/* Yexy Admin — design tokens, layout, components. Dark by default, light via [data-theme=light] or OS. */
:root {
  --font: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 224px;
  --fs: 14px;

  --bg: #0e1015;
  --bg-elev: #151821;
  --bg-elev2: #1b1f2a;
  --bg-hover: #212634;
  --border: #272c3a;
  --border-strong: #353b4d;
  --fg: #e6e8ee;
  --fg-muted: #9aa3b5;
  --fg-faint: #6b7385;
  --accent: #7c7cf0;
  --accent-strong: #5b5bd6;
  --accent-soft: rgba(124, 124, 240, 0.16);
  --ok: #3ccf8e;
  --ok-soft: rgba(60, 207, 142, 0.16);
  --warn: #f2b93b;
  --warn-soft: rgba(242, 185, 59, 0.16);
  --danger: #ef6b73;
  --danger-soft: rgba(239, 107, 115, 0.16);
  --info: #5cb3ff;
  --info-soft: rgba(92, 179, 255, 0.16);
  --user-bubble: #223052;
  --agent-bubble: #1e2430;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --sel: rgba(124, 124, 240, 0.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7fa;
  --bg-elev: #ffffff;
  --bg-elev2: #f0f2f6;
  --bg-hover: #e9ecf3;
  --border: #e1e4ec;
  --border-strong: #c9ceda;
  --fg: #171a22;
  --fg-muted: #5a6275;
  --fg-faint: #8b93a6;
  --accent: #5b5bd6;
  --accent-strong: #4646c4;
  --accent-soft: rgba(91, 91, 214, 0.12);
  --ok: #1f9d64;
  --ok-soft: rgba(31, 157, 100, 0.12);
  --warn: #b7791f;
  --warn-soft: rgba(183, 121, 31, 0.14);
  --danger: #d33f49;
  --danger-soft: rgba(211, 63, 73, 0.12);
  --info: #2a7fd4;
  --info-soft: rgba(42, 127, 212, 0.12);
  --user-bubble: #e4ebfb;
  --agent-bubble: #f0f2f6;
  --shadow: 0 8px 30px rgba(20, 24, 40, 0.14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f6f7fa; --bg-elev: #ffffff; --bg-elev2: #f0f2f6; --bg-hover: #e9ecf3; --border: #e1e4ec; --border-strong: #c9ceda;
    --fg: #171a22; --fg-muted: #5a6275; --fg-faint: #8b93a6; --accent: #5b5bd6; --accent-strong: #4646c4; --accent-soft: rgba(91,91,214,.12);
    --ok: #1f9d64; --ok-soft: rgba(31,157,100,.12); --warn: #b7791f; --warn-soft: rgba(183,121,31,.14); --danger: #d33f49; --danger-soft: rgba(211,63,73,.12);
    --info: #2a7fd4; --info-soft: rgba(42,127,212,.12); --user-bubble: #e4ebfb; --agent-bubble: #f0f2f6; --shadow: 0 8px 30px rgba(20,24,40,.14); color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fs)/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; } h4 { font-size: 13px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 8px; }
.muted { color: var(--fg-muted); } .faint { color: var(--fg-faint); } .tiny { font-size: 12px; } .small { font-size: 12.5px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); } .info { color: var(--info); }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.right { margin-left: auto; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: var(--sel); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-elev); border-right: 1px solid var(--border); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-strong); display: inline-block; position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 7px 7px 8px; border: 2.5px solid #fff; border-top: none; border-right: none; transform: rotate(-45deg) translate(1px, -2px); border-radius: 1px; }
.brand h1 { font-size: 15px; } .brand .tiny { line-height: 1.1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius); color: var(--fg-muted); font-weight: 500; }
.nav a:hover { background: var(--bg-hover); color: var(--fg); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--fg); }
.nav a .icon { opacity: .85; }
.nav .section { padding: 12px 10px 4px; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; color: var(--fg-muted); }
.nav .count.live { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 0; font-size: 12px; color: var(--fg-muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; min-height: 52px; }
.topbar h1 { font-size: 16px; }
.content { padding: 18px 20px 40px; max-width: 1500px; width: 100%; }
.content.full { max-width: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--fg-muted); font-size: 13px; }
.crumbs a { color: var(--fg-muted); } .crumbs .sep { color: var(--fg-faint); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg-elev2); color: var(--fg); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; line-height: 1.2; min-height: 32px; }
.btn:hover { background: var(--bg-hover); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); } .btn.danger.solid { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-muted); } .btn.ghost:hover { background: var(--bg-hover); color: var(--fg); }
.btn.sm { padding: 3px 8px; min-height: 26px; font-size: 12.5px; } .btn.xs { padding: 1px 6px; min-height: 22px; font-size: 12px; }
.btn.wide { width: 100%; } .btn.icon-only { padding: 6px; width: 32px; }
.input, select, textarea { font: inherit; color: var(--fg); background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 6px 10px; min-height: 32px; width: 100%; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; min-height: 90px; }
textarea.code { font-family: var(--mono); font-size: 12.5px; tab-size: 2; }
.input.sm { min-height: 28px; padding: 4px 8px; font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--fg-muted); font-weight: 500; }
label.field > .input, label.field > select, label.field > textarea { color: var(--fg); font-weight: 400; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.search { position: relative; } .search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--fg-faint); pointer-events: none; }
.search .input { padding-left: 30px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar select { width: auto; min-width: 180px; }
.toolbar .search .input { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--fg-muted); padding: 5px 10px; font: inherit; cursor: pointer; font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.active { background: var(--accent-soft); color: var(--fg); }
.kbd { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-elev2); color: var(--fg-muted); line-height: 1.6; }

/* ---------- surfaces ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.card.tight { padding: 10px 12px; } .card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin-right: auto; }
.grid { display: grid; gap: 14px; } .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 12px 14px; } .stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; } .stat .l { color: var(--fg-muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--bg-elev2); border: 1px solid var(--border); color: var(--fg-muted); white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.mono { font-family: var(--mono); font-weight: 400; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); } .dot.info { background: var(--info); } .dot.accent { background: var(--accent); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-elev); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--fg-muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--bg-elev2); position: sticky; top: 0; white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--bg-hover); }
tr.selected td { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 16px; text-align: center; color: var(--fg-muted); }
.empty .big { font-size: 15px; color: var(--fg); margin-bottom: 4px; }
.error-box { background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.note { background: var(--info-soft); color: var(--fg); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; border-left: 3px solid var(--info); }
.note.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); padding: 20px; justify-content: center; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; font: inherit; font-weight: 500; color: var(--fg-muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover { color: var(--fg); } .tabs button.active { color: var(--fg); border-bottom-color: var(--accent); }
.tabs button .count { margin-left: 6px; font-size: 11px; color: var(--fg-faint); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--fg-muted); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }
.chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.chain .node { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 9px; display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.chain .node .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-faint); }
.chain .arrow { color: var(--fg-faint); }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.split.wide-left { grid-template-columns: 420px minmax(0, 1fr); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.list-item:last-child { border-bottom: 0; } .list-item:hover { background: var(--bg-hover); } .list-item.active { background: var(--accent-soft); }
.list-item .title { font-weight: 500; } .list-item .sub { font-size: 12px; color: var(--fg-muted); }

/* ---------- dialogs & toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(5, 7, 12, .55); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; backdrop-filter: blur(2px); }
.dialog { background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: min(560px, 100%); max-height: 84vh; display: flex; flex-direction: column; }
.dialog.lg { width: min(860px, 100%); } .dialog.xl { width: min(1100px, 100%); }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 8px; } .dialog-head h2 { margin-right: auto; }
.dialog-body { padding: 6px 18px 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--bg-elev); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px; }
.toast.ok { border-left-color: var(--ok); } .toast.danger { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.palette { width: min(640px, 100%); }
.palette .input { font-size: 15px; min-height: 42px; }
.palette .results { max-height: 50vh; overflow: auto; margin-top: 8px; }
.palette .results .list-item.active { background: var(--accent-soft); }

/* ---------- live view ---------- */
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.session-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.session-card:hover { border-color: var(--border-strong); }
.session-card .who { font-weight: 600; font-size: 15px; }
.transcript { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 300px; max-height: calc(100vh - 230px); overflow: auto; }
.turn { display: flex; flex-direction: column; gap: 3px; max-width: 78%; }
.turn.user { align-self: flex-end; align-items: flex-end; } .turn.agent { align-self: flex-start; }
.turn .who { font-size: 11px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .05em; }
.bubble { padding: 9px 12px; border-radius: 14px; line-height: 1.5; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.turn.user .bubble { background: var(--user-bubble); border-bottom-right-radius: 4px; }
.turn.agent .bubble { background: var(--agent-bubble); border-bottom-left-radius: 4px; }
.bubble.interim { opacity: .65; font-style: italic; }
.bubble.streaming::after { content: "▍"; color: var(--accent); animation: pulse 1s infinite; margin-left: 1px; }
.turn.system { align-self: center; max-width: 92%; }
.turn.system .bubble { background: transparent; border: 1px dashed var(--border-strong); color: var(--fg-muted); font-size: 12.5px; padding: 5px 10px; border-radius: 8px; }
.turn.tool .bubble { background: var(--warn-soft); font-family: var(--mono); font-size: 12.5px; border-radius: 8px; }
.turn.error .bubble { background: var(--danger-soft); color: var(--danger); font-size: 12.5px; border-radius: 8px; }
.state-strip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--fg-muted); flex-wrap: wrap; }
.state-strip .state { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev2); color: var(--fg); font-weight: 500; }
.state-strip .state.speaking { background: var(--ok-soft); color: var(--ok); } .state-strip .state.thinking { background: var(--accent-soft); color: var(--accent); } .state-strip .state.listening { background: var(--info-soft); color: var(--info); }
.feed { display: flex; flex-direction: column; max-height: calc(100vh - 170px); overflow: auto; }
.feed-item { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .t { color: var(--fg-faint); font-family: var(--mono); font-size: 11px; padding-top: 2px; }
.feed-item .acc { color: var(--accent); font-weight: 500; } .feed-item .txt { color: var(--fg); word-break: break-word; }
.feed-item.type-error .txt { color: var(--danger); } .feed-item.type-tool .txt { color: var(--warn); }
.feed-item.type-session .txt { color: var(--fg-muted); }

/* ---------- agent workspace ---------- */
.agent-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.agent-head h1 { font-size: 18px; }
.block-card { margin-bottom: 12px; }
.block-card .block-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.block-card textarea { min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
.meter { height: 6px; background: var(--bg-elev2); border-radius: 3px; overflow: hidden; width: 120px; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.warn > i { background: var(--warn); } .meter.danger > i { background: var(--danger); }
.ctx-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.ctx-bar > div { min-width: 2px; } .ctx-bar .free { background: var(--bg-elev2); }
.ctx-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; margin-top: 8px; }
.ctx-legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.c-system { background: #8e8ef5; } .c-blocks { background: #3ccf8e; } .c-tools { background: #f2b93b; } .c-summary { background: #5cb3ff; } .c-msgs { background: #ef8f6b; } .c-ext { background: #c08fef; }
.msg { border-left: 3px solid var(--border-strong); padding: 6px 10px; margin-bottom: 8px; background: var(--bg-elev); border-radius: 0 var(--radius) var(--radius) 0; }
.msg.user_message { border-left-color: var(--info); } .msg.assistant_message { border-left-color: var(--ok); } .msg.reasoning_message { border-left-color: var(--fg-faint); } .msg.tool_call_message, .msg.tool_return_message { border-left-color: var(--warn); } .msg.system_message { border-left-color: var(--accent); }
.msg.out-of-context { opacity: .55; }
.msg .meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--fg-muted); margin-bottom: 3px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.msg .body.mono { font-size: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; min-height: 240px; max-height: calc(100vh - 360px); overflow: auto; padding: 12px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-input textarea { min-height: 44px; max-height: 160px; }
.tool-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.tool-row:last-child { border-bottom: 0; }
.code-view { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; max-height: 50vh; overflow: auto; }

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 26px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; } .login-brand .logo { width: 34px; height: 34px; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { font-size: 12.5px; color: var(--fg-muted); font-weight: 500; margin-top: 6px; }
.login-card input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 9px 11px; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { margin-top: 12px; min-height: 38px; }
.form-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .live-layout { grid-template-columns: 1fr; } .split, .split.wide-left { grid-template-columns: 1fr; } .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 2px; padding: 6px 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); z-index: 6; }
  .brand { padding: 0 8px 0 2px; } .brand div { display: none; }
  .nav { display: flex; gap: 2px; } .nav a { padding: 6px 9px; } .nav a span.label { display: none; } .nav .section { display: none; }
  .sidebar-foot { display: none; }
  .content { padding: 14px 12px 60px; } .topbar { padding: 8px 12px; flex-wrap: wrap; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .turn { max-width: 94%; } .transcript { max-height: none; } .feed { max-height: 50vh; }
  .hide-mobile { display: none !important; }
  .backdrop { padding: 4vh 8px; }
}
