/* Orpheus app components. Needs tokens.css first. Class names are the contract for the web UI port.
   Layout idea: a fixed sidebar (workspace, nav, sessions) and one working column; on phones the sidebar is a drawer. */

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: var(--fs-base)/var(--lh-base) var(--sans); }
a { color: var(--accent-ink); text-underline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: var(--lh-tight); }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 24px; height: 24px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); } .dim { color: var(--dim); }
.sp { flex: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --- label: mono caps, the product's voice for section names --- */
.label { font: 500 var(--fs-micro)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* --- buttons --- */
.btn { min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); text-decoration: none; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn:active { filter: brightness(1.08); }
.btn.go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.go:hover { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--mut); }
.btn.quiet:hover { border-color: var(--line2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: 13px; border-radius: var(--r-sm); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
@media (pointer: coarse) { .btn.sm { min-height: var(--tap); } }
.iconbtn { width: var(--tap); height: var(--tap); border-radius: var(--r-md); border: 1px solid var(--line2); background: transparent; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.iconbtn:hover { color: var(--accent-ink); border-color: var(--accent); }
.iconbtn.bare { border-color: transparent; }

/* --- fields --- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 600 13px var(--sans); color: var(--mut); }
.input { min-height: var(--tap); width: 100%; padding: 0 var(--s3); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font: 16px var(--sans); }
.input::placeholder { color: var(--dim); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.bad { border-color: var(--bad); }
.hint { font-size: var(--fs-xs); color: var(--dim); }
.err { font-size: var(--fs-sm); color: var(--bad); display: flex; gap: 6px; align-items: flex-start; }
select.input { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.select-sm { min-height: 36px; font-size: 13px; width: auto; }
@media (pointer: coarse) { .select-sm { min-height: var(--tap); } }

/* 6-digit code */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
.otp input { min-width: 0; height: 56px; text-align: center; font: 600 24px var(--mono); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); padding: 0; }
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp.bad input { border-color: var(--bad); }

/* --- badges, pills, chips --- */
.badge { font: 700 12px/1.3 var(--mono); letter-spacing: .03em; padding: 0 5px; border-radius: var(--r-xs); border: 1px solid var(--line2); color: var(--mut); white-space: nowrap; flex: none; }
.badge.claude { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.badge.codex { color: var(--good); background: var(--good-soft); border-color: var(--good-line); }
.badge.shell { color: var(--dim); }
.badge.accent { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-xs)/1 var(--sans); padding: 5px 9px; border-radius: var(--r-pill); border: 1px solid var(--line2); color: var(--mut); white-space: nowrap; flex: none; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.plain::before { display: none; }
.pill.good { color: var(--good); background: var(--good-soft); border-color: var(--good-line); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.pill.accent { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.good { background: var(--good); box-shadow: var(--glow-good); }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.dot.pulse { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
kbd { font: 12px var(--mono); background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-xs); padding: 0 5px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; }
.seg > * { font: 12px var(--mono); padding: 7px 13px; color: var(--mut); cursor: pointer; background: none; border: 0; }
.seg > .on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* --- avatar --- */
.av { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--panel3); border: 1px solid var(--line2); color: var(--ink); font: 700 12px var(--mono); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.av.round { border-radius: 50%; }
.av.ws { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

/* --- app shell --- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 15px var(--s4) 12px; }
.brand b { font-weight: 600; font-size: 15px; }
.mark { width: 22px; height: 22px; color: var(--accent); flex: none; }
.mark .mk-s { stroke: var(--ink); }
.wsbtn { margin: 0 var(--s2) var(--s2); display: flex; align-items: center; gap: 10px; padding: 7px 9px; min-height: var(--tap); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; text-align: left; position: relative; }
.wsbtn:hover, .wsbtn.open { border-color: var(--accent); }
.wsbtn .nm { flex: 1; min-width: 0; }
.wsbtn .nm b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsbtn .nm small { display: block; font: 12px var(--mono); color: var(--dim); }
.nav { display: flex; flex-direction: column; gap: 1px; padding: var(--s1) var(--s2); }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--mut); text-decoration: none; font-size: var(--fs-sm); }
.nav a:hover { background: var(--panel2); color: var(--ink); }
.nav a.on { background: var(--panel2); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.nav a .ct { margin-left: auto; font: 600 12px var(--mono); color: var(--on-accent); background: var(--warn); border-radius: var(--r-pill); padding: 1px 7px; }
.side .label { padding: var(--s4) var(--s4) 6px; }
.tree { padding: 0 var(--s2) var(--s4); }
.boxh { display: flex; align-items: center; gap: 8px; padding: 9px 8px 5px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.sess { display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin: 2px 0; border-radius: var(--r-sm); cursor: pointer; color: var(--mut); font: var(--fs-sm) var(--mono); }
.sess:hover, .sess.open { background: var(--panel2); color: var(--ink); }
.sess .snm { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .need { font: 600 12px var(--sans); color: var(--on-accent); background: var(--warn); border-radius: var(--r-pill); padding: 2px 7px; flex: none; }
.sidefoot { margin-top: auto; border-top: 1px solid var(--line); padding: var(--s2); display: flex; align-items: center; gap: 10px; }
.sidefoot .who { flex: 1; min-width: 0; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidefoot .who small { display: block; font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar { display: none; align-items: center; gap: var(--s2); padding: 6px max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar b { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: calc(var(--page-w) + 2 * var(--s8)); margin: 0 auto; padding: var(--s8) max(var(--s8), env(safe-area-inset-right, 0px)) var(--s16) max(var(--s8), env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: var(--s6); }
.pagehead { display: flex; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; }
.pagehead .tt { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pagehead h1 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; }
.pagehead p { color: var(--mut); max-width: 62ch; }
.crumb { font: var(--fs-xs) var(--mono); color: var(--dim); display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--mut); text-decoration: none; } .crumb a:hover { color: var(--accent-ink); }
.sect { display: flex; flex-direction: column; gap: var(--s3); }
.sect > header { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.sect h2 { font-size: var(--fs-md); font-weight: 650; }

/* drawer + top bar layout: small screens, and a phone held sideways (874x402) */
@media (max-width: 699px), (max-height: 500px) and (max-width: 959px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .side.drawer { display: flex; position: fixed; inset: 0 auto 0 0; width: min(86vw, calc(320px + env(safe-area-inset-left, 0px))); z-index: var(--z-side); box-shadow: var(--shadow-pop); }
  .topbar { display: flex; }
  .page { padding: var(--s5) max(16px, env(safe-area-inset-right, 0px)) var(--s12) max(16px, env(safe-area-inset-left, 0px)); gap: var(--s5); }
  .pagehead h1 { font-size: var(--fs-lg); }
}

/* --- cards and rows --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.pad { padding: var(--s5); }
.rows > .row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 60px; }
.rows > .row + .row { border-top: 1px solid var(--line); }
.row .main-t { flex: 1 1 0; min-width: 0; }
.row .main-t b { display: block; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.row .main-t small { display: block; color: var(--dim); font: var(--fs-xs)/1.5 var(--mono); overflow-wrap: anywhere; }
.row .acts { display: flex; align-items: center; gap: var(--s2); flex: none; }
a.row { color: inherit; text-decoration: none; }
a.row:hover { background: var(--panel2); }
.row .ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--panel2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--mut); flex: none; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s5); font-size: var(--fs-sm); }
.kv dt { color: var(--dim); font-family: var(--mono); font-size: var(--fs-xs); padding-top: 1px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* banner */
.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); font-size: var(--fs-sm); color: var(--mut); }
.banner b { color: var(--ink); }
.banner .btxt { flex: 1; min-width: 0; }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); } .banner.warn > svg { color: var(--warn); }
.banner.good { background: var(--good-soft); border-color: var(--good-line); } .banner.good > svg { color: var(--good); }
.banner.accent { background: var(--accent-soft); border-color: var(--accent-line); } .banner.accent > svg { color: var(--accent-ink); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad-line); } .banner.bad > svg { color: var(--bad); }

/* code block with copy */
.code { position: relative; background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--line2); border-radius: var(--r-md); font: 13px/1.6 var(--mono); padding: var(--s4); padding-right: 104px; white-space: pre-wrap; overflow-wrap: anywhere; }
.code .tok { color: #e0a24b; }
.code .cm { color: var(--term-dim); }
.code .copy { position: absolute; top: 10px; right: 10px; min-height: 36px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid #4a4541; background: #262523; color: #eceae7; font: 600 13px var(--sans); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.code .copy:hover { border-color: #d97757; color: #e08a6d; }
.code .copy.done { color: #7fb682; border-color: rgba(127, 182, 130, .5); }
@media (max-width: 699px) { .code { padding-right: var(--s4); padding-bottom: 60px; } .code .copy { top: auto; bottom: 10px; left: 10px; right: 10px; justify-content: center; min-height: var(--tap); } }

/* steps */
.steps { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: 0; font: var(--fs-xs) var(--mono); color: var(--dim); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 7px; }
.steps li + li::before { content: ""; width: 18px; height: 1px; background: var(--line2); }
.steps .n { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.steps .on { color: var(--ink); } .steps .on .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.steps .done { color: var(--good); } .steps .done .n { border-color: var(--good-line); background: var(--good-soft); }

/* countdown ring row */
.count { display: flex; align-items: center; gap: var(--s2); font: var(--fs-sm) var(--mono); color: var(--mut); }
.count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.count.low b { color: var(--warn); }
.bar-time { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar-time i { display: block; height: 100%; background: var(--accent); }

/* waiting line */
.wait { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border: 1px dashed var(--line2); border-radius: var(--r-md); color: var(--mut); font-size: var(--fs-sm); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--accent); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- usage meter: fill = used now, tick = on track for at reset, right edge = 100% of the limit --- */
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--panel3); }
.meter .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--good); }
.meter .proj { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: repeating-linear-gradient(135deg, var(--good-line) 0 4px, transparent 4px 8px); }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.meter.warn .fill { background: var(--warn); } .meter.warn .proj { background: repeating-linear-gradient(135deg, var(--warn-line) 0 4px, transparent 4px 8px); }
.meter.bad .fill { background: var(--bad); } .meter.bad .proj { background: repeating-linear-gradient(135deg, var(--bad-line) 0 4px, transparent 4px 8px); }
.meter.thin { height: 6px; }
.meter-scale { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--dim); margin-top: 6px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font: 650 var(--fs-xl)/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .v small { font: 500 var(--fs-xs) var(--mono); color: var(--dim); letter-spacing: 0; }

/* --- popover and sheet --- */
.pop { position: absolute; z-index: var(--z-pop); min-width: 260px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; }
.pop .label { padding: 8px 10px 6px; }
.pop .opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; min-height: var(--tap); border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); color: var(--ink); text-decoration: none; }
.pop .opt:hover { background: var(--panel2); }
.pop .opt .nm { flex: 1; min-width: 0; }
.pop .opt .nm small { display: block; font: 12px var(--mono); color: var(--dim); }
.pop .opt.on svg.chk { color: var(--accent-ink); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-scrim); }
.sheet { position: fixed; z-index: var(--z-sheet); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.sheet.wide { width: min(620px, calc(100vw - 32px)); }
.sheet h2 { font-size: var(--fs-lg); font-weight: 650; }
.sheet .x { position: absolute; top: 10px; right: 10px; }
.sheet .sheet-ic { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.sheet .acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.sheet .acts .btn { flex: 1 1 140px; }
.grab { display: none; }
@media (max-width: 699px) {
  .sheet, .sheet.wide { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; border-radius: var(--r-xl) var(--r-xl) 0 0; border-width: 1px 0 0; padding: var(--s3) max(16px, env(safe-area-inset-right, 0px)) calc(var(--s5) + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); max-height: 88dvh; }
  .grab { display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line2); margin: 0 auto var(--s1); flex: none; }
  .pop.as-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; min-width: 0; z-index: var(--z-sheet); border-radius: var(--r-xl) var(--r-xl) 0 0; border-width: 1px 0 0; padding: var(--s3) 10px calc(var(--s4) + env(safe-area-inset-bottom, 0px)); }
}

/* --- auth pages --- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: var(--s8) max(16px, env(safe-area-inset-right, 0px)) var(--s8) max(16px, env(safe-area-inset-left, 0px)); }
.authcard { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--s5); }
.authcard .brand { padding: 0; }
.authcard h1 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; }
.authcard .sub { color: var(--mut); }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--dim); font: var(--fs-micro) var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.fine { font-size: var(--fs-xs); color: var(--dim); }
.fine a { color: var(--mut); white-space: nowrap; }   /* a link never splits across lines (pass 7: wrapped 'Terms of Use' boxed over 'Privacy Policy') */

/* --- plans --- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.plan { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.plan.pick { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan h3 { font-size: var(--fs-md); font-weight: 650; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.plan .price { font: 650 var(--fs-2xl)/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan .price small { font: 500 var(--fs-xs) var(--mono); color: var(--dim); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-sm); color: var(--mut); flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { color: var(--good); margin-top: 2px; }
@media (max-width: 899px) { .plans { grid-template-columns: minmax(0, 1fr); } }

/* --- empty state --- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); padding: var(--s10) var(--s8); border: 1px dashed var(--line2); border-radius: var(--r-lg); }
.empty h2 { font-size: var(--fs-lg); font-weight: 650; }
.empty p { color: var(--mut); max-width: 56ch; }
.empty .glyph { font: 12px/1.35 var(--mono); color: var(--dim); white-space: pre; }
@media (max-width: 699px) { .empty { padding: var(--s6) var(--s4); } }

/* --- cockpit --- */
.cockpit { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100dvh; }
.grid { display: grid; gap: var(--s2); padding: var(--s2); min-height: 0; overflow: auto; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); grid-auto-rows: minmax(270px, 1fr); }
.pane { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-height: 0; min-width: 0; }
.pane.target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pane .head { display: flex; align-items: center; gap: var(--s2); padding: 5px 6px 5px 10px; min-height: var(--tap); border-bottom: 1px solid var(--line); background: var(--panel2); }
.pane .head .nm { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.pane .head .nm b { font: 600 13.5px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane .head .nm small { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.pane .head .seg > * { padding: 5px 10px; font-size: 12px; }
.read { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s4) 26px; font: var(--fs-read)/1.58 var(--sans); }
.read .turn { margin: 0 0 18px; }
.read .rl { display: block; font: 600 var(--fs-micro) var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }
.read .turn.you { border-left: 2px solid var(--accent); padding-left: 13px; } .read .turn.you .rl { color: var(--accent-ink); }
.read .turn.agent .rl { color: var(--good); }
.read code { font: .82em var(--mono); background: var(--panel3); border-radius: var(--r-xs); padding: 1px 5px; }
/* Message times (2026-11-15, PROPOSED). Spec: design/MESSAGE-TIMES.md. Mockup: design/screens/read-view.html.
   Every message opens with one quiet meta line. The first message of a group puts its time on the label row
   ("DEMO-API-REFACTOR · 14:06"); each later message in the same group opens with its time alone (.turn > .mtime).
   Your bubble shows the time only: the words "You said" stay in .rl-n for screen readers. Today "14:06", then
   "Yesterday 14:06", "Nov 12, 14:06", "Nov 12 2025, 14:06"; the title gives the full date. Same look as the Rooms post time. */
.read .rl { display: flex; align-items: baseline; gap: 0 6px; min-width: 0; }
.read .rl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read .mtime { flex: none; font: 400 var(--fs-micro)/1 var(--mono); letter-spacing: 0; text-transform: none; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.read .turn.agent .rl-n + .mtime::before, .read details.peer > summary .mtime::before { content: "·"; content: "·" / ""; margin-right: 6px; }
.read .turn > .mtime { display: block; width: fit-content; margin-bottom: 7px; }
.read .rt + .mtime, .read details.steps + .mtime { margin-top: 16px; }
.read .turn.you .rl { margin-bottom: 4px; }
.read .turn.you .rl-n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.term { flex: 1; min-height: 0; overflow: hidden; background: var(--term-bg); color: var(--term-ink); font: 12.5px/1.5 var(--mono); padding: var(--s3) var(--s4); white-space: pre-wrap; }
.term .d { color: var(--term-dim); } .term .g { color: #7fb682; } .term .o { color: #e08a6d; }
.livestrip { display: flex; align-items: center; gap: var(--s2); padding: 6px 10px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); }
.livestrip .k { border: 1px solid var(--line2); border-radius: var(--r-xs); padding: 3px 8px; color: var(--mut); background: var(--panel2); }
.sendbar { border-top: 1px solid var(--line); background: var(--panel); padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--s2); }
.sendto { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { font: 12px var(--mono); padding: 5px 11px; border-radius: var(--r-pill); border: 1px solid var(--line2); color: var(--mut); white-space: nowrap; cursor: pointer; background: none; flex: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.inrow { display: flex; gap: var(--s2); align-items: flex-end; }
.inrow .msg { flex: 1; min-width: 0; min-height: var(--tap); border-radius: var(--r-md); border: 1px solid var(--accent-line); background: var(--panel2); color: var(--ink); padding: 11px 12px; font: 15px var(--mono); }
.inrow .msg::placeholder { color: var(--dim); }
@media (max-width: 699px) {
  .cockpit { height: calc(100dvh - 57px); }
  .grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); padding: 0; gap: 0; }
  .grid .pane { display: none; border: 0; border-radius: 0; }
  .grid .pane.target { display: flex; box-shadow: none; }
  .read { padding: var(--s3) 17px; }
  .inrow .hide-s { display: none; }
}

/* --- mock chrome: the strip at the top of each mockup. Not part of the product. --- */
.mockbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: 6px 12px; background: #0f0e0d; color: #a49f98; font: 12px var(--mono); border-bottom: 1px solid #35322f; }
.mockbar b { color: #eceae7; font-weight: 600; }
.mockbar a { color: #a49f98; text-decoration: none; } .mockbar a:hover { color: #e08a6d; }
.mockbar label, .mockbar button { border: 1px solid #423e3a; border-radius: 6px; padding: 4px 9px; cursor: pointer; background: none; color: #a49f98; font: 12px var(--mono); }
.mock-st { position: absolute; opacity: 0; pointer-events: none; }
#st1:checked ~ .mockbar label[for="st1"], #st2:checked ~ .mockbar label[for="st2"], #st3:checked ~ .mockbar label[for="st3"], #st4:checked ~ .mockbar label[for="st4"], #st5:checked ~ .mockbar label[for="st5"] { background: #d97757; border-color: #d97757; color: #191817; font-weight: 600; }
#st1:checked ~ .stage [data-state]:not([data-state~="1"]), #st2:checked ~ .stage [data-state]:not([data-state~="2"]), #st3:checked ~ .stage [data-state]:not([data-state~="3"]), #st4:checked ~ .stage [data-state]:not([data-state~="4"]), #st5:checked ~ .stage [data-state]:not([data-state~="5"]) { display: none !important; }
.stage { position: relative; }
.stage .app, .stage .auth { min-height: calc(100dvh - 37px); }
.stage .side { top: 37px; height: calc(100dvh - 37px); }
.stage .topbar { top: 37px; }
.stage .cockpit { height: calc(100dvh - 37px); }
@media (max-width: 699px) { .stage .cockpit { height: calc(100dvh - 37px - 57px); } }

/* ===== BEGIN Rail nav fold (2026-11-15, PROPOSED) =====
   Spec: design/RAIL-NAV-FOLD.md. Mockup: design/screens/rail-nav-fold.html (source design/src/rail-nav-fold.html).
   Mike, 11-15: "make cockpit and other navigation elements upper left side pane retractable".
   Part 1: the product rules, written against the app's own selectors (#app, #side .brand, .ib, .bbtn.dmb, .dmn). Paste as is.
           New markup: one button, button.ib.navfold, in .brand .ib-row. New state: #app.nav-fold.
           Every rule here outranks the rule it replaces, so the block holds above or below "Part 2: feedback #178".
   Part 2: mock chrome for the mockup (rf-*). Not part of the product.
   Tokens only. No animation: the menu changes form in one frame. */

/* --- Part 1: the product rules (app selectors; tested against web/css/app.css at 1440x1046, 1440x780, 1024x768, 820x1180, 871x553 and 390x844) --- */
/* A. The control: one more 32px icon button in the row that already holds Refresh, Settings, Color and Collapse sidebar.
      No new row. The chevron points up while the full menu shows (press: it folds up) and down once it is folded. */
#side .brand .ib-row { gap: 0; }
#side .brand b { min-width: 0; }   /* five buttons and the name share one row at 300px; the name gives way before the row wraps */
#app:not(.nav-fold) #side .brand .ib.navfold svg { transform: rotate(180deg); }
/* a rail 240px or narrower in the tab layout: the five buttons share the row (39px each at 210px). Dense on purpose. Do not enlarge. */
@container (max-width: 240px) { #app.tabm #side .brand .ib { flex: 1 1 0; width: auto; min-width: 32px; } }

/* B. Retracted (#app.nav-fold): the nine rows become icons, five to a row. Every destination stays one tap away.
      The names stay in the page for screen readers (clipped, not removed) and show as the native title on hover.
      :is(a, button) lifts these rules over "#app.tabm #side .brand .bbtn.dmb", so they hold above or below Part 2 rule A. */
#app.nav-fold #side .brand .bbtn.dmb:is(a, button) { position: relative; flex: 1 0 16%; width: auto; min-width: 0; height: 40px; min-height: 40px; margin: 0; padding: 0; flex-direction: row; justify-content: center; align-items: center; gap: 0; font-size: 0; letter-spacing: 0; overflow: visible; box-shadow: none; }
#app.nav-fold #side .brand::after { content: ""; flex: 1 0 16%; order: 9; height: 0; }   /* the empty tenth slot: row two lines up under row one */
#app.nav-fold #side .brand .bbtn.dmb svg { width: 16px; height: 16px; }
#app.nav-fold #side .brand .bbtn.dmb.on { background: var(--panel2); color: var(--ink); box-shadow: none; }
#app.nav-fold #side .brand .bbtn.dmb.on svg { color: var(--accent); }
#app.nav-fold #side .brand .bbtn.dmb:focus-visible { outline-offset: -2px; }
#app.nav-fold #side .brand .bbtn.dmb .dml2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* short screens (under 700px tall) stay dense: 32px cells. Do not enlarge. The phone drawer gets full 44px targets. */
@media (min-width: 700px) and (max-height: 699px) { #app.nav-fold #side .brand .bbtn.dmb:is(a, button) { height: 32px; min-height: 32px; } }
@media (max-width: 699px) { #app.nav-fold #side .brand .bbtn.dmb:is(a, button) { height: 44px; min-height: 44px; } }

/* C. With a mouse on a rail 280px or wider all nine fit one 32px row. Asks and Decisions always get half a cell more
      (count or no count, so nothing moves when one arrives) and a two-digit count clears the next icon. */
@media (pointer: fine) {
  @container (min-width: 280px) {
    #app.nav-fold #side .brand { column-gap: 2px; }
    #app.nav-fold #side .brand .mark { margin-right: 6px; }   /* the name stays where it was (the gap was 8px) */
    #app.nav-fold #side .brand::after { content: none; }
    #app.nav-fold #side .brand .bbtn.dmb:is(a, button) { flex: 1 0 7.5%; height: 32px; min-height: 32px; }
    #app.nav-fold #side .brand .bbtn.dmb:is([href="asks.html"], [href="decisions.html"]) { flex: 1.5 0 11.25%; }
  }
}

/* D. The waiting counts on Asks and Decisions ride the icon's shoulder: same amber pill, same number, same place as the 3 x 3 grid. */
#app.nav-fold #side .brand .bbtn.dmb .dmn.on { position: absolute; top: calc(50% - 14px); left: calc(50% + 3px); margin: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); font: 700 12px/16px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
#app.nav-fold #side .brand .bbtn.dmb:is(.on, :hover) .dmn.on { box-shadow: 0 0 0 2px var(--panel2); }

/* E. Retracted, the top block is short enough to stay pinned on any screen 700px or taller (today it only pins from 900px),
      so the menu and this button stay in reach while the agent list scrolls under them. */
@media (min-width: 700px) and (min-height: 700px) and (max-height: 899px) { #app.nav-fold #side .brand { position: sticky; top: 0; z-index: 5; background: var(--panel); } }

/* --- Part 2: mock chrome for design/screens/rail-nav-fold.html. Not part of the product. Reuses the ct-* frames and rail. --- */
/* a rail at its real width: 300 desktop, 246 iPad landscape, 210 iPad portrait and phone sideways, 312 phone drawer */
.ct-rail.rf-rail { width: var(--rw, 300px); --rg: 8px; }
.rf-rail.w246 { --rw: 246px; --rg: 6px; }
.rf-rail.w210 { --rw: 210px; --rg: 6px; }
.rf-rail.w210.short { --rg: 3px; }
.rf-rail.w312 { --rw: 312px; }
.rf-rail .ct-rs { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.rf-rail .ct-rs::-webkit-scrollbar { display: none; }
/* the top block (#side .brand): pinned while the agent list scrolls under it; .rf-static = it scrolls away (today under 900px tall) */
.rf-top { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); }
.rf-rail:not(.fold) .rf-top.rf-static, .rf-top.rf-never { position: static; }
.rf-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 0 16px; }
.rf-head b { flex: 1 1 0; min-width: 0; font: 600 16px var(--sans); }
.rf-ibs { display: flex; }
.rf-ibs .iconbtn { width: 32px; height: 32px; border-radius: var(--r-sm); }
.rf-head.wrap { flex-wrap: wrap; row-gap: 8px; }
.rf-head.wrap .rf-ibs { flex: 0 0 100%; justify-content: flex-end; }
.rf-head.wrap .rf-ibs .iconbtn { width: 44px; height: 44px; }
.rf-rail .ct-ibs .iconbtn { flex: 1 1 0; width: auto; min-width: 32px; max-width: 44px; }
.rf-rail .iconbtn:hover { background: var(--line); color: var(--ink); border-color: transparent; }
.rf-aa { font: 700 12px/1 var(--sans); letter-spacing: -.02em; }
.rf-left svg.i { transform: rotate(180deg); }
.rf-rail .ct-ws { margin: 16px 8px 4px; min-height: 50px; gap: 10px; }
.rf-rail.w246 .ct-ws, .rf-rail.w210 .ct-ws { margin: 10px 8px 4px; min-height: 46px; }
.rf-rail .ct-ws .nm { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-rail .ct-ws svg.i { color: var(--mut); width: 16px; height: 16px; }
/* the control. Mock only: it really folds (script at the end of the source). */
.rf-fold { padding: 0; }
.rf-rail:not(.fold) .rf-fold svg.i { transform: rotate(180deg); }
.rf-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* expanded: the nine rows as they are live (36px rows 45px apart on desktop, 38px in the tab layout, 44px in the phone drawer) */
.rf-rail .ct-nav { border-bottom: 0; padding: var(--rg) 8px 12px; }
.rf-rail .ct-nav a { cursor: pointer; }
.rf-rail .ct-nav a:hover { background: var(--panel2); color: var(--ink); }
.rf-rail .ct-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-rail .ct-nav.old { gap: 9px; padding-top: 14px; }
.rf-rail.w300 .ct-nav.old a { min-height: 36px; }
.rf-rail.w312 .ct-nav.old a { min-height: 44px; }
.rf-rail .ct-nav .dml2 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rf-rail .ct-nav .dml2 small { font: 12px var(--mono); color: var(--dim); }
.rf-rail .ct-nav .dm-s, .rf-rail .ct-nav.c3 .dm-w, .rf-rail .ct-nav.c3 .dml2 small { display: none; }
.rf-rail .ct-nav.c3 .dm-s { display: inline; }
.rf-rail .ct-nav.c3 .dml2 { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* retracted: the same numbers as Part 1 rules B, C and D */
.rf-rail.fold .ct-nav, .rf-rail.fold .ct-nav.old { gap: var(--rg); padding-top: var(--rg); }
.rf-rail.fold .ct-nav a { flex: 1 0 16%; height: 40px; min-height: 40px; padding: 0; flex-direction: row; justify-content: center; gap: 0; font-size: 0; overflow: visible; box-shadow: none; }
.rf-rail.fold .ct-nav::after { content: ""; flex: 1 0 16%; height: 0; }
.rf-rail.fold .ct-nav a.on { background: var(--panel2); color: var(--ink); }
.rf-rail.fold .ct-nav a.on svg.i { color: var(--accent); }
.rf-rail.fold .ct-nav a .dml2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rf-rail.fold .ct-nav a .n { position: absolute; top: calc(50% - 14px); left: calc(50% + 3px); margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font: 700 12px/16px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.rf-rail.fold .ct-nav a.on .n, .rf-rail.fold .ct-nav a:hover .n, .rf-rail.fold .ct-nav a.is-hover .n { box-shadow: 0 0 0 2px var(--panel2); }
.rf-rail.short.fold .ct-nav a { height: 32px; min-height: 32px; }
.rf-rail.w312.fold .ct-nav a { height: 44px; min-height: 44px; }
.rf-rail.m9.fold .ct-nav { column-gap: 2px; }
.rf-rail.m9.fold .ct-nav::after { content: none; }
.rf-rail.m9.fold .ct-nav a { flex: 1 0 7.5%; height: 32px; min-height: 32px; }
.rf-rail.m9.fold .ct-nav a.ct { flex: 1.5 0 11.25%; }
/* the agent list under the menu */
.rf-agh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 14px 2px; min-height: 32px; }
.rf-agh b { font: 600 12.5px var(--sans); color: var(--warn); white-space: nowrap; }
.rf-rail .ct-sess { cursor: pointer; }
.rf-rail.wide .ct-sess { min-height: 46px; padding-right: 0; }
.rf-rail.wide .ct-sess .sm small i, .rf-rail:not(.wide) .ct-sess .badge { display: none; }
.rf-rail .ct-foot .iconbtn svg.i { width: 16px; height: 16px; }
/* frames */
.ct-screen.rf-desk { width: 1280px; height: 1046px; }
.rf-desk .rf-main > .ct-strip, .ct-screen.s871 .rf-main > .ltabs { display: none; }
.rf-main > .ltabs { position: relative; }
.ct-screen.s1024 .rf-main > .ltabs { height: 44px; }
.ct-screen.rf-phone { display: block; width: 390px; max-width: 100%; height: 844px; }
.rf-under { position: absolute; inset: 0; display: flex; flex-direction: column; }
.rf-scrim { position: absolute; inset: 0; background: var(--scrim); }
.ct-rail.rf-drawer { position: absolute; inset: 0 auto 0 0; max-width: 80%; border-right: 1px solid var(--line); box-shadow: var(--shadow-pop); }
/* the count line under a rail: how many agents show before scrolling */
.rf-gain { font: 500 var(--fs-sm)/1.4 var(--sans); color: var(--mut); }
.rf-gain b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
/* specimens (state 6) */
.rf-spec-rail { width: 300px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.rf-spec-rail.n210 { width: 210px; }
.rf-spec-rail .ct-nav { padding: 8px; }
.rf-spec-rail .rf-head { padding: 8px 12px 8px 16px; }
.rf-key { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--mut); }
/* ===== END Rail nav fold ===== */

/* ===== BEGIN Cockpit tabs and the short rail (2026-11-15, PROPOSED) =====
   Spec: design/COCKPIT-TABS.md. Mockup: design/screens/cockpit-tabs.html (source design/src/cockpit-tabs.html).
   Part 1: layout tabs (.ltabs, .lt, .ltchip, .lt-menu, .lt-confirm, .ph-act).
   Part 2: feedback #178, the rail on a short screen. Written against the app's own selectors; paste as is.
   Part 3: mock chrome for the mockup. Not part of the product.
   Tokens only. A tab's own colour arrives inline as --sw (the app's palette list, PALS[key].accent); nothing here names a colour. */

/* --- Part 1: layout tabs --- */
/* the row: one line above the pane grid, 38px with a mouse, 44px on touch. It never wraps and never grows. */
.ltabs { display: flex; align-items: flex-end; gap: 2px; height: 38px; min-width: 0; padding: 0 6px 0 8px; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
/* the tabs scroll sideways inside .lt-strip; + and "All tabs" stay outside it, so they never scroll away */
.lt-strip { flex: 0 1 auto; min-width: 0; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.lt-strip::-webkit-scrollbar { display: none; }
/* edge fades while there is more to scroll (same classes as #tabs: .fl = more on the left, .fr = more on the right). The #000 is mask alpha, not a colour. */
.lt-strip.fl { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
.lt-strip.fr { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
.lt-strip.fl.fr { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }

/* one tab: 184px wide, shrinks to 104px, then the strip scrolls. (width, not flex-basis: the strip sizes itself from it.) */
.lt { position: relative; flex: 0 1 auto; width: 184px; min-width: 104px; height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none; color: var(--mut); font: 500 var(--fs-sm)/1 var(--sans); white-space: nowrap; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x; }
.lt:hover { background: var(--panel2); color: var(--ink); }
/* the open tab takes the grid's ground, so tab and windows read as one sheet; its top line is the tab's own colour
   (loading a tab recolours the app, so --accent already is that colour) */
.lt[aria-selected="true"] { height: 35px; padding-right: 5px; background: var(--bg); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); cursor: default; }
.lt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* a hairline between two resting tabs */
.lt + .lt::before { content: ""; position: absolute; left: -2px; top: 10px; bottom: 9px; width: 1px; background: var(--line); }
.lt[aria-selected="true"]::before, .lt[aria-selected="true"] + .lt::before, .lt:hover::before, .lt:hover + .lt::before { display: none; }

/* the colour mark: a small square, so it is never read as a state dot (those are round: green working, amber waiting) */
.lt-dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--sw, var(--dim)); }
.lt[aria-selected="true"] .lt-dot { cursor: pointer; }
.lt[aria-selected="true"] .lt-dot::after { content: ""; position: absolute; inset: -9px -7px; }   /* 24px hit area for the colour picker */
.lt-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* agents waiting for you in a tab that is not open. Its own cell; the name gives way, never the count. */
.lt-n { flex: none; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--warn); color: var(--on-accent); font: 700 12px/16px var(--mono); text-align: center; }
.lt[aria-selected="true"] .lt-n { display: none; }
/* close: always on the open tab, where it has its own cell. On a resting tab it appears on hover (mouse only) and lies
   over the end of the name, so a narrow tab keeps its width for the name. Gone when one tab is left. */
.lt-x { flex: none; width: 24px; height: 24px; margin-left: -3px; padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; }
.lt-x svg.i { width: 13px; height: 13px; }
.lt:hover .lt-x, .lt[aria-selected="true"] .lt-x, .lt-x:focus-visible { opacity: 1; }
.lt-x:hover { background: var(--panel3); color: var(--ink); }
.lt:not([aria-selected="true"]) .lt-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin: 0; background: var(--panel2); }
.lt:not([aria-selected="true"]) .lt-x:hover { background: var(--panel3); }
.lt-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: none) { .lt:not([aria-selected="true"]) .lt-x { display: none; } }
.ltabs.one .lt-x { display: none; }

/* rename in place: the name becomes a field of the same size */
.lt-in { flex: 1 1 auto; min-width: 0; width: 100%; height: 24px; padding: 0 6px; border: 1px solid var(--accent-line); border-radius: var(--r-xs); background: var(--panel2); color: var(--ink); font: 500 var(--fs-sm) var(--sans); }
.lt-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lt-in.bad { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.lt.edit { cursor: text; }
.lt.edit .lt-x, .lt.edit .lt-n { display: none; }
@media (pointer: coarse) { .lt-in { font-size: 16px; } }   /* iOS zooms the page on a field under 16px */

/* drag to reorder: the lifted tab dims, a 2px accent line marks where it will land */
.lt.lt-dragging { opacity: .55; background: var(--panel2); cursor: grabbing; }
.lt.lt-drop-before::after, .lt.lt-drop-after::after { content: ""; position: absolute; top: 5px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--accent); }
.lt.lt-drop-before::after { left: 0; }
.lt.lt-drop-after::after { right: 0; }

/* new tab (straight after the last tab) and "All tabs" (pinned to the right end) */
.lt-add, .lt-all { flex: none; width: 30px; height: 30px; margin: 0 0 3px 2px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lt-add:hover, .lt-all:hover, .lt-all[aria-expanded="true"] { background: var(--panel2); color: var(--ink); }
.lt-add:focus-visible, .lt-all:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lt-add svg.i, .lt-all svg.i { width: 16px; height: 16px; }
.lt-all { margin-left: auto; }
@media (pointer: coarse) {
  .ltabs { height: 44px; }
  .lt { height: 40px; } .lt[aria-selected="true"] { height: 41px; }
  .lt-add, .lt-all { width: 40px; height: 40px; margin-bottom: 2px; }
  .lt-x { width: 32px; height: 32px; }
}

/* compact form: one chip that names the open tab and opens the tab list. It rides in a row that already exists
   (the window strip, or the phone's top bar), so tabs cost no height on small screens. */
.ltchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; max-width: 172px; padding: 0 7px 0 7px; border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--panel2); color: var(--ink); font: 600 var(--fs-sm)/1 var(--sans); white-space: nowrap; cursor: pointer; }
.ltchip:hover, .ltchip[aria-expanded="true"] { border-color: var(--accent); }
.ltchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ltchip > svg.i { width: 14px; height: 14px; color: var(--dim); }
.ltchip.min { gap: 3px; padding: 0 4px 0 6px; }            /* phone top bar: the letter and the chevron only */
.ltchip.min .lt-nm { display: none; }
/* the tab's initial on its colour. Used wherever tabs are a chip or a list row. */
.lt-av { flex: none; width: 22px; height: 22px; border-radius: var(--r-xs); background: var(--sw, var(--accent)); color: var(--on-accent); font: 700 12px/22px var(--mono); text-align: center; text-transform: uppercase; }
@media (pointer: coarse) and (max-width: 499px), (pointer: coarse) and (max-height: 500px) { .ltchip { height: var(--tap); } }

/* the tab list. Drops from the control that opened it (the chip, or "All tabs"), at every screen size. */
.lt-menu { position: absolute; z-index: var(--z-pop); width: min(300px, calc(100vw - 16px)); max-height: min(70dvh, 520px); display: flex; flex-direction: column; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); transform-origin: top left; animation: lt-grow var(--t) var(--ease); }
.lt-menu.right { transform-origin: top right; }
@keyframes lt-grow { from { opacity: 0; transform: scale(.96); } }
.lt-menu .label { flex: none; padding: 6px 8px 6px; }
.lt-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; }
.lt-row { position: relative; flex: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 3px 3px 3px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: var(--fs-sm)/1.25 var(--sans); text-align: left; cursor: pointer; touch-action: pan-y; }
.lt-row:hover, .lt-row[aria-checked="true"] { background: var(--panel2); }
.lt-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lt-row .nm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lt-row .nm b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-row[aria-checked="true"] .nm b { font-weight: 650; }
.lt-row .nm small { font: 12px/1.2 var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-more { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lt-more:hover { background: var(--panel3); color: var(--ink); }
.lt-row.lt-dragging { opacity: .55; }
.lt-row.lt-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.lt-row.lt-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.lt-menu hr { flex: none; width: 100%; border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
/* the two actions under the list */
.lt-row.act { min-height: 40px; color: var(--mut); }
.lt-row.act:hover { color: var(--ink); }
.lt-row.act svg.i { width: 16px; height: 16px; margin: 0 3px; }
.lt-row.act[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
@media (min-width: 700px) and (max-height: 699px) { .lt-row { min-height: 40px; } .lt-menu { max-height: calc(100dvh - 64px); } }   /* short screens stay dense */

/* close a tab that has windows: a small confirmation that drops from the tab (or the chip) */
.lt-confirm { position: absolute; z-index: var(--z-pop); width: min(288px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); transform-origin: top left; animation: lt-grow var(--t) var(--ease); }
.lt-confirm b { font: 600 14px/1.3 var(--sans); overflow-wrap: anywhere; }
.lt-confirm p { font-size: var(--fs-sm); line-height: 1.4; color: var(--mut); }
.lt-confirm .acts { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: 2px; }

/* empty tab: the second button on "Pick an agent to start" (production adds it to .placeholder.start) */
.ph-act { min-height: var(--tap); padding: 0 var(--s4); border: 1px solid var(--line2); border-radius: var(--r-md); background: transparent; color: var(--ink); font: 600 14px var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); cursor: pointer; }
.ph-act:hover { border-color: var(--accent); color: var(--accent-ink); }
.ph-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph-act svg.i { width: 16px; height: 16px; }

/* --- Part 2: feedback #178, the rail on a short screen (app selectors; tested against web/css/app.css at 871x553) --- */
/* A. Beside the rail on a screen under 700px tall (phone held sideways, Duo landscape) the nine nav rows become a
      3 x 3 grid of icon-over-label cells, so the agent list starts in the first screen. Dense on purpose. Do not enlarge. */
#side .brand .bbtn.dmb .dm-s { display: none; }
@media (min-width: 700px) and (max-height: 699px) {
  #side .brand { column-gap: 3px; row-gap: 3px; }
  #side .brand .ib-row, #side .brand .wsswitch { margin-bottom: 3px; }
  #side .brand .bbtn.dmb, #app.tabm #side .brand .bbtn.dmb { position: relative; flex: 0 0 calc((100% - 6px) / 3); min-width: 0; min-height: 40px; height: 40px; margin: 0; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 3px; font: 500 12px/1.1 var(--sans); letter-spacing: 0; white-space: nowrap; overflow: hidden; box-shadow: none; }
  #side .brand .bbtn.dmb + .bbtn.dmb { margin-top: 0; }
  #side .brand .bbtn.dmb svg { width: 16px; height: 16px; }
  #side .brand .bbtn.dmb.on { background: var(--panel2); color: var(--ink); box-shadow: none; }
  #side .brand .bbtn.dmb.on svg { color: var(--accent); }
  #side .brand .bbtn.dmb .dml2 { flex: none; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  #side .brand .bbtn.dmb small { display: none; }
  #side .brand .bbtn.dmb .dm-w { display: none; }
  #side .brand .bbtn.dmb .dm-s { display: inline; }
  #side .brand .bbtn.dmb .dmn.on { position: absolute; top: 2px; left: calc(50% + 5px); margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font: 700 12px/16px var(--mono); box-shadow: 0 0 0 2px var(--panel); }
  #side .brand #fblink { width: auto; text-align: center; }
}
/* B. A rail 260px wide or less: the kind (CLAUDE, CODEX) moves under the name as plain text and the row's menu button
      narrows, so the name gets the width (34px before, 128px after at 210px). Long-press and right-click still open the menu. */
@container (max-width: 260px) {
  #boxes .sess { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; column-gap: 0; row-gap: 1px; align-items: center; align-content: center; padding: 5px 2px 5px 10px; }
  #boxes .sess .s { grid-column: 1; grid-row: 1; margin-right: 9px; }
  #boxes .sess .sm { display: contents; }
  #boxes .sess .snm { grid-column: 2 / 4; grid-row: 1; }
  #boxes .sess .al { grid-column: 4; grid-row: 1; margin-left: 6px; }
  #boxes .sess .pv, #boxes .sess .pv.cl, #boxes .sess .pv.cx, #boxes .sess .pv.or { grid-column: 2; grid-row: 2; border: 0; background: none; padding: 0; border-radius: 0; font: 600 12px/1.3 var(--mono); letter-spacing: .04em; color: var(--dim); }
  #boxes .sess .sub { grid-column: 3 / 5; grid-row: 2; min-width: 0; }
  #boxes .sess:has(.pv) .sub:not(:empty)::before { content: "\00b7"; margin: 0 5px; color: var(--dim); font-weight: 400; }
  #boxes .sess:not(:has(.pv)) .sub { grid-column: 2 / 5; }
  /* a row that needs you says so in full: the kind steps aside */
  #boxes .sess.needs .pv, #boxes .sess.authout .pv { display: none; }
  #boxes .sess.needs .sub, #boxes .sess.authout .sub { grid-column: 2 / 5; }
  #boxes .sess.needs .sub::before, #boxes .sess.authout .sub::before { content: none !important; }
  #boxes .sess .more, #app.tabm #side .sess .more { grid-column: 5; grid-row: 1 / 3; width: 28px; height: 40px; margin-left: 2px; }
  #boxes .sess .lockup { grid-column: 5; grid-row: 1 / 3; margin-left: 6px; }
}
/* C. "waiting for you" under a name is amber text, not an amber pill (today it picks up .sess .need's fill and is unreadable) */
#boxes .sess .sub.need { background: none; padding: 0; margin: 0; border-radius: 0; font-family: inherit; letter-spacing: 0; }

/* --- Part 3: mock chrome for design/screens/cockpit-tabs.html. Not part of the product. --- */
.cockpit.has-lt { grid-template-rows: auto minmax(0, 1fr) auto; }
.cockpit.has-lt > .ltabs { position: relative; }
@media (max-width: 699px) { .cockpit.has-lt > .ltabs { display: none; } }   /* phones use the chip: state 6 */
.ct-ph { margin: auto; max-width: 340px; padding: 0 var(--s4); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ct-ph h2 { font: 650 20px/1.25 var(--sans); letter-spacing: -.01em; }
.ct-ph p { font-size: var(--fs-base); color: var(--mut); }
.ct-ph .ph-act { margin-top: 6px; }
.ct-ph a { min-height: var(--tap); display: inline-flex; align-items: center; color: var(--mut); font-size: 14px; text-underline-offset: 3px; }
.grid.ct-empty { display: flex; }
.ct-board { display: flex; flex-direction: column; gap: var(--s10); padding: var(--s6) max(16px, env(safe-area-inset-right, 0px)) var(--s12) max(16px, env(safe-area-inset-left, 0px)); min-width: 0; }
.ct-fig { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.ct-fig figcaption { font: 500 var(--fs-micro)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ct-fig .ct-note { font-size: var(--fs-sm); line-height: 1.5; color: var(--mut); max-width: 72ch; }
.ct-fig .ct-note code { font: 12px var(--mono); background: var(--panel3); border-radius: var(--r-xs); padding: 1px 5px; }
.ct-scroll { overflow-x: auto; padding-bottom: 4px; }
.ct-pair { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: flex-start; }
.ct-pair > .ct-fig { flex: 0 1 390px; }
.ct-pair.rails > .ct-fig { flex: none; }
/* a device frame at its real size */
.ct-screen { position: relative; flex: none; display: flex; overflow: hidden; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-xl); }
.ct-screen.s871 { width: 871px; height: 553px; }
.ct-screen.s1024 { width: 1024px; height: 768px; }
.ct-screen.s390 { width: 100%; height: 700px; flex-direction: column; }
.ct-screen.rail { width: 210px; height: 553px; }
.ct-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; }
.ct-main > .ltabs { flex: none; }
.ct-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 6px; }
.ct-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ct-screen .pane .read { font-size: 15px; line-height: 1.5; padding: 10px 14px; }
.ct-screen .pane .read .turn { margin-bottom: 12px; }
.ct-screen .pane .head { min-height: 40px; }
.ct-screen .sendbar { flex: none; padding: 6px 10px; }
.ct-screen .sendbar .msg { min-height: 40px; padding: 8px 12px; }
.ct-screen .sendbar .iconbtn { width: 40px; height: 40px; }
.ct-screen .sendbar .btn { min-height: 40px; }
/* the window strip (the app's #tabs in the tab layout): window tabs and the Two-up switch */
.ct-strip { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ct-wts { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.ct-wt { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel2); color: var(--mut); font: 13px var(--mono); white-space: nowrap; }
.ct-wt.on { border-color: var(--accent); color: var(--ink); }
.ct-wt.wait { border-color: var(--warn); color: var(--ink); }
.ct-tw { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--panel2); color: var(--accent-ink); font: 600 13px var(--sans); white-space: nowrap; }
.ct-top { flex: none; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 48px; padding: 2px 8px 2px 2px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; }
.ct-top .iconbtn { flex: none; }
/* the cockpit rail at 210px, redrawn from the live CSS (before) and with Part 2 applied (after) */
.ct-rail { flex: none; width: 210px; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.ct-screen.rail .ct-rail { border-right: 0; }
.ct-rs { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.ct-ibs { display: flex; justify-content: space-between; padding: 4px 8px 0; }
.ct-ibs .iconbtn { width: 44px; height: 44px; }
.ct-ws { margin: 6px 8px 8px; min-height: 44px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line2); border-radius: var(--r-md); font: 600 13.5px var(--sans); }
.ct-nav { display: flex; flex-wrap: wrap; gap: 1px; padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.ct-nav a { position: relative; flex: 0 0 100%; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: var(--r-sm); color: var(--mut); font: 500 13px var(--sans); text-decoration: none; }
.ct-nav a svg.i { width: 16px; height: 16px; }
.ct-nav a.on { background: var(--panel2); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.ct-nav a .n { margin-left: auto; padding: 1px 7px; border-radius: var(--r-pill); background: var(--warn); color: var(--on-accent); font: 600 12px/1.5 var(--mono); }
.ct-nav.old { gap: 9px; }   /* the live rail today: 38px rows, 47px apart */
.ct-nav.c3 { gap: 3px; }
.ct-nav.c3 a { flex: 0 0 calc((100% - 6px) / 3); height: 40px; min-height: 40px; padding: 0 2px; flex-direction: column; justify-content: center; gap: 3px; font: 500 12px/1.1 var(--sans); white-space: nowrap; overflow: hidden; }
.ct-nav.c3 a.on { box-shadow: none; }
.ct-nav.c3 a.on svg.i { color: var(--accent); }
.ct-nav.c3 a .n { position: absolute; top: 2px; left: calc(50% + 5px); margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font: 700 12px/16px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.ct-boxh { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.ct-sess { display: flex; align-items: center; gap: 9px; min-height: 50px; margin: 0 6px; padding: 5px 2px 5px 10px; border-radius: var(--r-sm); color: var(--mut); }
.ct-sess.cur { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.ct-sess .dot { width: 9px; height: 9px; box-shadow: none; }
.ct-sess .sm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ct-sess .sm b { font: 500 13px var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-sess .sm small { font: 12px/1.3 var(--sans); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-sess .sm small i { font: 600 12px/1.3 var(--mono); letter-spacing: .04em; font-style: normal; color: var(--dim); }
.ct-sess .sm small .work, .ct-sess .sm small.work { color: var(--good); }
.ct-sess .sm small .need, .ct-sess .sm small.need { color: var(--warn); font-weight: 600; }
.ct-sess .badge { font-size: 12px; letter-spacing: .06em; padding: 1px 6px; }
.ct-more { flex: none; width: 28px; height: 40px; padding: 0; border: 0; background: none; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; }
.ct-more.wide { width: 40px; }
.ct-foot { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--line); font: 12px var(--sans); color: var(--mut); white-space: nowrap; }
.ct-foot .seg > * { padding: 0 7px; height: 32px; font: 600 12px var(--sans); }
.ct-foot .iconbtn { width: 32px; height: 32px; border-radius: var(--r-sm); }
/* specimens: each tab state on its own line with what it is */
.ct-spec { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: var(--s3) var(--s5); align-items: center; }
.ct-spec dt { font-size: var(--fs-sm); color: var(--mut); }
.ct-spec dt b { display: block; color: var(--ink); font-weight: 600; }
.ct-spec dd { margin: 0; min-width: 0; }
.ct-spec dd .ltabs { position: relative; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.ct-spec dd.ct-pops { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-start; }
.ct-spec .lt.is-hover { background: var(--panel2); color: var(--ink); }
.ct-spec .lt.is-hover .lt-x { opacity: 1; }
.ct-spec .lt.is-hover::before, .ct-spec .lt.is-hover + .lt::before { display: none; }
.ct-spec .lt-menu, .ct-spec .lt-confirm, .ct-spec .pop { position: static; animation: none; }
.ct-spec .pop .opt { min-height: 36px; }
.ct-spec .pop .opt.danger { color: var(--bad); }
.ct-spec .pop .opt svg.i { width: 16px; height: 16px; color: var(--mut); }
.ct-spec .pop .opt.danger svg.i { color: var(--bad); }
.ct-w420 { max-width: 420px; }
@media (max-width: 699px) { .ct-spec { grid-template-columns: minmax(0, 1fr); gap: var(--s1) 0; } .ct-spec dd { margin-bottom: var(--s4); } }
/* ===== END Cockpit tabs and the short rail ===== */

/* BEGIN Layouts findable (Mike 11-16) */
/* Spec: design/LAYOUTS-FINDABLE.md. Mockup: design/screens/layouts-findable.html (source design/src/layouts-findable.html).
   Mike, 11-16: "I dont see the LAYOUT function any long on this platform". The layout tabs are the layout function, but
   nothing on screen said "Layouts" and the sidebar no longer listed them.
   Part 1: the product rules. A = the Layouts group in the sidebar (#lays, .ls-*). B = the lead-in on the tab row (.lt-lead).
           Written against the app's own selectors; paste as is, after the "Cockpit tabs" rules.
           This block sits inside the cockpit section on purpose: scripts/build-web-assets.js cuts that section, so
           web/css/ds.css and ds-overlay.css stay in sync (test/web-assets.test.js).
           Reuses .lt-dot, .lt-n and .lt-in from the tab rules. The new names do not collide with the dead #layouts / .lay* rules.
   Part 2: mock chrome for the mockup (lf-*). Not part of the product.
   Tokens only. A layout's own colour arrives inline as --sw (the app's palette list, PALS[key].accent). No animation. */

/* --- Part 1 A: the Layouts group in the sidebar --- */
/* Place: in #sidescroll, under the nav block and "Connect a machine", above the Agents header. It shares order 2 with
   #needbar and comes first in the page; a sign-in alert (#authbar, order 1) stays above both. */
#side #lays { order: 2; }
.lays { flex: none; padding: 10px 6px 0; }
/* the header: the word, the count and the fold chevron in one button; "New" at the right end.
   The word has the same face as "Agents" under it, so the two read as sibling groups. */
.ls-h { display: flex; align-items: center; gap: 4px; padding-left: 8px; }
.ls-tog { flex: 1 1 auto; min-width: 0; min-height: 32px; display: flex; align-items: center; gap: 7px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--dim); text-align: left; cursor: pointer; }
.ls-tog .lbl { flex: none; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ls-tog:hover .lbl { color: var(--ink); }
.ls-c { flex: none; font: 500 12px/1 var(--mono); color: var(--dim); }
.ls-tog > svg.i { flex: none; width: 14px; height: 14px; color: var(--dim); }
.ls-tog:focus-visible, .ls-new:focus-visible, .ls-go:focus-visible, .ls-more:focus-visible, .ls-all:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* folded: one row. It keeps the word and names the open layout, so the rail always answers "which layout am I in".
   The amber count is the agents waiting in the other layouts (the same number the chip shows). */
.ls-cur { flex: 0 1 auto; min-width: 0; display: none; align-items: center; gap: 6px; color: var(--ink); font: 600 var(--fs-sm)/1 var(--sans); }
.ls-cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-tog > .lt-n { display: none; }
.lays.fold .ls-cur { display: inline-flex; }
.lays.fold .ls-tog > .lt-n { display: block; }
.lays.fold .ls-c, .lays.fold .ls-list { display: none; }
.lays.fold .ls-tog > svg.i { transform: rotate(-90deg); }
/* New: the same act as the + on the tab row, with its word */
.ls-new { position: relative; flex: none; height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 5px; border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); font: 600 12px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.ls-new:hover { background: var(--panel2); color: var(--ink); }
.ls-new svg.i { width: 14px; height: 14px; }

/* the list: one row per layout, in tab order. The row is two buttons side by side: open it, and its menu. */
.ls-list { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }
.ls-row { position: relative; display: flex; align-items: center; min-height: 32px; border-radius: var(--r-sm); color: var(--mut); touch-action: pan-y; }
.ls-row:hover { background: var(--panel2); color: var(--ink); }
/* the open layout: the rail's own "you are here" mark (the same bar as the open agent row), plus weight. Never colour alone. */
.ls-row.cur { background: var(--panel2); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.ls-go { flex: 1 1 auto; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 9px; padding: 0 4px 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: inherit; font: 500 var(--fs-sm)/1.2 var(--sans); text-align: left; cursor: pointer; }
.ls-row.cur .ls-go { font-weight: 650; cursor: default; }
.ls-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-ct { flex: none; font: 12px/1 var(--mono); color: var(--dim); white-space: nowrap; }
.ls-row.cur .lt-n { display: none; }   /* as on the tab: the open layout shows its waiting agents in the windows themselves */
/* the row menu: always visible (never hover only), quiet until pointed at */
.ls-more { flex: none; width: 28px; height: 28px; margin-right: 2px; padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ls-more:hover, .ls-more[aria-expanded="true"] { background: var(--panel3); color: var(--ink); }
.ls-more svg.i { width: 16px; height: 16px; }
/* rename in the row: the name becomes the tab row's own field (.lt-in) */
.ls-row.edit .ls-go { padding-right: 6px; cursor: text; }
.ls-row.edit .ls-ct, .ls-row.edit .lt-n, .ls-row.edit .ls-more { display: none; }
/* hold and drag to reorder: the same marks as the tab list */
.ls-row.lt-dragging { opacity: .55; }
.ls-row.lt-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.ls-row.lt-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
/* more than six layouts: the rest wait behind one text row, so the agent list keeps the rail. No scroll inside a scroll. */
.ls-list:not(.all) > .ls-row:nth-child(n+7) { display: none; }
.ls-all { min-height: 28px; padding: 0 10px 0 29px; border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); font: 500 12px/1 var(--sans); text-align: left; cursor: pointer; }
.ls-all:hover { background: var(--panel2); color: var(--ink); }
/* one layout only: one line that says what the group is for */
.ls-hint { margin: 0; padding: 5px 10px 0 29px; font: 12px/1.4 var(--sans); color: var(--dim); text-wrap: balance; }

/* sizes. Mouse: 32px rows. Touch: 40px in the tab layout, 44px in the phone drawer (every row in that drawer is 44px). */
@media (pointer: coarse) {
  .ls-tog, .ls-row, .ls-all { min-height: 40px; }
  .ls-more { width: 40px; height: 40px; }
  .ls-new { height: 36px; }
}
#app.tabm #lays .ls-tog, #app.tabm #lays .ls-row { min-height: 40px; }
#app.tabm #lays .ls-more { width: 40px; height: 40px; }
@media (max-width: 699px) {
  #lays .ls-tog, #lays .ls-row, #lays .ls-all { min-height: var(--tap); }
  #lays .ls-more { width: var(--tap); height: var(--tap); }
  #lays .ls-new { height: var(--tap); padding: 0 12px 0 9px; }
}
/* beside the rail on a screen under 700px tall (phone held sideways, Duo spanned): dense on purpose. Do not enlarge. */
@media (min-width: 700px) and (max-height: 699px) {
  #side #lays { padding-top: 4px; }
  #lays .ls-tog, #lays .ls-row, #lays .ls-all, #app.tabm #lays .ls-tog, #app.tabm #lays .ls-row { min-height: 32px; }
  #lays .ls-more, #app.tabm #lays .ls-more { width: 32px; height: 32px; }
  #lays .ls-new { height: 28px; }
}
/* a rail 260px wide or less: the window count steps aside (it stays in the row's title) and "New" keeps its plus only */
@container (max-width: 260px) {
  #lays .ls-ct { display: none; }
  #lays .ls-new { padding: 0 7px; }
  #lays .ls-new span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* --- Part 1 B: the tab row says what it is --- */
/* "All tabs" moves from the right end of the row to the left end and gains its word: LAYOUTS and a chevron. It opens the
   same list (.lt-menu), now from the left, where the eye starts and where the tabs are on a very wide window.
   Same row, same 38px (44px on touch): no height added. Beside a collapsed sidebar it sits after the 58px the row
   already leaves for the open-sidebar button, so the word is there when the sidebar is not. */
.lt-all.lt-lead { position: relative; width: auto; margin: 0 9px 3px 0; padding: 0 4px 0 8px; gap: 2px; color: var(--mut); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.lt-all.lt-lead svg.i { width: 14px; height: 14px; color: var(--dim); }
.lt-all.lt-lead::after { content: ""; position: absolute; right: -5px; top: 7px; bottom: 7px; width: 1px; background: var(--line); }   /* a hairline between the word and the first tab */
@media (pointer: coarse) { .lt-all.lt-lead { margin-bottom: 2px; padding: 0 6px 0 10px; } }
/* The chip sizes (phone, Duo, a tab layout under 700px tall) get no new element and no new height: the chip stays as it is.
   There the word lives in the list the chip opens (its "Layouts" label) and in the sidebar group. */

/* --- Part 2: mock chrome for design/screens/layouts-findable.html. Not part of the product. Reuses ct-* and rf-*. --- */
.lf-wrap { overflow-x: auto; }
.lf-note { display: flex; align-items: center; gap: var(--s2); min-width: 1040px; min-height: 33px; padding: 4px 12px; background: var(--panel2); border-bottom: 1px solid var(--line); font: var(--fs-sm)/1.4 var(--sans); color: var(--mut); }
.lf-note b { color: var(--ink); font-weight: 600; }
.lf-note .lf-n2 { display: none; }
.lf-app { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-width: 1040px; height: calc(100dvh - 37px - 34px); min-height: 640px; background: var(--bg); }
.lf-app > .ct-rail { min-height: 0; }
.lf-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lf-main > .ltabs { flex: none; position: relative; }
.lf-main > .grid { flex: 1 1 auto; }
.lf-main > .sendbar { flex: none; }
.lf-app [hidden] { display: none !important; }
.lf-menu { top: 38px; left: 8px; }
.lf-menu .lt-row[aria-checked="true"] .lt-n { display: none; }
.lf-navshow { display: none; position: absolute; left: 8px; top: 4px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--mut); align-items: center; justify-content: center; }
.lf-navshow svg.i { width: 16px; height: 16px; }
/* state 2: the same screen with the sidebar collapsed (#app.nav-collapsed) */
#st2:checked ~ .stage .lf-app { grid-template-columns: minmax(0, 1fr); }
#st2:checked ~ .stage .lf-app > .ct-rail { display: none; }
#st2:checked ~ .stage .lf-main > .ltabs { padding-left: 58px; }
#st2:checked ~ .stage .lf-navshow { display: inline-flex; }
#st2:checked ~ .stage .lf-menu { left: 58px; }
#st2:checked ~ .stage .lf-note .lf-n1 { display: none; }
#st2:checked ~ .stage .lf-note .lf-n2 { display: inline; }
/* the rail sizes, mirrored from Part 1 A (the mock rails are not #side, so the media and container rules cannot reach them) */
.lays.t40 .ls-tog, .lays.t40 .ls-row, .lays.t40 .ls-all { min-height: 40px; }
.lays.t40 .ls-more { width: 40px; height: 40px; }
.lays.t40 .ls-new { height: 36px; }
.lays.t44 .ls-tog, .lays.t44 .ls-row, .lays.t44 .ls-all { min-height: var(--tap); }
.lays.t44 .ls-more { width: var(--tap); height: var(--tap); }
.lays.t44 .ls-new { height: var(--tap); padding: 0 12px 0 9px; }
.lays.d32 { padding-top: 4px; }
.lays.d32 .ls-tog, .lays.d32 .ls-row { min-height: 32px; }
.lays.d32 .ls-more { width: 32px; height: 32px; }
.lays.d32 .ls-new { height: 28px; }
.lays.n260 .ls-ct { display: none; }
.lays.n260 .ls-new { padding: 0 7px; }
.lays.n260 .ls-new span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ls-row.is-hover { background: var(--panel2); color: var(--ink); }
.rf-rail .qc-side { margin-top: var(--s2); }
.rf-spec-rail .lays { padding-bottom: 6px; }
/* the tab row at its touch size (the product gets this from pointer: coarse) */
.ltabs.t44 { height: 44px; }
.ltabs.t44 .lt { height: 40px; }
.ltabs.t44 .lt[aria-selected="true"] { height: 41px; }
.ltabs.t44 .lt-add, .ltabs.t44 .lt-all { width: 40px; height: 40px; margin-bottom: 2px; }
.ltabs.t44 .lt-all.lt-lead { width: auto; padding: 0 6px 0 10px; }
.ltabs.lf-coll { padding-left: 58px; }
.ltabs.lf-coll .lf-navshow { display: inline-flex; }
/* frames */
.ct-screen.lf-duo { display: block; width: 466px; max-width: 100%; height: 678px; }
.ct-pair.lf-duos > .ct-fig { flex: 0 1 466px; }
.lf-spec-w { max-width: 620px; }
.lf-copy { width: 100%; max-width: 760px; border-collapse: collapse; font-size: var(--fs-sm); }
.lf-copy th, .lf-copy td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lf-copy th { font: 500 var(--fs-micro)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.lf-copy td:nth-child(2) { color: var(--dim); }
.lf-copy td:nth-child(3) { color: var(--ink); font-weight: 600; }
/* END Layouts findable (Mike 11-16) */

/* --- additions used by specific screens --- */
.meter .limit { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px dashed var(--bad); }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 899px) { .cols2 { grid-template-columns: minmax(0, 1fr); } }
.login { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); }
.login > header { display: flex; align-items: flex-start; gap: var(--s3); }
.login > header .main-t { flex: 1; min-width: 0; }
.login > header b { display: block; font-size: 15px; }
.login > header small { font: var(--fs-xs) var(--mono); color: var(--dim); }
.login .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.login .ontrack { font-size: var(--fs-sm); color: var(--mut); }
.login .ontrack b { color: var(--ink); }
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 12px var(--mono); color: var(--mut); border: 1px solid var(--line2); border-radius: var(--r-xs); padding: 2px 7px; }
.tag.move { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s2); align-items: end; }
@media (max-width: 699px) { .inline-form { grid-template-columns: minmax(0, 1fr); } }
.quote { font: 13px/1.5 var(--mono); color: var(--mut); background: var(--panel2); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r-sm); padding: var(--s3); overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); color: var(--mut); }
.checks li { display: flex; gap: 9px; align-items: flex-start; }
.checks li svg { margin-top: 2px; }
.checks li.yes svg { color: var(--good); } .checks li.no svg { color: var(--bad); }
.checks b { color: var(--ink); font-weight: 600; }
.phone-only { display: none; }
@media (max-width: 699px) { .phone-only { display: block; } .desk-only { display: none !important; } }

/* --- asks, decisions, rooms (added with the three feature screens) ---
   Three widths: desktop (700+), Duo two-pane (466 to 699, dense on purpose), phone (up to 465). */
.page.wide { max-width: 1400px; }
textarea.input { padding: 10px var(--s3); min-height: 72px; line-height: 1.4; resize: vertical; display: block; }
.lk { filter: blur(3px); opacity: .5; pointer-events: none; user-select: none; }

/* tabs: page-level views with counts */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--panel2); }
.tab { min-height: 36px; padding: 0 var(--s3); border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); font: 600 13px var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line2); }
.tab .n { font: 600 12px var(--mono); color: var(--dim); }
.tab .n.hot { color: var(--on-accent); background: var(--warn); border-radius: var(--r-pill); padding: 1px 7px; }

/* session identity: state dot, session name, server, agent kind. One line everywhere a session is named. */
.sid { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font: var(--fs-sm) var(--mono); color: var(--ink); }
.sid b { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sid small { font-size: 12px; color: var(--dim); white-space: nowrap; }

/* the answer someone gave. Yes, no and discuss carry state colors plus the word. */
.ans { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--sans); padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--panel3); color: var(--ink); overflow-wrap: anywhere; }
.ans.yes { color: var(--good); background: var(--good-soft); border-color: var(--good-line); }
.ans.no { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.ans.discuss { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }

/* delivery track: answered, then typed into the session (or queued, or failed) */
.track { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; font: var(--fs-xs)/1.4 var(--mono); color: var(--dim); }
.track li { display: inline-flex; align-items: center; gap: 5px; }
.track li + li::before { content: ""; width: 14px; height: 1px; background: var(--line2); }
.track .ok { color: var(--good); } .track .pend { color: var(--warn); } .track .fail { color: var(--bad); }

/* a row icon can carry delivery state */
.row .ico.good { color: var(--good); } .row .ico.warn { color: var(--warn); } .row .ico.bad { color: var(--bad); }
.row .main-t .track { margin-top: 4px; }
.row .main-t .said { display: block; font-size: var(--fs-sm); color: var(--mut); margin-top: 2px; }

/* ask card */
.asklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 1500px) { .asklist { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.ask { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4) var(--s5); }
.ask > header { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.ask .age { margin-left: auto; font: var(--fs-xs) var(--mono); color: var(--dim); white-space: nowrap; }
.ask .q { font-size: var(--fs-md); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ask .ctx { font-size: var(--fs-sm); color: var(--mut); max-width: 72ch; overflow-wrap: anywhere; }
.opts { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.opts .btn { white-space: normal; text-align: left; padding-block: 8px; }
.ask .outcome { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; padding-top: var(--s3); border-top: 1px solid var(--line); }
.ask .outcome .track { flex: 1 1 200px; }

/* decisions */
.dcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (min-width: 1180px) { .dcols { grid-template-columns: minmax(0, 1fr) 300px; } }
.dcols > * { min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
.runbar { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; font: var(--fs-xs) var(--mono); color: var(--dim); }
.runbar b { color: var(--ink); font-weight: 600; }
.dgroup > header { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s4); min-height: var(--tap); border-bottom: 1px solid var(--line); background: var(--panel2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.dgroup > header .ct { margin-left: auto; font: var(--fs-xs) var(--mono); color: var(--dim); white-space: nowrap; }
.ditem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3) var(--s4); padding: var(--s4); align-items: start; }
.ditem + .ditem { border-top: 1px solid var(--line); }
.ditem .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ditem .q { font-size: var(--fs-base); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ditem .q .pill { vertical-align: 2px; margin-left: 4px; }
.ditem .ctx { font-size: var(--fs-sm); color: var(--mut); max-width: 72ch; overflow-wrap: anywhere; }
/* what each option does (Mike 11-18: "A"/"B" alone meant nothing) */
.ditem .optlist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; max-width: 72ch; }
.ditem .optlist li { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.ditem .optlist b { flex: none; min-width: 1.6em; padding: 0 6px; border: 1px solid var(--line2); border-radius: 6px; text-align: center; font-size: var(--fs-xs); color: var(--ink); }
.ditem .optlist span { min-width: 0; }
.ditem .rec { font: var(--fs-xs)/1.5 var(--mono); color: var(--dim); }
.ditem .rec b { color: var(--mut); font-weight: 600; }
.ditem .note { grid-column: 1 / -1; }
.choices { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(68px, auto); gap: 6px; }
.choice { min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--panel2); color: var(--mut); font: 600 13px var(--sans); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.choice:hover { color: var(--ink); border-color: var(--mut); }
.choice svg { display: none; }
.choice.on svg { display: block; }
.choice.on.yes { color: var(--good); background: var(--good-soft); border-color: var(--good); }
.choice.on.no { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.choice.on.discuss { color: var(--info); background: var(--info-soft); border-color: var(--info); }
.agst { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s2); padding: 8px var(--s3); min-height: 40px; }
.agst + .agst { border-top: 1px solid var(--line); }
.agst .sid { flex: 0 1 auto; }
.agst .st { margin-left: auto; font: var(--fs-xs) var(--mono); color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.agst .st.good { color: var(--good); } .agst .st.warn { color: var(--warn); } .agst .st.bad { color: var(--bad); }
.rows.tight > .row { min-height: 48px; padding: 8px var(--s3); }
.rows.tight > .row.on { background: var(--panel2); box-shadow: inset 2px 0 0 var(--accent); }
.cardhead { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s3) var(--s2); }
.cardhead .label { flex: 1; }

/* submit bar: sticks to the bottom of the working column */
.submitbar { position: sticky; bottom: 0; z-index: 20; margin-top: auto; background: var(--panel); border-top: 1px solid var(--line); padding: 10px max(var(--s8), env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(var(--s8), env(safe-area-inset-left, 0px)); }
.submitbar .in { max-width: 1336px; margin: 0 auto; display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.submitbar .cnt { flex: 1 1 150px; min-width: 0; font: var(--fs-sm) var(--mono); color: var(--mut); }
.submitbar .cnt b { color: var(--ink); }

/* dry-run preview: one block per session, showing the exact text that will be typed */
.wsend { display: flex; flex-direction: column; gap: 6px; }
.wsend > header { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.wsend > header .sid { flex: 1 1 0; }
.typed { background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--line2); border-radius: var(--r-sm); font: 12.5px/1.55 var(--mono); padding: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; }
.typed .d { color: var(--term-dim); }

/* picker: tick people or agent sessions (decision roster, room members) */
.picker { display: flex; flex-direction: column; }
.picker .boxh { padding-left: var(--s2); }
.pick { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 4px var(--s2); border-radius: var(--r-sm); cursor: pointer; }
.pick:hover { background: var(--panel2); }
.pick input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.pick .nm { flex: 1 1 0; min-width: 0; font: var(--fs-sm) var(--mono); overflow-wrap: anywhere; }
.pick .nm small { display: block; font: 12px var(--mono); color: var(--dim); }
.pick.person .nm { font: 14px var(--sans); }
.pick.off { cursor: default; } .pick.off .nm { color: var(--dim); }

/* switch and schedule times */
.switchrow { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); }
.switchrow .main-t { flex: 1 1 0; min-width: 0; font-size: var(--fs-sm); }
.switchrow .main-t b { display: block; font-size: 14.5px; }
.switchrow .main-t small { color: var(--dim); font: var(--fs-xs)/1.5 var(--mono); }
.switch { position: relative; width: 46px; height: 28px; flex: none; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--line2); background: var(--panel3); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--mut); transition: transform var(--t) var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--on-accent); }
.timeset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.time { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 2px 0 10px; border: 1px solid var(--line2); border-radius: var(--r-sm); font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.time button { width: 30px; height: 30px; border: 0; background: none; color: var(--dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-xs); }
.time button:hover { color: var(--bad); }
.timeset .input { width: auto; }

/* rooms: list beside a thread */
.rooms { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100dvh; min-height: 0; }
.roomlist { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); padding-bottom: var(--s4); }
.roomlist > header { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); min-height: 56px; }
.roomlist > header h1 { flex: 1; font-size: var(--fs-md); font-weight: 650; }
.roomrow { display: flex; flex-direction: column; gap: 2px; margin: 1px var(--s2); padding: 9px var(--s3); border-radius: var(--r-sm); color: var(--mut); text-decoration: none; cursor: pointer; }
.roomrow:hover, .roomrow.on { background: var(--panel2); }
.roomrow.on { box-shadow: inset 2px 0 0 var(--accent); }
.roomrow .top { display: flex; align-items: baseline; gap: var(--s2); }
.roomrow .top b { flex: 1; min-width: 0; font: 600 13.5px var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roomrow .top time { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.roomrow .last { display: flex; align-items: center; gap: var(--s2); font-size: 12.5px; }
.roomrow .last span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roomrow .unread { font: 700 12px var(--mono); color: var(--ink); background: var(--panel3); border: 1px solid var(--line2); border-radius: var(--r-pill); padding: 0 7px; flex: none; }
.roomrow .who { font: 12px var(--mono); color: var(--dim); }
.thread { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.thead { display: flex; align-items: center; gap: var(--s3); padding: 6px var(--s3) 6px var(--s5); min-height: 56px; border-bottom: 1px solid var(--line); background: var(--panel); }
.thead .back { display: none; }
.thead .tt { flex: 1; min-width: 0; }
.thead .tt b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thead .tt small { display: block; font: 12px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avs { display: inline-flex; padding-left: 6px; flex: none; }
.avs .av { width: 26px; height: 26px; font-size: 12px; margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); }
.posts { overflow-y: auto; padding: var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.posts > * { width: 100%; max-width: 820px; }
.post { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 var(--s3); }
.post > .av { grid-row: 1 / span 2; }
.post .by { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-height: 22px; font-size: 13.5px; }
.post .by b { font-weight: 600; }
.post .by time { font: 12px var(--mono); color: var(--dim); }
.post .tx { grid-column: 2; overflow-wrap: anywhere; }
.post .tx code { font: .86em var(--mono); background: var(--panel3); border-radius: var(--r-xs); padding: 1px 5px; }
/* an agent session's post: square terminal avatar, mono name with server and kind, boxed text */
.post.agent .av { background: var(--term-bg); color: var(--term-ink); border-color: var(--line2); }
.post.agent .by b { font: 600 13px var(--mono); }
.post.agent .by small { font: 12px var(--mono); color: var(--dim); }
.post.agent .tx { margin-top: 4px; padding: var(--s3) var(--s4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xs) var(--r-lg) var(--r-lg) var(--r-lg); }
.post.sys { display: block; text-align: center; font: var(--fs-xs) var(--mono); color: var(--dim); }
.composer { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); background: var(--panel); padding: 9px var(--s3) calc(9px + env(safe-area-inset-bottom, 0px)); }
.composer .msg { font: 16px var(--sans); border-color: var(--line2); }
.composer .msg:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .hears { font: 12px var(--mono); color: var(--dim); padding: 0 2px; }

@media (max-width: 699px) {
  .submitbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .ask { padding: var(--s4); }
  .rows > .row.wrap { flex-wrap: wrap; }
  .rows > .row.wrap .acts { flex: 1 1 100%; padding-left: 48px; flex-wrap: wrap; }
  .track { flex-direction: column; align-items: flex-start; }
  .track li { align-items: flex-start; }
  .track li svg { margin-top: 1px; }
  .track li + li::before { display: none; }
  .rooms { height: calc(100dvh - 57px - env(safe-area-inset-top, 0px)); }
}
/* Duo two-pane, 500 to 699: stays side by side and gets denser. Do not enlarge. */
@media (min-width: 500px) and (max-width: 699px) {
  .ask .q { font-size: var(--fs-base); }
  .opts .btn { min-height: 36px; font-size: 13px; padding-inline: var(--s3); }
  .dgroup > header { min-height: 36px; padding-inline: var(--s3); }
  .ditem { padding: var(--s3); gap: var(--s2) var(--s3); }
  .ditem .q { font-size: 14px; }
  .ditem .ctx { font-size: var(--fs-xs); }
  .choices { grid-auto-columns: auto; gap: 4px; }
  .choice { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .submitbar .btn { min-height: 38px; padding: 0 var(--s3); font-size: 13px; }
  .submitbar .cnt { flex-basis: 110px; font-size: var(--fs-xs); }
  .rooms { grid-template-columns: 172px minmax(0, 1fr); }
  .roomlist > header { min-height: 46px; padding-left: var(--s3); }
  .roomrow { margin: 1px 4px; padding: 6px var(--s2); }
  .roomrow .top b { font-size: 12.5px; }
  .roomrow .last { font-size: 12px; }
  .roomrow .who { display: none; }
  .thead { min-height: 46px; padding-left: var(--s3); }
  .thead .avs { display: none; }
  .posts { padding: var(--s3); gap: var(--s3); }
  .post { grid-template-columns: 26px minmax(0, 1fr); gap: 0 var(--s2); }
  .post .av { width: 26px; height: 26px; font-size: 12px; }
  .post .tx { font-size: 14px; }
  .post.agent .tx { padding: var(--s2) var(--s3); }
}
/* phone, up to 499 (Duo folded included): one column, full-width choices, rooms show the list or the thread */
@media (max-width: 499px) {
  .ditem { grid-template-columns: minmax(0, 1fr); }
  .choices { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice { min-height: var(--tap); }
  .opts .btn { flex: 1 1 100%; justify-content: flex-start; }
  .rooms { grid-template-columns: minmax(0, 1fr); }
  .rooms .roomlist { display: none; border-right: 0; }
  .rooms.list .roomlist { display: flex; }
  .rooms.list .thread { display: none; }
  .thead { padding-left: 4px; gap: var(--s1); }
  .thead .back { display: inline-flex; }
  .thead .avs { display: none; }
  .posts { padding: var(--s4) max(16px, env(safe-area-inset-right, 0px)) var(--s4) max(16px, env(safe-area-inset-left, 0px)); }
}

/* mock chrome for the added screens. Not part of the product. */
#st6:checked ~ .mockbar label[for="st6"] { background: #d97757; border-color: #d97757; color: #191817; font-weight: 600; }
#st6:checked ~ .stage [data-state]:not([data-state~="6"]) { display: none !important; }
.stage .rooms { height: calc(100dvh - 37px); }
@media (max-width: 699px) { .stage .rooms { height: calc(100dvh - 37px - 57px); } }

/* --- accounts board and onboarding (added with the multi-account plans) ---
   Accounts is the app's first screen: one card per connected Claude account, the agents on it, and where
   they were moved. Three widths again: desktop 700+, Duo 466 to 699 (dense on purpose), phone up to 465. */

/* account slots: one pip per account on the plan. Filled = connected, hollow = free slot. */
.pips { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.pips i { width: 7px; height: 12px; border-radius: 2px; background: var(--accent); }
.pips i.off { background: transparent; border: 1px solid var(--line2); }
.pips i.lock { background: transparent; border: 1px dashed var(--dim); }

.acctsum { display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: wrap; font: var(--fs-sm) var(--mono); color: var(--mut); }
.acctsum > span { display: inline-flex; align-items: center; gap: 7px; }
.acctsum b { color: var(--ink); font-weight: 600; }

.acols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (min-width: 1320px) { .acols { grid-template-columns: minmax(0, 1fr) 340px; } }
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--s3); align-items: start; }

.acct { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); min-width: 0; }
.acct.low { border-color: var(--warn-line); }
.acct > header { display: flex; align-items: flex-start; gap: var(--s2); min-width: 0; }
.acct .nm { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct .nm b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 15px/1.3 var(--mono); overflow-wrap: anywhere; }
.acct .nm small { font: var(--fs-xs)/1.4 var(--mono); color: var(--dim); overflow-wrap: anywhere; }

/* one limit: name, meter, percent, then the forecast line. Named .lmt because billing already has .lim. */
.lmts { display: flex; flex-direction: column; gap: var(--s3); }
.lmt { display: grid; grid-template-columns: 54px minmax(0, 1fr) 42px; grid-template-areas: "k m p" ". n n"; align-items: center; gap: 4px var(--s3); }
.lmt .k { grid-area: k; font: 500 var(--fs-micro)/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.lmt .meter { grid-area: m; }
.lmt .pct { grid-area: p; font: 600 14px/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.lmt .note { grid-area: n; font: var(--fs-xs)/1.45 var(--mono); color: var(--dim); }
.lmt .note b { color: var(--mut); font-weight: 600; }
.lmt .note b.over { color: var(--warn); }

/* the agent sessions on an account. Each chip opens "Move to". Filled dot = working, ring = idle. */
.onit { display: flex; flex-direction: column; gap: 6px; }
.schips { display: flex; flex-wrap: wrap; gap: 6px; }
.schip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; max-width: 100%; padding: 0 8px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--panel2); color: var(--ink); font: 12px var(--mono); cursor: pointer; text-decoration: none; }
.schip:hover { border-color: var(--accent); color: var(--accent-ink); }
.schip .snm { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schip .st { color: var(--dim); }
.schip svg.i { width: 13px; height: 13px; color: var(--dim); }
.dot.idle { background: transparent; border: 1.5px solid var(--dim); box-shadow: none; }
.schip.moving { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); cursor: default; }
.schip.arriving { border-style: dashed; border-color: var(--good-line); background: var(--good-soft); color: var(--good); cursor: default; }
.schip.moving .st, .schip.arriving .st { color: inherit; }
.schip.moving svg.i, .schip.arriving svg.i { color: inherit; }
.chipkey { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font: 12px var(--mono); color: var(--dim); }
.chipkey span { display: inline-flex; align-items: center; gap: 6px; }

/* auto-move: the switch, what it will do in words, the threshold, and the manual button */
.amrow { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; padding-top: var(--s3); border-top: 1px solid var(--line); }
.amrow .am { flex: 1 1 130px; min-width: 0; display: flex; flex-direction: column; }
.amrow .am b { font-size: 13.5px; font-weight: 600; }
.amrow .am small { font: var(--fs-xs)/1.4 var(--mono); color: var(--dim); }
.amrow .ctl { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

/* an account found on a machine but outside the plan */
.acct.locked { border-style: dashed; background: transparent; }
.acct.locked .nm b { color: var(--mut); }
.acct.locked p { font-size: var(--fs-sm); color: var(--mut); }
.acct.locked > header > svg { color: var(--dim); margin-top: 2px; }

/* moved agents: newest first. Session, from and to, why, and who or what moved it. */
.moved .mv { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: baseline; padding: var(--s3) var(--s4); }
.moved .mv + .mv { border-top: 1px solid var(--line); }
.mv time { font: var(--fs-xs) var(--mono); color: var(--dim); }
.mv .what { font: var(--fs-sm)/1.45 var(--mono); min-width: 0; overflow-wrap: anywhere; }
.mv .what b { font-weight: 600; }
.mv .what .ar { color: var(--dim); }
.mv .how { font: 600 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mv.now .how { color: var(--warn); }
.mv .why { grid-column: 2 / -1; font-size: var(--fs-xs); color: var(--dim); }
.mv .why a { color: var(--mut); }

/* "Move to": pick the account a session should run on */
.dests { display: flex; flex-direction: column; gap: 6px; }
.dest { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s3); align-items: center; width: 100%; min-height: var(--tap); padding: var(--s3); border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--panel2); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.dest:hover { border-color: var(--accent); }
.dest b { font: 600 14px var(--mono); }
.dest .meter, .dest small { grid-column: 1 / -1; }
.dest small { font: var(--fs-xs) var(--mono); color: var(--dim); }
.dest[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.dest[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }

/* plan ladder: plans are named by how many Claude accounts they cover */
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); }
.rung { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: var(--s3) var(--s4); border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--panel); color: var(--ink); text-decoration: none; cursor: pointer; }
.rung:hover { border-color: var(--accent); }
.rung .nm { font: 600 14px var(--sans); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rung .pr { font: 650 var(--fs-lg)/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rung .pr small { font: 500 var(--fs-xs) var(--mono); color: var(--dim); letter-spacing: 0; }
.rung.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rung.cur { background: var(--panel2); }
@media (max-width: 899px) {
  .ladder { grid-template-columns: minmax(0, 1fr); }
  .rung { flex-direction: row; align-items: center; gap: var(--s3); min-height: var(--tap); padding-block: var(--s2); }
  .rung .nm { flex: 1 1 0; }
  .rung .pips { order: -1; width: 62px; flex-wrap: wrap; }
}

/* plan picker: the ladder as buttons, sized by its own box (the cockpit placeholder and the billing page are
   narrower than the viewport). Rows when narrow, five columns from 600px. Used by .start and the billing page. */
.picker { container: picker / inline-size; }
button.rung { font: inherit; text-align: left; }
.rung[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.picker .ladder { grid-template-columns: minmax(0, 1fr); }
.picker .rung { flex-direction: row; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s2) var(--s4); }
.picker .rung .nm { flex: 1 1 0; }
.picker .rung .pips { order: -1; width: 62px; flex-wrap: wrap; row-gap: 3px; }
.picker .pickq { display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.picker .pickq b { font-weight: 600; }
@container picker (min-width: 600px) {
  .picker .ladder { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .picker .rung { flex-direction: column; align-items: stretch; gap: 6px; padding: var(--s3); }
  .picker .rung .nm { flex: none; }
  .picker .rung .pips { order: 0; width: auto; min-height: 27px; align-content: flex-start; }
}
/* one plan in full under the ladder: price and action on the left, what it includes on the right */
.plan.detail { padding: var(--s5) var(--s6); border-radius: var(--r-lg); min-height: 0; cursor: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5) var(--s8); align-items: start; }
.plan.detail:hover { background: var(--panel); }
.plan.detail .buy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); min-width: 0; }
@container picker (max-width: 599px) {
  .plan.detail { grid-template-columns: minmax(0, 1fr); padding: var(--s4); }
  .plan.detail .buy .btn { width: 100%; }
}

/* start panel: the no-plan state. Count your Claude accounts, start the trial, then connect them. */
.start { display: flex; flex-direction: column; gap: var(--s5); padding: var(--s8); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: var(--ink); font: var(--fs-base)/var(--lh-base) var(--sans); text-align: left; }
.start > h2 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; }
.start > .lede { color: var(--mut); max-width: 60ch; margin-top: calc(-1 * var(--s2)); }
/* due today: the checkout's own line, shown before the click */
.due { display: flex; align-items: center; gap: var(--s3) var(--s6); flex-wrap: wrap; padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel2); }
.due .amt { display: flex; flex-direction: column; gap: 3px; flex: 1 1 240px; min-width: 0; }
.due .amt b { font: 650 var(--fs-2xl)/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.due .amt small { font: var(--fs-xs)/1.4 var(--mono); color: var(--mut); }

/* ---- Store buy: the iOS in-app subscription surfaces. Spec: design/STORE-BUY.md ----
   Paste this block into design/app.css right after the ".due" rules (the "start panel" section), then run
   scripts/build-web-assets.js so it lands in web/css/ds.css. Everything else the flow uses already ships:
   .picker .ladder .rung .plan.pick.detail .due .start .steps .banner .bacts .sheet .card.rows .row .lim .btn .spin .badge.

   Four small things are new:
   1 .buyterms  the price and renewal terms under the subscribe button. They are the App Review 3.1.2 text, so they
                read at 13px in --mut (the .fine line is 12px in --dim, too faint for text a buyer has to be able to read).
   2 .buylinks  Restore purchases, Terms of Use, Privacy Policy as one row of 44px targets (the three fit on one line
                at 390). Restore is a <button>.
   3 .buywait   one status line under the button while the server confirms the purchase (role="status"). Empty, it
                takes no room, so the terms sit right under the button.
   4 .picker[aria-busy]  the ladder is dimmed and inert while a purchase is in flight. */

.buyterms { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; width: 100%; }
.buyterms p { font-size: var(--fs-sm); line-height: 1.5; color: var(--mut); max-width: 62ch; }
.buyterms p b { color: var(--ink); font-weight: 600; }
.buyterms p a { color: var(--ink); text-underline-offset: 3px; }

.buylinks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s1); margin-left: -6px; }
.buylinks a, .buylinks button {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 6px; white-space: nowrap;
  font: 500 var(--fs-xs) var(--sans); color: var(--mut); background: none; border: 0; border-radius: var(--r-sm);
  text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; cursor: pointer;
}
.buylinks a:hover, .buylinks button:hover { color: var(--ink); }
.buylinks button[aria-busy="true"] { pointer-events: none; text-decoration: none; }
.buylinks .spin { width: 14px; height: 14px; }

.buywait { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--mut); }
.buywait:empty { display: none; }

.picker[aria-busy="true"] .rung { opacity: .55; pointer-events: none; }

/* the buy block inside the start panel: the terms sit under the "Due today" box, not inside it */
.start > .buyterms { margin-top: calc(-1 * var(--s2)); }

/* Duo two-pane, 500 to 699: denser on purpose, like the rest of the system. Do not enlarge. */
@media (min-width: 500px) and (max-width: 699px) {
  .buylinks a, .buylinks button { min-height: 34px; }
  .buyterms p { font-size: var(--fs-xs); }
}

@container picker (max-width: 599px) {
  .start { padding: var(--s5) var(--s4); gap: var(--s4); }
  .start > h2 { font-size: var(--fs-lg); }
  .due { padding: var(--s4); }
  .due .btn { width: 100%; }
}

/* onboarding: one column, the three steps in the head */
.ob { min-height: 100dvh; display: flex; flex-direction: column; }
.obhead { display: flex; align-items: center; gap: var(--s3) var(--s5); flex-wrap: wrap; padding: var(--s3) max(var(--s6), env(safe-area-inset-right, 0px)) var(--s3) max(var(--s6), env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--panel); }
.obhead .brand { padding: 0; }
.obbody { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--s10) max(var(--s6), env(safe-area-inset-right, 0px)) var(--s16) max(var(--s6), env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: var(--s5); }
.obbody h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.02em; }
.obbody .lede { color: var(--mut); font-size: var(--fs-md); max-width: 58ch; }
.obnext { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.obnext .fine { flex: 1 1 200px; }
.found .row input.input { min-height: 36px; font: 600 14px var(--mono); max-width: 190px; }
.getapp { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--s5); align-items: center; }
.qr { width: 132px; height: 132px; border: 1px solid var(--line2); border-radius: var(--r-md); background: repeating-conic-gradient(var(--panel3) 0 25%, var(--panel) 0 50%) 0 0 / 22px 22px; display: flex; align-items: center; justify-content: center; }
.qr span { background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-xs); padding: 2px 6px; font: 12px var(--mono); color: var(--dim); }

/* Duo, 466 to 699: week and 5-hour sit side by side, controls drop to 34 px. Do not enlarge. */
@media (min-width: 500px) and (max-width: 699px) {
  .accts { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .acct { padding: var(--s3); gap: var(--s2); }
  .acct .nm b { font-size: 13.5px; }
  .lmts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
  .lmt { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k p" "m m" "n n"; gap: 3px var(--s2); }
  .lmt .pct { font-size: 13px; }
  .lmt .note { font-size: 12px; }
  .schip { min-height: 28px; font-size: 12px; padding: 0 7px; }
  .amrow { padding-top: var(--s2); }
  .amrow .btn.sm, .amrow .select-sm { min-height: 34px; font-size: 12.5px; }
  .amrow .am b { font-size: 12.5px; }
  .moved .mv { padding: var(--s2) var(--s3); grid-template-columns: 52px minmax(0, 1fr) auto; }
  .mv .what { font-size: 12px; }
  .obbody { padding-top: var(--s6); gap: var(--s4); }
  .obbody h1 { font-size: var(--fs-xl); }
  .obbody .lede { font-size: var(--fs-base); }
}
/* phone, up to 499 (Duo folded included): one column, sessions become full-width 44 px rows */
@media (max-width: 499px) {
  .accts { grid-template-columns: minmax(0, 1fr); }
  .schips { flex-direction: column; }
  .schip { min-height: var(--tap); width: 100%; padding: 0 var(--s3); font-size: 13px; }
  .schip .snm { flex: 1 1 0; }
  .amrow .ctl { flex: 1 1 100%; }
  .amrow .ctl .btn { flex: 1 1 0; }
  .amrow .btn.sm, .amrow .select-sm { min-height: var(--tap); }
  .moved .mv { grid-template-columns: minmax(0, 1fr) auto; padding-inline: var(--s3); }
  .mv time { grid-column: 1 / -1; }
  .mv .why { grid-column: 1 / -1; }
  .obhead { padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
  .obbody { padding: var(--s6) max(16px, env(safe-area-inset-right, 0px)) var(--s12) max(16px, env(safe-area-inset-left, 0px)); }
  .obbody h1 { font-size: var(--fs-xl); }
  .obnext .btn { flex: 1 1 100%; }
  .getapp { grid-template-columns: minmax(0, 1fr); }
  .getapp .qr { display: none; }
}
/* mock chrome. Not part of the product. */
.stage .ob { min-height: calc(100dvh - 37px); }

/* ===== Usage: burn trend, runs-out line, pins, moves log, low banner, alerts, Auto-move note (2026-11-14) =====
   Markup and geometry rules: design/DESIGN.md section 13. Specimens: design/screens/usage.html#st6. */

/* --- burn trend: this week's weekly % since the last reset, the projection dashed to the reset, the 100% limit line.
   The svg is stretched (preserveAspectRatio="none"), so strokes are non-scaling and the round marks are HTML. --- */
.trend { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trend > figcaption { display: flex; align-items: baseline; gap: var(--s2); }
.trend .rd { font: var(--fs-xs)/1.3 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend .rd b { color: var(--ink); font-weight: 600; }
.trend .plot { position: relative; height: 64px; --tone: var(--good); --tone-soft: var(--good-soft); touch-action: pan-y; }
.trend.warn .plot { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.trend.bad .plot { --tone: var(--bad); --tone-soft: var(--bad-soft); }
.trend.stale .plot { --tone: var(--dim); --tone-soft: transparent; }
.trend svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.trend svg path { fill: none; vector-effect: non-scaling-stroke; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .base { stroke: var(--line2); stroke-width: 1; }
.trend svg .area { fill: var(--tone-soft); }
.trend .line { stroke: var(--tone); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .proj { stroke: var(--tone); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1 5; }
.trend .lim { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 4; }
.trend .now, .trend .out { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; }
.trend .now { background: var(--tone); box-shadow: 0 0 0 2px var(--panel); }
.trend .out { background: var(--panel); border: 2px solid var(--bad); }
.trend .limtx { position: absolute; left: 0; margin-top: 4px; font: 12px/1 var(--mono); color: var(--dim); pointer-events: none; }
.trend .cross { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--mut); pointer-events: none; }
.trend .days { position: relative; height: 13px; font: 12px/13px var(--mono); color: var(--dim); }
.trend .days span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.trend .days .on { color: var(--ink); }

/* --- runs-out line, under "On track for N% at reset." Icon plus words; never color alone. --- */
.runsout { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); color: var(--mut); }
.runsout svg { color: var(--warn); margin-top: 2px; }
.runsout b { color: var(--warn); font-weight: 600; }
.runsout.out svg, .runsout.out b { color: var(--bad); }

/* --- pinned agent: Auto-move skips it. The pin sits between the state dot and the name. --- */
.schip svg.i.pin { color: var(--ink); }
.schip.moving svg.i.pin { color: inherit; }
.schip.ro { cursor: default; }
.schip.ro:hover { border-color: var(--line2); color: var(--ink); }
.tag svg.i { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.chipkey svg.i { width: 13px; height: 13px; }
.pinrow { padding-top: var(--s3); border-top: 1px solid var(--line); }
.switch:disabled { opacity: .5; cursor: default; }

/* --- recent moves: newest first. Time, agent, from and to, who; a failed move adds one line with the reason. --- */
.mvlog { list-style: none; margin: 0; padding: 0; }
.mvl { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: baseline; padding: var(--s3) var(--s4); }
.mvl + .mvl { border-top: 1px solid var(--line); }
.mvl time { font: var(--fs-xs)/1.45 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mvl .what { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); min-width: 0; font-size: var(--fs-sm); line-height: 1.45; }
.mvl .what b { font-family: var(--mono); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mvl .route { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; color: var(--mut); overflow-wrap: anywhere; }
.mvl .route svg.i { width: 13px; height: 13px; color: var(--dim); }
.mvl .who { font: var(--fs-xs)/1.45 var(--sans); color: var(--mut); text-align: right; white-space: nowrap; }
.mvl .who.auto { font: 600 12px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.mvl .why { grid-column: 2 / -1; display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-xs); color: var(--mut); }
.mvl .why svg { color: var(--bad); margin-top: 1px; }
.mvl .why b { color: var(--bad); font-weight: 600; }
.mvlog .none { padding: var(--s5) var(--s4); font-size: var(--fs-sm); color: var(--mut); max-width: 62ch; }
.mvlog .none b { color: var(--ink); }

/* --- every account low: the bad banner carries its actions on a second line --- */
.banner .bacts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); }

/* --- alerts and notifications: one row per setting, text left, control right --- */
.alerts { display: flex; flex-direction: column; }
.alerts > * + * { border-top: 1px solid var(--line); }
.alerts > .al, .alerts > .lvlbox, .alerts > .alfoot { padding: var(--s3) var(--s4); }
.al { flex-wrap: wrap; gap: var(--s2) var(--s3); }
.al .main-t b { font-weight: 600; font-size: 14.5px; }
.al .main-t .pill { margin-left: 6px; vertical-align: 1px; }
.al .acts { display: flex; align-items: center; gap: var(--s2); flex: none; }
.al.note { display: block; }
.al.note .main-t { display: block; font-size: var(--fs-sm); }
.al .alhelp { margin-top: var(--s1); font-size: var(--fs-sm); color: var(--mut); max-width: 62ch; }
.lvlbox { display: flex; flex-direction: column; gap: var(--s2); }
.lvls { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--mut); }
.lvls li { display: flex; align-items: baseline; gap: var(--s3); }
.lvls .pill { min-width: 46px; justify-content: center; font-family: var(--mono); }

/* --- Auto-move note (first time it is turned on): what it does and what the accounts must be --- */
.acklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: var(--fs-sm); color: var(--mut); }
.acklist li { display: flex; align-items: flex-start; gap: var(--s3); }
.acklist li svg { color: var(--mut); margin-top: 1px; }
.acklist b { color: var(--ink); font-weight: 600; }

/* Duo, 466 to 699: denser on purpose. Do not enlarge. */
@media (min-width: 500px) and (max-width: 699px) {
  .trend .plot { height: 52px; }
  .mvl { padding: var(--s2) var(--s3); }
  .mvl .what { font-size: 12px; }
  .alerts > .al, .alerts > .lvlbox, .alerts > .alfoot { padding: var(--s2) var(--s3); }
  .al .main-t b { font-size: 13.5px; }
  .lvls { font-size: var(--fs-xs); }
  .acklist { gap: var(--s2); font-size: 12.5px; }
}
/* phone, up to 499 (Duo folded included): the log puts time and who on one line, the agent under it; alert buttons go full width */
@media (max-width: 499px) {
  .mvl { grid-template-columns: minmax(0, 1fr) auto; padding-inline: var(--s3); }
  .mvl time { grid-area: 1 / 1; }
  .mvl .who { grid-area: 1 / 2; }
  .mvl .what, .mvl .why { grid-column: 1 / -1; }
  .al .acts { flex: 1 1 100%; order: 3; }
  .al .acts .btn { flex: 1 1 0; min-height: var(--tap); }
  .banner .bacts .btn { flex: 1 1 100%; min-height: var(--tap); }
}

/* Step-up sheet (design/screens/step-up-v2.html, P0 11-14): the Google mark on a button, and the in-app banner's
   Open in Safari / Copy link pair, which stays side by side on a phone. */
.btn .gmark { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.btn.go .gmark { width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; background: var(--panel); }
.banner .bacts.pair .btn { flex: 0 1 auto; }

/* Phone hand-off: "Finish this on your computer" (design/ACTIVATION.md section 3, mockups add-server-phone / onboarding-phone).
   Shown on a phone in place of the setup prompt. Tokens only. */
.handoff { display: flex; flex-direction: column; gap: var(--s4); }
.handoff .ho-top { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.handoff .ho-ico { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--panel2); border: 1px solid var(--line2); color: var(--mut); display: inline-flex; align-items: center; justify-content: center; }
.handoff h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em; }
.handoff .ho-top p { color: var(--mut); margin-top: 4px; max-width: 52ch; }
.handoff .ho-send { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.handoff .ho-send .banner { align-self: stretch; }
.handoff .ho-send:focus { outline: none; }
.handoff .ho-send .hint b { color: var(--mut); font-weight: 600; overflow-wrap: anywhere; }
.handoff .ho-again { display: flex; align-items: center; gap: var(--s1) var(--s3); flex-wrap: wrap; }
.handoff .ho-type { display: flex; flex-direction: column; gap: 6px; padding-top: var(--s4); border-top: 1px solid var(--line); }
.handoff .ho-url { font: 15px/1.4 var(--mono); color: var(--ink); background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-md); padding: 11px var(--s3); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.handoff .ho-alt { display: flex; align-items: center; gap: var(--s1) var(--s3); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--mut); }
.handoff .ho-alt .btn { margin-left: calc(-1 * var(--s3)); }

/* a button that is working: keeps its place and its label, shows a spinner, takes no second tap */
.btn[aria-busy="true"] { pointer-events: none; opacity: .8; }
.btn .spin { width: 16px; height: 16px; border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }

/* Duo two-pane, 466 to 699: denser on purpose. The button sits beside its hint. Do not enlarge. */
@media (min-width: 500px) and (max-width: 699px) {
  .handoff { gap: var(--s3); }
  .card.pad.handoff { padding: var(--s4); }
  .handoff .ho-top { grid-template-columns: 34px minmax(0, 1fr); }
  .handoff .ho-ico { width: 34px; height: 34px; border-radius: var(--r-sm); }
  .handoff h2 { font-size: var(--fs-md); }
  .handoff .ho-top p { font-size: var(--fs-sm); }
  .handoff .ho-send { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); }
  .handoff .ho-send .btn.go { flex: none; }
  .handoff .ho-send > .hint { flex: 1 1 170px; }
  .handoff .ho-send .banner, .handoff .ho-send .ho-again { flex: 1 1 100%; }
  .handoff .ho-type { padding-top: var(--s3); }
  .handoff .ho-url { font-size: 13px; padding: 8px var(--s3); }
}
/* phone, up to 499 (Duo folded included): the primary button is full width */
@media (max-width: 499px) {
  .card.pad.handoff { padding: var(--s4); }
  .handoff .ho-send { align-items: stretch; }
  .handoff .ho-send .btn.go { width: 100%; }
  .handoff .ho-url { font-size: 14px; }
}

/* ===== App Review gate fixes, 2026-11-15 (design spec: Fable). Order matters: this block wins. ===== */
/* 4. tap targets on touch screens */
@media (pointer: coarse) {
  .nav a, .nav button { min-height: var(--tap); }
  .tab { min-height: 38px; } .tabs { padding: 2px; }
  .switch { width: 62px; height: 44px; border: 8px solid transparent; background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--line2); }
  .switch[aria-checked="true"] { box-shadow: none; }
  .switch::after { top: 4px; left: 4px; }
}
@media (max-width: 699px) { .thead .btn.sm[data-edit] { min-width: var(--tap); padding-inline: 0; justify-content: center; } }
/* 5. a disabled primary is neutral, not faded orange */
.btn.go:disabled, .btn.go[aria-disabled="true"] { background: var(--panel3); border-color: var(--line2); color: var(--mut); opacity: 1; }
/* 3. price unit on the selected rung, on the accent wash */
.rung.cur .pr small, .rung.on .pr small, .rung[aria-pressed="true"] .pr small { color: var(--mut); }
/* 7, 8. safe areas: the top inset on every app page, the left inset beside the sidebar */
.topbar { padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
.side { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); }
@media (min-width: 700px) and (min-height: 501px), (min-width: 960px) { .app { grid-template-columns: calc(var(--side-w) + env(safe-area-inset-left, 0px)) minmax(0, 1fr); } }
@media (min-width: 700px) and (min-height: 501px), (min-width: 960px) { .page { padding-top: calc(var(--s8) + env(safe-area-inset-top, 0px)); } }
.obhead { padding-top: calc(var(--s3) + env(safe-area-inset-top, 0px)); }
/* 9. Rooms: right and bottom insets at every width */
.thead { padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); }
.posts { padding-right: max(var(--s6), env(safe-area-inset-right, 0px)); }
@media (min-width: 500px) and (max-width: 699px) { .posts { padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); } }
@media (max-width: 499px) { .posts { padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
.composer { padding-left: max(var(--s3), env(safe-area-inset-left, 0px)); padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); }
.roomrow { overflow: hidden; }
/* 16. one header row: page tools dock into the top bar on small screens */
.topbar .tools { display: flex; align-items: center; gap: var(--s2); flex: none; }
.topbar .tools:empty { display: none; }
.topbar b { font-size: var(--fs-md); }
.topbar .tools .btn { min-height: var(--tap); padding: 0 var(--s3); }
.topbar .tools .btn.quiet .lb { display: none; }
.topbar .tools .btn.quiet { width: var(--tap); padding: 0; justify-content: center; }
body[data-docked] .pagehead h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-docked] .pagehead { flex-wrap: nowrap; }
body[data-docked] .pagehead:not(:has(.pageintro)) { display: none; }
.pageintro { font-size: var(--fs-sm); color: var(--mut); }
.pagehead { flex-wrap: nowrap; }
.pagehead .tt { flex: 1 1 0; }
.pagehead > :not(.tt) { flex: none; }
@media (max-width: 499px) {
  .topbar .tools .btn .lb { display: none; }
  .topbar .tools .btn { width: var(--tap); padding: 0; justify-content: center; }
  .topbar .tools .tabs .tab .lb { display: inline; }
  .topbar .tools .tabs .tab { width: auto; padding: 0 var(--s3); }
}
/* 12. phone held sideways: height is the scarce thing */
@media (max-height: 500px) and (min-width: 700px) and (max-width: 959px) {
  .topbar { padding-top: calc(2px + env(safe-area-inset-top, 0px)); padding-bottom: 2px; }
  .page { padding-top: var(--s3); gap: var(--s3); }
  .pageintro { display: none; }
  .submitbar { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .submitbar .in { flex-wrap: nowrap; }
  .submitbar .cnt { flex: 1 1 0; }
  .rooms { grid-template-columns: 220px minmax(0, 1fr); height: 100dvh; }
  .accts, .cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 17. Rooms: one header row on small screens (the list header carries the burger) */
.roomlist [data-navopen] { display: none; }
@media (max-width: 699px), (max-height: 500px) and (max-width: 959px) {
  body[data-page="rooms"]:has(.rooms) .topbar { display: none; }   /* the no-plan gate has no room list header: keep the top bar (menu, safe area) */
  .rooms, body[data-page="rooms"] .rooms { height: 100dvh; }
  .roomlist [data-navopen] { display: inline-flex; }
  .roomlist > header, .thead { padding-top: env(safe-area-inset-top, 0px); min-height: calc(56px + env(safe-area-inset-top, 0px)); }
  .roomlist { padding-left: env(safe-area-inset-left, 0px); }
  .pop.as-sheet { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
}
.roomlist .roomsfoot { display: none; padding: var(--s4); flex-direction: column; gap: var(--s2); }
@media (max-width: 499px) { .roomlist .roomsfoot { display: flex; } }
/* 19. counts never shrink beside a truncating name */
.tab .n, .nav a .ct, .roomrow .unread, .dgroup > header .ct { flex: none; }
.dgroup > header .sid { flex: 1 1 0; min-width: 0; }
.ask > header { flex-wrap: nowrap; }
.ask > header .sid { flex: 1 1 0; min-width: 0; }
.ask .age { flex: none; }
/* 20. Send feedback row in the sidebar */
.navfoot { margin-top: auto; padding-bottom: var(--s2); }
.navfoot + .sidefoot { margin-top: 0; }
.nav button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--mut); font: inherit; font-size: var(--fs-sm); cursor: pointer; width: 100%; text-align: left; }
.nav button:hover { background: var(--panel2); color: var(--ink); }
button.row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
/* 23. billing ladder: one line per rung */
.rung .nm { flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
/* 24. Decisions run line and send bar */
.runbar { flex-wrap: nowrap; overflow: hidden; }
.runbar > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 699px), (max-height: 500px) { .submitbar .cnt .more { display: none; } }
/* 34. ids and emails never break */
.row .main-t b.id { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.main-t small span { white-space: nowrap; }
/* 36. sentences in sans, machine values in mono */
.row .main-t small, .switchrow .main-t small, .composer .hears { font-family: var(--sans); }
small.m, .m { font-family: var(--mono); }
@media (max-width: 499px) {
  .row .main-t b.id { font-size: 13.5px; }
  .row .main-t small .ip { display: none; }
  .picker .rung .pr small { display: none; }
  .ask > header .sid small { display: none; }
  .submitbar .in { flex-wrap: nowrap; }
  .submitbar .cnt { flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .submitbar #previewbtn { flex: none; width: var(--tap); padding: 0; justify-content: center; }
  .submitbar #previewbtn .lb { display: none; }
  .submitbar #sendbtn { flex: none; }
}
/* the dense Duo two-pane keeps its sizes */
@media (min-width: 500px) and (max-width: 699px) {
  .tab { min-height: 32px; }
  .switch { width: 46px; height: 32px; border-width: 2px 0; }
  .schip { min-height: 32px; }
  .thead .btn.sm[data-edit] { min-width: 36px; }
  .topbar .tools .btn { min-height: 36px; font-size: 13px; }
  .roomlist > header, .thead { min-height: calc(46px + env(safe-area-inset-top, 0px)); }
}
/* gate round 2 (pcheck 11-15 09:24) */
/* Rooms list: nothing in the list pane pushes it wider than its column */
.roomlist { overflow-x: hidden; }
.roomlist > header h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomrow, .roomrow .top { min-width: 0; }
.roomrow .top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomrow .top time { flex: none; }
@media (min-width: 500px) and (max-width: 699px) { .rooms { grid-template-columns: clamp(172px, 33vw, 220px) minmax(0, 1fr); } }
@media (max-height: 500px) and (min-width: 700px) and (max-width: 959px) { .rooms { grid-template-columns: 240px minmax(0, 1fr); } }
/* Rooms thread header beside a sidebar and the list: the people button is an icon, the avatars give way to the title */
@media (max-width: 1179px) {
  .thead .avs { display: none; }
  .thead .btn.sm[data-edit] { min-width: var(--tap); padding-inline: 0; justify-content: center; }
  .thead .btn.sm[data-edit] .desk-only { display: none; }
}
/* a short wide screen (Duo or phone sideways): the sidebar rows tighten so the whole sidebar fits above the home indicator */
@media (pointer: coarse) and (min-width: 700px) and (max-height: 720px) {
  .nav a, .nav button { min-height: 38px; }
  .side .brand { padding-block: var(--s3); }
  .side .label { padding-top: var(--s3); }
}
/* billing ladder: the selected rung is marked by its border and wash; the CURRENT word stays for screen readers only */
@media (max-width: 1179px) {
  .rung .badge { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* the one tool on a page keeps its label in the top bar (Servers: Add server) */
@media (max-width: 499px) {
  .topbar .tools > .btn:only-child:not(.quiet) { width: auto; padding: 0 var(--s3); }
  .topbar .tools > .btn:only-child:not(.quiet) .lb { display: inline; }
}

/* gate round 3: 44px targets wherever the layout is not the dense Duo two-pane (phones, Duo folded, phone landscape) */
@media (pointer: coarse) and (max-width: 499px), (pointer: coarse) and (max-height: 500px) {
  .tab { min-height: var(--tap); }
  .choice { min-height: var(--tap); }
}

/* review #183 item 7: Asks empty state says what an Ask is, with an inert sample card */
.ask-empty { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); align-items: start; }
.ask-empty .ae-words, .ask-empty .ae-ex { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); min-width: 0; }
.ask-empty .ae-words p { max-width: 68ch; }
.ask-empty h3 { font-size: 15px; font-weight: 600; margin: var(--s2) 0 0; }
.ask-empty .ae-ex { align-self: stretch; }
.ask-empty .ask-sample { width: 100%; pointer-events: none; user-select: none; }
.ask-empty .ask-sample .pill { margin-left: auto; }
.ask-empty .ask-sample .pill + .age { margin-left: 0; }
@media (min-width: 1500px) { .ask-empty { grid-template-columns: minmax(0, 1fr) minmax(320px, 480px); gap: var(--s8); } }

/* review #183 item 8: roster Select all / Clear, overall and per machine; the list scrolls inside the dialog */
.lblrow .rs-sel, .boxh .rs-sel { display: inline-flex; gap: 8px; flex: none; }
.lblrow { display: flex; align-items: center; gap: var(--s2) var(--s3); flex-wrap: wrap; }
.boxh .bn { flex: none; }
.boxh .bc { font: 12px var(--mono); letter-spacing: 0; text-transform: none; color: var(--dim); }
.boxh .sp { flex: 1; }
.boxh .rs-sel .btn { text-transform: none; letter-spacing: 0; font-family: var(--sans); }
.picker.rpick { max-height: max(220px, calc(100dvh - 440px)); overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.picker.rpick .boxh { position: sticky; top: 0; z-index: 1; background: var(--panel); min-height: 40px; padding-top: 5px; }
@media (max-width: 499px) {
  .lblrow .rs-sel { width: 100%; justify-content: flex-end; }
  .boxh { flex-wrap: wrap; }
  .boxh .rs-sel { width: 100%; justify-content: flex-end; }
}
.sheet .banner.accent + .stack { margin-top: var(--s3); }

/* review #183 item 9: Usage uses the full width of the main column, left-aligned */
.page.full { max-width: none; margin: 0; }
@media (min-width: 1500px) { .page.full .cols2 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 2200px) { .page.full .cols2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.page.full .cols2.accts1 { max-width: 1040px; }
.page.full > .fine, .page.full #content > .fine { max-width: 90ch; }
.um-top, .um-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.um-two { gap: var(--s5); align-items: start; }
@media (min-width: 1500px) {
  .um-top { grid-template-columns: minmax(0, 1fr) 420px; align-items: stretch; }
  .um-top > .banner, .um-top > .card { margin: 0; }
  .um-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* Usage merge (2026-11-15): "readings differ" mark on a login card */
.card.login .m.df{color:var(--warn);text-decoration:underline dotted;text-underline-offset:2px;cursor:help;white-space:nowrap}

/* Guide (onboarding agent) */
/* ===== Orpheus Guide: a chat that gets machines and agents into Orpheus (2026-11-15) =====
   Mockup: design/screens/guide.html. Spec, copy and behaviour: design/GUIDE.md. Tokens only.
   Layout: head, thread, composer, in the main column. One quiet 720 px column. Your messages sit right in a soft
   block and the guide's words are plain text, as in the Read view (.turn.you, .turn.agent, .rl, .rt). What the guide
   did shows as cards in the thread: the setup prompt, the waiting and connected rows, the servers card, code.
   The parts follow the chat's own width (container gchat), not the screen, so one markup fits the page and a phone. */
.gchat { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; min-height: 0; min-width: 0; container: gchat / inline-size; }
.gc-head { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 6px max(var(--s3), env(safe-area-inset-right, 0px)) 6px max(var(--s6), env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: var(--panel); }
.gc-head h1 { flex: 1; min-width: 0; font-size: var(--fs-md); font-weight: 650; }
.gchat > .gc-head { grid-row: 1; } .gchat > .gc-thread { grid-row: 2; } .gchat > .gc-composer { grid-row: 3; } /* rows stay put when the head is hidden on small screens */
.gc-thread { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: var(--s6) max(var(--s6), env(safe-area-inset-right, 0px)) var(--s6) max(var(--s6), env(safe-area-inset-left, 0px)); }
.gc-col { flex: 1 0 auto; width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; font-size: var(--fs-base); line-height: 1.55; }

/* turns: the Read view's names and look */
.gchat .turn { margin: 0; min-width: 0; max-width: 100%; }
.gchat .turn.you { align-self: flex-end; max-width: min(86%, 560px); border: 1px solid var(--line); background: var(--panel2); border-radius: 14px 14px 4px 14px; padding: 8px 13px; }
.gchat .turn.agent { display: flex; flex-direction: column; gap: var(--s3); }
.gchat .turn.agent .rl { font: 500 var(--fs-micro)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: -5px; }
/* message times (design/MESSAGE-TIMES.md): the Read view's meta line. "GUIDE · 14:06" on the guide's reply; your bubble
   shows the time on top and keeps "You" for screen readers only. */
.gchat .turn .rl { display: flex; align-items: baseline; gap: 0 6px; min-width: 0; }
.gchat .rl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gchat .mtime { flex: none; font: 400 var(--fs-micro)/1 var(--mono); letter-spacing: 0; text-transform: none; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.gchat .turn.agent .rl-n + .mtime::before { content: "·"; content: "·" / ""; margin-right: 6px; }
.gchat .turn.you .rl { margin: 0 0 4px; }
.gchat .turn.you .rl-n { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gchat .rt { overflow-wrap: anywhere; max-width: 66ch; }
.gchat .rt > * { margin: 0 0 .7em; }
.gchat .rt > :last-child { margin-bottom: 0; }
.gchat .rt b { font-weight: 650; }
.gchat .rt ol, .gchat .rt ul { padding-left: 1.3em; }
.gchat .rt li { margin: .25em 0; padding-left: .15em; }
.gchat .rt li::marker { color: var(--dim); }
.gchat code { font: .86em var(--mono); background: var(--panel3); border-radius: var(--r-xs); padding: 1px 5px; }

/* one dim line for each thing the guide did (read your servers, made a prompt). Never the tool's raw output. */
.gc-did { display: flex; align-items: center; gap: var(--s2); min-height: 20px; font: 400 var(--fs-sm)/1.3 var(--sans); color: var(--dim); }
/* the guide is answering */
.gc-working { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: 14px; line-height: 1.3; color: var(--mut); }
.gc-working .dots { display: inline-flex; gap: 4px; }
.gc-working .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--good); animation: gcdot 1.2s ease-in-out infinite; }
.gc-working .dots i:nth-child(2) { animation-delay: .15s; }
.gc-working .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes gcdot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* a card in the thread: a head line (label, machine name, state on the right), then its body */
.gc-card { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); min-width: 0; }
.gc-ch { display: flex; align-items: center; gap: var(--s1) var(--s3); flex-wrap: wrap; min-height: 26px; }
.gc-ch > b { font: 600 var(--fs-sm) var(--mono); min-width: 0; overflow-wrap: anywhere; }
.gc-ch .count { font-size: var(--fs-xs); gap: 6px; white-space: nowrap; }
.gc-meta { font-size: var(--fs-xs); color: var(--dim); }

/* setup prompt: the same one-use prompt as Add server. The token is masked in the text and added on copy. */
.gc-prompt .code { padding: var(--s3) var(--s4); font-size: 12.5px; }
.gc-prompt .bar-time { margin-top: calc(-1 * var(--s1)); }
.gc-prompt.low .bar-time i { background: var(--warn); }
.gc-cf { display: flex; align-items: center; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.gc-cf .btn { flex: none; }
.gc-cf .hint { flex: 1 1 220px; min-width: 0; }
/* after it is used, expired or cannot be shown again: the head line and one sentence */
.gc-prompt.used, .gc-prompt.expired, .gc-prompt.gone { gap: var(--s2); padding-block: var(--s3); }

/* waiting for the connector, then connected */
.gc-wait b { color: var(--ink); }
.gc-ok { font-size: 14.5px; }
.gc-ok .btxt { display: flex; flex-direction: column; gap: var(--s2); }
.gc-ok .btxt p { color: var(--ink); }
.gc-ok .btxt p.gc-meta { color: var(--mut); }
.gc-next { display: flex; flex-direction: column; gap: var(--s2); }

/* servers card: one row per server. Dot and pill say online or offline; the counts say shared and hidden. */
.gc-status { padding: 0; gap: 0; }
.gc-status .gc-ch { padding: var(--s3) var(--s4) var(--s2); }
.gc-status .rows { border-top: 1px solid var(--line); }
.gc-status .rows > .row { padding-inline: var(--s4); }
.gc-status .row .main-t b { font: 600 13.5px/1.4 var(--mono); }
.gc-n { font: var(--fs-xs) var(--mono); font-variant-numeric: tabular-nums; color: var(--mut); white-space: nowrap; }
.gc-n b { color: var(--ink); font-weight: 600; }
.gc-n.warn, .gc-n.warn b { color: var(--warn); }

/* a file snippet: where it goes, the code with Copy, what happens after */
.gc-file { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gc-cap { font: var(--fs-xs)/1.4 var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.gc-file .code .tok { color: var(--term-ink); background: var(--warn-soft); box-shadow: 0 0 0 2px var(--warn-soft); border-radius: 2px; }

/* suggestion chips: sentences, so sans. One .lead chip at most, and only while no machine is connected. */
.gc-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.gchat > .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gc-chips .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%; padding: 0 14px; font: 500 13.5px/1.2 var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r-pill); cursor: pointer; text-decoration: none; transition: border-color var(--t-fast), color var(--t-fast); }
.gc-chips .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.gc-chips .chip.lead { font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.gc-chips .btn.sm { border-radius: var(--r-pill); }
@media (pointer: coarse) { .gc-chips .chip { min-height: var(--tap); } }

/* first open */
.gc-empty { margin: auto 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); padding-block: var(--s6); }
.gc-empty .gc-ico { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--panel2); border: 1px solid var(--line2); color: var(--mut); display: inline-flex; align-items: center; justify-content: center; }
.gc-empty h2 { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.01em; }
.gc-empty p { color: var(--mut); max-width: 56ch; }

/* limit reached, guide unavailable: a banner in the thread with the way out */
.gc-stop { font-size: 14px; }

/* composer: the Rooms composer in the thread's column, with the one-line note on what the guide can and cannot do */
.gc-composer { padding: var(--s3) max(var(--s6), env(safe-area-inset-right, 0px)) calc(var(--s3) + env(safe-area-inset-bottom, 0px)) max(var(--s6), env(safe-area-inset-left, 0px)); }
.gc-composer > * { width: 100%; max-width: 720px; margin-inline: auto; }
.gc-composer .msg { display: block; resize: none; max-height: 168px; font: 16px/1.4 var(--sans); }
.gc-composer .msg:disabled { background: var(--panel); border-color: var(--line); color: var(--dim); }
.gc-composer .inrow .btn.go { width: var(--tap); padding: 0; flex: none; }
.gc-fine { margin-block: 0; }

/* the app's small-screen layout (drawer and top bar): the page title and "New chat" live in the top bar */
@media (max-width: 699px), (max-height: 500px) and (max-width: 959px) {
  .gchat { height: calc(100dvh - 57px - env(safe-area-inset-top, 0px)); }
  .gc-head { display: none; }
}
/* Duo two-pane and narrower, by the chat's own width: denser on purpose. Do not enlarge. */
@container gchat (max-width: 699px) {
  .gc-thread { padding-top: var(--s4); padding-bottom: var(--s4); padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px)); }
  .gc-col { gap: var(--s4); font-size: 14px; }
  .gc-card { padding: var(--s3); }
  .gc-status { padding: 0; }
  .gc-status .gc-ch { padding: var(--s2) var(--s3); }
  .gc-status .rows > .row { padding-inline: var(--s3); }
  .gc-prompt .code { font-size: 12px; padding: 10px var(--s3); }
  .gc-empty h2 { font-size: var(--fs-lg); }
  .gc-composer { padding-top: var(--s2); padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px)); }
  .gc-composer .msg { font-size: 16px; }
}
/* phone, by the chat's own width: 15 px text, 44 px targets, the primary button full width, counts under the name */
@container gchat (max-width: 499px) {
  .gc-col { font-size: var(--fs-base); }
  .gchat .turn.you { max-width: 90%; padding: 7px 12px; }
  .gc-cf .btn.go { flex: 1 1 100%; }
  .gc-cf .hint { flex-basis: 100%; }
  .gc-chips .chip, .gc-chips .btn.sm { min-height: var(--tap); }
  .gc-status .rows > .row { flex-wrap: wrap; row-gap: 2px; }
  .gc-status .gc-n { order: 3; flex: 1 1 100%; padding-left: 19px; white-space: normal; }
  .gc-stop .bacts .btn { flex: 1 1 100%; min-height: var(--tap); }
  .gc-file .code { padding-right: var(--s4); padding-bottom: 60px; }
  .gc-file .code .copy { top: auto; bottom: 10px; left: 10px; right: 10px; justify-content: center; min-height: var(--tap); }
}
@media (prefers-reduced-motion: reduce) { .gc-working .dots i { opacity: 1; } }

/* mock chrome for the guide. Not part of the product. */
.stage .gchat { height: calc(100dvh - 37px); }
@media (max-width: 699px) { .stage .gchat { height: calc(100dvh - 37px - 57px); } }
.gc-board { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: var(--s6); padding: var(--s6) max(16px, env(safe-area-inset-right, 0px)) var(--s12) max(16px, env(safe-area-inset-left, 0px)); }
.gc-frame { margin: 0; flex: 0 1 540px; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.gc-frame.phone { flex: 0 1 390px; }
.gc-frame figcaption { font: 500 var(--fs-micro)/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.gc-frame .gc-screen { height: 620px; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); border: 1px solid var(--line2); border-radius: var(--r-xl); }
.gc-frame.phone .gc-screen { height: 844px; }
.gc-frame .topbar { display: flex; position: static; flex: none; padding-top: 6px; }
.stage .gc-frame .gchat { flex: 1 1 auto; height: auto; min-height: 0; }
.gc-frame.phone .gc-thread { display: flex; flex-direction: column-reverse; } /* mock: opens scrolled to the newest turn, as the product does */
.gc-frame.phone .gc-head { display: none; }

/* ===== Guide window and quick connect ===== (2026-11-15, PROPOSED)
   Mockup: design/screens/guide-window.html. Spec, copy, states and API calls: design/GUIDE-WINDOW.md. Tokens only.
   Placement: this block sits OUTSIDE the cockpit section on purpose. scripts/build-web-assets.js cuts the cockpit section
   out of web/css/ds.css and web/css/ds-overlay.css, so only rules out here reach the app. In the cockpit (index.html)
   mount the window and the popup inside a <div class="ds">, because the overlay scopes every rule under .ds.
   Two parts, prefixed so nothing collides:
   gw-  the Guide window. An agent window that floats over any app page in the Guide's own colour (iris, --guide*).
        Desktop: docked bottom-right, 400 x up to 640, not modal. Phone (up to 699): a full-height sheet, modal.
        Mode switch Guide / Feedback in the head; one window, two panels.
   qc-  quick connect. One click makes a one-time setup prompt and shows it with one big Copy button.
        A centred dialog on desktop, a bottom sheet on phones. It uses the app accent: it is an app action, not the Guide.
   --gw-lift: set on <html> by pages with a bottom bar (the cockpit's send bar) to its height, so the window and the
   minimised pill sit above it and never cover Send. 0 everywhere else. */

/* --- the window --- */
.gw { position: fixed; z-index: var(--z-guide); right: max(var(--s4), env(safe-area-inset-right, 0px)); bottom: calc(var(--s4) + var(--gw-lift, 0px) + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 2 * var(--s4))); height: min(640px, calc(100dvh - 2 * var(--s4) - var(--gw-lift, 0px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--panel); color: var(--ink); border: 1px solid var(--guide-line); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden; font: var(--fs-base)/var(--lh-base) var(--sans); transform-origin: 100% 100%; animation: gw-in var(--t) var(--ease); }
.gw.gw-still { animation: none; }   /* reopened after a page load: no entrance */
.gw :focus-visible { outline-color: var(--guide); }
@keyframes gw-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* head: the Guide's mark, the mode switch (it is the window's title), minimise, close */
.gw-head { display: flex; align-items: center; gap: var(--s2); min-height: 52px; padding: var(--s2) var(--s2) var(--s2) var(--s3); background: var(--guide-soft); border-bottom: 1px solid var(--guide-line); }
.gw-mark { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--guide-line); color: var(--guide-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gw-modes { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--panel); border: 1px solid var(--guide-line); min-width: 0; }
.gw-mode { min-height: 30px; padding: 0 var(--s3); border: 0; border-radius: var(--r-pill); background: none; color: var(--mut); font: 600 13px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.gw-mode:hover { color: var(--ink); }
.gw-mode[aria-selected="true"] { background: var(--guide); color: var(--on-guide); }
.gw-head .sp { flex: 1; }
.gw-tool { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--mut); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.gw-tool:hover { color: var(--guide-ink); border-color: var(--guide-line); background: var(--panel); }

/* a panel: Guide (thread + composer) or Feedback (form + foot) */
.gw-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; }

/* thread: one scroller. Your messages sit right in a soft block; the Guide's words are plain text. */
.gw-thread { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); font-size: 14.5px; line-height: 1.5; }
.gw-who { font: 500 var(--fs-micro)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--guide-ink); }
.gw-intro { display: flex; flex-direction: column; gap: var(--s3); }
.gw-intro h2 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -.005em; }
.gw-intro p { color: var(--mut); }
.gw-you { align-self: flex-end; max-width: 88%; padding: 7px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; overflow-wrap: anywhere; }
.gw-say { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
/* message times (design/MESSAGE-TIMES.md): each message opens with its time. The window has no speaker labels, so the
   time stands alone: on top inside your bubble, and as the first line of the Guide's reply. */
.gw-thread .mtime { display: block; width: fit-content; font: 400 var(--fs-micro)/1 var(--mono); letter-spacing: 0; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.gw-you > .mtime { margin-bottom: 4px; }
.gw-say > .mtime { margin-bottom: calc(7px - var(--s3)); }
.gw-rt { overflow-wrap: anywhere; }
.gw-rt > * { margin: 0 0 .6em; }
.gw-rt > :last-child { margin-bottom: 0; }
.gw-rt b { font-weight: 650; }
.gw-rt ol, .gw-rt ul { padding-left: 1.3em; }
.gw-rt code { font: .86em var(--mono); background: var(--panel3); border-radius: var(--r-xs); padding: 1px 5px; }
.gw-did { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--dim); }
.gw-working { display: flex; align-items: center; gap: 10px; min-height: 22px; font-size: var(--fs-sm); color: var(--mut); }
.gw-working .dots { display: inline-flex; gap: 4px; }
.gw-working .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--guide); animation: gw-dot 1.2s ease-in-out infinite; }
.gw-working .dots i:nth-child(2) { animation-delay: .15s; } .gw-working .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes gw-dot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* starter chips: sentences, so sans. "Connect a machine" leads, in the Guide's colour. */
.gw-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gw-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font: 500 13px/1.2 var(--sans); text-align: left; cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.gw-chip:hover { border-color: var(--guide); color: var(--guide-ink); }
.gw-chip svg { color: var(--guide-ink); }
.gw-chip.lead { background: var(--guide-soft); border-color: var(--guide-line); color: var(--guide-ink); font-weight: 600; }

/* buttons in the Guide's colour (with .btn) */
.btn.gw-go { background: var(--guide); border-color: var(--guide); color: var(--on-guide); }
.btn.gw-go:hover { background: var(--guide2); border-color: var(--guide2); color: var(--on-guide); }
.btn.gw-quiet:hover { border-color: var(--guide); color: var(--guide-ink); }

/* composer and the scope line */
.gw-composer { display: flex; flex-direction: column; gap: 6px; padding: var(--s3) var(--s3) var(--s2); border-top: 1px solid var(--line); background: var(--panel); }
.gw-inrow { display: flex; align-items: flex-end; gap: var(--s2); }
.gw-input { flex: 1; min-width: 0; display: block; min-height: var(--tap); max-height: 144px; resize: none; padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); font: 15px/1.4 var(--sans); }
.gw-input::placeholder { color: var(--dim); }
.gw-input:focus { outline: none; border-color: var(--guide); box-shadow: 0 0 0 3px var(--guide-soft); }
.gw-input:disabled { background: var(--panel); border-color: var(--line); color: var(--dim); }
.gw-send { width: var(--tap); height: var(--tap); flex: none; border: 0; border-radius: var(--r-md); background: var(--guide); color: var(--on-guide); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.gw-send:hover { background: var(--guide2); }
.gw-send:disabled { opacity: .4; cursor: default; }
.gw-scope { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-xs); line-height: 1.4; color: var(--dim); }
.gw-scope svg { margin-top: 1px; }

/* the feedback card the Guide offers in the thread (SSE card kind 'feedback'). Nothing is sent until Send. */
.gw-fb { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3); border: 1px solid var(--guide-line); border-radius: var(--r-lg); background: var(--panel2); min-width: 0; }
.gw-fb-h { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.gw-kindtag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--guide-line); background: var(--guide-soft); color: var(--guide-ink); font: 600 12px/1.2 var(--sans); }
.gw-fb-st { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font: var(--fs-xs) var(--mono); color: var(--dim); white-space: nowrap; }
.gw-fb-text { font-size: 14px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.gw-fb-acts { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.gw-fb-acts .btn { min-height: 36px; }
.gw-fb .err { font-size: var(--fs-xs); }
.gw-fb.sent { background: var(--panel); border-color: var(--good-line); }
.gw-fb.sent .gw-fb-st { color: var(--good); }
.gw-fb.sent .gw-fb-text, .gw-fb.moved .gw-fb-text { color: var(--mut); }
.gw-fb.moved { background: var(--panel); border-style: dashed; border-color: var(--line2); }

/* Feedback panel: kind, text, send; then the confirmation */
.gw-fbody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.gw-fbody > p { color: var(--mut); font-size: 14.5px; }
.gw-kinds { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gw-kind { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line2); background: var(--panel); color: var(--mut); font: 600 13px/1 var(--sans); cursor: pointer; }
.gw-kind:hover { color: var(--ink); border-color: var(--guide-line); }
.gw-kind svg { display: none; }
.gw-kind[aria-checked="true"] { background: var(--guide-soft); border-color: var(--guide); color: var(--guide-ink); }
.gw-kind[aria-checked="true"] svg { display: inline; }
.gw-ftext { min-height: 156px; resize: vertical; font: 15px/1.45 var(--sans); }
.gw-ftext:focus { border-color: var(--guide); box-shadow: 0 0 0 3px var(--guide-soft); }
.gw-ffoot { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); background: var(--panel); }
.gw-ffoot .btn { width: 100%; }
.gw-done { margin: auto 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); padding-block: var(--s4); }
.gw-done-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--good-soft); border: 1px solid var(--good-line); color: var(--good); display: inline-flex; align-items: center; justify-content: center; }
.gw-done h2 { font-size: var(--fs-lg); font-weight: 650; }
.gw-done p { color: var(--mut); }
.gw-sent { align-self: stretch; padding: var(--s3); border-radius: var(--r-md); background: var(--panel2); border: 1px solid var(--line); font-size: 14px; color: var(--mut); white-space: pre-wrap; overflow-wrap: anywhere; }
.gw-done-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* minimised: the window folds to a pill in the same corner. A dot = a reply came while it was folded. */
.gw-pill { position: fixed; z-index: var(--z-guide); right: max(var(--s4), env(safe-area-inset-right, 0px)); bottom: calc(var(--s4) + var(--gw-lift, 0px) + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); max-width: calc(100vw - 2 * var(--s4)); padding: 0 var(--s4) 0 6px; border-radius: var(--r-pill); border: 1px solid var(--guide-line); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); font: 600 14px/1.2 var(--sans); cursor: pointer; animation: gw-in var(--t) var(--ease); }
.gw-pill:hover { border-color: var(--guide); }
.gw-pill .gw-mark { position: relative; width: 32px; height: 32px; border-radius: 50%; }
.gw-pill small { font: 400 var(--fs-xs) var(--mono); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gw-unread { position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--guide); box-shadow: 0 0 0 2px var(--panel); }

/* the sidebar "Guide" item while the window is open or folded */
.gw-navdot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--guide); flex: none; }

/* --- quick connect --- */
.qc-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-scrim); }
.qc { position: fixed; z-index: var(--z-sheet); left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(540px, calc(100vw - 2 * var(--s4))); max-height: calc(100dvh - var(--s12)); display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--panel); color: var(--ink); border: 1px solid var(--line2); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden; font: var(--fs-base)/var(--lh-base) var(--sans); animation: qc-in var(--t) var(--ease); }
@keyframes qc-in { from { opacity: 0; } }
.qc-grab { display: none; }
.qc-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s3) var(--s2) var(--s5); }
.qc-ic { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.qc-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.qc-tt h2 { font-size: var(--fs-lg); font-weight: 650; }
.qc-tt p { font: var(--fs-xs) var(--mono); color: var(--dim); }
.qc-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.qc-lead { color: var(--mut); font-size: 14.5px; }
.qc-lead b { color: var(--ink); font-weight: 600; }
.qc-name { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px var(--s2); }
.qc-name .field { flex: 1 1 220px; min-width: 0; }
.qc-name .btn { flex: none; }
.qc-name .hint { flex: 1 1 100%; }
/* the prompt: terminal ground in both themes. The token is masked here and copied in full. */
.qc-code { max-height: 168px; overflow-y: auto; overscroll-behavior: contain; padding: var(--s3) var(--s4); border: 1px solid var(--line2); border-radius: var(--r-md); background: var(--term-bg); color: var(--term-dim); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.qc-code .tok { color: var(--term-ink); }
.qc-skel { display: flex; flex-direction: column; gap: 10px; padding-block: 4px; }
.qc-skel i { display: block; height: 9px; border-radius: 5px; background: var(--term-dim); opacity: .3; animation: qc-skel 1.2s ease-in-out infinite; }
.qc-skel i:nth-child(2) { width: 92%; } .qc-skel i:nth-child(3) { width: 74%; } .qc-skel i:nth-child(4) { width: 48%; }
@keyframes qc-skel { 50% { opacity: .12; } }
.qc-copy { width: 100%; min-height: 48px; font-size: 15px; }
.qc-copy.done, .qc-copy.done:hover { background: var(--good); border-color: var(--good); color: var(--on-accent); }
.qc-exp { display: flex; flex-direction: column; gap: 6px; }
.qc-exp .count { font-size: var(--fs-xs); }
.qc-exp.low .bar-time i { background: var(--warn); }
.qc-cmds { border-top: 1px solid var(--line); padding-top: var(--s3); }
.qc-cmds > summary { display: flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; font: 600 var(--fs-sm) var(--sans); color: var(--mut); list-style: none; }
.qc-cmds > summary::-webkit-details-marker { display: none; }
.qc-cmds > summary svg { transition: transform var(--t-fast); }
.qc-cmds[open] > summary svg { transform: rotate(180deg); }
.qc-cmds > summary:hover { color: var(--ink); }
.qc-cmds .code { margin-top: var(--s2); font-size: 12px; }
.qc-wait b { color: var(--ink); }
.qc-wait code { font: .9em var(--mono); }
/* the end states: one icon, one sentence, one or two buttons */
.qc-end { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.qc-end-ic { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line2); background: var(--panel2); color: var(--mut); }
.qc-end-ic.good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
.qc-end-ic.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.qc-end-ic.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.qc-end h3 { font-size: var(--fs-md); font-weight: 650; }
.qc-end p { color: var(--mut); font-size: 14.5px; }
.qc-acts { display: flex; gap: var(--s2); flex-wrap: wrap; align-self: stretch; }
.qc-acts .btn { flex: 1 1 160px; }

/* entry point in the cockpit rail: first row above the agent list */
.qc-side { display: flex; align-items: center; gap: 9px; width: calc(100% - 2 * var(--s2)); min-height: 36px; margin: 0 var(--s2) var(--s1); padding: 0 10px; border-radius: var(--r-sm); border: 1px dashed var(--line2); background: none; color: var(--mut); font: 600 var(--fs-sm) var(--sans); text-align: left; cursor: pointer; }
.qc-side svg { color: var(--accent-ink); }
.qc-side:hover { border-style: solid; border-color: var(--accent); color: var(--ink); }
/* on a phone the popup shows the shipped .handoff card (ACTIVATION.md section 3); the sheet head already carries the laptop */
.qc .handoff .ho-top { grid-template-columns: minmax(0, 1fr); }
.qc .handoff .ho-ico { display: none; }
/* H.card() ships as section.card.pad.handoff with an h2. Inside the sheet it is flat: no second box inside the sheet, and its
   heading stays below the sheet title ("Connect a machine"). */
.qc .card.pad.handoff { padding: 0; border: 0; border-radius: 0; background: none; }
.qc .handoff h2, .qc .handoff h3 { margin: 0 0 4px; font-size: var(--fs-md); font-weight: 650; letter-spacing: 0; }

@media (pointer: coarse) {
  .gw-chip, .gw-kind, .gw-fb-acts .btn { min-height: var(--tap); }
  .gw-tool { width: var(--tap); height: var(--tap); }
  .gw-mode { min-height: 38px; }
  .qc-side { min-height: var(--tap); }
}

/* phone, up to 699 (Duo included): the window is a full-height sheet (modal, focus trapped); quick connect is a bottom sheet */
@media (max-width: 699px) {
  .gw { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top, 0px); animation-name: gw-up; }
  .gw-head { min-height: 56px; padding-left: max(var(--s3), env(safe-area-inset-left, 0px)); padding-right: max(var(--s2), env(safe-area-inset-right, 0px)); }
  .gw-tool { width: var(--tap); height: var(--tap); }
  .gw-mode { min-height: 38px; padding: 0 var(--s4); }
  .gw-thread, .gw-fbody { padding-left: max(var(--s4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s4), env(safe-area-inset-right, 0px)); }
  .gw-composer, .gw-ffoot { padding-left: max(var(--s3), env(safe-area-inset-left, 0px)); padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); padding-bottom: calc(var(--s2) + env(safe-area-inset-bottom, 0px)); }
  .gw-input, .gw-ftext { font-size: 16px; }
  .gw-chip, .gw-kind, .gw-fb-acts .btn { min-height: var(--tap); }
  .gw-pill { right: max(var(--s3), env(safe-area-inset-right, 0px)); bottom: calc(var(--s3) + var(--gw-lift, 0px) + env(safe-area-inset-bottom, 0px)); }
  .qc { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 92dvh; border-width: 1px 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; animation-name: qc-up; }
  .qc-grab { display: block; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line2); }
  .qc-head { padding: var(--s5) max(var(--s2), env(safe-area-inset-right, 0px)) var(--s2) max(var(--s4), env(safe-area-inset-left, 0px)); }
  .qc-body { padding: var(--s2) max(var(--s4), env(safe-area-inset-right, 0px)) calc(var(--s5) + env(safe-area-inset-bottom, 0px)) max(var(--s4), env(safe-area-inset-left, 0px)); }
  .qc-head .iconbtn { margin-top: -6px; }
  .qc-code { max-height: 132px; font-size: 12px; }
  .qc-acts .btn { flex-basis: 100%; }
}
@keyframes gw-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes qc-up { from { transform: translateY(32px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .gw, .gw-pill, .qc { animation: none; }
  .gw-working .dots i { animation: none; opacity: 1; }
  .qc-skel i { animation: none; opacity: .25; }
  .qc-cmds > summary svg { transition: none; }
}
/* ===== END Guide window and quick connect ===== */

/* ===== BEGIN Layout pass (App Review gate, 2026-11-16). Spec: design/LAYOUT-PASS.md, part B. =====
   Paste this whole block at the END of design/app.css (after "END Guide window and quick connect"), then run
   node scripts/build-web-assets.js so it lands in web/css/ds.css. It must stay last: it overrides earlier gate rounds.
   No new tokens. No font is made larger. Duo 500 to 699 keeps its dense sizes. */

/* B1. One header on every settings page: 48px bar, icon tools bare like the burger, workspace chip neutral */
@media (max-width: 699px) {
  .topbar { padding-top: calc(2px + env(safe-area-inset-top, 0px)); padding-bottom: 2px; }
}
.topbar .av.ws { background: var(--panel3); border-color: var(--line2); color: var(--mut); }
@media (max-width: 499px) {
  .topbar .tools > .btn:not(.go):not(:only-child) { border-color: transparent; background: none; color: var(--mut); }
  .page { padding-top: var(--s3); gap: var(--s3); }
}

/* B2. Servers: the second way to add a server is a text link under the list */
.fine.also { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.fine.also a { display: inline-flex; align-items: center; min-height: 32px; }
@media (pointer: coarse) and (max-width: 499px), (pointer: coarse) and (max-height: 500px) { .fine.also a { min-height: var(--tap); } }

/* B3. Usage: the move banner folds to one line; move tags never orphan a word; Auto-move is one row */
details.banner.fold { display: block; padding: 0; }
details.banner.fold > summary { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 6px var(--s3) 6px var(--s4); list-style: none; cursor: pointer; color: var(--ink); }
details.banner.fold > summary::-webkit-details-marker { display: none; }
details.banner.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-md); }
details.banner.fold > summary b { flex: 1 1 0; min-width: 0; font-weight: 600; }
details.banner.fold > summary svg.i:first-child { color: var(--mut); }
details.banner.warn.fold > summary svg.i:first-child { color: var(--warn); }
details.banner.fold > summary svg.i:last-child { width: 16px; height: 16px; color: var(--dim); transition: transform .16s; }
details.banner.fold[open] > summary svg.i:last-child { transform: rotate(180deg); }
details.banner.fold > .btxt { padding: 0 var(--s4) var(--s3) calc(var(--s4) + 18px + var(--s3)); }
@media (prefers-reduced-motion: reduce) { details.banner.fold > summary svg.i:last-child { transition: none; } }
.taglist .tag.move { display: inline-flex; gap: 6px; max-width: 100%; min-width: 0; white-space: nowrap; }
.tag.move .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag.move .to { flex: none; }
#automove .amrow.amtop { flex-wrap: nowrap; }
#automove .amrow.amtop .am { flex: 1 1 0; }
#automove .amrow.amtop .ctl { flex: none; flex-wrap: nowrap; padding-left: 0; }
#automove .amrow.amtop .ctl .select-sm { width: auto; }
@media (max-width: 499px) { #automove.card.pad { padding: var(--s2) var(--s3); } }

/* B4. Decisions on a phone: the first card starts high, and the session name wins its header row */
.runbar .nx { white-space: nowrap; }
@media (max-width: 499px) {
  body[data-page="decisions"][data-docked] .pagehead { display: none; }
  .runbar { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .runbar > span:not(.pill) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .runbar > .pill { flex: none; }
  .runbar .nx { display: none; }
  .dgroup > header .sid small, .dgroup > header .ct { display: none; }
}

/* B5. Asks: answered rows are one line; Duo and small tablets use two columns */
.rows.done > .row { min-height: var(--tap); padding-top: var(--s2); padding-bottom: var(--s2); flex-wrap: nowrap; }
.rows.done > .row .main-t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows.done > .row .acts { flex: none; padding-left: 0; }
.ans.off { color: var(--dim); background: none; border-color: var(--line); font-weight: 500; }
@media (min-width: 600px) and (max-width: 899px) and (min-height: 501px) {
  body[data-page="asks"] #content:has(> .asklist):has(> .sect) { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 1fr); gap: var(--s4); align-items: start; }
  body[data-page="asks"] #content:has(> .asklist) > .sect { margin-top: 0; }
  body[data-page="asks"] #content:has(> .asklist) > .sect > header .btn { display: none; }   /* the History tab is in the header above */
  /* in the side column an answered row is the question (two lines at most) over its answer */
  body[data-page="asks"] #content:has(> .asklist) .rows.done > .row { flex-direction: column; align-items: flex-start; gap: 6px; }
  body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .main-t { width: 100%; }
  body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .main-t b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* B6. Account: your own address is never cut; repeated devices fold into one row */
.row .main-t b.id.full { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.rows > button.row.grp { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rows > button.row.grp:first-child { border-top: 0; }
.rows > button.row.grp:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rows > button.row.grp .acts { flex: none; padding-left: 0; }
.rows > button.row.grp .acts svg.i { width: 16px; height: 16px; color: var(--dim); transition: transform .16s; }
.rows > button.row.grp[aria-expanded="true"] .acts svg.i { transform: rotate(180deg); }
.rows > .row.in-grp { background: var(--panel2); }
.rows > .row.in-grp[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .rows > button.row.grp .acts svg.i { transition: none; } }

/* B7. Rooms: agent post headers keep one shape (name, server, kind, then the time at the right) */
.post .by { flex-wrap: nowrap; }
.post .by b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .by small { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post .by .badge { flex: none; }
.post .by time { flex: none; margin-left: auto; white-space: nowrap; }

/* B8. Phone held sideways (874 x 402): height is the scarce thing. Adds to gate block 12. */
@media (max-height: 500px) and (max-width: 959px) {
  /* Rooms: the list or the thread, like a phone held upright; one composer row */
  .rooms { grid-template-columns: minmax(0, 1fr); }
  .rooms .roomlist { display: none; border-right: 0; }
  .rooms.list .roomlist { display: flex; }
  .rooms.list .thread { display: none; }
  .thead { min-height: 46px; padding-left: max(4px, env(safe-area-inset-left, 0px)); gap: var(--s1); }
  .thead .back { display: inline-flex; }
  .posts { padding: var(--s3) max(16px, env(safe-area-inset-right, 0px)) var(--s3) max(16px, env(safe-area-inset-left, 0px)); }
  .composer { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .composer .hears { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-height: 500px) and (min-width: 700px) and (max-width: 959px) {
  /* Decisions: two cards side by side; the run line lives in Run details */
  .runbar { display: none; }
  .dcols > div:first-child:has(> .dgroup + .dgroup) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: start; }
  .dcols > div:first-child > :not(.dgroup) { grid-column: 1 / -1; }
  .ditem { grid-template-columns: minmax(0, 1fr); padding: var(--s3); gap: var(--s2); }
  .choices { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dgroup > header .sid small { display: none; }
  /* Billing: the current plan is one row, so the plan tiles and their prices show */
  body[data-page="billing"] #content > section.card.pad.stack:has(> .ttl-row) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding-top: var(--s3); padding-bottom: var(--s3); }
  body[data-page="billing"] #content > section.card.pad.stack:has(> .ttl-row) > p { flex: 1 1 300px; min-width: 0; margin: 0; }
  body[data-page="billing"] .picker .hint { display: none; }
  /* Account: two columns, so Passkeys starts on the first screen */
  body[data-page="account"] #content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
  body[data-page="account"] #content > .sect:has(#outall), body[data-page="account"] #content > :not(.sect) { grid-column: 1 / -1; }
}
/* ===== END Layout pass ===== */

/* touch targets: interval toggle, list "New", code Copy reach the tap size on touch (pcheck a11y-tap-44, 11-16) */
@media (pointer: coarse) {
  .seg button { min-height: var(--tap); }
  .ls-new { min-width: 32px; height: 32px; }
  .code .copy { min-height: var(--tap); }
}

/* ===== BEGIN Layout pass 2 (App Review gate, 2026-11-16). =====
   Goes at the very END of design/app.css (after the "touch targets" block), then run node scripts/build-web-assets.js.
   Needs --strip-gap, --inset-l and --inset-r from design/tokens.css. No font is made larger. Dense Duo (500 to 699) is untouched. */

/* P1. One side gutter: where the device has a side inset (Duo strip, landscape notch), content stops 12px short of it.
   With no side inset every value below resolves to what it was before. */
@media (max-width: 499px), (max-height: 500px) and (max-width: 959px) {
  .topbar { padding-right: max(8px, var(--inset-r)); }
  .page, .submitbar, .posts { padding-left: max(16px, var(--inset-l)); padding-right: max(16px, var(--inset-r)); }
  .thead { padding-right: max(var(--s3), var(--inset-r)); }
  .composer { padding-left: max(var(--s3), var(--inset-l)); padding-right: max(var(--s3), var(--inset-r)); }
  .roomlist { padding-left: calc(env(safe-area-inset-left, 0px) + min(4px, env(safe-area-inset-left, 0px))); padding-right: calc(env(safe-area-inset-right, 0px) + min(4px, env(safe-area-inset-right, 0px))); }
  .sheet, .sheet.wide { padding-left: max(16px, var(--inset-l)); padding-right: max(16px, var(--inset-r)); }
  .pop.as-sheet { padding-left: max(10px, var(--inset-l)); padding-right: max(10px, var(--inset-r)); }
  /* P2. The Asks tab pair: 44px targets, 36px drawn, so its bar is the same height as every other page */
  .topbar .tools .tabs { padding: 0; border: 0; background: none; gap: 0; }
  .topbar .tools .tabs .tab { min-height: var(--tap); border: 4px solid transparent; border-radius: calc(var(--r-sm) + 4px); background-clip: padding-box; }
  .topbar .tools .tabs .tab.on { background-color: var(--panel2); box-shadow: inset 0 0 0 1px var(--line2); }
}

/* P3. Phone held sideways: 45px header, 70px bottom bar, first card in the first frame */
@media (max-height: 500px) and (max-width: 959px) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0; }
  .topbar .tools > .btn:not(.go), .thead .btn { border-color: transparent; background: none; }
  .page { padding-top: var(--s2); gap: var(--s2); }
  .submitbar { padding-top: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
  .composer { padding-top: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
  .thead { min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .thead .tt { display: flex; align-items: baseline; gap: var(--s2); }
  .thead .tt b { flex: 0 1 auto; min-width: 0; }
  .thead .tt small { flex: 1 1 0; min-width: 0; }
  .posts { padding-top: var(--s2); padding-bottom: var(--s2); gap: var(--s2); }
  .um-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); align-items: start; }
  #automove.card.pad { padding: 3px var(--s3); }
  body[data-page="billing"] #content > section.card.pad.stack:has(> .ttl-row) { padding-top: var(--s1); padding-bottom: var(--s1); }
}

/* P4. Decisions on a phone: the run line shows only while agents are still replying */
@media (max-width: 499px) {
  .runbar:not(:has(.pill.warn)) { display: none; }
}
/* ===== END Layout pass 2 ===== */

/* ===== BEGIN Layout pass 3 (App Review gate, 2026-11-16) ===== */
/* P5. Room post header: the agent's name is what tells posts apart, so it gets the room. On a phone the server
   label steps aside; in a thread under 360px (three panes on Duo landscape) the kind badge does too.
   Both stay in the name's title. */
.rooms .thread { container: thread / inline-size; }
@media (max-width: 499px) { .rooms .post .by small { display: none; } }
@container thread (max-width: 419px) { .rooms .post .by small { display: none; } }
@container thread (max-width: 359px) { .rooms .post .by .badge { display: none; } }

/* P6. A filled button in the top bar is drawn 36 tall inside its 44 hit box, like the Asks tabs (pass 2, P2):
   it sits inside the bar with air above and below, and never touches the hairline */
@media (max-width: 699px), (max-height: 500px) and (max-width: 959px) {
  .topbar .tools > .btn.go { border: 4px solid transparent; background-clip: padding-box; }
}

/* P7. Usage on a phone: one line per item. The forecast and the reset time are two lines, not one wrapped
   sentence; the Auto-move row is its label, the switch and the threshold (the helper line wrapped to three) */
@media (max-width: 499px) {
  .login .ontrack b { display: block; }
  .amrow .am small { display: none; }
}
/* P8. Asks, Recently answered, on a phone: the question gets two lines so two rows can be told apart;
   the answer chip keeps its own column at the right, top-aligned */
@media (max-width: 499px) {
  .rows.done > .row { align-items: flex-start; }
  .rows.done > .row .main-t b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* P9. Billing on a phone: the card for the plan you are on does not restate its name and price a third time
   (the Current plan card and the marked rung already do); "Your current plan." and what is included stay */
@media (max-width: 499px) { .plan.detail.is-cur .buy h3, .plan.detail.is-cur .buy .price { display: none; } }
/* ===== END Layout pass 3 ===== */

/* ===== BEGIN Layout pass 4 (Fable spec, 11-16) ===== */
/* P10. Duo: section nav as one capsule on the right (folded: in the status strip). Same geometry as the Cockpit's window capsule. */
#sr-probe { position: fixed; visibility: hidden; pointer-events: none; left: 0; top: 0; padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
html.strip-r, html.strip-open { --strip-gap: .5px; }   /* content ends 13pt from the capsule (inset 84 + .5) */
.striprail { position: fixed; z-index: calc(var(--z-sheet) + 1); right: 23px; bottom: max(34px, env(safe-area-inset-bottom, 0px)); width: 50px; }
.sr-cap { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 2px; border-radius: 999px; border: 1px solid var(--line2); background: color-mix(in srgb, var(--panel2) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .6); }
.sr-cap a { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid transparent; display: grid; place-items: center; color: var(--mut); }
.sr-cap a .i { width: 20px; height: 20px; }
.sr-cap a.on { background: var(--panel); border-color: var(--accent); color: var(--ink); }
.sr-cap a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sr-ct { position: absolute; top: 1px; right: -1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font: 600 10px/16px var(--mono); text-align: center; color: var(--on-accent); background: var(--warn); }
@media (max-height: 677px) { html.strip-r .sr-cap { gap: 3px; } }   /* a shorter folded screen: the pitch shrinks, the rail never scrolls */
html.strip-open .striprail { right: 24.5px; width: 47px; bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
html.strip-open .sr-cap a { width: 41px; height: 41px; }
html.strip-open .topbar, html.strip-open .page, html.strip-open .submitbar, html.strip-open .posts, html.strip-open .composer, html.strip-open .thead { padding-right: 84.5px; }

/* P12. Account beside the rail on the unfolded Duo: two columns, the device list and anything that is not a section stay full width */
html.strip-open body[data-page="account"] #content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
html.strip-open body[data-page="account"] #content > * { margin-top: 0; min-width: 0; }
html.strip-open body[data-page="account"] #content > .sect:has(#outall), html.strip-open body[data-page="account"] #content > :not(.sect) { grid-column: 1 / -1; }

/* P11. Asks beside the rail on the unfolded Duo: one column, so an answered row is one line with its chip in a fixed right column */
html.strip-open body[data-page="asks"] #content:has(> .asklist):has(> .sect) { display: block; }
html.strip-open body[data-page="asks"] #content:has(> .asklist) > .sect { margin-top: var(--s6); }
html.strip-open body[data-page="asks"] #content:has(> .asklist) .rows.done > .row { flex-direction: row; align-items: center; gap: var(--s3); }
html.strip-open body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .main-t { width: auto; flex: 1; min-width: 0; }
html.strip-open body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .main-t b { display: block; white-space: nowrap; }

/* P13. Narrow phones: the page title is never cut by the one labelled tool beside it */
@media (max-width: 379px) { .topbar { gap: 6px; } }
@media (max-width: 359px) {
  .topbar .tools > .btn:only-child:not(.quiet) { width: var(--tap); padding: 0; }
  .topbar .tools > .btn:only-child:not(.quiet) .lb { display: none; }
}

/* P14. Usage on phones and in phone landscape: the first account card starts higher */
@media (max-width: 699px), (max-height: 500px) and (max-width: 959px) {
  body[data-page="usage"] .legend { margin-block: 0; }
  body[data-page="usage"] #content { gap: var(--s2); }
  body[data-page="usage"] #automove.card.pad { padding-block: 4px; }
}
@media (max-height: 500px) and (max-width: 959px) { body[data-page="usage"] #automove .am small { display: none; } }

/* P15. Decisions: "Sessions asked" is one line once every session has replied; the bar count is never cut at 360 */
details.sessfold > summary { list-style: none; cursor: pointer; min-height: var(--tap); padding-block: 0; }
details.sessfold > summary::-webkit-details-marker { display: none; }
details.sessfold > summary .i { flex: none; color: var(--dim); transition: transform .15s; }
details.sessfold[open] > summary .i { transform: rotate(90deg); }
details.sessfold[open] > summary { border-bottom: 1px solid var(--line); }
@media (max-width: 379px) { .submitbar .in { gap: var(--s2); } .submitbar .cnt { flex: none; } }

/* P16. Tablet and unfolded-landscape widths: a 240 sidebar and a 224 room list, so the chat pane and every page get the width */
@media (min-width: 700px) and (max-width: 1099px) and (min-height: 501px) {
  :root { --side-w: 240px; }
  .rooms { grid-template-columns: 224px minmax(0, 1fr); }
}
/* ===== END Layout pass 4 ===== */

/* ===== BEGIN Layout pass 5 (Fable spec, 11-16) ===== */
/* N3: one nav block on every page, Home included. List when tall; short docked sidebar = same eleven items in a grid. */
.navs { display: flex; flex-direction: column; }
.navs .nav .sh { display: none; }
.navs .nav a, .navs .nav button { position: relative; }
.navs .nav.navfoot { margin-top: 0; padding-bottom: var(--s1); }
.navs + .sidefoot { margin-top: auto; }
/* Short docked sidebar: dense on purpose (Duo). Do not enlarge. */
@media (min-width: 700px) and (max-height: 699px) {
  .navs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: var(--s1) var(--s2); }
  .navs > .nav { display: contents; }
  .navs > .label { display: none; }
  .navs .nav a, .navs .nav button { flex-direction: column; justify-content: center; align-items: center; gap: 2px;
    width: auto; height: 36px; min-height: 36px; padding: 0; font: 500 12px/1.1 var(--sans); white-space: nowrap;
    overflow: hidden; text-align: center; }
  .navs .nav a svg, .navs .nav button svg { width: 16px; height: 16px; }
  .navs .nav .lg { display: none; }
  .navs .nav .sh { display: inline; }
  .navs .nav a.on { box-shadow: none; }
  .navs .nav a.on svg { color: var(--accent); }
  .navs .nav a .ct { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; padding: 0 5px; font-size: 10px; line-height: 14px; }
}
/* N4: drawers keep the whole list; the user row stays pinned while the list scrolls under it */
@media (max-width: 699px) {
  .side.drawer .sidefoot { position: sticky; bottom: 0; background: var(--panel); }
  html.strip-r #drawer-scrim { right: 84px; }
  html.strip-open #drawer-scrim { right: 84.5px; }
}
/* R1: Menu capsule first in the rail; the header hamburger goes while a rail shows */
.striprail { display: flex; flex-direction: column; gap: 7px; }
.sr-cap { box-shadow: none; }
.sr-cap button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid transparent;
  background: none; display: grid; place-items: center; color: var(--mut); padding: 0; cursor: pointer; }
.sr-cap button .i, .sr-cap button svg { width: 20px; height: 20px; }
.sr-cap button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html.strip-open .sr-cap button { width: 41px; height: 41px; }
.sr-cap a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
html.strip-r #navopen, html.strip-open #navopen { display: none; }
html.strip-r [data-navopen]:not(.sr-cap *), html.strip-open [data-navopen]:not(.sr-cap *) { display: none; }
html.strip-r .topbar, html.strip-open .topbar { padding-left: 16px; box-sizing: border-box; min-height: calc(49px + env(safe-area-inset-top, 0px)); }
/* R2: the strip is one colour; bar rules stop at the content edge */
html.strip-r .topbar, html.strip-open .topbar, html.strip-r .thead, html.strip-open .thead {
  border-bottom: 0;
  background: linear-gradient(var(--line), var(--line)) left bottom / calc(100% - 84.5px) 1px no-repeat, var(--bg); }
html.strip-r .submitbar, html.strip-open .submitbar, html.strip-r .composer, html.strip-open .composer {
  border-top: 0;
  background: linear-gradient(var(--line), var(--line)) left top / calc(100% - 84.5px) 1px no-repeat, var(--bg); }
/* G6: sessions under the server card on tall screens */
.srv-sess .rows > .row { min-height: 52px; }
/* G7: the name in a Rooms message header never cuts; the server label gives way */
.post .by b { flex-shrink: 1; }
.post .by small { flex-shrink: 100; }
/* ===== END Layout pass 5 ===== */

/* ===== BEGIN Layout pass 6 (Fable spec, 11-16) ===== */
/* A1. Servers: the session list shows at every size; the kind badge stays at the row's right edge */
.srv-sess .rows > .row.wrap { flex-wrap: nowrap; }
.srv-sess .rows > .row.wrap .acts { flex: none; padding-left: 0; }
/* A3. phone top bar: the workspace chip ends 16pt from the screen edge (not on strip layouts, where the strip is the margin) */
@media (max-width: 699px) and (min-height: 501px) { html:not(.strip-r):not(.strip-open) .topbar .av.ws { margin-right: 8px; } }
/* A4. a count inside a top-bar tab sits a clear gap after its label */
.topbar .tools .tabs .tab .n { margin-left: 2px; }
/* A5. phone landscape: two cards share the row, so the count leaves the header and the agent name shows in full */
@media (max-height: 500px) and (max-width: 959px) { .dgroup > header .ct { display: none; } }
/* A6. phone landscape: the colour key leaves (each card already says "used", "on track for" and "limit"); cards tighten */
@media (max-height: 500px) and (max-width: 959px) {
  body[data-page="usage"] .legend { display: none; }
  body[data-page="usage"] .card.login { padding: 12px 16px; }
}
/* A7. under 700 wide the byline has no room for the server tag: drop it instead of clipping it */
@media (max-width: 699px) { .post .by small { display: none; } }
/* A8. the rail is one capsule: six sections, a hairline, then Menu. The drawer it opens keeps the full nav (same on every page). */
.sr-cap .sr-more { position: relative; margin-top: 3px; }
.sr-cap .sr-more::before { content: ""; position: absolute; left: 8px; right: 8px; top: -4px; height: 1px; background: var(--line2); }
/* A9. header actions keep their words at every size: "Ask agents" on Decisions, "Refresh" on Usage */
.topbar .tools > #askbtn, .topbar .tools > #refresh { width: auto; padding: 0 var(--s3); }
.topbar .tools > #askbtn .lb, .topbar .tools > #refresh .lb { display: inline; }
/* ===== END Layout pass 6 ===== */
/* ===== BEGIN Layout pass 7 ===== */
/* B1. Servers top bar: the title never shrinks; the docked button keeps its words and drops its icon */
body[data-page="servers"] .topbar > b { flex-shrink: 0; }
.topbar .tools > #qcbtn svg { display: none; }
/* B2. Account: the bulk sign-out actions are buttons under the device list; on phones they share the row's width */
.sect > .bulk { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 499px) { .sect > .bulk .btn { flex: 1 1 auto; } }
/* B3. Asks, recently closed: agent and time lead (the name gives way, the time never cuts), the question gets two lines, the result chip may wrap */
.card.rows.done > .row { align-items: center; }
.rows.done > .row .main-t small { display: flex; min-width: 0; white-space: nowrap; }
.rows.done > .row .main-t small .dw { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rows.done > .row .main-t small .dt { flex: none; white-space: pre; }
.rows.done > .row .main-t .dq { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.rows.done > .row .acts { flex: 0 1 auto; max-width: 42%; }
.rows.done > .row .acts .ans { white-space: normal; text-align: right; }
.ans.off { color: var(--mut); }
@media (min-width: 600px) and (max-width: 899px) and (min-height: 501px) { body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .acts { max-width: 100%; } }
/* ===== END Layout pass 7 ===== */
/* ===== BEGIN Layout pass 8 ===== */
/* B1. Usage: the move suggestion is one row with one filled action; what moves where is in the sheet it opens */
.banner.mvsg { align-items: center; padding: 4px var(--s2) 4px var(--s4); min-height: 46px; box-sizing: border-box; }
.banner.mvsg > .btn.sm { flex: none; position: relative; min-height: 36px; }
.banner.mvsg > .btn.sm::before { content: ""; position: absolute; inset: -5px 0; }
@media (max-width: 699px), (max-height: 500px) { .banner.mvsg:has(> .btn) .rest { display: none; } }
/* B2. Usage: with a suggestion above it, Auto-move is a setting line, not a second card */
.um-top > .banner.mvsg ~ #automove.card { background: none; border-color: transparent; }
.um-top > .banner.mvsg ~ #automove.card.pad { padding-top: 0; padding-bottom: 0; }
/* B3. Usage: an agent chip says Move in words */
.schip .mv { flex: none; font: 600 12px var(--sans); color: var(--accent-ink); }
.schip.moving .mv { color: inherit; }
.mvall { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mvall li { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.mvall li:first-child { border-top: 0; }
.mvall li b { flex: 1 1 0; min-width: 0; font: 500 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvall li .to { flex: none; color: var(--ink); }
.mvall li.skip .to { color: var(--dim); }
/* B4. Billing: a short ladder (larger plans only) fills its row instead of two of five columns */
@container picker (min-width: 600px) { .picker.up .ladder { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } }
/* B5. Asks, recently closed: the answer is one line. On phones it sits under the question, left-aligned; wider, it keeps its own column */
.rows.done > .row .acts .ans { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
@media (max-width: 499px) {
  .card.rows.done > .row { flex-direction: column; align-items: stretch; gap: 6px; }
  .rows.done > .row .acts { max-width: 100%; align-self: flex-start; }
}
html.strip-open body[data-page="asks"] #content:has(> .asklist) .rows.done > .row .acts { max-width: 42%; }
/* ===== END Layout pass 8 ===== */
/* ===== BEGIN Layout pass 9 ===== */
/* B1. Servers: list and setup panel in one pane, sessions in the other. The two wrappers vanish outside the open Duo, where the order is list, sessions, setup panel */
.srv-a, .srv-b { display: contents; }
.srv-b > * { order: 1; }
.srv-a > .srv-help { order: 2; }
.srv-a > .fine { order: 3; }
.srv-steps { list-style: none; margin: 0; padding: 0; counter-reset: srv; }
.srv-steps li { counter-increment: srv; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s2); padding: 10px var(--s4); border-top: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.45; color: var(--mut); }
.srv-steps li:first-child { border-top: 0; }
.srv-steps li::before { content: counter(srv); font: 600 var(--fs-xs)/1.6 var(--mono); color: var(--dim); }
.srv-steps b { color: var(--ink); font-weight: 600; }
@media (pointer: coarse) { .srv-help .fine.also a { min-height: var(--tap); } }
html.strip-open body[data-page="servers"] #content:has(> .srv-b) { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s4); align-items: start; }
html.strip-open body[data-page="servers"] #content:has(> .srv-b) > .banner { grid-column: 1 / -1; }
html.strip-open body[data-page="servers"] #content > .srv-a, html.strip-open body[data-page="servers"] #content > .srv-b { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
/* B2. Usage banner on touch: the button is a real 44pt target, the banner wraps it with a 3pt inset; the auto-move row centres on the taller banner */
@media (pointer: coarse) {
  .banner.mvsg:has(> .btn.sm) { padding: 3px 3px 3px var(--s4); }
  .banner.mvsg > .btn.sm { min-height: var(--tap); }
  .banner.mvsg > .btn.sm::before { content: none; }
}
.um-top > .banner.mvsg ~ #automove.card { align-self: center; }
/* B3. Asks: the agent's options carry the accent tint; "Decide later" is a text action, right of the options from 500 wide, under them on phones */
.ask .opts .btn { border-color: var(--accent-line); background: var(--accent-soft); }
.opts .later { margin: 0 calc(-1 * var(--s1)) 0 auto; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s1); border: 0; border-radius: var(--r-xs); background: none; color: var(--mut); font: 500 var(--fs-sm) var(--sans); text-decoration: underline; text-underline-offset: 3px; }
.opts button.later { cursor: pointer; }
.opts button.later:hover { color: var(--ink); }
.opts .later:disabled { opacity: .45; cursor: default; }
@media (max-width: 499px) { .opts .later { margin-left: calc(-1 * var(--s1)); } }
/* ===== END Layout pass 9 ===== */

/* ---- "Stuck? Tell us what happened", the feedback box and Send feedback placements (design/FEEDBACK-STUCK.md,
   design/src/feedback-stuck.html, Fable 11-18) ---- */
/* 1. The Stuck line: one quiet line next to an error. Never a button shape, never the accent fill. */
.stuck { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; margin: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--mut); }
.stuck > svg { color: var(--good); }
.stuck-open { appearance: none; border: 0; background: none; padding: 0; min-height: var(--tap); margin-block: -12px; display: inline-flex; align-items: center;
  font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line2); text-decoration-thickness: 1px; text-underline-offset: 3px;
  cursor: pointer; border-radius: var(--r-xs); }
.stuck-open:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.stuck-open:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.banner .btxt > .stuck { margin-top: 6px; }
.qc-end > .stuck { margin-top: 2px; }

/* 2. The box. It is the shipped .sheet (centered dialog on desktop, bottom sheet up to 699) with these parts. */
.stk { gap: var(--s4); }
.stk-head { display: flex; flex-direction: column; gap: 4px; padding-right: 36px; }
.stk-head p { margin: 0; color: var(--mut); font-size: var(--fs-sm); }
.stk-ctx { display: flex; align-items: center; gap: var(--s2); min-width: 0; margin: 0; padding: 7px var(--s3); border-radius: var(--r-sm); background: var(--panel2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.stk-ctx .label { flex: none; }
.stk-ctx .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.stk textarea.input { min-height: 104px; }
.stk .field { gap: var(--s2); }
/* voice: idle button, recording strip, kept note. One row, same height in all three, so nothing jumps. */
.stk-voice { display: flex; align-items: center; gap: var(--s3); min-height: 52px; }
.stk-voice .hint { flex: 1 1 0; min-width: 0; }
.stk-strip { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 3px 3px 3px var(--s3); border-radius: var(--r-md); border: 1px solid var(--line2); background: var(--panel2); }
.stk-strip b { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.stk-strip .stk-time { font: 600 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.stk-strip .stk-time small { font-weight: 400; font-size: 12px; color: var(--mut); }
.stk-strip .btn, .stk-strip .iconbtn { flex: none; }
.stk-strip.rec { border-color: var(--bad-line); background: var(--bad-soft); }
.stk-strip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); flex: none; animation: stk-pulse 1.2s ease-in-out infinite; }
@keyframes stk-pulse { 50% { opacity: .35; } }
.stk-lvl { flex: 1 1 40px; min-width: 0; height: 24px; display: flex; align-items: center; gap: 3px; overflow: hidden; justify-content: flex-end; }
.stk-lvl i { width: 3px; border-radius: 2px; background: var(--bad); flex: none; }
.stk-strip.note { padding-left: 3px; }
.stk-strip.note .sp { flex: 1 1 0; }
/* screenshot: a thumbnail the person can open, one sentence, Remove */
.stk-shot { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 3px 3px 3px var(--s2); border-radius: var(--r-md); border: 1px solid var(--line); }
.stk-thumb { appearance: none; width: 72px; height: 46px; padding: 0; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg); overflow: hidden; flex: none; cursor: zoom-in; }
.stk-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.stk-shot .main-t { flex: 1 1 0; min-width: 0; }
.stk-shot .main-t b { display: block; font-size: var(--fs-sm); font-weight: 600; }
.stk-shot .main-t small { display: block; font-size: var(--fs-xs); color: var(--dim); }
.stk-shot.off { border-style: dashed; padding-left: 3px; }
.stk .acts { align-items: center; }
/* sent */
.stk-done { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.stk-done p { margin: 0; color: var(--mut); }
.stk-done p b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.stk .sheet-ic.good { background: var(--good-soft); border-color: var(--good-line); color: var(--good); }
@media (max-width: 699px) {
  .stk { gap: var(--s3); }
  .stk textarea.input { min-height: 88px; }
  /* Send stays reachable when the keyboard is up: the action row sticks to the sheet's bottom edge */
  .stk .acts { position: sticky; bottom: calc(-1 * var(--s5) - env(safe-area-inset-bottom, 0px)); margin: 0 -16px calc(-1 * var(--s5)); padding: var(--s3) 16px calc(var(--s5) + env(safe-area-inset-bottom, 0px)); background: var(--panel); border-top: 1px solid var(--line); }
  .stk .acts .btn[data-close] { display: none; }   /* the X closes; one full-width Send */
  .stk .stk-done ~ .acts .btn[data-close] { display: inline-flex; flex: 1; }   /* the sent state: Close is its only button */
}

/* 3. A failed-request toast, second time round: the same words as the line, as the toast's one action */
.toast.act { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; width: max-content; }
.obhead .fb-top { color: var(--mut); }
@media (max-width: 699px) { .topbar .fb-top { margin-inline: -6px; } }
.toast.act .stuck-open { color: var(--ink); white-space: nowrap; }

/* 4. Send feedback placements */
.topbar .fb-top { color: var(--mut); margin-right: -4px; }
/* desktop list sidebar: the row is pinned to the foot, above the account row, so it never scrolls away */
@media (min-width: 700px) and (min-height: 700px) {
  .side > .navs { flex: 1 1 auto; }
  .navs .nav.navfoot { margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--line); }
  .navs + .sidefoot { margin-top: 0; }
}
/* the box's wrappers add no box of their own: the parts are the sheet's own flex children, as in the mockup */
.stk-in, .stk-form { display: contents; }
.stuck.sent { color: var(--mut); gap: 0 6px; }
.stk-err { margin: 0; }
.stk-shotbig { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--bg); }
@media (prefers-reduced-motion: reduce) { .stk-strip .dot { animation: none; } }
