/* ═══════════════════════════════════════════════════════════════════
   site5.css  —  Ticket · Anthropic-inspired design system
   Terracotta accent · warm sand palette · high-contrast
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 15px; -webkit-font-smoothing: antialiased; }
body { height: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
input, textarea, select { font: inherit; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
svg { display: block; }

/* ── Type scale ─────────────────────────────────────────────────── */
:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;

    /* ── Light palette ──────────────────────────────────────────── */

    /* Page */
    --bg:           hsl(38 28% 94%);
    --fg:           hsl(22 16% 9%);

    /* Sidebar — always dark regardless of mode */
    --sb-bg:        hsl(22 18% 11%);
    --sb-fg:        hsl(38 20% 82%);
    --sb-hover:     hsl(22 18% 18%);
    --sb-active:    hsl(22 18% 24%);
    --sb-border:    hsl(22 14% 7%);

    /* Topbar */
    --tb-bg:        hsl(0 0% 100%);
    --tb-border:    hsl(38 18% 86%);

    /* Cards */
    --card:         hsl(0 0% 100%);
    --card-border:  hsl(38 16% 84%);
    --card-shadow:  0 1px 2px hsl(22 16% 18% / 0.06), 0 3px 10px hsl(22 16% 18% / 0.05);

    /* Inputs (same surface as card in light) */
    --input:        hsl(38 24% 97%);
    --input-border: hsl(38 14% 76%);
    --input-focus:  var(--accent);

    /* Text */
    --fg-2:         hsl(22 10% 36%);   /* secondary — 5.8:1 on --bg */
    --fg-3:         hsl(22 8% 52%);    /* tertiary  — 3.1:1 on --bg */

    /* Accent: Anthropic terracotta */
    --accent:       hsl(18 68% 44%);
    --accent-fg:    hsl(38 60% 97%);
    --accent-hover: hsl(18 68% 37%);
    --accent-tint:  hsl(18 68% 44% / 0.10);

    /* Danger */
    --red:          hsl(2 62% 46%);
    --red-fg:       hsl(0 0% 100%);
    --red-hover:    hsl(2 62% 39%);

    /* Borders & radius */
    --radius:       5px;
    --radius-lg:    9px;
    --radius-xl:    13px;

    /* Shadows */
    --shadow-sm:    0 1px 3px hsl(22 16% 18% / 0.08), 0 1px 2px hsl(22 16% 18% / 0.06);
    --shadow-md:    0 4px 14px hsl(22 16% 18% / 0.10), 0 1px 4px hsl(22 16% 18% / 0.07);
    --shadow-lg:    0 8px 30px hsl(22 16% 18% / 0.14), 0 3px 8px hsl(22 16% 18% / 0.09);
    --shadow-xl:    0 16px 48px hsl(22 16% 18% / 0.18), 0 6px 14px hsl(22 16% 18% / 0.11);
}

/* ── Dark mode overrides ────────────────────────────────────────── */
.dark {
    --bg:           hsl(22 14% 7%);
    --fg:           hsl(38 22% 88%);

    /* Sidebar stays dark — just slightly lighter than page */
    --sb-bg:        hsl(22 16% 13%);
    --sb-fg:        hsl(38 18% 78%);
    --sb-hover:     hsl(22 16% 19%);
    --sb-active:    hsl(22 16% 25%);
    --sb-border:    hsl(22 14% 5%);

    --tb-bg:        hsl(22 14% 11%);
    --tb-border:    hsl(22 12% 19%);

    --card:         hsl(22 12% 14%);
    --card-border:  hsl(22 10% 22%);
    --card-shadow:  0 2px 6px hsl(0 0% 0% / 0.30);

    /* Inputs — sunken below card surface */
    --input:        hsl(22 10% 9%);
    --input-border: hsl(22 10% 26%);

    --fg-2:         hsl(38 10% 58%);
    --fg-3:         hsl(38 8% 42%);

    --accent:       hsl(18 72% 56%);
    --accent-hover: hsl(18 72% 64%);
    --accent-fg:    hsl(22 14% 7%);
    --accent-tint:  hsl(18 68% 56% / 0.14);

    --red:          hsl(2 66% 58%);
    --red-hover:    hsl(2 66% 65%);

    --shadow-sm:    0 1px 4px hsl(0 0% 0% / 0.32);
    --shadow-md:    0 4px 18px hsl(0 0% 0% / 0.44), 0 2px 6px hsl(0 0% 0% / 0.28);
    --shadow-lg:    0 8px 36px hsl(0 0% 0% / 0.54), 0 3px 10px hsl(0 0% 0% / 0.34);
    --shadow-xl:    0 16px 52px hsl(0 0% 0% / 0.64), 0 6px 16px hsl(0 0% 0% / 0.42);
}

/* ── Base ───────────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
}

/* ── Landing ────────────────────────────────────────────────────── */
#landing-canvas {
    position: fixed; inset: 0; z-index: 100;
    width: 100%; height: 100%;
    background: var(--bg);
}
html:not(.landing-active) #landing-canvas { display: none; }
html.landing-active .login-screen,
html.landing-active .app-shell { display: none; }

/* ── Login ──────────────────────────────────────────────────────── */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
}

.login-theme-btn {
    position: absolute;
    top: 20px; right: 20px;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    width: 100%; max-width: 376px;
    display: flex; flex-direction: column; gap: 18px;
}

.auth-brand {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--accent);
    text-align: center;
    margin-bottom: 2px;
}

.auth-actions {
    display: flex; flex-direction: column; gap: 8px;
}

.auth-error {
    font-size: 0.8125rem;
    color: var(--red);
    min-height: 1.25em;
}

/* ── Theme icon swap ────────────────────────────────────────────── */
#theme-sun, #login-theme-sun         { display: none; }
#theme-moon, #login-theme-moon       { display: block; }
.dark #theme-sun, .dark #login-theme-sun   { display: block; }
.dark #theme-moon, .dark #login-theme-moon { display: none; }

/* ── App shell ──────────────────────────────────────────────────── */
.app-shell {
    height: 100vh;
    display: flex; flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
    height: 52px;
    flex-shrink: 0;
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: var(--tb-bg);
    border-bottom: 1px solid var(--tb-border);
    z-index: 100;
}
.topbar-left, .topbar-right {
    display: flex; align-items: center; gap: 8px;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.body-layout {
    flex: 1; display: flex; overflow: hidden;
}

.sidebar {
    width: 216px; flex-shrink: 0;
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    overflow-y: auto;
    padding: 10px 8px;
    display: flex; flex-direction: column; gap: 2px;
}

/* Scrollbar in sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: hsl(22 14% 22%); border-radius: 2px; }

/* ── Navigation ─────────────────────────────────────────────────── */
.nav-list {
    display: flex; flex-direction: column;
    padding: 4px 8px; gap: 2px;
}

/* app.js renders <button data-view="..." class="" | "active"> — no nav-item class */
#main-nav button,
#process-nav button,
#admin-nav button {
    width: 100%;
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px;
    border-radius: var(--radius-lg);
    background: none;
    border: 1px solid transparent;
    color: var(--sb-fg);
    font-size: 0.875rem; font-weight: 500;
    text-align: left; white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
#main-nav button:hover,
#process-nav button:hover,
#admin-nav button:hover {
    background: var(--sb-hover);
    border-color: hsl(22 16% 28% / 0.6);
    color: hsl(38 22% 92%);
}
#main-nav button.active,
#process-nav button.active,
#admin-nav button.active {
    background: hsl(18 44% 20%);
    border-color: hsl(18 38% 32%);
    color: hsl(18 70% 82%);
    font-weight: 600;
}

.nav-icon {
    width: 24px; height: 24px;
    flex-shrink: 0; align-self: center;
    border-radius: var(--radius);
    background: hsl(38 16% 80% / 0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
    color: hsl(38 20% 72%);
}
.nav-icon svg {
    width: 15px; height: 15px;
    stroke: currentColor; fill: none;
    stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
#main-nav button.active .nav-icon,
#process-nav button.active .nav-icon,
#admin-nav button.active .nav-icon {
    background: hsl(18 50% 28% / 0.5);
    color: hsl(18 70% 74%);
}

/* ── Nav section headers ────────────────────────────────────────── */
.nav-section-label {
    padding: 12px 10px 4px;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase;
    color: hsl(38 14% 52%);
    user-select: none;
}
.nav-section-label:first-child { padding-top: 4px; }

.nav-badge {
    margin-left: auto; flex-shrink: 0;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 0.6875rem; font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px; min-width: 18px; text-align: center;
}

/* ── Main content ───────────────────────────────────────────────── */
.main-content {
    flex: 1; min-width: 0;
    overflow-y: auto;
    display: flex; flex-direction: column;
}

.notice {
    font-size: 0.8125rem;
    padding: 8px 20px;
    background: hsl(44 90% 88%);
    color: hsl(36 60% 20%);
    border-bottom: 1px solid hsl(44 60% 74%);
    flex-shrink: 0;
}
.dark .notice {
    background: hsl(40 46% 18%);
    color: hsl(44 60% 78%);
    border-bottom-color: hsl(40 40% 26%);
}
.notice:empty { display: none; }

.views-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ── Views ──────────────────────────────────────────────────────── */
.view { display: none; padding: 22px; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; }
/* The chat view manages its own internal scroll (the message list), so it never scrolls as a whole. */
#view-chat { overflow: hidden; }
.view.active { display: flex; }

.view.split {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}
.view.split > .card:first-child {
    width: 300px; flex-shrink: 0;
    position: sticky; top: 0;
    max-height: calc(100vh - 52px - 44px);
    overflow-y: auto;
    background: hsl(38 24% 96%);
}
.dark .view.split > .card:first-child {
    background: hsl(22 10% 18%);
}
.view.split > .card:last-child {
    flex: 1; min-width: 0;
}

/* Board-style: view-header above a split content area */
.view-split {
    display: flex; flex-direction: row;
    align-items: flex-start; gap: 16px;
    flex: 1; min-height: 0;
}
.view-split > .card:first-child {
    width: 300px; flex-shrink: 0;
    position: sticky; top: 0;
    max-height: calc(100vh - 52px - 44px - 60px);
    overflow-y: auto;
    background: hsl(38 24% 96%);
}
.dark .view-split > .card:first-child {
    background: hsl(22 10% 18%);
}
.view-split > .card:last-child {
    flex: 1; min-width: 0;
}

/* Settings view sub-panels */
.settings-panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.settings-panel.active { display: flex; }

/* ── View header ────────────────────────────────────────────────── */
.view-header {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    gap: 12px; margin-bottom: 18px;
    flex-wrap: wrap;
}
.view-header h1 {
    font-size: 1.125rem; font-weight: 800;
    letter-spacing: -0.025em; line-height: 1.2;
}
.view-header .meta { margin-top: 3px; }
.view-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 13px 16px 12px;
    border-bottom: 1px solid var(--card-border);
    flex-wrap: wrap;
}
.card-header h2 {
    font-size: 0.9375rem; font-weight: 700;
    letter-spacing: -0.015em;
}
.card-header h3 {
    font-size: 0.875rem; font-weight: 600;
}
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Sub-sections inside a card */
.card-section {
    border-top: 1px solid var(--card-border);
    padding: 14px 16px;
}
.card-section-head {
    display: flex; align-items: baseline;
    justify-content: space-between; gap: 10px;
    margin-bottom: 10px; flex-wrap: wrap;
}
.card-section-head h3 {
    font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em;
}
.card-meta-pad { padding: 6px 16px 0; }

/* item-list inside a card-section (sub-lists: history, files, etc.)
   keeps compact row style rather than the padded-card style */
.card-section .item-list {
    padding: 0; gap: 0;
}
.card-section .entity-card {
    border-radius: 0; border: none;
    border-bottom: 1px solid var(--card-border);
    padding: 8px 0;
}
.card-section .entity-card:last-child { border-bottom: none; }

/* ── Item lists ─────────────────────────────────────────────────── */
.item-list {
    display: flex; flex-direction: column;
    padding: 8px;
    gap: 6px;
}

/* ── Entity cards (generated by app.js) ─────────────────────────── */
.entity-card {
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    background: var(--card);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.dark .entity-card {
    border-color: hsl(22 10% 24%);
    background: hsl(22 10% 22%);   /* lighter than panel (18%) so cards show up */
}
.entity-card:hover {
    border-color: hsl(18 40% 72%);
    box-shadow: var(--shadow-sm);
}
.dark .entity-card:hover {
    border-color: hsl(22 10% 32%);
    background: hsl(22 10% 25%);
    box-shadow: 0 1px 4px hsl(22 16% 4% / 0.3);
}
.entity-card.active {
    background: hsl(18 60% 94%);
    border-color: hsl(18 50% 74%);
}
.dark .entity-card.active {
    background: hsl(18 34% 18%);
    border-color: hsl(18 38% 30%);
}

.entity-card h4 {
    font-size: 0.875rem; font-weight: 600;
    line-height: 1.3;
    color: var(--fg);
    margin-bottom: 2px;
}
.entity-card p {
    font-size: 0.8125rem;
    color: var(--fg-2);
    line-height: 1.4;
    margin-bottom: 6px;
}
.entity-card .tag-row { margin-top: 2px; }

/* ── Board ──────────────────────────────────────────────────────── */
.board {
    display: flex; gap: 12px;
    overflow-x: auto; padding-bottom: 8px;
    align-items: flex-start; min-height: 160px;
}
.board::-webkit-scrollbar { height: 6px; }
.board::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }

/* app.js generates: <div class="lane"> */
.lane {
    flex-shrink: 0; width: 252px;
    background: hsl(38 20% 91%);
    border: 1px solid hsl(38 14% 82%);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column; min-height: 80px;
}
.dark .lane {
    background: hsl(22 12% 10%);
    border-color: hsl(22 10% 18%);
}
.lane.drag-target {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-tint);
}

/* app.js generates: <div class="lane-head"> */
.lane-head {
    padding: 9px 12px 8px;
    border-bottom: 1px solid hsl(38 14% 82%);
    display: flex; align-items: center; justify-content: space-between;
}
.dark .lane-head { border-bottom-color: hsl(22 10% 18%); }
.lane-head h3 {
    font-size: 0.75rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--fg-2);
}

.lane-body { padding: 7px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

/* app.js generates: <article class="ticket-card"> */
.ticket-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 10px 11px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.1s, border-color 0.1s, transform 0.1s;
}
.ticket-card:hover {
    box-shadow: var(--shadow-md);
    border-color: hsl(38 14% 72%);
    transform: translateY(-1px);
}
.dark .ticket-card:hover { border-color: hsl(22 10% 30%); }
.ticket-card.dragging { opacity: 0.45; transform: rotate(1deg); }

/* ── Panel head (inside ticket-card, generated by app.js) ────────── */
.panel-head {
    display: flex; align-items: center;
    justify-content: space-between; gap: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 5px;
}
.panel-head-tight { padding-bottom: 3px; margin-bottom: 4px; }
.panel-head h4 {
    font-size: 0.6875rem; font-weight: 700;
    color: var(--fg-3); letter-spacing: 0.04em;
}

/* ── Chips (generated by app.js throughout) ─────────────────────── */
.chip {
    display: inline-flex; align-items: center;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 0.6875rem; font-weight: 600;
    background: hsl(38 18% 88%);
    color: var(--fg-2);
    border: 1px solid hsl(38 12% 78%);
    white-space: nowrap; vertical-align: middle;
}
.dark .chip {
    background: hsl(22 10% 21%);
    border-color: hsl(22 8% 29%);
    color: var(--fg-2);
}

/* ── Tags / static badges ───────────────────────────────────────── */
.tag { composes: chip; } /* alias */
.status-badge {
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 2px 8px; border-radius: 99px;
    background: hsl(38 18% 88%); color: var(--fg-2);
    border: 1px solid hsl(38 12% 78%);
}
.dark .status-badge {
    background: hsl(22 10% 21%); border-color: hsl(22 8% 29%);
}
.status-badge.processing { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* ── Tag row ─────────────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 0; }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 14px; padding: 16px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
    font-size: 0.8125rem; font-weight: 600;
    color: var(--fg-2); letter-spacing: -0.005em;
}

.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 100px; }
.field-row > .field-narrow { flex: 0 1 116px; }

.field-group {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.field-group legend {
    font-size: 0.8125rem; font-weight: 600;
    color: var(--fg-2); padding: 0 4px;
}

.radio-group { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 7px; }
.radio-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.875rem; cursor: pointer; font-weight: 400; color: var(--fg);
}

.form-actions {
    display: flex; align-items: center;
    gap: 8px; flex-wrap: wrap; padding-top: 4px;
}

/* ── Inputs ─────────────────────────────────────────────────────── */
input:not([type=checkbox]):not([type=radio]):not([type=file]),
textarea, select {
    width: 100%;
    background: var(--input);
    color: var(--fg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    padding: 7px 10px;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
    appearance: none;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px hsl(18 68% 44% / 0.14);
}
.dark input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
.dark textarea:focus, .dark select:focus {
    box-shadow: 0 0 0 3px hsl(18 72% 56% / 0.18);
}
input[readonly], textarea[readonly] { color: var(--fg-2); cursor: default; }
textarea { resize: vertical; min-height: 76px; }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.input-sm {
    padding: 5px 8px; font-size: 0.8125rem;
    width: auto; min-width: 120px;
}
.select-sm {
    padding: 5px 26px 5px 8px;
    font-size: 0.8125rem; width: auto; min-width: 100px;
}
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }

.checkbox-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.875rem; cursor: pointer; white-space: nowrap;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center;
    justify-content: center; gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 600;
    border: 1px solid var(--card-border);
    background: var(--card); color: var(--fg);
    transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
    white-space: nowrap; line-height: 1.4;
    cursor: pointer;
}
.btn:hover {
    background: hsl(38 16% 94%);
    border-color: hsl(38 12% 70%);
}
.dark .btn {
    background: hsl(22 12% 20%); border-color: hsl(22 10% 32%);
}
.dark .btn:hover {
    background: hsl(22 12% 26%); border-color: hsl(22 10% 38%);
}

.btn-primary {
    background: var(--accent); border-color: var(--accent);
    color: var(--accent-fg);
}
.btn-primary:hover {
    background: var(--accent-hover); border-color: var(--accent-hover);
}
.dark .btn-primary, .dark .btn-primary:hover { /* inherits via var */ }

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

.btn-ghost {
    background: transparent; border-color: transparent; color: var(--fg-2);
}
.btn-ghost:hover {
    background: hsl(38 16% 91%); border-color: transparent; color: var(--fg);
}
.dark .btn-ghost { background: transparent; border-color: transparent; }
.dark .btn-ghost:hover { background: hsl(22 12% 20%); }

/* Icon button */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    background: var(--card); color: var(--fg-2);
    flex-shrink: 0;
    transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: hsl(38 16% 91%); color: var(--fg); }
.dark .icon-btn { background: hsl(22 12% 18%); border-color: hsl(22 10% 28%); }
.dark .icon-btn:hover { background: hsl(22 12% 24%); color: var(--fg); }
.icon-btn svg {
    width: 15px; height: 15px; fill: none;
    stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}
.login-theme-btn { /* same as icon-btn */ }

/* Dangerous icon button (app.js adds this class to btn-danger buttons with "delete" text) */
.icon-button-danger {
    background: transparent !important;   /* override .btn-danger's red fill */
    color: var(--red) !important;         /* red icon on light bg — visible */
    border-color: var(--red) !important;
}
.icon-button-danger:hover {
    background: var(--red) !important;
    color: var(--red-fg) !important;      /* white icon on red bg */
    border-color: var(--red) !important;
}
/* SVG inside icon buttons — stroke-based icons need these to be visible */
.icon-button-danger svg,
.icon-trash {
    stroke: currentColor; fill: none;
    stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
    width: 15px; height: 15px;
}
/* Screen-reader-only text (added by decorateDeleteButtons) */
.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;
}

/* ── Topbar buttons ─────────────────────────────────────────────── */
.project-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px;
    border-radius: var(--radius);
    border: 1px solid var(--tb-border);
    background: transparent; color: var(--fg);
    font-size: 0.875rem; font-weight: 600;
    transition: background 0.1s;
}
.project-btn:hover { background: hsl(38 16% 93%); }
.dark .project-btn:hover { background: hsl(22 12% 16%); }
.chevron { font-size: 0.65rem; color: var(--fg-3); }

.avatar-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: var(--accent-fg);
    border: none; font-size: 0.875rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    transition: opacity 0.1s;
}
.avatar-btn:hover { opacity: 0.82; }

/* ── Dropdowns ──────────────────────────────────────────────────── */
.dropdown-wrap { position: relative; }

.dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 50; overflow: hidden;
    display: none;
}
.dropdown.open { display: block; }
.project-dropdown { min-width: 220px; left: 0; right: auto; }

.dropdown-label {
    padding: 10px 12px 7px;
    font-size: 0.8125rem; font-weight: 700;
    color: var(--fg-2);
    border-bottom: 1px solid var(--card-border);
}
.dropdown-item {
    display: block; width: 100%; text-align: left;
    padding: 8px 12px; font-size: 0.875rem;
    background: none; border: none; color: var(--fg); cursor: pointer;
    transition: background 0.08s;
}
.dropdown-item:hover { background: hsl(38 16% 94%); }
.dark .dropdown-item:hover { background: hsl(22 12% 20%); }
.dropdown-item + .dropdown-item { border-top: 1px solid var(--card-border); }

/* ── Right-click context menu (board) ────────────────────────────── */
.context-menu {
    position: fixed; z-index: 200;
    min-width: 200px; max-width: 280px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    font-size: 0.875rem;
}
.context-menu-header {
    padding: 9px 12px;
    font-size: 0.75rem; font-weight: 700;
    color: var(--fg-2);
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.context-menu-role {
    font-weight: 600; color: var(--accent-fg);
    background: var(--accent); border-radius: 999px;
    padding: 1px 8px; font-size: 0.6875rem;
}
.context-menu-list { max-height: 320px; overflow-y: auto; }
.context-menu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left;
    padding: 8px 12px;
    background: none; border: none; color: var(--fg); cursor: pointer;
    transition: background 0.08s;
}
.context-menu-item:hover { background: hsl(38 16% 94%); }
.dark .context-menu-item:hover { background: hsl(22 12% 20%); }
.context-menu-check { width: 12px; flex-shrink: 0; color: var(--accent); font-weight: 700; }
.context-menu-item.is-match { font-weight: 600; }
.context-menu-label { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.context-menu-label small { color: var(--fg-3); font-size: 0.6875rem; font-weight: 400; }
.context-menu-empty { padding: 10px 12px; color: var(--fg-3); font-size: 0.8125rem; }
.context-menu-unassign {
    border-top: 1px solid var(--card-border);
    color: var(--red);
}
.context-menu-sep { height: 1px; background: var(--card-border); margin: 4px 0; }
.context-menu-danger .context-menu-label { color: var(--red); }
.context-menu-danger .context-menu-check { color: var(--red); }
.context-menu-danger:hover { background: hsl(0 70% 96%); }
.dark .context-menu-danger:hover { background: hsl(0 40% 22%); }

/* ── Segmented control ──────────────────────────────────────────── */
.segmented {
    display: inline-flex;
    border: 1px solid var(--card-border);
    border-radius: var(--radius); overflow: hidden;
}
.seg-btn {
    padding: 5px 12px; font-size: 0.8125rem; font-weight: 500;
    background: none; border: none; color: var(--fg-2);
    border-right: 1px solid var(--card-border);
    transition: background 0.08s, color 0.08s; cursor: pointer;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: var(--accent); color: var(--accent-fg); }
.seg-btn:not(.active):hover { background: hsl(38 16% 93%); color: var(--fg); }
.dark .seg-btn:not(.active):hover { background: hsl(22 12% 20%); }

/* Icon-only segmented toggle (board/list/plan perspective switch). Wider tap
   targets — the icons alone were too small to click comfortably. */
.perspective-toggle .seg-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 22px;
}
.perspective-toggle .seg-btn svg {
    width: 15px; height: 15px; fill: none;
    stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ── Modals ──────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto; }
.modal.open { display: flex; }
.modal.hidden { display: none !important; }

.modal-backdrop {
    position: fixed; inset: 0;
    background: hsl(22 16% 6% / 0.52);
    backdrop-filter: blur(3px);
}
.modal-box {
    position: relative; z-index: 1;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%; max-width: 880px; overflow: hidden;
}
.modal-box-sm { max-width: 440px; }

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; }

/* Two-column modal layout */
.modal-grid { display: grid; grid-template-columns: 1fr 296px; }
.modal-main { padding: 18px; border-right: 1px solid var(--card-border); overflow-y: auto; max-height: calc(90vh - 52px); }
.modal-sidebar { overflow-y: auto; max-height: calc(90vh - 52px); }
.modal-grid-tabbed { display: block; padding: 18px; overflow-y: auto; max-height: calc(90vh - 52px); }
.ticket-subnav { margin-bottom: 14px; }
.ticket-panel { display: none; }
.ticket-panel.active { display: block; }

.modal-section { margin-top: 18px; }
.modal-section:first-child { margin-top: 0; }

.section-heading {
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fg-3); margin-bottom: 8px;
}

/* ── Dialog ──────────────────────────────────────────────────────── */
.dialog-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: hsl(0 0% 0% / 0.5);
    display: flex; align-items: center; justify-content: center;
}
.dialog-overlay.hidden { display: none; }
.dialog-box {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 24px; width: 100%; max-width: 360px;
    display: flex; flex-direction: column; gap: 16px;
}
.dialog-message { font-size: 0.9375rem; font-weight: 500; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── History (app.js generates these class names) ────────────────── */
.history-list {
    display: flex; flex-direction: column;
    max-height: 260px; overflow-y: auto;
    padding: 8px 0;
}
.history-item {
    font-size: 0.8125rem; color: var(--fg-2);
    padding: 5px 16px;
    border-bottom: 1px solid var(--card-border); line-height: 1.5;
}
.history-item:last-child { border-bottom: none; }
.history-item-agent { color: var(--accent); }
.history-item-user { color: var(--fg); }
.history-item-system { color: var(--fg-3); font-style: italic; }
.history-item-latest-agent { font-weight: 600; }

/* ── Chat ────────────────────────────────────────────────────────── */
.chat-log {
    min-height: 80px; max-height: 260px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 16px;
    background: var(--input);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.chat-input-row {
    display: flex; gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border);
}
.chat-input-row input { flex: 1; }

/* ── Inline add rows ─────────────────────────────────────────────── */
.inline-add {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px;
    border-top: 1px solid var(--card-border);
}
.inline-add input { flex: 1; }
.inline-add-col { display: flex; flex-direction: column; gap: 8px; }

/* ── Decomposition list ──────────────────────────────────────────── */
.decomp-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.mini-list { display: flex; flex-direction: column; gap: 3px; }

/* ── Agent config grid ───────────────────────────────────────────── */
.agent-grid { display: flex; flex-direction: column; gap: 10px; }

/* ── Workflow board ──────────────────────────────────────────────── */
.workflow-stage-board { padding: 16px; overflow-x: auto; }
.stage-grid {
    display: flex; gap: 10px;
    min-height: 120px; overflow-x: auto;
}
.stage-create-card {
    background: hsl(38 18% 93%);
    border: 1.5px dashed hsl(38 12% 74%);
    border-radius: var(--radius);
    padding: 14px; min-width: 196px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.dark .stage-create-card {
    background: hsl(22 12% 10%); border-color: hsl(22 8% 22%);
}
.stage-create-card h4 { font-size: 0.8125rem; font-weight: 700; color: var(--fg-2); }
.stage-card {
    background: hsl(38 18% 93%);
    border: 1px solid hsl(38 12% 78%);
    border-radius: var(--radius);
    min-width: 196px; flex-shrink: 0;
}
.dark .stage-card { background: hsl(22 12% 10%); border-color: hsl(22 10% 19%); }

/* Stage card header (reuses .lane-head positioning, adds its own overrides) */
.stage-card-top {
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    padding: 7px 8px 7px 10px;
    border-bottom: 1px solid hsl(38 12% 78%);
}
.dark .stage-card-top { border-bottom-color: hsl(22 10% 19%); }

.stage-card-heading {
    display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1;
}
.stage-card-order {
    font-size: 0.6875rem; font-weight: 700; color: var(--fg-3); flex-shrink: 0;
}
.stage-card-title-button {
    background: none; border: none; padding: 0; margin: 0;
    cursor: pointer; text-align: left; min-width: 0;
}
.stage-card-title-button:hover .stage-card-title { color: var(--accent); }
.stage-card-title {
    font-size: 0.8125rem; font-weight: 700; color: var(--fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px;
}

.stage-card-controls {
    display: flex; align-items: center; gap: 3px; flex-shrink: 0;
}
.stage-card-move-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    background: none; border: 1px solid var(--card-border);
    border-radius: var(--radius); font-size: 0.75rem; font-weight: 700;
    color: var(--fg-2); cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.stage-card-move-button:hover:not(:disabled) { background: hsl(38 16% 86%); color: var(--fg); }
.stage-card-move-button:disabled { opacity: 0.3; cursor: default; }
.dark .stage-card-move-button { border-color: hsl(22 10% 30%); }
.dark .stage-card-move-button:hover:not(:disabled) { background: hsl(22 12% 24%); }

/* Stage section (details/summary blocks inside a card) */
.stage-card-section {
    border-top: 1px solid hsl(38 12% 78%);
}
.dark .stage-card-section { border-top-color: hsl(22 10% 19%); }
.stage-card-section > summary {
    padding: 6px 10px; list-style: none;
    display: flex; align-items: center; gap: 5px;
    cursor: pointer; user-select: none;
}
.stage-card-section > summary::marker,
.stage-card-section > summary::-webkit-details-marker { display: none; }
.stage-card-section > summary::before {
    content: "▶"; font-size: 0.6rem; color: var(--fg-3); flex-shrink: 0;
    transition: transform 0.15s;
}
.stage-card-section[open] > summary::before { transform: rotate(90deg); }
.stage-card-section-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--fg-2);
}
.stage-card-section > summary:hover .stage-card-section-title { color: var(--fg); }

.stage-card-section-body {
    padding: 8px 10px 10px;
}
.stage-card-section-body.stack { display: flex; flex-direction: column; gap: 8px; }

.stage-card-actions {
    display: flex; justify-content: flex-end; padding: 4px 0 0;
}

/* Role list inside stage cards */
.workflow-role-list {
    display: flex; flex-direction: column; gap: 4px; min-height: 28px;
    border: 1px dashed hsl(38 12% 74%); border-radius: var(--radius);
    padding: 4px;
}
.dark .workflow-role-list { border-color: hsl(22 10% 28%); }
.workflow-role-empty {
    font-size: 0.8125rem; color: var(--fg-3); padding: 4px; text-align: center;
}
.stage-card-add-role {
    display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.stage-card-add-role .field { flex: 1; min-width: 100px; margin: 0; }

.workflow-settings-panel {
    border-top: 1px solid var(--card-border);
    padding: 0 16px;
}
.workflow-settings-panel > summary {
    padding: 10px 0;
    font-size: 0.875rem; font-weight: 600; color: var(--fg-2);
}
.workflow-settings-panel > summary:hover { color: var(--fg); }

/* ── Document drop ───────────────────────────────────────────────── */
#view-documents { position: relative; }
.doc-drop-zone { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.doc-drop-zone.document-drop-active {
    position: fixed; inset: 0; z-index: 150;
    display: flex; align-items: center; justify-content: center;
    background: hsl(18 60% 96% / 0.92); pointer-events: all;
}
.dark .doc-drop-zone.document-drop-active { background: hsl(22 40% 8% / 0.94); }
.doc-drop-msg { display: none; }
.doc-drop-zone.document-drop-active .doc-drop-msg {
    display: block; text-align: center;
    background: var(--card);
    border: 2px dashed var(--accent);
    border-radius: var(--radius-xl);
    padding: 48px 56px;
}
.doc-drop-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 6px; }

/* ── Misc helpers ────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.meta    { font-size: 0.8125rem; color: var(--fg-2); line-height: 1.5; }
.empty   { padding: 20px 16px; text-align: center; font-size: 0.875rem; color: var(--fg-3); }
.mono    { font-family: var(--font-mono); font-size: 0.8125rem; }

.version-badge {
    position: fixed; bottom: 10px; right: 12px;
    font-size: 0.6875rem; color: var(--fg-3);
    pointer-events: none; z-index: 5;
}

/* ── Scrollbar (WebKit) ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(38 12% 76%); border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: hsl(22 8% 26%); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .modal-grid { grid-template-columns: 1fr; }
    .modal-sidebar { max-height: none; }
    .view.split { flex-direction: column; }
    .view.split > .card:first-child { width: 100%; max-height: none; position: static; }
}
@media (max-width: 600px) {
    .sidebar { width: 48px; padding: 8px 4px; }
    .nav-item span:not(.nav-icon):not(.nav-badge) { display: none; }
    .nav-badge { display: none; }
    .nav-item { padding: 7px; justify-content: center; }
}

/* ── Release / list-view styles ─────────────────────────────────── */
.ticket-list-view {
    padding: 8px 0;
}

.release-group {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.release-group > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    user-select: none;
}

/* Expand/collapse caret to the left of the release/feature/backlog header. */
.release-group > summary::before {
    content: "\25B8"; /* ▸ */
    flex-shrink: 0;
    width: 1.1em;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--fg-2);
    transition: transform 0.12s ease;
}
.release-group[open] > summary::before { transform: rotate(90deg); }

.release-group[open] > summary {
    border-bottom: 1px solid var(--border);
}

.release-group > summary strong {
    flex: 1;
    font-size: 0.9rem;
}

/* Nested groups (feature within release, epic within feature) indent and use a
   lighter header so the hierarchy is readable. */
.release-group .release-group {
    margin: 8px 12px 8px;
    border-radius: var(--radius);
}
.release-group-epic > summary {
    background: var(--bg-2, var(--card-bg));
    font-size: 0.85rem;
}

/* Release status chips. */
.chip.release-status-in_design { background: var(--chip-idle-bg, #e5e7eb); color: var(--fg-2, #374151); }
.chip.release-status-in_progress { background: var(--chip-active-bg, #dbeafe); color: #1e40af; }
.chip.release-status-complete { background: var(--chip-success-bg, #dcfce7); color: #166534; }

.ticket-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--card-bg);
}

.ticket-list-table th {
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--fg-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ticket-list-row {
    cursor: pointer;
    transition: background 0.1s;
}

/* Zebra striping: subtle, neutral alternating row background to separate tickets. */
.ticket-list-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.028);
}
.dark .ticket-list-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.035);
}

.ticket-list-row:hover {
    background: var(--hover);
}

.ticket-list-row td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Collapse the ID column to its content so the title sits immediately to its
   right (left-aligned) rather than across a stretched gap. */
.ticket-list-table th:first-child,
.ticket-list-row td:first-child {
    width: 1%;
    white-space: nowrap;
}
.ticket-list-table th:nth-child(2),
.ticket-list-row td:nth-child(2) {
    text-align: left;
}

.ticket-list-row:last-child td {
    border-bottom: none;
}

.table-wrap { overflow-x: auto; }

/* Ticket modal: collapsible "Agent prompt" preview sub-section. */
.ticket-prompt-section {
    margin-top: 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: var(--bg);
}
.ticket-prompt-section > summary {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fg-2);
    user-select: none;
}
.ticket-prompt-preview {
    margin: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--card-border);
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 0.75rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    color: var(--fg);
}

/* Inline-editable list cells (priority/type): click to open a value popup. */
.editable-cell {
    cursor: pointer;
    border-radius: 4px;
    padding: 1px 5px;
    border: 1px dashed transparent;
}
.editable-cell:hover {
    border-color: var(--card-border);
    background: var(--card);
}

.chip-state-active  { background: #d1fae5; color: #065f46; }
.chip-state-idle    { background: #f3f4f6; color: #374151; }
.chip-state-success { background: #dbeafe; color: #1e40af; }
.chip-state-failure { background: #fee2e2; color: #991b1b; }

.ticket-plan-view {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 160px);
    overflow: hidden;
}

.plan-pane {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.plan-pane-header {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-muted);
    padding: 0.4rem 0.5rem;
    position: sticky;
    top: 0;
    background: var(--bg, #fff);
    z-index: 1;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.plan-release-group {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg);
}

.plan-release-group > summary {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    background: var(--surface, #f8f8f8);
    font-weight: 500;
    font-size: 0.875rem;
    list-style: none;
}

.plan-release-group[open] > summary {
    border-bottom: 1px solid var(--border);
}

.plan-release-group > summary strong {
    flex: 1;
}

.plan-drop-zone {
    min-height: 2.5rem;
    transition: background 0.15s;
}

.plan-drop-target > .plan-drop-zone,
.plan-pane.plan-drop-target {
    background: var(--accent-muted, #e8f0ff);
    outline: 2px dashed var(--accent, #4a80f0);
    outline-offset: -2px;
}

.plan-ticket-row {
    padding: 0.4rem 0.75rem;
    cursor: grab;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    background: var(--card-bg);
    transition: background 0.1s;
}

.plan-ticket-row:last-child {
    border-bottom: none;
}

.plan-ticket-row:hover {
    background: var(--hover, #f0f0f0);
}

.plan-ticket-row.dragging {
    opacity: 0.35;
}

.plan-ticket-key {
    color: var(--fg-muted);
    font-size: 0.75rem;
    min-width: 4rem;
    flex-shrink: 0;
}

.plan-ticket-locked {
    cursor: default;
    opacity: 0.6;
}

.plan-release-group[data-release-locked] > summary {
    opacity: 0.7;
}

.plan-empty {
    color: var(--fg-muted);
    font-size: 0.875rem;
    padding: 0.75rem;
    text-align: center;
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    align-items: start;
}

.admin-summary-card {
    display: flex;
    flex-direction: column;
}

.item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.item-row:last-child {
    border-bottom: none;
}

.item-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta {
    color: var(--fg-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-sm {
    padding: 2px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── Agent bar ─────────────────────────────────────────────────────────── */
/* Agent icons live in the topbar, to the right of the project selector. */
.project-agent-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: visible;
}
.project-agent-bar:not(.hidden) {
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid var(--tb-border);
}
/* Compact the round agent icons so they sit comfortably in the 52px topbar. */
.topbar .agent-icon {
    width: 1.9rem; height: 1.9rem;
    font-size: 0.85rem;
    border-width: 2px;
    background: var(--tb-bg);
}
.topbar .agent-icon-badge {
    width: 0.85rem; height: 0.85rem;
    font-size: 0.55rem;
    top: -2px; right: -2px;
    border-color: var(--tb-bg);
}
/* The "Agents" text label is redundant beside the robot icons in the topbar. */
.topbar .agent-bar-label { display: none; }

.agent-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--bg-code, #f0f0f0);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
    font-size: 1rem;
    user-select: none;
}
.agent-icon:hover { border-color: var(--accent); }
.agent-icon[data-status="working"] { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.agent-icon[data-status="idle"]    { border-color: var(--border); }
.agent-icon[data-status="soliciting"] { border-color: #3b82f6; }
.agent-icon[data-status="disabled"],
.agent-icon[data-status="offline"] { opacity: 0.45; }

.agent-icon-badge {
    position: absolute;
    top: -3px; right: -3px;
    width: 1rem; height: 1rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    border: 1.5px solid var(--bg);
    line-height: 1;
}
.agent-badge-working  { background: #22c55e; color: #fff; }
.agent-badge-idle     { background: #94a3b8; color: #fff; }
.agent-badge-offline  { background: #ef4444; color: #fff; }
.agent-badge-question { background: #f59e0b; color: #fff; }

.agent-icon-label {
    font-size: 0.7rem;
    color: var(--fg-muted);
    margin-top: 0.2rem;
}

.agent-bar-label {
    font-size: 0.75rem;
    color: var(--fg-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Agent popup (CSS-driven, shown on click) ───────────────────────────── */
.agent-popup {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    min-width: 11rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
}
.agent-popup::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px; height: 8px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}
.agent-icon.agent-popup-open .agent-popup { display: block; }
.agent-popup-name {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--fg);
}
.agent-popup-row {
    display: flex;
    gap: 0.4rem;
    line-height: 1.6;
}
.agent-popup-key {
    color: var(--fg-muted);
    min-width: 4.5rem;
}
.agent-popup-val { color: var(--fg); }
.agent-popup-status[data-status="working"] { color: #22c55e; font-weight: 600; }
.agent-popup-status[data-status="idle"]    { color: var(--fg-muted); }
.agent-popup-status[data-status="offline"],
.agent-popup-status[data-status="disabled"] { color: #ef4444; }

/* ── Ticket active-agent indicator ─────────────────────────────────────── */
.ticket-agent-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem; height: 1.1rem;
    border-radius: 50%;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-right: 0.25rem;
}
.ticket-agent-dot.working  { color: #22c55e; animation: agent-pulse 2s infinite; }
.ticket-agent-dot.idle     { color: var(--fg-muted); }

@keyframes agent-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ── Recommend ready banner ─────────────────────────────────────────────── */
.recommend-ready-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.35);
    border-radius: var(--radius, 6px);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.recommend-ready-banner .rr-icon { font-size: 1.1rem; }
.recommend-ready-banner .rr-msg  { flex: 1; }

/* ── PR notification ────────────────────────────────────────────────────── */
.notif-pr-ready {
    border-left: 3px solid #22c55e;
}
.notif-pr-ready .notif-icon { color: #22c55e; }

/* ── Refinement chat panel ─────────────────────────────────────────────── */
.refinement-status {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.8125rem; color: var(--fg-2);
    padding: 6px 10px; margin-bottom: 8px;
    background: var(--accent-tint);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
}
.refinement-status.hidden { display: none; }
.refinement-status-busy { color: var(--fg); }
/* Warning variant: no refiner LLM is wired up. */
.refinement-status-warn {
    color: var(--fg);
    background: rgba(220, 140, 0, 0.12);
    border-color: rgba(220, 140, 0, 0.55);
}
.refinement-warn-icon { color: #d08c00; }
.refinement-no-llm-note {
    align-self: stretch;
    font-size: 0.8125rem;
    color: var(--fg);
    background: rgba(220, 140, 0, 0.10);
    border: 1px solid rgba(220, 140, 0, 0.45);
    border-radius: var(--radius);
    padding: 8px 10px;
}
.refinement-no-llm-note .meta { margin-top: 4px; color: var(--fg-2); }
.refinement-no-llm-note code {
    font-family: var(--mono, monospace);
    background: var(--card);
    padding: 1px 4px;
    border-radius: 4px;
}

/* Animated pulse used by the status line, card chip, and thinking bubble. */
.refining-pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent); display: inline-block;
    animation: refining-pulse 1s infinite ease-in-out;
}
@keyframes refining-pulse {
    0%, 100% { opacity: 0.25; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.15); }
}

/* Board card "actively refining" cue. Uses outline (not border/box-shadow) so the
   :hover rule — which changes border-color and box-shadow — can't override it. */
.ticket-card-refining {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}
.chip-refining {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-tint);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.refinement-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
    margin-bottom: 10px;
}
.refinement-bubble {
    max-width: 80%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card);
    box-shadow: var(--card-shadow);
}
.refinement-bubble-agent {
    align-self: flex-start;
    border-top-left-radius: 2px;
    background: var(--accent-tint);
    border-color: var(--accent);
}
.refinement-bubble-human {
    align-self: flex-end;
    border-top-right-radius: 2px;
}
.refinement-thinking { opacity: 0.85; }
.refinement-streaming .refinement-text::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--accent);
    animation: refinement-caret 1s steps(1) infinite;
}
@keyframes refinement-caret {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}
.refinement-typing {
    display: inline-flex; gap: 3px; vertical-align: middle;
}
.refinement-typing span {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    animation: refinement-blink 1.2s infinite ease-in-out both;
}
.refinement-typing span:nth-child(2) { animation-delay: 0.2s; }
.refinement-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes refinement-blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}
.refinement-author {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--fg-2);
    margin-bottom: 2px;
}
.refinement-text {
    color: var(--fg);
    white-space: pre-wrap;
    word-break: break-word;
}
.refinement-date {
    font-size: 0.68rem;
    color: var(--fg-2);
    margin-top: 4px;
}
.refinement-compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.refinement-compose textarea {
    flex: 1;
    min-height: 56px;
    resize: vertical;
}
.refinement-approve-box {
    border: 1px solid var(--accent);
    background: var(--accent-tint);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}
.refinement-approve-banner {
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 8px;
}
.refinement-subheading {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--fg-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 6px 0 4px;
}
.refinement-child {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card);
    margin-bottom: 6px;
}
.refinement-child-body {
    flex: 1;
    min-width: 0;
}
.refinement-child-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.refinement-reorder-btn {
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--fg-2);
    border-radius: 4px;
    font-size: 0.6rem;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
}
.refinement-reorder-btn:hover:not(:disabled) {
    color: var(--fg);
    border-color: var(--fg-2);
}
.refinement-reorder-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ── Context graph view ───────────────────────────────────────────── */
.context-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.context-toolbar input {
    min-width: 220px;
}
.context-graph-wrap {
    position: relative;
    padding: 8px 12px;
}
.context-graph {
    display: block;
    width: 100%;
    height: auto;
    min-height: 320px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}
.context-graph-wrap .empty {
    padding: 28px 16px;
}
.context-edge {
    stroke: var(--card-border);
    stroke-width: 1.5;
}
.context-edge.dimmed {
    opacity: 0.18;
}
.context-node {
    cursor: pointer;
}
.context-node circle {
    fill: var(--fg-2);
    stroke: var(--card);
    stroke-width: 2;
}
.context-node-ticket circle {
    fill: var(--accent);
}
.context-node-document circle {
    fill: hsl(150 45% 42%);
}
.context-node-url circle {
    fill: hsl(210 60% 52%);
}
.context-node text {
    fill: var(--fg-2);
    font-size: 11px;
    pointer-events: none;
}
.context-node:hover circle {
    stroke: var(--fg);
}
.context-node.dimmed {
    opacity: 0.22;
}
.context-node.focus circle {
    stroke: var(--fg);
    stroke-width: 2.5;
}
.context-node.focus text {
    fill: var(--fg);
    font-weight: 600;
}
.context-node.matched circle {
    stroke: var(--accent);
    stroke-width: 3;
}
.context-node.matched text {
    fill: var(--fg);
}
.context-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 16px 14px;
    flex-wrap: wrap;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--fg-2);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.legend-ticket {
    background: var(--accent);
}
.legend-document {
    background: hsl(150 45% 42%);
}
.legend-url {
    background: hsl(210 60% 52%);
}

/* Workflow graph layout (TK-117: positioning rules were missing from this
   stylesheet, so nodes rendered full-width in normal flow instead of at their
   computed coordinates). */
.workflow-graph-viewport { position: relative; overflow: auto; max-height: 70vh; }
.workflow-graph-frame { position: relative; }
.workflow-graph-surface { position: relative; }
.workflow-graph-links { position: absolute; top: 0; left: 0; }
.workflow-graph-node { position: absolute; }

/* Command palette (Shift Shift quick-switcher, TK-127). */
#command-palette-overlay { align-items: flex-start; }
.command-palette {
  width: min(560px, 92vw);
  margin-top: 12vh;
  background: var(--surface, #1b1d22);
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.command-palette-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 16px;
  border: none;
  border-bottom: 1px solid var(--border, #333);
  background: transparent;
  color: inherit;
  outline: none;
}
.command-palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.command-palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px; cursor: pointer;
}
.command-palette-item .cp-slash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; opacity: 0.8; }
.command-palette-item .cp-label { margin-left: auto; opacity: 0.65; font-size: 13px; }
.command-palette-item.active, .command-palette-item:hover { background: var(--accent-soft, rgba(255, 122, 26, 0.16)); }
.command-palette-empty { padding: 14px 16px; opacity: 0.6; }
.command-palette-hint { padding: 8px 14px; font-size: 12px; opacity: 0.55; border-top: 1px solid var(--border, #333); }
.command-palette-hint kbd {
  font-family: inherit; font-size: 11px; padding: 1px 5px; margin: 0 2px;
  border: 1px solid var(--border, #444); border-radius: 4px; opacity: 0.9;
}

/* Chat / multiplayer rooms (TK-118 S5). */
#view-chat .chat-room-group { padding: 8px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; }
#view-chat .chat-room-item { display: block; width: 100%; text-align: left; padding: 7px 12px; border: none; background: transparent; color: inherit; cursor: pointer; border-radius: 6px; }
#view-chat .chat-room-item:hover { background: var(--accent-soft, rgba(255,122,26,.12)); }
#view-chat .chat-room-item.active { background: var(--accent-soft, rgba(255,122,26,.2)); font-weight: 600; }
/* Unified full-height chat shell: rooms sidebar + message pane as one panel. */
#view-chat { padding: 16px; }
.chat-shell {
    flex: 1; display: flex; min-height: 0;
    border: 1px solid var(--card-border); border-radius: 10px; overflow: hidden;
    background: var(--card);
}
.dark .chat-shell { background: hsl(22 10% 14%); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; }
.chat-sidebar {
    width: 280px; flex-shrink: 0;
    border-right: 1px solid var(--border, #333);
    background: hsl(38 24% 96%);
}
.dark .chat-sidebar { background: hsl(22 10% 18%); }
.chat-sidebar .card-header { padding: 12px 14px; }
#chat-rooms-list { flex: 1; overflow-y: auto; padding: 4px 6px; }
.chat-main { flex: 1; min-width: 0; }
.chat-main .card-header { padding: 12px 16px; border-bottom: 1px solid var(--border, #333); }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) {
    .chat-shell { flex-direction: column; }
    .chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border, #333); max-height: 30vh; }
}
.chat-msg { padding: 5px 8px; border-radius: 6px; }
.chat-msg-sender { font-weight: 600; margin-right: 6px; opacity: .85; }
.chat-msg-system, .chat-msg-agent_event { opacity: .7; font-style: italic; }
.chat-msg-task { background: var(--accent-soft, rgba(255,122,26,.12)); }
.chat-composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border, #333); }
.chat-composer-input, #chat-composer-input { flex: 1; padding: 9px 12px; border-radius: 7px; border: 1px solid var(--border, #444); background: transparent; color: inherit; }
.chat-member { padding: 4px 8px; }
.chat-mention { color: var(--accent, #ff7a1a); font-weight: 600; }
.chat-label { color: #5aa9e6; font-weight: 600; }
.chat-room-item .chat-room-count { float: right; opacity: .5; font-size: 11px; }
.chat-room-item.unread { font-weight: 700; }
.chat-unread-dot { color: var(--accent, #ff7a1a); font-weight: 800; }

/* Board keyboard navigation focus ring (TK-128). */
.ticket-card.kbd-focus { outline: 2px solid var(--accent, #ff7a1a); outline-offset: 1px; }

/* Access-roles admin panel (TK-135). */
#view-access .access-role-item { display: block; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px; background: var(--card); border: 1px solid var(--card-border); border-radius: 6px; cursor: pointer; color: inherit; }
#view-access .access-role-item:hover { border-color: var(--accent, #ff7a1a); }
#view-access .access-role-item.active { border-color: var(--accent, #ff7a1a); background: var(--accent-soft, rgba(255,122,26,0.12)); }
#view-access .access-check-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }

/* Red unread counter near a room in the chat list (TK-139). */
.chat-unread-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; }

/* Collapsible chat group headers (TK chat room-list overhaul). */
#view-chat button.chat-room-group { display: flex; align-items: center; gap: 4px; width: 100%; border: none; background: transparent; color: inherit; cursor: pointer; }
#view-chat button.chat-room-group:hover { opacity: 0.85; }
#view-chat .chat-group-caret { font-size: 10px; opacity: 0.7; width: 12px; display: inline-block; }
#view-chat .chat-room-group .chat-unread-badge { margin-left: auto; }

/* Detail panels fill the panel space without a floating-card border (TK). */
.view > .card,
.view-split > .card,
.view.split > .card:last-child,
.settings-panel > .card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}
/* Single-detail views and split detail panes fill the available height. */
#view-projects > .card,
.view.split > .card:last-child,
.view-split > .card:last-child {
    flex: 1;
    min-height: 0;
}

/* Chat message bubbles (TK-156): self aligns left; responder (agent/person) right with an avatar. */
.chat-bubble-row { display: flex; gap: 8px; margin: 6px 0; align-items: flex-end; }
.chat-bubble-row.chat-msg-self { justify-content: flex-start; }
.chat-bubble-row.chat-msg-other { justify-content: flex-end; }
.chat-bubble { max-width: 76%; padding: 7px 11px; border-radius: 12px; background: var(--card-border, #2a2a2a); }
.chat-msg-self .chat-bubble { background: var(--accent-soft, rgba(255,122,26,.14)); border-bottom-left-radius: 4px; }
.chat-msg-other .chat-bubble { border-bottom-right-radius: 4px; }
.chat-msg-meta { font-size: 11px; opacity: .75; margin-bottom: 2px; }
.chat-msg-model { margin-left: 6px; opacity: .6; font-style: italic; }
.chat-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px; font-weight: 600; background: var(--card-border, #333); }
.chat-avatar-agent { background: var(--accent-soft, rgba(255,122,26,.2)); }
.chat-typing-dots { display: inline-flex; gap: 3px; align-items: center; padding: 3px 2px; }
.chat-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .4; animation: chatTyping 1.2s infinite; }
.chat-typing-dots span:nth-child(2) { animation-delay: .2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chatTyping { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }
.chat-presence { margin-top: 2px; color: var(--accent, #2ea043); font-size: 0.75rem; }
.chat-typing-indicator { padding: 2px 8px; color: var(--fg-2); font-size: 0.75rem; font-style: italic; min-height: 1em; }
.chat-queue { border-top: 1px solid var(--card-border, #333); padding: 6px 8px; max-height: 30%; overflow-y: auto; }
.chat-queue-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-2); margin-bottom: 4px; }
.chat-queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-queue-item { display: flex; align-items: baseline; gap: 6px; font-size: 0.8125rem; }
.chat-queue-state { width: 1em; flex-shrink: 0; text-align: center; }
.chat-queue-instr { flex: 1; }
.chat-queue-agent { color: var(--fg-2); font-size: 0.75rem; flex-shrink: 0; }
.chat-queue-running .chat-queue-state { color: var(--accent, #2ea043); }
.chat-queue-done .chat-queue-instr { opacity: .6; text-decoration: line-through; }
.chat-queue-failed .chat-queue-state { color: var(--danger, #d33); }
