        :root {
            --bg: #f7f7f8;
            --sidebar-bg: #f9f9fa;
            --surface: #ffffff;
            --surface-2: #f4f4f6;
            --surface-3: #ececef;
            --border: #e5e5e9;
            --border-strong: #d4d4da;
            --text: #1a1a1e;
            --text-muted: #68686f;
            --text-soft: #97979e;
            --primary: #6366f1;
            --primary-hover: #4f46e5;
            --primary-soft: #eef2ff;
            --accent: #f59e0b;
            --success: #10b981;
            --danger: #ef4444;
            --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
            --shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
            --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);
            --radius: 14px;
            --radius-lg: 18px;
            --radius-pill: 999px;
            --brand-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
            --user-bubble-bg: #1a1a1e;
            --user-bubble-text: #ffffff;
            --sidebar-width: 268px;
            color-scheme: light;
        }

        :root[data-theme="dark"] {
            --bg: #212123;
            --sidebar-bg: #171718;
            --surface: #2a2a2d;
            --surface-2: #201f21;
            --surface-3: #38383c;
            --border: #38383c;
            --border-strong: #4c4c52;
            --text: #ececed;
            --text-muted: #a9a9b0;
            --text-soft: #7a7a81;
            --primary: #8183f6;
            --primary-hover: #9a9bf8;
            --primary-soft: rgba(129, 131, 246, 0.18);
            --accent: #f5a524;
            --success: #34d399;
            --danger: #f87171;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
            --shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
            --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
            --user-bubble-bg: #3a3a3f;
            --user-bubble-text: #ececed;
            color-scheme: dark;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html, body {
            height: 100%;
            width: 100%;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            font-feature-settings: 'cv11', 'ss01';
        }

        :lang(kn), .kn {
            font-family: 'Noto Sans Kannada', 'Inter', sans-serif;
        }

        body {
            position: relative;
        }

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.001ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.001ms !important;
            }
            /* Zeroing animations is not enough: the message list also
               animates every scroll via scroll-behavior. Jump instead. */
            #chat-messages {
                scroll-behavior: auto;
            }
        }

        /* ========= App shell (sidebar + main column) ========= */
        .app-shell {
            /* Pinned to the visible area: 100dvh does NOT shrink when the mobile
               on-screen keyboard opens, which would hide the composer and the
               newest messages behind it. --app-height is kept in sync with
               window.visualViewport by syncAppHeight() in app.js; the 100dvh
               fallback applies before that first runs (and if JS is disabled). */
            position: fixed;
            /* --app-offset-top realigns the shell when iOS shifts the visual
               viewport down inside the layout viewport to reveal the focused
               input; without it the whole app drifts above the visible area
               while the keyboard is open. Also synced by syncAppHeight(). */
            top: var(--app-offset-top, 0px);
            left: 0;
            width: 100dvw;
            height: var(--app-height, 100dvh);
            display: flex;
            overflow: hidden;
            background: var(--bg);
        }

        .brand-mark {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: var(--brand-gradient);
            color: white;
            font-family: 'Noto Sans Kannada', sans-serif;
            font-size: 22px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
        }

        /* ========= Sidebar ========= */
        .sidebar {
            width: var(--sidebar-width);
            flex-shrink: 0;
            background: var(--sidebar-bg);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .sidebar-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 16px 14px 8px;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }

        .brand-text {
            min-width: 0;
        }

        .sidebar h1 {
            margin: 0;
            font-size: 1.02rem;
            font-weight: 700;
            letter-spacing: -0.01em;
            line-height: 1.2;
            color: var(--text);
        }

        .tagline {
            margin: 2px 0 0 0;
            font-size: 0.72rem;
            color: var(--text-muted);
            font-weight: 400;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-close-btn {
            display: none;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 8px;
            width: 32px;
            height: 32px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex-shrink: 0;
        }

        .sidebar-close-btn:hover {
            background: var(--surface-3);
            color: var(--text);
        }

        .new-chat-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 8px 14px 12px;
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 10px 12px;
            font-size: 13.5px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.18s;
            font-family: inherit;
            box-shadow: var(--shadow-sm);
        }

        .new-chat-btn:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary);
        }

        /* ========= Mode tabs (sidebar nav) ========= */
        .mode-tabs {
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding: 0 10px;
            flex-shrink: 0;
        }

        .mode-tab {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            text-align: left;
            background: transparent;
            color: var(--text-muted);
            border: 1px solid transparent;
            border-radius: 10px;
            padding: 9px 10px;
            font-size: 13.5px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
            font-family: inherit;
            box-shadow: none;
        }

        .mode-tab-emoji {
            font-size: 15px;
            flex-shrink: 0;
        }

        .mode-tab:hover {
            background: var(--surface-3);
            color: var(--text);
        }

        .mode-tab.is-active {
            background: var(--primary-soft);
            color: var(--primary);
            font-weight: 600;
        }

        .mode-tab.is-active:hover {
            background: var(--primary-soft);
            color: var(--primary);
        }

        /* ===== Session conversation list ===== */
        .sidebar-section-label {
            padding: 14px 16px 4px;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--text-soft);
            flex-shrink: 0;
        }

        .conversation-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 0 10px 4px;
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .conversation-list::-webkit-scrollbar { width: 7px; }
        .conversation-list::-webkit-scrollbar-thumb {
            background: var(--border-strong);
            border-radius: 4px;
        }

        .conv-item {
            display: flex;
            align-items: center;
            border-radius: 9px;
            transition: background 0.15s;
        }

        .conv-item:hover { background: var(--surface-3); }

        .conv-item.is-active { background: var(--primary-soft); }

        .conv-item-btn {
            flex: 1;
            min-width: 0;
            text-align: left;
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 13px;
            font-weight: 500;
            padding: 9px 8px 9px 10px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .conv-item:hover .conv-item-btn,
        .conv-item.is-active .conv-item-btn { color: var(--text); }

        .conv-item.is-active .conv-item-btn { font-weight: 600; }

        .conv-item-del {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            /* 36px visual + the ::before bleed = a ≥44px touch target.
               These were 28px and force-visible on touch — a heavy mis-tap
               risk on a destructive control. */
            width: 36px;
            height: 36px;
            margin-right: 2px;
            position: relative;
            background: transparent;
            border: none;
            border-radius: 7px;
            color: var(--text-soft);
            cursor: pointer;
            opacity: 0;
            transition: all 0.15s;
        }

        /* Invisible hit-area extension: grows the touch target to 44px
           without inflating the row layout. */
        .conv-item-del::before,
        .pdf-chip-remove::before,
        .close-button::before {
            content: '';
            position: absolute;
            inset: -4px;
        }

        .conv-item:hover .conv-item-del,
        .conv-item.is-active .conv-item-del { opacity: 1; }

        .conv-item-del:hover {
            background: color-mix(in srgb, var(--danger) 16%, transparent);
            color: var(--danger);
        }

        /* Touch devices have no hover — keep delete affordance visible */
        @media (hover: none) {
            .conv-item-del { opacity: 1; }
        }

        .sidebar-footer {
            margin-top: auto;
            padding: 10px;
            border-top: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .sidebar-footer-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            text-align: left;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 10px;
            padding: 9px 10px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
            box-shadow: none;
        }

        .sidebar-footer-btn:hover {
            background: var(--surface-3);
            color: var(--text);
        }

        .sidebar-footer-btn .icon-moon { display: none; }
        :root[data-theme="dark"] .sidebar-footer-btn .icon-moon { display: inline-flex; }
        :root[data-theme="dark"] .sidebar-footer-btn .icon-sun { display: none; }

        .sidebar-footer-link {
            padding: 8px 10px;
            font-size: 12.5px;
            font-weight: 500;
            color: var(--text-muted);
            text-decoration: none;
            border-radius: 10px;
            transition: all 0.15s;
        }

        .sidebar-footer-link:hover {
            background: var(--surface-3);
            color: var(--text);
        }

        .sidebar-copyright {
            padding: 8px 10px 2px;
            font-size: 11px;
            color: var(--text-soft);
        }

        .sidebar-backdrop {
            display: none;
        }

        /* ========= Main column ========= */
        #chat-container {
            flex: 1;
            min-width: 0;
            height: 100%;
            background: var(--surface);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        #mobile-topbar {
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 10px 12px;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
        }

        .mobile-topbar-brand {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--text);
        }

        .brand-mark-sm {
            width: 26px;
            height: 26px;
            border-radius: 8px;
            font-size: 15px;
        }

        .icon-btn-sm {
            border: 1px solid var(--border);
            border-radius: 10px;
            width: 34px;
            height: 34px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.18s;
            font-family: inherit;
            padding: 0;
            box-shadow: none;
        }

        .mobile-topbar-btn {
            background: var(--surface);
            color: var(--text-muted);
        }

        .mobile-topbar-btn:hover {
            background: var(--surface-3);
            color: var(--text);
        }

        @media (max-width: 880px) {
            .sidebar {
                position: fixed;
                /* Visual-viewport geometry (same pattern as .app-shell): with
                   the keyboard open, inset-based sizing stretched the drawer
                   into the layout viewport and its footer (About / theme
                   toggle) sat behind the keyboard. */
                top: var(--app-offset-top, 0px);
                left: 0;
                height: var(--app-height, 100dvh);
                z-index: 50;
                width: min(var(--sidebar-width), 82vw);
                transform: translateX(-100%);
                transition: transform 0.22s ease;
                box-shadow: var(--shadow-lg);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .sidebar-close-btn {
                display: flex;
            }
            .sidebar-backdrop {
                display: none;
                position: fixed;
                top: var(--app-offset-top, 0px);
                left: 0;
                width: 100dvw;
                height: var(--app-height, 100dvh);
                background: rgba(0, 0, 0, 0.45);
                z-index: 45;
            }
            .sidebar-backdrop.show {
                display: block;
            }
            #mobile-topbar {
                display: flex;
            }
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* ========= Chat messages ========= */
        #chat-messages {
            flex: 1;
            overflow-y: auto;
            /* Full-bleed background; readable column centered at ~880px via
               symmetric horizontal padding that grows on wide screens. */
            padding: 20px max(20px, calc((100% - 880px) / 2));
            background: var(--bg);
            -webkit-overflow-scrolling: touch;
            min-height: 200px;
            scroll-behavior: smooth;
        }

        #chat-messages::-webkit-scrollbar {
            width: 8px;
        }
        #chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }
        #chat-messages::-webkit-scrollbar-thumb {
            background: var(--border-strong);
            border-radius: 4px;
        }
        #chat-messages::-webkit-scrollbar-thumb:hover {
            background: var(--text-soft);
        }

        /* Empty state */
        .empty-state {
            max-width: 520px;
            margin: 32px auto;
            text-align: center;
            padding: 24px;
        }

        .empty-state-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 16px;
            border-radius: 18px;
            background: var(--brand-gradient);
            color: white;
            font-family: 'Noto Sans Kannada', sans-serif;
            font-size: 36px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
        }

        .empty-state h2 {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 8px;
            letter-spacing: -0.01em;
        }

        .empty-state p {
            font-size: 0.95rem;
            color: var(--text-muted);
            line-height: 1.5;
            margin-bottom: 20px;
        }

        .suggestion-chips {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
        }

        .suggestion-chip {
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: var(--radius-pill);
            padding: 8px 14px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.18s;
            font-family: inherit;
            box-shadow: var(--shadow-sm);
        }

        .suggestion-chip:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow);
        }

        .feature-pills {
            list-style: none;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 6px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border);
        }

        .feature-pill {
            background: var(--surface-2);
            color: var(--text-muted);
            border: 1px solid var(--border);
            border-radius: var(--radius-pill);
            padding: 5px 11px;
            font-size: 11.5px;
            font-weight: 500;
        }

        /* Messages */
        @keyframes msgIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .message {
            padding: 12px 16px;
            line-height: 1.55;
            font-size: 15px;
            max-width: min(78%, 720px);
            word-wrap: break-word;
            white-space: pre-wrap;
            box-shadow: var(--shadow-sm);
            position: relative;
            margin: 10px 0;
            animation: msgIn 0.22s ease-out;
            clear: both;
        }

        .user-message {
            background: var(--user-bubble-bg);
            color: var(--user-bubble-text);
            border-radius: 18px 18px 4px 18px;
            margin-left: auto;
            margin-right: 0;
        }

        .assistant-message {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 18px 18px 18px 4px;
            color: var(--text);
            margin-right: auto;
            margin-left: 0;
        }

        /* Failures render as a distinct bubble — never styled as an AI reply.
           Not persisted, so it disappears on switch/reload. */
        .error-message {
            background: color-mix(in srgb, var(--danger) 9%, var(--surface));
            border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
            border-radius: 18px 18px 18px 4px;
            color: var(--text);
            margin-right: auto;
            margin-left: 0;
        }

        .retry-button {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin-top: 8px;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: 600;
            color: var(--danger);
            background: transparent;
            border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
            border-radius: var(--radius-pill);
            cursor: pointer;
            transition: background 0.15s;
        }

        .retry-button:hover {
            background: color-mix(in srgb, var(--danger) 12%, transparent);
        }

        /* Action bar: a row that sits below the assistant reply. On devices
           with a real pointer it fades in on hover/focus (ChatGPT-style);
           on touch devices it stays visible since there's no hover. */
        .button-container {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
            transition: opacity 0.18s ease;
        }

        @media (hover: hover) {
            .button-container {
                opacity: 0;
            }
            .message:hover .button-container,
            .button-container:focus-within {
                opacity: 1;
            }
        }

        .voice-button, .transliterate-button, .copy-button, .regenerate-button, .edit-button {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: transparent;
            color: var(--text-muted);
            border: 1px solid var(--border);
            border-radius: var(--radius-pill);
            padding: 4px 10px;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s;
            box-shadow: none;
            font-family: inherit;
        }

        .regenerate-button:hover, .edit-button:hover {
            background: var(--surface-3);
            color: var(--text);
            border-color: var(--border-strong);
        }

        /* Edit affordance on the most recent user message. Same fade-in-on-hover
           behaviour as the assistant action bar. */
        .user-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 6px;
            transition: opacity 0.18s ease;
        }

        @media (hover: hover) {
            .user-actions { opacity: 0; }
            .user-message:hover .user-actions,
            .user-actions:focus-within { opacity: 1; }
        }

        /* Inline editor that replaces a user bubble while editing. */
        .edit-box { display: flex; flex-direction: column; gap: 8px; min-width: min(74vw, 420px); }

        .edit-textarea {
            width: 100%;
            resize: none;
            border: 1px solid var(--border-strong);
            border-radius: 12px;
            background: var(--surface);
            color: var(--text);
            padding: 10px 12px;
            font: inherit;
            font-size: 14.5px;
            line-height: 1.5;
            max-height: 160px;
            overflow-y: auto;
        }

        .edit-actions { display: flex; gap: 8px; justify-content: flex-end; }

        .edit-save, .edit-cancel {
            border-radius: var(--radius-pill);
            padding: 5px 14px;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            border: 1px solid var(--border);
            transition: all 0.15s;
        }

        .edit-save { background: var(--primary); color: #fff; border-color: var(--primary); }
        .edit-save:hover { background: var(--primary-hover); }
        .edit-cancel { background: transparent; color: var(--text-muted); }
        .edit-cancel:hover { background: var(--surface-3); color: var(--text); }

        /* Thumbs feedback — sits in the assistant action bar. */
        .feedback-group { display: inline-flex; gap: 2px; margin-left: auto; }

        .feedback-button {
            background: transparent;
            border: none;
            border-radius: var(--radius-pill);
            padding: 4px 7px;
            font-size: 13px;
            line-height: 1;
            cursor: pointer;
            opacity: 0.6;
            transition: opacity 0.15s, background 0.15s, transform 0.1s;
        }

        .feedback-button:hover:not(:disabled) { opacity: 1; background: var(--surface-3); }
        .feedback-button:active:not(:disabled) { transform: scale(0.9); }
        .feedback-button:disabled { cursor: default; }
        .feedback-button.chosen { opacity: 1; }
        .feedback-up.chosen { background: color-mix(in srgb, var(--success) 20%, transparent); }
        .feedback-down.chosen { background: color-mix(in srgb, var(--danger) 18%, transparent); }

        /* Suggested follow-up questions below the newest reply. */
        .followups {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin: 4px 0 10px;
            animation: msgIn 0.22s ease-out;
        }

        .followup-chip {
            background: var(--surface);
            border: 1px solid var(--border);
            color: var(--text-muted);
            border-radius: var(--radius-pill);
            padding: 7px 14px;
            font-size: 13px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            text-align: left;
            transition: all 0.15s;
        }

        .followup-chip:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary);
        }

        .voice-button:hover {
            background: var(--primary-soft);
            color: var(--primary);
            border-color: var(--primary);
        }

        .transliterate-button:hover {
            background: color-mix(in srgb, var(--success) 14%, transparent);
            color: var(--success);
            border-color: var(--success);
        }

        .copy-button:hover {
            background: var(--surface-3);
            color: var(--text);
            border-color: var(--border-strong);
        }

        .copy-button.copied {
            background: color-mix(in srgb, var(--success) 14%, transparent);
            color: var(--success);
            border-color: var(--success);
        }

        /* ===== Learn mode ===== */
        .learn-empty { max-width: 640px; }

        .learn-packs {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 10px;
            margin: 8px 0 4px;
            text-align: left;
        }

        .learn-pack-card {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            cursor: pointer;
            font-family: inherit;
            text-align: left;
            transition: all 0.18s;
            box-shadow: var(--shadow-sm);
        }

        .learn-pack-card:hover {
            border-color: var(--primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow);
        }

        .learn-pack-emoji { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
        .learn-pack-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
        .learn-pack-title { font-size: 14px; font-weight: 600; color: var(--text); }
        .learn-pack-blurb { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

        .learn-potd { margin-top: 22px; text-align: left; }

        .learn-potd-label {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--text-soft);
            margin-bottom: 8px;
        }

        .learn-potd-card {
            display: flex;
            flex-direction: column;
            gap: 4px;
            width: 100%;
            background: var(--surface);
            border: 1px solid var(--border);
            border-left: 3px solid var(--accent);
            border-radius: var(--radius);
            padding: 14px 16px;
            cursor: pointer;
            font-family: inherit;
            text-align: left;
            transition: all 0.18s;
            box-shadow: var(--shadow-sm);
        }

        .learn-potd-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
        .learn-potd-kn { font-family: 'Noto Sans Kannada', sans-serif; font-size: 20px; font-weight: 600; color: var(--text); }
        .learn-potd-translit { font-size: 13px; color: var(--text-muted); }
        .learn-potd-en { font-size: 13.5px; color: var(--text); }

        /* Phrase cards — assistant-side bubbles rendered in the stream. */
        .phrase-card { display: flex; flex-direction: column; gap: 6px; }
        .phrase-kn { font-family: 'Noto Sans Kannada', sans-serif; font-size: 22px; font-weight: 600; line-height: 1.35; }
        .phrase-translit { font-size: 13.5px; color: var(--text-muted); }
        .phrase-en { font-size: 14.5px; color: var(--text); }
        .phrase-note { font-size: 12.5px; color: var(--text-muted); font-style: italic; margin-top: 2px; }

        /* Polite/casual toggle */
        .phrase-register {
            display: inline-flex;
            gap: 2px;
            margin-top: 2px;
            padding: 2px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius-pill);
            width: fit-content;
        }

        .phrase-register-btn {
            border: none;
            background: transparent;
            color: var(--text-muted);
            border-radius: var(--radius-pill);
            padding: 3px 12px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .phrase-register-btn.is-active {
            background: var(--surface);
            color: var(--text);
            box-shadow: var(--shadow-sm);
        }

        /* Word-by-word breakdown */
        .phrase-breakdown { margin-top: 2px; }

        .phrase-breakdown-toggle {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: transparent;
            color: var(--text-muted);
            border: 1px solid var(--border);
            border-radius: var(--radius-pill);
            padding: 4px 10px;
            font-size: 11.5px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .phrase-breakdown-toggle::before {
            content: '▸';
            font-size: 10px;
            transition: transform 0.15s;
        }

        .phrase-breakdown-toggle.is-open::before { transform: rotate(90deg); }
        .phrase-breakdown-toggle:hover { background: var(--surface-3); color: var(--text); }

        .phrase-breakdown-body {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-top: 8px;
            padding-left: 2px;
        }

        .phrase-breakdown-row { display: flex; gap: 10px; align-items: baseline; }
        .phrase-breakdown-kn { font-family: 'Noto Sans Kannada', sans-serif; font-size: 14.5px; font-weight: 600; min-width: 92px; }
        .phrase-breakdown-gloss { font-size: 13px; color: var(--text-muted); }

        .phrase-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

        .tryit-button {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: var(--primary);
            color: #fff;
            border: 1px solid var(--primary);
            border-radius: var(--radius-pill);
            padding: 5px 12px;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .tryit-button:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }

        /* "Practising ___" strip above the composer. */
        .learn-practice {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
            padding: 8px 12px;
            background: var(--primary-soft);
            border: 1px solid var(--primary);
            border-radius: var(--radius);
        }

        .learn-practice-label { font-size: 13px; color: var(--text); min-width: 0; }
        .learn-practice-phrase { font-weight: 700; }

        .learn-practice-exit {
            flex-shrink: 0;
            background: transparent;
            color: var(--primary);
            border: 1px solid var(--primary);
            border-radius: var(--radius-pill);
            padding: 4px 10px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .learn-practice-exit:hover { background: var(--primary); color: #fff; }

        /* Markdown rendering inside messages */
        .message-body ul, .message-body ol {
            margin: 4px 0 4px 20px;
            padding: 0;
        }

        .message-body li {
            margin: 2px 0;
        }

        .message-body code {
            background: var(--surface-3);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 1px 5px;
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 0.9em;
        }

        /* ========= Input ========= */
        #input-container {
            padding-top: 12px;
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
            padding-left: max(16px, calc((100% - 880px) / 2));
            padding-right: max(16px, calc((100% - 880px) / 2));
            background: var(--surface);
            border-top: 1px solid var(--border);
            position: relative;
            z-index: 10;
            flex-shrink: 0;
        }

        .input-row {
            display: flex;
            gap: 8px;
            align-items: flex-end;
            background: var(--surface-3);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 4px 4px 4px 16px;
            transition: all 0.18s;
        }

        .input-row:focus-within {
            border-color: var(--primary);
            background: var(--surface);
            box-shadow: 0 0 0 4px var(--primary-soft);
        }

        #user-input {
            flex: 1;
            padding: 10px 0;
            border: none;
            background: transparent;
            font-size: 15px;
            outline: none;
            color: var(--text);
            font-family: inherit;
            min-width: 0;
            resize: none;
            line-height: 1.5;
            max-height: 160px;
            overflow-y: auto;
        }

        #user-input::placeholder {
            /* --text-soft measured ~2.9:1 against the input surface — under
               the 4.5:1 WCAG AA floor. --text-muted passes in both themes. */
            color: var(--text-muted);
        }

        button {
            font-family: inherit;
        }

        .send-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 10px 18px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.18s;
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
            flex-shrink: 0;
        }

        .send-btn:hover {
            background: var(--primary-hover);
            box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
            transform: translateY(-1px);
        }

        .send-btn:active {
            transform: translateY(0);
        }

        .send-btn:disabled {
            /* Token-based disabled style that passes contrast in both themes;
               the old --text-soft fill at 0.6 opacity with white text was
               well under 3:1. */
            background: var(--surface-3);
            color: var(--text-muted);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* While a request is in flight the same button means Stop. */
        .send-btn .stop-icon { display: none; }
        .send-btn.is-stop .send-icon { display: none; }
        .send-btn.is-stop .stop-icon { display: inline; }

        .send-btn.is-stop {
            background: var(--danger);
        }

        .send-btn.is-stop:hover {
            background: color-mix(in srgb, var(--danger) 85%, black);
            box-shadow: 0 4px 14px color-mix(in srgb, var(--danger) 40%, transparent);
        }

        @media (max-width: 480px) {
            .send-btn .btn-label {
                display: none;
            }
            .send-btn {
                padding: 10px 12px;
                width: 42px;
                height: 42px;
                justify-content: center;
            }
            .input-row {
                padding-left: 14px;
            }
        }

        /* ========= Typing indicator ========= */
        .typing-indicator {
            display: inline-flex;
            align-items: center;
            padding: 14px 18px !important;
            gap: 4px;
        }

        .typing-indicator span {
            height: 7px;
            width: 7px;
            background-color: var(--text-soft);
            border-radius: 50%;
            display: inline-block;
            opacity: 0.5;
            animation: typing 1.2s infinite ease-in-out;
        }

        .typing-indicator span:nth-child(1) { animation-delay: 0s; }
        .typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
        .typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

        @keyframes typing {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
            30% { transform: translateY(-5px); opacity: 1; }
        }

        /* ========= Mobile message tweaks ========= */
        @media (max-width: 480px) {
            .message {
                font-size: 14.5px;
                padding: 11px 14px;
                max-width: 80%;
            }
            .button-container {
                gap: 5px;
            }
            .voice-button, .transliterate-button, .copy-button {
                padding: 4px 9px;
                font-size: 11px;
            }
            .empty-state {
                margin: 16px auto;
                padding: 16px;
            }
            .empty-state h2 {
                font-size: 1.15rem;
            }
            .empty-state p {
                font-size: 0.875rem;
            }
            .empty-state-icon {
                width: 56px;
                height: 56px;
                font-size: 30px;
            }
            #chat-messages {
                padding: 14px;
            }
        }

        /* ===== Reply-style profile: sidebar toggle + first-run modal ===== */
        .reply-mode { margin: 2px 0 6px; }

        .reply-mode-options {
            display: flex;
            gap: 4px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 3px;
        }

        .reply-mode-btn {
            flex: 1;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 7px;
            padding: 6px 4px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .reply-mode-btn:hover { color: var(--text); }

        .reply-mode-btn.is-active {
            background: var(--surface);
            color: var(--primary);
            box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.16));
        }

        /* First-run picker modal — reuses the visual-viewport-tracking backdrop
           geometry so the mobile keyboard can't hide it (see the share modal). */
        .app-modal {
            display: none;
            position: fixed;
            top: var(--app-offset-top, 0px);
            left: 0;
            width: 100dvw;
            height: var(--app-height, 100dvh);
            z-index: 1000;
            background-color: rgba(15, 23, 42, 0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            padding: 16px;
            align-items: center;
            justify-content: center;
        }

        .app-modal-card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 420px;
            padding: 24px;
            box-shadow: var(--shadow-lg);
            animation: modalSlideIn 0.25s ease-out;
            max-height: 90vh;
            overflow-y: auto;
        }

        .app-modal-title { font-size: 19px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
        .app-modal-sub { font-size: 13.5px; color: var(--text-muted); margin: 0 0 18px; line-height: 1.5; }

        .profile-options { display: flex; flex-direction: column; gap: 10px; }

        .profile-option {
            display: flex;
            flex-direction: column;
            gap: 3px;
            text-align: left;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 13px 15px;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.15s;
        }

        .profile-option:hover, .profile-option:focus-visible {
            border-color: var(--primary);
            background: var(--primary-soft);
            outline: none;
        }

        .profile-option-title {
            font-size: 14.5px;
            font-weight: 600;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .profile-option-desc { font-size: 12.5px; color: var(--text-muted); }

        .profile-option-tag {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: var(--primary);
            background: var(--primary-soft);
            padding: 2px 7px;
            border-radius: var(--radius-pill);
        }

        .profile-skip {
            display: block;
            margin: 16px auto 0;
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            font-family: inherit;
            padding: 6px 10px;
            border-radius: 8px;
        }

        .profile-skip:hover { color: var(--text); background: var(--surface-3); }

        /* ========= Modals (transliteration / share) ========= */
        .transliteration-modal,
        .share-modal {
            display: none;
            position: fixed;
            /* Track the visual viewport, not the layout viewport: with the
               mobile keyboard open, inset: 0 geometry left these centered in
               the full-height layout viewport — partly behind the keyboard. */
            top: var(--app-offset-top, 0px);
            left: 0;
            width: 100dvw;
            height: var(--app-height, 100dvh);
            z-index: 1000;
            background-color: rgba(15, 23, 42, 0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            padding: 16px;
            align-items: center;
            justify-content: center;
        }

        .transliteration-content,
        .share-content {
            background-color: var(--surface);
            margin: 0 auto;
            padding: 0;
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 600px;
            box-shadow: var(--shadow-lg);
            animation: modalSlideIn 0.25s ease-out;
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .share-content {
            max-width: 700px;
        }

        @keyframes modalSlideIn {
            from { opacity: 0; transform: translateY(-20px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .transliteration-header,
        .share-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-2);
        }

        .transliteration-header h3,
        .share-header h3 {
            margin: 0;
            color: var(--text);
            font-size: 16px;
            font-weight: 700;
            letter-spacing: -0.01em;
        }

        .close-button {
            background: transparent;
            border: none;
            font-size: 22px;
            cursor: pointer;
            color: var(--text-muted);
            padding: 0;
            width: 36px;
            height: 36px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: all 0.18s;
            font-family: inherit;
            box-shadow: none;
        }

        .close-button:hover {
            background: var(--surface-3);
            color: var(--text);
            transform: none;
            box-shadow: none;
        }

        .transliteration-body,
        .share-body {
            padding: 20px;
            overflow-y: auto;
        }

        .transliteration-pair {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }

        .kannada-text, .english-text {
            padding: 14px;
            border-radius: 12px;
            background: var(--surface-2);
            border: 1px solid var(--border);
        }

        .kannada-text h4, .english-text h4 {
            margin: 0 0 8px 0;
            color: var(--text-muted);
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .kannada-text p, .english-text p {
            margin: 0;
            line-height: 1.5;
            color: var(--text);
            font-size: 15px;
        }

        .kannada-text p {
            font-family: 'Noto Sans Kannada', sans-serif;
        }

        @media (max-width: 600px) {
            .transliteration-pair {
                grid-template-columns: 1fr;
            }
        }

        /* Share modal */
        .share-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 8px;
            margin-bottom: 18px;
        }

        .share-option {
            display: flex;
            align-items: center;
            gap: 10px;
            min-height: 46px;
            background: var(--surface-2);
            color: var(--text);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 11px 14px;
            font-size: 13.5px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.18s;
            text-align: left;
            font-family: inherit;
            box-shadow: none;
        }

        .share-option:hover {
            background: var(--primary-soft);
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .share-preview h4 {
            margin: 0 0 8px 0;
            color: var(--text-muted);
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .share-textarea {
            width: 100%;
            min-height: 110px;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 10px;
            font-family: inherit;
            font-size: 13px;
            line-height: 1.5;
            resize: vertical;
            background: var(--surface-2);
            color: var(--text);
        }

        .share-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-soft);
        }

        @media (max-width: 600px) {
            .share-options {
                grid-template-columns: 1fr;
            }
        }

        /* iOS no longer needs -webkit-fill-available height hacks here: the
           shell is position:fixed and sized from window.visualViewport, and
           #chat-container is a plain height:100% flex child of it. Sizing
           #chat-container to the *layout* viewport (fill-available) would
           overflow the shrunken shell and push the composer off-screen while
           the keyboard is open. */

        /* ========= PDF attach button + attachment chip ========= */
        .attach-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            flex-shrink: 0;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
        }

        .attach-btn:hover {
            background: var(--surface-3);
            color: var(--text);
        }

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

        /* Voice-input mic button — matches the attach button, with recording
           and transcribing states. */
        .mic-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            flex-shrink: 0;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.15s;
            font-family: inherit;
            position: relative;
        }

        .mic-btn:hover { background: var(--surface-3); color: var(--text); }
        .mic-btn:disabled { cursor: default; }

        .mic-btn .mic-stop-icon,
        .mic-btn .mic-spinner { display: none; }

        /* Recording: red pulsing, mic swaps to a stop square. */
        .mic-btn.recording { color: var(--danger); }
        .mic-btn.recording .mic-icon { display: none; }
        .mic-btn.recording .mic-stop-icon { display: inline; }
        .mic-btn.recording::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 10px;
            border: 2px solid var(--danger);
            animation: micPulse 1.2s ease-out infinite;
        }

        @keyframes micPulse {
            0%   { opacity: 0.7; transform: scale(1); }
            100% { opacity: 0;   transform: scale(1.35); }
        }

        /* Transcribing: hide both icons, show a spinner. */
        .mic-btn.transcribing .mic-icon,
        .mic-btn.transcribing .mic-stop-icon { display: none; }
        .mic-btn.transcribing .mic-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid var(--border-strong);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: micSpin 0.7s linear infinite;
        }

        @keyframes micSpin { to { transform: rotate(360deg); } }

        @media (prefers-reduced-motion: reduce) {
            .mic-btn.recording::after { animation: none; opacity: 0.7; }
            .mic-btn.transcribing .mic-spinner { animation-duration: 1.4s; }
        }

        /* Highlight the composer while a file is dragged over it. */
        #input-container.dragover .input-row {
            border-color: var(--primary);
            background: var(--surface);
            box-shadow: 0 0 0 4px var(--primary-soft);
        }

        .pdf-attachment {
            margin-bottom: 8px;
        }

        .pdf-chip {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
        }

        .pdf-chip-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            flex-shrink: 0;
            border-radius: 8px;
            background: color-mix(in srgb, var(--danger) 14%, var(--surface));
            color: var(--danger);
        }

        .pdf-chip-meta {
            display: flex;
            flex-direction: column;
            min-width: 0;
            flex: 1;
        }

        .pdf-chip-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .pdf-chip-status {
            font-size: 11.5px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .pdf-lang {
            display: inline-flex;
            flex-shrink: 0;
            background: var(--surface-3);
            border-radius: var(--radius-pill);
            padding: 2px;
        }

        .pdf-lang-btn {
            border: none;
            background: transparent;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 12px;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: var(--radius-pill);
            cursor: pointer;
            transition: all 0.15s;
        }

        .pdf-lang-btn.is-active {
            background: var(--surface);
            color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        .pdf-chip-remove {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            flex-shrink: 0;
            position: relative;
            background: transparent;
            color: var(--text-muted);
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .pdf-chip-remove:hover {
            background: color-mix(in srgb, var(--danger) 16%, transparent);
            color: var(--danger);
        }

        .pdf-chip-progress {
            margin-top: 8px;
        }

        .progress-bar-container {
            width: 100%;
            height: 4px;
            background: var(--surface-3);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), #8b5cf6);
            border-radius: 4px;
            width: 0%;
            transition: width 0.3s ease;
            position: relative;
        }

        .progress-bar::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        @media (max-width: 480px) {
            .pdf-chip {
                gap: 8px;
            }
            .pdf-lang-btn {
                padding: 4px 8px;
            }
        }

        /* ========= Toasts ========= */
        .toast-container {
            position: fixed;
            /* Anchored to the visual viewport, laid out as a bottom-aligned
               column. bottom-pinning against the layout viewport put error
               toasts *behind* the iOS keyboard — invisible at exactly the
               moment the composer was focused and a send failed. */
            top: var(--app-offset-top, 0px);
            left: 50%;
            height: var(--app-height, 100dvh);
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            gap: 8px;
            padding-bottom: calc(84px + env(safe-area-inset-bottom));
            z-index: 1000;
            width: max-content;
            max-width: min(92vw, 420px);
            pointer-events: none;
        }

        .toast {
            background: var(--user-bubble-bg);
            color: var(--user-bubble-text);
            padding: 11px 16px;
            border-radius: 12px;
            font-size: 13.5px;
            font-weight: 500;
            line-height: 1.4;
            box-shadow: var(--shadow-lg);
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.22s ease, transform 0.22s ease;
            pointer-events: auto;
        }

        .toast.show {
            opacity: 1;
            transform: translateY(0);
        }

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

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

        .toast-success {
            background: var(--success);
        }
