:root {
    /* LENS_0 — Hermes Teal (default Pot Still theme) */
    --bg: #041c1c;
    --bg-elevated: #062a2a;
    --midground: #ffe6cb;
    --fg: #ffffff;
    --fg-muted: #a8b5b5;
    --accent: #34d399;
    --accent-warm: #ffbd38;
    --danger: #fb2c36;
    --warning: #ffbd38;
    --success: #4ade80;
    --info: #60a5fa;
    --border: rgba(255, 230, 203, 0.12);
    --radius: 8px;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Calibri, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --shadow-glow: 0 0 24px rgba(255, 189, 56, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, rgba(255, 189, 56, 0.08), transparent 60%);
}

.login-card {
    width: min(420px, 92vw);
    padding: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glow);
}

.brand {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--midground);
}

.subtitle {
    margin: 0 0 24px;
    color: var(--fg-muted);
    font-size: 14px;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 14px;
    color: var(--fg-muted);
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.18);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--fg);
    font: inherit;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    width: 100%;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--accent), #10b981);
    color: #041c1c;
    font-weight: 600;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    padding: 6px 12px;
    font-size: 14px;
}

.alert {
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
}

.alert-error {
    background: rgba(251, 44, 54, 0.12);
    border: 1px solid rgba(251, 44, 54, 0.25);
    color: var(--danger);
}

.badge-ai {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 189, 56, 0.12);
    border: 1px solid rgba(255, 189, 56, 0.25);
    color: var(--accent-warm);
    font-size: 12px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 189, 56, 0.12);
    border: 1px solid rgba(255, 189, 56, 0.25);
    color: var(--accent-warm);
    font-size: 12px;
    line-height: 1;
}

/* Privacy / Consent */
.page-privacy, .page-consent {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 0%, rgba(255, 189, 56, 0.06), transparent 60%);
}

/* Standalone-страницы (privacy/consent/settings/login): html имеет overflow:hidden
   глобально, что делает html скролл-контейнером и обрезает длинный контент на
   мобильных. Разрешаем вертикальный скролл на html для этих страниц. */
html:has(body.page-privacy),
html:has(body.page-consent),
html:has(body.page-settings),
html:has(body.page-login) {
    overflow-y: auto;
}

.privacy-container, .consent-card {
    width: min(720px, 92vw);
    padding: 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.privacy-container h2, .consent-card h2 {
    margin: 8px 0 16px;
    color: var(--midground);
    font-size: 22px;
}

.policy-meta {
    color: var(--fg-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.policy-content {
    line-height: 1.7;
    color: var(--fg);
}

.policy-content br { margin-bottom: 8px; display: block; content: ""; }

.privacy-footer, .consent-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.consent-text {
    margin: 16px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.consent-text ul { padding-left: 20px; margin: 12px 0 0; }

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 0;
    cursor: pointer;
}

.consent-checkbox input { margin-top: 4px; }

.text-link { font-size: 14px; color: var(--fg-muted); }
.text-link:hover { color: var(--accent); }

.policy-link { font-size: 13px; color: var(--fg-muted); }
.policy-link a { color: var(--fg-muted); text-decoration: underline; }
.policy-link a:hover { color: var(--accent); }

.alert-warning {
    background: rgba(255, 189, 56, 0.12);
    border: 1px solid rgba(255, 189, 56, 0.25);
    color: var(--warning);
}

.btn-outline-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(251, 44, 54, 0.45);
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
}

.btn-outline-danger:hover {
    background: rgba(251, 44, 54, 0.10);
}

.btn-danger {
    width: 100%;
    margin-top: 12px;
    background: rgba(251, 44, 54, 0.12);
    border: 1px solid rgba(251, 44, 54, 0.25);
    color: var(--danger);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border);
    padding: 8px 14px;
    font-size: 14px;
    border-radius: var(--radius);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
}

/* Chat page — body wrapper */
.page-agent {
    display: flex;
    height: 100dvh;
    overflow: hidden;
}

/* Chat app container */
.chat-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
}

/* Topbar navigation (FR-46.1, FR-46.2, FR-46.3) */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.topbar-hamburger {
    display: block;
    background: none;
    border: none;
    color: var(--fg);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.topbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--midground);
    letter-spacing: 0.02em;
}

.topbar-links {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.topbar-link {
    padding: 6px 12px;
    border-radius: var(--radius);
    color: var(--fg-muted);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.topbar-link:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.topbar-link.active { background: rgba(52, 211, 153, 0.12); color: var(--accent); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-theme-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Унифицированная кнопка темы: ☀️ в тёмной теме, 🌙 в светлой.
   Оба значка в разметке, CSS показывает нужный — без Alpine. */
.topbar-theme-btn .theme-icon-light { display: none; }
.topbar-theme-btn .theme-icon-dark { display: inline; }
[data-theme="light"] .topbar-theme-btn .theme-icon-light { display: inline; }
[data-theme="light"] .topbar-theme-btn .theme-icon-dark { display: none; }

.topbar-role {
    font-size: 11px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.topbar-role.role-admin { background: rgba(251, 44, 54, 0.15); color: var(--danger); }
.topbar-role.role-user { background: rgba(52, 211, 153, 0.15); color: var(--accent); }
.topbar-role.role-guest { background: rgba(255, 189, 56, 0.15); color: var(--accent-warm); }

.topbar-user {
    font-size: 13px;
    color: var(--fg-muted);
}

.topbar-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
}
.topbar-logout:hover { color: var(--danger); border-color: var(--danger); }

/* Chat body (sidebar + main) */
.chat-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.25s ease, width 0.25s ease, margin-left 0.25s ease;
}

/* Десктоп: сайдбар сворачивается кнопкой ☰ (sidebarOpen=false → скрыт) */
@media (min-width: 641px) {
    .chat-sidebar:not(.sidebar-open) {
        width: 0;
        flex-basis: 0;
        min-width: 0;
        border-right: none;
        overflow: hidden;
    }
    /* Overlay только для мобильного off-canvas; на десктопе не показываем */
    .sidebar-overlay { display: none !important; }
    /* Чат-контент центрируется и не сдвигается влево, когда сайдбар свёрнут */
    .chat-body.sidebar-collapsed .chat-sidebar {
        display: none;
    }
    .chat-body.sidebar-collapsed .chat-main {
        margin: 0 auto;
        max-width: 900px;
        height: 100%;
        background: var(--bg-elevated);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        box-shadow: 0 0 40px rgba(0,0,0,0.25);
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .brand { font-size: 20px; }

.sidebar-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin-bottom: 8px;
}

.sidebar-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
}

.agent-select, .model-select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0,0,0,0.24);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font: inherit;
}

.history-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--fg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.history-item:hover { background: rgba(255,255,255,0.04); }
.history-item.active { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); }

.history-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--fg-muted);
}

.empty-history {
    font-size: 13px;
    color: var(--fg-muted);
    padding: 12px;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--bg);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.chat-header-title { font-weight: 600; }
.chat-header-model {
    font-size: 12px;
    color: var(--fg-muted);
    background: rgba(0,0,0,0.24);
    padding: 4px 10px;
    border-radius: 999px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
    min-height: 0;
}

@media (max-width: 1200px) {
    .chat-messages { padding: 24px 16px; }
}
@media (max-width: 768px) {
    .chat-messages { padding: 20px 16px; }
}

.welcome {
    margin: auto;
    text-align: center;
    color: var(--fg-muted);
}
.welcome-icon { font-size: 48px; margin-bottom: 12px; }
.welcome h2 { margin: 0 0 8px; color: var(--fg); }
.welcome p { margin: 0; }

.msg {
    display: flex;
    gap: 16px;
    max-width: 100%;
}

/* Сообщение агента — раскладка по умолчанию. Правило объявлено явно, а не
   оставлено пустым местом: класс присутствует в разметке, и без него
   невозможно отличить «оформление не требуется» от «забыли оформить». */
.msg-bot { margin-right: auto; }
.msg-user { margin-left: auto; flex-direction: row-reverse; }
.msg-user .msg-body { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.25); color: var(--fg); }

.msg-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 18px;
}

.msg-body {
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--midground);
    max-width: min(720px, calc(100% - 60px));
    line-height: 1.6;
}

.msg-content {
    word-break: break-word;
}
.msg-user .msg-content {
    white-space: pre-wrap;   /* сохраняем переносы строк в тексте пользователя */
}

.msg-reasoning {
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-warm);
    padding-left: 12px;
}

.msg-reasoning-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--accent-warm);
    font-size: 0.9em;
    user-select: none;
}
.msg-reasoning-toggle:hover { opacity: 0.8; }

.msg-reasoning-content {
    margin-top: 8px;
    font-size: 0.95em;
    color: var(--fg-muted);
}

/* highlight.js темы — используем встроенную тему github-dark */
.hljs { background: transparent; }

.msg-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 11px;
}

.msg-ai-badge {
    color: var(--accent);
    background: rgba(52, 211, 153, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
}

.msg-time { color: var(--fg-muted); }

.msg-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s;
}
.msg:hover .msg-actions { opacity: 1; }

.msg-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--fg-muted);
    font-size: 14px;
    padding: 2px 6px;
    cursor: pointer;
    line-height: 1;
}
.msg-action-btn:hover { background: rgba(255,255,255,0.06); color: var(--fg); }

.streaming-msg .msg-body { min-width: 60px; }

.typing {
    display: flex;
    gap: 5px;
    padding: 6px 0;
}
.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fg-muted);
    animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

.tool-indicator {
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: toolPulse 1.5s ease-in-out infinite;
}
@keyframes toolPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Input area */
.chat-input-area {
    border-top: 1px solid var(--border);
    padding: 16px;
    background: var(--bg-elevated);
}

@media (max-width: 1200px) {
    .chat-input-area { padding: 16px; }
}
@media (max-width: 768px) {
    .chat-input-area { padding: 12px 16px; }
}

.chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: rgba(0,0,0,0.24);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.chat-form textarea {
    flex: 1;
    resize: none;
    background: transparent;
    border: none;
    color: var(--fg);
    font: inherit;
    line-height: 1.5;
    max-height: 200px;
    min-height: 24px;
    outline: none;
}

.chat-form .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.input-hint {
    font-size: 11px;
    color: var(--fg-muted);
    text-align: center;
    margin-top: 8px;
}

/* Stop button */
.btn-stop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(251, 44, 54, 0.12);
    border: 1px solid rgba(251, 44, 54, 0.3);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-stop:hover { background: rgba(251, 44, 54, 0.2); }

/* Chat header actions */
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prompt chips (FR-46.26) */
.prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.prompt-chip {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--fg-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.prompt-chip:hover {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--accent);
}

/* History search */
.history-search {
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.24);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 13px;
    outline: none;
}
.history-search:focus { border-color: var(--accent); }

.history-group {
    margin-bottom: 4px;
}

.history-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    padding: 4px 12px;
    margin-top: 8px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* Markdown content styles */
.msg-content h1, .msg-content h2, .msg-content h3 {
    margin: 12px 0 8px;
    color: var(--fg);
}
.msg-content h1 { font-size: 1.4em; }
.msg-content h2 { font-size: 1.2em; }
.msg-content h3 { font-size: 1.1em; }

.msg-content p { margin: 8px 0; }

.msg-content ul, .msg-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.msg-content li { margin: 4px 0; }

.msg-content code {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.msg-content pre {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.msg-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
}

.msg-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 0.9em;
}

.msg-content th, .msg-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.msg-content th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
}

.msg-content blockquote {
    border-left: 3px solid var(--accent);
    margin: 8px 0;
    padding: 4px 16px;
    color: var(--fg-muted);
}

.msg-content a {
    color: var(--accent);
    text-decoration: underline;
}

.msg-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.msg-content img {
    max-width: 100%;
    border-radius: var(--radius);
}

/* Light theme */
[data-theme="light"] {
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --midground: #1e293b;
    --fg: #0f172a;
    --fg-muted: #64748b;
    --accent: #059669;
    --accent-warm: #d97706;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --info: #2563eb;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 24px rgba(5, 150, 105, 0.08);
}

[data-theme="light"] .msg-body {
    color: var(--fg);
}

[data-theme="light"] .msg-user .msg-body {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
}

[data-theme="light"] .chat-form {
    background: rgba(0,0,0,0.04);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] textarea,
[data-theme="light"] .agent-select,
[data-theme="light"] .model-select,
[data-theme="light"] .history-search {
    background: rgba(0,0,0,0.04);
}

/* Mobile off-canvas (FR-46.27) */
@media (max-width: 640px) {
    .topbar-hamburger { display: block; }
    .topbar-links { display: none; }
    .topbar-user { display: none; }

    /* Мобильное выпадающее меню (WO-20260906-UI-Topbar-Unify):
       гамбургер открывает .topbar-links как dropdown под топбаром. */
    .topbar { position: relative; }
    .topbar.topbar-mobile-open .topbar-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: 8px;
        gap: 2px;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        z-index: 110;
    }
    .topbar.topbar-mobile-open .topbar-link {
        padding: 10px 12px;
        border-radius: var(--radius);
    }

    .chat-sidebar {
        position: fixed;
        top: 48px;
        left: 0;
        bottom: 0;
        z-index: 95;
        transform: translateX(-100%);
        width: 280px;
        border-right: 1px solid var(--border);
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }
    .chat-sidebar.sidebar-open { transform: translateX(0); }

    .sidebar-overlay { display: block; }

    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 12px 16px; }

    .chat-header { padding: 10px 16px; }
    .msg-body { max-width: calc(100% - 48px); }
    .msg-actions { opacity: 1; }
    .msg:hover .msg-actions { opacity: 1; }
    .prompt-chips { gap: 6px; }
    .prompt-chip { font-size: 12px; padding: 6px 12px; }
}

[x-cloak] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


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

.dashboard-header h1 {
    margin: 0;
    font-size: 28px;
    color: var(--midground);
}

.period-selector {
    display: flex;
    gap: 8px;
}

.period-selector .btn {
    min-width: 48px;
}

.period-selector .btn.active {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.4);
    color: var(--accent);
}

.alerts-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 14px;
}

.alert-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.alert-value {
    margin-left: auto;
    font-weight: 600;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.metric-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.metric-card.wide {
    grid-column: span 2;
}

.metric-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--midground);
    margin-bottom: 6px;
}

.metric-subtitle {
    font-size: 13px;
    color: var(--fg-muted);
}

.metric-sparkline {
    margin-top: 10px;
    height: 32px;
    opacity: 0.9;
}

.metric-sparkline.wide {
    height: 64px;
}

/* Журнал аудита (Health) — понятная карточка вместо сырого бейджа audit chain */
.audit-card {
    margin: 16px 0;
    padding: 16px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.audit-card.audit-ok { border-left: 4px solid var(--success); }
.audit-card.audit-broken { border-left: 4px solid var(--danger); }
.audit-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.audit-status-icon {
    font-size: 18px;
    line-height: 1;
}
.audit-card.audit-ok .audit-status-icon { color: var(--success); }
.audit-card.audit-broken .audit-status-icon { color: var(--danger); }
.audit-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--midground);
}
.audit-status {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: auto;
}
.audit-card.audit-ok .audit-status {
    color: var(--success);
    background: rgba(74, 222, 128, 0.12);
}
.audit-card.audit-broken .audit-status {
    color: var(--danger);
    background: rgba(251, 44, 54, 0.12);
}
.audit-card-body p {
    font-size: 13px;
    color: var(--fg-muted);
    margin: 0 0 10px;
    line-height: 1.55;
}
.audit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13px;
    color: var(--fg-muted);
}
.audit-meta span { white-space: nowrap; }
.audit-warning {
    color: var(--danger);
    font-weight: 600;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.channel-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: var(--radius);
}

.channel-name { font-size: 12px; color: var(--fg-muted); }
.channel-dot { width: 10px; height: 10px; border-radius: 50%; }
.channel-dot.ok { background: var(--success); }
.channel-dot.fail { background: var(--danger); }
.channel-count { font-size: 18px; font-weight: 600; color: var(--fg); }
.channel-error { font-size: 12px; color: var(--danger); }

@media (max-width: 640px) {
    .metric-card.wide { grid-column: span 1; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
}

/* Mobile */
@media (max-width: 640px) {
    .chat-app { flex-direction: column; }
    .chat-messages { padding: 16px; }
    .chat-input-area { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


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

/* ═══════════════════════════════════════════════════════════════════════════
   UISPEC-20260803 §5–§7 — колонка чата, композер, хранилище

   Классы ниже использовались в разметке, но правил для них не существовало
   (FR-UI-18). Из-за этого нативный выбор файла оставался видимым поверх поля
   ввода, вложения не оформлялись, а действия над историей не отображались.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Одна колонка на ленту и композер (§5). Ширина задаётся контейнером, а не
   долей ширины окна: окно шире области чата на ширину сайдбара, поэтому
   vw-отступы давали несимметричную колонку и «уплывающее» поле ввода. */
.chat-messages > *,
.chat-input-area > * {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* §7.4 — нативный выбор файла невидим. Прикрепление только через 📎.
   Именно отсутствие этого правила выводило «Выбор файлов / Не выбран ни один
   файл» поверх поля ввода и перехватывало клики, предназначенные textarea. */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.btn-attach {
    font-size: 1.05rem;
    line-height: 1;
}

/* Вложения (§7.8) */
.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    padding: 4px 8px 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-elevated);
    font-size: 0.85rem;
    color: var(--fg);
}

.attachment-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-muted);
    font-size: 1rem;
    cursor: pointer;
}

.attachment-remove:hover { color: var(--danger); }

/* Действия над диалогом в истории */
.history-item-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.history-item-wrapper:hover .history-item-actions,
.history-item-wrapper:focus-within .history-item-actions {
    opacity: 1;
}

.history-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
}

.history-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Индикатор профиля и хранилища в шапке чата (§4.1 п.2–3, FR-46.4) */
.profile-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--fg);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-indicator:hover { background: rgba(255, 255, 255, 0.06); }

.profile-indicator-icon { font-size: 1.1rem; }

/* Чип хранилища. В состоянии по умолчанию — нейтральный. В альтернативном
   подписывается последствием и подсвечивается: «файлы не сохраняются в
   хранилище» — это обещание о судьбе данных, и пользователь должен проверять
   его взглядом, не открывая настроек (§4.3.2, §4.3.3). */
.chat-header-storage {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.storage-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--fg-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.storage-chip:hover { background: rgba(255, 255, 255, 0.06); }

.storage-chip.storage-alt {
    color: var(--accent-warm);
    border-color: var(--accent-warm);
}

.storage-warning {
    font-size: 0.8rem;
    color: var(--accent-warm);
    white-space: nowrap;
}

/* Все интерактивные элементы имеют видимый фокус (FR-UI-22) */
.profile-indicator:focus-visible,
.storage-chip:focus-visible,
.history-action-btn:focus-visible,
.attachment-remove:focus-visible,
.btn-attach:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    /* Зона нажатия не меньше 44×44 (§6) */
    .history-action-btn,
    .attachment-remove,
    .btn-attach {
        min-width: 44px;
        min-height: 44px;
    }
    /* На узком экране действия над историей видны всегда: наведения нет */
    .history-item-actions { opacity: 1; }

    .chat-header {
        padding: 8px 12px;
        gap: 8px;
    }
    /* Подпись-предупреждение переносится на свою строку целиком */
    .storage-warning {
        flex-basis: 100%;
        white-space: normal;
    }
}

/* Страница настроек — обычная прокручиваемая страница, не раскладка чата.
   Класс присутствовал в разметке без правила: страница наследовала
   html,body{overflow:hidden} и не прокручивалась при длинном содержимом. */
.page-settings {
    margin: 0;
    min-height: 100dvh;
    overflow-y: auto;
    background: var(--bg);
    color: var(--fg);
}

/* Гостевой экран «что дальше» — единственное место продукта, где задача
   конверсия. Гость приходит по личной ссылке от конкретного человека, а не из
   поиска, поэтому это не лендинг: одна мысль, короткий список, одно действие. */
.pitch-lead {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--accent);
}

.pitch-list {
    margin: 8px 0 20px;
    padding-left: 20px;
    color: var(--fg);
    line-height: 1.7;
}

.pitch-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Зона нажатия не меньше 44px по высоте: экран открывают с телефона */
    min-height: 44px;
    padding: 12px 20px;
    text-decoration: none;
}

.pitch-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─── Content Library (FR-1.17, FR-1.50, FR-1.51, FR-1.52) ─────────────────── */
.content-app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.content-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.content-header .subtitle {
    margin: 4px 0 0;
    color: var(--fg-muted);
}

.content-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-filter select {
    background: var(--bg-elevated);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
}

.loading {
    color: var(--fg-muted);
    padding: 24px 0;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.document-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.document-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin-bottom: 8px;
    word-break: break-word;
}

.document-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--fg-muted);
}

.document-content {
    margin: 0;
    color: var(--midground);
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

.document-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
}

.empty-series {
    color: var(--fg-muted);
    padding: 24px 0;
}

/* Модальное окно просмотра документа (FR-1.50) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glow);
    width: min(760px, 100%);
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    word-break: break-word;
}

.modal-meta {
    display: flex;
    gap: 12px;
    padding: 8px 20px;
    font-size: 13px;
    color: var(--fg-muted);
    border-bottom: 1px solid var(--border);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.modal-content {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--midground);
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

/* ===== База знаний (CR-20260914) — сплит: дерево слева / контент справа ===== */

.kb-root {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
    width: 100%;
}

@media (max-width: 820px) {
    .kb-root { grid-template-columns: 1fr; }
}

/* Дерево файлов */
.kb-tree {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    min-width: 0;
    width: 100%;
}

.kb-tree-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 700;
    color: var(--fg-muted);
    margin-bottom: 8px;
}

.kb-tree-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--fg-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-tree-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg); }

.kb-tree-item.active {
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent);
}

.kb-tree-folder {
    padding: 4px 8px;
    color: var(--fg);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.kb-tree-children { padding-left: 14px; }

/* Просмотр файла */
.kb-viewer {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    min-height: 200px;
    min-width: 0;
    overflow-wrap: break-word;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.kb-viewer-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fg);
    word-break: break-word;
    margin: 0 0 12px;
}

.kb-tags { margin-bottom: 12px; }

.kb-tag {
    display: inline-block;
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent);
    border-radius: 4px;
    padding: 2px 8px;
    margin: 0 4px 4px 0;
    font-size: 12px;
}

/* Рендер markdown */
.kb-md {
    color: var(--midground);
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}
.kb-md > *:first-child { margin-top: 0; }
.kb-md > *:last-child { margin-bottom: 0; }
.kb-md h1, .kb-md h2, .kb-md h3, .kb-md h4, .kb-md h5, .kb-md h6 {
    color: var(--fg);
    margin: 18px 0 8px;
    line-height: 1.3;
}
.kb-md h1 { font-size: 1.5rem; }
.kb-md h2 { font-size: 1.3rem; }
.kb-md h3 { font-size: 1.1rem; }
.kb-md p { margin: 8px 0; }
.kb-md a { color: var(--accent); }
.kb-md blockquote {
    margin: 10px 0;
    padding: 8px 14px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.03);
    color: var(--fg-muted);
}
.kb-md ul, .kb-md ol { padding-left: 22px; margin: 8px 0; }
.kb-md li { margin: 4px 0; }
.kb-md code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--accent-warm);
}
.kb-md pre {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 10px 0;
    max-width: 100%;
    box-sizing: border-box;
}
.kb-md pre code { background: none; color: var(--midground); padding: 0; white-space: pre-wrap; word-break: break-word; }
.kb-md hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.kb-md table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 13px;
    display: block;
    overflow-x: auto;
    max-width: 100%;
}
.kb-md th, .kb-md td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
    word-break: break-word;
}
.kb-md th { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.kb-md video, .kb-md img { max-width: 100%; height: auto; }

/* Поиск */
.kb-search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.kb-search input {
    flex: 1;
    background: var(--bg-elevated);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font: inherit;
}
.kb-search input:focus { outline: none; border-color: var(--accent); }

.kb-search-hit {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 6px;
    color: var(--fg);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    word-break: break-word;
}
.kb-search-hit:hover { border-color: var(--accent); }

/* ===== Канбан-доска (CR-20260914-WebUI-Kanban) — карточки в дизайн-системе ===== */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

@media (max-width: 780px) {
    .kanban-board { grid-template-columns: 1fr; }
}

.kanban-column {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-column-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    margin: 0 0 4px;
}

.kanban-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    word-break: break-word;
    margin-bottom: 6px;
}

.kanban-card:last-child {
    margin-bottom: 0;
}

.kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 6px;
}

.kanban-card-priority {
    font-size: 12px;
    color: var(--fg-muted);
    font-weight: 600;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.kanban-card-project {
    font-size: 11px;
    color: var(--accent);
    background: rgba(52, 211, 153, 0.12);
    border-radius: 4px;
    padding: 1px 6px;
}

.kanban-card-desc {
    font-size: 12px;
    color: var(--fg-muted);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    white-space: normal;
}

.kanban-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* Группа задач по проекту внутри колонки */
.kanban-project-group {
    margin-bottom: 14px;
}

.kanban-project-group:last-child {
    margin-bottom: 4px;
}

.kanban-project-title {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    margin: 0 0 8px;
    padding: 2px 0 6px;
    border-bottom: 1px solid var(--border);
}

.kanban-project-title:hover {
    color: var(--accent);
}

.kanban-project-title:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
    border-radius: 2px;
}

.kanban-project-badge {
    color: var(--accent-warm);
    font-size: 11px;
    line-height: 1;
}

.kanban-project-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 7px;
    line-height: 1.6;
}


