/* "Biroul": the product's register. A calm, paper-like workspace; the conversation is the primary surface, the
   context follows it. Tone shifts instead of borders, one accent, light display type, big numbers. */
:root{--paper:#f7f6f2;--sheet:#ffffff;--sheet-2:#f1efe9;--ink:#1c1b18;--ink-2:#55524b;--ink-3:#8a867c;--hair:#e6e2d8;--accent:#2f5bea;--accent-soft:#e8edfd;--ok:#1e8a4c;--ok-soft:#e3f3ea;--warn:#b86b00;--warn-soft:#fdf0dc;--bad:#c8372d;--bad-soft:#fbe6e3;--agent:#6a4fd1;--agent-soft:#efeafc;--r:14px;--r-s:10px;--sans:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;--mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace}
.night{--paper:#121212;--sheet:#1a1a1c;--sheet-2:#222225;--ink:#f0efea;--ink-2:#b8b5ac;--ink-3:#7d7a72;--hair:#2a2a2e;--accent:#8fb0ff;--accent-soft:#1b2a4d;--ok:#5dd089;--ok-soft:#14301f;--warn:#e8a05a;--warn-soft:#3a2a14;--bad:#f08a80;--bad-soft:#3a1a17;--agent:#b7a6f6;--agent-soft:#2a2340}
/* the evening variant follows the system unless the person chose one in the menu (data-theme on <html>) */
:root{color-scheme:light dark}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--paper:#121212;--sheet:#1a1a1c;--sheet-2:#222225;--ink:#f0efea;--ink-2:#b8b5ac;--ink-3:#7d7a72;--hair:#2a2a2e;--accent:#8fb0ff;--accent-soft:#1b2a4d;--ok:#5dd089;--ok-soft:#14301f;--warn:#e8a05a;--warn-soft:#3a2a14;--bad:#f08a80;--bad-soft:#3a1a17;--agent:#b7a6f6;--agent-soft:#2a2340}}
:root[data-theme="dark"]{--paper:#121212;--sheet:#1a1a1c;--sheet-2:#222225;--ink:#f0efea;--ink-2:#b8b5ac;--ink-3:#7d7a72;--hair:#2a2a2e;--accent:#8fb0ff;--accent-soft:#1b2a4d;--ok:#5dd089;--ok-soft:#14301f;--warn:#e8a05a;--warn-soft:#3a2a14;--bad:#f08a80;--bad-soft:#3a1a17;--agent:#b7a6f6;--agent-soft:#2a2340}
*{box-sizing:border-box}
.b{min-height:100%;background:var(--paper);color:var(--ink);font:15px/23px var(--sans);display:grid;grid-template-columns:72px minmax(0,1fr) 420px;letter-spacing:-.005em}
.rail{padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:8px;border-right:1px solid var(--hair)}
.rail .co{width:44px;height:44px;border-radius:14px;background:var(--ink);color:var(--paper);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:13px;margin-bottom:10px}
.rail a{width:48px;height:48px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--ink-3);font-size:10px;letter-spacing:.02em;position:relative}
.rail a.on{background:var(--sheet);color:var(--ink);box-shadow:0 1px 0 var(--hair)}.rail a svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.9}.rail a.on svg{opacity:1}.rail a .n{position:absolute;top:6px;right:6px;min-width:16px;height:16px;border-radius:8px;background:var(--warn);color:var(--paper);font-size:10px;line-height:16px;text-align:center;padding:0 4px;font-weight:600}
.rail .me{margin-top:auto;width:40px;height:40px;border-radius:20px;background:var(--agent-soft);color:var(--agent);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:12px}
.conv{display:flex;flex-direction:column;min-height:100vh}
.conv .top{display:flex;align-items:center;justify-content:space-between;padding:22px 40px 10px}.conv .top h1{margin:0;font-size:22px;line-height:28px;font-weight:500;letter-spacing:-.01em}.conv .top .d{color:var(--ink-3);font-size:14px}
.thread{flex:1;padding:12px 40px 24px;display:flex;flex-direction:column;gap:22px;max-width:860px;width:100%;margin:0 auto}
.m{display:flex;flex-direction:column;gap:8px}.m .who{font-size:12px;color:var(--ink-3);display:flex;gap:8px;align-items:center}.m .who b{color:var(--ink-2);font-weight:500}
.m.me{align-items:flex-end}.m.me .txt{background:var(--sheet-2);border-radius:18px 18px 4px 18px;padding:10px 16px;max-width:70%}
.m.ai .txt{font-size:16px;line-height:26px;max-width:720px}.m.ai .txt b{font-weight:600}
.blk{background:var(--sheet);border-radius:var(--r);padding:16px 18px;display:flex;flex-direction:column;gap:12px;max-width:720px;box-shadow:0 1px 0 var(--hair)}
.blk .h{display:flex;justify-content:space-between;align-items:center;gap:12px}.blk .h b{font-weight:600;font-size:14px}.blk .h span{font-size:12px;color:var(--ink-3)}
.nums{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.nums div{display:flex;flex-direction:column;gap:2px}.nums b{font-size:28px;line-height:32px;font-weight:300;letter-spacing:-.02em}.nums b small{font-size:13px;color:var(--ink-3);margin-left:4px;font-weight:400}.nums span{font-size:12px;color:var(--ink-3)}
.bars{display:flex;align-items:flex-end;gap:3px;height:48px}.bars i{flex:1;background:var(--accent);opacity:.35;border-radius:2px}.bars i.hi{opacity:1}
.diff{font-family:var(--mono);font-size:12.5px;line-height:20px;background:var(--sheet-2);border-radius:var(--r-s);padding:10px 12px;white-space:pre-wrap}.diff s{color:var(--bad);text-decoration:line-through}.diff b{color:var(--ok);font-weight:500}
.acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.bt{display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;border-radius:10px;border:1px solid var(--hair);background:var(--sheet);color:var(--ink);font:500 14px/20px var(--sans);cursor:pointer}.bt.p{background:var(--ink);border-color:var(--ink);color:var(--paper)}.bt.a{background:var(--accent);border-color:var(--accent);color:var(--paper)}.bt.s{height:28px;padding:0 10px;font-size:13px;border-radius:8px}
.tag{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 9px;border-radius:11px;font-size:12px;font-weight:500;background:var(--sheet-2);color:var(--ink-2);white-space:nowrap}.tag.ok{background:var(--ok-soft);color:var(--ok)}.tag.warn{background:var(--warn-soft);color:var(--warn)}.tag.bad{background:var(--bad-soft);color:var(--bad)}.tag.ag{background:var(--agent-soft);color:var(--agent)}.tag.ac{background:var(--accent-soft);color:var(--accent)}
.fine{font-size:12.5px;color:var(--ink-3)}
.composer{position:sticky;bottom:0;padding:12px 40px 22px;background:linear-gradient(to bottom,transparent,var(--paper) 30%)}.composer .box{max-width:860px;margin:0 auto;background:var(--sheet);border-radius:18px;box-shadow:0 1px 0 var(--hair),0 8px 30px rgba(0,0,0,.06);padding:14px 16px;display:flex;flex-direction:column;gap:10px}.composer .in{color:var(--ink-3);font-size:15px;min-height:24px}.composer .row{display:flex;justify-content:space-between;align-items:center;gap:8px}.composer .chips{display:flex;gap:6px;flex-wrap:wrap}
.ctx{border-left:1px solid var(--hair);padding:22px 22px 32px;display:flex;flex-direction:column;gap:18px;background:var(--paper)}
.ctx .hd{display:flex;justify-content:space-between;align-items:center}.ctx .hd span{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}
.post{background:var(--sheet);border-radius:var(--r);padding:18px;display:flex;flex-direction:column;gap:12px;box-shadow:0 1px 0 var(--hair)}
.post .id{display:flex;gap:12px;align-items:center}.post .mono,.feed .mono{width:44px;height:44px;border-radius:14px;background:var(--agent-soft);color:var(--agent);display:flex;align-items:center;justify-content:center;font-weight:600;position:relative;font-family:var(--sans)}.post .mono,.feed .mono::after{content:"";position:absolute;right:-2px;bottom:-2px;width:12px;height:12px;border-radius:6px;background:var(--ok);border:2px solid var(--sheet)}.post .mono,.feed .mono.w::after{background:var(--warn)}.post .mono,.feed .mono.off::after{background:var(--ink-3)}
.post h3{margin:0;font-size:16px;font-weight:600}.post .role{font-size:12.5px;color:var(--ink-3)}
.post .out{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.post .out b{display:block;font-size:22px;line-height:26px;font-weight:300}.post .out span{font-size:11.5px;color:var(--ink-3)}
.feed{display:flex;flex-direction:column}.feed .day{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);padding:14px 0 6px;font-weight:500}
.feed .e{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;padding:10px 0;border-top:1px solid var(--hair);align-items:start}.feed .e .t{font-family:var(--mono);font-size:12px;color:var(--ink-3);padding-top:2px}.feed .e .w{font-size:14px;line-height:21px}.feed .e .meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.story{background:var(--sheet);border-radius:var(--r);box-shadow:0 1px 0 var(--hair);padding:22px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.story h4{margin:0 0 10px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);font-weight:500}.story p{margin:0 0 8px;font-size:14px;line-height:21px}.story .q{border-left:2px solid var(--hair);padding:6px 12px;color:var(--ink-2);font-size:13.5px;margin:6px 0}
.steps{display:flex;flex-direction:column;gap:0}.steps .s{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;padding:7px 0;font-size:13.5px;line-height:20px}.steps .s i{width:10px;height:10px;border-radius:5px;margin-top:5px;justify-self:center;background:var(--hair)}.steps .s i.th{background:var(--agent)}.steps .s i.tool{background:var(--accent)}.steps .s i.ans{background:var(--ok)}.steps .s .k{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);margin-right:6px}.steps .s code{font-family:var(--mono);font-size:12px;background:var(--sheet-2);padding:1px 6px;border-radius:6px}
.pageh{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;padding:26px 40px 6px}.pageh h1{margin:0;font-size:30px;line-height:36px;font-weight:300;letter-spacing:-.02em}.pageh .d{color:var(--ink-3)}
.wrap{padding:16px 40px 40px;display:flex;flex-direction:column;gap:20px}
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.filters .q{flex:1;min-width:260px;background:var(--sheet);border-radius:12px;padding:10px 14px;color:var(--ink-3);box-shadow:0 1px 0 var(--hair)}
.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:20px;align-items:start}

/* ---- the live panel: pieces the boards did not need */
html,body{margin:0;min-height:100%;background:var(--paper)}
.b{min-height:100vh}
.rail a{cursor:pointer;text-decoration:none}.rail a:hover{color:var(--ink)}
.conv .top{position:sticky;top:0;background:var(--paper);z-index:2}
.thread{padding-bottom:140px}
.m .txt p{margin:0 0 8px}.m .txt p:last-child{margin:0}
.composer textarea{width:100%;border:0;background:transparent;font:15px/23px var(--sans);color:var(--ink);resize:none;outline:none;min-height:24px;max-height:160px}
.composer .box:focus-within{box-shadow:0 1px 0 var(--hair),0 8px 30px rgba(0,0,0,.09),0 0 0 2px var(--accent-soft)}
.tag.btn,.chip{cursor:pointer}.tag.btn:hover{background:var(--hair)}
.bt:hover{filter:brightness(.97)}.bt:disabled{opacity:.5;cursor:default}
.hidden{display:none!important}
.ctx{min-width:0}.ctx .feed .e{cursor:pointer}.ctx .feed .e:hover .w{color:var(--accent)}
.post{cursor:default}.tiles .post{cursor:pointer}.tiles .post:hover{box-shadow:0 1px 0 var(--hair),0 6px 20px rgba(0,0,0,.06)}
.feed .e.on{background:var(--sheet-2);margin:0 -18px;padding:10px 18px;border-radius:10px;border-top-color:transparent}
.steps .s .io{display:none;margin-top:6px;background:var(--sheet-2);border-radius:8px;padding:8px 10px;font-family:var(--mono);font-size:11.5px;line-height:17px;white-space:pre-wrap;max-height:260px;overflow:auto}.steps .s.open .io{display:block}.steps .s .k{cursor:pointer}
table.t{width:100%;border-collapse:collapse;font-size:13.5px;line-height:20px}table.t th{text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);font-weight:500;padding:8px 10px;border-bottom:1px solid var(--hair)}table.t td{padding:9px 10px;border-bottom:1px solid var(--hair);vertical-align:top}table.t tr:last-child td{border-bottom:0}table.t tr.pick{cursor:pointer}table.t tr.pick:hover td{background:var(--sheet-2)}
.scroll{overflow-x:auto}
input.f,select.f,textarea.f{width:100%;height:36px;border:1px solid var(--hair);border-radius:10px;padding:0 12px;font:14px/20px var(--sans);background:var(--sheet);color:var(--ink)}textarea.f{height:auto;min-height:72px;padding:8px 12px}input.f:focus,select.f:focus,textarea.f:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}
label.f{display:block;font-size:12px;color:var(--ink-3);margin:0 0 4px}
.cel{display:inline-flex;height:26px;min-width:84px;align-items:center;justify-content:center;border-radius:13px;font-size:12px;font-weight:500;cursor:pointer;border:0}.cel.yes{background:var(--ok-soft);color:var(--ok)}.cel.approval{background:var(--warn-soft);color:var(--warn)}.cel.no{background:var(--sheet-2);color:var(--ink-3)}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:12px;font-size:14px;display:none;z-index:50;max-width:80vw}
.pre{white-space:pre-wrap;font-family:var(--mono);font-size:12.5px;line-height:19px;background:var(--sheet-2);border-radius:10px;padding:10px 12px;max-height:320px;overflow:auto}
.who-box{font:14px/22px var(--sans);color:var(--ink);display:flex;flex-direction:column;gap:8px;position:absolute;left:84px;bottom:24px;background:var(--sheet);border-radius:14px;padding:14px;box-shadow:0 1px 0 var(--hair),0 12px 36px rgba(0,0,0,.12);width:300px;z-index:20;font-size:13px}
.subnav{display:flex;gap:6px;flex-wrap:wrap}
.card{background:var(--sheet);border-radius:var(--r);padding:16px 18px;box-shadow:0 1px 0 var(--hair);min-width:0}.card h3{margin:0 0 10px;font-size:15px;font-weight:600}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.num{font-variant-numeric:tabular-nums}
.sheet{position:fixed;left:0;right:0;bottom:0;max-height:75vh;overflow:auto;background:var(--paper);border-radius:22px 22px 0 0;box-shadow:0 -10px 40px rgba(0,0,0,.18);padding:16px;z-index:30;display:none}
@media (max-width:1100px){.b{grid-template-columns:72px minmax(0,1fr)}.ctx{display:none}.sheet.show{display:block}}
@media (max-width:720px){.b{grid-template-columns:1fr}.rail{flex-direction:row;border-right:0;border-bottom:1px solid var(--hair);padding:8px;gap:4px;position:sticky;top:0;background:var(--paper);z-index:5;overflow-x:auto}.rail .co{margin:0 6px 0 0;width:36px;height:36px}.rail a{width:auto;height:40px;padding:0 10px;flex-direction:row;gap:6px;font-size:12px}.rail a i{display:none}.rail .me{margin-left:auto;width:34px;height:34px}.conv .top{padding:14px 16px 4px}.thread{padding:8px 16px 140px}.composer{padding:8px 12px 12px}.pageh{padding:18px 16px 4px}.wrap{padding:10px 16px 30px}.tiles,.two{grid-template-columns:1fr}.story{grid-template-columns:1fr}.nums{grid-template-columns:repeat(2,minmax(0,1fr))}.who-box{left:12px;right:12px;width:auto}}
/* the ledger story breathes: more room, chapters wrap into one column when narrow */
#story .story .story{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
#story h4 span{display:block;margin-top:2px}
.composer .bt{flex:none}
@media (min-width:721px) and (max-width:1500px){.wrap .two[style*="minmax(0,.9fr)"]{grid-template-columns:minmax(0,.75fr) minmax(0,1.6fr)!important}}
@media (max-width:720px){.conv,.thread,.composer,.wrap,.pageh{min-width:0;max-width:100vw}.conv .top{flex-direction:column;align-items:flex-start;gap:2px}.conv .top h1{font-size:19px;line-height:26px}.m.me .txt{max-width:88%}.blk{max-width:100%;padding:12px 14px}.composer .row{flex-wrap:wrap}.composer .chips{width:100%;order:2}.composer .fine{display:none}.composer .box{padding:10px 12px}.story{padding:14px}.pageh{flex-direction:column;align-items:flex-start}.filters .q{min-width:0;width:100%}.ctx{display:none}.rail .n{top:2px;right:2px}}
@media (max-width:720px){.two,.tiles,.story,#story .story .story{grid-template-columns:1fr!important}.nums{grid-template-columns:repeat(2,minmax(0,1fr))!important}table.t{display:block;overflow-x:auto;white-space:nowrap}.post{min-width:0}.acts{flex-wrap:wrap}}
.steps .s,.story .q,.story p,.steps .s code,.pre,.diff,.feed .e .w{overflow-wrap:anywhere;word-break:break-word;min-width:0}
#story,.story{min-width:0}

/* the gate: before sign-in, one centred card and nothing else */
.b.gate{grid-template-columns:1fr}.b.gate .rail,.b.gate .ctx{display:none}
.gatewrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:40px 16px}
.gatebox{width:100%;max-width:400px;display:flex;flex-direction:column;gap:18px}
.gatebox .brand{display:flex;align-items:center;gap:10px;justify-content:center;font-weight:600;font-size:16px}.gatebox .brand b{width:36px;height:36px;border-radius:10px;background:var(--ink);color:var(--paper);display:inline-flex;align-items:center;justify-content:center;font-size:13px}
.gatecard{padding:26px 26px 22px;display:flex;flex-direction:column;gap:12px;box-shadow:0 1px 0 var(--hair),0 10px 30px rgba(0,0,0,.05)}.gatecard h3{font-size:20px;font-weight:500;letter-spacing:-.01em;margin:0}.gatecard .fine{margin:-6px 0 4px}
.gatebtn{height:42px;justify-content:center;width:100%;font-size:15px;margin-top:6px}
.gatetok{margin-top:6px;font-size:13.5px}.gatetok summary{cursor:pointer;color:var(--accent);list-style:none}.gatetok summary::-webkit-details-marker{display:none}.gatetok[open] summary{margin-bottom:8px}
.gatefoot{text-align:center}.gatefoot a{color:var(--ink-3)}

/* desktop: the page is the screen; each column scrolls on its own, the conversation inside its thread with the composer
   pinned below it, so new messages never grow the page */
@media (min-width:721px){
  .b{height:100vh;min-height:0;overflow:hidden}
  .rail{overflow:hidden}
  .conv{height:100vh;min-height:0;overflow-y:auto}
  .conv:has(> .thread){overflow:hidden}
  .conv:has(> .thread) .thread{flex:1;min-height:0;overflow-y:auto;padding-bottom:24px;scrollbar-gutter:stable}
  .conv:has(> .thread) .thread{max-width:none;padding:12px 40px 24px}
  .conv:has(> .thread) .thread > *{max-width:860px;width:100%;margin-left:auto;margin-right:auto}
  .conv:has(> .thread) .composer{position:static;flex:none;background:var(--paper)}
  .ctx{height:100vh;overflow-y:auto}
}

/* phone: the composer is two lines (text, then the suggestions scrolling sideways next to the send button); the rail
   shows icons only; cards and feeds take the whole width */
@media (max-width:720px){
  .thread{padding-bottom:116px}
  .composer .row{flex-wrap:nowrap;gap:8px}
  .composer .chips{order:0;width:auto;flex:1;min-width:0;display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;white-space:nowrap;scrollbar-width:none;padding-bottom:2px}
  .composer .chips::-webkit-scrollbar{display:none}
  .composer .chips .tag{flex:none}
  .composer .row > div:last-child{flex:none}
  .composer textarea{font-size:16px}
  .rail a{padding:0 8px;gap:0;font-size:0}
  .rail a svg{display:block;width:22px;height:22px}
  .rail a span{display:none}.rail a .n{display:block;font-size:10px}
  .rail a.on{font-size:12px;gap:6px}.rail a.on span{display:inline}
  .feed .e{grid-template-columns:44px minmax(0,1fr)}
  .post .out b{font-size:20px}
  .pageh h1{font-size:24px;line-height:30px}
  .bars{height:64px!important}
}

/* scrollbars in the panel's own colours, thin, on every column that scrolls */
.thread,.conv,.ctx,.wrap,.pre,.diff,.steps .s .io,table.t{scrollbar-width:thin;scrollbar-color:var(--hair) transparent}
.thread::-webkit-scrollbar,.conv::-webkit-scrollbar,.ctx::-webkit-scrollbar{width:10px;height:10px}
.thread::-webkit-scrollbar-thumb,.conv::-webkit-scrollbar-thumb,.ctx::-webkit-scrollbar-thumb{background:var(--hair);border-radius:6px;border:3px solid var(--paper)}
.thread::-webkit-scrollbar-track,.conv::-webkit-scrollbar-track,.ctx::-webkit-scrollbar-track{background:transparent}

/* posts listed in the context panel: the same monogram, smaller */
.ctx .feed .mono{width:36px;height:36px;border-radius:11px;font-size:12px;margin-top:2px}
.ctx .feed .e{align-items:center}
