/* Part 6: dark only, flat, 8 px corners, 1 px borders, no shadows, no gradients. */
:root {
  --night: #0B1220; --bench: #121C2E; --glass: #1C2A42; --chalk: #E8EDF5; --pencil: #8A97AD;
  --accent: #5EE6C8; --ember: #F2A65A; --confirm: #6FCF97; --contradict: #E86C6C;
  --head: 'Inter Tight', 'Inter', system-ui, sans-serif; --body: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 8px; --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--night); color: var(--chalk); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
button, textarea, input { font: inherit; color: inherit; }
a { color: var(--pencil); text-decoration: none; } a:hover { color: var(--chalk); }
[hidden] { display: none !important; }
/* the logo, top left: the mark at a fixed height (never stretched) and the name in Inter Tight */
.brand { position: absolute; top: 22px; left: 28px; z-index: 5; display: flex; align-items: center; gap: 10px; color: var(--chalk); font: 600 17px var(--head); letter-spacing: -0.01em; }
.brand:hover { color: var(--chalk); }
.logo-mark { height: 22px; width: auto; display: block; }
/* accounts: one quiet link, top right */
.acct { position: absolute; top: 20px; right: 28px; z-index: 5; font-size: 14px; color: var(--chalk); border: 1px solid var(--glass); border-radius: var(--r); padding: 7px 14px; background: var(--bench); }
.acct:hover { color: var(--chalk); border-color: var(--accent); }
/* the work console, top right beside Your projects, on every project screen (Tor, 11 Nov, C6); its right edge is set from #acct */
.console-top { cursor: pointer; font: inherit; font-size: 14px; }
body.treestage .console-top { display: none; }

/* ---------- hero: talk on the left, office on the right rail ---------- */
.hero { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 32px; padding: 0 56px 56px 72px; align-items: center; }
.talk { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 64px 0 40px; max-width: 860px; }
.intro { transition: margin 300ms var(--ease); }
h1 { font: 600 clamp(28px, 2.7vw, 46px)/1.1 var(--head); letter-spacing: -0.02em; margin: 0 0 14px; max-width: 19em; text-wrap: balance; }
.sub { color: var(--pencil); font-size: clamp(16px, 1.25vw, 20px); margin: 0 0 20px; max-width: 640px; }
/* why to believe the headline: three short statements, each true of the site today (Tor's pick, 12 Nov) */
.proof { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 760px; }
.proof li { border: 1px solid var(--glass); border-radius: var(--r); padding: 9px 12px; font-size: 13.5px; line-height: 1.45; color: var(--chalk); min-width: 0; }
.proof b { display: block; font: 500 10.5px/1.7 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
body.chatting .proof { display: none; }
body.chatting .talk { justify-content: flex-end; height: 100vh; height: 100dvh; }
/* once the conversation starts, the conversation gets the room (Tor, 13 Nov: "I can barely see the reading screen").
   The headline and the sub-line go; the log takes all the height left; the files sit on one line under the box. */
body.chatting .hero { grid-template-columns: minmax(0, 72fr) minmax(0, 28fr); }
body.chatting .talk { max-width: 1040px; padding-top: 72px; padding-bottom: 20px; }
body.chatting .intro { display: none; }
body.chatting .log { flex: 1 1 auto; max-height: none; min-height: 0; font-size: 16px; line-height: 1.55; }
body.chatting .brought { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
body.chatting .bnote { display: none; }


.log { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 52vh; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--glass) transparent; }
.log:empty { display: none; }
body.chatting .log { margin-bottom: 16px; }
.msg { overflow-wrap: anywhere; max-width: 88%; padding: 10px 14px; border-radius: var(--r); animation: fadein 300ms var(--ease); }
.msg.user { align-self: flex-end; background: var(--glass); }
.msg.notice { align-self: flex-start; background: var(--bench); border: 1px solid var(--ember); }
.msg.user.by-agent { border: 1px dashed var(--accent, #5EE6C8); }
.msg.user .actor { display: block; font-size: 11px; letter-spacing: .02em; color: var(--accent, #5EE6C8); margin-bottom: 2px; }
.msg.manager { align-self: flex-start; display: flex; gap: 10px; padding: 0; max-width: 92%; }
.msg.manager .who { flex: 0 0 auto; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; background: #2B3C5C; position: relative; }
.msg.manager .who::before { content: ''; position: absolute; left: 7px; top: 10px; width: 3px; height: 3px; border-radius: 50%; background: var(--chalk); box-shadow: none; }
.msg.manager .who::after { content: ''; position: absolute; right: 9px; top: 10px; width: 3px; height: 3px; border-radius: 50%; background: var(--chalk); }
.msg.manager .text { background: var(--bench); border: 1px solid var(--glass); border-radius: var(--r); padding: 10px 14px; }
.msg.ask .text, .msg.choice .text { border-color: #2A3B58; }
.q { font-weight: 500; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.chip { border: 1px solid var(--glass); background: transparent; border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px; color: var(--chalk); transition: border-color 150ms, color 150ms; }
.chip:hover { border-color: var(--pencil); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.skip { color: var(--pencil); }
.chip:disabled { cursor: default; opacity: .55; }
.chip.on:disabled { opacity: 1; }
.seed { display: flex; gap: 8px; margin: 0 0 8px; }
.seed input { flex: 1; min-width: 0; background: var(--night); border: 1px solid var(--glass); border-radius: var(--r); padding: 7px 10px; font: 13px var(--mono); }
.seed input:focus { outline: none; border-color: var(--accent); }
.seed .clip, .seed .use { border: 1px solid var(--glass); background: transparent; border-radius: var(--r); padding: 0 10px; cursor: pointer; color: var(--pencil); }
.seed .use { color: var(--night); background: var(--accent); border-color: var(--accent); font-weight: 500; }
.seed .clip:hover { color: var(--chalk); border-color: var(--pencil); }
.answered .chips, .answered .seed { pointer-events: none; }

/* the chat box: same place on every screen (Part 5) */
.box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--glass); background: var(--bench); border-radius: var(--r); padding: 8px 8px 8px 16px; transition: border-color 150ms; }
.box:focus-within { border-color: var(--accent); }
.box textarea { flex: 1; resize: none; border: 0; background: transparent; outline: none; padding: 8px 0; max-height: 180px; line-height: 1.45; }
.box textarea::placeholder { color: var(--pencil); }
.attach, .mic, .send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--r); border: 0; cursor: pointer; display: grid; place-items: center; }
.attach, .mic { background: transparent; color: var(--pencil); } .attach:hover, .mic:hover { color: var(--chalk); }
/* what the scientist brought with their question: held by the session, never written down (Tor, 10 Nov) */
.brought { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.bfile { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--glass); border-radius: var(--r); padding: 5px 6px 5px 10px; font-size: 13px; max-width: 280px; flex: 0 0 auto; }
.bfile b { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bfile small { white-space: nowrap; }
.bfile.unread { border-color: var(--ember); }
.bfile small { color: var(--pencil); }
.bx { border: 0; background: transparent; color: var(--pencil); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.bx:hover { color: var(--chalk); background: var(--glass); }
.bnote { flex: 1 1 100%; color: var(--pencil); font-size: 12px; margin: 0; }
.mic.on { color: var(--night); background: var(--ember); }
.send { background: var(--accent); color: var(--night); }
.send:disabled { opacity: .5; cursor: default; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.free { color: var(--pencil); font-size: 13px; margin: 14px 0 0; }
body.chatting .starters, body.chatting .free { display: none; }

/* ---------- the office ---------- */
.rail { align-self: center; position: relative; }
.office { position: relative; }
.office-svg { width: 100%; height: auto; display: block; overflow: visible; }
.laptop { display: none; }
.bubble { position: absolute; z-index: 2; max-width: 260px; transform: translate(-30%, -100%); background: var(--bench); border: 1px solid var(--glass); border-radius: var(--r); padding: 8px 12px; font: 600 13px/1.4 var(--head); color: var(--chalk); animation: fadein 300ms var(--ease); pointer-events: none; }
.status { position: absolute; z-index: 3; transform: translate(-50%, -100%); color: var(--pencil); font: 12px var(--mono); white-space: nowrap; pointer-events: none; background: var(--night); padding: 2px 6px; border-radius: 4px; }
.station { cursor: default; }
.station.empty .desk, .station.empty .chair-g { opacity: .75; }
.station.empty.hired .desk { opacity: 1; transition: opacity 300ms var(--ease); }
.station .desk polygon:first-child { stroke: transparent; stroke-width: 2; transition: stroke 300ms var(--ease), fill 300ms var(--ease); }
.station.arriving .desk polygon:first-child { fill: #34507A; stroke: var(--accent); }
.station.arriving .bot-in rect:first-child { fill: #2E5A63; transition: fill 300ms var(--ease); }
.status.announce { color: var(--accent); border: 1px solid var(--accent); }
.station.empty.hired .screen { opacity: 1; }
.station.hired .screen { --scr: #5EE6C8; --scr2: #2E9C88; }

/* bots: away bots are not in the room; a hired bot slides into the chair from behind in 300 ms */
.bot.away .bot-in { opacity: 0; transform: translate(34px, -26px); }
.station.hired .bot.away .bot-in { opacity: 1; transform: none; transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.bot-in, .head, .eyes, .arm-r, .arm-l, .pen { transform-box: fill-box; }
.head { transform-origin: 50% 100%; transition: transform 300ms var(--ease); }
.eyes { transition: transform 300ms var(--ease); }

/* Manager idle (4–6 s): looks toward the chat box, blinks, taps a pen every 4 s */
.bot.manager .eyes { transform: translate(-1.5px, 0.5px); }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 5.2s infinite; }
.pen { transform-origin: 0% 100%; animation: tap 4s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes tap { 0%, 84%, 100% { transform: rotate(0); } 88% { transform: rotate(-14deg); } 92% { transform: rotate(0); } }
/* the scientist puts the cursor in the box: the Manager looks up */
.office.attentive .bot.manager .head { transform: translateY(-2px); }
.office.attentive .bot.manager .eyes { transform: translate(-1px, -1px); }
/* working (1–2 s): writes on the notepad */
.office.writing .bot.manager .head { transform: rotate(-6deg) translateY(1px); }
.office.writing .bot.manager .eyes { transform: translate(-2px, 2px); }
.office.writing .pen { animation: write 1.2s infinite linear; }
.office.writing .bot.manager .arm-l { animation: armw 1.2s infinite linear; transform-origin: 50% 0%; }
@keyframes write { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-3px, 1px) rotate(-6deg); } 50% { transform: translate(-6px, 2px) rotate(0); } 75% { transform: translate(-3px, 3px) rotate(-6deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes armw { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg); } }
/* done: looks up and nods once */
.office.nod .bot.manager .head { animation: nod 700ms var(--ease) 1; }
@keyframes nod { 0%, 100% { transform: none; } 40% { transform: translateY(3px); } }
/* Reader idle: straightens the stack every 5 s */
.station.hired .stack { animation: straighten 5s infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes straighten { 0%, 86%, 100% { transform: none; } 90% { transform: translateX(-1.5px); } 94% { transform: translateX(1px); } }
.station.reader-hidden .stack { opacity: .42; }
/* Reader working (build step 2, 1–2 s): a paper flies from the shelf into its hands while it really reads; its screen is on */
.flyer { pointer-events: none; }
.flyer .flyer-in { opacity: 0; transform-box: fill-box; transform-origin: center; }
.office.reading .flyer .flyer-in { animation: fetch 1.8s infinite var(--ease); }
@keyframes fetch { 0% { opacity: 0; transform: none; } 10% { opacity: 1; } 70% { opacity: 1; transform: translate(var(--fx), var(--fy)) scale(.8); } 85%, 100% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(.5); } }
.office.reading .station[data-bot="reader"] .arm-r { animation: armw 1.8s infinite linear; transform-origin: 50% 0%; }
.office.reading .station[data-bot="reader"] .head { transform: rotate(5deg) translateY(1px); }
/* Reader done: slides its card stack toward the Manager's desk, once */
.office.handed .station[data-bot="reader"] .stack { animation: hand 900ms var(--ease) 1; transform-box: fill-box; }
@keyframes hand { 0%, 100% { transform: none; } 50% { transform: translate(10px, 4px); } }
/* Illustrator (build step 3). Idle: spins the stylus every 5 s. Working (1.4 s): strokes run across the tablet while it really
   draws. Done: the miniature of the real figure shows on the tablet and it holds the tablet up once. */
.tab .stylus { transform-box: fill-box; transform-origin: 0% 100%; }
.station.hired .tab .stylus { animation: spin 5s infinite; }
@keyframes spin { 0%, 88%, 100% { transform: rotate(0); } 94% { transform: rotate(40deg); } }
.draw-stroke { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.office.drawing .draw-stroke { opacity: 1; animation: stroke 1.4s infinite linear; }
.office.drawing .tab .stylus { animation: scribble 1.4s infinite linear; }
.office.drawing .station[data-bot="illustrator"] .arm-r { animation: armw 1.4s infinite linear; transform-origin: 50% 0%; }
.office.drawing .station[data-bot="illustrator"] .head { transform: rotate(5deg) translateY(1px); }
@keyframes stroke { 0% { stroke-dashoffset: 1; } 70%, 100% { stroke-dashoffset: 0; } }
@keyframes scribble { 0%, 100% { transform: translate(0, 0); } 35% { transform: translate(-10px, 4px); } 70% { transform: translate(-4px, -3px); } }
.mini { opacity: 0; transition: opacity 300ms var(--ease); }
.office.drawn .mini { opacity: 1; }
.office.drawn .draw-stroke { opacity: 0; }
.office.raised .station[data-bot="illustrator"] .tab { animation: raise 900ms var(--ease) 1; transform-box: fill-box; }
@keyframes raise { 0%, 100% { transform: none; } 50% { transform: translateY(-6px); } }
.status.live { color: var(--pencil); }
.status .rev { color: var(--ember); }

/* the Manager's task card beside the office (Part 3, step 2): one line per hired bot, ticked when done */
.plan { margin: 12px auto 0; max-width: 360px; border: 1px solid var(--glass); background: var(--bench); border-radius: var(--r); padding: 10px 14px; font: 13px/1.5 var(--mono); color: var(--pencil); }
.plan ol { list-style: none; margin: 0; padding: 0; }
.plan li { display: flex; gap: 8px; align-items: baseline; }
.plan li::before { content: '○'; color: var(--pencil); }
.plan li.now::before { content: '◐'; color: var(--accent); }
.plan li.done { color: var(--chalk); } .plan li.done::before { content: '✓'; color: var(--confirm); }
.plan .stop { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--pencil); font: 12px var(--mono); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.plan .stop:hover { color: var(--chalk); }

/* the Reader's card in the chat: the Paper panel's order (Part 5): metadata, then Claim · Why it's here · Method · Key figure · Limitations */
.msg.manager.paper { max-width: 100%; }
.msg.manager.paper .text { flex: 1; min-width: 0; }
.pcard { margin-top: 10px; border: 1px solid var(--glass); border-radius: var(--r); background: var(--night); padding: 14px 16px; }
.pcard h3 { font: 600 16px/1.3 var(--head); margin: 0 0 4px; }
.pcard .meta { font: 12px/1.5 var(--mono); color: var(--pencil); margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.pcard .meta a { color: var(--pencil); text-decoration: underline; text-underline-offset: 3px; }
.badge { border: 1px solid var(--glass); border-radius: 999px; padding: 0 8px; font: 11px/1.7 var(--mono); }
.badge.open { border-color: var(--accent); color: var(--accent); }
.badge.closed { border-color: var(--ember); color: var(--ember); }
.pcard .why { color: var(--chalk); border-left: 2px solid var(--accent); padding-left: 10px; margin: 0 0 12px; }
.pcard dl { margin: 0; display: grid; grid-template-columns: 112px 1fr; gap: 8px 14px; }
.pcard dt { font: 12px/1.55 var(--mono); color: var(--pencil); padding-top: 1px; }
.pcard dd { margin: 0; }
.pcard dd ul { margin: 0; padding-left: 16px; }
.pcard .claim { font-weight: 500; }
.pcard .check { font: 11px var(--mono); color: var(--pencil); display: block; margin-top: 2px; }
.pcard .check.ok { color: var(--confirm); }
.pcard .note { font: 12px var(--mono); color: var(--pencil); margin: 12px 0 0; }
.pcard .rev { color: var(--ember); }
@media (max-width: 860px) { .pcard dl { grid-template-columns: 1fr; gap: 2px; } .pcard dd { margin-bottom: 8px; } }

/* idle loops stop entirely when the tab is hidden (motion rule 2) */
body.paused *, body.paused *::before, body.paused *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- below the fold: three 6-second cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px 72px 72px; max-width: 1440px; margin: 0 auto; }
.card { border: 1px solid var(--glass); background: var(--bench); border-radius: var(--r); padding: 24px; }
.card h2 { font: 600 20px/1.2 var(--head); margin: 18px 0 6px; }
.card p { color: var(--pencil); margin: 0; }
.anim { height: 120px; border-radius: var(--r); background: var(--night); position: relative; overflow: hidden; }
/* It reads: papers fly into a card */
.reads i { position: absolute; width: 22px; height: 28px; background: var(--chalk); border-radius: 2px; left: 12%; top: 20%; animation: fly 6s infinite var(--ease); opacity: 0; }
.reads i:nth-child(2) { animation-delay: 1.4s; top: 50%; } .reads i:nth-child(3) { animation-delay: 2.8s; top: 35%; }
.reads b { position: absolute; right: 14%; top: 22%; width: 74px; height: 66px; border: 1px solid var(--accent); border-radius: 6px; background: var(--bench); }
.reads b::before, .reads b::after { content: ''; position: absolute; left: 10px; right: 10px; height: 3px; background: var(--glass); top: 16px; }
.reads b::after { top: 30px; right: 24px; background: var(--accent); }
@keyframes fly { 0% { opacity: 0; transform: none; } 8% { opacity: 1; } 40% { opacity: 1; transform: translate(170%, 0) rotate(-8deg); } 55%, 100% { opacity: 0; transform: translate(330%, 10px) scale(.4); } }
/* It maps: nodes cluster */
.maps i { position: absolute; width: 12px; height: 12px; border-radius: 50%; animation: cluster 6s infinite var(--ease); }
.maps i:nth-child(1) { background: #5EE6C8; left: 10%; top: 20%; --tx: 70px; --ty: 18px; }
.maps i:nth-child(2) { background: #5EE6C8; left: 25%; top: 70%; --tx: 46px; --ty: -36px; }
.maps i:nth-child(3) { background: #7FA7FF; left: 80%; top: 15%; --tx: -40px; --ty: 30px; }
.maps i:nth-child(4) { background: #7FA7FF; left: 88%; top: 72%; --tx: -60px; --ty: -20px; }
.maps i:nth-child(5) { background: #C98BFF; left: 50%; top: 82%; --tx: 6px; --ty: -26px; }
.maps i:nth-child(6) { background: #C98BFF; left: 55%; top: 8%; --tx: -2px; --ty: 40px; }
@keyframes cluster { 0%, 10% { transform: none; } 45%, 85% { transform: translate(var(--tx), var(--ty)); } 100% { transform: none; } }
/* It explains: a figure being redrawn */
.explains s { position: absolute; bottom: 22px; width: 18px; background: var(--accent); transform-origin: bottom; animation: grow 6s infinite var(--ease); }
.explains s:nth-child(1) { left: 30%; height: 60px; } .explains s:nth-child(2) { left: 42%; height: 34px; background: var(--pencil); animation-delay: .25s; }
.explains s:nth-child(3) { left: 54%; height: 72px; animation-delay: .5s; } .explains s:nth-child(4) { left: 66%; height: 28px; background: var(--pencil); animation-delay: .75s; }
.explains u { position: absolute; left: 24%; right: 24%; bottom: 21px; height: 1px; background: var(--glass); }
@keyframes grow { 0%, 8% { transform: scaleY(0); } 35%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }

.more { max-width: 1440px; margin: 0 auto; padding: 0 72px 48px; }
.more h2 { font: 600 22px/1.2 var(--head); margin: 0 0 8px; }
.more p { color: var(--pencil); max-width: 760px; margin: 0 0 16px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tier { border: 1px solid var(--glass); border-radius: var(--r); padding: 16px 20px; }
.tier h3 { font: 600 17px var(--head); margin: 0 0 4px; }
.mono { font: 13px/1.5 var(--mono); color: var(--pencil); margin: 0; }
.foot { text-align: center; color: var(--pencil); font-size: 13px; padding: 24px 16px 32px; border-top: 1px solid var(--glass); }
.lang { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--pencil); font-size: 13px; }
.lang.on { color: var(--chalk); }

/* ---------- phone (design/11): one column, office below, laptop line ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 0 16px 24px; gap: 8px; }
  .talk { min-height: auto; padding: 84px 0 8px; }
  .brand { top: 22px; left: 16px; } .acct { top: 16px; right: 16px; }
  /* a thumb needs 32 px (tester/brain/profile.md R17; the walk found six links under it on 12 and 13 Nov, backlog B4) */
  .brand, .acct, .foot a { min-height: 32px; display: inline-flex; align-items: center; }
  .foot a { padding: 0 4px; }
  .proof b { font-size: 12px; }
  h1 { font-size: 30px; }
  /* on a phone the box must stay on the first screen: the three statements become three plain lines */
  .proof { grid-template-columns: 1fr; gap: 4px; margin-bottom: 16px; }
  .proof li { border: 0; padding: 0; font-size: 13px; color: var(--pencil); }
  .proof b { display: inline; margin-right: 8px; }
  .starters { flex-direction: column; } .starters .chip { text-align: center; padding: 9px 13px; }
  .rail { max-width: 420px; margin: 0 auto; width: 100%; }
  .bubble { max-width: 200px; }
  .laptop { display: block; color: var(--chalk); font-size: 14px; text-align: center; margin: 8px 0 0; }
  .cards, .tiers { grid-template-columns: 1fr; } .cards, .more { padding-left: 16px; padding-right: 16px; }
  .log { max-height: none; }
  body.chatting .hero { grid-template-columns: 1fr; }
  body.chatting .talk { height: auto; padding-top: 72px; }
}

/* ---------- the Paper Visual (build step 3): the chat card and the stage ---------- */
.msg.visual { max-width: 100%; }
.msg.visual .text { width: 100%; }
.vcard { margin-top: 10px; border: 1px solid var(--glass); border-radius: var(--r); background: var(--night); padding: 14px 16px; }
.vcard .ref { font: 12px var(--mono); color: var(--pencil); margin: 0 0 4px; }
.vcard .vclaim { font: 600 17px/1.35 var(--head); margin: 0 0 10px; color: var(--chalk); }
.vcard .thumb { position: relative; border-radius: var(--r); overflow: hidden; cursor: pointer; border: 1px solid var(--glass); padding: 10px 66px 10px 10px; background: var(--bench); }
.vcard .thumb .vfig { display: block; max-width: 520px; margin: 0 auto; }
.vcard .thumb .playb { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--night); display: grid; place-items: center; cursor: pointer; }
.vactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid var(--glass); background: transparent; color: var(--chalk); border-radius: var(--r); padding: 7px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: var(--pencil); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--night); font-weight: 500; }
.btn:disabled { opacity: .55; cursor: default; }
.export { position: relative; }
.export .menu { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--bench); border: 1px solid var(--glass); border-radius: var(--r); padding: 6px; }
.export .menu a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--chalk); font-size: 14px; }
.export .menu a:hover { background: var(--glass); }
.export .menu small { display: block; color: var(--pencil); font: 11px var(--mono); padding: 4px 10px 2px; }
.sheet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.sheet .sw { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--glass); }
.sheet .fonts { font: 12px var(--mono); color: var(--pencil); flex-basis: 100%; }

.stage { display: none; }
body.staging .stage { display: flex; flex-direction: column; gap: 14px; height: 100vh; height: 100dvh; padding: 28px 0 24px; }
body.staging .talk { display: none; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-bar .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--glass); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--pencil); padding: 7px 12px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--glass); }
.seg button.on { background: var(--glass); color: var(--chalk); }
.seg-label { font: 12px var(--mono); color: var(--pencil); margin-right: 2px; }
.pv { flex: 1; min-height: 0; overflow: auto; border-radius: var(--r); border: 1px solid var(--line, var(--glass)); background: var(--bg); color: var(--text); padding: 26px 30px; display: grid; grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); gap: 28px; align-content: start; transition: background 300ms var(--ease), color 300ms var(--ease); }
.pv .pv-meta { grid-column: 1 / -1; font: 12px var(--mono); color: var(--pencil); }
.pv .pv-title { grid-column: 1 / -1; margin: -18px 0 0; font: 600 16px/1.35 var(--vhead); color: var(--text); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pv .pv-claim { font: 600 clamp(20px, 1.8vw, 28px)/1.3 var(--vhead); margin: 0 0 18px; color: var(--text); }
.pv .pv-ftitle { font: 600 13px/1.4 var(--vbody); margin: 0 0 6px; color: var(--text); }
.pv .pv-take { font: 15px/1.5 var(--vbody); margin: 10px 0 0; }
.pv .pv-note, .pv .pv-why { font: 13px/1.5 var(--vbody); color: var(--muted); margin: 8px 0 0; }
.pv .pv-why b { display: block; font-weight: 600; font-size: 12px; }
.pv .pv-maplab { font: 12px var(--mono); color: var(--muted); margin: 6px 0 0; }
.pv .pv-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; font: 12px var(--vbody); color: var(--pencil); }
.pv .pv-foot b { font: 600 13px var(--head); color: var(--text); margin-right: 8px; }
/* the Visual plays once on open and on Replay: map node 600 ms, edge 400 ms, claim, then bars one by one (Part 6) */
.pv .vq, .pv .vn, .pv .pv-claim, .pv .pv-fig, .pv .pv-take, .pv .pv-why, .pv .vv, .pv .vs { opacity: 1; }
.pv.play .vq { animation: vfade 600ms var(--ease) both; }
.pv.play .vn { animation: vfade 600ms var(--ease) 700ms both, vpulse 2s ease-in-out 1300ms 1; }
.pv.play .ve { animation: vdraw 400ms var(--ease) 600ms both; }
.pv.play .pv-claim { animation: vfade 600ms var(--ease) 1300ms both; }
.pv.play .pv-fig { animation: vfade 300ms var(--ease) 1900ms both; }
.pv.play .vb { transform-box: fill-box; transform-origin: 50% 100%; animation: vgrow 600ms var(--ease) calc(1900ms + var(--d)) both; }
.pv.play .vv, .pv.play .vs { animation: vfade 300ms var(--ease) calc(1900ms + var(--d)) both; }
.pv.play .pv-take, .pv.play .pv-note { animation: vfade 600ms var(--ease) 3300ms both; }
.pv.play .pv-why { animation: vfade 600ms var(--ease) 3800ms both; }
@keyframes vfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vgrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes vdraw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes vpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (max-width: 860px) {
  body.staging .stage { height: auto; padding: 16px 0; }
  .pv { grid-template-columns: 1fr; padding: 18px 16px; gap: 16px; }
}

/* ---------- the map (build step 4): the Briefing's stage ---------- */
/* Cartographer at its desk. Idle: nothing moves but the pins it has. Working (1.6 s): a thread runs across the pinboard while it
   really groups and links the cards. Done: it steps back from the board once. */
.thread-run { fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.office.mapping .thread-run { opacity: 1; animation: stroke 1.6s infinite linear; }
.office.mapping .station[data-bot="cartographer"] .arm-r { animation: armw 1.6s infinite linear; transform-origin: 50% 0%; }
.office.mapping .station[data-bot="cartographer"] .head { transform: rotate(5deg) translateY(1px); }
.office.stepped .station[data-bot="cartographer"] .bot-in { animation: stepback 900ms var(--ease) 1; }
@keyframes stepback { 0%, 100% { transform: none; } 50% { transform: translate(-4px, -3px); } }
.pinboard .pins circle, .pinboard .threads line { transition: fill 300ms var(--ease); }

body.mapstage .stage { gap: 10px; }
.map-status { font: 12px var(--mono); color: var(--pencil); }
.map-area { position: relative; flex: 1; min-height: 320px; border: 1px solid var(--glass); border-radius: var(--r); background: var(--night); overflow: hidden; }
.map { position: absolute; inset: 0; perspective: 1400px; --px: 0; --py: 0; }
.map-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; touch-action: none;
  transform: rotateX(calc(var(--py) * -3deg)) rotateY(calc(var(--px) * 3deg)); transition: transform 900ms var(--ease); }
.map.panning .map-svg { cursor: grabbing; }
/* parallax between layers: the plates move least, the labels most */
.m-layer { transition: transform 900ms var(--ease); }
.m-plates { transform: translate(calc(var(--px) * 3px), calc(var(--py) * 2px)); }
.m-edges { transform: translate(calc(var(--px) * 6px), calc(var(--py) * 4px)); }
.m-nodes { transform: translate(calc(var(--px) * 8px), calc(var(--py) * 5px)); }
.m-labels { transform: translate(calc(var(--px) * 11px), calc(var(--py) * 7px)); }
.m-plate { fill: var(--bench); stroke-width: 1; stroke-opacity: .45; transition: opacity 300ms var(--ease); }
.m-label { font: 600 13px var(--head); paint-order: stroke; stroke: var(--night); stroke-width: 4px; stroke-linejoin: round; transition: opacity 300ms var(--ease); pointer-events: none; }
.m-q-dot { fill: var(--accent); }
.m-q-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-opacity: .5; }
.m-q-text { font: 600 12px var(--head); fill: var(--chalk); paint-order: stroke; stroke: var(--night); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
/* papers: a dim outline until read, a 2 s pulse while read, full colour when the card is done; 600 ms into their group */
.m-node { transition: transform 600ms var(--ease), opacity 600ms var(--ease); cursor: default; outline: none; }
.m-node.new { opacity: 0; }
.m-node circle { stroke-width: 1.5; transition: fill 300ms var(--ease), stroke 300ms var(--ease), r 300ms var(--ease); }
.m-node.planned circle { stroke: var(--pencil); stroke-opacity: .45; }
.m-node.reading circle { stroke: var(--accent); stroke-width: 2; animation: mpulse 2s ease-in-out infinite; }
.m-node.failed circle { stroke: var(--pencil); stroke-opacity: .35; stroke-dasharray: 3 3; }
.m-node.done { cursor: pointer; }
.m-node.done:hover circle, .m-node.done:focus-visible circle { stroke: var(--chalk); stroke-width: 2; }
.m-node.sel circle { stroke: var(--chalk); stroke-width: 2.5; }
.m-node.off, .m-plate.off, .m-label.off, .m-edge.off { opacity: .08; pointer-events: none; }
@keyframes mpulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .3; } }
/* lines draw from source to target over 400 ms */
.m-edge { fill: none; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 400ms var(--ease), opacity 300ms var(--ease); }
.m-edge.new { stroke-dashoffset: 1; }
.m-edge.cites { stroke: var(--pencil); stroke-opacity: .5; stroke-width: 1; }
.m-edge.confirms { stroke: var(--confirm); stroke-opacity: .9; stroke-width: 1.6; }
.m-edge.contradicts { stroke: var(--contradict); stroke-opacity: .9; stroke-width: 1.6; }
.m-edge:hover { stroke-width: 2.6; }
.map-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--bench); border: 1px solid var(--glass); border-radius: 6px; padding: 4px 8px; font: 12px var(--mono); color: var(--chalk); max-width: 360px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-start; }
.map-legend .lg-h { flex-basis: 100%; margin: 0; font: 12px var(--mono); color: var(--pencil); }
.lg-groups { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; }
.lg-group { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--glass); border-radius: var(--r); background: transparent; padding: 5px 10px; cursor: pointer; font-size: 13px; color: var(--chalk); text-align: left; }
.lg-group i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lg-group small { font: 11px var(--mono); color: var(--pencil); }
.lg-group.off { opacity: .45; }
.lg-kinds { display: flex; flex-wrap: wrap; gap: 14px; font: 12px var(--mono); color: var(--pencil); }
.lg-kind { display: inline-flex; align-items: center; gap: 6px; }
.lg-kind i { display: inline-block; width: 18px; height: 2px; }
.lg-kind.dim b { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--pencil); opacity: .6; }
/* a paper's card opens from the left over a third of the stage (Part 5) */
.map-panel { position: absolute; z-index: 4; top: 0; left: 0; bottom: 0; width: min(420px, 38%); overflow: auto; background: var(--bench); border-right: 1px solid var(--glass); padding: 14px 16px; animation: slidein 300ms var(--ease); }
.map-panel .mp-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.map-panel .mp-group { flex: 1; font: 600 13px/1.35 var(--head); }
.map-panel .close { padding: 4px 10px; font-size: 13px; }
.map-panel .pcard { border: 0; padding: 0; background: transparent; }
.map-panel .pcard dl { grid-template-columns: 1fr; gap: 2px; } .map-panel .pcard dd { margin-bottom: 8px; }
@keyframes slidein { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
.mthumb { padding: 6px !important; background: var(--night) !important; min-height: 120px; }
.mthumb svg { display: block; width: 100%; height: auto; max-height: 260px; }
.plan .of { color: var(--pencil); }
.msg.trial .chips .chip.tier { border-color: var(--ember); }
@media (max-width: 860px) { .map-area { min-height: 60vh; } .map-panel { width: 100%; } }

/* ---------- the Briefing (build step 5): the written half, research mode, next steps ---------- */
.office.writing .bot.manager .head { transform: rotate(-6deg) translateY(1px); }
.brief-btns { display: inline-flex; gap: 8px; }
.btn.on:not(.primary) { border-color: var(--accent); color: var(--accent); }
.brief-drawer { position: absolute; z-index: 5; top: 0; right: 0; bottom: 0; width: min(440px, 42%); overflow: auto; background: var(--bench); border-left: 1px solid var(--glass); padding: 14px 18px 18px; animation: slideleft 300ms var(--ease); }
@keyframes slideleft { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.bd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.bd-head h2 { margin: 0; font: 600 18px var(--head); }
.bd-head .close { padding: 4px 10px; font-size: 13px; }
.bd-note, .bd-empty { font: 12px/1.5 var(--mono); color: var(--pencil); margin: 6px 0 0; }
.bd-sec { border-top: 1px solid var(--glass); padding: 12px 0 4px; }
.bd-sec h3 { margin: 0 0 6px; font: 600 15px var(--head); }
.bd-sec ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bd-sec li { font-size: 14px; line-height: 1.5; padding-left: 12px; border-left: 2px solid var(--glass); transition: border-color 300ms var(--ease); }
.bd-sec li:hover { border-left-color: var(--chalk); }
.bd-sec.agree li { border-left-color: rgba(111, 207, 151, .45); }
.bd-sec.disagree li { border-left-color: rgba(232, 108, 108, .55); }
.refs { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: baseline; }
.ref { border: 1px solid var(--glass); background: transparent; border-radius: 6px; padding: 0 6px; font: 11px/1.7 var(--mono); color: var(--pencil); cursor: pointer; }
.ref:hover, .ref:focus-visible { color: var(--chalk); border-color: var(--pencil); }
.bd-sec.proposal { border: 1px solid var(--ember); border-radius: var(--r); padding: 12px 14px; margin: 14px 0 6px; }
.bd-sec.proposal h3 { color: var(--ember); }
.bd-prop { margin: 0 0 8px; font: 600 15px/1.45 var(--head); }
.bd-why { margin: 0; font-size: 13px; color: var(--pencil); }
.bd-why b { display: block; font-weight: 600; font-size: 12px; color: var(--chalk); margin-bottom: 2px; }
.chips.next { flex-direction: column; align-items: stretch; margin-top: 10px; }
.chip.nextstep { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; }
.chip.nextstep small { font: 11px var(--mono); color: var(--pencil); white-space: nowrap; }
/* research mode: the papers a sentence rests on stay lit, the rest dims; the Manager's words sit at the foot of the map */
.map.hl .m-node:not(.hl), .map.hl .m-edge:not(.hl), .map.hl .m-plate:not(.hl), .map.hl .m-label:not(.hl) { opacity: .16; }
.m-node.hl circle { stroke: var(--chalk); stroke-width: 2.5; }
.tour { position: absolute; z-index: 4; left: 14px; bottom: 14px; width: min(560px, calc(58% - 28px)); background: var(--bench); border: 1px solid var(--accent); border-radius: var(--r); padding: 12px 14px; }
.tour-text { margin: 0 0 10px; font: 600 15px/1.45 var(--head); animation: fadein 300ms var(--ease); }
.tour-ctl { display: flex; align-items: center; gap: 8px; }
.tour-ctl .btn { padding: 4px 10px; font-size: 13px; }
.tour-n { flex: 1; font: 12px var(--mono); color: var(--pencil); }
body.paused .tour-text { animation: none; }
@media (max-width: 860px) { .brief-drawer { width: 100%; } .tour { width: calc(100% - 28px); } }

/* ---------- build step 6: the price card (Ember, in the chat, never a modal), checkout, transfer ---------- */
.msg.offer .text, .msg.checkout .text, .msg.transfer .text { border-color: var(--ember); }
.msg.offer .otext, .msg.checkout .otext, .msg.transfer .otext { margin: 0 0 12px; }
.tiers-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tierb { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; text-align: left; background: var(--night); border: 1px solid var(--glass); border-radius: var(--r); cursor: pointer; transition: border-color 300ms var(--ease); }
.tierb:hover:not(:disabled), .tierb.on { border-color: var(--ember); }
.tierb:disabled { cursor: default; opacity: .6; } .tierb.on:disabled { opacity: 1; }
.tierb .tn { font: 600 15px/1.3 var(--head); }
.tierb .tp { font: 600 22px/1.2 var(--head); color: var(--ember); }
.tierb .tm { font: 12px/1.4 var(--mono); color: var(--pencil); }
.ofoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ofoot .chip { margin: 0; } .ofoot .incl { margin-right: auto; }
.incl { color: var(--pencil); font-size: 12px; }
.legal { color: var(--pencil); font-size: 12px; margin: 10px 0 0; }
.legal a { color: var(--chalk); text-decoration: underline; text-decoration-color: var(--glass); }
.coform { display: flex; flex-direction: column; gap: 8px; }
.cogrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coform input[type=text], .coform input[type=email] { width: 100%; background: var(--night); border: 1px solid var(--glass); border-radius: var(--r); padding: 9px 12px; outline: none; }
.coform input:focus { border-color: var(--accent); }
.cototal { font: 600 17px/1.3 var(--head); margin: 6px 0 0; text-align: center; }
.coform .incl { text-align: center; margin-top: -6px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--pencil); cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); }
.coerr { color: var(--contradict); font-size: 13px; margin: 0; }
.cotest { font: 12px var(--mono); color: var(--ember); margin: 0; }
.btn.pay { width: 100%; justify-content: center; padding: 10px; }
.linkish { background: none; border: 0; color: var(--pencil); text-decoration: underline; text-decoration-color: var(--glass); cursor: pointer; font-size: 13px; padding: 2px; }
.linkish:hover { color: var(--chalk); }
.stripe-mount:not(:empty) { margin-top: 12px; border-radius: var(--r); overflow: hidden; background: #fff; min-height: 300px; }
.tdetails { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.tdetails dt { color: var(--pencil); font-size: 13px; } .tdetails dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mono { font-family: var(--mono); font-size: 13px; }
.copy { background: none; border: 1px solid var(--glass); border-radius: var(--r); color: var(--pencil); font-size: 11px; padding: 2px 8px; cursor: pointer; }
.promise { color: var(--pencil); font-size: 12px; margin: 8px 0 0; text-align: center; }
.badge { display: inline-block; font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--night); background: var(--confirm); border-radius: 4px; padding: 3px 6px; vertical-align: 1px; }
@media (max-width: 860px) { .tiers-in, .cogrid { grid-template-columns: 1fr; } }
.export .menu .menu-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--chalk); font-size: 14px; background: none; border: 0; cursor: pointer; }
.export .menu .menu-item:hover { background: var(--glass); }
.export .menu .sep { border-top: 1px solid var(--glass); margin: 4px 0; }
.export .menu .note { color: var(--pencil); font-size: 12px; padding: 4px 10px; max-width: 280px; }
.export .menu .shareurl { display: block; width: 100%; margin: 2px 0 4px; background: var(--night); border: 1px solid var(--glass); border-radius: 6px; padding: 6px 8px; font: 12px var(--mono); color: var(--chalk); }
.export.right .menu { left: auto; right: 0; }
.recbar { font: 12px var(--mono); color: var(--ember); }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass); }
.mp-remove { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.mp-remove input { background: var(--night); border: 1px solid var(--glass); border-radius: var(--r); padding: 8px 10px; outline: none; }
.mp-remove input:focus { border-color: var(--accent); }
.mp-remove .row { display: flex; gap: 8px; }
.pfig { margin-top: 4px; border: 1px solid var(--glass); border-radius: var(--r); padding: 6px; background: var(--night); cursor: zoom-in; }
.pfig svg { display: block; width: 100%; height: auto; }
.export .menu { z-index: 20; }
.export.right .menu { min-width: 280px; }
.export .menu a, .export .menu .menu-item { white-space: nowrap; }

/* build step 7: the bot-hours counter in the task card, and a bot's log when its desk is clicked (Part 3, Part 7) */
.station.hired, .station.here { cursor: pointer; }
.plan .meter { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--glass); color: var(--pencil); cursor: help; }
.plan .meter b { font-weight: 400; color: var(--chalk); }
.plan .meter.ticking b { color: var(--accent); }
.plan .meter .ring { display: inline-flex; }
.botlog { margin: 12px auto 0; max-width: 360px; border: 1px solid var(--glass); background: var(--bench); border-radius: var(--r); padding: 10px 14px; font-size: 13px; color: var(--chalk); }
.botlog .head { display: flex; justify-content: space-between; align-items: center; }
.botlog h3 { margin: 0; font: 600 14px var(--head); }
.botlog .x { background: none; border: 0; color: var(--pencil); font-size: 18px; cursor: pointer; padding: 0 4px; }
.botlog ul { list-style: none; margin: 8px 0 0; padding: 0; }
.botlog li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--glass); }
.botlog li .mono, .botlog .tot { font: 12px var(--mono); color: var(--pencil); white-space: nowrap; }
.botlog .tot { margin: 6px 0 0; text-align: right; }
.botlog .note, .botlog .empty { margin: 8px 0 0; color: var(--pencil); font-size: 12px; }
/* a refunded project: the conversation stays readable, its buttons do nothing */
body.readonly .msg button, body.readonly .msg .chip, body.readonly .msg .btn, body.readonly .msg .tierb { pointer-events: none; opacity: .45; }

/* a paper whose full text is not open: the way through the scientist's institution */
.pcard .inst { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--glass); }
.pcard .inst-go { color: var(--accent); font-weight: 500; text-decoration: none; }
.pcard .inst-go:hover { text-decoration: underline; }
.pcard .inst .note { margin: 6px 0 4px; }
.pcard .inst-set { font-size: 13px; color: var(--pencil); }
/* the 3D presentation (web/scene3d.js): it covers the map area while it plays; the map is back one click away */
.p3d-layer { position: absolute; inset: 0; z-index: 6; background: var(--night); display: flex; flex-direction: column; }
.p3d-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.p3d { display: flex; flex-direction: column; flex: 1; min-height: 0; justify-content: center; }
.p3d-canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
.p3d-canvas:active { cursor: grabbing; }
.p3d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--glass); background: var(--bench); }
.p3d-bar .btn { padding: 5px 12px; font-size: 13px; }
.p3d-seek { flex: 1; min-width: 120px; accent-color: var(--accent); }
.p3d-n { font: 12px var(--mono); color: var(--pencil); min-width: 52px; }
.p3d-hint { color: var(--pencil); font-size: 12px; width: 100%; }
@media (max-width: 860px) { .p3d-hint { display: none; } }
.p3d-layer:fullscreen { padding: 0; }
.p3d-layer:fullscreen .p3d-close { display: none; }

/* the price card: what every depth includes */
.incl-list { margin: 12px 0 4px; font-size: 14px; color: var(--chalk); }
.incl-list summary { cursor: pointer; color: var(--pencil); font-size: 13px; }
.incl-list ul { margin: 8px 0 6px; padding-left: 18px; }
.incl-list li { margin: 3px 0; }
.incl-list .note { color: var(--pencil); font-size: 13px; margin: 6px 0 0; }
/* the checkout card: pay from a monthly plan or from prepaid credit */
.checkout .quick { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 10px 0 6px; }
.checkout .or { color: var(--pencil); font-size: 13px; margin: 10px 0 4px; }

/* the search levers and the paper preview (Tor, 9 Nov) */
.chip.find, .chip.go { border-color: var(--accent); color: var(--accent); }
.levers { border-top: 1px solid var(--glass); margin-top: 10px; padding-top: 10px; display: grid; gap: 8px; }
.levers .lh { font-size: 13px; color: var(--pencil); margin-top: 4px; }
.levers .chip small { color: var(--pencil); font: 11px var(--mono); margin-left: 2px; }
.lnote { font-size: 12px; color: var(--pencil); margin: 0; }
.yrs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yr { font-size: 13px; display: grid; gap: 4px; }
.yr input { width: 100%; accent-color: var(--accent); }
.short { display: grid; gap: 8px; }
.pick { border: 1px solid var(--glass); border-radius: var(--r); padding: 10px; display: grid; gap: 4px; justify-items: start; }
.pick .ptitle { font-size: 13px; }
.pv-overlay { position: fixed; inset: 0; background: rgba(5, 9, 16, .72); display: grid; place-items: center; padding: 16px; z-index: 50; }
.pvw { background: var(--bench); border: 1px solid var(--glass); border-radius: var(--r); padding: 18px; max-width: 560px; width: 100%; max-height: 85vh; overflow: auto; display: grid; gap: 10px; }
.pvw h3 { margin: 0; font-size: 16px; }
.pvw p { margin: 0; font-size: 14px; line-height: 1.5; }
/* ---------- the work tree (build step 6c): papers in order, the picked one explained ---------- */
body.treestage .stage { gap: 10px; }
/* The console scrolls with the page: one scrollbar, not a window of a few hundred pixels inside a page that also scrolls
   (Tor's review, 12 Nov). The bar stays at the top while the page moves under it. "Full screen" hides the site's own
   header and the goalpost and, where the browser allows it, takes the whole screen. */
body.treestage .stage { height: auto; min-height: 100dvh; }
body.treestage .rail, body.treestage .cards, body.treestage .more, body.treestage .foot { display: none; }
body.treestage .tree-stagebar { position: sticky; top: 0; z-index: 20; background: var(--night); padding-block: 8px; }
body.treefull .brand, body.treefull .acct, body.treefull .tree-goal { display: none; }
body.treefull .stage { padding-top: 0; }
.tree-area { flex: 1; min-height: 0; display: flex; }
.tree-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; width: 100%; min-height: 0; }
.tree-list { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: auto; min-width: 0; }
.tree-lhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.tree-lt { font: 600 13px var(--head); }
.tree-count { font: 11px var(--mono); color: var(--muted); }
.tree-seg { display: flex; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tree-seg button { font: 500 11.5px var(--body); padding: 6px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 4px; cursor: pointer; }
.tree-seg button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.tree-row { display: grid; grid-template-columns: 22px 34px 1fr; gap: 7px; align-items: start; width: 100%; text-align: left; padding: 9px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; }
.tree-row:hover { background: rgba(127, 167, 255, .07); }
.tree-row[aria-selected="true"] { background: rgba(127, 167, 255, .11); box-shadow: inset 3px 0 0 var(--accent); }
.tree-ord, .tree-yr { font: 11px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.tree-ti { min-width: 0; font-size: 12.5px; line-height: 1.35; }
.tree-ti b { font-weight: 600; }
.tree-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tree-chip { font: 9.5px var(--mono); letter-spacing: .04em; padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.tree-chip.on { color: var(--accent); border-color: var(--accent); }
.tree-chip.thin { color: var(--pencil); }
.tree-pane { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: auto; min-width: 0; padding: 0 0 16px; }
.tree-bar { padding: 11px 15px; border-bottom: 1px solid var(--line); }
.tree-ref { font: 12px var(--mono); color: var(--muted); }
.tbeat { background: var(--bg); border-bottom: 1px solid var(--line); }
.tree-beats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.tree-beats button { font: 500 11px var(--mono); padding: 5px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 4px; cursor: pointer; }
.tree-beats button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.tree-grow { flex: 1; }
.tree-kind { font: 10.5px var(--mono); color: var(--muted); }
.tree-ask { padding: 22px 15px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--line); }
.tree-ask p { margin: 0; font-size: 13.5px; max-width: 46ch; }
.tree-fields { display: grid; gap: 13px; padding: 15px; }
.tree-field p { margin: 0; font-size: 13px; }
.tree-field ul { margin: 0; padding-left: 18px; font-size: 13px; }
.tree-field li { margin-bottom: 3px; }
.tree-flab { font: 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tree-links, .tree-clash, .tree-stand, .tree-unk, .tree-own { padding: 13px 15px; border-top: 1px solid var(--line); }
/* the scientist's own material, told apart from the papers at a glance */
.tree-tag.yours { color: var(--accent); border-color: var(--accent); }
.tree-link, .tree-srow, .tree-urow { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 12.5px; padding: 4px 0; }
.tree-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; align-self: center; }
.tree-structure { padding: 12px 8px; }
.tree-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 15px 10px; font: 10.5px var(--mono); color: var(--muted); }
.tree-li { display: flex; align-items: center; gap: 5px; }
.tree-hid { font: 11px var(--mono); color: var(--accent); flex: 0 0 auto; }
.tree-htx { flex: 1; min-width: 0; }
.tree-tag { font: 10px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; white-space: nowrap; }
.tree-tag.off { color: var(--pencil); }
.tree-mark { font: 10.5px var(--mono); padding: 3px 7px; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 3px; cursor: pointer; }
.tree-by { display: block; width: 100%; color: var(--pencil); font-size: 11.5px; }
.tree-empty { padding: 24px 15px; color: var(--muted); }
.tree-clash p { margin: 3px 0; font-size: 12.5px; }
/* the beats play on open and when another beat is picked, in the same order the Visual uses */
.tbeat .vv, .tbeat .vs { opacity: 1; }
.tbeat.play .vb { transform-box: fill-box; transform-origin: 50% 100%; animation: vgrow 500ms var(--ease) calc(120ms + var(--d, 0ms)) both; }
.tbeat.play .vv, .tbeat.play .vs { animation: vfade 320ms var(--ease) calc(120ms + var(--d, 0ms)) both; }
@media (max-width: 860px) {
  .tree-wrap { grid-template-columns: minmax(0, 1fr); }
  .tree-list { max-height: 38vh; }
}
@media (prefers-reduced-motion: reduce) {
  .tbeat.play .vb, .tbeat.play .vv, .tbeat.play .vs { animation: none; }
}

/* ---------- the goalpost, the bar and the final film (build step 6d) ---------- */
.tree-goal { padding: 0 16px 10px; }
.goal-in { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.goal-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-k { font: 600 11px/1.2 var(--mono, ui-monospace, monospace); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.goal-text { font-weight: 600; }
.goal-who { font-size: 12px; color: var(--muted); }
.goal-bar { display: flex; gap: 4px; margin-top: 10px; }
.goal-step { position: relative; flex: 1 1 0; min-width: 0; min-height: 26px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--sunk, rgba(0,0,0,.14)); }
.goal-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .22; transition: width 400ms var(--ease, ease); }
.goal-step.is-done .goal-fill { opacity: .5; }
.goal-step.is-done { border-color: var(--accent); }
/* a step's name wraps to a second line rather than being cut ("Plan the search for what is missi…", Tor's review, 12 Nov) */
.goal-lab { position: relative; display: block; padding: 5px 7px; font-size: 11px; line-height: 15px; overflow-wrap: anywhere; hyphens: auto; color: var(--muted); }
.goal-step.is-done .goal-lab, .goal-step.is-working .goal-lab { color: var(--text); }
.goal-line { display: block; margin-top: 7px; color: var(--muted); }
.goal-edit { display: flex; gap: 8px; align-items: center; }
.goal-input { flex: 1 1 auto; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--sunk, transparent); color: inherit; font: inherit; }
.film-wrap { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 220px; margin: 0 16px 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0B1220; }
.film-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.film-len { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; }
.film-note { color: var(--muted); text-align: right; }
/* the player sizes its canvas from this box's height, so the box must not take its height back from the
   canvas: without a determinate height the two chase each other and every drawn frame is cleared again */
.film-area { flex: 1 1 auto; display: flex; min-height: 0; height: clamp(200px, 44vh, 620px); }
.film-area .p3d { flex: 1 1 auto; min-width: 0; }
@media (max-width: 860px) {
  .goal-bar { flex-wrap: wrap; }
  .goal-step { flex: 1 1 44%; }
  .film-bar { flex-wrap: wrap; }
  .film-note { text-align: left; width: 100%; }
  .film-area { height: clamp(220px, 44vh, 420px); }
}
@media (prefers-reduced-motion: reduce) { .goal-fill { transition: none; } }

/* ---------- what is missing, and the guesses (build step 6e) ---------- */
/* the stage is a flex column, so a panel that does not say otherwise is shrunk and its last rows are cut
   off with no scrollbar to show it happened: these two keep their own height */
/* The stage is exactly one viewport tall (body.staging .stage) and nothing clips it, so a panel that keeps
   its natural height spills over the page behind it. Both new panels are flex children that may shrink and
   scroll inside themselves, so the stage stays one screen however many of them are open. */
.gaps-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 120px; margin: 0 16px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.gaps-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
.gaps-count { color: var(--muted); font: 11px var(--mono, ui-monospace, monospace); }
.gaps-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
body.gapsopen .tree-area, body.gapsopen .tree-goal { display: none; }
body.gapsopen .gaps-wrap { min-height: 0; }
.gaps-note { color: var(--muted); }
.gaps-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 10px; padding: 12px; }
.gap, .guess { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--sunk, transparent); }
.gap.none { border-style: dashed; }
.gap-what { font-weight: 600; margin-bottom: 7px; }
.gap-k { font: 600 10px/1.4 var(--mono, ui-monospace, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }
.gap-k.warn { color: var(--warm, #D9643F); }
.gap-where, .gap-look { margin-bottom: 6px; }
.gap-res { font-weight: 600; }
.gap-via, .gap-wired, .gap-hand, .gap-settles { display: block; color: var(--muted); margin-top: 2px; }
.gap-hand { color: var(--warm, #D9643F); }
.gap-steps { margin: 4px 0 6px 18px; padding: 0; }
.gap-steps li { margin: 2px 0; }
/* what the databases answered for one gap (UniProt, the PDB, AlphaFold) */
.gap-acts { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.gap-when { color: var(--pencil); }
.gap-found { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: grid; gap: 6px; }
.found-protein, .found-st, .found-model { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.found-title { flex: 1 1 220px; }
.found-meta { color: var(--pencil); }
.found-tag { border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; color: var(--pencil); }
.found-tag.ok { color: var(--accent); border-color: var(--accent); }
.found-tag.warn { color: var(--ember); border-color: var(--ember); }
.found-link { color: var(--accent); text-decoration: none; font-variant-numeric: tabular-nums; }
.found-link:hover { text-decoration: underline; }
.found-open { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; margin-left: 10px; font-size: .92em; }
.found-note { color: var(--pencil); font-style: italic; }
.guess-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px 0; border-top: 1px solid var(--line); }
.guess-warn { color: var(--warm, #D9643F); }
.guess { border-color: var(--warm, #D9643F); }
.guess-tag { display: inline-block; margin-bottom: 6px; padding: 1px 7px; border: 1px solid var(--warm, #D9643F); border-radius: 999px; font: 600 10px/1.6 var(--mono, ui-monospace, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--warm, #D9643F); }
.guess-tests { margin: 6px 0 0; }
.guess-tests dt { font: 600 10px/1.4 var(--mono, ui-monospace, monospace); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }
.guess-tests dd { margin: 2px 0 0; }
.guess-from { display: block; margin-top: 2px; color: var(--muted); }
.guess-nosize { color: var(--muted); }
@media (max-width: 860px) { .gaps-body { grid-template-columns: 1fr; } }
/* "My lab colours", explained before any file is asked for */
.lab-help { border: 1px solid var(--glass); border-radius: var(--r); background: var(--bench); padding: 12px 14px; max-width: 560px; margin-left: auto; display: grid; gap: 6px; }
.lab-help p { margin: 0; font-size: 14px; } .lab-help .lab-h { font-weight: 600; } .lab-help .lab-n { color: var(--pencil); font-size: 13px; }
.lab-acts { display: flex; gap: 8px; margin-top: 4px; }

/* the 3D presentation in full screen: the bar with Minimise stays on screen below the scene (C3) */
:fullscreen { background: var(--bench, #0b1220); display: flex; flex-direction: column; }
.p3d.is-full { height: 100%; }
