/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #fff;
}

.btn-primary {
    background-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-edit {
    background-color: #5865f2;
}

.btn-edit:hover {
    background-color: #4752c4;
}

.btn-warning {
    background-color: #fee75c;
    color: #000;
}

.btn-warning:hover {
    background-color: #fede3a;
}

.btn-success {
    background-color: #57f287;
    color: #000;
}

.btn-success:hover {
    background-color: #43d974;
}

.btn-secondary:hover {
    background-color: var(--border);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
}

/* Password strength indicator */
.password-strength {
    margin-top: -4px;
    margin-bottom: 4px;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
}

.strength-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.strength-tips {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Auth page layout */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--bg-primary);
}

.auth-card {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 12px var(--shadow);
}

.auth-logo {
    display: block;
    width: 80px;
    height: 67px;
    margin: 0 auto 12px;
    background: url('/img/logo-icon.svg') center / contain no-repeat;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-card .auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-card .auth-link a {
    color: var(--accent);
    cursor: pointer;
}

/* Toast notifications.
 * Pinned to top-right (was bottom-right) so the stack doesn't overlap
 * the chat composer's Send button — chat-input grows vertically with
 * the textarea, so any bottom offset eventually crashes into it.
 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    max-width: 360px;
    animation: toast-in 0.3s ease-out;
    box-shadow: 0 4px 12px var(--shadow);
}

.toast-error {
    background-color: var(--danger);
}

.toast-success {
    background-color: #43b581;
}

.toast-info {
    background-color: var(--accent);
}

.toast-warning {
    background-color: #faa61a;
    color: #1a1a1a;
}

.toast-exit {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalOverlayFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background-color: var(--bg-elev);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px -16px rgba(0,0,0,0.6),
                0 0 0 1px rgba(255,255,255,0.03) inset;
    animation: modalSlideIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

/* Confirm dialog */
.confirm-modal {
    max-width: 420px;
}
.confirm-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-primary);
}
.confirm-modal-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    white-space: pre-line;
}
.confirm-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.confirm-modal-actions-stacked {
    flex-direction: column-reverse;
    align-items: stretch;
}
.confirm-modal-actions .btn {
    min-width: 96px;
}

/* Input row inside confirm-modal (for showPromptDialog). Sits between
   the body message and the action buttons. */
.confirm-modal-input-wrap {
    margin-bottom: 20px;
}
.confirm-modal-input-wrap .confirm-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
}

/* Image cropper */
.cropper-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cropper-container {
    position: relative;
    max-width: 90vw;
    max-height: 70vh;
}

.cropper-canvas {
    display: block;
    max-width: 90vw;
    max-height: 70vh;
    cursor: move;
}

.cropper-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.cropper-hint {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 8px;
}

/* Universal file preview modal */
.file-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fp-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
}

.fp-close:hover {
    opacity: 1;
}

.fp-content {
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-image {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

.fp-video {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 4px;
    background: #000;
}

.fp-pdf {
    width: 80vw;
    height: 75vh;
    border-radius: 4px;
    background: #fff;
}

.fp-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.fp-audio-icon {
    font-size: 64px;
}

.fp-audio {
    width: 400px;
    max-width: 90vw;
}

.fp-unknown {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    padding: 32px;
}

.fp-unknown-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.fp-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.fp-download {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.fp-download:hover {
    text-decoration: underline;
}

/* ─── Notify Banner ──────────────────────────────────────────────
   Persistent actionable notifications. See spec:
   docs/superpowers/specs/2026-04-15-notification-banner-design.md
*/

#notify-banner-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-notify);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 480px;
    width: 100%;
    pointer-events: none; /* click-through container; banners re-enable it */
}

#notify-banner-container .notify-banner {
    pointer-events: auto;
}

.notify-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    border-left: 4px solid var(--accent); /* default (info); overridden per type */
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.notify-banner.notify-banner-entered {
    opacity: 1;
    transform: translateY(0);
}

.notify-banner.notify-banner-exit {
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 150ms ease-in, transform 150ms ease-in;
}

/* Type variants — only border-left color differs. Icon content set in JS. */
.notify-banner-info    { border-left-color: var(--accent); }
.notify-banner-success { border-left-color: var(--success); }
.notify-banner-warning { border-left-color: var(--warning); }
.notify-banner-error   { border-left-color: var(--danger); }

.notify-banner-icon {
    flex: 0 0 20px;
    font-size: 16px;
    line-height: 20px;
    user-select: none;
}

.notify-banner-message {
    flex: 1 1 auto;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-word;
}

.notify-banner-action {
    flex: 0 0 auto;
    padding: 4px 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease;
}
.notify-banner-action:hover:not(:disabled) {
    background: var(--accent-hover);
}
.notify-banner-action-primary {
    background: var(--accent);
    font-weight: 600;
}
.notify-banner-action-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.notify-banner-dismiss {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.notify-banner-dismiss:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Disabled state (applied to action button after click for double-click guard) */
.notify-banner button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile — stretch to full width minus 8px each side */
@media (max-width: 768px) {
    #notify-banner-container {
        left: 8px;
        right: 8px;
        transform: none;
        max-width: none;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notify-banner,
    .notify-banner.notify-banner-exit {
        transition: none;
    }
}

/* ── NotifyLevelPicker (Stage 5b, actionable dropdown) ─────────── */

.notify-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: transparent;
}

.notify-picker {
    background: var(--bg-secondary, #2f3136);
    color: var(--text-primary, #dcddde);
    border: 1px solid var(--border-color, #202225);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 4px 0;
    min-width: 240px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    overflow: hidden;
}

.notify-picker--popover {
    position: absolute;
}

.notify-picker--sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    min-width: 0;
    border-radius: 12px 12px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 4px 0 12px;
}

.notify-picker-item {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    color: var(--text-primary, #dcddde);
    border: none;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
    width: 100%;
}

.notify-picker-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

/* Active row — subtle accent tint + accent-coloured text. Conveys the
   "current selection" without needing a left-column checkmark. */
.notify-picker-item.active {
    background: rgba(88, 101, 242, 0.12);
    color: var(--accent, #5865f2);
    font-weight: 500;
}

.notify-picker-item.active:hover {
    background: rgba(88, 101, 242, 0.18);
}

.notify-picker-item-glyph {
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.notify-picker-item-glyph svg {
    width: 18px;
    height: 18px;
    display: block;
}
.notify-picker-item.active .notify-picker-item-glyph {
    color: var(--accent, #5865f2);
}

.notify-picker-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notify-picker-separator {
    height: 1px;
    background: var(--border-color, #202225);
    margin: 4px 0;
}

@media (max-width: 599px) {
    /* Bottom-sheet rows get roomier tap targets */
    .notify-picker-item {
        padding: 12px 16px;
        font-size: 15px;
    }
    .notify-picker-separator {
        margin: 6px 0;
    }
}

/* ── iOS-style toggle switch ──────────────────────────────────────────────── */
.ios-toggle-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--text-normal) !important;
    margin-bottom: 0 !important;
}
.ios-toggle-row .ios-toggle-label {
    font-size: 18px;
    color: var(--text-normal);
}
.ios-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.ios-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.ios-toggle-track {
    width: 44px;
    height: 26px;
    background: #ed4245;
    border-radius: 13px;
    transition: background 0.2s ease;
    position: relative;
    box-shadow: 0 0 0 2px rgba(0,0,0,.25), inset 0 1px 2px rgba(0,0,0,.2);
}
.ios-toggle-track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.ios-toggle input:checked + .ios-toggle-track {
    background: #3ba55d;
}
.ios-toggle input:checked + .ios-toggle-track::after {
    transform: translateX(18px);
}

/* ── Upload circular progress overlay ─────────────────────────────────── */
.upload-circular-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    pointer-events: none;
}
.upload-circular-progress.paused circle:last-of-type {
    stroke: #aaa;
}
/* Smooth fill animation between progress updates. Especially nice for the
   dedup short-circuit (0 → 100 % in one call) which now sweeps in over
   ~350 ms instead of snapping. ease-out so the visual finish feels
   confirmed rather than abrupt. */
.upload-circular-fill {
    transition: stroke-dashoffset 0.35s ease-out;
}
/* Finalizing state: chunks done, server is assembling the file. The ring
   creeps slowly from 95 % to ~99 % over ~4 s — long enough to feel
   "almost there" for the typical 1-3 s server-side wait, but the long
   linear easing means even a slower finalize doesn't visibly stall.
   When onProgress(1) lands the .finalizing class drops off, the
   transition reverts to the short ease-out (above), and the ring snaps
   up to 100 %. Text is blanked by the JS path during finalize so no
   stuck number is visible — the moving ring is the indicator. */
.upload-circular-progress.finalizing .upload-circular-fill {
    transition: stroke-dashoffset 4s linear;
}

/* Completion: at 100 % the checkmark fades + draws itself. No text to
   swap out — the indicator was simplified to ring + check only after
   percent numbers proved distracting (flashed during dedup, sat
   visibly empty during finalize creep). Stroke-draw delay 0.10 s lets
   the ring's 0.35 s sweep get a head start so the visual hand-off
   reads ring → check rather than both at once. */
.upload-circular-check {
    opacity: 0;
    transition: opacity 0.12s ease-out, stroke-dashoffset 0.30s ease-out;
}
.upload-circular-progress.complete .upload-circular-check {
    opacity: 1;
    stroke-dashoffset: 0;
    transition: opacity 0.12s ease-out 0.08s, stroke-dashoffset 0.30s ease-out 0.10s;
}
.file-preview-img { position: relative; }
.file-preview-img.uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    border-radius: inherit;
}

/* ── Upload retry button ───────────────────────────────────────────────── */
.upload-retry-btn {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.upload-retry-btn:hover { background: rgba(0,0,0,0.9); }

/* Disable send button while uploads pending */
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================================
   v2 EXPANDED AUDIO PLAYER — full-screen Now Playing overlay.
   Rendered by frontend/js/components/expanded-audio-player.js. Sits above
   chat layout, ниже modal'ов. body.has-player-expanded скрывает mini-player.
   Источник дизайна: tmp/design/freescord-v2-app-prototype.html (.player-expanded).
   ============================================================================ */
.player-expanded {
    position: fixed; inset: 0;
    z-index: 1480;
    background: var(--bg-base);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 280ms ease;
}
body.has-player-expanded .player-expanded {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
/* Когда expanded виден — mini-player уезжает вниз. Это даёт singular-focus
   на одном плеере: либо expanded, либо mini, не оба сразу. */
body.has-player-expanded .mini-player {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* На admin SPA-маршрутах глобальный плеер всегда скрыт — админ-сессия
   изолирована от user-сессии того же браузера. `:has()` ловит присутствие
   .admin-layout в DOM независимо от того, где он отрисован. */
body:has(.admin-layout) .mini-player,
body:has(.admin-layout) .player-expanded {
    display: none !important;
}

.player-expanded .pe-bg {
    position: absolute; inset: -10%;
    background-size: cover; background-position: center;
    filter: blur(80px) saturate(140%) brightness(0.35);
    z-index: 0;
}
.player-expanded .pe-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11,12,15,0.45), rgba(11,12,15,0.85));
}
.player-expanded .pe-hdr {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    color: #fff;
}
.player-expanded .pe-hdr-l { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.player-expanded .pe-hdr-source-label {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.player-expanded .pe-hdr-source-name {
    font-size: 14px; font-weight: 800;
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 360px;
}
.player-expanded .pe-hdr-actions { display: flex; gap: 6px; }
.player-expanded .pe-hdr-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: none;
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
    backdrop-filter: blur(6px);
}
.player-expanded .pe-hdr-btn:hover { background: rgba(255,255,255,0.12); transform: scale(1.05); }

.player-expanded .pe-body {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.85fr);
    gap: 32px;
    padding: 8px 40px 28px;
    overflow: hidden;
    color: #fff;
}
.player-expanded .pe-side {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 18px; min-width: 0;
}
.player-expanded .pe-cover {
    width: min(380px, 38vw);
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    background-size: cover; background-position: center;
    background-color: var(--bg-tertiary);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.7),
                inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: transform var(--transition-medium), filter var(--transition-medium);
}
.player-expanded.is-paused .pe-cover {
    transform: scale(0.92);
    filter: brightness(0.7);
}
.player-expanded .pe-meta { width: 100%; max-width: 480px; }
.player-expanded .pe-title-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.player-expanded .pe-title {
    font-size: 26px; font-weight: 800;
    letter-spacing: -0.01em; line-height: 1.15;
}
.player-expanded .pe-artist {
    font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px;
}
.player-expanded .pe-scrub-wrap { width: 100%; max-width: 480px; }
.player-expanded .pe-scrub {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}
.player-expanded .pe-scrub-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: #fff;
    border-radius: 2px;
    transition: width 80ms linear;
}
.player-expanded .pe-scrub-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.player-expanded .pe-scrub-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 3px 7px;
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border-radius: 4px;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 3;
}
.player-expanded .pe-scrub-tooltip[hidden] { display: none; }
.player-expanded .pe-time-row {
    display: flex; justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px; color: rgba(255,255,255,0.6);
    margin-top: 6px;
}
.player-expanded .pe-controls {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    margin-top: 8px;
}
.player-expanded .pe-tx-btn {
    width: 44px; height: 44px;
    border-radius: 50%; border: none;
    background: transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
}
.player-expanded .pe-tx-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.player-expanded .pe-tx-btn.toggle.is-on { color: var(--accent); }
.player-expanded .pe-tx-btn svg { width: 20px; height: 20px; }
.player-expanded .pe-tx-btn.primary {
    width: 64px; height: 64px;
    background: #fff; color: var(--bg-base);
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.5);
}
.player-expanded .pe-tx-btn.primary:hover {
    background: #fff; transform: scale(1.05); color: var(--bg-base);
}
.player-expanded .pe-tx-btn.primary svg { width: 26px; height: 26px; }
.player-expanded .pe-utility {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    flex-wrap: wrap; min-height: 32px;
}
.player-expanded .pe-util-btn {
    height: 32px; padding: 0 12px;
    border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    display: inline-flex; align-items: center; gap: 6px;
    transition: var(--transition-fast);
}
.player-expanded .pe-util-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.player-expanded .pe-util-btn.is-on {
    background: var(--accent-tint-strong); color: var(--accent);
    border-color: rgba(88,101,242,0.4);
}
.player-expanded .pe-util-btn svg { width: 13px; height: 13px; }
.player-expanded .pe-source-key {
    font-family: var(--font-mono);
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.player-expanded .pe-queue {
    background: rgba(20, 22, 26, 0.5);
    backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.player-expanded .pe-queue-h {
    padding: 16px 18px 8px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
}
.player-expanded .pe-queue-h h4 {
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    margin: 0;
}
.player-expanded .pe-queue-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(255,255,255,0.45);
}
.player-expanded .pe-queue-list {
    flex: 1; overflow-y: auto;
    padding: 4px 8px 16px;
    scrollbar-width: thin;
}
.player-expanded .pe-queue-list::-webkit-scrollbar { width: 6px; }
.player-expanded .pe-queue-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
}

/* Queue row — clickable trek inside expanded player queue. Layout mirrors
   mini-player queue sheet (.mac-row) but adapted to wider expanded sidebar.
   Vadim 2026-05-20 — раньше эти rules не существовали и треки рендерились
   как plain divs без отступов / hover / active state. */
.player-expanded .queue-row {
    display: grid;
    grid-template-columns: 24px 36px 1fr auto 28px 28px;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.player-expanded .queue-row:hover {
    background: rgba(255,255,255,0.05);
}
.player-expanded .queue-row.is-active {
    background: rgba(88,101,242,0.12);
}
.player-expanded .queue-row.is-active .queue-row-title {
    color: var(--accent);
}
.player-expanded .queue-row-num {
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    text-align: center;
    width: 100%;
}
.player-expanded .queue-row-num .mac-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 1.5px;
    height: 12px;
    width: 12px;
}
.player-expanded .queue-row-num .mac-eq span {
    width: 2.5px;
    background: var(--accent);
    border-radius: 1px;
    animation: peQueueEq 0.85s ease-in-out infinite alternate;
}
.player-expanded .queue-row-num .mac-eq span:nth-child(1) { height: 50%; animation-delay: -0.1s; }
.player-expanded .queue-row-num .mac-eq span:nth-child(2) { height: 100%; animation-delay: -0.35s; }
.player-expanded .queue-row-num .mac-eq span:nth-child(3) { height: 35%; animation-delay: -0.2s; }
@keyframes peQueueEq {
    0%   { transform: scaleY(0.5); }
    100% { transform: scaleY(1); }
}
.player-expanded.is-paused .queue-row.is-active .mac-eq span {
    animation-play-state: paused;
}
.player-expanded .queue-row-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.04);
    flex-shrink: 0;
}
.player-expanded .queue-row-info { min-width: 0; }
.player-expanded .queue-row-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}
.player-expanded .queue-row-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.player-expanded .queue-row-dur {
    color: var(--text-muted);
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.player-expanded .queue-row-heart,
.player-expanded .queue-row-menu {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.player-expanded .queue-row:hover .queue-row-heart,
.player-expanded .queue-row:hover .queue-row-menu {
    opacity: 1;
}
.player-expanded .queue-row-heart:hover,
.player-expanded .queue-row-menu:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}
.player-expanded .queue-row-heart.is-saved {
    color: var(--accent);
    opacity: 1;
}

/* ============================================================================
   v2 VIDEO PIP — floating Picture-in-Picture для видео из медиатеки.
   Не путать с .video-player (inline <video> в чате). Источник:
   tmp/design/freescord-v2-app-prototype.html → .video-player (PiP-вариант).
   ============================================================================ */
.video-pip {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    box-shadow:
        0 24px 60px -12px rgba(0,0,0,0.6),
        0 0 0 1px var(--border-faint);
    z-index: 1500;
    overflow: hidden;
    transform: translateY(120%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}
body.has-video-pip .video-pip {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.video-pip .vp-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000 center/cover;
    cursor: pointer;
    overflow: hidden;
}
.video-pip .vp-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}
.video-pip .vp-frame::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 50%;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65));
    pointer-events: none;
    z-index: 1;
}
.video-pip .vp-play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
    opacity: 0;
    z-index: 2;
}
.video-pip:hover .vp-play-overlay,
.video-pip.is-paused .vp-play-overlay {
    opacity: 1;
}
.video-pip .vp-play-overlay:hover {
    background: rgba(0,0,0,0.8);
    transform: translate(-50%, -50%) scale(1.05);
}
.video-pip .vp-corner-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 3;
}
.video-pip:hover .vp-corner-actions { opacity: 1; }
.video-pip .vp-corner-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    color: #fff; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
}
.video-pip .vp-corner-btn:hover { background: rgba(0,0,0,0.85); }

.video-pip .vp-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: rgba(255,255,255,0.12);
    z-index: 2;
}
.video-pip .vp-progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 80ms linear;
}
.video-pip .vp-time-overlay {
    position: absolute;
    left: 12px;
    bottom: 12px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    z-index: 2;
}

.video-pip .vp-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
}
.video-pip .vp-meta { min-width: 0; }
.video-pip .vp-title {
    font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-pip .vp-author {
    font-size: 11px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.video-pip .vp-tx-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition-fast);
}
.video-pip .vp-tx-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.video-pip .vp-tx-btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px -4px rgba(88,101,242,0.55);
}
.video-pip .vp-tx-btn.primary:hover { background: var(--accent-hover); }
.video-pip .vp-tx-btn svg { width: 14px; height: 14px; }
.video-pip .vp-tx-btn.primary svg { width: 16px; height: 16px; }

/* ============================================================================
   v2 LIBRARY COMPOSER PICKER — модалка "Медиатека · вставить в сообщение".
   ДОСЛОВНАЯ копия .picker CSS из tmp/design/freescord-v2-app-prototype.html.
   Никаких адаптаций. Mounted by library-composer-picker.js.
   ============================================================================ */
.library-composer-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: modalOverlayFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.library-composer-picker-overlay .modal-content.picker {
    width: 100%;
    max-width: 720px;
    max-height: 700px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 30px 80px -20px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: modalSlideIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.library-composer-picker-overlay .picker-h {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-faint);
    display: flex;
    align-items: center;
    gap: 12px;
}
.library-composer-picker-overlay .picker-h h3 {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.library-composer-picker-overlay .queue-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-faint);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.library-composer-picker-overlay .queue-sheet-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.10);
}
.library-composer-picker-overlay .picker-tabs {
    padding: 12px 20px 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.library-composer-picker-overlay .picker-tab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition-fast);
}
.library-composer-picker-overlay .picker-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
.library-composer-picker-overlay .picker-tab.is-active {
    background: var(--accent-tint-strong);
    color: var(--accent);
    border-color: rgba(88,101,242,0.2);
}
.library-composer-picker-overlay .picker-search {
    padding: 12px 20px;
}
.library-composer-picker-overlay .picker-search input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-faint);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    padding: 9px 14px 9px 38px;
    border-radius: var(--radius-pill);
    outline: none;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23949ba4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px 50%;
    box-sizing: border-box;
}
.library-composer-picker-overlay .picker-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint-soft);
}
.library-composer-picker-overlay [data-lcp-body] {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}
.library-composer-picker-overlay [data-lcp-body]::-webkit-scrollbar { width: 6px; }
.library-composer-picker-overlay [data-lcp-body]::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 6px; }
.library-composer-picker-overlay .picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 12px;
}
.library-composer-picker-overlay .picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 4px 20px 12px;
}
.library-composer-picker-overlay .picker-tile {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-fast);
    position: relative;
    text-align: left;
    color: var(--text-primary);
    font-family: inherit;
}
.library-composer-picker-overlay .picker-tile:hover { background: var(--bg-elev); }
.library-composer-picker-overlay .picker-tile.is-selected {
    border-color: var(--accent);
    background: var(--accent-tint-soft);
}
.library-composer-picker-overlay .picker-tile.is-selected::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--accent);
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 0 3px var(--bg-secondary);
}
.library-composer-picker-overlay .picker-tile-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-input);
    margin-bottom: 8px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.library-composer-picker-overlay .picker-tile.video .picker-tile-cover { aspect-ratio: 16/9; }
/* Composite-обложка плейлиста (4 квадранта из preview_tracks). Лежит
 * внутри picker-tile-cover как абсолютная сетка; tile-cover сохраняет
 * свой aspect-ratio и border-radius — нужно только обнулить background
 * чтобы не просвечивал accent под пустыми ячейками. */
.library-composer-picker-overlay .lcp-quad-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: inherit;
}
.library-composer-picker-overlay .lcp-quad {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.library-composer-picker-overlay .picker-tile-name {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.library-composer-picker-overlay .picker-tile-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}
.library-composer-picker-overlay .picker-track-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    margin: 2px 4px;
    border: none;
    background: transparent;
    width: calc(100% - 8px);
    text-align: left;
    color: inherit;
    font-family: inherit;
}
.library-composer-picker-overlay .picker-track-row:hover { background: rgba(255,255,255,0.04); }
.library-composer-picker-overlay .picker-track-row.is-selected {
    background: var(--accent-tint-strong);
    box-shadow: inset 0 0 0 1px rgba(88,101,242,0.3);
}
.library-composer-picker-overlay .picker-track-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}
.library-composer-picker-overlay .picker-track-info { min-width: 0; }
.library-composer-picker-overlay .picker-track-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.library-composer-picker-overlay .picker-track-artist {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.library-composer-picker-overlay .picker-track-dur {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.library-composer-picker-overlay .picker-bottom {
    border-top: 1px solid var(--border-faint);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0,0,0,0.18);
}
.library-composer-picker-overlay .picker-bottom-target {
    font-size: 12px;
    color: var(--text-muted);
}
.library-composer-picker-overlay .picker-bottom-target b {
    color: var(--text-primary);
    font-weight: 700;
}
.library-composer-picker-overlay .btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: 0 6px 18px -6px rgba(88,101,242,0.6);
}
.library-composer-picker-overlay .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.library-composer-picker-overlay .btn-primary:disabled {
    background: var(--bg-elev);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.library-composer-picker-overlay .picker-empty-soon {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.library-composer-picker-overlay .picker-empty-soon p { margin: 0; max-width: 360px; margin: 0 auto; line-height: 1.5; }

/* Highlighted menu item — "Медиатека" в composer-+ menu. Иконка accent
   ТОЛЬКО на hover (раньше была always-accent — выглядело "всегда выбрано"). */
.input-add-menu-item.is-highlighted:hover {
    background: var(--accent-tint-soft);
}
.input-add-menu-item.is-highlighted:hover .icon-wrap,
.input-add-menu-item.is-highlighted:hover svg {
    color: var(--accent);
}

/* ============================================================================
   v2 SEND DIALOG — Telegram-style picker для "Отправить плейлист в...".
   ДОСЛОВНАЯ копия prototype CSS из tmp/design/freescord-v2-prototype.html.
   Никаких адаптаций. Rendered by library-send-dialog.js.
   ============================================================================ */
.library-send-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: modalOverlayFadeIn 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.send-dialog {
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    display: flex;
    flex-direction: column;
    max-height: 700px;
    animation: modalSlideIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.send-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-faint);
    display: flex;
    align-items: center;
    gap: 12px;
}
.send-header-title { flex: 1; min-width: 0; }
.send-header-title h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.send-header-title small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
    margin-top: 3px;
    letter-spacing: 0.04em;
}
.send-multi-toggle {
    background: transparent;
    border: 1px solid var(--border-faint);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.send-multi-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.send-multi-toggle.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.send-search-wrap { padding: 12px 16px 4px; }
.send-search {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-faint);
    color: var(--text-primary);
    font: inherit;
    font-size: 13px;
    padding: 10px 14px 10px 38px;
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23949ba4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px 50%;
    box-sizing: border-box;
}
.send-search::placeholder { color: var(--text-muted); }
.send-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint-strong);
}

.send-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 8px;
}
.send-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    background: var(--accent-tint-strong);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    animation: sendChipIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.send-chip-x {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    padding: 0;
    line-height: 1;
}
.send-chip-x:hover { background: rgba(255,255,255,0.18); }
@keyframes sendChipIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.send-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 12px;
}
.send-list::-webkit-scrollbar { width: 6px; }
.send-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
}

.send-section-label {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 14px 6px;
}
.send-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    margin: 2px 4px;
}
.send-row:hover { background: rgba(255,255,255,0.04); }
.send-row.is-selected {
    background: var(--accent-tint-strong);
    box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.3);
}
.send-row.is-selected::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--accent);
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}
.send-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    font-size: 14px;
}
.send-row-icon.is-saved {
    background: linear-gradient(135deg, #5865f2, #8a7eff);
    color: #fff;
}
.send-row-icon.is-server-1 {
    background: linear-gradient(135deg, #f97316, #f43f5e);
    color: #fff;
    font-weight: 800;
}
.send-row-icon.is-server-2 {
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    color: #fff;
    font-weight: 800;
}
.send-row-icon.is-server-3 {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    color: #fff;
    font-weight: 800;
}
.send-row-icon.is-channel {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}
.send-row-info { min-width: 0; }
.send-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.send-row-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.send-row .send-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}
.send-row.is-expanded .send-chevron { transform: rotate(180deg); }

.send-server-children {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 1px dashed var(--border-faint);
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition-slow);
}
.send-server-children.is-shown { max-height: 700px; }
.send-server-children .send-row { padding: 6px 12px; }
.send-server-children .send-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 12px;
}

.send-section-empty-soon {
    padding: 12px 16px 8px;
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-md);
    margin: 0 8px 6px;
}
.send-section-empty-soon .pill-soon {
    font-size: 9px;
    font-family: var(--font-mono);
    background: var(--bg-elev);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.send-bottom {
    border-top: 1px solid var(--border-faint);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(0,0,0,0.18);
}
.send-bottom-target {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.send-bottom-target b { color: var(--text-primary); font-weight: 700; }
.send-confirm {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    box-shadow: 0 6px 18px -6px rgba(88, 101, 242, 0.55);
}
.send-confirm:hover { background: var(--accent-hover); }
.send-confirm:active { transform: scale(0.97); }
.send-confirm:disabled {
    background: var(--bg-elev);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Blocked message collapsed stub */
.message-blocked-collapsed {
    padding: 6px 12px;
    color: var(--text-muted);
    font-style: italic;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.message-blocked-collapsed .link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    font-style: normal;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.message-blocked-collapsed .link-btn:hover {
    color: var(--accent-hover, var(--accent));
}
