/* Meridian, made like the homepage (landing.css): one full-bleed scene with the aurora video behind it, the homepage's
   nav across the top, homepage type (very large, thin, tight) and spaced mono labels, hairlines instead of cards,
   text links and one white pill. Tasks and files are drawers that slide over the scene. Always dark. */
body[data-product="meridian"] {
  color-scheme: dark;
  --bg: #020308; --bg-2: #05070d; --surface: #090c14; --raised: #0e121c;
  --line: rgba(200, 215, 255, .1); --line-2: rgba(200, 215, 255, .2);
  --ink: #f4f6fb; --ink-2: #aeb6c8; --ink-3: #7c869c;
  --accent: #9fb0ff; --accent-soft: rgba(130, 150, 255, .14); --accent-line: rgba(159, 176, 255, .5);
  --ok: #7fd6b0; --warn: #e6bf72; --danger: #ff8a7a; --code-bg: #04060b; --shadow: none;
  --lbl: 500 10.5px/1 var(--mono); --col: 820px; --pad: clamp(20px, 4vw, 56px);
}
html, body { height: 100%; }
body { overflow: hidden; background: var(--bg); }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 500 10px var(--mono); letter-spacing: .08em; color: var(--ink-3); }
.tasks h3, .plan-k, .plan-n, .tool-b .lbl, .drawer-h, .crumb, .tl-s, .status, .hint { font: var(--lbl); letter-spacing: .24em; text-transform: uppercase; }

/* boot + gate */
.boot { display: grid; place-content: center; gap: 14px; height: 100dvh; text-align: center; }
.boot-mark { font: 300 clamp(2rem, 5vw, 3rem)/1.1 var(--sans); letter-spacing: -.05em; }
.boot-line { width: 120px; height: 1px; margin-inline: auto; background: var(--line-2); position: relative; overflow: hidden; }
.boot-line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
.gate { display: grid; justify-items: center; align-content: center; gap: 14px; max-width: 540px; margin-inline: auto; min-height: 100dvh; padding: 32px; text-align: center; }
.gate-mark { opacity: .9; margin-bottom: 6px; }
.gate h1 { font: 300 clamp(2rem, 5vw, 3rem)/1.05 var(--sans); letter-spacing: -.045em; }
.gate p { color: var(--ink-2); line-height: 1.6; }
.gate-acts { display: flex; gap: 24px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.tl { display: inline-flex; gap: 10px; align-items: center; padding-bottom: 5px; border-bottom: 1px solid var(--ink); font-weight: 500; transition: gap var(--t), border-color var(--t); }
.tl:hover { gap: 16px; border-color: var(--accent); }
.tl.dim { color: var(--ink-2); border-color: var(--line-2); }

/* the scene */
.cp { position: relative; isolation: isolate; height: 100dvh; display: flex; }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; z-index: -2; pointer-events: none; }

/* the homepage's shade: dark on the left where the type is, open on the right; nearly black once a task is running */
.sky-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: background 600ms;
  background: linear-gradient(90deg, rgba(2, 3, 8, .72), rgba(2, 3, 8, .1) 70%), linear-gradient(rgba(2, 3, 8, .55), transparent 18%, transparent 55%, var(--bg)); }
.cp[data-empty="0"] .sky-shade { background: linear-gradient(rgba(2, 3, 8, .9), rgba(2, 3, 8, .86) 40%, rgba(2, 3, 8, .94)); }
/* letterbox bars, like the opening of the homepage */


/* top bar = the homepage nav */
.main { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 var(--pad); flex: none; background: linear-gradient(rgba(2, 3, 8, .7), transparent); }
.bar-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 17px/1 var(--sans); letter-spacing: -.02em; flex: none; }
.crumb { color: var(--ink-3); flex: none; }
.title { font: 500 14px/1.2 var(--sans); letter-spacing: -.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 46ch; }
.cp[data-empty="1"] .title { display: none; }
.status { flex: none; padding: 6px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; letter-spacing: .16em; font-size: 9.5px; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status[data-s="running"] { color: var(--accent); border-color: var(--accent-line); }
.status[data-s="running"]::before { animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 0 8px currentColor; }
.status[data-s="done"] { color: var(--ok); } .status[data-s="waiting"] { color: var(--warn); } .status[data-s="error"] { color: var(--danger); }
.bar-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.bar-links > * { white-space: nowrap; font: 500 13.5px var(--sans); color: var(--ink-2); padding: 7px 12px; border-radius: 99px; transition: color var(--t), background var(--t); }
.bar-links > *:hover, .cp[data-rail="1"] #rail-toggle, .cp[data-wsopen="1"] #ws-toggle { color: var(--ink); background: var(--accent-soft); }
.bar-links b { font: 500 10.5px var(--mono); color: var(--ink-3); margin-left: 4px; }
.pill { flex: none; height: 36px; padding: 0 18px; border-radius: 99px; background: var(--ink); color: var(--bg); font: 500 14px var(--sans); transition: box-shadow var(--t); }
.pill:hover { box-shadow: 0 0 28px -4px var(--glow); }
.icon-btn { color: var(--ink-3); } .icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* the feed */
.feed { flex: 1; overflow-y: auto; padding: 40px 0 40px; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(transparent, #000 32px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(transparent, #000 32px, #000 calc(100% - 48px), transparent); }
/* #feed outranks the items' own margin shorthands, so every item stays centred on the composer's column */
#feed > * { width: min(var(--col), 100% - 2 * var(--pad)); max-width: none; margin-left: auto; margin-right: auto; }
.cp[data-empty="1"] .feed { display: none; }
.cp[data-empty="0"] .hero { display: none; }

/* empty state = the homepage hero: type low on the left, steps under it */
.hero { flex: 1; display: flex; align-items: flex-end; overflow: hidden auto; padding: 24px var(--pad) clamp(20px, 4vh, 44px); }
.hero-in { width: 100%; max-width: 760px; margin-inline: auto; }
.hero h2 { font: 300 clamp(1.9rem, 3.4vw, 2.8rem)/1.08 var(--sans); letter-spacing: -.04em; text-wrap: balance; }
.starters { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 18px; }
.starters li { max-width: 100%; }
.starter { max-width: 100%; padding: 5px 0; text-align: left; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--t); }
.starter:hover, .starter:focus-visible { color: var(--ink); }

/* feed items */
.msg-user { margin: 0 0 28px; }
.msg-user > div { font: 300 clamp(1.45rem, 2.4vw, 2.1rem)/1.15 var(--sans); letter-spacing: -.04em; color: var(--ink); white-space: pre-wrap; word-wrap: break-word; max-height: 40vh; overflow: auto; }
.msg-user + * { border-top: 1px solid var(--line); padding-top: 24px; }
.prose { font-size: 15.5px; line-height: 1.72; color: var(--ink-2); margin: 4px 0 20px; overflow-wrap: break-word; }
.prose strong, .prose b { color: var(--ink); font-weight: 500; }
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p, .prose h3 + p, .prose .tbl, .prose pre, .prose blockquote { margin-top: 14px; }
.prose h3 { font: 400 1.25rem/1.2 var(--sans); letter-spacing: -.03em; color: var(--ink); margin-top: 28px; }
.prose ul, .prose ol { padding-left: 20px; display: grid; gap: 6px; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li::marker { color: var(--ink-3); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 4px; transition: color var(--t); }
.prose a:hover { color: var(--accent); }
.prose code { font: 13px var(--mono); color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; }
.prose pre { background: var(--code-bg); border: 1px solid var(--line-2); border-radius: 4px; padding: 14px 16px; overflow-x: auto; color: #dfe5f3; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 12.5px; }
.prose blockquote { border-left: 1px solid var(--line-2); padding-left: 14px; color: var(--ink-3); }
.tbl { overflow-x: auto; border-top: 1px solid var(--line-2); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tbl th, .tbl td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font: var(--lbl); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.tbl td { color: var(--ink-2); }

.think { margin: 2px 0 12px; color: var(--ink-3); font-size: 13px; }
.think summary { cursor: pointer; list-style: none; display: inline-flex; gap: 10px; align-items: center; user-select: none; font: var(--lbl); letter-spacing: .2em; text-transform: uppercase; }
.think summary::-webkit-details-marker { display: none; }
.think summary::before { content: ""; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); transition: transform var(--t); }
.think[open] summary::before { transform: rotate(45deg); }
.think div { margin: 10px 0 4px 2px; padding-left: 14px; border-left: 1px solid var(--line-2); white-space: pre-wrap; line-height: 1.65; }
.think.live summary span { background: linear-gradient(90deg, var(--ink-3) 30%, var(--ink) 50%, var(--ink-3) 70%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.2s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* tool calls: hairline rows, like the homepage's Sources list */
.tools { display: grid; gap: 0; margin: 6px 0 20px; border-bottom: 1px solid var(--line); }
.tool { border-top: 1px solid var(--line); }
.tool > summary { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 0; cursor: pointer; list-style: none; font-size: 13.5px; }
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary svg { width: 15px; height: 15px; color: var(--ink-3); }
.tool > summary:hover .tl-t { color: var(--ink); }
.tool .tl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); transition: color var(--t); }
.tool .tl-t b { color: var(--ink); font-weight: 500; }
.tl-s { color: var(--ink-3); letter-spacing: .16em; font-size: 9.5px; }
.tool[data-s="running"] .tl-s { color: var(--accent); }
.tool[data-s="error"] .tl-s { color: var(--danger); }
.tool[data-s="ok"] .tl-s { color: var(--ok); }
.tool[data-s="running"] > summary svg { color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.tool-b { padding: 2px 0 16px 30px; font-size: 13px; color: var(--ink-2); display: grid; gap: 10px; max-height: 380px; overflow: auto; }
.tool-b pre { margin: 0; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--code-bg); color: #dfe5f3; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; }
.tool-b pre.err { color: #ffb4a8; }
.tool-b .lbl { color: var(--ink-3); }
.res { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
.res:first-child { border-top: 0; }
.res a { color: var(--ink); font-weight: 500; }
.res a:hover { color: var(--accent); }
.res small { color: var(--ink-3); font: 11px var(--mono); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; color: var(--accent); font: 500 12px var(--mono); }
.file-chip svg { width: 13px; height: 13px; }
.tool-b pre.out { max-height: 240px; overflow: auto; }

/* figures a run drew: always in view under the run, and inline wherever an answer or a report names them */
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; padding: 4px 0 16px 30px; }
.fig { display: grid; gap: 6px; text-align: left; padding: 0; border-radius: 6px; cursor: zoom-in; }
.fig img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; border: 1px solid var(--line); transition: border-color var(--t); }
.fig:hover img { border-color: var(--accent-line); }
.fig span { color: var(--ink-3); font: 11px var(--mono); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fig.inline { display: grid; margin: 14px 0; max-width: 640px; }
.img-view { margin: 0; display: grid; gap: 8px; }
.img-view img { display: block; max-width: 100%; height: auto; border-radius: 6px; background: #fff; }
.img-view figcaption { color: var(--ink-3); font: 11px var(--mono); }

/* Meridian for desktop: the task's folder, beside the title */
.folder { display: inline-flex; align-items: center; flex: none; min-width: 0; border: 1px solid var(--line-2); border-radius: 99px; }
.folder[hidden] { display: none; }
.folder-pick { display: inline-flex; gap: 7px; align-items: center; height: 28px; padding: 0 6px 0 11px; color: var(--ink-2); font: 500 12px var(--mono); max-width: 26ch; }
.folder-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-pick svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; }
.folder-pick:hover:not(:disabled) { color: var(--ink); }
.folder-show { height: 28px; padding: 0 10px 0 4px; color: var(--ink-3); }
.folder-show:hover { color: var(--accent); }
.desk-only { display: none; }
.desktop .desk-only { display: inline; }

.note { margin: 8px 0 20px; padding: 12px 0; border-radius: 0; font-size: 13.5px; border: 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); color: var(--ink-2); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: none; }
.note.err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--ink); }
.note button { color: var(--ink); font-weight: 500; font-size: 13.5px; padding-bottom: 4px; border-bottom: 1px solid var(--ink); }
.note button:hover { border-color: var(--accent); }
.caret::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.working { display: flex; gap: 12px; align-items: center; color: var(--ink-3); margin: 6px 0 18px; font: var(--lbl); letter-spacing: .24em; text-transform: uppercase; }
.working i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.2s ease-in-out infinite; }

/* modes: one switch in the composer, a tag in the header and on each task */
.modes { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 99px; flex: none; }
.modes button { position: relative; height: 26px; padding: 0 12px; border-radius: 99px; font: 500 12.5px var(--sans); color: var(--ink-3); transition: color var(--t), background var(--t); }
.modes button:hover:not(:disabled) { color: var(--ink); }
.modes button[aria-checked="true"] { color: var(--bg); background: var(--ink); }
.modes button:disabled:not([aria-checked="true"]) { opacity: .35; cursor: not-allowed; }
.modes button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.mode-tag, .tmode { font: 500 9.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.mode-tag { display: none; }
.mode-tag[data-m="agent"], .tmode[data-m="agent"] { color: var(--accent); }
.tmode { justify-self: end; letter-spacing: .12em; font-size: 9px; }
/* chat reads as a conversation: a tighter column and smaller prompts */
.cp[data-mode="chat"] { --col: 760px; }
.cp[data-mode="chat"] .msg-user > div { font: 400 clamp(1.1rem, 1.6vw, 1.3rem)/1.4 var(--sans); letter-spacing: -.015em; }
.cp[data-mode="chat"] .msg-user + * { border-top: 0; padding-top: 4px; }
.cp[data-mode="chat"] .msg-user { margin-bottom: 14px; padding-top: 18px; }
.cp[data-mode="chat"] .msg-user:not(:first-child) { border-top: 1px solid var(--line); margin-top: 10px; }

/* sources a research or chat answer relied on */
.srcs { border-top: 1px solid var(--line); padding-top: 10px; }
.srcs summary { cursor: pointer; list-style: none; font: 500 10.5px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.srcs summary::-webkit-details-marker { display: none; }
.srcs summary:hover { color: var(--ink); }
.srcs ol { list-style: decimal; padding-left: 22px; display: grid; gap: 7px; margin-top: 10px; font-size: 13.5px; }
.srcs li::marker { color: var(--ink-3); font: 11px var(--mono); }
.srcs a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.srcs a:hover { text-decoration-color: var(--accent); }
.srcs small { margin-left: 10px; color: var(--ink-3); font: 11px var(--mono); }

/* end of a run: what it did, and the files it left */
.run-end { margin: 4px 0 26px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.run-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font: 500 11px var(--mono); letter-spacing: .06em; color: var(--ink-3); }
.run-word { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); letter-spacing: .18em; text-transform: uppercase; font-size: 10.5px; }
.run-word::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.run-end[data-s="done"] .run-word { color: var(--ok); } .run-end[data-s="waiting"] .run-word { color: var(--warn); } .run-end[data-s="error"] .run-word { color: var(--danger); }
.run-copy { margin-left: auto; color: var(--ink-3); font: inherit; transition: color var(--t); }
.run-copy:hover { color: var(--ink); }
.delivs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.deliv { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 3px 10px; align-items: center; padding: 12px 14px; text-align: left; border: 1px solid var(--line-2); border-radius: 6px; background: rgba(9, 12, 20, .6); transition: border-color var(--t), background var(--t), transform var(--t); }
.deliv:hover { border-color: var(--accent-line); background: rgba(14, 18, 28, .85); transform: translateY(-1px); }
.deliv svg { width: 15px; height: 15px; color: var(--accent); grid-row: span 2; align-self: start; margin-top: 2px; }
.deliv-n { font: 500 13px var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deliv small { color: var(--ink-3); font-size: 11.5px; }
.deliv.more { display: grid; place-items: center; grid-template-columns: 1fr; color: var(--ink-2); font: 500 12.5px var(--sans); border-style: dashed; }
.run-acts { display: flex; gap: 22px; flex-wrap: wrap; }
.run-acts button { font: 500 13px var(--sans); color: var(--ink); padding-bottom: 4px; border-bottom: 1px solid var(--ink); transition: border-color var(--t); }
.run-acts button + button { color: var(--ink-2); border-color: var(--line-2); }
.run-acts button:hover { border-color: var(--accent); }

/* composer */
.composer { position: relative; z-index: 1; flex: none; padding: 0 var(--pad) clamp(20px, 3vh, 28px); }
.composer > * { width: min(var(--col), 100%); margin-inline: auto; }
.cp[data-empty="1"] .composer { padding-bottom: clamp(16px, 4vh, 40px); }
.cp[data-empty="1"] .composer > * { width: min(760px, 100%); }
.plan { margin-bottom: 10px; font-size: 13px; }
.plan-h { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 10px 0 11px; text-align: left; color: var(--ink-3); }
.plan-h:hover .plan-now { color: var(--ink); }
.plan-now { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--t); }
.plan-n { color: var(--ink-3); }
.plan-bar { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-2); }
.plan-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--plan-pct, 0%); background: var(--aurora, var(--accent)); transition: width 500ms; }
.plan[data-collapsed="0"] ol { padding-bottom: 10px; }
.plan ol { display: grid; }
.plan[data-collapsed="1"] ol { display: none; }
.plan li { position: relative; display: grid; grid-template-columns: 7px 1fr; gap: 12px; align-items: center; min-height: 26px; color: var(--ink-3); }
.plan li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); z-index: 1; }
.plan li:not(:last-child)::after { content: ""; position: absolute; left: 3px; top: 18px; width: 1px; height: 16px; background: var(--line-2); }
.plan li[data-s="active"] { color: var(--ink); }
.plan li[data-s="active"]::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.4s infinite; }
.plan li[data-s="done"] { color: var(--ink-2); }
.plan li[data-s="done"]::before { background: var(--ink-2); border-color: var(--ink-2); }
.box { border: 1px solid var(--line-2); border-radius: 4px; background: rgba(5, 7, 13, .62); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 0 140px -60px rgba(120, 140, 255, .35); transition: border-color var(--t); }
.box:focus-within { border-color: var(--accent-line); }
.box textarea { display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent; padding: 18px 20px 6px; font-size: 16px; line-height: 1.55; max-height: 40vh; }
.box textarea::placeholder { color: var(--ink-3); }
.box-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px 20px; }
.hint { color: var(--ink-3); margin-right: auto; letter-spacing: .16em; font-size: 9.5px; }
.go, .stop { margin-left: auto; }
.go { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 99px; display: grid; place-items: center; background: var(--ink); color: var(--bg); transition: opacity var(--t), box-shadow var(--t); }
.go:not(:disabled):hover { box-shadow: 0 0 28px -4px var(--glow); }
.go:disabled { opacity: .25; cursor: default; }
.go svg { width: 16px; height: 16px; stroke-width: 2; }
.stop { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; }
.stop:hover { border-color: var(--danger); }
.stop i { width: 8px; height: 8px; border-radius: 1px; background: currentColor; }

/* drawers: tasks from the left, files from the right, over the scene */
.rail, .ws { position: fixed; top: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; min-height: 0; background: rgba(5, 7, 13, .86); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); transition: transform 320ms cubic-bezier(.2, .7, .2, 1), visibility 320ms; visibility: hidden; }
.rail { left: 0; width: min(340px, 88vw); border-right: 1px solid var(--line-2); transform: translateX(-102%); }
.ws { right: 0; width: min(480px, 94vw); border-left: 1px solid var(--line-2); transform: translateX(102%); overflow: hidden; }
.cp[data-rail="1"] .rail, .cp[data-wsopen="1"] .ws { transform: none; visibility: visible; }
.scrim { display: none; }
.cp[data-rail="1"] .scrim, .cp[data-wsopen="1"] .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 6, .45); }
.drawer-h { color: var(--ink-3); margin-right: auto; }
.rail-top, .ws-h { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 20px 0 24px; border-bottom: 1px solid var(--line); flex: none; }
.new { display: inline-flex; align-items: center; gap: 12px; margin: 20px 24px 8px; padding: 0 0 8px; border-bottom: 1px solid var(--ink); font: 500 14px var(--sans); letter-spacing: .02em; align-self: flex-start; transition: gap var(--t), border-color var(--t); }
.new:hover { gap: 18px; border-color: var(--accent); }
.new svg { width: 14px; height: 14px; }
.tasks { flex: 1; overflow-y: auto; padding: 0 16px 12px; display: grid; align-content: start; }
.tasks h3 { color: var(--ink-3); padding: 20px 8px 10px; }
.task-link { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 8px; color: var(--ink-3); font-size: 14px; text-align: left; width: 100%; border-top: 1px solid var(--line); transition: color var(--t); }
.task-link:hover, .task-link[aria-current="true"] { color: var(--ink); }
.task-link[aria-current="true"] span { font-weight: 500; }
.task-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); justify-self: center; }
.sdot[data-s="running"] { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.sdot[data-s="done"] { background: var(--ink-2); border-color: var(--ink-2); }
.sdot[data-s="waiting"] { background: var(--warn); border-color: var(--warn); }
.sdot[data-s="error"] { background: var(--danger); border-color: var(--danger); }
@keyframes pulse { 50% { opacity: .45; } }
.rail-foot { border-top: 1px solid var(--line); padding: 16px 24px 20px; display: grid; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.meter-row { display: flex; justify-content: space-between; margin-bottom: 8px; font: var(--lbl); letter-spacing: .2em; text-transform: uppercase; }
.meter-bar { height: 1px; background: var(--line-2); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: var(--aurora); transition: width 600ms; }
.model { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font: 500 11.5px var(--mono); letter-spacing: .04em; }
.model .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); }
.rail-links { display: flex; gap: 16px; flex-wrap: wrap; }
.rail-links a, .rail-links button { color: var(--ink-3); font-size: 12.5px; transition: color var(--t); }
.rail-links a:hover, .rail-links button:hover { color: var(--ink); }
.ws-acts { display: flex; gap: 14px; align-items: center; }
.ws-acts > button:not(.icon-btn) { font: 500 12.5px var(--sans); padding: 0 0 4px; border-bottom: 1px solid var(--ink); color: var(--ink); transition: border-color var(--t); }
.ws-acts > button:not(.icon-btn):hover { border-color: var(--accent); }
.ws-acts > button:disabled { opacity: .35; cursor: default; border-color: var(--line-2); }
.files { padding: 8px 24px; display: grid; max-height: 38%; overflow-y: auto; flex: none; }
.files button { width: 100%; display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); text-align: left; font: 12.5px var(--mono); color: var(--ink-2); transition: color var(--t); }
.files li:first-child button { border-top: 0; }
.files button:hover, .files button[aria-current="true"] { color: var(--ink); }
.files button[aria-current="true"] svg { color: var(--accent); }
.files button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files button small { color: var(--ink-3); font-size: 10.5px; letter-spacing: .06em; }
.files svg { width: 14px; height: 14px; color: var(--ink-3); }
.files .fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { color: var(--accent); } }
.ws-empty { padding: 32px 24px; color: var(--ink-3); font-size: 13px; line-height: 1.65; }
.viewer { flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.viewer-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.viewer-name { font: 500 12px var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-acts { display: flex; gap: 2px; flex: none; }
.viewer-acts button { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 5px 8px; border-radius: 99px; color: var(--ink-3); transition: color var(--t), background var(--t); }
.viewer-acts button:hover { color: var(--ink); background: var(--accent-soft); }
.viewer-b { flex: 1; overflow: auto; padding: 18px 20px 28px; }
.viewer-b > pre { margin: 0; font: 12px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.viewer-b .prose { font-size: 14px; margin: 0; }
.runner { position: absolute; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

/* wide screens: once a task has files they stay docked beside it (the toggle folds them away) */
@media (min-width: 1200px) {
  .cp[data-dock="1"] .ws { position: relative; z-index: 4; transform: none; visibility: visible; width: clamp(340px, 30vw, 460px); flex: none; background: rgba(5, 7, 13, .78); transition: none; }
  .cp[data-dock="1"] .scrim { display: none; }
  .cp[data-dock="1"] #ws-toggle { color: var(--ink); background: var(--accent-soft); }
  .cp[data-dock="1"] .files { max-height: 34%; }
  .cp[data-dock="1"] .run-acts [data-ws], .cp[data-dock="1"] .deliv.more { display: none; }
}

/* invites dialog */
.inv-form { display: flex; gap: 8px; }
.inv-form input { flex: 1; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); }
.inv-form button { padding: 0 16px; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 500; }
.inv-list { display: grid; gap: 0; margin-top: 14px; max-height: 320px; overflow-y: auto; }
.inv-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.inv-list button { color: var(--danger); font-size: 12.5px; }


@media (max-width: 980px) {
  .title { display: none; }
}
@media (max-width: 640px) {
  .bar { gap: 8px; height: 56px; }
  .crumb, .hide-sm, .hint, .status, .mode-tag { display: none; }
  .modes button { padding: 0 10px; }
  .run-meta { gap: 6px 14px; }
  .delivs { grid-template-columns: minmax(0, 1fr); }
  .bar-links > * { padding: 7px 9px; }
  .pill { height: 32px; padding: 0 14px; font-size: 13px; }
  #feed > * { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html.lite .box, html.lite .rail, html.lite .ws { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--bg-2); }

/* less on screen: the sky only behind the empty state, and quieter there; no mode switch while a run is going */
.cp[data-empty="1"] .sky-shade { background: linear-gradient(rgba(2, 3, 8, .62), rgba(2, 3, 8, .5) 50%, var(--bg)); }
.cp[data-empty="0"] .sky, .cp[data-empty="0"] .sky-shade { opacity: 0; }
.cp[data-empty="0"] { background: var(--bg); }
.cp[data-busy="1"] .modes { display: none; }
