/* FILG v2 — the unified two-panel build surface. Craigslist-plain on purpose: the machinery is the
   visual interest, not decoration. Light/dark aware. */
:root{
  --bg:#fbfbfa; --fg:#1a1a1a; --muted:#6b6b6b; --line:#e2e2df; --card:#fff;
  --accent:#FF6B4A; --blue:#2E7CF6; --yellow:#c99a00; --red:#d1453b; --green:#2e7d32;
}
@media (prefers-color-scheme:dark){:root{--bg:#161615;--fg:#ededec;--muted:#9a9a97;--line:#2e2e2b;--card:#1e1e1d;}}
*{box-sizing:border-box}
[hidden]{display:none!important}   /* the hidden attribute must win over the display rules below */
html,body{margin:0;height:100%;background:var(--bg);color:var(--fg);
  font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;}
button{font:inherit;cursor:pointer}
textarea{font:inherit;width:100%;resize:vertical;background:var(--card);color:var(--fg);
  border:1px solid var(--line);border-radius:8px;padding:10px 12px;outline:none}
textarea:focus{border-color:var(--accent)}
.ghost{background:none;border:1px solid var(--line);border-radius:6px;padding:6px 12px;color:var(--fg)}
.ghost.small{padding:3px 8px;font-size:13px}
.err{color:var(--red);font-size:13px;margin-top:6px;min-height:1px}

/* ── Full mode: the landing IS the workspace — left drawer expanded, box centered. The first
   prompt drops .full and the same surface collapses into the sidebar (width + hero transitions). ── */
.hero{max-height:0;opacity:0;overflow:hidden;margin:0 auto;text-align:center;max-width:640px;width:100%;
  transition:max-height .55s cubic-bezier(.4,0,.2,1),opacity .3s ease,padding .55s ease;padding:0 20px}
.hero h1{font-size:30px;margin:0 0 12px;font-weight:700}
#landing-sub{color:var(--muted);margin:0 0 22px;font-size:15px}
/* once a plan exists the hero is collapsed — but as a 0-height flex child it still ate a 12px gap
   on EACH side, doubling the empty space above the section header (SUMMARY / GRADED RESEARCH / …).
   Drop it from the flow entirely off the landing so the header sits tight under the FILG bar. */
.workspace:not(.full) .hero{display:none}
.workspace.full .left{width:100%;min-width:100%;border-right:none}
.workspace.full .hero{max-height:60vh;opacity:1;padding:6vh 20px 8px;overflow-y:auto}   /* scrolls at zoom / with the idea card open — never clips */
.workspace.full .chatlog,.workspace.full .modechips{display:none}
.workspace.full #ws-wrap{max-width:640px;margin:0 auto;width:100%}
.workspace.full #ws-box{min-height:92px;font-size:16px}
/* the landing HELP CHAT: a help question on the landing expands into a conversation (not a build) —
   collapse the big headline and reveal the chat log between it and the box (Sam, 2026-07-07) */
.workspace.full.helpchat .hero{max-height:0;opacity:0;padding:0}
.workspace.full.helpchat .chatlog{display:flex;flex:1 1 auto;min-height:0;overflow-y:auto;
  max-width:640px;margin:0 auto;width:100%}
.workspace.full.helpchat #ws-box{min-height:70px}
.workspace.full .right{flex:0 0 0;opacity:0;padding:0;pointer-events:none}
.qmark{display:none}
.workspace.full .qmark{display:flex;align-items:center;justify-content:center;bottom:66px}   /* riding the textarea, clear of the Start button */
#ws-send,.stage-cta{background:var(--accent);color:#fff;border:none;border-radius:8px;
  padding:11px 20px;font-weight:600}

/* ── the prompt box + its help/mode tint ── */
.promptwrap{position:relative;text-align:left}
.promptwrap.big textarea{min-height:92px;font-size:16px}
.qmark{position:absolute;right:10px;bottom:10px;width:26px;height:26px;border-radius:50%;
  border:1px solid var(--line);background:var(--card);color:var(--muted);font-weight:700;line-height:1}
.promptwrap.help textarea{background:color-mix(in srgb,var(--blue) 8%,var(--card));border-color:var(--blue)}
.promptwrap.help .qmark{border-color:var(--blue);color:var(--blue);background:color-mix(in srgb,var(--blue) 12%,var(--card))}
.promptwrap.research textarea{background:color-mix(in srgb,var(--yellow) 12%,var(--card));border-color:var(--yellow)}
.promptwrap.board textarea{background:color-mix(in srgb,var(--red) 8%,var(--card));border-color:var(--red)}

/* ── Workspace split ── */
.workspace{display:flex;height:100%;overflow:hidden}
.left{width:var(--left-w,360px);min-width:300px;border-right:1px solid var(--line);padding:14px;display:flex;
  flex-direction:column;gap:12px;overflow:hidden;position:relative;z-index:10;
  transition:width .55s cubic-bezier(.4,0,.2,1),min-width .55s cubic-bezier(.4,0,.2,1)}   /* the chatlog scrolls, the box stays pinned; full mode animates into the sidebar; --left-w = the drag-resized width */
@media (min-width:1100px){.left{width:var(--left-w,33.333vw)}}   /* a third of the screen on big displays */
.left-top{display:flex;justify-content:space-between;align-items:center}
.logo{background:none;border:none;font-weight:800;font-size:18px;color:var(--accent)}
.modechips{display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap}
.mchip{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:3px 12px;font-size:13px;color:var(--muted)}
.mchip.on{color:var(--fg);border-color:var(--fg)}
.mchip[data-mode=research].on{border-color:var(--yellow);color:var(--yellow)}
.mchip[data-mode=board].on{border-color:var(--red);color:var(--red)}
.mchip[data-mode=help].on{border-color:var(--blue);color:var(--blue)}
#ws-send{margin-top:8px;width:100%}

/* ── The chat: the conversation IS the left panel; the box stays pinned below it ── */
.chatlog{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:4px 2px;min-height:40px}
.cmsg{max-width:92%;border-radius:12px;padding:8px 12px;font-size:13.5px;line-height:1.45}
.cmsg.user{align-self:flex-end;background:color-mix(in srgb,var(--accent) 14%,var(--card));border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line))}
.cmsg.bot{align-self:flex-start;background:var(--card);border:1px solid var(--line)}
.cmsg.err{align-self:flex-start;background:var(--card);border:1px solid var(--red);color:var(--red)}
.cmsg.status{align-self:center;background:none;border:none;color:var(--muted);font-size:12px;padding:2px}
.cmsg .cbtns{display:flex;gap:8px;margin-top:8px}
.cmsg .cbtns button{border-radius:7px;padding:6px 14px;font-size:13px;border:1px solid var(--line);background:var(--card);color:var(--fg)}
.cmsg .cbtns .go{background:var(--accent);color:#fff;border:none;font-weight:600}
.cmsg.asked .cbtns{display:none}
/* graded-lookup rows in a chat bubble: claim + source link + a tier chip (flagged = vendor amber) */
.lkclaim{margin-top:8px;padding-top:8px;border-top:1px solid var(--line);font-size:13px;line-height:1.45}
.lkclaim:first-of-type{margin-top:6px}
.lkclaim a{color:var(--muted);font-size:11.5px;margin-left:4px}
.lktier{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;font-size:10.5px;
  border:1px solid var(--line);color:var(--muted);vertical-align:1px}
.lktier.bad{border-color:var(--yellow);color:var(--yellow)}
/* board-in-chat rows: one take per director, skeptic tinted, matrix lines bolded */
.bdrow{margin-top:8px;padding-top:8px;border-top:1px solid var(--line);font-size:13px;line-height:1.45}
.bdrow b{display:inline-block;margin-right:4px}
.bdrow.skept{color:color-mix(in srgb,var(--red) 70%,var(--fg))}   /* answered → buttons fold away, the bubble stays as history */

/* ── Right: the decision graph IS the panel ── */
.right{flex:1;position:relative;overflow:hidden;min-width:0;opacity:1;transition:opacity .45s ease .2s;background:
  radial-gradient(color-mix(in srgb,var(--fg) 7%,transparent) 1px,transparent 1px);
  background-size:22px 22px}
#graph{position:absolute;inset:0;cursor:grab;touch-action:none}
#graph.dragging{cursor:grabbing}
#gview{position:absolute;top:0;left:0;transform-origin:0 0;will-change:transform}
#gedges{position:absolute;top:0;left:0;overflow:visible;pointer-events:none}
#gedges path{fill:none;stroke:var(--line);stroke-width:1.6px;vector-effect:non-scaling-stroke}
#gedges path.on{stroke:var(--accent);stroke-width:2px}
#gedges path.new{stroke-dasharray:1;stroke-dashoffset:1;animation:gdraw .55s ease forwards}
@keyframes gdraw{to{stroke-dashoffset:0}}
.gnode{position:absolute;width:190px;background:var(--card);border:1px solid var(--line);border-radius:11px;
  padding:9px 12px;cursor:pointer;user-select:none;
  transition:left .45s ease,top .45s ease,opacity .35s ease,box-shadow .2s ease,border-color .2s ease}
.gnode:hover{box-shadow:0 3px 14px rgba(0,0,0,.14)}
.gnode .nk{font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);display:flex;gap:5px;align-items:center}
.gnode .nt{font-size:13px;font-weight:600;margin-top:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.gnode.path{border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
.gnode.on{border-color:var(--accent);box-shadow:0 4px 18px color-mix(in srgb,var(--accent) 25%,transparent)}
.gnode.dim{opacity:.6}
.gnode.sel{border-color:var(--green);box-shadow:0 0 0 1px color-mix(in srgb,var(--green) 45%,transparent)}
/* passed-over: clearly secondary but still READABLE — the rim carries the meaning, not the fade */
.gnode.rej{border-color:color-mix(in srgb,var(--red) 45%,var(--line));opacity:.72}
.gnode.rej:hover{opacity:1}
.gnode.ghost{border-style:dashed;border-color:var(--accent);color:var(--muted);animation:gpulse 1.6s ease-in-out infinite}
.gnode.enter{opacity:0;transform:translateY(-10px)}
.gnode.wip{width:250px;border-color:var(--accent);animation:gpulse 1.6s ease-in-out infinite;cursor:default}
@keyframes gpulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 34%,transparent)}
  50%{box-shadow:0 0 0 7px transparent}}
.nlanes{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}
.nlanes i{font-style:normal;font-size:12px;filter:grayscale(1);opacity:.5;transition:filter .3s,opacity .3s}
.nlanes i.done{filter:none;opacity:1}
.nspew{font:10.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted);margin-top:6px;
  max-height:96px;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end}
.nspew div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nspew div:last-child{color:var(--fg)}
.wipl{color:var(--accent)!important}
.spin{width:11px;height:11px;border-radius:50%;border:2px solid color-mix(in srgb,var(--accent) 30%,transparent);
  border-top-color:var(--accent);display:inline-block;animation:gspin .8s linear infinite;flex:none}
.sendspin{border-color:rgba(255,255,255,.35);border-top-color:#fff;vertical-align:-1px}
@keyframes gspin{to{transform:rotate(360deg)}}
#ws-send.busy::after{content:'';display:inline-block;width:1.2em;text-align:left;animation:ell 1.2s steps(1) infinite}
@keyframes ell{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'}}
/* a chat send in flight DEBOUNCES the focused-node CTAs: dimmed + click-blocked + a spinner over the
   row, so feedback-then-race-click-"next step" can't fire on stale state (cleared when the reply lands) */
body.chatbusy .nbody .ctarow{position:relative;pointer-events:none}
body.chatbusy .nbody .ctarow .stage-cta{opacity:.5}
body.chatbusy .nbody .ctarow::after{content:'';position:absolute;left:50%;top:50%;width:18px;height:18px;
  transform:translate(-50%,-50%);border-radius:50%;border:2px solid color-mix(in srgb,var(--accent) 30%,transparent);
  border-top-color:var(--accent);animation:ctaspin .8s linear infinite;z-index:3;pointer-events:none;
  background:var(--card);box-shadow:0 0 0 7px var(--card)}
/* keep the centering translate through the rotation — a bare rotate keyframe would drop it and the
   spinner would spin off-center over the CTA row */
@keyframes ctaspin{from{transform:translate(-50%,-50%) rotate(0)}to{transform:translate(-50%,-50%) rotate(360deg)}}

/* ── Zoomed-in node: the document/step expands IN PLACE inside the node ── */
#gview.ease{transition:transform .6s cubic-bezier(.22,.8,.3,1)}
.gnode.focus{overflow:auto;z-index:7;cursor:default;opacity:1;
  border-color:var(--accent);box-shadow:0 26px 80px rgba(0,0,0,.35);padding:14px 18px 18px;
  overscroll-behavior:contain;   /* width/max-height set inline: panel-fit at natural scale (k=1) */
  user-select:text}              /* an OPEN doc is a document: selectable (select-to-comment, #8) */
.gnode.focus .draft{cursor:text}
/* an open doc keeps its selection story: green rim on a picked option, red-tinted on a passed one */
.gnode.focus.sel{border-color:var(--green);
  box-shadow:0 0 0 1px color-mix(in srgb,var(--green) 45%,transparent),0 26px 80px rgba(0,0,0,.35)}
.gnode.focus.rej{border-color:color-mix(in srgb,var(--red) 45%,var(--line))}
.gnode.focus .nt{-webkit-line-clamp:unset;font-size:15px}
.nbody{margin-top:10px;font-size:14px;cursor:auto}
.nbody .draft h3{font-size:15px}
/* the step's CTA stays pinned to the bottom of the open doc while its content scrolls */
.gnode.focus .nbody .ctarow{position:sticky;bottom:-18px;margin:16px -18px -18px;padding:12px 18px 14px;
  background:var(--card);border-top:1px solid var(--line)}
.nhist{margin-top:12px;border-top:1px solid var(--line);padding-top:8px}
.nhist summary{cursor:pointer;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.nhist .nspew{max-height:150px;display:block;overflow:auto}
/* research leaflets: labeled sub-nodes fanning out of a working node — the lane's question + a
   spinner while it digs, ✓ when it resolves. Click one to read the full question. */
.gleaf{position:absolute;width:184px;background:var(--card);border:1px solid var(--line);
  border-radius:999px;padding:4px 10px;display:flex;align-items:center;gap:6px;cursor:pointer;
  font-size:11px;color:var(--muted);opacity:.9;z-index:2;
  transition:left .5s ease,top .5s ease,opacity .4s,width .25s ease}
.gleaf .lfic{filter:grayscale(1);flex:none}
.gleaf .lftxt{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1}
.gleaf .lfspin{width:9px;height:9px;border-width:1.5px;flex:none}
.gleaf .lfok{color:var(--green);font-weight:700;flex:none}
.gleaf.done{border-color:var(--green);color:var(--fg)}
.gleaf.done .lfic{filter:none}
.gleaf.open{width:260px;border-radius:12px;z-index:6;color:var(--fg)}
.gleaf.open .lftxt{white-space:normal}
.gleaf.enter{opacity:0;transform:translateY(-8px)}
/* the in-node stack: lanes live inside the working node, one row each, stretch the node to fit */
.leafstack{display:flex;flex-direction:column;gap:5px;margin:8px 0 2px}
.gleaf.inrow{position:static;width:auto;transition:opacity .4s}
.gleaf.inrow.open{width:auto}
#vtabs{position:absolute;top:12px;left:16px;z-index:9;display:flex;gap:6px}
#vtabs button{border:1px solid var(--line);background:var(--card);border-radius:999px;padding:4px 14px;font-size:12px;color:var(--muted)}
#vtabs button.on{color:var(--fg);border-color:var(--fg)}
#docs{position:absolute;inset:0;padding:56px 26px 22px;overflow:auto}
#roadmap{position:absolute;inset:0;background:var(--bg)}
#roadmap iframe{width:100%;height:100%;border:0;display:block}
#dtabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:10px;border-bottom:1px solid var(--line);margin-bottom:16px}
.dtab{border:1px solid var(--line);background:var(--card);border-radius:8px;padding:6px 12px;font-size:12.5px;
  color:var(--muted);white-space:nowrap;display:inline-flex;gap:6px;align-items:center;cursor:pointer}
.dtab.on{color:var(--fg);border-color:var(--accent)}
.dtab.cur::after{content:'●';color:var(--accent);font-size:8px}
.dtab.wipdt{color:var(--accent);border-color:var(--accent);cursor:default}
.docsheet{max-width:760px;margin:0 auto;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:20px 24px}
#gpill{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:8;
  background:var(--accent);color:#fff;border:none;border-radius:999px;padding:9px 18px;font-weight:600;
  box-shadow:0 6px 20px color-mix(in srgb,var(--accent) 40%,transparent)}

/* ── Stage surfaces ── */
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin-bottom:14px}
.eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:0 0 6px}
.optgrid{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}
.opt{display:flex;gap:12px;align-items:flex-start;background:var(--card);border:1px solid var(--line);
  border-radius:12px;padding:14px 16px;cursor:pointer}
.opt.sel{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--card))}
.opt input{margin-top:4px}
.opt h3{margin:0 0 4px;font-size:16px}
.opt p{margin:0 0 6px;color:var(--fg)}
.mold{display:inline-block;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:2px 9px}
.ctarow{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.stage-cta{background:var(--accent);color:#fff;border:none;border-radius:8px;padding:10px 18px;font-weight:600;text-align:left}
.stage-cta.secondary{background:none;color:var(--fg);border:1px solid var(--line)}
.stage-cta .ctasub{display:block;font-size:11px;font-weight:400;opacity:.78;margin-top:2px}
.gate{border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;
  padding:10px 12px;margin:14px 0 2px;font-size:13.5px;color:var(--muted)}
.gate b{color:var(--fg)}
ul.qs{margin:6px 0 4px;padding-left:20px}
ul.qs li{margin:4px 0}
/* interactive gate questions: a clickable row that expands to an answer box (§v2 #14) */
ul.qs.qint{list-style:none;padding:0;margin:8px 0 4px}
ul.qs.qint li.qrow{margin:6px 0;border:1px solid var(--line);border-radius:8px;overflow:hidden}
li.qrow.answered{border-color:color-mix(in srgb,var(--green) 55%,var(--line))}
.qtoggle{display:flex;gap:8px;align-items:flex-start;width:100%;text-align:left;background:none;
  border:none;color:var(--fg);font:inherit;font-size:14px;padding:9px 11px;cursor:pointer}
.qtoggle:hover{background:color-mix(in srgb,var(--accent) 6%,transparent)}
.qmarker{flex:none;width:18px;height:18px;border-radius:50%;border:1px solid var(--line);
  display:inline-flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);margin-top:1px}
li.qrow.answered .qmarker{border-color:var(--green);color:var(--green)}
.qtext{flex:1}
.qans{max-height:0;overflow:hidden;transition:max-height .2s ease;padding:0 11px}
li.qrow.open .qans{max-height:180px;padding:0 11px 10px}
.qans textarea{width:100%;box-sizing:border-box;font:inherit;font-size:13.5px;resize:vertical;
  border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--fg);padding:6px 8px}
/* draw the focus ring INSET — the row's overflow:hidden (max-height animation + rounded corners)
   would clip the default outward-offset outline against the box edges */
.qans textarea:focus-visible{outline-offset:-2px}
.qfold:disabled{opacity:.45;cursor:default}
/* ── Alertable concerns: the pre-advance modal list + the board-line ⚠️ badge (2026-07-07) ── */
.mcbody{color:var(--muted);font-size:14px;line-height:1.55}
.mcbody .cintro{margin:0 0 10px}
.mcbody .cintro b{color:var(--fg)}
ul.concernlist{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
ul.concernlist .concern{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);
  border-left:3px solid var(--line);border-radius:8px;padding:9px 11px;background:var(--card)}
ul.concernlist .concern.high{border-left-color:var(--red)}
ul.concernlist .concern.med{border-left-color:var(--yellow)}
ul.concernlist .concern .cico{flex:none;font-size:15px;line-height:1.3}
ul.concernlist .concern b{color:var(--fg);font-size:13.5px}
ul.concernlist .concern .cdetail{color:var(--muted);font-size:13px;line-height:1.45;margin-top:2px}
.alertdot{font-size:12px;vertical-align:1px}
.alertdot.high{filter:none}
.alertdot.med{opacity:.85}
.nhist.hasalert>summary{color:var(--fg)}
.bdrow.concerning.high{border-left:2px solid var(--red);padding-left:8px}
.bdrow.concerning.med{border-left:2px solid var(--yellow);padding-left:8px}
.bdrow .skept.hi{color:var(--red)}
.kept li{color:var(--green)} .dropped li{color:var(--muted)}
.dropped li .why{opacity:.8}
.verdict{display:inline-block;font-size:12px;font-weight:700;text-transform:uppercase;padding:2px 10px;
  border-radius:999px;margin-right:8px}
.verdict.pursue{background:color-mix(in srgb,var(--green) 18%,transparent);color:var(--green)}
.verdict.pivot{background:color-mix(in srgb,var(--yellow) 20%,transparent);color:var(--yellow)}
.verdict.kill{background:color-mix(in srgb,var(--red) 18%,transparent);color:var(--red)}
.react{font-size:18px;font-weight:600;margin:6px 0 14px}
.keypoints{list-style:none;padding:0;margin:0}
.keypoints li{padding:8px 0;border-top:1px solid var(--line)}
.keypoints li b{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.draft{white-space:pre-wrap}
.draft h1,.draft h2,.draft h3{font-size:17px;margin:14px 0 6px}
.fork{border:1px solid var(--red);border-radius:12px;padding:16px 18px;background:color-mix(in srgb,var(--red) 5%,var(--card))}
.fork .skept{font-style:italic;color:var(--red);margin:8px 0}

.thinking{color:var(--muted)}

/* (the tool drawer is gone, 2026-07-06 — research/board/help are all chat-drawer display states) */
.ev{list-style:none;padding:0;margin:0}
.ev li{padding:8px 0;border-top:1px solid var(--line);font-size:13px}
.badge{font-size:11px;border-radius:999px;padding:1px 7px;border:1px solid var(--line)}
.b-ok{color:var(--green)} .b-warn{color:var(--yellow)}

/* ── Toasts ── */
.toasts{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:20;display:flex;flex-direction:column;gap:6px}
.toast{background:var(--fg);color:var(--bg);padding:8px 14px;border-radius:8px;font-size:13px}
.toast.err{background:var(--red);color:#fff}

/* ── Mobile = the v1 drawer model (Sam, 2026-07-06). The decision graph/docs own the SCREEN;
   the chat lives in a LEFT drawer over it. Explicit controls: ⟨ in the drawer collapses it
   fully off the LEFT edge; a floating 💬 chip over the graph expands it back. Any submission
   that draws the graph auto-collapses the drawer (mCollapse in beginWip/adoptPlan) so the
   tree animates unobstructed. An expanded section (research/board ⇥) REPLACES the chat
   drawer; ⇤ Tuck in returns to the split chat drawer. dvh tracks the browser bar — the old
   stacked layout overflowed the 100%/overflow:hidden workspace and cut the bottom off. ── */
/* the open/close TABS follow v1's drawer-rail/sd-rail pattern: a 20×54 tab on the drawer's outer
   edge collapses it; when collapsed, the same tab sticks out of the screen's left edge to reopen */
.mrail-in,#mrail{display:none;align-items:center;justify-content:center;width:20px;height:54px;
  padding:0;border:0;cursor:pointer;background:#555;color:#fff;font-size:18px;line-height:1}
.nfold{display:none}
.jokecard{border:1px solid var(--line);border-radius:12px;padding:16px;margin-top:16px;text-align:left}

/* ── Model-crew chip + session meter + profile ── */
.stackchip{display:inline-flex;align-items:center;gap:7px;font-size:12px;padding:4px 10px;white-space:nowrap}
.pips{display:inline-flex;gap:2px}
.pips i{width:5px;height:5px;border-radius:50%;background:var(--line);display:inline-block}
.pips i.on{background:var(--accent)}
.meter{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap}
.profile{width:30px;height:30px;border-radius:50%;border:1px solid var(--line);background:var(--card);
  color:var(--muted);display:inline-flex;align-items:center;justify-content:center;padding:0}
.profile:hover{color:var(--fg)}
.acctlabel{display:none}        /* the profile reads as an icon on desktop, the word 'Account' in the mobile menu */
.hmenu{display:none;width:32px;height:30px;border:1px solid var(--line);border-radius:8px;
  background:var(--card);color:var(--fg);font-size:15px;line-height:1;padding:0}   /* mobile-only */
.sktile{display:block;width:100%;text-align:left;background:var(--card);border:1px solid var(--line);
  border-radius:10px;padding:10px 12px;margin-bottom:8px;color:var(--fg)}
.sktile.on{border-color:var(--accent)}
.sktile .sk-top{display:flex;align-items:center;gap:8px;margin-bottom:3px}
.sktile .sk-top .pips{margin-left:auto}
.sktile .sk-desc{font-size:12.5px;color:var(--muted)}

/* ── Key indicator + modal ── */
.lt-right{display:flex;align-items:center;gap:8px;margin-left:auto}
.keydot{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:2px 9px;white-space:nowrap}
.keydot.byok{color:var(--green);border-color:var(--green)}
.keydot.off{opacity:.5}
.modalback{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:30;display:none}
.modalback.show{display:block}
.modal{position:fixed;z-index:31;top:50%;left:50%;transform:translate(-50%,-50%);width:min(460px,92vw);
  background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px 20px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.modal-h{display:flex;justify-content:space-between;align-items:center;font-weight:700;margin-bottom:12px}
.modal-body{font-size:14px}
.modal-acts{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}
.modal-acts button{border:1px solid var(--line);background:var(--card);color:var(--fg);border-radius:8px;padding:8px 16px}
.modal-acts .primary{background:var(--accent);color:#fff;border:none}
.provsw{display:flex;gap:6px;margin:6px 0 12px}
.provsw button{flex:1;border:1px solid var(--line);background:var(--card);color:var(--muted);border-radius:8px;padding:7px}
.provsw button.on{border-color:var(--fg);color:var(--fg)}
.modal input{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 11px;background:var(--card);color:var(--fg);font:inherit}
.modal .muted{color:var(--muted);font-size:13px;margin:0 0 10px}
.modal .err{min-height:16px}
.modal a{color:var(--accent)}

/* The fold-in receipt: one line on HOW the last note/comments changed this part (visible, not silent) */
.chgnote{font-size:13px;color:var(--muted);background:var(--bg);border-left:3px solid var(--accent);
  border-radius:0 6px 6px 0;padding:6px 10px;margin:0 0 10px}

/* ── Inline doc comments (backlog #8): select text in a rendered doc → note popover + comment rows ── */
#cmtpop{position:fixed;z-index:60;width:280px;background:var(--card);border:1px solid var(--line);
  border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.18);padding:10px;display:none}
#cmtpop.show{display:block}
#cmtpop .cmtq{font-size:12px;color:var(--muted);font-style:italic;margin-bottom:6px;
  max-height:76px;overflow:auto}
#cmtpop textarea{font-size:13px}
#cmtpop .cmtacts{display:flex;gap:8px;align-items:center;margin-top:8px}
#cmtpop .cmtacts .sp{flex:1}
#cmtpop .cmtacts button{border:1px solid var(--line);background:var(--card);color:var(--fg);
  border-radius:7px;padding:5px 12px;font-size:13px}
#cmtpop .cmtacts .primary{background:var(--accent);color:#fff;border:none;font-weight:600}
#cmtpop .cmtdel{display:none;color:var(--red);border-color:var(--red)}
#cmtpop.editing .cmtdel{display:inline-block}
/* the inline balloon: pinned at the end of a commented section, click to view/edit/delete */
.cmtdot{border:none;background:none;cursor:pointer;font-size:14px;line-height:1;
  padding:0 2px;margin-left:4px;vertical-align:baseline;opacity:.72}
.cmtdot:hover{opacity:1}
/* the bottom summary: per comment, ONE truncated quote line + the note nested ONE line beneath */
.cmts{margin-top:12px;border-top:1px dashed var(--line);padding-top:8px}
.cmts .cmtrow{display:block;font-size:13px;margin:6px 0;cursor:pointer;border-radius:6px;padding:2px 4px}
.cmts .cmtrow:hover{background:var(--bg)}
.cmts .cmtq{color:var(--muted);font-style:italic;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmts .cmtn{padding-left:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* click-a-line / highlight-to-comment affordance: a rendered doc block lifts on hover (v1 parity) */
.draft p,.draft li,.draft h1,.draft h2,.draft h3,.draft h4,.draft blockquote{border-radius:4px;transition:background .12s}
.draft p:hover,.draft li:hover,.draft h1:hover,.draft h2:hover,.draft h3:hover,.draft h4:hover,.draft blockquote:hover{
  background:color-mix(in srgb,var(--accent) 8%,transparent);cursor:pointer}

/* ── #12: chapter labels grouping the section tabs in the reader (display only) ── */
.dchap{align-self:center;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);margin:0 2px 0 10px;white-space:nowrap}
.dchap:first-child{margin-left:0}

/* ── v2 research mode: ONE chat, three displays. The list lives IN the chat drawer (full → the
   history is covered; split → top half research, bottom half chat) or slides out into its own
   left-anchored drawer (expanded). All transitions are flex/opacity so the chat "slides". ── */
/* INACTIVE panes are display:none, not just 0-height — a 0-height flex child still eats a 12px gap on
   each side, and THREE stacked inactive panes (rpane+hpane before spane) piled ~36px of dead space
   above the section header. The active pane lights display:flex via its mode rule below. */
.rpane{display:none;flex-direction:column;min-height:0;flex:0 1 0%;opacity:0;overflow:hidden;
  transition:flex .45s ease,opacity .3s ease;pointer-events:none}
/* research, board, and help share the .rpane machinery; the MODE rules are id-scoped so only the
   active surface lights (a bare .rpane selector would raise every pane at once) */
.left.rfull #rpane,.left.rsplit #rpane,.left.bfull #bpane,.left.bsplit #bpane,.left.hsplit #hpane{display:flex;opacity:1;pointer-events:auto}
.left.rfull #rpane,.left.bfull #bpane{flex:1 1 auto}
.left.rfull .chatlog,.left.bfull .chatlog{flex:0 1 0%;min-height:0;opacity:0;pointer-events:none}
.left.rsplit #rpane,.left.bsplit #bpane{flex:0 0 46%;border-bottom:1px dashed var(--line);padding-bottom:6px;margin-bottom:4px}
/* help is a BANNER over the chat: it takes what it needs (up to the split height), never a drawer */
.left.hsplit #hpane{flex:0 1 auto;max-height:46%;border-bottom:1px dashed var(--line);padding-bottom:6px;margin-bottom:4px}
.hblurb{font-size:13px;line-height:1.5;border:1px solid var(--line);border-radius:8px;padding:9px 11px;
  background:var(--card);color:var(--fg)}
.hfaqhead{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.hfaqhead .eyebrow{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.hfaq{border:1px solid var(--line);border-radius:8px;padding:7px 10px;background:var(--card)}
.hfaq summary{cursor:pointer;font-size:13px;font-weight:600}
.hfaq .hfaqa{font-size:13px;line-height:1.5;margin-top:6px;color:var(--fg)}
.hfaq .hfaqa p{margin:0 0 6px}
.chatlog{transition:flex .45s ease,opacity .3s ease}
.rpane-head{display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:6px 2px 6px;flex:0 0 auto}
/* pull the active section pane up under the FILG bar so the buffer above the header ≈ the buffer
   below it (the header's own 6px padding is the visible gap), instead of the doubled negative space */
.left.rsplit #rpane,.left.bsplit #bpane,.left.hsplit #hpane,.left.ssplit #spane,
.left.rfull #rpane,.left.bfull #bpane{margin-top:-8px}
.rpane-head .ghost.small{font-size:12px;padding:3px 9px}
.rlist{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:6px;padding:2px 2px 8px}
.rlist .thinking{font-size:13px}
.rrow{font-size:13px;line-height:1.45;border:1px solid var(--line);border-radius:8px;padding:7px 9px;
  background:var(--card);transition:opacity .25s ease,border-color .25s ease,background .25s ease}
/* Source type is the outline: blue = a hard/independent source (gov, official stats, Google Trends);
   green = a vendor/secondary source. A search hit (yellow, below) still wins over both. */
.rrow.hard{border-color:var(--blue);border-left-width:3px}
.rrow.vendor{border-color:var(--green);border-left-width:3px}
.rrow.hit{border-color:var(--yellow);background:color-mix(in srgb,var(--yellow) 10%,var(--card))}
.rrow.dim{opacity:.42}
.rrow a{color:var(--accent);font-size:12px;margin-left:6px;text-decoration:none}
.rrow .rtier{font-size:11px;color:var(--muted);margin-left:6px;text-transform:uppercase;letter-spacing:.04em}
.rrow.flagged .rtier{color:var(--yellow)}
.rrow.hard .rtier{color:var(--blue)}
.rrow.vendor .rtier{color:var(--green)}
/* "How many hard sources" gate — a small notice pinned atop the research stack when we found <3. */
.rwarn{position:sticky;top:0;z-index:1;font-size:12px;line-height:1.4;font-weight:600;
  color:var(--fg);background:color-mix(in srgb,var(--blue) 12%,var(--card));
  border:1px solid var(--blue);border-radius:8px;padding:7px 9px;margin-bottom:2px}
.rdrawer{flex:0 0 0%;width:0;min-width:0;overflow:hidden;opacity:0;pointer-events:none;position:relative;
  border-right:1px solid var(--line);background:var(--bg);display:flex;flex-direction:column;
  padding:14px 0 14px;transition:flex .45s ease,opacity .3s ease}
/* an OPEN expanded drawer matches the chat drawer's width — chat (1/3) + stack (1/3) ≈ 2/3 of the
   screen, the graph keeps the rest (Sam, 2026-07-06); --rd-w = the drag-resized width (only bites
   when .open, so closing still zeroes the width) */
.rdrawer.open{flex:0 0 var(--rd-w,360px);width:var(--rd-w,360px);opacity:1;pointer-events:auto;padding:14px}
@media (min-width:1100px){.rdrawer.open{flex:0 0 var(--rd-w,33.333vw);width:var(--rd-w,33.333vw)}}
.workspace.full .rpane,.workspace.full .rdrawer{display:none}   /* no research surface on the landing */

/* ── Graph chrome (2026-07-05): search-glow · fit/zoom controls · minimap · stubs · wayfinding ── */
#gctrls{position:absolute;top:12px;right:14px;display:flex;gap:6px;align-items:center;z-index:5}
#gctrls button{width:30px;height:30px;border:1px solid var(--line);border-radius:7px;
  background:var(--card);color:var(--fg);font-size:14px;line-height:1;display:inline-flex;
  align-items:center;justify-content:center}
#gctrls button:hover{border-color:var(--accent)}
/* search collapses to a magnifier; the input expands beside it on click (all screen sizes) */
#gsearchwrap{display:flex;align-items:center;gap:6px}
#gsearch{width:0;padding:0;border:0 solid var(--line);opacity:0;box-sizing:border-box;
  font:13px/1.2 inherit;background:var(--card);color:var(--fg);border-radius:7px;outline:none;
  transition:width .22s ease,opacity .18s ease,padding .22s ease}
#gctrls.searchopen #gsearch{width:180px;padding:6px 9px;border-width:1px;opacity:1}
#gctrls.searchopen #gsearch:focus{border-color:var(--accent)}
#gzoom{display:flex;gap:6px;align-items:center}
#gzoomrow{display:flex;gap:6px}
.gclabel{display:none}       /* labels (Search / Center) only surface inside the mobile dropdown */
#gctrls #gmenu{display:none} /* the ⋯ dropdown toggle is mobile-only (id-specific: beats #gctrls button) */
.gsn{font-size:11.5px;color:var(--muted);white-space:nowrap}
#gctrls:not(.searchopen) .gsn{display:none}   /* the hit count belongs to the open search box */
#minimap{position:absolute;right:14px;bottom:14px;width:156px;height:104px;z-index:5;cursor:pointer;
  background:color-mix(in srgb,var(--card) 82%,transparent);border:1px solid var(--line);
  border-radius:9px;overflow:hidden;backdrop-filter:blur(3px)}
#minimap i{position:absolute;border-radius:1.5px;background:var(--muted);opacity:.55}
#minimap i.path{background:var(--accent);opacity:.85}
#minimap i.act{background:var(--accent);opacity:1;box-shadow:0 0 0 1.5px color-mix(in srgb,var(--accent) 40%,transparent)}
#minimap i.stub{background:var(--line);opacity:.8}
#minimap i.wip{background:var(--accent);animation:gpulse 1.6s ease-in-out infinite}
#minimap .mmview{position:absolute;display:block;border:1.5px solid var(--accent);border-radius:3px;
  background:color-mix(in srgb,var(--accent) 7%,transparent);pointer-events:none}
/* a folded passed-over subtree: one quiet dashed row, click to unfold */
.gnode.stub{border-style:dashed;border-color:var(--line);background:color-mix(in srgb,var(--card) 60%,var(--bg))}
.gnode.stub .nt{color:var(--muted);font-weight:500}
.gnode.stub:hover{border-color:var(--accent)}
.gnode .tuck{margin-left:auto;background:none;border:none;color:var(--muted);font-size:12px;padding:0 2px}
.gnode .tuck:hover{color:var(--accent)}
/* keyboard cursor: where the arrows are, distinct from .on (the active step) */
.gnode.kbd{outline:2px solid var(--blue);outline-offset:2px}
/* search-glow: hits pulse, everything else steps back (PoE's tree-search pattern) */
.gnode.ghit{border-color:var(--yellow);animation:ghlow 1.4s ease-in-out infinite}
@keyframes ghlow{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--yellow) 55%,transparent)}
  50%{box-shadow:0 0 0 7px transparent}}
.gnode.gdim{opacity:.35}
.gnode.gdim:hover{opacity:1}
/* hover wayfinding: the root→hovered chain lifts */
.gnode.trail{border-color:color-mix(in srgb,var(--blue) 55%,var(--line));
  box-shadow:0 0 0 1px color-mix(in srgb,var(--blue) 30%,transparent)}
/* share modal bits */
.sharerow{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:12px 0}
.sharerow button{border:1px solid var(--line);border-radius:7px;background:var(--card);color:var(--fg);padding:6px 12px}
.sharerow button.primary{background:var(--accent);color:#fff;border:none}
#shareurl{width:100%;font:12.5px ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--bg);
  color:var(--fg);border:1px solid var(--line);border-radius:7px;padding:8px 10px;margin-top:4px}

/* ── Board room (2026-07-06): the board gets the same three displays as research ── */
.bacts{display:flex;gap:5px;align-items:center}
.bacts .ghost.small{font-size:11.5px;padding:3px 7px;white-space:nowrap}
.bseats{display:flex;gap:5px;flex-wrap:wrap;flex:0 0 auto;padding:0 2px 8px}
.bseat{font-size:11.5px;border:1px solid var(--line);border-radius:999px;padding:2px 9px;
  background:var(--card);color:var(--muted);cursor:pointer;transition:border-color .2s,color .2s}
.bseat.on{border-color:var(--accent);color:var(--fg)}
.bseat.custom.on{border-color:var(--blue)}
.brow{font-size:13px;line-height:1.45;border:1px solid var(--line);border-radius:8px;padding:8px 10px;
  background:var(--card);transition:opacity .25s ease,border-color .25s ease}
.brow.hit{border-color:var(--yellow);background:color-mix(in srgb,var(--yellow) 10%,var(--card))}
.brow.dim{opacity:.42}
.brow .bt{font-weight:600;font-size:12.5px}
.brow .bverdict{display:inline-block;font-size:10.5px;font-weight:700;text-transform:uppercase;
  letter-spacing:.04em;border:1px solid var(--line);border-radius:5px;padding:0 6px;margin-left:6px;
  color:var(--muted)}
.brow .bverdict.warn{color:var(--yellow);border-color:var(--yellow)}
.brow .bverdict.bad{color:var(--red);border-color:var(--red)}
.brow .bverdict.ok{color:var(--green);border-color:var(--green)}
.brow details{margin-top:4px}
.brow summary{cursor:pointer;font-size:12px;color:var(--muted)}
.brow .bdrow{margin-top:6px;padding-top:6px;border-top:1px solid var(--line);font-size:12.5px}
.brow .skept{color:var(--fg)}
.stressbar{font-weight:700;font-size:12.5px;margin-bottom:4px}
.sline{border-left:3px solid var(--line);padding:3px 0 3px 9px;margin:7px 0;font-size:12.5px}
.sline.broken{border-left-color:var(--red)}
.sline.weakened{border-left-color:var(--yellow)}
.sline.survives{border-left-color:var(--green)}
.sline .why{color:var(--muted)}
#forgedesc{min-height:84px}
.forgecard{border:1px solid var(--line);border-radius:9px;padding:10px 12px;margin-top:10px}
.forgecard .doms{color:var(--muted);font-size:12.5px;margin-top:4px}

/* a declared set-aside: part of the ask declined OUT LOUD — a warning card, never buried */
.saside{font-size:13px;line-height:1.5;border:1px solid var(--yellow);border-radius:8px;
  padding:8px 11px;margin:8px 0;background:color-mix(in srgb,var(--yellow) 9%,var(--card))}
.saside .why{color:var(--muted)}

/* the split boundary is DRAGGABLE (Sam, 2026-07-06): a grip at the bottom of each in-drawer pane */
.vgrip{flex:0 0 12px;cursor:row-resize;display:flex;align-items:center;justify-content:center;
  touch-action:none;user-select:none}
.vgrip::after{content:"";width:38px;height:4px;border-radius:2px;background:var(--line);
  transition:background .2s}
.vgrip:hover::after,.vgrip.dragging::after{background:var(--accent)}
.left.rfull .vgrip,.left.bfull .vgrip{display:none}   /* resize belongs to the SPLIT boundary only */
.rpane.resizing{transition:none}   /* a live drag needs 1:1 tracking, not the .45s ease */
/* the drawer WIDTH is draggable too (Sam, 2026-07-07): a thin grip on the right edge of the chat
   drawer AND the expanded research/board drawer. Desktop only (mobile drawers are full-height sheets). */
.hgrip{display:none;position:absolute;top:0;right:0;width:7px;height:100%;cursor:col-resize;z-index:11;
  touch-action:none;user-select:none}
.hgrip::after{content:"";position:absolute;top:0;right:0;width:2px;height:100%;background:transparent;transition:background .15s}
.hgrip:hover::after,.hgrip.dragging::after{background:var(--accent)}
.left.resizing,.rdrawer.resizing{transition:none}   /* 1:1 tracking during a width drag */

/* ── The gating wave: summary display · auth/pricing modals · tier chip · the account surface ── */
/* Summary is the 4th display state of the chat drawer (the hsplit mechanism, green-tinted). */
.mchip[data-mode=summary].on{border-color:var(--green);color:var(--green)}
.promptwrap.summary textarea{background:color-mix(in srgb,var(--green) 8%,var(--card));border-color:var(--green)}
.left.ssplit #spane{display:flex;opacity:1;pointer-events:auto;flex:0 1 auto;max-height:46%;
  border-bottom:1px dashed var(--line);padding-bottom:6px;margin-bottom:4px}
.sumcard{border:1px solid var(--line);border-radius:10px;background:var(--card);padding:12px 14px;margin-bottom:8px}
.sumcard .verdict{margin-right:6px}   /* reuses the standard verdict chip styling */
.sumcard .sumreact{font-size:15px;margin:8px 0 6px;font-weight:600}
.sumcard p{margin:6px 0}
.sumcard .mold{display:inline-block;font-size:11px;border:1px solid var(--line);border-radius:999px;padding:1px 8px;color:var(--muted)}

/* tier chip: plan label + allowance % in the header */
.tierchip{border-color:var(--green);color:var(--green)}
.tierchip.hot{border-color:var(--red);color:var(--red)}

/* auth + pricing modal furniture (ported from v1's modal, restyled plain) */
.modal.wide{width:min(700px,94vw)}
.authgate{margin:6px 0 2px;display:flex;gap:8px}   /* the sign-in choices share one row, resized to fit */
.authgate .gbtn{display:flex;align-items:center;justify-content:center;gap:8px;flex:1 1 0;min-width:0;
  background:var(--card);color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:10px 8px;font-weight:700}
.authgate .gbtn:hover{border-color:var(--fg)}
.tiergrid{display:flex;gap:10px;margin-top:8px;flex-wrap:wrap}
.tiercard{border:1px solid var(--line);border-radius:10px;padding:14px;flex:1;min-width:180px;background:var(--card)}
.tiercard.cur{border-color:var(--green)}
.tiercard .tprice{font-size:1.5em;font-weight:700;margin:4px 0}
.tiercard .tprice span{font-size:.55em;color:var(--muted)}
.tiercard ul{margin:0 0 10px;padding-left:18px;font-size:.85em}
.tiercard button{border:1px solid var(--line);background:var(--accent);color:#fff;border-radius:8px;padding:7px 14px;border:none}
.tiercard button[disabled]{background:var(--card);color:var(--muted);border:1px solid var(--line);cursor:default}
.byokbox{margin-top:12px;border:1px dashed var(--muted);border-radius:10px;padding:12px 14px}
.byokbox .byokfree{color:var(--green);font-weight:700}
.byokbox button{border:1px solid var(--line);background:var(--card);color:var(--fg);border-radius:8px;padding:7px 14px;margin-top:6px}
.submeter{margin:6px 0 12px;font-size:.85em}
.submeter .bar{height:6px;background:var(--line);border-radius:3px;margin-top:4px;overflow:hidden}
.submeter .bar i{display:block;height:100%;background:var(--green)}
.submeter .bar i.hot{background:var(--red)}

/* the account surface: a full overlay over the workspace */
.account{position:fixed;inset:0;z-index:20;background:var(--bg);overflow-y:auto;padding:28px 20px 60px}
.acctwrap{max-width:860px;margin:0 auto}
.accttop{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.accttop h2{margin:0}
.accttop .link{background:none;border:none;color:var(--accent);font-size:14px}
.accttabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:16px;flex-wrap:wrap}
.accttabs button{background:none;border:none;border-bottom:2px solid transparent;padding:8px 12px;color:var(--muted);font-weight:600}
.accttabs button.on{color:var(--fg);border-bottom-color:var(--accent)}
.pcard{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid var(--line);
  border-radius:10px;background:var(--card);padding:12px 14px;margin-bottom:8px;flex-wrap:wrap}
.pcard .pinfo{min-width:0;flex:1}
.pcard .idea{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pcard .meta{font-size:12.5px;color:var(--muted)}
.pcard .act{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.pcard .act button{border:1px solid var(--line);background:var(--card);color:var(--fg);border-radius:8px;padding:6px 10px;font-size:13px}
.pcard .act button.primary{background:var(--accent);color:#fff;border:none}
.pcard .pill{font-size:11px;font-weight:700;border:1px solid var(--line);border-radius:999px;padding:2px 8px;color:var(--muted)}
.pcard .pill.done{border-color:var(--green);color:var(--green)}
.acct-block{border:1px solid var(--line);border-radius:10px;background:var(--card);padding:14px;margin-bottom:12px}
.acct-lbl{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);margin-bottom:6px}
.acct-block .prow{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.acct-block .prow button{border:1px solid var(--line);background:var(--card);color:var(--fg);border-radius:8px;padding:7px 12px}
.acct-block .prow button.danger{border-color:var(--red);color:var(--red)}
.acct-block .pnote{color:var(--muted);font-size:13.5px;margin:2px 0}
.acctempty{color:var(--muted);padding:18px 4px}

/* the disclaimer fine-print link (landing + help banner) */
.fineprint{background:none;border:none;color:var(--muted);font-size:12.5px;padding:6px 0;text-align:left}
.fineprint:hover{color:var(--fg);text-decoration:underline}
.workspace:not(.full) #hero .fineprint{display:none}   /* landing-only there; help carries it after */

/* the landing free-taste note: the no-pay hook's one-line promise */
.freenote{color:var(--muted);font-size:13px;margin:-14px 0 18px}
.workspace:not(.full) #hero .freenote{display:none}

/* the front-door idea hook: trending rows + roll + the labeled idea card (landing only) */
.workspace:not(.full) #hero #ideastrip{display:none}
#ideastrip{margin:14px 0 6px;border-top:1px solid var(--line);padding-top:14px}
.zonehead{font-weight:700;font-size:14px;margin:0 0 8px}
#ownzone{border-top:1px solid var(--line);padding-top:14px;margin-top:16px}
.workspace:not(.full) #hero #ownzone,.workspace:not(.full) #hero #landing-sub{display:none}
.idearow{display:flex;justify-content:space-between;gap:10px;width:100%;text-align:left;
  background:none;border:none;border-bottom:1px dotted var(--line);padding:7px 2px;
  color:var(--fg);font-size:13.5px;cursor:pointer}
.idearow:hover .irt{text-decoration:underline}
.idearow .epi{color:var(--muted);font-size:12px;white-space:nowrap}
.rollbtn{margin:10px 0 0;font-size:13.5px}
.icard{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-top:12px}
.icard h3{margin:0 0 6px;font-size:15px}
.icard p{margin:0 0 8px;font-size:13.5px}
.imeta{color:var(--muted);font-size:12px;margin-bottom:8px}
.ieco{font-size:13px;margin:6px 0}
.ilabel{display:inline-block;border:1px solid var(--line);border-radius:4px;padding:0 5px;
  font-size:11px;color:var(--muted);margin-right:6px;vertical-align:1px}
.ilabel[data-l="flagged not credible"]{color:var(--red,#c0392b);border-color:var(--red,#c0392b)}
.ilabel[data-l="named operator, verified on screen"]{color:var(--green,#1e7e34);border-color:var(--green,#1e7e34)}
.inote{color:var(--muted);font-size:12px;margin:2px 0 0 2px}
.iacts{display:flex;gap:8px;margin-top:10px}
.ideasrc{color:var(--muted);font-size:12px;margin:10px 0 0}

/* a11y baseline (kept from the v1 contract): visible keyboard focus + reduced-motion honor */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* ── Desktop (≥821px): the chat drawer collapses on ANY screen now, not just mobile, and both the
   chat drawer and the expanded research/board drawer are width-draggable. ── */
@media (min-width:821px){
  /* the right-edge width grips ride only on desktop; the expanded drawer shows its grip when open */
  .left>.hgrip{display:block}
  .rdrawer.open>.hgrip{display:block}
  /* the ‹ tab folds the chat drawer off the left edge; a › rail brings it back; the graph takes the
     freed width. The collapse is a CHAT-drawer control — the expanded panes fold via ⇤ Tuck in. */
  .left>.mrail-in{display:flex;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:13;
    width:16px;height:46px;border-radius:7px 0 0 7px;background:color-mix(in srgb,var(--line) 85%,var(--bg));
    color:var(--muted);box-shadow:-2px 0 6px rgba(0,0,0,.10)}
  .left>.mrail-in:hover{color:var(--fg);background:var(--line)}
  .rdrawer .mrail-in{display:none}
  .workspace.mclosed:not(.full) .left{width:0;min-width:0;padding-left:0;padding-right:0;
    border-right:none;opacity:0;pointer-events:none;overflow:hidden}
  .workspace.mclosed:not(.full) #mrail{display:flex;position:fixed;left:0;top:50%;transform:translateY(-50%);
    z-index:23;width:18px;height:46px;border-radius:0 7px 7px 0;background:var(--line);color:var(--fg)}
  .workspace.mclosed:not(.full) #mrail:hover{background:var(--accent);color:#fff}
  .workspace.full .mrail-in,.workspace.full #mrail{display:none}
}

/* ── Mobile overrides live LAST so they win over base rules by source order ── */
@media (max-width:820px){
  .workspace{height:100vh;height:100dvh}
  .right{min-width:0}
  .left{position:fixed;top:0;bottom:0;left:0;width:min(92vw,430px);min-width:0;z-index:24;
    max-height:none;border-right:1px solid var(--line);background:var(--bg);
    box-shadow:10px 0 30px rgba(0,0,0,.35);
    padding-bottom:calc(14px + env(safe-area-inset-bottom,0px));
    transition:transform .3s ease}
  .workspace.mclosed .left{transform:translateX(-103%)}
  .workspace.rx .left{visibility:hidden}          /* an expanded section replaces the chat drawer */
  .rdrawer{position:fixed;top:0;bottom:0;left:0;width:min(92vw,430px);min-width:0;z-index:25;
    transition:transform .3s ease,opacity .2s ease}
  .rdrawer.open{flex:none;width:min(92vw,430px);max-height:none;padding:14px;
    padding-bottom:calc(14px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;
    border-right:1px solid var(--line);background:var(--bg);box-shadow:10px 0 30px rgba(0,0,0,.35)}
  .workspace.mclosed .rdrawer.open{transform:translateX(-103%)}
  .mrail-in{display:flex;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:12;
    border-radius:8px 0 0 8px}
  .workspace.mclosed #mrail{display:flex;position:fixed;left:0;top:50%;transform:translateY(-50%);
    z-index:23;border-radius:0 8px 8px 0}
  .workspace.full #mrail{display:none}
  /* the landing keeps the whole screen (there's no graph yet) and scrolls itself */
  .workspace.full .left{position:fixed;inset:0;width:auto;max-height:none;transform:none;
    overflow-y:auto;border-right:none;box-shadow:none}
  .workspace.full .mrail-in{display:none}
  .toasts{z-index:40}
  #minimap{display:none}   /* the screen IS touch-panned — a jump pip is dead weight on a phone */
  /* stage CTAs share the row at phone size instead of stacking full-width */
  .ctarow{gap:8px}
  .ctarow .stage-cta{flex:1 1 40%;min-width:0;padding:8px 10px;font-size:13.5px}
  .stage-cta .ctasub{font-size:10.5px}
  /* an open node's ×: a plain close anchored in the top-right corner (no tab chrome), sticky so
     it stays pinned while the doc scrolls — one tap back to the compact node + restored camera */
  .nfold{display:block;position:sticky;top:-14px;margin:-10px -14px -26px auto;z-index:3;
    width:36px;height:32px;border:0;padding:0;cursor:pointer;background:none;color:var(--muted);
    font-size:21px;line-height:1;text-align:center}
  .nfold:hover,.nfold:active{color:var(--fg)}

  /* ── Header: the model crew, session meter, and account collapse behind a hamburger ── */
  #lefttop{position:relative}
  .hmenu{display:inline-flex;align-items:center;justify-content:center;margin-left:auto}
  .lt-right{display:none;position:absolute;top:calc(100% + 6px);right:0;z-index:32;margin-left:0;
    flex-direction:column;align-items:stretch;gap:2px;background:var(--bg);border:1px solid var(--line);
    border-radius:10px;padding:6px;min-width:190px;box-shadow:0 12px 30px rgba(0,0,0,.4)}
  #lefttop.menu-open .lt-right{display:flex}
  /* delist: drop the pill boxes so the crew / tokens / account read as one neat ordered list */
  .lt-right .stackchip,.lt-right .meter,.lt-right .profile{border:0;border-radius:6px;background:none;
    width:auto;height:auto;justify-content:flex-start;padding:9px 10px;font-size:14px;color:var(--fg)}
  .lt-right .stackchip:hover,.lt-right .profile:hover{background:var(--card)}
  .profile .acctlabel{display:inline}
  .profile svg{display:none}

  /* ── Graph controls collapse into one ⋯ dropdown (they used to overlap the view tabs) ── */
  #gctrls #gmenu{display:inline-flex}
  #gctrls #gsearchwrap,#gctrls #gzoom{display:none}
  #gctrls.gmenu-open{flex-direction:column;align-items:stretch;gap:6px;background:var(--bg);
    border:1px solid var(--line);border-radius:10px;padding:8px;min-width:154px;
    box-shadow:0 12px 30px rgba(0,0,0,.4)}
  #gctrls.gmenu-open #gmenu{order:-1;align-self:flex-end;width:30px}
  #gctrls.gmenu-open #gsearchwrap{display:flex;flex-direction:column;align-items:stretch;gap:6px}
  #gctrls.gmenu-open #gzoom{display:flex;gap:6px}
  #gctrls.gmenu-open #gsearchbtn,#gctrls.gmenu-open #gfit{width:100%;height:auto;padding:10px 12px;
    justify-content:flex-start;gap:9px;font-size:14px}
  #gctrls.gmenu-open .gclabel{display:inline}
  #gctrls.gmenu-open #gfit .gcicon{display:none}
  #gctrls.gmenu-open #gzoomrow{display:flex;gap:6px}
  #gctrls.gmenu-open #gzoomrow button{flex:1 1 0;width:auto;height:40px;font-size:18px}
  #gctrls.gmenu-open.searchopen #gsearch{width:100%;padding:9px 11px;border-width:1px;opacity:1}
}

/* ── Standing decisions — the Summary tab's color-coded axiom index (app.js decListHtml) ── */
.dechead{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:2px 0 6px}
.dechead .eyebrow{margin:0}
.declist{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.decrow{border:1px solid var(--line);border-left:3px solid var(--muted);border-radius:9px;
  background:var(--card)}
.decrow summary{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;
  padding:7px 10px;font-size:13px}
.decrow summary::-webkit-details-marker{display:none}
.decrow .dectext{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.decrow[open] .dectext{white-space:normal;overflow:visible}
.decw{font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);
  white-space:nowrap;flex:none}
.decdot{width:9px;height:9px;border-radius:50%;background:var(--muted);flex:none;display:inline-block}
/* the color code: non-negotiable = red, firm = amber, nice-to-have = green */
.decrow.non_negotiable,.decref.non_negotiable{border-left-color:var(--red)}
.decrow.firm,.decref.firm{border-left-color:var(--yellow)}
.decrow.nice_to_have,.decref.nice_to_have{border-left-color:var(--green)}
.non_negotiable .decdot{background:var(--red)}
.firm .decdot{background:var(--yellow)}
.nice_to_have .decdot{background:var(--green)}
.decbody{padding:0 10px 9px;font-size:12.5px}
.decwhy{margin:0 0 7px;color:var(--muted)}
.decacts{display:flex;gap:6px}
.decinput{width:100%;margin:9px 0 0;padding:8px 10px;border:1px solid var(--line);border-radius:8px;
  background:var(--bg);color:var(--fg);font:inherit;font-size:13px;box-sizing:border-box}
.decwpick{display:flex;gap:6px;margin-top:10px;flex-wrap:wrap}
.decwchip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);
  border-radius:999px;padding:5px 11px;font-size:12.5px;background:var(--card);color:var(--fg);
  cursor:pointer}
.decwchip.on{border-color:currentColor;box-shadow:0 0 0 1px currentColor inset}
.decwchip.non_negotiable{color:var(--red)}
.decwchip.firm{color:var(--yellow)}
.decwchip.nice_to_have{color:var(--green)}
/* the restated decision is a plain QUOTE — no color, no weight; the operator picks below */
.decoffer{border-left:3px solid var(--line);padding:4px 10px;margin-top:8px;font-size:13.5px;
  font-style:italic;color:var(--fg)}
.cmsg .cbtns .decwchip{border-radius:999px}
.decimps{max-height:260px;overflow-y:auto;margin-top:4px}
/* one revisit row: checkbox hard-left, "Refined idea 3a" beside it, expandable to the snippet */
.decimp{display:flex;align-items:flex-start;gap:10px;padding:8px 10px;border:1px solid var(--line);
  border-radius:8px;margin-top:6px;font-size:13px}
.decimp input{flex:none;width:auto;margin:3px 0 0}   /* .modal input{width:100%} must not eat the row */
.decimp details{flex:1;min-width:0}
.decimp summary{cursor:pointer;font-weight:600}
.decimpsub{color:var(--muted);font-size:12.5px;margin-top:4px}
.decref{display:flex;align-items:center;gap:7px;border-left:3px solid var(--muted);padding:4px 8px}
.decref.gone{opacity:.6}

/* ── The in-chat pin offer: weight options stack as list rows, one per line ── */
.decopts{display:flex;flex-direction:column;gap:6px;margin-top:9px}
.decopts .decopt{display:flex;align-items:center;gap:9px;width:100%;text-align:left;
  padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:var(--card);
  color:var(--fg);font-size:13px;cursor:pointer}
.decopts .decopt b{font-weight:600;white-space:nowrap}
.decopts .decopt:hover{border-color:var(--accent)}
.cmsg.asked .decopts{display:none}

/* the box number — how modals/logs refer to a node; rides the node's kind row */
.gnode .gnum{margin-left:auto;font-size:9.5px;color:var(--muted);border:1px solid var(--line);
  border-radius:5px;padding:0 4px;line-height:1.5}
