﻿:root {
    --bg-1: #0a0f1f;
    --bg-2: #10182b;
    --bg-3: #17233d;
    --panel: rgba(15, 23, 42, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.9);
    --panel-soft: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #eef2ff;
    --text-soft: #c7d2fe;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --accent: #7c9cff;
    --accent-2: #5f84ff;
    --accent-soft: rgba(124, 156, 255, 0.16);
    --ok: #34d399;
    --warn: #f59e0b;
    --danger: #f87171;
    --shadow-sm: 0 10px 24px rgba(2, 6, 23, 0.18);
    --shadow-md: 0 24px 64px rgba(2, 6, 23, 0.28);
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --max-page: 1520px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(124, 156, 255, 0.22), transparent 22%), radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 16%), radial-gradient(circle at bottom center, rgba(99, 102, 241, 0.12), transparent 24%), linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 48%, var(--bg-3) 100%);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    appearance: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 11px 16px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #f8fbff;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: transform 0.12s ease, filter 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 10px 20px rgba(95, 132, 255, 0.18);
}

    button:hover:not(:disabled) {
        transform: translateY(-1px);
        filter: brightness(1.03);
    }

    button.secondary {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text);
        border-color: var(--line);
        box-shadow: none;
    }

        button.secondary:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.08);
            border-color: var(--line-strong);
        }

    button.ghost {
        background: transparent;
        color: var(--muted);
        border-color: transparent;
        box-shadow: none;
    }

    button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
    }

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

    input::placeholder,
    textarea::placeholder {
        color: var(--muted-2);
    }

    input:focus,
    textarea:focus,
    select:focus {
        border-color: rgba(124, 156, 255, 0.7);
        box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.14);
        background: rgba(255, 255, 255, 0.06);
    }

textarea {
    min-height: 108px;
    resize: vertical;
    line-height: 1.55;
}

label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.93rem;
    font-weight: 700;
}

.page {
    max-width: var(--max-page);
    margin: 0 auto;
    padding: 24px;
}

.card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.surface {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

    .header h1,
    .header h2,
    .header h3,
    h1,
    h2,
    h3,
    h4 {
        margin: 0;
    }

    .header h1 {
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.92rem;
}

.xsmall {
    font-size: 0.82rem;
}

.error {
    color: #fecaca;
}

.success {
    color: #bbf7d0;
}

.hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
}

    .auth-card form {
        display: grid;
        gap: 14px;
    }

.auth-brand {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

    .auth-brand .eyebrow {
        color: var(--accent);
        font-weight: 800;
        font-size: 0.8rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.menu-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

    .menu-card .title {
        font-size: 1.16rem;
        font-weight: 800;
        line-height: 1.3;
    }

    .menu-card .meta {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

.chat-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 360px;
    gap: 16px;
}

.sidebar-list {
    display: grid;
    gap: 10px;
    max-height: 72vh;
    overflow: auto;
    padding-right: 2px;
}

.sidebar-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
    cursor: pointer;
}

    .sidebar-item:hover {
        transform: translateY(-1px);
        border-color: rgba(124, 156, 255, 0.45);
        background: rgba(255, 255, 255, 0.05);
    }

    .sidebar-item.active {
        border-color: var(--accent);
        box-shadow: inset 0 0 0 1px rgba(124, 156, 255, 0.45);
        background: linear-gradient(180deg, rgba(124, 156, 255, 0.12) 0%, rgba(124, 156, 255, 0.06) 100%);
    }

.sidebar-item-title {
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 5px;
    color: var(--text);
}

.sidebar-item-meta {
    display: grid;
    gap: 4px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 76vh;
}

.panel-topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.panel-title {
    display: grid;
    gap: 4px;
}

.chat-messages {
    flex: 1;
    overflow: auto;
    display: grid;
    gap: 14px;
    padding: 8px 2px;
    min-height: 360px;
    scroll-behavior: smooth;
    align-content: start;
}

.msg-row {
    display: flex;
    width: 100%;
}

    .msg-row.user {
        justify-content: flex-end;
    }

    .msg-row.assistant {
        justify-content: flex-start;
    }

.msg {
    width: fit-content;
    max-width: min(72%, 760px);
    min-width: 56px;
    padding: 12px 14px;
    border-radius: 18px;
    white-space: pre-wrap;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    word-break: break-word;
}

    .msg.user {
        background: linear-gradient(180deg, rgba(124, 156, 255, 0.24) 0%, rgba(124, 156, 255, 0.18) 100%);
        border: 1px solid rgba(124, 156, 255, 0.28);
        border-bottom-right-radius: 8px;
        color: #f8fbff;
    }

    .msg.assistant {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom-left-radius: 8px;
        color: var(--text);
    }

.msg-meta {
    font-size: 0.78rem;
    color: var(--muted-2);
    padding: 0 4px;
}

.composer {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 16px;
    display: grid;
    gap: 12px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .row.spread {
        justify-content: space-between;
    }

    .row > * {
        flex: initial;
    }

.stat-list {
    display: grid;
    gap: 10px;
}

.stat-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-soft);
}

    .badge.blue {
        background: rgba(124, 156, 255, 0.14);
        border-color: rgba(124, 156, 255, 0.26);
        color: #cdd8ff;
    }

    .badge.green {
        background: rgba(52, 211, 153, 0.12);
        border-color: rgba(52, 211, 153, 0.22);
        color: #bbf7d0;
    }

    .badge.orange {
        background: rgba(245, 158, 11, 0.12);
        border-color: rgba(245, 158, 11, 0.22);
        color: #fde68a;
    }

    .badge.red {
        background: rgba(248, 113, 113, 0.12);
        border-color: rgba(248, 113, 113, 0.22);
        color: #fecaca;
    }

.pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 14px 12px;
    vertical-align: top;
}

th {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notice {
    border-left: 4px solid var(--accent);
    background: rgba(124, 156, 255, 0.1);
    padding: 14px 16px;
    border-radius: 14px;
}

.debug-shell {
    display: grid;
    gap: 12px;
}

.debug-group {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.debug-group-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--line);
}

.debug-group-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
}

.debug-group-header button {
    padding: 7px 10px;
    font-size: 0.84rem;
}

.debug-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.48;
    max-height: 340px;
    overflow: auto;
    padding: 14px;
    color: #dbe5ff;
}

.debug-empty {
    color: var(--muted);
    padding: 14px;
    font-size: 0.9rem;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kv-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.kv-label {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kv-value {
    font-weight: 800;
    line-height: 1.4;
    color: var(--text);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    text-align: center;
    color: var(--muted);
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

    .typing span {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #94a3b8;
        display: inline-block;
        animation: blink 1.1s infinite ease-in-out;
    }

        .typing span:nth-child(2) {
            animation-delay: 0.15s;
        }

        .typing span:nth-child(3) {
            animation-delay: 0.3s;
        }

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@media (max-width: 1280px) {
    .chat-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .chat-layout,
    .menu-grid,
    .grid-3,
    .grid-2,
    .kv-grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 18px;
    }

    .chat-panel {
        min-height: 65vh;
    }

    .msg {
        max-width: 88%;
    }

    .header {
        align-items: stretch;
        flex-direction: column;
    }
}


/*:root {
    --bg: #0b1020;
    --bg-soft: #121a2f;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-strong: #ffffff;
    --line: #e5e7eb;
    --line-strong: #cfd4dc;
    --text: #111827;
    --muted: #667085;
    --muted-2: #98a2b3;
    --accent: #2563eb;
    --accent-2: #1d4ed8;
    --accent-soft: #dbeafe;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --ok: #027a48;
    --ok-soft: #d1fadf;
    --warning: #b54708;
    --warning-soft: #fef0c7;
    --shadow-sm: 0 2px 10px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.08);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --max-page: 1440px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 22%), radial-gradient(circle at top right, rgba(29, 78, 216, 0.10), transparent 20%), linear-gradient(180deg, #f5f7fb 0%, #eef2f8 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    appearance: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

    button:hover:not(:disabled) {
        background: var(--accent-2);
        transform: translateY(-1px);
    }

    button.secondary {
        background: white;
        color: var(--text);
        border-color: var(--line);
        box-shadow: none;
    }

        button.secondary:hover:not(:disabled) {
            background: #f8fafc;
            border-color: var(--line-strong);
        }

    button.ghost {
        background: transparent;
        color: var(--muted);
        border-color: transparent;
        box-shadow: none;
    }

        button.ghost:hover:not(:disabled) {
            background: rgba(15, 23, 42, 0.05);
            color: var(--text);
        }

    button.danger {
        background: var(--danger);
    }

    button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
        transform: none;
    }

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

    input:focus,
    textarea:focus,
    select:focus {
        border-color: rgba(37, 99, 235, 0.6);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #344054;
}

.page {
    max-width: var(--max-page);
    margin: 0 auto;
    padding: 28px;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.surface {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

    .header h1,
    .header h2,
    .header h3,
    h1,
    h2,
    h3,
    h4 {
        margin: 0;
    }

    .header h1 {
        font-size: 1.7rem;
        letter-spacing: -0.02em;
    }

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.92rem;
}

.xsmall {
    font-size: 0.82rem;
}

.error {
    color: var(--danger);
}

.success {
    color: var(--ok);
}

.hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.96);
}

    .auth-card form {
        display: grid;
        gap: 14px;
    }

.auth-brand {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

    .auth-brand .eyebrow {
        color: var(--accent);
        font-weight: 700;
        font-size: 0.8rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.menu-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

    .menu-card .title {
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .menu-card .meta {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

.chat-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 360px;
    gap: 16px;
}

.sidebar-list {
    display: grid;
    gap: 10px;
    max-height: 72vh;
    overflow: auto;
    padding-right: 2px;
}

.sidebar-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    cursor: pointer;
}

    .sidebar-item:hover {
        border-color: #bfd2ff;
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
        transform: translateY(-1px);
    }

    .sidebar-item.active {
        border-color: var(--accent);
        box-shadow: inset 0 0 0 1px var(--accent), 0 10px 24px rgba(37, 99, 235, 0.08);
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    }

.sidebar-item-title {
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 4px;
}

.sidebar-item-meta {
    display: grid;
    gap: 4px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 76vh;
}

.panel-topbar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.panel-title {
    display: grid;
    gap: 6px;
}

.chat-messages {
    flex: 1;
    overflow: auto;
    display: grid;
    gap: 14px;
    padding: 8px 4px 8px 2px;
    min-height: 360px;
    scroll-behavior: smooth;
}

.msg-row {
    display: grid;
    gap: 6px;
}

    .msg-row.user {
        justify-items: end;
    }

    .msg-row.assistant {
        justify-items: start;
    }

.msg {
    max-width: min(78%, 920px);
    padding: 12px 14px;
    border-radius: 18px;
    white-space: pre-wrap;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

    .msg.user {
        background: linear-gradient(180deg, #dbeafe 0%, #cfe1ff 100%);
        border: 1px solid #bfd5ff;
        border-bottom-right-radius: 8px;
    }

    .msg.assistant {
        background: #ffffff;
        border: 1px solid #e8ecf3;
        border-bottom-left-radius: 8px;
    }

.msg-meta {
    font-size: 0.78rem;
    color: var(--muted-2);
    padding: 0 4px;
}

.composer {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 16px;
    display: grid;
    gap: 12px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .row.spread {
        justify-content: space-between;
    }

    .row > * {
        flex: initial;
    }

.stat-list {
    display: grid;
    gap: 10px;
}

.stat-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: white;
    font-size: 0.86rem;
    font-weight: 600;
    color: #344054;
}

    .badge.blue {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .badge.green {
        background: var(--ok-soft);
        border-color: #a6f4c5;
        color: var(--ok);
    }

    .badge.orange {
        background: var(--warning-soft);
        border-color: #fedf89;
        color: var(--warning);
    }

    .badge.red {
        background: var(--danger-soft);
        border-color: #fecdca;
        color: var(--danger);
    }

.pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 14px 12px;
    vertical-align: top;
}

th {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--muted);
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.notice {
    border-left: 4px solid var(--accent);
    background: #eff6ff;
    padding: 14px 16px;
    border-radius: 14px;
}

.debug-shell {
    display: grid;
    gap: 12px;
}

.debug-group {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    overflow: hidden;
}

.debug-group-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.debug-group-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.debug-group-body {
    padding: 0;
}

.debug-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    max-height: 340px;
    overflow: auto;
    background: white;
    padding: 14px;
}

.debug-empty {
    color: var(--muted);
    padding: 14px;
    font-size: 0.9rem;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kv-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: white;
}

.kv-label {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kv-value {
    font-weight: 700;
    line-height: 1.4;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    text-align: center;
    color: var(--muted);
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
}

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

    .typing span {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #94a3b8;
        display: inline-block;
        animation: blink 1.1s infinite ease-in-out;
    }

        .typing span:nth-child(2) {
            animation-delay: 0.15s;
        }

        .typing span:nth-child(3) {
            animation-delay: 0.3s;
        }

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@media (max-width: 1280px) {
    .chat-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .chat-layout,
    .menu-grid,
    .grid-3,
    .grid-2,
    .kv-grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 18px;
    }

    .chat-panel {
        min-height: 65vh;
    }

    .msg {
        max-width: 92%;
    }

    .header {
        align-items: stretch;
        flex-direction: column;
    }
}
*/