:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --border: #e3e5e9;
  --border-strong: #cfd3da;
  --text: #14171c;
  --text-2: #4d5562;
  --text-3: #7b8493;
  --brand: #173a5e;
  --accent: #2a78d6;
  --accent-soft: #e8f1fc;
  --agent-bg: #fbfaf7;
  --good: #0ca30c;
  --warn-ink: #8a5a00;
  --warn-bg: #fdf1d3;
  --crit: #d03b3b;
  --crit-bg: #fbe6e6;
  /* chart roles (reference data-viz palette) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-other: #a9afb9;
  --grid: #e7e9ed;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #131416; --surface: #1c1d20; --surface-2: #222428; --border: #2e3136; --border-strong: #3d4148;
    --text: #eef0f3; --text-2: #b9bfc9; --text-3: #8a919e;
    --brand: #3987e5; --accent: #5b9df0; --accent-soft: #1d2c40; --agent-bg: #18191b;
    --warn-ink: #f3c861; --warn-bg: #3a2f12; --crit: #e66767; --crit-bg: #3b1f1f;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-other: #5d636e;
    --grid: #2b2e33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr) 400px; grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.shell.agent-hidden { grid-template-columns: 208px minmax(0, 1fr) 0; }
.shell.agent-hidden .agent { display: none; }

/* ---------- sidebar ---------- */
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark { color: var(--brand); display: flex; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--text-2); text-align: left; font-weight: 500; }
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--accent-soft); color: var(--accent); }
.nav .count { font-size: 12px; color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.workspace-name { font-weight: 600; }
.plan-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.link-btn { border: 0; background: none; padding: 0; color: var(--text-3); cursor: pointer; font-size: 12px; text-align: left; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }

/* ---------- main ---------- */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.topbar h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.view { flex: 1; overflow: auto; padding: 4px 24px 32px; outline: none; }

.btn { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.ghost[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.spark { color: var(--series-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- list toolbar + chips ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 0 1 260px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; font-size: 12.5px; font-weight: 500; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.chip button:hover { background: rgba(0, 0, 0, .1); }
.result-count { color: var(--text-3); font-size: 12.5px; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 11px; cursor: pointer; color: var(--text-2); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.primary { font-weight: 600; }
.muted { color: var(--text-3); }
.empty { padding: 40px; text-align: center; color: var(--text-3); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.pill.good { background: color-mix(in srgb, var(--good) 12%, transparent); border-color: transparent; color: color-mix(in srgb, var(--good) 70%, var(--text)); }
.pill.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.pill.crit { background: var(--crit-bg); border-color: transparent; color: var(--crit); }
.pill.info { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

@keyframes flash { 0%, 60% { background: color-mix(in srgb, var(--series-4) 28%, transparent); } 100% { background: transparent; } }
.flash, tr.flash td { animation: flash 2.4s ease-out; }

/* ---------- deal board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.board-head strong { font-size: 13px; }
.board-head span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.deal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.deal-card:hover { border-color: var(--accent); }
.deal-card .name { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.deal-card .co { color: var(--text-3); font-size: 12px; }
.deal-card .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; }
.deal-card .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--border); color: var(--text-2); display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; }
.board-more { text-align: center; font-size: 12px; color: var(--text-3); padding: 4px; }

/* ---------- drawer ---------- */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: auto; padding: 20px 22px 32px; z-index: 5; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.drawer-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.drawer h2 { font-size: 19px; letter-spacing: -.01em; }
.drawer-sub { color: var(--text-2); margin-bottom: 16px; }
.close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-3); padding: 2px 6px; border-radius: 6px; }
.close:hover { background: var(--surface-2); color: var(--text); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 20px; }
.field label { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.field div, .field select { font-weight: 500; overflow-wrap: anywhere; }
.field select { border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 6px; background: var(--surface); }
.drawer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 18px 0 8px; }
.rel { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.rel:hover { border-color: var(--accent); }
.rel .sub { color: var(--text-3); font-size: 12px; }
.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 14px; display: grid; gap: 12px; }
.timeline .item { position: relative; }
.timeline .item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .when { font-size: 12px; color: var(--text-3); }

/* ---------- dashboards ---------- */
.dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 12px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.dash-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.dash-head h2 { font-size: 18px; letter-spacing: -.01em; }
.dash-head p { color: var(--text-2); }
.dash-meta { display: flex; gap: 10px; align-items: center; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; margin-right: 5px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.widget { padding: 16px; min-width: 0; animation: rise .35s ease-out backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.widget h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1250px) { .span-3 { grid-column: span 6; } .span-4, .span-6, .span-8 { grid-column: span 12; } }
.kpi-value { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.widget.kpi h3 { margin-bottom: 6px; }
.widget-text { color: var(--text-2); font-size: 14px; }
.widget .table-wrap { margin: 0 -16px -16px; }
.widget td, .widget th { padding: 8px 16px; }

.hbars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 8px 12px; align-items: center; }
.hbars .label { color: var(--text-2); font-size: 12.5px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { height: 16px; display: flex; }
.hbars .bar { height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; transition: width .5s ease-out; }
.hbars .val { font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 500; }
.hbars .rowhit { display: contents; cursor: pointer; }
.hbars .rowhit:hover .bar { filter: brightness(1.12); }
.hbars.funnel .track { justify-content: center; }
.hbars.funnel .bar { border-radius: 4px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap svg { flex: none; }
.legend { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content max-content; gap: 6px 10px; align-items: center; font-size: 12.5px; flex: 1; min-width: 180px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .lv { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.legend .lp { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.chart-svg { display: block; width: 100%; overflow: visible; }
.chart-svg text { fill: var(--text-3); font-size: 11px; }
.chart-svg .hit { cursor: pointer; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; box-shadow: var(--shadow-lg); max-width: 240px; }
.tooltip b { font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 60; }

.canvas-empty { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--text-2); }
.canvas-empty h2 { font-size: 17px; margin-bottom: 6px; color: var(--text); }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.suggest button, .starter { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.suggest button:hover, .starter:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- agent panel ---------- */
.agent { position: relative; background: var(--agent-bg); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.agent-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.agent-title { font-weight: 650; }
.agent-mode { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.agent-mode.scripted { color: var(--warn-ink); }
.agent-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.agent-log > * { flex-shrink: 0; } /* messages keep their height; the log scrolls instead of squeezing them */
.agent-head, .agent-form, .agent-hint, .allowance { flex-shrink: 0; }
.jump-latest { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 3; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer; box-shadow: var(--shadow-lg); }
.jump-latest:hover { color: var(--accent); border-color: var(--accent); }
.msg.user { align-self: flex-end; max-width: 88%; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { display: grid; gap: 8px; }
.msg .prose { overflow-wrap: anywhere; }
.msg .prose p { margin: 0 0 8px; } .msg .prose p:last-child { margin-bottom: 0; }
.msg .prose ul { margin: 4px 0 8px; padding-left: 20px; }
.msg .prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.msg .error { color: var(--crit); background: var(--crit-bg); padding: 8px 10px; border-radius: 8px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.step .icon { width: 14px; height: 14px; flex: none; display: grid; place-items: center; font-size: 11px; color: var(--good); }
.step.running .icon { border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.step.failed .icon { color: var(--text-3); }
.step .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.change { align-items: flex-start; }
.step.change .label { white-space: normal; }
.step .diff { color: var(--text-3); display: block; margin-top: 1px; }
.step .diff s { opacity: .8; }
.step.undone .label { text-decoration: line-through; color: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking { display: flex; gap: 4px; padding: 4px 2px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite both; }
.thinking i:nth-child(2) { animation-delay: .2s; } .thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.welcome { color: var(--text-2); display: grid; gap: 10px; }
.welcome h2 { font-size: 16px; color: var(--text); }
.starters { display: grid; gap: 6px; }
.starter { border-radius: 10px; text-align: left; padding: 9px 12px; }
.agent-form { display: flex; gap: 8px; padding: 12px 16px 6px; align-items: flex-end; }
.agent-form textarea { flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; background: var(--surface); max-height: 140px; line-height: 1.4; }
.agent-hint { font-size: 11px; color: var(--text-3); padding: 0 16px 12px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 150px minmax(0, 1fr) 350px; }
  .shell.agent-hidden { grid-template-columns: 150px minmax(0, 1fr) 0; }
  .nav .count { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- sign-in ---------- */
[hidden] { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); padding: 28px; display: grid; gap: 14px; }
.login-card .brand { padding: 0 0 6px; }
.login-card h1 { font-size: 20px; letter-spacing: -.01em; }
.login-card label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.login-card input { padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 14px; }
.login-card .btn { padding: 10px; margin-top: 4px; }
.login-error { color: var(--crit); background: var(--crit-bg); padding: 8px 10px; border-radius: 8px; font-size: 13px; }

/* ---------- daily allowance ---------- */
.allowance { display: flex; align-items: center; gap: 8px; padding: 0 16px 6px; font-size: 11px; color: var(--text-3); }
.allowance-bar { flex: 0 0 72px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.allowance-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s; }
.allowance.high .allowance-bar i { background: var(--crit); }
.allowance.high { color: var(--crit); }

/* ---------- briefing, suggestions, email ---------- */
.briefing-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.briefing-head .link-btn { text-transform: none; letter-spacing: 0; font-weight: 400; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.suggestion { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.suggestion:hover { background: var(--accent); color: #fff; }
.step.email details { margin-top: 4px; }
.step.email summary { cursor: pointer; color: var(--text); font-weight: 500; }
.step.email .email-meta { color: var(--text-3); margin: 6px 0 4px; }
.step.email .email-body { white-space: pre-wrap; color: var(--text-2); border-left: 2px solid var(--border-strong); padding-left: 10px; }
.step.email .pill { margin-left: 4px; font-size: 11px; padding: 1px 7px; }

/* ---------- briefing card ---------- */
.briefing-card { display: grid; gap: 10px; }
.b-greeting { font-size: 15px; font-weight: 600; }
.b-counts { display: grid; gap: 3px; color: var(--text-2); font-size: 13px; }
.b-counts b { color: var(--text); font-variant-numeric: tabular-nums; }
.b-picks { display: grid; gap: 6px; }
.b-picks h4 { margin: 6px 0 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.b-wait { font-size: 12.5px; animation: blink 1.4s infinite both; }
.b-item { display: grid; gap: 3px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; animation: rise .3s ease-out backwards; }
.b-item:hover:not(:disabled) { border-color: var(--accent); }
.b-item:disabled { cursor: default; }
.b-title { font-weight: 600; font-size: 13px; }
.b-meta { color: var(--text-3); font-size: 12px; }
.b-facts { display: flex; flex-wrap: wrap; gap: 4px; }
.b-facts .pill { font-size: 11px; padding: 1px 7px; }
.b-reason { color: var(--text-2); font-size: 12.5px; }

/* ---------- admin ---------- */
.admin-tabs { margin-bottom: 14px; }
.admin-table td, .admin-table th { padding: 9px 16px; }
.meter { display: inline-block; vertical-align: middle; width: calc(100% - 44px); max-width: 220px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.meter.high i { background: var(--crit); }
.kpi .meter { display: block; width: 100%; max-width: none; margin-top: 10px; }
.meter-label { margin-left: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.daybars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; height: 170px; align-items: end; }
.daybar { display: grid; grid-template-rows: 16px minmax(0, 1fr) 18px; height: 100%; justify-items: center; align-items: end; font-size: 11px; color: var(--text-3); }
.daybar i { width: min(28px, 70%); background: var(--series-1); border-radius: 4px 4px 0 0; align-self: end; }
.daybar-value { color: var(--text-2); font-variant-numeric: tabular-nums; }
.daybar-label { white-space: nowrap; overflow: hidden; }
.admin-note { margin: 14px 0 10px; font-size: 12.5px; max-width: 900px; }
.admin-note code, .admin-upload code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.admin-upload { display: flex; gap: 24px; justify-content: space-between; align-items: center; padding: 18px 20px; margin-bottom: 12px; border-style: dashed; border-width: 1.5px; }
.admin-upload.dragging { border-color: var(--accent); background: var(--accent-soft); }
.admin-upload h3 { font-size: 15px; margin-bottom: 6px; }
.admin-upload p { margin-bottom: 4px; max-width: 760px; font-size: 13px; }
.admin-upload-actions { display: grid; gap: 6px; justify-items: center; flex: none; font-size: 12px; }
.upload-error { white-space: pre-wrap; color: var(--crit); background: var(--crit-bg); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.skill-list { display: grid; gap: 10px; }
.skill { padding: 14px 18px; }
.skill.disabled .skill-desc, .skill.disabled .skill-name { opacity: .6; }
.skill-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.skill-name { font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.skill-name .pill { font-family: inherit; margin-left: 6px; }
.skill-desc { margin: 4px 0; color: var(--text-2); max-width: 820px; }
.skill-meta { font-size: 12px; }
.skill-actions { display: flex; gap: 6px; flex: none; }
.skill details { margin-top: 10px; }
.skill summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.skill-body { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; max-height: 320px; overflow: auto; }
.skill-body p { margin: 0 0 8px; } .skill-body ul { margin: 4px 0 8px; padding-left: 20px; }

/* the model line can be long now that three models are named */
.agent-head .link-btn { flex: none; white-space: nowrap; margin-left: 12px; }
.agent-mode { line-height: 1.35; }
