/* ------------------------------------------------------------------
   voltu — design system
   Tokens carried over from the original comp. Everything below is
   built from them; nothing hardcodes a colour.
------------------------------------------------------------------- */

:root{
  --bar-h:60px;   /* docked agent bar on narrow screens */
  --page:#e9e9e7;
  --shell:#f2f1ef;
  --sidebar:#eceae7;
  --surface:#ffffff;
  --canvas:#fbfaf9;
  --sunken:#f5f4f2;
  --ink:#131313;
  --ink-2:#454545;
  --muted:#9a9a96;
  --line:#e6e4e1;
  --line-soft:#eeecea;
  --amber:#c2761a;  --amber-bg:#fbf1e2;
  --blue:#2563c4;   --blue-bg:#e9f0fb;
  --green:#17794a;  --green-bg:#e6f2ea;
  --red:#b3261e;    --red-bg:#fbeceb;
  --violet:#6d4aa8; --violet-bg:#f1ecfa;
  /* the one strong colour in the interface — themes move this */
  --primary:#111111;
  --primary-hi:#000000;
  --primary-ink:#ffffff;   /* text on the brand colour — light brands flip this */
  --accent:#2563c4;        /* quiet accent: focus rings, active chrome */
  --radius-lg:22px;
  --radius:14px;
  --radius-sm:10px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  background:var(--page);color:var(--ink);
  -webkit-font-smoothing:antialiased;
  display:flex;align-items:center;justify-content:center;padding:28px;
}
button,input,select,textarea{font:inherit;color:inherit}
.num{font-variant-numeric:tabular-nums}

/* ---------- shell ---------- */

.app{
  width:min(2100px,100%);
  height:min(1360px,calc(100vh - 56px));
  background:var(--shell);
  border-radius:var(--radius-lg);
  border:1px solid #dedbd7;
  box-shadow:0 24px 60px rgba(0,0,0,.10),0 2px 6px rgba(0,0,0,.04);
  display:grid;grid-template-columns:252px minmax(0,1fr) 430px;
  overflow:hidden;
}

/* ---------- sidebar ---------- */

.sidebar{background:var(--sidebar);padding:18px 14px;display:flex;flex-direction:column;gap:18px;overflow-y:auto}
/* The lockup the founder chose: the mark beside the name, set heavy. Sized
   from the type so the two can never drift apart; the mark is the small-size
   cut, since this is the one place it renders under 20px. */
.brand{display:flex;align-items:center;gap:8px;padding:2px 5px 0;color:var(--ink);text-decoration:none;
  font-size:15.5px;font-weight:650;letter-spacing:-.025em;line-height:1}
.brand .vmark{height:14px;width:auto;display:block}
.brand:hover{opacity:.8}
.search{
  display:flex;align-items:center;gap:9px;background:var(--surface);
  border:1px solid var(--line);border-radius:11px;padding:8px 9px;color:var(--muted);font-size:13px;
}
.search input{border:0;outline:0;background:transparent;flex:1;min-width:0;color:var(--ink)}
.search input::placeholder{color:var(--muted)}
.kbd{font-size:12px;color:var(--muted)}
.search:focus-within{border-color:var(--ink-2)}

/* ---------- search results ----------
   Positioned fixed and measured from the input, because the sidebar scrolls
   and an absolute child would be clipped by it rather than float over it. */
.search-pop{
  position:fixed;z-index:40;min-width:300px;max-height:min(420px,60vh);overflow-y:auto;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  box-shadow:0 12px 34px rgba(0,0,0,.14);padding:6px;
}
.search-pop[hidden]{display:none}
.sr{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;
  width:100%;padding:8px 10px;border:0;border-radius:8px;background:transparent;
  text-align:left;cursor:pointer;color:var(--ink);font:inherit;
}
.sr:hover,.sr.on{background:var(--sunken)}
.sr .sym{font-weight:600;font-size:13px;min-width:52px;font-variant-numeric:tabular-nums}
.sr .nm{font-size:12.5px;color:var(--ink-2);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr .nm small{color:var(--muted)}
.sr .meta{display:flex;gap:6px;align-items:center;font-size:11px;color:var(--muted);white-space:nowrap}
.sr .meta .tag{font-size:10.5px;padding:2px 6px}
.sr .px{font-variant-numeric:tabular-nums;font-size:12px}
.search-empty{padding:12px 10px;font-size:12.5px;color:var(--muted)}

/* The groups live inside one slot, so nothing was separating them — the
   section label sat directly beneath the previous item and the active pill
   crowded it. */
#nav-slot{display:flex;flex-direction:column;gap:16px}
.nav{display:flex;flex-direction:column;gap:1px}
.nav-label{
  font-size:10px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);padding:0 9px 8px;
}
.nav a{
  display:flex;align-items:center;gap:10px;padding:8px 9px;border-radius:var(--radius-sm);
  color:var(--ink-2);text-decoration:none;font-size:13.5px;cursor:pointer;
}
.nav a:hover{background:rgba(0,0,0,.03)}
.nav a.active:hover{background:var(--surface)}
.nav a.active{background:var(--surface);color:var(--ink);font-weight:500}
.nav a.active svg{opacity:1}
.nav svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.75}
.nav .badge{
  margin-left:auto;font-size:11.5px;font-weight:600;background:var(--amber-bg);color:var(--amber);
  border-radius:999px;padding:2px 7px;min-width:20px;text-align:center;
}
.spacer{flex:1;min-height:12px}

.acct{border-top:1px solid var(--line);padding-top:14px}
.acct .lbl{font-size:11.5px;color:var(--muted)}
.acct .val{font-size:17.5px;font-weight:500;letter-spacing:-.01em;margin-top:3px}
.acct .chg{font-size:12px;margin-top:2px}

/* ---------- main ---------- */

.main{
  background:var(--canvas);border-left:1px solid var(--line);border-right:1px solid var(--line);
  display:flex;flex-direction:column;min-width:0;overflow:hidden;
}
.main-head{padding:15px 20px 12px;border-bottom:1px solid var(--line-soft);flex:none}
.crumbs{display:flex;align-items:center;gap:9px;font-size:14.5px;color:var(--muted)}
.crumbs .now{color:var(--ink);font-weight:500}
.crumbs svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.7}
.head-row{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-top:10px}
.head-row h1{font-size:25px;font-weight:600;letter-spacing:-.015em}
.head-row .sub{font-size:14px;color:var(--muted);margin-top:5px;max-width:70ch;line-height:1.5}
.head-actions{display:flex;gap:9px;flex:none}
.view{padding:24px 30px 40px;overflow-y:auto;flex:1;min-height:0}

/* ---------- primitives ---------- */

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}
.card-pad{padding:20px 22px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:11px}
.card-head h3,.section-title{font-size:14.5px;font-weight:400;color:var(--ink-2)}
.grid{display:grid;gap:12px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stack{display:flex;flex-direction:column;gap:12px}
.row{display:flex;align-items:center;gap:10px}
.wrap{flex-wrap:wrap}
.right{margin-left:auto}
.mt{margin-top:12px}

.stat{padding:18px 20px 20px}
.stat h3{font-size:13.5px;font-weight:400;color:var(--ink-2)}
.stat .big{font-size:34px;line-height:1.2;font-weight:500;letter-spacing:-.02em;margin:6px 0 3px}
.stat .cap{font-size:13px;color:var(--muted)}

.pill{display:inline-flex;align-items:center;gap:7px;font-size:13px;font-weight:500;padding:5px 11px;border-radius:999px;white-space:nowrap}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.pill.nodot::before{display:none}
.pill.amber{color:var(--amber);background:var(--amber-bg)}
.pill.blue{color:var(--blue);background:var(--blue-bg)}
.pill.green{color:var(--green);background:var(--green-bg)}
.pill.red{color:var(--red);background:var(--red-bg)}
.pill.violet{color:var(--violet);background:var(--violet-bg)}
.pill.grey{color:var(--muted);background:var(--sunken)}

.tag{font-size:12.5px;color:var(--ink-2);border:1px solid var(--line);border-radius:8px;padding:4px 9px;background:var(--surface);white-space:nowrap}
.tag.plain{background:var(--sunken);border-color:transparent}

.up{color:var(--green)}
.down{color:var(--red)}
.flat{color:var(--muted)}

.btn{font-size:14.5px;font-weight:500;cursor:pointer;border-radius:11px;padding:11px 16px;border:1px solid transparent;background:var(--surface);border-color:var(--line);color:var(--ink)}
.btn:hover{background:#f6f5f3}
.btn.primary{background:var(--primary);color:var(--primary-ink);border-color:var(--primary)}
.btn.primary:hover{background:var(--primary-hi)}
.btn.sm{font-size:13.5px;padding:8px 12px;border-radius:var(--radius-sm)}
.btn.quiet{background:transparent;border-color:transparent;color:var(--muted)}
.btn.quiet:hover{color:var(--ink);background:rgba(0,0,0,.035)}
.btn.danger{color:var(--red);border-color:var(--line)}
.btn.danger:hover{background:var(--red-bg)}
.btn:disabled{opacity:.45;cursor:default}
.btn:disabled:hover{background:var(--surface)}

/* tables */
table{width:100%;border-collapse:collapse}
th{text-align:left;font-size:12.5px;font-weight:400;color:var(--muted);padding:0 10px 12px;border-bottom:1px solid var(--line-soft);white-space:nowrap}
th:first-child,td:first-child{padding-left:0}
th:last-child,td:last-child{padding-right:0;text-align:right}
th.n,td.n{text-align:right}
th.sortable{cursor:pointer;user-select:none}
th.sortable:hover{color:var(--ink)}
th .caret{opacity:.55;font-size:10px;margin-left:3px}
td{padding:14px 10px;font-size:14px;border-bottom:1px solid var(--line-soft);white-space:nowrap}
tbody tr:last-child td{border-bottom:0}
tr.clickable{cursor:pointer}
tr.clickable:hover td{background:var(--canvas)}
td .sym{font-weight:500}
td .sub{font-size:12.5px;color:var(--muted);margin-top:2px;white-space:normal}
.tick{transition:background .5s}
.tick.up-flash{background:var(--green-bg)}
.tick.down-flash{background:var(--red-bg)}
@media (prefers-reduced-motion:reduce){.tick{transition:none}}

/* forms */
label.field{display:block}
.field .lab{display:block;font-size:12.5px;color:var(--muted);margin-bottom:6px}
input[type=text],input[type=number],select,textarea{
  width:100%;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:10px 11px;font-size:14px;outline:0;
}
input:focus,select:focus,textarea:focus{border-color:#cfccc8}
select{appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a96' stroke-width='1.8'><path d='m7 10 5 5 5-5'/></svg>");background-repeat:no-repeat;background-position:right 9px center;background-size:16px;padding-right:30px}

.seg{display:inline-flex;background:var(--sunken);border-radius:var(--radius-sm);padding:3px;gap:2px}
.seg button{border:0;background:transparent;font-size:13px;padding:7px 12px;border-radius:8px;cursor:pointer;color:var(--ink-2)}
.seg button:hover{color:var(--ink)}
.seg button[aria-pressed=true]{background:var(--surface);color:var(--ink);font-weight:500;box-shadow:0 1px 2px rgba(0,0,0,.06)}

.chip{font-size:13px;cursor:pointer;color:var(--ink-2);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:6px 12px}
.chip:hover{background:#f6f5f3;color:var(--ink)}
.chip[aria-pressed=true]{background:var(--primary);color:var(--primary-ink);border-color:var(--primary)}

.switch{position:relative;width:40px;height:23px;flex:none;border:0;border-radius:999px;background:#d7d4d0;cursor:pointer;transition:background .16s}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:#fff;transition:transform .16s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch[aria-checked=true]{background:var(--green)}
.switch[aria-checked=true]::after{transform:translateX(17px)}

/* sparkline */
.spark{display:block;width:100%;height:34px;overflow:visible}
.spark path.line{fill:none;stroke-width:1.6;vector-effect:non-scaling-stroke}
.spark path.area{stroke:none;opacity:.10}

/* empty state */
.empty{text-align:center;padding:52px 20px;color:var(--muted)}
.empty h4{font-size:16px;color:var(--ink);font-weight:500;margin-bottom:6px}
.empty p{font-size:14px;line-height:1.55;max-width:44ch;margin:0 auto 16px}

/* ---------- strategy cards ---------- */

.strat{display:flex;flex-direction:column;overflow:hidden}
.strat-top{padding:15px 18px 0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.strat-top h3{font-size:16.5px;font-weight:600;letter-spacing:-.005em}
.strat-top .by{font-size:12.5px;color:var(--muted);margin-top:4px}
.strat p.thesis{padding:8px 18px 0;font-size:13.5px;line-height:1.55;color:var(--muted)}
/* four metrics across a card this width either compress until the labels
   wrap or leave one orphaned on a second row; two columns is tidy either way */
.strat .metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px 16px;padding:11px 18px 0}
.metric .k{font-size:12px;color:var(--muted)}
.metric .v{font-size:16px;font-weight:500;margin-top:2px;letter-spacing:-.01em}
.strat .sparkwrap{padding:10px 18px 0}
.strat .foot{margin-top:auto;display:flex;align-items:center;gap:8px;padding:11px 18px;border-top:1px solid var(--line-soft)}

/* ---------- builder ---------- */

.builder{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}
.block{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden}
.block-head{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line-soft)}
.block-head .step{width:22px;height:22px;border-radius:7px;background:var(--sunken);color:var(--ink-2);display:grid;place-items:center;font-size:12px;font-weight:600;flex:none}
.block-head h4{font-size:14.5px;font-weight:500}
.block-head .hint{font-size:12.5px;color:var(--muted);margin-left:auto}
.block-body{padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.cond{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,.9fr) minmax(0,.7fr) auto;gap:8px;align-items:center}
.cond .x{border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:17px;padding:6px 8px;border-radius:8px}
.cond .x:hover{background:var(--sunken);color:var(--ink)}
.joiner{font-size:12.5px;color:var(--muted);padding:0 2px}
.summary{background:var(--sunken);border-radius:var(--radius);padding:16px 18px;font-size:14.5px;line-height:1.6}
.summary b{font-weight:600}
.summary .lab{display:block;font-size:12.5px;color:var(--muted);margin-bottom:8px;font-weight:400}

/* ---------- drawer ---------- */

.scrim{position:fixed;inset:0;background:rgba(20,20,20,.28);opacity:0;pointer-events:none;transition:opacity .18s;z-index:40}
.scrim.open{opacity:1;pointer-events:auto}
.drawer{
  position:fixed;top:0;right:0;height:100%;width:min(460px,92vw);background:var(--canvas);
  border-left:1px solid var(--line);box-shadow:-14px 0 40px rgba(0,0,0,.12);
  transform:translateX(100%);transition:transform .22s cubic-bezier(.4,0,.2,1);z-index:41;
  display:flex;flex-direction:column;
}
.drawer.open{transform:none}
.drawer-head{padding:22px 24px 16px;border-bottom:1px solid var(--line-soft);display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.drawer-head h3{font-size:19px;font-weight:600;letter-spacing:-.01em}
.drawer-head .sub{font-size:13px;color:var(--muted);margin-top:4px}
.drawer-body{padding:20px 24px 28px;overflow-y:auto;flex:1}
.drawer-foot{padding:14px 24px;border-top:1px solid var(--line-soft);display:flex;gap:9px}
@media (prefers-reduced-motion:reduce){.drawer{transition:none}}

.kv{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--line-soft);font-size:14px}
.kv:last-child{border-bottom:0}
.kv .k{color:var(--muted)}

/* ---------- toast ---------- */

.toasts{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:9px;z-index:60;align-items:center}
.toast{
  background:#141414;color:#fff;font-size:14px;border-radius:12px;padding:12px 16px;
  box-shadow:0 12px 30px rgba(0,0,0,.24);display:flex;align-items:center;gap:10px;
  animation:rise .22s ease-out;max-width:min(560px,90vw);
}
.toast .dot{width:7px;height:7px;border-radius:50%;background:#4ec78e;flex:none}
.toast .dot.amber{background:#e0a253}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.toast{animation:none}}

/* ---------- agent rail ---------- */

.rail{background:var(--canvas);display:flex;flex-direction:column;min-height:0;overflow:hidden}
.rail-head{padding:16px 22px 15px;border-bottom:1px solid var(--line-soft);display:flex;align-items:center;gap:12px}
.agent-state{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted)}
.live{width:7px;height:7px;border-radius:50%;background:#3ba776;box-shadow:0 0 0 3px rgba(59,167,118,.16);flex:none}
.live.paused{background:var(--amber);box-shadow:0 0 0 3px rgba(194,118,26,.16)}

.thread{flex:1;min-height:0;overflow-y:auto;padding:15px 18px 10px;display:flex;flex-direction:column;gap:13px}
/* Flex children shrink by default. Without this the cards compress and clip
   their own text instead of overflowing, so the thread never scrolls. */
.thread > *{flex:0 0 auto}
.msg{font-size:13.5px;line-height:1.55}
.msg .who{display:block;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.msg.agent{color:var(--ink-2);max-width:95%}
.msg.user{align-self:flex-end;max-width:85%;background:#f0efec;border:1px solid var(--line);border-radius:14px 14px 4px 14px;padding:10px 13px;color:var(--ink)}
.msg.system{align-self:center;font-size:12.5px;color:var(--muted);background:var(--sunken);border-radius:999px;padding:5px 12px}

.proposal{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.proposal-top{display:flex;align-items:center;justify-content:space-between;padding:11px 14px 0;gap:9px}
.ago{font-size:11px;color:var(--muted)}
.proposal-body{padding:9px 14px 11px}
.proposal-body h4{font-size:14.5px;font-weight:600;line-height:1.35;letter-spacing:-.005em}
.proposal-body p{margin-top:6px;font-size:12.5px;line-height:1.55;color:var(--muted)}
.facts{list-style:none;display:flex;flex-wrap:wrap;gap:5px;margin-top:9px;font-size:11.5px;color:var(--ink-2)}
.facts li{background:var(--sunken);border-radius:7px;padding:4px 9px}
.why{margin-top:11px;border-top:1px dashed var(--line);padding-top:10px}
.why summary{font-size:12.5px;color:var(--muted);cursor:pointer;list-style:none}
.why summary::-webkit-details-marker{display:none}
.why summary::before{content:"▸ ";font-size:10px}
.why[open] summary::before{content:"▾ "}
.why ul{list-style:none;margin-top:9px;display:flex;flex-direction:column;gap:6px}
.why li{font-size:12.5px;color:var(--ink-2);display:flex;justify-content:space-between;gap:12px}
.why li span{color:var(--muted)}
.proposal-actions{display:flex;gap:7px;padding:10px 14px;border-top:1px solid var(--line-soft)}
.btn-approve{flex:1;background:var(--primary);color:var(--primary-ink);border:0;border-radius:var(--radius-sm);padding:9px 13px;font-size:13px;font-weight:500;cursor:pointer}
.btn-approve:hover{background:var(--primary-hi)}
.reasons{padding:12px 15px;border-top:1px solid var(--line-soft)}
.reasons .lab{display:block;font-size:12.5px;color:var(--muted);margin-bottom:9px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.resolved{display:flex;align-items:center;gap:8px;padding:11px 15px;border-top:1px solid var(--line-soft);font-size:13px}
.resolved svg{width:14px;height:14px;flex:none;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.resolved.ok{color:var(--green)}
.resolved.no{color:var(--muted)}
.proposal.is-resolved{background:var(--canvas)}
.proposal.is-resolved h4{color:var(--ink-2);font-weight:500}

.typing{display:flex;gap:4px;align-items:center;height:18px}
.typing i{width:5px;height:5px;border-radius:50%;background:#bdbab6;animation:blink 1.2s infinite}
.typing i:nth-child(2){animation-delay:.18s}
.typing i:nth-child(3){animation-delay:.36s}
@keyframes blink{0%,60%,100%{opacity:.35}30%{opacity:1}}
@media (prefers-reduced-motion:reduce){.typing i{animation:none;opacity:.6}}

.composer{border-top:1px solid var(--line-soft);padding:12px 18px 15px;flex:none}
.suggests{display:flex;gap:6px;overflow-x:auto;padding-bottom:10px;scrollbar-width:none}
.suggests::-webkit-scrollbar{display:none}
.suggests button{font-size:12.5px;white-space:nowrap;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:6px 11px;cursor:pointer;color:var(--ink-2)}
.suggests button:hover{background:#f6f5f3;color:var(--ink)}
.composer-box{display:flex;align-items:flex-end;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:8px 8px 8px 13px}
.composer-box:focus-within{border-color:#cfccc8}
.composer textarea{flex:1;border:0;outline:0;resize:none;background:transparent;font-size:13.5px;line-height:1.5;max-height:110px;padding:5px 0}
.composer textarea::placeholder{color:var(--muted)}
.send{width:33px;height:33px;flex:none;border:0;border-radius:9px;background:var(--primary);color:var(--primary-ink);display:grid;place-items:center;cursor:pointer}
.send:disabled{background:#dedbd7;cursor:default}
.send svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hint{margin-top:8px;font-size:11.5px;color:var(--muted);text-align:center}

/* ---------- responsive ---------- */

@media (max-width:1440px){ .app{grid-template-columns:230px minmax(0,1fr) 390px} }
@media (max-width:1180px){
  body{padding:0}
  .app{grid-template-columns:220px minmax(0,1fr);height:100vh;border-radius:0;border:0}

}
/* ---------- narrow screens: docked bar + bottom sheet ----------
   The agent is central enough to earn a permanent strip. Docking it means
   the layout reserves the height, so nothing sits underneath it — which a
   floating button could never avoid. */

.rail-bar{display:none}
.rail-scrim{display:none}

@media (max-width:1180px){
  /* The scrim belongs to the bottom sheet, so it only exists here. On a wide
     screen the rail is permanently visible and opening it dims nothing — the
     scrim used to sit outside this block, which dimmed the whole app and
     swallowed every click. */
  .rail-scrim{
    display:block;
    position:fixed;inset:0;z-index:29;background:rgba(20,20,20,.28);
    opacity:0;pointer-events:none;transition:opacity .2s;
  }
  .rail-scrim.open{opacity:1;pointer-events:auto}

  /* Reserve the bar's height so content is never behind it. body centres the
     app by default, so shrinking the app alone just re-centres it — the
     padding is what actually lifts it clear. */
  body{padding:0 0 var(--bar-h);align-items:stretch;justify-content:stretch}
  .app{width:100%;height:calc(100vh - var(--bar-h));border-radius:0;border:0}

  .rail-bar{
    display:flex;align-items:center;gap:14px;
    position:fixed;left:0;right:0;bottom:0;height:var(--bar-h);z-index:31;
    padding:0 16px;cursor:pointer;
    background:var(--surface);border-top:1px solid var(--line);
    box-shadow:0 -6px 22px rgba(0,0,0,.07);
  }
  .rail-bar:focus-visible{outline:2px solid var(--ink-2);outline-offset:-3px}
  .rb-status{display:flex;align-items:center;gap:9px;flex:1;min-width:0}
  .rb-dot{width:8px;height:8px;border-radius:50%;background:#3ba776;flex:none}
  .rb-dot.quiet{background:var(--muted)}
  .rb-dot.paused{background:var(--amber)}
  .rb-label{font-size:13.5px;font-weight:500;color:var(--ink);white-space:nowrap;flex:none}
  .rb-next{
    font-size:12.5px;color:var(--muted);min-width:0;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  .rb-next::before{content:"· ";color:var(--line)}
  .rb-action{
    display:flex;align-items:center;gap:5px;flex:none;
    font-size:13px;font-weight:500;color:var(--ink);
    background:var(--sunken);border-radius:999px;padding:7px 12px;
  }
  .rb-action svg{width:14px;height:14px}

  .rail-bar.waiting{background:var(--amber-bg);border-top-color:#e8d5b5}
  .rail-bar.waiting .rb-dot{background:var(--amber);animation:rb-pulse 2.4s ease-in-out infinite}
  .rail-bar.waiting .rb-label{color:var(--amber)}
  .rail-bar.waiting .rb-next{color:var(--ink-2)}
  .rail-bar.waiting .rb-action{background:var(--surface)}

  /* the rail becomes a sheet rising from the bar */
  .rail{
    position:fixed;left:0;right:0;bottom:var(--bar-h);top:auto;
    width:auto;height:min(62vh,620px);
    border-left:0;border-top:1px solid var(--line);
    border-radius:18px 18px 0 0;
    box-shadow:0 -16px 44px rgba(0,0,0,.18);
    transform:translateY(calc(100% + var(--bar-h)));
    transition:transform .26s cubic-bezier(.4,0,.2,1);
    z-index:30;
  }
  .rail.open{transform:none}
  .rail-head{padding-top:10px}
  /* a grab handle, so it reads as a sheet */
  .rail-head::before{
    content:"";position:absolute;top:7px;left:50%;transform:translateX(-50%);
    width:36px;height:4px;border-radius:2px;background:var(--line);
  }
  .rail-head{position:relative}

  .toasts{bottom:calc(var(--bar-h) + 14px)}
}

@keyframes rb-pulse{0%,100%{opacity:1}50%{opacity:.4}}
@media (prefers-reduced-motion:reduce){
  .rail-bar.waiting .rb-dot{animation:none}
  .rail{transition:none}
}
@media (max-width:820px){
  .app{grid-template-columns:1fr}
  .sidebar{display:none}
  .g4,.g3,.g2{grid-template-columns:1fr}
  .builder{grid-template-columns:1fr}
  .view,.main-head{padding-left:18px;padding-right:18px}
}

/* ---------- charts ---------- */

.chart-wrap{position:relative;width:100%}
.chart-wrap svg:focus-visible{outline:2px solid var(--ink-2);outline-offset:2px;border-radius:6px}
.chart-tip{
  position:absolute;pointer-events:none;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:7px 10px;box-shadow:0 6px 18px rgba(0,0,0,.10);
  display:flex;flex-direction:column;gap:2px;white-space:nowrap;z-index:2;
}
.chart-tip[hidden]{display:none}   /* an author display rule outranks the hidden attribute */
.chart-tip b{font-size:14px;font-weight:600}
.chart-tip span{font-size:12px;color:var(--muted)}
.chart-tip span.up{color:var(--green)}
.chart-tip span.down{color:var(--red)}

/* wide tables scroll inside their card; the page never scrolls sideways */
.table-scroll{overflow-x:auto}

/* ---------- portfolios ---------- */







.pf-by{margin-top:10px;font-size:12.5px;color:var(--muted);line-height:1.45}





@media (max-width:1180px){ .g3{grid-template-columns:repeat(2,minmax(0,1fr))} }

/* ---------- instrument ---------- */

.inst{display:flex;flex-direction:column;gap:18px}
.inst-lower{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:1100px){ .inst-lower{grid-template-columns:1fr} }

.quote-strip{display:flex;align-items:center;gap:28px;padding:16px 22px;flex-wrap:wrap}
.q-lead{flex:none;min-width:190px}
.q-grid{display:flex;flex-wrap:wrap;gap:14px 30px;flex:1}
/* conditions sit two-up in a full-width strip so the results get the page */
.sc-conds{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:10px 20px;align-items:center}
.sc-conds .joiner{display:none}

.ticket-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;margin-top:16px}
@media (max-width:760px){ .ticket-split{grid-template-columns:1fr} }
.q-stat{display:flex;flex-direction:column;gap:3px}
.q-stat span{font-size:12px;color:var(--muted)}
.q-stat b{font-size:14.5px;font-weight:500}

.ohlc{display:flex;flex-wrap:wrap;gap:14px;font-size:12.5px;color:var(--muted)}
.ohlc b{font-weight:600;color:var(--ink);margin-left:3px}

.symlink{color:inherit;text-decoration:none;border-bottom:1px solid var(--line);cursor:pointer}
.symlink:hover{border-color:var(--ink-2)}

/* Voltu already having a view on this instrument is context, not an alert —
   so it sits inline where it is relevant rather than as a banner row. */
.q-flag{
  display:inline-flex;align-items:center;gap:7px;flex:none;
  border:1px solid #e8d5b5;background:var(--amber-bg);color:var(--amber);
  border-radius:999px;padding:6px 10px 6px 11px;cursor:pointer;
  font-size:var(--t-sm);font-weight:500;white-space:nowrap;
}
.q-flag:hover{filter:brightness(.98)}
.q-flag svg{width:13px;height:13px;opacity:.75}
.q-flag-dot{width:6px;height:6px;border-radius:50%;background:var(--amber);flex:none}

.ticket-open-note{
  padding:9px 16px;border-bottom:1px solid var(--line-soft);
  background:var(--amber-bg);font-size:var(--t-sm);color:var(--ink-2);line-height:1.5;
}
.ticket-open-note b{font-weight:600;color:var(--ink)}
.linkish{
  border:0;background:none;padding:0;margin-left:6px;cursor:pointer;
  font-size:inherit;color:var(--amber);font-weight:500;text-decoration:underline;
  text-underline-offset:2px;text-decoration-thickness:1px;
}
.linkish:hover{color:var(--ink)}

.ticket{overflow:hidden}
.ticket-head{display:flex;align-items:center;gap:4px;padding:12px 16px;border-bottom:1px solid var(--line-soft)}
.ticket-tab{border:0;background:transparent;font-size:15px;font-weight:500;color:var(--muted);
  padding:7px 12px;border-radius:9px;cursor:pointer}
.ticket-tab:hover{color:var(--ink)}
.ticket-tab[aria-pressed=true]{background:var(--sunken);color:var(--ink)}
.ticket-body{padding:16px}
.ticket-calc{padding-top:2px}
.ticket-checks{display:flex;flex-direction:column;gap:7px;padding-top:2px}
.chk{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.45}
.chk svg{width:14px;height:14px;flex:none;margin-top:2px}
.chk.ok{color:var(--muted)} .chk.ok svg{color:var(--green)}
.chk.no{color:var(--red)}
.ticket-foot{display:flex;gap:9px;padding:14px 16px;border-top:1px solid var(--line-soft)}
.ticket-note{padding:0 16px 15px;font-size:12px;color:var(--muted);line-height:1.55}

/* ------------------------------------------------------------------
   Content type scale
   The main column and the drawer are data-dense; the agent rail is
   prose and keeps its larger, more readable sizes. Every size below
   comes from these six tokens — tune them here, not in the rules.
------------------------------------------------------------------- */

.main, .drawer{
  --t-hero:27px;   /* stat tile figures */
  --t-h1:20px;     /* view title */
  --t-h2:14px;     /* section and card headings that carry weight */
  --t-body:12.5px; /* tables, key-values, inputs, buttons */
  --t-sm:11.5px;   /* captions, subtitles */
  --t-xs:10.5px;   /* column headers, meta, secondary lines */
}

.main .crumbs{font-size:var(--t-body)}
.main .head-row h1{font-size:var(--t-h1)}
.main .head-row .sub{font-size:var(--t-sm)}
.main .view{padding:14px 20px 28px}

.main .card-pad{padding:13px 16px}
.main .card-head h3,
.main .section-title{font-size:var(--t-body)}

.main .stat{padding:12px 14px 13px}
.main .stat h3{font-size:var(--t-sm)}
.main .stat .big{font-size:var(--t-hero)}
.main .stat .cap{font-size:var(--t-xs)}

.main table th,
.main table td{font-size:var(--t-body)}
.main table th{font-size:var(--t-xs);padding-bottom:10px}
.main table td{padding:9px 9px}
/* this rule outranks the base td:first-child, so restore it: the first
   column must start at the same edge as its header */
.main table th:first-child,
.main table td:first-child{padding-left:0}
.main td .sub{font-size:var(--t-xs);margin-top:1px}

.main .kv, .drawer .kv{font-size:var(--t-body);padding:10px 0}
.main .metric .v{font-size:15px}
.main .metric .k{font-size:var(--t-xs)}

.main .btn, .drawer .btn{font-size:var(--t-body)}
.main .btn.sm, .drawer .btn.sm{font-size:var(--t-sm);padding:7px 11px}
.main .chip, .drawer .chip{font-size:var(--t-sm);padding:5px 11px}
.main .tag{font-size:var(--t-xs);padding:3px 8px}
.main .pill, .drawer .pill{font-size:var(--t-sm);padding:4px 10px}
.main .seg button{font-size:var(--t-sm);padding:6px 11px}

.main .field .lab, .drawer .field .lab{font-size:var(--t-xs)}
.main input, .main select, .main textarea,
.drawer input, .drawer select, .drawer textarea{font-size:var(--t-body);padding:9px 10px}

.main .empty h4{font-size:var(--t-h2)}
.main .empty p{font-size:var(--t-body)}

.main .q-stat b{font-size:var(--t-body)}
.main .q-stat span{font-size:var(--t-xs)}

.main .strat-top h3{font-size:15px}
.main .strat p.thesis{font-size:var(--t-body);line-height:1.55}
.main .strat-top .by{font-size:var(--t-xs)}
.main .block-head h4{font-size:var(--t-body)}
.main .block-head .hint{font-size:var(--t-xs)}
.main .summary{font-size:var(--t-body)}
.main .cond select, .main .cond input{font-size:var(--t-sm)}
.main .chk{font-size:var(--t-sm)}
.main .ticket-tab{font-size:var(--t-h2)}
.main .ohlc{font-size:var(--t-sm)}
.main .drawer-head h3{font-size:17px}
.drawer .drawer-head h3{font-size:17px}

/* ---------- account switcher ---------- */

.crumb-account{position:relative;display:inline-flex}
.acct-btn{display:inline-flex;align-items:center;gap:7px;border:1px solid transparent;background:transparent;
  border-radius:9px;padding:4px 8px;cursor:pointer;color:var(--muted);font-size:var(--t-body,14px)}
.acct-btn:hover{background:rgba(0,0,0,.04);color:var(--ink)}
.acct-btn[aria-expanded=true]{background:var(--surface);border-color:var(--line);color:var(--ink)}
.acct-mask{font-size:11.5px;color:var(--muted);letter-spacing:.04em}

.acct-menu{position:absolute;top:calc(100% + 7px);left:0;z-index:25;min-width:330px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:0 14px 36px rgba(0,0,0,.14);overflow:hidden}
.acct-menu-head{font-size:11.5px;color:var(--muted);padding:11px 14px 8px}
.acct-menu-foot{font-size:11.5px;color:var(--muted);line-height:1.5;padding:10px 14px 12px;
  border-top:1px solid var(--line-soft);background:var(--canvas)}
.acct-item{display:flex;align-items:center;gap:14px;width:100%;text-align:left;border:0;background:transparent;
  padding:10px 14px;cursor:pointer;border-top:1px solid var(--line-soft)}
.acct-item:hover{background:var(--canvas)}
.acct-item.on{background:var(--sunken)}
.acct-item-main{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.acct-item-name{font-size:13.5px;font-weight:500;color:var(--ink);display:flex;align-items:center}
.acct-item-sub{font-size:11.5px;color:var(--muted)}
.acct-item-val{font-size:13.5px;color:var(--ink-2);white-space:nowrap}

/* A detail row spans every column, which makes its cell both first and last
   child — so it inherits the right-alignment meant for numeric columns. */
.main td.detail{
  text-align:left;
  padding:0 0 13px;
  font-size:var(--t-sm);
  color:var(--muted);
  line-height:1.6;
  white-space:normal;
}
/* Two aligned columns rather than a wall of inline text: the labels line up,
   and the prose stops short of the numeric columns instead of running under
   them. */
.main .detail-box{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:4px 16px;
  max-width:76ch;
}
.main .detail-box .lbl{color:var(--ink-2);font-weight:500;white-space:nowrap}
/* an entry and its detail are one thing: only the pair gets a rule beneath */
.main tr.has-detail > td{border-bottom:0;padding-bottom:8px;vertical-align:top}

/* Titles are prose and must wrap; the global nowrap is meant for numbers. */
.main td.wrap-cell{white-space:normal;min-width:200px}
.main td.decision-cell{white-space:normal;vertical-align:top;min-width:132px}
.main td.decision-cell .reason{font-size:var(--t-xs);color:var(--muted);margin-top:5px;line-height:1.4}
/* Give the numeric and status columns exactly what they need and let the
   title column absorb the rest. */
.main table.ledger th:nth-child(2),
.main table.ledger th:nth-child(3),
.main table.ledger th:nth-child(4){width:1%;white-space:nowrap}
/* the four status columns were packed together on the right */
.main table.ledger th:not(:first-child),
.main table.ledger td:not(:first-child):not(.detail){padding-left:32px}
/* the detail cell is also a last-child; it must still wrap */
.main table.ledger td:last-child:not(.detail){white-space:nowrap}

/* What Voltu's risk management changed, stated as a trade rather than a claim. */
.main .raw-cmp{
  display:grid;grid-template-columns:1fr auto;gap:3px 14px;
  margin:10px 18px 0;padding:8px 11px;
  background:var(--sunken);border-radius:var(--radius-sm);
  font-size:var(--t-xs);color:var(--muted);
}
.main .raw-cmp span{white-space:nowrap}
.main .raw-cmp .num{color:var(--ink-2)}
.main .raw-cmp .num b{color:var(--green);font-weight:600}

/* The card footer holds a pill, an optional amount and two buttons. At three
   cards per row that overflows, and flex compresses the buttons until their
   labels break mid-word. Let the row wrap instead and keep labels intact. */
.main .strat .foot{flex-wrap:wrap;row-gap:8px}
.main .strat .foot .btn,
.main .strat .foot .tag,
.main .strat .foot .pill{white-space:nowrap;flex:none}
.main .strat .foot .right{margin-left:auto}


/* ---------- large displays ----------
   The shell used to stop at laptop dimensions and float in the middle of a
   27". It now fills, and the extra width is shared: a wider rail shows more
   of the conversation, and the main column grows without its lines getting
   too long to read. */

@media (min-width:1700px){
  .app{grid-template-columns:264px minmax(0,1fr) 470px}
  .main .view{padding:16px 26px 32px}
  .main-head{padding:17px 26px 14px}
}
@media (min-width:1800px){
  /* a third column keeps the line length readable; at two columns a card
     on a 1920 display runs to 84 characters a line */
  .main .grid.cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:2100px){
  .app{grid-template-columns:284px minmax(0,1fr) 520px}
  .main .view{padding:18px 30px 34px}
  .main-head{padding:19px 30px 15px}
  .main .inst-lower{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
}
@media (min-width:2200px){
  .main .grid.cards{grid-template-columns:repeat(4,minmax(0,1fr))}
}


/* ==================================================================
   THEMES
   The neutrals and the one strong colour move; the status palette
   (green / red / amber for up, down and needs-you) never does — those
   mean something, and their contrast and colourblind separation were
   validated once and should stay put.
================================================================== */

/* Acid — Fintra. Cream ground, heavy black, an acid lime that carries the
   action. The only theme with a light brand colour, hence --primary-ink. */
[data-theme="acid"]{
  --page:#e9e9e2; --shell:#f4f4ee; --sidebar:#eeeee7; --surface:#ffffff;
  --canvas:#faf9f4; --sunken:#f1f1ea;
  --ink:#0d0d0a; --ink-2:#41413b; --muted:#8f8f86;
  --line:#e3e3da; --line-soft:#eeeee6;
  --primary:#d7f24a; --primary-hi:#c9e838; --primary-ink:#101008;
  --accent:#5f6d18;
}

/* Mint — Cryptowallet. Sage surfaces, peach actions. Muted and slightly
   retro; the calmest of the three despite the colour. */
[data-theme="mint"]{
  --page:#d2dbd3; --shell:#e5eae5; --sidebar:#dde4de; --surface:#ffffff;
  --canvas:#f4f8f4; --sunken:#e9efe9;
  --ink:#121711; --ink-2:#454b43; --muted:#879085;
  --line:#d6dfd7; --line-soft:#e4eae4;
  --primary:#f0d3a2; --primary-hi:#e6c48c; --primary-ink:#1b2418;
  --accent:#4d7a60;
}

/* Editorial — W3. Greige, achromatic, hairlines that actually read. The
   surface is off-white rather than white, so rules carry the structure. */
[data-theme="editorial"]{
  --page:#d7d5d0; --shell:#e7e5e0; --sidebar:#e1dfd9; --surface:#f6f5f2;
  --canvas:#efeeea; --sunken:#e6e4de;
  --ink:#0f0f0d; --ink-2:#3e3e3a; --muted:#87857f;
  --line:#c9c6c0; --line-soft:#dbd8d2;
  --primary:#111111; --primary-hi:#000000; --primary-ink:#ffffff;
  --accent:#56544e;
}
/* the editorial look leans on its rules, so they get a touch more weight */
[data-theme="editorial"] .card{border-color:var(--line)}
[data-theme="editorial"] .main{border-left-color:var(--line);border-right-color:var(--line)}

/* ---------- prototype: theme picker in the sidebar ---------- */
.theme-row{display:flex;align-items:center;gap:7px;padding-top:12px;margin-top:2px;border-top:1px solid var(--line)}
.theme-row .lbl{font-size:10.5px;color:var(--muted);margin-right:auto}
.sw{width:17px;height:17px;border-radius:50%;border:1px solid rgba(0,0,0,.14);cursor:pointer;padding:0;
  background-size:100% 100% !important}
.sw[aria-pressed=true]{outline:2px solid var(--ink-2);outline-offset:2px}

/* ---------- thesis and kill criteria ---------- */

.main .kill{display:flex;align-items:center;gap:9px;padding:7px 0;font-size:var(--t-body)}
.main .kill svg{width:14px;height:14px;flex:none}
.main .kill.ok svg{color:var(--green)}
.main .kill.no svg{color:var(--amber)}
.main .kill-label{color:var(--ink-2);flex:1;min-width:0}
.main .kill.no .kill-label{color:var(--ink)}
.main .kill-value{color:var(--muted);white-space:nowrap}
.main .kill.no .kill-value{color:var(--amber);font-weight:500}

/* ---------- the behavioural mirror ----------
   Deliberately quiet: it reports, it does not warn. Amber would make it a
   telling-off, which is the fastest way to get it tuned out. */
.mirror{
  display:flex;flex-direction:column;gap:3px;
  padding:10px 14px;border-top:1px solid var(--line-soft);
  background:var(--sunken);
  font-size:12.5px;color:var(--ink-2);line-height:1.55;
}
.mirror-label{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}

/* ---------- situations ---------- */

.proposal.situation{background:var(--canvas)}
.sit-moves{
  display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:11px;
  padding:8px 10px;background:var(--sunken);border-radius:var(--radius-sm);
  font-size:11.5px;color:var(--muted);
}
.sit-moves b{font-weight:600;margin-right:3px}
.sit-block,.sit-view{margin-top:11px;font-size:12.5px;line-height:1.55;color:var(--ink-2)}
.sit-label{
  display:block;font-size:10px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:3px;
}
.sit-view{
  padding:10px 12px;background:var(--sunken);border-radius:var(--radius-sm);
  color:var(--ink);
}
.cap-note{margin-top:7px;font-size:11.5px;color:var(--muted);line-height:1.45}

/* ---------- since you last looked ----------
   Deliberately plain. This is a summary, not an alert stack — colouring
   every row would turn "here is what changed" into "here are five things
   to worry about", which is the feed behaviour it exists to avoid. */

.main .digest{display:flex;flex-direction:column}
.main .digest-row{
  display:flex;gap:12px;align-items:flex-start;
  padding:10px 0;border-bottom:1px solid var(--line-soft);
  font-size:var(--t-body);line-height:1.55;color:var(--ink-2);
}
.main .digest-row:last-child{border-bottom:0}
.main .digest-tag{
  flex:none;min-width:74px;font-size:10px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);padding-top:3px;
}
.main .digest-row b{color:var(--ink);font-weight:600}
.main .digest-quiet{
  font-size:var(--t-body);line-height:1.6;color:var(--ink-2);
  padding:14px 16px;background:var(--sunken);border-radius:var(--radius-sm);
}
.main .digest-quiet b{color:var(--ink)}
.main .digest-checked{
  margin-top:12px;padding-top:10px;border-top:1px solid var(--line-soft);
  font-size:var(--t-xs);color:var(--muted);line-height:1.5;
}


/* ---------- the focus card on Home ----------
   It used to carry an inline width:76% from the original comp, where a
   narrower card read as deliberate. Once the tiles above and the row below
   are full width it just reads as misalignment — and the inline font sizes
   predated the type scale, so it was a step larger than everything else. */

.main .focus-home .focus-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 0}
.main .focus-home .focus-body{padding:11px 16px 14px}
.main .focus-home .focus-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.main .focus-home .focus-head h2{font-size:18px;font-weight:600;letter-spacing:-.01em;line-height:1.3}
.main .focus-home .focus-body p{margin-top:8px;font-size:var(--t-body);line-height:1.55;color:var(--muted);max-width:70ch}
.main .focus-home .focus-actions{display:flex;gap:10px;padding:13px 16px;border-top:1px solid var(--line-soft)}
.main .focus-home .focus-actions .btn.primary{flex:1}


/* ---------- reverse-engineering a source ---------- */

.src-row {
  display:flex; align-items:center; gap:14px; width:100%;
  padding:13px 14px; margin-bottom:8px; text-align:left; cursor:pointer;
  background:var(--canvas); border:1px solid var(--line); border-radius:10px;
  color:var(--ink); font:inherit; transition:border-color .15s, background .15s;
}
.src-row:hover { border-color:var(--primary); background:var(--sunken); }
.src-kind {
  flex:none; width:46px; padding:3px 0; text-align:center;
  font-size:9.5px; font-weight:650; letter-spacing:.06em;
  color:var(--muted); background:var(--surface); border:1px solid var(--line); border-radius:5px;
}
.src-main { display:flex; flex-direction:column; gap:2px; min-width:0; flex:1 }
.src-label { font-size:var(--t-body); font-weight:560 }
.src-sub { font-size:var(--t-xs); color:var(--muted) }
.src-go { flex:none; color:var(--muted); font-size:15px }
.src-row:hover .src-go { color:var(--primary) }

.consent { border:1px solid var(--line); border-radius:10px; padding:15px; background:var(--canvas) }
.consent-url {
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:var(--t-xs); word-break:break-all;
  padding:8px 10px; margin-bottom:11px; border-radius:6px;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-2);
}
.consent p { font-size:var(--t-sm); color:var(--ink-2); line-height:1.55; margin:0 0 12px }
.consent-check { display:flex; gap:10px; align-items:flex-start; cursor:pointer }
.consent-check input { margin-top:2px; flex:none; accent-color:var(--primary); width:15px; height:15px }
.consent-check span { font-size:var(--t-sm); line-height:1.55 }
.consent-note { font-size:var(--t-xs) !important; color:var(--muted) !important; margin:12px 0 0 !important }

.rule { border:1px solid var(--line); border-radius:10px; padding:13px 14px; margin-bottom:9px; background:var(--canvas) }
.rule-head { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:9px }
.rule-stats { font-size:var(--t-sm); color:var(--ink-2); line-height:1.6 }
.rule-stats b { font-variant-numeric:tabular-nums }
.rule-extra { font-size:var(--t-xs); color:var(--muted); margin-top:6px; line-height:1.5 }
.rule .btn { margin-top:11px }
.rule-none {
  border:1px solid var(--line); border-left:2px solid var(--amber); border-radius:8px;
  padding:13px 14px; font-size:var(--t-sm); color:var(--ink-2); line-height:1.6;
}
.rule-none b { display:block; color:var(--ink); margin-bottom:4px }
.tag.plain { background:var(--surface); border-color:var(--line); font-weight:560 }
.num.flat { color:var(--muted) }

.from-source {
  display:flex; align-items:center; gap:14px; width:100%; margin-bottom:14px;
  padding:12px 14px; text-align:left; cursor:pointer; color:var(--ink); font:inherit;
  background:var(--canvas); border:1px dashed var(--line); border-radius:10px;
}
.from-source:hover { border-color:var(--primary); border-style:solid }
.from-source > span:first-child { display:flex; flex-direction:column; gap:2px; flex:1 }
.from-source b { font-size:var(--t-body); font-weight:560 }
.from-source span span { font-size:var(--t-xs); color:var(--muted) }

.derived {
  display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:14px;
  padding:11px 13px; border-radius:9px; font-size:var(--t-sm); line-height:1.5;
  background:var(--canvas); border:1px solid var(--line); border-left:2px solid var(--primary);
}
