/* BearBull Desk — page and widget styles. Tokens only. */

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .mark { animation: skp 1.2s ease-in-out infinite; }

/* ── login ──────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: var(--s10) var(--s12);
  background:
    radial-gradient(1200px 600px at 10% 110%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, var(--bk-swing) 22%, transparent), transparent 60%),
    radial-gradient(700px 500px at 70% 100%, color-mix(in srgb, #FF9F7A 35%, transparent), transparent 60%),
    var(--surface-2);
}
.login-hero .logo .wm { font-size: 20px; }
.login-hero .logo .mark { width: 34px; height: 34px; }
.hero-copy h1 { font-size: 44px; line-height: 52px; letter-spacing: -.03em; font-weight: 750; max-width: 520px; }
.hero-copy p { margin-top: var(--s4); font-size: var(--fs-18); line-height: 28px; color: var(--ink-2); max-width: 460px; }
.hero-art { position: relative; height: 260px; margin: var(--s6) 0; }
.hero-art svg.wave { position: absolute; inset: 0; width: 100%; height: 100%; }
.float {
  position: absolute; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-2); border: 1px solid var(--line); font-size: var(--fs-13); animation: floaty 6s ease-in-out infinite;
}
.float b { display: block; font-size: var(--fs-18); line-height: var(--lh-18); }
.float .fi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--up-soft); color: var(--up); }
.float.f2 { animation-delay: -2s; } .float.f3 { animation-delay: -4s; }
.float.f2 .fi { background: var(--brand-soft); color: var(--brand-ink); }
.float.f3 .fi { background: var(--info-soft); color: var(--info); }
@keyframes floaty { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }
.hero-foot { font-size: var(--fs-13); color: var(--ink-3); }
.login-side { display: grid; place-items: center; padding: var(--s8) var(--s6); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: var(--s5); }
.login-card h2 { font-size: var(--fs-24); line-height: var(--lh-24); }
.login-card .sub { color: var(--ink-3); margin-top: 4px; }
.login-as { display: flex; align-self: stretch; }
.login-as button { flex: 1; }
.login-card .btn.primary { height: 44px; font-size: var(--fs-16); }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw .btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.login-err { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); border-radius: var(--r); background: var(--down-soft); color: var(--down); font-size: var(--fs-13); font-weight: 500; }
.login-foot { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-13); color: var(--ink-3); }
.login-step { display: flex; flex-direction: column; gap: var(--s5); }
.login-step[hidden] { display: none; }
.login-code { font-family: var(--mono); font-size: var(--fs-20); letter-spacing: .12em; font-variant-numeric: tabular-nums; }

/* ── home ───────────────────────────────────────────── */
.home { gap: var(--s6); }
.hello { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; }
.hello h1 { font-size: var(--fs-32); line-height: var(--lh-32); letter-spacing: -.025em; }
.hello p { margin-top: 4px; color: var(--ink-3); font-size: var(--fs-14); }
.hello-scope { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-13); }
/* account picker (scope.js): which accounts the P&L covers */
.scope-slot { display: flex; align-items: center; min-height: 32px; max-width: 100%; }
.scope-slot:empty { display: none; }
.scope-seg button { min-width: 64px; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.check-t { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-height: 64px; }
.check-t .ci { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--up-soft); color: var(--up); }
.check-t.warn .ci { background: var(--warn-soft); color: var(--warn); }
.check-t.bad .ci { background: var(--down-soft); color: var(--down); }
.check-t.idle .ci { background: var(--sunken); color: var(--ink-3); }
.check-t .ct { font-weight: 600; }
.check-t .cd { font-size: var(--fs-13); color: var(--ink-3); }
.sumrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sumrow .kpi { border: 0; border-radius: 0; background: none; padding: var(--s4) var(--s5); }
.sumrow .kpi + .kpi { border-left: 1px solid var(--line); }
.sumrow .kpi-v { font-size: var(--fs-32); line-height: var(--lh-32); }
.books { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.bcard {
  position: relative; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); border-radius: var(--r-xl); min-height: 236px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.bcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.bcard:active { transform: translateY(0); }
.bcard::before { content: ""; position: absolute; left: var(--s5); right: var(--s5); top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--book); opacity: 0; transition: opacity var(--t-med) var(--ease); }
.bcard:hover::before, .bcard:focus-visible::before { opacity: 1; }
.bcard-top { display: flex; align-items: center; gap: var(--s3); }
.bicon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--book-soft); color: var(--book); flex: none; }
.bcard-top h2 { font-size: var(--fs-18); }
.bcard-top .grow .faint { font-size: var(--fs-12); }
.bcard .big { font-size: var(--fs-32); line-height: var(--lh-32); font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.bcard .big-l { font-size: var(--fs-12); color: var(--ink-3); font-weight: 500; }
.bfacts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-13); color: var(--ink-2); }
.bfacts b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bcard .open { margin-top: auto; display: flex; align-items: center; gap: 4px; font-size: var(--fs-13); font-weight: 650; color: var(--ink-2); }
.bcard:hover .open { color: var(--ink); }
.bcard .bk-key { position: absolute; top: var(--s5); right: var(--s5); }
.bcard.last::after { content: "Last opened"; position: absolute; top: -9px; left: var(--s5); padding: 0 var(--s2); border-radius: var(--r-full); background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; line-height: 18px; }
.home-low { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s4); }

/* ── workspace ──────────────────────────────────────── */
.ov-page { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 2 * var(--s6)); gap: var(--s4); max-width: none; }
.ov-ws { flex: 1 1 auto; min-height: 420px; display: flex; }
.ov-ws > * { flex: 1 1 auto; min-width: 0; min-height: 0; }
.ws-split { display: flex; min-width: 0; min-height: 0; }
.ws-split.ws-row { flex-direction: row; } .ws-split.ws-col { flex-direction: column; }
.ws-cell { display: flex; min-width: 0; min-height: 0; }
.ws-cell > * { flex: 1 1 auto; min-width: 0; min-height: 0; }
.ws-grip { flex: 0 0 12px; position: relative; cursor: col-resize; touch-action: none; }
.ws-split.ws-col > .ws-grip { cursor: row-resize; }
.ws-grip::after { content: ""; position: absolute; border-radius: 2px; background: transparent; transition: background var(--t-fast); }
.ws-split.ws-row > .ws-grip::after { top: 30%; bottom: 30%; left: 5px; width: 2px; }
.ws-split.ws-col > .ws-grip::after { left: 30%; right: 30%; top: 5px; height: 2px; }
.ws-grip:hover::after, .ws-grip.on::after { background: var(--brand-edge); }
body.dragging-x, body.dragging-x * { cursor: col-resize !important; user-select: none; }
body.dragging-y, body.dragging-y * { cursor: row-resize !important; user-select: none; }
.ws-panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.ws-tabs { display: flex; align-items: center; height: 44px; padding: 0 var(--s1) 0 var(--s2); border-bottom: 1px solid var(--line); flex: none; }
.ws-tablist { flex: 1 1 auto; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ws-tablist::-webkit-scrollbar { display: none; }
.ws-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--s1) 0 var(--s2); border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: 600; color: var(--ink-3); cursor: pointer; white-space: nowrap; flex: none; user-select: none;
}
.ws-tab:hover { background: var(--hover); color: var(--ink-2); }
.ws-tab.on { color: var(--ink); background: var(--sunken); }
.ws-tab .ic { color: var(--ink-3); }
.ws-tab.on .ic { color: var(--ink-2); }
/* tab drag: reorder in a panel, or drop on another panel */
body.ws-tabdrag, body.ws-tabdrag * { cursor: grabbing !important; user-select: none; }
.ws-tab.ws-src { opacity: .4; }
.ws-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.ws-mark { position: fixed; z-index: 1000; width: 2px; border-radius: 2px; background: var(--brand-edge); pointer-events: none; }
.ws-panel.ws-drop { border-color: var(--brand-edge); box-shadow: 0 0 0 1px var(--brand-edge), var(--shadow-1); }
.ws-x { width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--ink-3); cursor: pointer; opacity: 0; }
.ws-tab:hover .ws-x, .ws-tab.on .ws-x, .ws-x.vis { opacity: 1; }
.ws-x:hover { background: var(--press); color: var(--ink); }
.ws-acts { display: flex; flex: none; }
.ws-acts .btn { width: 32px; height: 32px; }
.ws-body { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; }
.w-root { min-height: 100%; display: flex; flex-direction: column; }
.ws-blank { height: 100%; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); text-align: center; padding: var(--s4); font-size: var(--fs-13); }
.ws-dia { width: 64px; height: 44px; }
.ws-dia rect { fill: none; stroke: currentColor; stroke-width: 1.4; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.tpl { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s4) var(--s3); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-3); text-align: center; }
.tpl:hover { border-color: var(--line-strong); color: var(--ink-2); }
.tpl.on { border-color: var(--brand-edge); background: var(--brand-soft); color: var(--ink); }
.tpl b { color: var(--ink); font-size: var(--fs-14); }
.tpl span { font-size: var(--fs-12); }

/* widget internals */
.w-pad { padding: var(--s3) var(--s4); }
.w-wide { display: flex; flex-direction: column; gap: var(--s3); overflow-x: auto; }
.w-foot { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-13); margin-top: auto; }
.w-hero { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.w-hero .big { font-size: var(--fs-40); line-height: var(--lh-40); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.w-hero .split { display: flex; gap: var(--s5); font-size: var(--fs-13); color: var(--ink-3); flex-wrap: wrap; }
.w-hero .split b { display: block; font-size: var(--fs-16); color: var(--ink); font-variant-numeric: tabular-nums; }
.w-hero.fill { min-height: 100%; }
.w-hero .push { margin-top: auto; }
.w-hero .big-pct { margin-left: var(--s2); font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums; }
.w-hero .hero-sub { margin-top: var(--s1); font-size: var(--fs-13); }
.w-hero .hero-rows { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--fs-13); }
.w-hero .hero-rows > div { display: flex; align-items: baseline; gap: var(--s2); }
.w-hero .hero-rows .faint { min-width: 88px; }
.w-hero .hero-rows .sym { flex: 1 1 auto; font-weight: 600; }
.w-hero .hero-kpis { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0 var(--s3); }
.w-hero .hero-kpis .kpi { padding: var(--s1) 0; }
.w-hero .hero-kpis .kpi-v { font-size: var(--fs-16); line-height: var(--lh-16); }
/* Widgets fit their panel (owner, 2026-11-23): each panel body is a size
   container, so content re-flows live while a splitter drags or a widget moves
   to a smaller or larger panel. Width steps: < 560 drop secondary table columns,
   < 420 two-line rows (same as phone); height steps: < 320 compact hero,
   < 220 headline only. Short + wide puts the hero figures beside the number. */
.ws-body { container: ws / size; }
@container ws (max-width: 560px) {
  .tbl th.hide-m, .tbl td.hide-m { display: none; }
  .w-pad, .w-hero { padding-left: var(--s3); padding-right: var(--s3); }
  .w-sel { padding: var(--s2) var(--s3) 0; }
  .w-foot { padding: var(--s2) var(--s3); }
}
@container ws (max-width: 420px) {
  .tbl.cards-m thead { display: none; }
  .tbl.cards-m, .tbl.cards-m tbody, .tbl.cards-m tr { display: block; }
  .tbl.cards-m tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); padding: var(--s2) var(--s3); }
  .tbl.cards-m td { height: auto; padding: 0 !important; border: 0; width: auto; font-size: var(--fs-13); color: var(--ink-3); }
  .tbl.cards-m td:first-child { flex: 1 1 60%; font-size: var(--fs-14); color: var(--ink); }
  .tbl.cards-m td.key { flex: 0 0 auto; margin-left: auto; font-size: var(--fs-14); font-weight: 600; }
  .tbl.cards-m td.meta { flex-basis: 100%; order: 3; }
  .w-hero .big { font-size: var(--fs-32); line-height: var(--lh-32); }
  .w-hero .split { gap: var(--s3); }
}
@container ws (max-height: 320px) {
  .w-hero { gap: var(--s2); padding-top: var(--s3); padding-bottom: var(--s3); }
  .w-hero .big { font-size: var(--fs-32); line-height: var(--lh-32); }
  .w-hero .push { display: none; }
  .health .hrow { padding-top: var(--s2); padding-bottom: var(--s2); }
}
@container ws (max-height: 320px) and (min-width: 640px) {
  .w-hero.fill { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); grid-auto-rows: min-content; column-gap: var(--s5); align-content: start; }
  .w-hero.fill > * { grid-column: 1; }
  .w-hero.fill > .hero-kpis { grid-column: 2; grid-row: 1 / span 4; align-self: start; }
}
@container ws (max-height: 220px) {
  .w-hero .big { font-size: var(--fs-24); line-height: var(--lh-24); }
  .w-hero .hero-sub { display: none; }
  .w-hero .split b { font-size: var(--fs-14); }
}
@container ws (max-height: 150px) {
  .w-hero > .faint:first-child { display: none; }
}
@container ws (max-height: 220px) and (max-width: 639px) {
  .w-hero .hero-kpis { display: none; }
}
.w-sel { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); padding: var(--s3) var(--s4) 0; }
.w-sel b.num { white-space: nowrap; }
.w-sel .select { height: 32px; font-size: var(--fs-13); }
.select.sm, .input.sm { height: 32px; font-size: var(--fs-13); }

/* clock */
.clock { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.clock-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.clock-big { font-size: var(--fs-40); line-height: var(--lh-40); font-weight: 700; letter-spacing: -.03em; }
.clock-list { display: flex; flex-direction: column; }
.clock-row { display: flex; align-items: center; gap: var(--s3); height: 40px; border-top: 1px solid var(--line); font-size: var(--fs-14); }
.clock-row b { font-weight: 600; min-width: 48px; text-align: right; }
.clock .btn { align-self: flex-start; }
/* notes */
.notes { display: flex; flex-direction: column; height: 100%; min-height: 220px; padding: var(--s3) var(--s4) var(--s3); gap: var(--s2); }
.notes-top { display: flex; gap: var(--s1); }
.note-area { flex: 1 1 auto; width: 100%; min-height: 120px; resize: none; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); background: var(--surface-2); line-height: 22px; font-size: var(--fs-14); }
.note-area:focus { outline: none; border-color: var(--ink-3); background: var(--surface); }
.note-area.c-sun { background: color-mix(in srgb, #FFC83D 16%, var(--surface)); }
.note-area.c-mint { background: color-mix(in srgb, #3DD68F 14%, var(--surface)); }
.note-area.c-sky { background: color-mix(in srgb, #6EA2FF 14%, var(--surface)); }
.note-area.c-rose { background: color-mix(in srgb, #FF8FA3 15%, var(--surface)); }
.note-area.c-lilac { background: color-mix(in srgb, #A68CFF 15%, var(--surface)); }
.notes-foot { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.swatch.c-none { background: var(--surface); } .swatch.c-sun { background: #FFC83D; } .swatch.c-mint { background: #3DD68F; }
.swatch.c-sky { background: #6EA2FF; } .swatch.c-rose { background: #FF8FA3; } .swatch.c-lilac { background: #A68CFF; }
/* sizer */
.sizer { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.sizer .fields { gap: var(--s3); }
.sizer-out .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sizer-out .kpi-v { font-size: var(--fs-20); line-height: var(--lh-20); }
/* alerts list */
.alist { display: flex; flex-direction: column; }
.aitem { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.aitem:last-child { border-bottom: 0; }
.aitem .dot { margin-top: 7px; }
.aitem.unread .a-t { font-weight: 650; }
.a-t { font-size: var(--fs-14); color: var(--ink); }
.a-b { font-size: var(--fs-13); color: var(--ink-2); margin-top: 2px; }
.a-m { font-size: var(--fs-12); color: var(--ink-3); margin-top: 2px; }
.alist.compact .aitem { padding: var(--s2) 0; }
.alist.compact .a-t { font-size: var(--fs-13); }
/* health */
.health { display: flex; flex-direction: column; }
.hrow { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.h-t { font-size: var(--fs-14); font-weight: 600; }
.h-d { font-size: var(--fs-12); color: var(--ink-3); }
/* events */
.evlist { display: flex; flex-direction: column; }
.ev { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-d { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: var(--r-sm); background: var(--sunken); line-height: 1.1; }
.ev-d b { font-size: var(--fs-16); }
.ev-d span { font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* charts */
.chart { position: relative; }
.chart svg .zero { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart svg .dd { fill: var(--down); opacity: .18; }
.chart svg .seg-line { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart svg .seg-lbl, .chart svg .ax, .chart-ax .ax { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart svg .xh { stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; pointer-events: none; }
.ch-tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch-dd { position: absolute; left: 0; font-size: 11px; color: var(--ink-3); pointer-events: none; }
.ch-seg { position: absolute; top: 12px; margin-left: 6px; font-size: 11px; color: var(--ink-3); pointer-events: none; white-space: nowrap; }
.chart-y { position: absolute; top: 4px; right: 0; bottom: 40px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); pointer-events: none; text-align: right; font-variant-numeric: tabular-nums; }
.chart-y span { background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 2px; border-radius: 3px; }
.chart-tip { position: absolute; top: 4px; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: var(--fs-12); pointer-events: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-empty { display: grid; place-items: center; min-height: 140px; color: var(--ink-3); font-size: var(--fs-13); }
.bars .zero { stroke: var(--line-strong); vector-effect: non-scaling-stroke; }
.bars .b-up { fill: var(--up); } .bars .b-down { fill: var(--down); }
.bars rect:hover { opacity: .75; }
/* donut (charts.js donut) */
.donut { position: relative; flex: none; }
.donut .dn-track { stroke: var(--sunken); }
.donut .dn-seg[data-slice] { cursor: pointer; }
.donut .dn-seg:hover { opacity: .8; }
.donut .dn-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut .dn-c b { font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut .dn-c span { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.heat { display: flex; gap: 4px; }
.hcol { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.hc { display: block; aspect-ratio: 1; min-width: 10px; border-radius: 4px; background: var(--sunken); }
.hc.f { background: transparent; border: 1px dashed var(--line); }
.hc.u1 { background: color-mix(in srgb, var(--up) 25%, var(--surface)); } .hc.u2 { background: color-mix(in srgb, var(--up) 45%, var(--surface)); }
.hc.u3 { background: color-mix(in srgb, var(--up) 70%, var(--surface)); } .hc.u4 { background: var(--up); }
.hc.d1 { background: color-mix(in srgb, var(--down) 25%, var(--surface)); } .hc.d2 { background: color-mix(in srgb, var(--down) 45%, var(--surface)); }
.hc.d3 { background: color-mix(in srgb, var(--down) 70%, var(--surface)); } .hc.d4 { background: var(--down); }
.spark { display: block; }

/* ── strategies list ────────────────────────────────── */
.strat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.scard { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-med); min-width: 0; }
.scard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.scard-top { display: flex; align-items: flex-start; gap: var(--s2); }
.scard .code { font-size: var(--fs-12); font-weight: 600; color: var(--ink-3); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard h3 { font-size: var(--fs-16); line-height: var(--lh-16); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.scard .fact span { display: block; font-size: var(--fs-12); color: var(--ink-3); }
.scard .fact b { font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.scard .verdict { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-13); color: var(--ink-2); }
.scard.off { opacity: .72; }
.journey { display: flex; align-items: center; gap: 4px; }
.journey i { flex: 1; height: 4px; border-radius: 2px; background: var(--sunken); }
.journey i.done { background: var(--up); } .journey i.now { background: var(--brand); }
.scard .verdict .grow { flex: 1; min-width: 0; }
.scard .facts.one { grid-template-columns: minmax(0, 1fr); }
.scard .sum { margin: 0; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Strategies list head, every book (journeyStatus.js): answer line, the
   journey strip (the stage filter, read left to right), the showing line. */
.jhead { display: grid; gap: var(--s4); margin-bottom: var(--s6); }
.jhead .filters { margin: 0; }
.janswer { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); color: var(--ink); max-width: 72ch; }
.jstrip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s2); align-items: stretch; }
.jt { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.jt.on { border-color: var(--brand-edge); box-shadow: 0 0 0 1px var(--brand-edge); }
.jt-main { display: grid; gap: var(--s1); padding: var(--s3) var(--s4); background: none; border: 0; border-radius: var(--r-lg); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background var(--t-fast); }
.jt-main:hover { background: var(--hover); }
.jt-main:focus-visible, .jt-x:focus-visible { outline: none; box-shadow: var(--focus); }
.jt-l { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-13); line-height: var(--lh-13); font-weight: 500; color: var(--ink-2); }
.jt-i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-full); background: var(--sunken); font-size: var(--fs-12); font-weight: 600; color: var(--ink-2); }
.jt.on .jt-i { background: var(--brand); color: var(--on-brand); }
.jt-n { font-size: var(--fs-32); line-height: var(--lh-32); font-weight: 600; font-variant-numeric: tabular-nums; }
.jt.zero .jt-n { color: var(--ink-3); }
.jt-s { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-3); }
.jt-nx { display: grid; justify-items: start; gap: var(--s1); margin-top: auto; padding: var(--s2) var(--s4) var(--s3); border-top: 1px solid var(--line); }
.jt-x { display: inline-flex; align-items: center; gap: var(--s1); padding: 0; border: 0; border-radius: var(--r-sm); background: none; font: inherit; font-size: var(--fs-13); line-height: var(--lh-13); font-weight: 500; text-align: left; }
button.jt-x { cursor: pointer; }
button.jt-x:hover span, .jt-x.on span { text-decoration: underline; text-underline-offset: 3px; }
.jt-x.on { font-weight: 600; }
.jt-arr { align-self: center; color: var(--ink-3); }
.jt-arr .ic { display: block; }
.jshow { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); font-size: var(--fs-13); color: var(--ink-2); }
.jshow-t { font-weight: 500; }
.jshow-l { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.jshow .sp { flex: 1; }
.jshow .btn.on { background: var(--brand-soft); }
.jshow .select, .jshow .input { width: auto; min-width: 200px; max-width: 280px; }
/* the card's answer (status sentence) sits under its name */
.scard .sline { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 500; color: var(--ink); }
.scard .sline .ic { flex: none; margin-top: 2px; }
.scard .chks { display: flex; flex-wrap: wrap; gap: var(--s1); }
@media (max-width: 767px) {
  .jstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jt-arr { display: none; }
  .jt-n { font-size: var(--fs-24); line-height: var(--lh-24); }
}
/* Strategies list: a section per journey stage, every book (journeyStatus.js) */
.st-secs { display: grid; gap: var(--s8); }
.st-sec-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2) var(--s3); margin-bottom: var(--s3); font-size: var(--fs-13); }
.st-sec-h h2 { margin: 0; font-size: var(--fs-18); line-height: var(--lh-18); font-weight: 600; }
.st-sec-h .cnt { color: var(--ink-3); font-weight: 500; margin-left: var(--s1); }

/* ── strategy page ──────────────────────────────────── */
.s-head { display: flex; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; }
.s-head .titles { flex: 1 1 320px; min-width: 0; }
.s-head h1 { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.s-head .code { font-family: var(--mono); font-size: var(--fs-14); color: var(--ink-3); font-weight: 500; }
.s-meta { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.step { position: relative; padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step .sn { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-13); font-weight: 650; color: var(--ink-3); }
.step .sd { margin-top: 4px; font-size: var(--fs-12); color: var(--ink-3); }
.step .si { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--ink-3); flex: none; }
.step.done .si { background: var(--up); color: #fff; }
.step.done .sn { color: var(--ink); }
.step.now { border-color: var(--brand-edge); background: var(--brand-soft); }
.step.now .sn { color: var(--ink); }
.step.now .si { background: var(--brand); color: var(--on-brand); }
.next-box { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: var(--fs-13); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--s4); }
.cmp td.b, .cmp th.b { color: var(--ink-3); }
.rules-list { display: flex; flex-direction: column; }
.rule { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.rule:last-child { border-bottom: 0; }
.rule .r-v { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); font-size: var(--fs-13); }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.adv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.adv { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.adv:hover { border-color: var(--line-strong); }
.adv .ai { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); flex: none; }
.adv b { display: block; font-size: var(--fs-14); }
.adv span { font-size: var(--fs-13); color: var(--ink-3); }

/* backtest report (shared component) */
.bt-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.bt-head .grow { min-width: 200px; }
.bt-run { font-size: var(--fs-13); color: var(--ink-3); }
.bt-run b { color: var(--ink); font-weight: 600; }
.bt-verdict { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); font-size: var(--fs-14); }
.bt-verdict.good { background: var(--up-soft); } .bt-verdict.bad { background: var(--down-soft); } .bt-verdict.meh { background: var(--warn-soft); }
.bt-verdict .ic { flex: none; }
.bt-verdict.good .ic { color: var(--up); } .bt-verdict.bad .ic { color: var(--down); } .bt-verdict.meh .ic { color: var(--warn); }
.months { display: grid; grid-template-columns: 56px repeat(12, minmax(0, 1fr)) 64px; gap: 3px; font-size: 11px; font-variant-numeric: tabular-nums; }
.months > * { height: 26px; display: grid; place-items: center; border-radius: 4px; }
.months .mh { color: var(--ink-3); font-weight: 600; }
.months .yr { color: var(--ink-2); font-weight: 600; justify-items: start; }
.months .m { background: var(--sunken); color: var(--ink-2); }
.months .m.p1 { background: color-mix(in srgb, var(--up) 18%, var(--surface)); } .months .m.p2 { background: color-mix(in srgb, var(--up) 38%, var(--surface)); }
.months .m.p3 { background: color-mix(in srgb, var(--up) 62%, var(--surface)); color: var(--ink); }
.months .m.n1 { background: color-mix(in srgb, var(--down) 18%, var(--surface)); } .months .m.n2 { background: color-mix(in srgb, var(--down) 38%, var(--surface)); }
.months .m.n3 { background: color-mix(in srgb, var(--down) 62%, var(--surface)); color: var(--ink); }
.months .tot { font-weight: 650; }
.progress { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width var(--t-med) var(--ease); }
.runs { display: flex; flex-direction: column; gap: 2px; }
/* Re-score all bar (rescore.js) — same on every book's Strategies page */
.rs-bar { align-items: flex-start; }
.rs-host:empty { display: none; }
.rs-bar > .ic { margin-top: 2px; }
.rs-bar .rs-row { display: flex; align-items: baseline; gap: var(--s2); min-width: 0; }
.rs-bar .progress { margin-top: var(--s2); }
.rs-bar .rs-sub { margin: var(--s1) 0 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* ── chart page ─────────────────────────────────────── */
.cp > * { min-width: 0; }
.cp { display: grid; grid-template-columns: minmax(0, 1fr) var(--cp-side-w, 300px); grid-template-rows: auto 1fr auto; height: calc(100vh - var(--topbar-h)); }
.cp-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.cp-bar .sym { font-size: var(--fs-18); font-weight: 700; letter-spacing: -.01em; }
.cp-bar .px { font-size: var(--fs-16); font-weight: 650; font-variant-numeric: tabular-nums; }
.cp-main { position: relative; min-width: 0; min-height: 0; background: var(--surface); }
.cp-main canvas { display: block; }
.cp-side { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.cp-side .wl-h { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.cp-side .wl { flex: 1 1 auto; overflow: auto; }
.wl-row { display: flex; align-items: center; gap: var(--s2); height: 48px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); cursor: pointer; font-size: var(--fs-13); }
.wl-row:hover { background: var(--hover); }
.wl-row.on { background: var(--brand-soft); }
.wl-row b { font-weight: 650; font-size: var(--fs-14); }
.wl-l1 { display: flex; align-items: center; gap: var(--s1); min-width: 0; white-space: nowrap; }
.wl-l1 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wl-l1 .chip { flex: none; }
.wl-row .r { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.wl-row .r small { display: block; font-size: var(--fs-12); font-weight: 600; }
.cp-drawer { grid-column: 1 / 2; border-top: 1px solid var(--line); background: var(--surface); }
.cp-drawer .tabs { padding: 0 var(--s3); }
.cp-drawer-b { height: var(--cp-drawer-h, 280px); overflow: auto; padding: var(--s4); }
.cp-drawer.folded .cp-drawer-b { display: none; }
.cp-legend { position: absolute; top: var(--s3); left: var(--s4); z-index: 2; display: flex; gap: var(--s3); font-size: var(--fs-12); color: var(--ink-2); font-variant-numeric: tabular-nums; pointer-events: none; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 2px 6px; border-radius: var(--r-sm); }


/* ── tools ──────────────────────────────────────────── */
.tool-groups { display: flex; flex-direction: column; gap: var(--s6); }
.tool-groups h2 { margin-bottom: var(--s3); font-size: var(--fs-16); }

/* settings / more */
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow .chip { margin-left: var(--s2); vertical-align: middle; }
.sec-recent { align-items: flex-start; }
.sec-acts { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 767px) {
  #secCard .set-row { flex-wrap: wrap; }
  #secCard .set-row .grow { flex-basis: 100%; }
  #secCard .sec-acts { justify-content: flex-start; }
  #secCard .btn.sm { height: 44px; }
}
.sec-events { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); font-size: var(--fs-13); }
.sec-events li { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sec-steps { margin: 0; padding-left: var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.sec-key { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0; padding: var(--s2) var(--s3); background: var(--sunken); border-radius: var(--r); }
.sec-key code { font-family: var(--mono); font-size: var(--fs-16); letter-spacing: .06em; flex: 1; word-break: break-all; }
.sec-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); margin: 0; padding: 0; list-style-position: inside; font-family: var(--mono); font-size: var(--fs-16); }
.set-list.compact .set-row { padding: var(--s2) 0; }
.set-row .grow b { display: block; font-weight: 600; }
.set-row .grow span { font-size: var(--fs-13); color: var(--ink-3); }
.more-list { display: flex; flex-direction: column; }
.more-g { padding: var(--s4) 0 var(--s2); font-size: var(--fs-12); font-weight: 650; color: var(--ink-3); }
.more-i { display: flex; align-items: center; gap: var(--s3); height: 52px; padding: 0 var(--s1); border: 0; border-bottom: 1px solid var(--line); background: none; font-size: var(--fs-16); font-weight: 550; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }
.more-i > .ic:last-child { margin-left: auto; color: var(--ink-3); }
.more-i.danger { color: var(--down); }
.kb-list { display: flex; flex-direction: column; }
.kb-row { display: flex; justify-content: space-between; align-items: center; height: 40px; border-bottom: 1px solid var(--line); font-size: var(--fs-14); }
.kb-row:last-child { border-bottom: 0; }

/* positions */
.pos-sum { display: flex; gap: var(--s6); flex-wrap: wrap; }

/* ── responsive pages ───────────────────────────────── */
@media (max-width: 1399px) {
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .ov-page { height: calc(100vh - var(--topbar-h) - 2 * var(--s4)); }
  .cp { grid-template-columns: minmax(0, 1fr) var(--cp-side-w, 260px); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .login { grid-template-columns: 1fr; }
  .login-hero { padding: var(--s8) var(--s6); min-height: 0; }
  .hero-art { display: none; }
  .hero-copy h1 { font-size: 32px; line-height: 40px; }
  .home-low, .grid-21 { grid-template-columns: 1fr; }
  .sumrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumrow .kpi:nth-child(3) { border-left: 0; }
  .sumrow .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cp { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(320px, 1fr) auto auto; height: auto; min-height: calc(100vh - var(--topbar-h)); }
  .cp-bar .seg { order: 5; }
  .cp-side { border-left: 0; border-top: 1px solid var(--line); max-height: 260px; }
  .cp-drawer { grid-column: 1; }
}
@media (max-width: 767px) {
  .login-hero { padding: calc(var(--s6) + var(--safe-t)) var(--s4) var(--s6); }
  .hero-copy p { font-size: var(--fs-16); line-height: 24px; }
  .hero-foot { display: none; }
  .login-side { place-items: start center; padding: var(--s6) var(--s4); }
  .hello h1 { font-size: var(--fs-24); line-height: var(--lh-24); }
  .hello-scope { width: 100%; }
  .hello-scope .faint { display: none; }
  .checks { grid-template-columns: 1fr; }
  .books { grid-template-columns: 1fr; gap: var(--s3); }
  .bcard { min-height: 0; padding: var(--s4); gap: var(--s3); }
  .bcard .big { font-size: var(--fs-24); line-height: var(--lh-24); }
  .bcard .bk-key { display: none; }
  .sumrow .kpi { padding: var(--s3) var(--s4); }
  .sumrow .kpi-v { font-size: var(--fs-20); line-height: var(--lh-20); }
  .grid-2, .grid-3, .stepper { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strat-grid { grid-template-columns: 1fr; }
  .ov-page { height: auto; }
  .months { grid-template-columns: 40px repeat(12, minmax(0, 1fr)) 48px; font-size: 10px; }
  .w-hero .big { font-size: var(--fs-32); line-height: var(--lh-32); }
}

/* ── Tools hub + areas (pages/tools.js, pages/tools/_frame.js) ── */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s4); }
.area-card { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); transition: border-color var(--t-fast), box-shadow var(--t-med); }
.area-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.area-card .ai { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.area-card b { font-size: var(--fs-16); }
.area-card p { margin-top: 2px; color: var(--ink-3); font-size: var(--fs-13); }
.area-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.area-tabs .chip { cursor: pointer; }
.area-tabs .chip:hover { background: var(--hover); color: var(--ink); }
.tool-page .tool-body { min-width: 0; }
.tool-pane { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.tool-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.tool-bar .sp { flex: 1; }
.picker .select { min-width: 240px; max-width: 360px; }
@media (max-width: 767px) { .area-grid { grid-template-columns: 1fr; } .picker .select { min-width: 0; width: 100%; } }
.bcard .big, .w-hero .big { display: inline-block; }

/* ── AI-built widgets (widgets/ai.js, 2026-11-23) ───────────────────── */
.w-root:has(> .ai-body) { min-height: 100%; }
.ai-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ai-body > * { flex: 1 1 auto; }
.ai-frame { flex: 1 1 auto; width: 100%; min-height: 150px; border: 0; display: block; background: transparent; }
.ai-foot { align-items: center; }
.ai-foot .faint { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-bars { display: flex; flex-direction: column; gap: var(--s2); }
.ai-bar { display: grid; grid-template-columns: minmax(64px, 30%) 1fr auto; align-items: center; gap: var(--s3); font-size: var(--fs-13); }
.ai-bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ai-bar-t { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.ai-bar-t i { display: block; height: 100%; border-radius: 4px; }
.ai-bar-t i.up { background: var(--up); } .ai-bar-t i.down { background: var(--down); }
.ai-bar-v { text-align: right; white-space: nowrap; }
.ai-list { display: flex; flex-direction: column; }
.ai-li { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.ai-li:last-child { border-bottom: 0; }
.ai-li .num { white-space: nowrap; }
.ai-build { display: flex; flex-direction: column; gap: var(--s4); }
.ai-prompt { min-height: 88px; resize: vertical; font: inherit; padding: var(--s2) var(--s3); line-height: var(--lh-14); }
.ai-ex { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ai-ex .chip { border: 0; cursor: pointer; height: 28px; padding: 0 var(--s3); }
.ai-ex .chip:hover { background: var(--hover); color: var(--ink); }
.ai-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: var(--fs-13); }
.ai-was { font-size: var(--fs-13); }
.ai-prev { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ai-prev-h { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.ai-prev-b { height: 320px; display: flex; flex-direction: column; overflow: auto; container: ws / size; }
