/* Apps: one frame for everything the OS runs — his web apps and real programs alike. */
.appwrap { flex: 1; min-height: 0; padding: 12px; display: flex; }
.app { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--ground); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.app.agent { border-color: var(--run); box-shadow: inset 0 3px 0 var(--run); }
.app-h { flex: none; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.app-h > svg.ic { color: var(--ink-2); }
.app-h h1 { font: 700 18px/24px var(--cond); }
.app-h .o { font: var(--meta); color: var(--ink-3); }
.app-h .who { margin-left: auto; display: flex; align-items: center; gap: 9px; font: 700 14.5px/20px var(--sans); }
.app-h .who span { font-weight: 400; color: var(--ink-2); }
.app-h .ctl { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.app-h .who[hidden] + .ctl { margin-left: auto; }      /* no "You have the controls" on an app that only watches: the controls still sit at the end */
.app-h .ctl button { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-2); }
/* A narrow app window (the 528 px side at 1366) never pushes its controls out: the icon, the name, 'You have the
   controls' and the controls keep their size; 'Your app · runs on the Mini' gives way first, then the status line
   (with an ellipsis; the whole line is its title) */
.app-h > svg.ic, .app-h h1, .app-h .who, .app-h .ctl { flex: none; }
.app-h .o { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-b { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.app-f { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--rule); background: var(--panel); }
.app-f .x { min-width: 0; flex: 1; }
.app-f .x b { display: block; font: var(--lead); }
.app-f .x span { display: block; font: var(--meta); color: var(--ink-3); margin-top: 2px; }
.app-f .btn { height: 40px; }

/* collapsed conversation: the rail and Now stay */
.main.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.mini { display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--rule); min-height: 0; position: relative; }
.mini .ex { width: 44px; height: 44px; margin-top: 10px; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--r); }
.mini .r { flex: 1; width: 2px; background: var(--rule-2); margin-top: 12px; position: relative; }
.mini .r i { position: absolute; left: 2px; width: 9px; height: 2px; background: var(--rule-2); }
.mini .r i.y { left: -4px; width: 10px; height: 10px; background: var(--ink); }
.mini .r i.c { left: -4px; width: 10px; height: 10px; background: var(--ground); border: 2px solid var(--ink); }
.mini .nw { width: 100%; background: var(--panel); border-top: 1px solid var(--rule); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 14px; }
.mini .nw .lamp { width: 12px; height: 12px; margin-top: -1px; }
.mini .nw b { font: 700 13px/16px var(--sans); }
.mini .nw span { font: var(--meta); color: var(--ink-2); text-align: center; }
.mini .nw .btn { width: 52px; height: 44px; padding: 0; margin-top: 2px; }
.mini .nw .need { width: 52px; height: 28px; background: var(--hold); color: var(--on-hold); border-radius: var(--r); font: 700 14px/28px var(--sans); text-align: center; }

/* trading (a web app of his) */
.trd { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; border-bottom: 1px solid var(--rule); }
.kpis > div { padding: 14px 20px 14px; border-right: 1px solid var(--rule); }
.kpis > div:last-child { border-right: 0; }
.kpis span { font: var(--meta); color: var(--ink-3); display: block; }
.kpis b { font: 700 30px/36px var(--cond); font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.kpis b small { font: 600 15px/20px var(--cond); color: var(--ink-2); margin-left: 6px; }
.kpis em { font: 500 13.5px/16px var(--sans); font-style: normal; color: var(--ink-2); display: flex; gap: 7px; align-items: center; margin-top: 4px; }
.chart { position: relative; min-height: 0; border-bottom: 1px solid var(--rule); background: var(--well); }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart .t { position: absolute; left: 20px; top: 14px; font: 700 15px/20px var(--cond); }
.chart .t span { font: var(--meta); color: var(--ink-3); margin-left: 10px; }
.chart .ax { position: absolute; right: 12px; font: var(--meta); color: var(--ink-3); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.pos { width: 100%; border-collapse: collapse; }
.pos th, .pos td { height: 40px; padding: 0 20px; text-align: right; border-bottom: 1px solid var(--rule); font: 400 15px/20px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.pos th { height: 30px; font: var(--meta); color: var(--ink-3); }
.pos td:first-child, .pos th:first-child { text-align: left; }
.pos td b { font: 700 15px/20px var(--cond); color: var(--ink); }
.pos td.n { color: var(--ink); font-weight: 600; }
.pos tr.flat td, .pos tr.flat td b { color: var(--ink-3); font-weight: 400; }
.trd-f { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; font: var(--do); color: var(--ink-3); }
.trd-f p { margin-right: auto; }
.trd-f .btn { height: 40px; }

/* (prototype-only spreadsheet mock removed: real programs arrive as apps) */
/* launcher: one list for everything */
.launch { position: absolute; top: 44px; right: 12px; width: 600px; max-height: calc(100% - 56px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--rule-2); border-radius: var(--r); z-index: 5; overflow: hidden; }
.launch .q { flex: none; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--rule); font: 500 18px/24px var(--sans); }
.launch .q svg.ic { color: var(--ink-2); }
.launch .q .caret { width: 2px; height: 22px; background: var(--ink); margin-left: -10px; }
.launch .q span { color: var(--ink-3); }
.launch .q kbd { margin-left: auto; }
.launch h3 { font: 700 12.5px/16px var(--sans); color: var(--ink-3); padding: 12px 16px 4px; }
.lr { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; width: 100%; height: 44px; padding: 0 16px 0 13px; border-left: 3px solid transparent; }
.lr svg.ic { color: var(--ink-2); }
.lr .n { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; }
.lr .n b { font: 700 16px/20px var(--cond); }
.lr .n span { font: 400 14px/20px var(--sans); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.lr .w { font: var(--meta); color: var(--ink-3); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.lr .w.act { color: var(--ink); font-weight: 600; }
.lr.on { background: var(--panel-2); border-left-color: var(--ink); }
.launch .ft { flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 44px; margin-top: 8px; border-top: 1px solid var(--rule); font: var(--meta); color: var(--ink-3); white-space: nowrap; }
.launch .ft span { display: flex; gap: 6px; align-items: center; }
.launch .ft .ask { margin-left: auto; color: var(--ink-2); }
.side { position: relative; }

@media (max-height: 820px) and (min-width: 700px) { .lr { height: 36px; } .launch h3 { padding-top: 8px; } .kpis b { font-size: 24px; line-height: 28px; } .kpis > div { padding: 8px 20px; } .pos td { height: 34px; } }

/* phone: one app at a time, Now strip stays */
.phone .papp { display: flex; flex-direction: column; min-height: 0; }
.phone .papp .st { flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-bottom: 1px solid var(--rule); font: 700 15px/20px var(--sans); }
.phone .papp .st span { font-weight: 400; color: var(--ink-2); }
.phone .papp .app-b { flex: 1; }
.phone .kpis { grid-template-columns: 1fr 1fr; }
.phone .kpis > div { padding: 12px 16px; }
.phone .kpis > div:nth-child(2) { border-right: 0; }
.phone .kpis > div:nth-child(n+3) { display: none; }
.phone .kpis b { font-size: 24px; line-height: 32px; white-space: nowrap; }
.phone .kpis b small { font-size: 13px; margin-left: 4px; }
.phone .kpis em { display: none; }
.phone .pos th, .phone .pos td { padding: 0 16px; height: 44px; font-size: 16px; }
.phone .pos .hidep { display: none; }
.phone .trd-f { padding: 12px 16px; }
.phone .trd-f p { display: none; }
.phone .trd-f .btn { flex: 1; height: 48px; }
.phone .pnow { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 12px 12px 34px 16px; background: var(--panel); border-top: 1px solid var(--rule); }
.phone .pnow .a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.phone .pnow .a .lamp { width: 12px; height: 12px; }
.phone .pnow .a b { display: block; font: 700 17px/24px var(--sans); white-space: nowrap; }
.phone .pnow .a .meta { display: block; }
.phone .pnow .back { grid-column: 1 / 3; height: 48px; width: 100%; }

/* ════ Step 1 shell additions (side-apps). Above this line: byte copy of the prototype's apps.css. ════ */
.lamp.idle { background: var(--clear); }
button[disabled] { cursor: default; }

/* Now strip */
.now-2.nob { margin-top: 6px; }
.now-2 .cnt.na { color: var(--ink-2); font-weight: 500; }

/* side body: one core pane or one app */
.side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.sb-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* The Open box gives way when an app adds its tab: it narrows, then drops its keycap, then its word — never runs
   off the edge (it was cut at 1366 with an app open). With room it keeps the look's own width. */
.tabs .find { flex: 0 1 auto; min-width: 44px; overflow: hidden; container-type: inline-size; }
.tabs .find > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 150px) { .tabs .find kbd { display: none; } }
@container (max-width: 84px) { .tabs .find > span { display: none; } }
.tab:focus-visible, .tabs .find:focus-visible, .cl-i:focus-visible, .strip:focus-visible, .lr:focus-visible, .follow:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.watch > .rp { max-height: 48vh; }
.watch.one { grid-template-rows: minmax(0, 1fr); }

/* changes */
.cl { overflow-y: auto; }
.code { overflow: auto; }
.code div > span { overflow: hidden; text-overflow: ellipsis; }
.dt-top div .w { color: var(--ink-3); }
.diff .more { font: var(--meta); color: var(--ink-3); padding-left: 14px; margin-top: 2px; white-space: normal; }
.chg-f { align-items: center; gap: 14px; }
.chg-f .btn { flex: none; padding: 0 16px; }
.chg-n { font: var(--do); color: var(--ink-3); }
.follow { display: flex; align-items: center; gap: 7px; font: var(--meta); color: var(--ink-2); }
.ch-empty { padding: 20px; }
.ch-empty p:first-child { font: 600 17px/24px var(--sans); color: var(--ink); }
.ch-empty .meta { color: var(--ink-2); margin-top: 6px; }

/* running pane + board */
.rp-empty { padding: 14px 16px; font: var(--do); color: var(--ink-2); }
.strips.dn.top { padding-top: 12px; margin-top: 0; }
.board .rows { overflow-y: auto; }
.rw b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf p { max-width: 46em; }

/* the question card */
#askSlot { flex: none; }
.ask-d { white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-raw { background: var(--well); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 14px; margin: 8px 0 4px; font: var(--code); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.ask-hint.why { color: var(--ink-2); font-weight: 600; }
.ask-hint.tp { display: none; }
.choice:hover:not([disabled]) { background: var(--panel-2); }
.choice:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.choice[disabled] { color: var(--ink-3); }
.choice[disabled] > i { border-color: var(--rule); }
.ev.numq > .tk::after { display: none; }
.ev.numq .ask-l { color: var(--ink-2); }
.ev.numq .choices { margin-top: 2px; }

/* app frame */
.app-b > iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--ground); }
.app-h .ctl button:hover { color: var(--ink); }
.side.full { position: fixed; top: 36px; left: 0; right: 0; bottom: 0; z-index: 20; }
.side.full .app-h .ctl .full { color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); border-radius: var(--r); }
.sh-h, .sh-f { display: none; }

/* launcher: a fixed overlay under the tab strip */
#launcher[hidden] { display: none; }
.launch-bg { position: fixed; inset: 0; z-index: 40; }
#launcher .launch { position: fixed; top: 80px; right: 12px; max-height: calc(100vh - 92px); z-index: 41; }
.launch .q input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--ink); font: 500 18px/24px var(--sans); -webkit-appearance: none; appearance: none; }
.launch .q input::placeholder { color: var(--ink-3); }
.launch .q input::-webkit-search-cancel-button { display: none; }
.launch .lbody { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 4px; }
.launch .lempty { padding: 16px; font: var(--do); color: var(--ink-2); }
.launch .ft { margin-top: 0; }
.launch .lback { width: 44px; height: 44px; margin-left: -12px; display: grid; place-items: center; color: var(--ink); }

/* phone: the side region is a full-screen sheet */
.phone #side { position: fixed; inset: 0; z-index: 30; display: none; background: var(--well); padding-top: env(safe-area-inset-top); }
.phone #side.sheet-open { display: flex; }
.phone .sh-h { display: flex; flex: none; align-items: center; gap: 10px; height: 52px; padding: 0 4px; background: var(--well); border-bottom: 1px solid var(--rule); }
.phone .sh-h .ob { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); }
.phone .sh-h .x { font: 700 19px/24px var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone .sh-h .sp { flex: 1; }
.phone .sh-f { display: grid; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.phone .sh-f .btn.stop { height: 48px; }
.phone .tabs { padding: 0 4px; height: 48px; }
.phone .tab { padding: 0 12px; font-size: 16px; }
.phone .tabs .find, .phone .tabs .tsep { display: none; }
.phone #side.is-app .tabs { display: none; }
.phone .appwrap { padding: 0; }
.phone .app { border: 0; border-radius: 0; }
.phone .app-h { display: none; }
.phone .sb-pane { overflow-y: auto; }
.phone .watch { display: flex; flex-direction: column; gap: 12px; flex: none; }
.phone .watch > .chp { flex: none; min-height: 62vh; }
.phone .watch.one > .chp { min-height: 0; flex: 1; }
.phone .watch > .rp { max-height: none; flex: none; }
.phone .md { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.phone .cl { max-height: 32vh; border-right: 0; border-bottom: 1px solid var(--rule); }
.phone .cl-i { min-height: 44px; }
.phone .dt-top h2 { font-size: 20px; line-height: 26px; }
.phone .pane-h .m { display: none; }
.phone .strips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone .strip.done { height: 44px; padding: 12px 10px; }
.phone .needs { flex-wrap: wrap; padding: 10px 12px; }
.phone .needs .btn { height: 44px; }
.phone .board { margin: 12px; }
.phone .sum { grid-template-columns: repeat(3, 1fr); }
.phone .sum > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--rule); }
.phone .rw { grid-template-columns: 16px minmax(0, 1fr) 56px; height: 44px; padding-right: 12px; }
.phone .rw .w, .phone .rw .x { display: none; }
.phone .rw.hold { grid-template-columns: 16px minmax(0, 1fr) auto; }
.phone .rw.hold .w { display: block; grid-column: 2 / 4; }
.phone .rw.hold .x { display: flex; grid-column: 2 / 4; padding: 6px 0 0; }
.phone .bf { height: auto; padding: 12px 16px; }
.phone .ask-hint.kb { display: none; }
.phone .ask-hint.tp { display: flex; }
.phone .choice { min-height: 56px; }
.phone .now kbd { display: none; }
.phone #launcher .launch { inset: 0; top: 0; right: 0; width: auto; max-height: none; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
.phone .launch .q { height: 56px; padding: 0 12px; }
.phone .launch .q input { font-size: 17px; }
.phone .launch .ft { display: none; }
.phone .lr { height: 52px; }
.phone .lr .n { flex-direction: column; align-items: flex-start; gap: 0; }
.phone .lr .n span { font-size: 13px; line-height: 16px; }
.chg-m b, .dt-top div b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg-m .meta, .dt-top div .n { flex: none; white-space: nowrap; }
.bf { height: auto; min-height: 56px; padding-top: 10px; padding-bottom: 10px; }
.phone .gh { grid-template-columns: minmax(0, 1fr) 56px; padding-right: 12px; column-gap: 12px; }

/* agents by liveness: working (colour) · quiet (hollow, no amber) · stopped or lost · finished (collapsed) */
.bus i.q[data-who] { background: none; border: 1.5px solid var(--who); height: 10px; }
[data-k] .strip.quiet:not(.done), .strip.quiet { background: var(--panel); border-left-style: dashed; }
.strip .b.quiet, .rw .w.quiet { color: var(--ink-2); font-style: normal; }
.rw .w.lost { color: var(--ink-3); }
.rp-lines { display: flex; flex-direction: column; padding: 0 12px 12px; gap: 4px; }
.strips + .rp-lines { margin-top: -4px; }
.needs + .rp-lines, .pane-h + .rp-lines { padding-top: 12px; }
.rp-line { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 2px; font: 500 14px/20px var(--sans); color: var(--ink); }
.rp-line .go { margin-left: auto; color: var(--ink-3); font-size: 18px; }
.rp-line.fin, .rp-line.lost { color: var(--ink-2); }
.rp-line:hover { background: var(--panel); }
.rp-line:focus-visible, .gh.tg:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.gh.tg { width: 100%; grid-template-columns: minmax(0, 1fr); text-align: left; cursor: pointer; }
.gh.tg.fin { color: var(--ink-2); font-weight: 600; }
.rw.sub b { padding-left: 12px; font-weight: 600; }
.phone .sum { grid-template-columns: repeat(2, 1fr); }
.phone .sum > div:nth-child(2) { border-right: 0; }
.phone .sum > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
.phone .rp-line { min-height: 44px; }
.phone .gh.tg { height: 44px; }
.sum.c1 { grid-template-columns: minmax(0, 1fr) 2fr; }
.sum.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)) 1.6fr; }
.sum.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)) 1.5fr; }
.sum.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)) 1.5fr; }
.sum small.sub { display: block; font: var(--meta); color: var(--ink-2); margin-top: 4px; }
.fin-sec { margin-top: 14px; border-top: 1px solid var(--rule-2); }
.fin-f { padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--rule); }
.fin-q { width: 100%; max-width: 360px; height: 36px; padding: 0 10px; background: var(--well); border: 1px solid var(--rule-2); border-radius: var(--r); color: var(--ink); font: 400 15px/20px var(--sans); }
.fin-q::placeholder { color: var(--ink-3); }
.fin-q:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.phone .sum.c1, .phone .sum.c2, .phone .sum.c3, .phone .sum.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone .fin-q { height: 44px; font-size: 16px; max-width: none; }
.phone .rw[data-state="done"], .phone .rw[data-state="quiet"], .phone .rw[data-state="lost"] { height: auto; min-height: 52px; padding-top: 6px; padding-bottom: 6px; grid-template-rows: auto auto; row-gap: 0; }
.phone .rw[data-state="done"] .w, .phone .rw[data-state="quiet"] .w, .phone .rw[data-state="lost"] .w { display: block; grid-column: 2 / 4; grid-row: 2; font-size: 14px; line-height: 20px; white-space: normal; }
.phone .rw[data-state="done"] .lamp, .phone .rw[data-state="quiet"] .lamp, .phone .rw[data-state="lost"] .lamp { grid-row: 1; }
/* agent rows: tap to read; last line inline; dismiss */
.rw.tap { cursor: pointer; }
.rw.tap:hover { background: var(--panel); }
.rw.tap:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.rw.wide { grid-template-columns: 16px 160px minmax(0, 1fr) 64px auto; }
.rw .w small.last { font: inherit; color: var(--ink-3); margin-left: 10px; }
.rw.done .w small.last { font-size: 13px; }
.ag-read { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ag-read-h { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--rule); }
.ag-read-h b { font: 700 16px/22px var(--cond); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-read-h .m { font: var(--meta); color: var(--ink-3); white-space: nowrap; }
.ag-read-h .btn { margin-left: auto; }
.ag-txt { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 14px 16px; font: 400 15px/24px var(--sans); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.phone .rw .w small.last { display: block; margin-left: 0; }
.phone .rw.wide .x { display: flex; grid-column: 2 / 4; grid-row: 3; padding: 6px 0 2px; justify-content: flex-start; }
.phone .rw.wide .x .btn { height: 40px; }
.phone .ag-read-h .btn { height: 40px; }
.phone .pane.board { flex: none; min-height: auto; overflow: visible; }
.phone .board .rows { flex: none; overflow: visible; }
.phone .board .ag-read { min-height: 50vh; }
.phone .bf p { font-size: 14px; line-height: 20px; }
.av { display: none; }

/* diff structure: div.hunk > div[data-diff] > u.ln + s.sg + span.tx (base look unchanged) */
.diff .hunk { padding-left: 0; border-left: 0; overflow: visible; white-space: normal; }
.phone .diff .hunk { padding-left: 0; }
.diff u.ln, .code u.ln { text-decoration: none; }
.diff u.ln:empty { display: none; }
.diff s.sg { text-decoration: none; margin-right: 1ch; }
.code .hunk { display: block; border-left: 0; color: inherit; }
button.more { display: block; width: 100%; text-align: left; font: var(--meta); color: var(--ink-2); padding: 4px 0 2px 14px; text-decoration: underline; text-underline-offset: 3px; }
.code button.more { padding-left: 64px; min-height: 28px; }
.chg-m .meta b, .dt-top div .n b, .cl-i .s em b { display: inline; font: inherit; color: inherit; margin: 0; overflow: visible; white-space: nowrap; }

/* Running roster line (top of the board and of the run pane) */
.ro-box { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid var(--rule); }
.roster { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.ro-p { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 6px; border-radius: var(--r); font: 500 15px/20px var(--sans); color: var(--ink-2); }
.ro-p b { color: var(--ink); font-weight: 700; }
.ro-p .ro-s { color: var(--ink-3); }
.ro-p.need { color: var(--hold-ink); font-weight: 600; }
.ro-p.na, .ro-p.zero { color: var(--ink-2); }
button.ro-p:hover { background: var(--panel); }
button.ro-p:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ro-sep { font-style: normal; color: var(--ink-3); }
.ro-box .bus { height: 16px; }
.board > .ro-box { border-bottom: 1px solid var(--rule); }

/* chevrons keep their text glyphs (looks style them); data-icon="chev" lets a look mask them as an icon */
.gh.tg .chev { font-style: normal; color: var(--ink-3); width: 14px; display: inline-block; }

/* collapsed conversation (wide only) */
.main.collapsed > #conv { display: none; }
.main:not(.collapsed) > .mini { display: none; }
.main.collapsed .app-h .collapse { color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); border-radius: var(--r); }
.mini .nw .need { border: 0; cursor: pointer; }
.mini .nw .btn.stop.off .sq { background: var(--rule-2); }
.phone .app-h .collapse, .phone .mini { display: none; }

/* phone side sheet: each pane scrolls inside the sheet, above the footer */
.phone #side.sheet-open { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.phone #side > .sh-h, .phone #side > .tabs, .phone #side > .sh-f { flex: none; }
.phone #side .side-body { flex: 1 1 0; min-height: 0; overflow: hidden; }
.phone .sb-pane { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.phone .follow { min-height: 44px; min-width: 44px; padding: 0 8px; margin-right: -8px; }
.phone .pane-h { height: auto; min-height: 48px; }
.phone .md { display: block; }
.phone .cl { max-height: none; overflow: visible; }
.phone .watch > .chp, .phone .watch.one > .chp { flex: none; min-height: 0; overflow: visible; }
.phone .chp .dt { min-height: 0; }
.phone .chp .code { flex: none; overflow-x: auto; overflow-y: visible; }
.phone .ro-p { min-height: 44px; }
/* the roster line is opt-in per look (theme.json "running-roster": true -> html[data-running-roster]) */
html:not([data-running-roster]) .ro-box { display: none; }
html[data-running-roster] .board > .sum, html[data-running-roster] .rp > .pane-h > .r, html[data-running-roster] .rp-line.classic { display: none; }
html[data-running-roster] .rp-lines:not(:has(.rp-line:not(.classic))) { display: none; }
.cl-all { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 14px; border-bottom: 1px solid var(--rule); font: 600 14px/20px var(--sans); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* The desktop rule: every side piece can float. With the gap tokens at 0 (core.css) nothing moves:
   --base12 is the base look's own 12 px inset, and it drops to 0 as soon as a look opens --gap-piece. */
.side { --base12: clamp(0px, 12px - var(--gap-piece, 0px) * 1000, 12px); row-gap: var(--gap-piece, 0px); }
.watch { padding: var(--base12); gap: calc(var(--gap-piece, 0px) + var(--base12)); }
.board { margin: var(--base12); }
.appwrap { padding: var(--base12); }
#launcher .launch { top: calc(80px + var(--gap-edge, 0px) + var(--gap-bar, 0px)); right: calc(12px + var(--gap-edge, 0px)); max-height: calc(100vh - 92px - 2 * var(--gap-edge, 0px) - var(--gap-bar, 0px)); }
.side.full { top: calc(36px + var(--gap-edge, 0px) + var(--gap-bar, 0px)); left: var(--gap-edge, 0px); right: var(--gap-edge, 0px); bottom: var(--gap-edge, 0px); }
.phone .side { --base12: clamp(0px, 12px - var(--gap-piece-phone, 0px) * 1000, 12px); row-gap: var(--gap-piece-phone, 0px); }
/* The phone side sheet floats like every other piece once a look opens a phone gap token: it then sits UNDER the
   status bar (never over it), --gap-edge-phone from the left, right and bottom edge, its own parts (header, tabs,
   panes, footer) --gap-piece-phone apart with the desk between them. --sg is 0 while every phone gap is 0 and huge
   otherwise, so with the defaults the sheet is exactly the full-screen sheet it was. A look whose phone bar is not
   52 px high says so in --sys-h-phone. */
.phone #side { --sg: calc((var(--gap-edge-phone, 0px) + var(--gap-bar-phone, 0px) + var(--gap-piece-phone, 0px)) * 100000);
  --sheet-top: min(var(--sg), var(--sys-h-phone, 52px) + env(safe-area-inset-top) + var(--gap-edge-phone, 0px) + var(--gap-bar-phone, 0px));
  top: var(--sheet-top); left: var(--gap-edge-phone, 0px); right: var(--gap-edge-phone, 0px); bottom: var(--gap-edge-phone, 0px);
  padding: max(0px, env(safe-area-inset-top) - var(--sg)) 0 0;
  background-image: linear-gradient(var(--desk), var(--desk)); background-repeat: no-repeat; background-size: 100% min(100%, var(--sg)); }
.phone #side.sheet-open { height: calc(100vh - var(--sheet-top) - var(--gap-edge-phone, 0px)); height: calc(100dvh - var(--sheet-top) - var(--gap-edge-phone, 0px)); }
.phone .watch { gap: calc(var(--gap-piece-phone, 0px) + var(--base12)); }
/* Undo / Keep on a change (chgact.js): buttons then one plain sentence; the sentence wraps under on a narrow card */
.chg-ctl { display: contents; }
.chg-f { flex-wrap: wrap; }
.chg-f .chg-n { flex: 1 1 15em; min-width: 0; }
.chg-said { font-weight: 650; color: var(--ink-2); }
.dt-f:has(.chg-ctl) { height: auto; min-height: 52px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; row-gap: 6px; }
.dt-f .chg-n { flex: 1 1 18em; min-width: 0; }
.dt-f .chg-ctl > .r { margin-left: auto; display: flex; gap: 8px; }
