/* ScourJet design system. Tokens and components from the approved prototype
   (docs/superpowers/specs/assets/2026-11-10-ui-redesign-prototype.html).
   Calm off-white page, near-black ink, outlined cards with a solid black lip.
   Orange is only for "needs your decision" (.strip, .st.need). Yellow (--yellow) is only the
   new-row flash. State colour comes from the --st-* palette: a soft fill with a darker text
   and border per state (each text/fill pair is AA or better). Single light theme, Manrope only, no monospace. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --page: #f3f3f1;
  --paper: #ffffff;
  --ink: #18181b;
  --ink-2: #55565c;
  --grey: #9a9ba1;
  --grey-ink: #64666c; /* quiet text that still reads (5:1 on the unread tint): a notification's time */
  --grey-2: #d9d9d6;
  --grey-3: #ececea;
  --orange: #ff8368;   /* Ujeebu orange */
  --orange-soft: #fff1ec;
  --red: #c8322b;      /* errors only */
  --red-soft: #fdeceb;
  --warn: #7a4b00;     /* warnings: amber text/border on a pale fill (never the decision orange) */
  --warn-bg: #fff3d6;
  --logo-ink: #161C2B;  /* the logo's ink (img/brand, App\Lib\Logo; #F4F3EF on a dark page); its orange is the SVG's own */
  --yellow: #fff7d1;   /* only for freshly arrived rows */
  --grid: #e6e6e3;
  /* Status palette: soft fill (-bg) + darker text/border, per state. */
  --st-run: #1e4f9c;    --st-run-bg: #e7effb;     /* running, open */
  --st-done: #1d6a3e;   --st-done-bg: #e2f3e8;    /* done, kept, used up */
  --st-plan: #6f5300;   --st-plan-bg: #fbf1c6;    /* planning */
  --st-pause: #4a5363;  --st-pause-bg: #eceff3;   /* paused, dry */
  --st-stop: #8e3a33;   --st-stop-bg: #f7e9e7;    /* stopped, cut */
  --st-err: #b4241d;    --st-err-bg: #fde3e1;     /* error, blocked */
  --hdr: #f8f8f6;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --b: 1.5px solid var(--ink);
  --lip: 0 6px 0 var(--ink);
  --lip-s: 0 4px 0 var(--ink);
  --r: 20px;
  --fs-meta: 12.5px;   /* a one-line figure under a heading: the command center's spend */
  --gap-words: .4em;   /* the space between two parts of one line of words (a figure and what follows it) */
  --gap-lines: 2px;    /* between two lines of one item (a name and its note under it) */
  --rowlist-gap: 12px; /* between the parts of a list's row (a run's name, figures and state) */
  --rowlist-pad: 10px; /* above and below a list's row */
  --rowlist-name-min: 10em;   /* the least a row's name keeps beside long figures */
  --strip-text-min: 15rem;    /* the least a decision's words keep beside its buttons before the buttons go under them */
  --card-r: 14px;      /* a box inside a card (the plan card's "Changed since the last plan") */
  --card-pad: 12px;    /* inside that box */
  --card-gap: 6px;     /* between the parts of a card's box, and a change and its folded detail */
  --fs-h4: 14px;       /* a small heading inside a card ("Changed since the last plan") */
  --list-indent: 18px; /* a list's indent, its markers inside the box */
  --underline-offset: 3px;   /* a text control's underline (a fold's summary) */
  --focus-ring: 2px solid var(--ink);   /* the visible focus of a control the global rule does not name (a summary) */
  --focus-offset: 2px;
  --hairline: 1px solid var(--grey-2);   /* a quiet box's edge */
  color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
/* Waiting for a change on its way (sj.js sjHold): every control held looks off, not only a .btn; its title says why. */
button[data-held]:disabled, input[data-held]:disabled { opacity: .4; cursor: not-allowed; }
.btn.is-busy, button.is-busy { cursor: progress; }
.n { font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; border: var(--b); border-radius: 10px; padding: 9px 16px; background: var(--ink); color: var(--paper); white-space: nowrap; transition: transform .08s; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn svg { width: 15px; height: 15px; }
.go-circle { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.go-circle svg { width: 13px; height: 13px; }
.textbtn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; font-weight: 600; font-size: 13.5px; }
.circ { width: 38px; height: 38px; border-radius: 50%; border: var(--b); display: grid; place-items: center; background: transparent; flex: none; }
.circ svg { width: 16px; height: 16px; }
.circ.sm { width: 30px; height: 30px; }
.circ.sm svg { width: 13px; height: 13px; }

.card { background: var(--paper); border: var(--b); border-radius: var(--r); box-shadow: var(--lip); }
.card.flat { box-shadow: none; }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* HOME */
.home { overflow: auto; padding: 18px 28px 32px; display: flex; flex-direction: column; gap: 30px; }
/* The composer is the hero: the headline and a one-line lede centred over a wide New search box
   (its title is for screen readers only: the headline says it), the examples as chips under it. */
.hero { display: flex; flex-direction: column; align-items: center; padding: 34px 0 6px; text-align: center; }
.home .hero h1 { margin: 0; font-size: clamp(39px, 4.8vw, 70px); line-height: 1; letter-spacing: -.04em; font-weight: 500; text-wrap: balance; }   /* two lines break after "data." */
.hero .lede { margin: 18px auto 0; max-width: 52ch; font-size: 20px; line-height: 1.45; letter-spacing: -.012em; color: var(--ink-2); text-wrap: balance; }
.hgrid { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; margin-top: 32px; text-align: left; }
.composer { width: 100%; max-width: 920px; padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 14px; }
.c-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: var(--b); padding-bottom: 10px; }
.c-head h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.c-head span { font-size: 12px; color: var(--grey); }
.composer textarea { border: 0; outline: 0; resize: none; background: transparent; font-size: 25px; font-weight: 500; letter-spacing: -.02em; min-height: 104px; line-height: 1.3; }
.composer .crow { padding-top: 12px; border-top: 1px solid var(--grey-2); }
.composer .crow .btn.primary { padding: 10px 20px; font-size: 14px; }
.composer textarea::placeholder { color: var(--grey); }
.columns > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); list-style: none; }
.columns > summary::-webkit-details-marker { display: none; }
.columns > summary::before { content: '+ '; }
.columns[open] > summary::before { content: '\2212 '; }
.columns .hint { margin: 6px 0 8px; font-size: 12.5px; color: var(--ink-2); }
.columns .chip[draggable="true"] { cursor: grab; }
.crow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.limit { font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--grey-2); border-radius: 8px; padding: 3px 9px; }
.limit b { color: var(--ink); font-weight: 600; }
.c-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; }
.illo { width: 100%; max-width: 150px; height: auto; color: var(--ink); }
.illo .pl { fill: var(--paper); }
.illo .ink { fill: currentColor; }
/* The examples: chips of one line, centred under the box; one fills the box. */
.stack { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.idea { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 15px; text-align: left; background: var(--paper); border: var(--b); border-radius: 999px; box-shadow: none; transition: background-color .1s, box-shadow .1s; }
.idea:hover { background: var(--hdr); }
.idea .t { flex: none; display: flex; flex-direction: column; min-width: 0; }
.idea .t b { font-weight: 500; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.idea .t small { display: none; }
.idea .circ { width: 26px; height: 26px; }
.idea .circ svg { width: 12px; height: 12px; }
.recent { display: flex; flex-direction: column; gap: 10px; }
.recent h3 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.rlist { display: flex; flex-direction: column; }
.rlist button { display: flex; align-items: center; gap: 14px; background: none; border: 0; border-top: 1px solid var(--grey-2); padding: 12px 2px; text-align: left; }
.rlist button:last-child { border-bottom: 1px solid var(--grey-2); }
.rlist button:hover .t b { text-decoration: underline; text-underline-offset: 4px; }
.rlist .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rlist .t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rlist .t small { color: var(--grey); font-size: 12px; }
.rlist .num { font-family: var(--font); font-size: 13px; }
.st { display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 1.5; border: 1px solid var(--grey-2); color: var(--ink-2); border-radius: 999px; padding: 0 9px; white-space: nowrap; font-style: normal; }
.st.run { background: var(--st-run-bg); border-color: var(--ink); color: var(--st-run); }
.st.plan { background: var(--st-plan-bg); border-color: var(--ink); color: var(--st-plan); }
.st.need { background: var(--orange); border-color: var(--ink); color: var(--ink); }
.st.done { background: var(--st-done-bg); border-color: var(--ink); color: var(--st-done); }
.st.paused { background: var(--st-pause-bg); border-color: var(--st-pause); color: var(--st-pause); }
.st.stopped { background: var(--st-stop-bg); border-color: var(--st-stop); color: var(--st-stop); }
.st.err { background: var(--st-err-bg); border-color: var(--st-err); color: var(--st-err); }
.rlist .t { gap: 8px; }
.rlist .t small { display: flex; gap: 8px; align-items: center; }
.wb-tb { position: relative; }
.wb-tb::after { content: ""; position: absolute; left: 0; bottom: -1.5px; height: 2px; width: 28%; background: var(--ink); opacity: 0; }
.wb.running .wb-tb::after, .wb.planning .wb-tb::after { opacity: 1; animation: sweep 1.6s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes sweep { from { left: -28%; } to { left: 100%; } }
/* Planning progress: four marks, finished steps filled, the current one outlined. */
.steps { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.steps i { display: block; width: 16px; height: 4px; border-radius: 2px; background: var(--grey-2); }
.steps i.done { background: var(--ink); }
.steps i.now { background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.wb-state .steps { margin-left: 10px; }

/* LIVE · workbook */
.live { padding: 6px 28px 20px; gap: 14px; position: relative; }
.qbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qbar :is(h1, h2) { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -.035em; flex: 1; min-width: 0; line-height: 1.1; }
.wb { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border: var(--b); border-radius: var(--r); box-shadow: var(--lip); overflow: hidden; }
.wb-tb { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: var(--b); flex-wrap: wrap; }
.state { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.state .n { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.state .what { color: var(--grey); }
.seg { display: inline-flex; gap: 2px; border: 1px solid var(--grey-2); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 11px; font-size: 12.5px; font-weight: 600; border-radius: 8px; color: var(--ink-2); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--st-pause-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg button[data-view="cut"][aria-checked="true"] { background: var(--st-stop-bg); color: var(--st-stop); box-shadow: inset 0 0 0 1px var(--st-stop); }
/* The row views and Complete only (wb-filters.js), every one always in view. A phone (880 px and under): the views two by
   two across the width, Complete only on the line under them. A desktop: one line, wrapping only where the table is too
   narrow for it. */
.wb-filters { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; min-inline-size: 0; }
.wb-filters__views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 100%; }
.wb-filters__complete { flex: none; white-space: nowrap; }
@media (min-width: 881px) {
  .wb-filters { flex: 0 1 auto; }
  .wb-filters__views { display: inline-flex; flex-wrap: wrap; flex: 0 1 auto; }
  .wb-filters__views button { white-space: nowrap; }
}
.wb-filters__complete[aria-pressed="true"] { background: var(--st-run-bg); color: var(--st-run); border-color: var(--st-run); }
.fx { display: flex; border-bottom: 1px solid var(--grid); font-size: 12.5px; }
.fx .ref { width: 62px; padding: 5px 10px; border-right: 1px solid var(--grid); font-family: var(--font); color: var(--grey); }
.fx .lbl { padding: 5px 10px; border-right: 1px solid var(--grid); color: var(--grey); }
.fx .val { padding: 5px 10px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gridbox { flex: 1; min-height: 0; overflow: auto; }
.grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.grid thead th { position: sticky; top: 0; z-index: 1; background: var(--hdr); color: var(--grey); font-weight: 400; font-size: 11px; font-family: var(--font); border: 1px solid var(--grid); border-top: 0; padding: 2px 6px; text-align: center; }
.grid thead tr.names th { top: var(--letters-h); font-family: var(--font); font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: left; padding: 6px 10px; background: var(--paper); border-bottom: var(--b); }
.grid th.rh, .grid td.rh { width: 40px; background: var(--hdr); color: var(--grey); font-family: var(--font); font-size: 11px; text-align: center; padding: 0; }
.grid td { border: 1px solid var(--grid); padding: 6px 10px; height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.grid td.mono { font-family: var(--font); font-size: 12px; }
.grid td.miss { color: var(--grey); }
/* A missing value: a small grey dot, not a character (copy carries no em dashes). */
.grid td.miss::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--grey-2); vertical-align: middle; }
.grid td.src { font-family: var(--font); font-size: 11px; color: var(--grey); }
.grid td.sel { outline: 1.5px solid var(--ink); outline-offset: -1.5px; }
.grid tr.fresh td:not(.rh) { animation: fill 2.4s ease-out; }
@keyframes fill { 0%, 25% { background: var(--yellow); } 100% { background: transparent; } }
.grid tr.cut td:not(.rh):not(.act):not(.why) { color: var(--grey); text-decoration: line-through; }
/* Why a row was cut: a column of its own in the Cut view only (the page's own view before the filters' script runs, then its). */
.grid .why { display: none; }
#workbook[data-view="cut"]:not([data-view-now]) .grid .why, #workbook[data-view-now="cut"] .grid .why { display: table-cell; }
.grid td.why { min-width: 12em; max-width: 22em; color: var(--st-stop); font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }
.grid th.why { text-align: start; }
.grid tr.cut td.rh { background: var(--st-stop-bg); color: var(--st-stop); box-shadow: inset 3px 0 0 var(--st-stop); }
.grid tr.kept td.rh { background: var(--st-done-bg); color: var(--st-done); font-weight: 700; box-shadow: inset 3px 0 0 var(--st-done); }
.grid tr.ghost td:not(.rh) { cursor: default; }
.grid tr.ghost td:not(.rh)::after { content: ""; display: block; height: 7px; width: 55%; background: var(--grey-3); border-radius: 4px; }
.grid td.act { width: 74px; text-align: center; padding: 0 4px; }
/* A row's mark, Cut or Restore, in view with no hover or menu to find it (spec item 22). */
.ra { display: inline-flex; gap: 4px; }
.ra button { border: 1px solid var(--ink); background: var(--paper); border-radius: 50%; width: 24px; height: 24px; font-size: 11px; padding: 0; line-height: 1; }
.ra button:hover { background: var(--ink); color: var(--paper); }
/* A row's ✎ (a steering note about it, workbook.js): filled while the row has a note. */
.ra button.rnote { display: inline-flex; align-items: center; justify-content: center; }
.ra button.rnote svg { width: 12px; height: 12px; }
.ra button.rnote[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
/* A row waiting for a check has three marks (✎, Restore, Cut): its view's action column makes room for them. */
#workbook[data-view="check"]:not([data-view-now]) .grid col.actc, #workbook[data-view-now="check"] .grid col.actc { width: 92px; }
/* Select, in the sheet's corner above the row numbers: a toggle, filled while its checkboxes show. The letters' row is its height
   (the names' row sticks under it). */
.grid { --letters-h: 28px; }
.grid thead tr.letters th { height: var(--letters-h); padding-top: 0; padding-bottom: 0; }
.grid th.corner { vertical-align: middle; }
.selmode { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0 auto; padding: 0; border: 1px solid var(--grey-2); border-radius: 6px; background: var(--paper); color: var(--ink-2); cursor: pointer; vertical-align: middle; }
.selmode svg { width: 15px; height: 15px; }
.selmode:hover { border-color: var(--ink); color: var(--ink); }
.selmode[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sheets { display: flex; align-items: center; gap: 6px; border-top: var(--b); background: var(--hdr); padding: 7px 12px; font-size: 12.5px; flex-wrap: wrap; }
.sheets button { border: 1px solid transparent; background: none; border-radius: 8px; padding: 2px 11px; font-weight: 600; color: var(--ink-2); }
.sheets button[aria-selected="true"] { background: var(--paper); border-color: var(--ink); color: var(--ink); }
.sheets .stat { font-size: 12px; color: var(--grey); }
.sheets .stat b { color: var(--ink); font-weight: 600; }

.strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px 14px 20px; border: var(--b); border-radius: 18px; box-shadow: var(--lip-s); animation: up .25s ease-out; background: var(--orange); }
.strip > span { flex: 1; min-width: 220px; }
/* A decision's compact labelled lines (LimitDecision, the stop's Retry): each line its label then its words, wrapping whole. */
.strip-what { flex: 1 1 var(--strip-text-min); min-inline-size: 0; display: flex; flex-direction: column; gap: var(--gap-lines); }
.strip-h, .strip-note { margin: 0; }
.strip-lines { margin: 0; display: flex; flex-direction: column; gap: var(--gap-lines); }
.strip-lines > div { display: flex; flex-wrap: wrap; column-gap: var(--gap-words); min-inline-size: 0; }
.strip-lines dt { font-weight: 600; }
.strip-lines dd { margin: 0; min-inline-size: 0; overflow-wrap: anywhere; }
.strip .btn.ghost { border-color: var(--ink); }
.strip.done { background: var(--paper); }
/* The one question a search waits with before it spends (understand_first): options, then the user's own words. */
.strip.ask { flex-direction: column; align-items: stretch; gap: 10px; }
.strip.ask .ask-q { margin: 0; }
.strip.ask .ask-note { font-size: 13px; }
.strip.ask .ask-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.strip.ask .ask-other { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.strip.ask .ask-other input { flex: 1; min-width: 0; border: var(--b); border-radius: 10px; background: var(--paper); padding: 7px 10px; font-size: 13px; line-height: 1.4; }
.strip.ask .ask-label { font-weight: 600; font-size: 13px; flex-basis: 100%; }
.strip.ask > form.inline:last-child { align-self: flex-start; }
.pc-q .pc-q-err { margin: 6px 0 0; font-size: 13px; }
.understood { margin: 14px 0 12px; }
.understood > p { margin: 0 0 8px; }
.understood .facts { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.mw { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; background: var(--paper); border: var(--b); border-radius: 16px; box-shadow: var(--lip-s); padding: 6px; z-index: 6; }
.menu button { width: 100%; display: flex; justify-content: space-between; background: none; border: 0; border-radius: 10px; padding: 8px 10px; font-weight: 600; text-align: left; }
.menu button:hover { background: var(--page); }
.menu small { color: var(--grey); font-weight: 500; }
.menu hr { border: 0; border-top: 1px solid var(--grey-2); margin: 4px 4px; }

.scrim { position: fixed; inset: 0; background: rgba(24,24,27,.10); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 8; }
.sheet { position: fixed; top: 12px; right: 12px; bottom: 18px; width: min(430px, 92%); background: var(--paper); border: var(--b); border-radius: var(--r); box-shadow: var(--lip); transform: translateX(110%); transition: transform .24s cubic-bezier(.2,.9,.25,1); z-index: 9; display: flex; flex-direction: column; overflow: hidden; }
.sh-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.sh-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
/* The tabs stay on one row: where they do not fit, the row scrolls sideways inside itself (the selected tab kept in
   view, details.js), never the page (spec 2.4). */
.tabs { display: flex; gap: 20px; padding: 0 18px; border-bottom: var(--b); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; white-space: nowrap; }
.tabs button { border: 0; background: none; padding: 6px 0 9px; font-size: 13px; font-weight: 600; color: var(--grey); border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.pane { padding: 14px 18px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.rowlist { display: flex; flex-direction: column; }
.rowlist > div { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grey-3); }
.time { font-family: var(--font); font-size: 11.5px; color: var(--grey); flex: none; }
.tag { font-size: 11.5px; font-weight: 600; border: 1px solid var(--ink); border-radius: 999px; padding: 0 9px; white-space: nowrap; }
.tag.bad { background: var(--st-err-bg); border-color: var(--st-err); color: var(--st-err); }
.tag.open { background: var(--st-run-bg); border-color: var(--st-run); color: var(--st-run); }
.tag.used { background: var(--st-done-bg); border-color: var(--st-done); color: var(--st-done); }
.tag.dry { background: var(--st-pause-bg); border-color: var(--st-pause-bg); color: var(--st-pause); }
.tag.mute { border-color: var(--grey-2); color: var(--grey); }
.kv { display: grid; grid-template-columns: 115px 1fr; gap: 10px 12px; margin: 0; }
.kv dt { color: var(--grey); }
.kv dd { margin: 0; font-weight: 500; }
.hint { color: var(--grey); font-size: 12.5px; margin: 0; }
.hint a { color: var(--ink-2); text-underline-offset: 3px; }

.pal-wrap { position: fixed; inset: 0; background: rgba(24,24,27,.14); z-index: 20; display: flex; justify-content: center; align-items: flex-start; padding-top: 90px; }
.pal { width: min(520px, 92%); background: var(--paper); border: var(--b); border-radius: var(--r); box-shadow: var(--lip); overflow: hidden; padding: 6px 18px 12px; }
.pal input { width: 100%; border: 0; border-bottom: var(--b); padding: 12px 0; font-size: 18px; font-weight: 500; outline: 0; background: transparent; margin-bottom: 4px; }
.pal .rlist button:first-child { border-top: 0; }
.pal .rlist button:last-child { border-bottom: 0; }


/* ---- App shell (top bar) ---- */
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.top { display: flex; align-items: center; gap: 20px; padding: 12px max(28px, env(safe-area-inset-left, 0px)); min-height: 64px; box-sizing: border-box; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
/* The logo (App\Lib\Logo): the emblem and the wordmark, 26 px tall, touching (the wordmark's own drawing starts with the
   space between them), so the two are the logo file's lockup. Their ink is the logo's, whatever the text around them. */
.logo-mark, .logo-wm { display: block; flex: none; height: 26px; color: var(--logo-ink); }
.logo-mark { width: 26px; }
.logo-wm { width: calc(26px * 207 / 56); margin-left: -8px; }
/* The brand is one home link (app/Elements/brand.elm.php): mark, wordmark, "by ujeebu" (part of the
   brand, not a link of its own) and the Beta tag, with a hit area wider than what it shows. */
.top .logo, .auth-top .logo, .lp-top .logo { padding: 6px 10px; margin: -6px -10px; border-radius: 12px; flex: none; }
.by-uj { display: inline-flex; align-items: center; margin-left: 2px; padding-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--grey); white-space: nowrap; }
/* Places on the left after the brand, one size, one line with the brand and the right side's controls;
   40 px tall targets; the page you are on: ink with an ink bar under it (no weight change, nothing moves). */
.nav { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.nav a { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--grey-3); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--ink); }
.grow { flex: 1; }
/* The right side: New search, the balance, the bell, the account; one height, even gaps. */
.top .tr { display: flex; align-items: center; gap: 8px; flex: none; }
.tr > .credits { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--grey-3); font-size: 13px; color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tr > .credits:hover { color: var(--ink); background: var(--grey-2); }
.top .newsearch { height: 36px; padding: 0 13px 0 10px; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.top .newsearch svg { width: 14px; height: 14px; flex: none; }
.top .avatar { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1; }
@media (min-width: 821px) { .top .circ.sm { width: 36px; height: 36px; } .top .circ.sm svg { width: 16px; height: 16px; } }
/* Where the places and the actions just fit (821 to 1100 px), New search is its mark alone (named for screen readers). */
@media (min-width: 821px) and (max-width: 900px) { .top .logo .by-uj { display: none; } }   /* the places still in the bar: the lockup gives the room */
@media (min-width: 821px) and (max-width: 1100px) {
  .top .newsearch { width: 36px; padding: 0; justify-content: center; }
  .top .newsearch .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.outline { background: transparent; border: var(--b); border-radius: 10px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.outline:hover { background: var(--paper); }
.bell { position: relative; }
.bell .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.menu.wide { width: 320px; max-height: 380px; overflow-y: auto; }
.menu a { display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; padding: 8px 10px; font-weight: 600; color: var(--ink); text-decoration: none; }
.menu a:hover { background: var(--page); }
.menu .nitem { display: block; border-radius: 10px; padding: 8px 10px; color: var(--ink); text-decoration: none; }
.menu .nitem:hover { background: var(--page); }
.menu .nitem b { display: block; font-weight: 600; }
.menu .nitem span { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
/* New against read, not by colour alone: unread ones have a dot, a bolder title and a faint blue
   tint (the info blue: the accent is kept for primary actions); read ones are plain on white. */
.menu .nitem { position: relative; }
.menu .nitem b { font-weight: 500; }
.menu .nitem.unread { background: var(--st-run-bg); padding-left: 24px; }
.menu .nitem.unread:hover { background: var(--st-run-bg); filter: brightness(.98); }
.menu .nitem.unread b { font-weight: 700; }
.menu .nitem .ndot { position: absolute; left: 10px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--st-run); }
.menu .nitem + .nitem { margin-top: 2px; }
.menu .nitem .st { float: right; margin: 1px 0 0 8px; }
.menu .nsec { padding: 10px 10px 4px; color: var(--grey); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
/* A notification whose decision was made (Plan approved, Cancelled, ...): read, its pill quiet, a check, no colour. */
.st.handled { background: transparent; border-color: var(--grey-2); color: var(--ink-2); font-weight: 500; }
.st.handled::before { content: "\2713"; margin-right: 4px; }
.menu .nitem.handled b { color: var(--ink-2); }
/* When it happened, in words ("5 min ago"); the exact time in its title on hover, or beside it after a
   long press on a phone (.ntip, sj.js), which does not open the notification. */
.menu .nitem .nwhen { display: inline-block; margin-top: 3px; color: var(--grey-ink); font-size: 11.5px; font-weight: 500; line-height: 1.3; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.menu .nitem .ntip { position: absolute; z-index: 2; display: block; padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.menu .nhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu .nhead .textbtn { width: auto; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 0; padding: 2px 0; }   /* at the right end, not a menu row */
.menu .nhead .textbtn:hover { background: none; text-decoration-thickness: 2px; }
.menu .nhead .textbtn[hidden] { display: none; }
/* Notification toasts (sj.js): bottom right, above the action toast, at most three. */
.ntoasts { position: fixed; right: 24px; bottom: calc(80px + var(--dock-h, 0px)); z-index: 1090; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.ntoast { pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; border-radius: 14px; box-shadow: var(--lip-s); animation: up .25s ease-out; }
.ntoast .nt { min-width: 0; display: flex; flex-direction: column; }
.ntoast .nt b { font-size: 13.5px; font-weight: 700; }
.ntoast .nt span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ntoast .x { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; color: var(--ink-2); padding: 0; }
.ntoast .x:hover { background: var(--grey-3); color: var(--ink); }
.menu .empty { padding: 16px 10px; color: var(--grey); font-size: 13px; }
.menu .head { padding: 6px 10px; color: var(--grey); font-size: 12px; font-weight: 600; }
.main { padding: 18px max(28px, env(safe-area-inset-left, 0px)) 72px; }
.banner { margin: 0 max(28px, env(safe-area-inset-left, 0px)); }
body.open { overflow: hidden; }
body.open .sheet { transform: none; }
body.open .scrim { opacity: 1; pointer-events: auto; }
.btn { text-decoration: none; }
a.rowlink { color: inherit; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .wb.running .wb-tb::after, .wb.planning .wb-tb::after { left: 0; width: 100%; opacity: .15; }
}
.main[tabindex]:focus-visible { outline: 0; }
.composer:focus-within, .pal:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Combobox (Elements/combobox.elm.php: the Settings model fields). */
.sj-combo { position: relative; }
.sj-combo__panel { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--paper); border: var(--b); border-radius: 10px; padding: 5px; max-height: 236px; overflow-y: auto; }
.sj-combo.sj-open .sj-combo__panel { display: block; }
.sj-combo__opt { padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sj-combo__opt[hidden], .sj-combo__empty[hidden] { display: none; }
.sj-combo__opt:hover, .sj-combo__opt--active { background: var(--page); }
.sj-combo__chev { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 6px; }

/* Task 6: home composer inputs, links in lists, Searches page, palette. */
.textbtn, .rlist a, .slist a { color: inherit; text-decoration: none; }
.limit input { width: 8ch; border: 0; border-bottom: 1px solid var(--grey-2); background: transparent; font: inherit; font-weight: 600; color: var(--ink); padding: 0; text-align: right; outline: 0; }
.limit input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The time limit ("Stop after"): typed in free form ("20 min", "1 h 30 min"), wide enough for the longest it shows; set like the
   numbers beside it. */
.limit input.t { width: 10ch; }
.rlist a { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--grey-2); padding: 12px 2px; }
.rlist a:last-child { border-bottom: 1px solid var(--grey-2); }
.rlist a:hover .t b { text-decoration: underline; text-underline-offset: 4px; }
.pal .rlist a:first-child, .pal .rlist button:first-child { border-top: 0; }
.rlist button[aria-selected="true"] .t b, .rlist a[aria-selected="true"] .t b { text-decoration: underline; text-underline-offset: 4px; }
.count-badge { font-size: 12.5px; color: var(--ink-2); }
.pal-empty { padding: 14px 2px; color: var(--grey); font-size: 13px; }
.searches { gap: 18px; }
.shead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.shead :is(h1, h2) { margin: 0; font-size: 42px; line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.sfilter { flex: 1; min-width: 200px; }
.sfilter input { width: 100%; border: var(--b); border-radius: 10px; padding: 8px 12px; background: var(--paper); font: inherit; }
.sempty { color: var(--grey); }
.slist { display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) 80px 110px 36px; align-items: center; gap: 12px 18px; border-top: 1px solid var(--grey-2); padding: 12px 2px; }
.srow:last-child { border-bottom: 1px solid var(--grey-2); }
.srow .t { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.srow .col-rows, .srow .col-when { text-align: right; }
.srow .t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .t:hover b { text-decoration: underline; text-underline-offset: 4px; }
.srow .t small { display: flex; gap: 8px; align-items: center; color: var(--grey); font-size: 12px; }
.srow .num { font-size: 13px; white-space: nowrap; }
.menu form { margin: 0; }
.srow .meta { color: var(--grey); font-size: 12px; }
.rlist .t small .meta { color: var(--grey); }
/* What a search spent, in a list of searches (Home's, the Searches page): its page's header words (SpendSummary) under its
   name and state, at every width the whole of the name's column, wrapping rather than cut ("Spent 770 credits and $0.64
   of AI so far" never loses its money). */
.rlist .t .t-spend, .srow .t .t-spend { display: block; color: var(--ink-2); font-size: var(--fs-meta); line-height: 1.45; min-inline-size: 0; overflow-wrap: anywhere; }

/* Task 7: the workbook page. */
form.inline { display: inline-flex; margin: 0; }
.wb { position: relative; }
.wb-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wb-ctl { display: inline-flex; }
.when { font-size: 12px; color: var(--grey); }
/* On a phone, and in a window under 600 px tall (a short one, or a zoomed page), the page scrolls and the grid is capped;
   otherwise only the table scrolls (the block below). */
@media (max-width: 880px), (max-height: 599.98px) { .live .gridbox { max-height: min(62vh, 640px); } }
/* On a desktop only the table scrolls (spec item 20): the page that holds the workbook is the window's height and never
   scrolls, so the top bar and the command center stay put. The page, the view, its main and the table card are flex
   columns, and the grid takes the room left. A window under 600 px tall keeps the scrolling page: the grid would have
   almost no room, and what is under it could not be reached. */
@media (min-width: 881px) and (min-height: 600px) {
  html:has(> body > .main > .view.live), body:has(> .main > .view.live) { height: 100%; overflow: hidden; }
  body:has(> .main > .view.live) { display: flex; flex-direction: column; min-height: 0; }
  body:has(> .main > .view.live) > * { flex-shrink: 0; }
  body > .main:has(> .view.live) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 0; }   /* the view's own padding keeps the card's lip in view */
  .view.live > .wb-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
}
.fx .cv { flex: 0 1 auto; max-width: 50%; padding: 5px 10px; border-right: 1px solid var(--grid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx .cv:empty { display: none; }
.fx .val a { color: var(--ink); text-underline-offset: 3px; }
.grid th.rh, .grid td.rh { position: sticky; left: 0; z-index: 1; }
.grid thead th.rh { z-index: 2; }
.grid td.act { position: relative; }
.grid .ra { position: absolute; inset: 0; align-items: center; justify-content: center; }
.jump { position: absolute; right: 14px; bottom: 50px; z-index: 3; }
.wb-empty { padding: 18px 16px; }
.wb.is-zero .fx, .wb.is-zero .gridbox, .wb.is-zero .jump { display: none; }
.wb-zero { padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.wb-zero h3 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.wb-zero p { margin: 0; color: var(--ink-2); }
.wb-zero .tried { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.strip.stop { background: var(--paper); }

/* Task 8: search controls, select mode, reviewer line. */
.wb-ctl { gap: 8px; align-items: center; }
.btn.ic { width: 32px; height: 32px; padding: 0; border-radius: 50%; justify-content: center; }
.ctl-more { position: relative; display: inline-flex; }
.ctl-more > summary { list-style: none; cursor: pointer; }
.ctl-more > summary::-webkit-details-marker { display: none; }
.ctl-more .menu { width: 160px; }
.wb-tb .bulk { display: inline-flex; align-items: center; gap: 8px; margin: 0; flex-basis: 100%; flex-wrap: wrap; justify-content: flex-end; }
.wb-tb .bulk[hidden] { display: none; }
.grid td.rh .pick { margin: 0; width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
.wb.selecting .grid td.rh .rn { display: none; }
.reviewer { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.reviewer a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.ctl-more .menu form { display: flex; }
/* Small screens put the header's controls at the left edge: the menu opens rightwards from there. */
@media (max-width: 820px) { .ctl-more .menu { right: auto; left: 0; } }

/* Task 9: the Details side sheet (Activity, Sources, Runs, Setup, Log). */
.sheet[inert] { visibility: hidden; transition: transform .24s cubic-bezier(.2,.9,.25,1), visibility 0s .24s; }
.sheet .pane:focus-visible { outline-offset: -2px; }
.dgroup, .sgroup, .run-group { display: flex; flex-direction: column; gap: 10px; }
.sgroup + .sgroup { border-top: 1px solid var(--grey-3); padding-top: 16px; }
.dgroup h3, .sgroup h3, .run-group h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.insights { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.rowlist .t { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.rowlist .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlist .t small { color: var(--ink-2); font-size: 12px; line-height: 1.45; }
/* Details, Runs: a run's row (a.pass), mobile first. A narrow list puts its name and state on one line and what it added,
   spent and took under them, the whole width (a spend can be long: "1,234 credits plus AI, not priced yet"). From 26rem
   of list (every desktop sheet) all on one line as before, where what it spent wraps rather than squeezing the name. */
.run-group { container: runs / inline-size; }
.rowlist > a.pass { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "meta meta";
  column-gap: var(--rowlist-gap); row-gap: var(--gap-lines); align-items: center; padding-block: var(--rowlist-pad); padding-inline: 0;
  border-block-end: 1px solid var(--grey-3); color: inherit; text-decoration: none; }
.rowlist > a.pass > .t { grid-area: name; }
.rowlist > a.pass > .tag { grid-area: state; justify-self: end; }
.rowlist > a.pass > .time { grid-area: meta; min-inline-size: 0; text-align: start; overflow-wrap: anywhere; }
@container runs (min-width: 26rem) {
  .rowlist > a.pass { display: flex; }
  .rowlist > a.pass > .t { min-inline-size: min(var(--rowlist-name-min), 40%); }
  .rowlist > a.pass > .time { flex: 0 1 auto; text-align: end; }
}
.rowlist > a.pass:hover .t b { text-decoration: underline; text-underline-offset: 4px; }
.rowlist .time { text-align: right; }
.passnote a { color: var(--ink); text-underline-offset: 3px; }
/* Details, Log (_details_log.tpl.php): a line a row, the newest at the bottom; a long line shows its start and
   Show more (details.js sets data-fold; without it the whole line shows); every word wraps inside the block,
   a formatted JSON answer too, so a phone never scrolls sideways. Each line's copy button shows on hover or
   focus where there is a pointer; a touch screen has Copy log. */
.logtab { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.log-region { min-width: 0; }
.log-bar { position: sticky; top: -14px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -14px -18px 0; padding: 10px 18px; background: var(--paper); border-bottom: 1px solid var(--grey-3); }
.log { font-family: var(--font); font-size: 11.5px; line-height: 1.7; color: var(--ink-2); background: var(--hdr); border: 1px solid var(--grid); border-radius: 12px; padding: 6px 12px; margin: 0; list-style: none; min-width: 0; }
.log i { font-style: normal; color: var(--grey); }
.log > li { position: relative; padding: 4px 28px 4px 0; overflow-wrap: anywhere; min-width: 0; }
.log > li + li { border-top: 1px solid var(--grey-3); }
.log .lmeta { color: var(--grey); margin-right: 4px; }
.log > li.err .lmsg { color: var(--red); }
.log .lshort, .log .lmore { display: none; }
.log[data-fold] > li.long:not(.open) .lfull { display: none; }
.log[data-fold] > li.long:not(.open) .lshort { display: inline; }
.log[data-fold] .lmore { display: inline; margin-left: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.log .ljson { margin: 6px 0 2px; padding: 8px 10px; background: var(--paper); border: 1px solid var(--grey-3); border-radius: 8px; font: inherit; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; overflow-x: auto; }
.log .lcopy { position: absolute; top: 3px; right: 0; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--grey); opacity: 0; }
.log .lcopy svg { width: 13px; height: 13px; }
.log > li:hover .lcopy, .log .lcopy:focus-visible { opacity: 1; }
.log .lcopy:hover { color: var(--ink); background: var(--paper); }
@media (hover: none) { .log .lcopy { display: none; } .log > li { padding-right: 0; } }
/* A run's first line: "Run 3, started 14:02" over its lines (the Log groups its lines by run). */
.log > li.lsep { padding: 8px 0 2px; color: var(--ink); font-weight: 600; }
.log > li.lsep small { font-weight: 400; color: var(--grey); }
.log > li.lsep + li { border-top: 0; }
/* The Details tabs on a phone: the six spread across one row (a second row only below about 350 px). */
@media (max-width: 520px) { .tabs { gap: 14px; } }

/* Setup forms */
.setup { display: flex; flex-direction: column; gap: 16px; }
.sform { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select, .tags-src { width: 100%; border: 1px solid var(--grey-2); border-radius: 10px; background: var(--paper); padding: 7px 10px; font-size: 13px; line-height: 1.4; }
.field textarea { resize: vertical; }
.field input:disabled, .field textarea:disabled, .field select:disabled { background: var(--hdr); color: var(--grey); cursor: not-allowed; }
.field [aria-invalid="true"] { border-color: var(--ink); border-width: 1.5px; }
.factions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.unit { display: flex; align-items: center; gap: 6px; }
.unit input { width: 100%; min-width: 0; text-align: right; }
.unit small { color: var(--grey); font-size: 12px; white-space: nowrap; }
.fset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fset legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fset label, .checks label { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; cursor: pointer; }
.fset input[type="radio"], .fset input[type="checkbox"], .checks input { margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.fsub { display: flex; flex-direction: column; gap: 8px; padding-left: 22px; }
.fsub .seg { align-self: flex-start; position: relative; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.inline-field { flex-direction: row; align-items: center; gap: 8px; }
.inline-field select { width: auto; }
.fmore > summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.fmore[open] > summary { margin-bottom: 10px; }
.danger:not(.btn) { margin: 6px 0 0; border-top: 1px solid var(--grey-3); padding-top: 14px; }   /* not a red button: the confirm's Stop is .btn.danger and keeps its own box */
.dup-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; line-height: 1.45; max-height: 320px; overflow-y: auto; overflow-wrap: anywhere; }
.dup-list li { border-top: 1px solid var(--grey-3); padding-top: 6px; }
.dup-list .muted { color: var(--grey); }

/* Keyword / seed URL tag inputs */
.tags-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--grey-2); border-radius: 10px; background: var(--paper); padding: 5px 6px; min-height: 38px; }
.tags-box:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.tags-input { flex: 1; min-width: 120px; border: 0; outline: 0; background: transparent; font-size: 13px; padding: 3px 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 1px solid var(--grey-2); border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 12.5px; background: var(--hdr); }
.chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.chip-x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; padding: 0; line-height: 1; color: var(--ink-2); }
.chip-x:hover { background: var(--grey-3); color: var(--ink); }

/* Column editor */
.cols { display: flex; flex-direction: column; gap: 8px; }
.col { border: 1px solid var(--grey-2); border-radius: 14px; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.col-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.col-row .field { flex: 0 1 96px; }
.col-row .field.grow { flex: 1 1 120px; }
.col-row .field:has([data-val-kind]) { flex-basis: 150px; }
.col-row.checks { align-items: center; gap: 16px; font-size: 13px; }
.col .textbtn { font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.kv dd.urls { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; font-weight: 500; }

/* Column header menus and the Export menu */
.grid thead tr.names th { overflow: visible; }
.grid thead th:focus-within, .grid thead th.menu-open { z-index: 5; }
.grid .hd { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.grid .hd .hdn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grid .hd svg { width: 12px; height: 12px; flex: none; color: var(--grey); }
/* A column's resize handle (wb-col-widths.js): on the header's end edge, a finger wide on a touch screen, with a hairline
   that shows on hover, on focus and while dragged. The grid lays its columns out left to right whatever a name's own
   direction, so the handle keeps to the physical right, as the sticky row numbers keep to the left. */
:root { --colsize-hit: 24px; }
@media (min-width: 881px) and (pointer: fine) { :root { --colsize-hit: 10px; } }
.grid thead tr.names th[data-col] { padding-right: var(--colsize-hit); }
.wb-colsize { position: absolute; top: 0; bottom: 0; right: 0; width: var(--colsize-hit); z-index: 1; cursor: col-resize; touch-action: none; }
.wb-colsize::after { content: ""; position: absolute; top: 6px; bottom: 6px; right: 0; width: 2px; border-radius: 1px; background: var(--ink); opacity: 0; }
.wb-colsize:hover::after, .wb-colsize:focus-visible::after, .grid.is-resizing .wb-colsize:focus::after { opacity: 1; }
.wb-colsize:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
@media (pointer: coarse) { .wb-colsize::after { opacity: .35; } }
.grid.is-resizing, .grid.is-resizing * { cursor: col-resize; user-select: none; }
.menu.cm { width: 288px; max-width: calc(100vw - 24px); max-height: min(78vh, 560px); overflow-y: auto; padding: 12px; color: var(--ink); font-size: 13px; font-weight: 500; text-align: left; white-space: normal; }
.grid .menu.cm { position: fixed; right: auto; top: 0; left: 0; }
.cmform { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.menu.cm .field > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.menu.cm .btn { width: auto; justify-content: center; background: var(--ink); color: var(--paper); border: var(--b); border-radius: 10px; padding: 6px 12px; }
.menu.cm .btn.ghost { background: transparent; color: var(--ink); }
.menu.cm .btn:hover { background: var(--ink); }
.menu.cm .btn.ghost:hover { background: var(--page); }
.cmact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmact .grow { flex: 1; }
.menu .chk, .chk { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; cursor: pointer; padding: 6px 10px; }
.menu.cm .chk { padding: 0; }
.chk input { margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.chk small { color: var(--grey); font-weight: 500; }
.menu .chk small { margin-left: auto; }
.menu.cm .chk small { margin-left: 0; display: block; }
.menu.cm .chk { flex-wrap: wrap; }
details.rm > summary { cursor: pointer; list-style: none; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
details.rm > summary::-webkit-details-marker { display: none; }
details.rm[open] { flex-basis: 100%; }
.rmbox { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 8px; border-top: 1px solid var(--grey-2); padding-top: 8px; }
.rmbox p { margin: 0; }
.cmshow { margin: 0; }
/* The Columns pane's "Add a column" and "Hidden columns" (spec item 21), above the schema editor. */
.cc-colpane { display: flex; flex-direction: column; gap: 16px; margin-block-end: 16px; padding-block-end: 16px; border-block-end: 1px solid var(--grey-3); }
.cc-colpane .cmform { max-inline-size: 420px; }
.cc-colpane .cmact { justify-content: flex-start; }
.cc-colpane__shown { display: flex; flex-wrap: wrap; gap: 8px; }
/* The line under the workbook's toolbar (#wb-marks, _state/marks): the latest mark and its Undo, or what marks are for.
   The duplicates line under it (#wb-dupes, _state/dupes) is drawn the same, its Review as the Undo. */
.wb-marks { display: block; margin: 0; padding-block: 4px; padding-inline: 12px; border-block-end: 1px solid var(--grid);
  background: var(--paper); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.wb-marks[hidden] { display: none; }
.wb-marks--undo { color: var(--ink); font-weight: 600; }
.wb-marks__undo { font-size: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cc-colpane .chk small, .cc-colpane .hint { color: var(--ink-2); }
.menu.cm .cmshow button { padding: 6px 10px; }
.menu .hint { padding: 4px 10px; }
.menu.cm .hint { padding: 0; }
.menu .hint:empty { display: none; }
.copybox { width: calc(100% - 20px); margin: 6px 10px 4px; border: 1px solid var(--grey-2); border-radius: 10px; background: var(--paper); font: inherit; font-size: 12.5px; padding: 6px 8px; resize: vertical; }
#export-menu { width: 280px; }

/* Task 11: global pages (Usage, Credits, Settings, Billing). */
.gpage { display: flex; flex-direction: column; gap: 22px; max-width: 1080px; }
.gpage.narrow { max-width: 680px; }
.phead { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.phead > div { flex: 1; min-width: 240px; }
.phead :is(h1, h2) { margin: 0; font-size: 42px; line-height: 1; letter-spacing: -.04em; font-weight: 500; }
.phead p { margin: 10px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 62ch; }
.sstack { display: flex; flex-direction: column; gap: 32px; }
/* The top row of buttons keeps clear of the section below (32px gap + 8px). */
.sstack > .actions.end { padding-bottom: 8px; }
.panel { padding: 20px 22px; }
.panel.flush { padding: 0; overflow: hidden; }
.ph { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.ph h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ph .hint { margin-left: auto; }
.panel.flush > .ph { padding: 16px 22px 12px; margin: 0; border-bottom: 1px solid var(--grey-3); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.split.wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.metric { padding: 18px 22px; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--grey-3); }
.metric .k { color: var(--grey); font-size: 12px; font-weight: 600; }
.metric .v { font-size: 30px; line-height: 1.1; font-weight: 500; letter-spacing: -.03em; margin-top: 6px; }
.metric .s { color: var(--grey); font-size: 12px; margin-top: 4px; }
.bar { height: 8px; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper); }
.bar > i { display: block; height: 100%; background: var(--ink); }
.bar.thin { height: 6px; }
.barnote { display: flex; justify-content: space-between; gap: 12px; color: var(--grey); font-size: 12px; margin-top: 7px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars > div > i { display: block; min-height: 2px; background: var(--ink); border-radius: 3px 3px 0 0; }
.bars.soft > div > i { background: var(--grey-2); }
.barsx { display: flex; justify-content: space-between; color: var(--grey); font-size: 11px; margin-top: 8px; }
.emptynote { display: flex; align-items: center; justify-content: center; height: 110px; margin: 0; color: var(--grey); font-size: 13px; text-align: center; }
/* New rows per cycle: narrow neutral bars (never a full-width block), the cycle number under
   each (thinned out past ~12), the value on top while there are few enough to read. */
.cbars { display: flex; justify-content: center; gap: 6px; height: 128px; padding-top: 16px; }
.cbars .cb { flex: 1 1 0; min-width: 0; max-width: 36px; display: flex; flex-direction: column; }
.cbars .ca { flex: 1; display: flex; align-items: flex-end; }
.cbars .ca i { position: relative; display: block; width: 100%; min-height: 2px; background: var(--ink-2); border-radius: 4px 4px 0 0; }
.cbars .cb:hover .ca i { background: var(--ink); }
.cbars .cv { display: none; font-style: normal; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.cbars.vals .cv { display: block; }
.cbars .cl { height: 16px; margin-top: 6px; font-size: 11px; color: var(--grey); text-align: center; white-space: nowrap; }
.dsrow { border-bottom: 1px solid var(--grey-3); padding: 14px 22px 10px; }
.dsrow .top { display: flex; align-items: flex-end; gap: 12px; }
.dsrow .top a { font-weight: 600; color: var(--ink); text-decoration: none; }
.dsrow .top a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dsrow .top small { display: block; color: var(--grey); font-size: 12px; }
.dsrow .top .mn { flex: 1; min-width: 0; }
.dsrow .top .num { font-weight: 600; width: 84px; text-align: right; }
.dsrow .top .num.credits { width: 120px; }
.dshead span.num:nth-child(2) { width: 120px; }
.dsrow .top .llm { font-weight: 500; color: var(--ink-2); }
.dshead { display: flex; gap: 12px; padding: 8px 22px; font-size: 11.5px; font-weight: 600; color: var(--grey); border-bottom: 1px solid var(--grey-3); }
.dshead span:first-child { flex: 1; }
.dshead .num { width: 84px; text-align: right; }
.costfilter { padding: 10px 22px; border-bottom: 1px solid var(--grey-3); }
.costfilter input { width: 100%; }
.costlist.scroll { max-height: 640px; overflow-y: auto; }
.opline { display: grid; grid-template-columns: minmax(0, 1fr) 64px 120px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.opline .num { white-space: nowrap; }
.opline .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opline .nm small { color: var(--grey); font-size: 12px; }
.opline .num { text-align: right; }
.totalrow { display: flex; gap: 12px; padding: 13px 22px; font-weight: 600; }
.totalrow > span:first-child { flex: 1; }
.totalrow .num { width: 84px; text-align: right; }
.totalrow small { color: var(--grey); font-weight: 500; }
.moreline { padding: 11px 22px; border-bottom: 1px solid var(--grey-3); }
.empty-p { padding: 22px; color: var(--grey); margin: 0; }
/* Usage's tabs (Credits, Storage): the Settings tab row, as hash links (role tab). */
.tabrow a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
/* Usage, Storage (costs/_storage): the figures, the search box and sort, then the searches, their header in view. */
.store-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 22px; }
.store-tools input[type="search"] { flex: 1 1 240px; min-width: 0; border: var(--b); border-radius: 10px; padding: 7px 12px; background: var(--paper); }
.store-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.store-table th { position: sticky; top: 0; z-index: 1; background: var(--paper); text-align: left; font-size: 11.5px; font-weight: 600; color: var(--grey);
  padding: 8px 22px 8px 0; border-block: 1px solid var(--grey-3); }
.store-table td { padding: 12px 22px 12px 0; border-bottom: 1px solid var(--grey-3); vertical-align: baseline; }
.store-table :is(th, td):first-child { padding-left: 22px; }
.store-table .num { width: 96px; text-align: right; white-space: nowrap; }
.store-table .num:last-child { width: 112px; }
.store-table .nm a { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.store-table .nm a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) {
  .store-tools { padding: 12px 16px; }
  .store-tools input[type="search"] { min-height: 40px; }
  .store-table, .store-table thead, .store-table tbody { display: block; }
  .store-table thead { position: sticky; top: 0; z-index: 1; background: var(--paper); }
  .store-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; padding-inline: 16px; }
  .store-table tbody tr { border-bottom: 1px solid var(--grey-3); padding-block: 10px; }
  .store-table th { position: static; padding: 8px 0; border: 0; }
  .store-table th:first-child { display: none; }
  .store-table td { padding: 0; border: 0; }
  .store-table td.nm { grid-column: 1 / -1; padding-bottom: 4px; }
  .store-table :is(th, td):first-child { padding-left: 0; }
  .store-table .num, .store-table .num:last-child { width: auto; text-align: left; }
  .store-table thead tr { border-block: 1px solid var(--grey-3); }
}
.legend { display: flex; flex-direction: column; gap: 11px; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.legend .num { margin-left: auto; }
.legend .pct { width: 36px; text-align: right; color: var(--grey); font-size: 12px; }
.sw { width: 10px; height: 10px; border: 1px solid var(--ink); border-radius: 2px; flex: none; }
/* Provider shares: soft neutrals, lightest first, never a solid ink block. */
.pc0 { background: var(--grey-2); }
.pc1 { background: var(--grey); }
.pc2 { background: var(--ink-2); }
.pc3 { background: var(--grey-3); }
.pc4 { background: var(--paper); }
.pstack { display: flex; height: 10px; border: 1px solid var(--grey-2); border-radius: 999px; overflow: hidden; margin-bottom: 16px; background: var(--grey-3); }
.pstack > i { display: block; height: 100%; }
.pstack > i + i { border-left: 2px solid var(--paper); }
.llmline { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--grey-2); }
.note-p { margin: 0; padding: 14px 22px; border-top: 1px solid var(--grey-3); color: var(--ink-2); font-size: 12.5px; }
.filter-mw .menu { width: 288px; }
.filter-mw .fsearch { display: block; width: 100%; border: 1px solid var(--grey-2); border-radius: 10px; padding: 7px 10px; font-size: 13px; background: var(--paper); margin-bottom: 6px; }
.filter-mw .fopts { max-height: 280px; overflow-y: auto; }
.filter-mw .menu a.on { text-decoration: underline; text-underline-offset: 4px; }
.filter-mw .menu a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btnlink { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.bigno { font-size: 56px; line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.balrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.balrow .hint { margin-left: auto; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stk { display: flex; flex-direction: column; gap: 14px; }
.stk p { margin: 0; }
.tabrow { display: flex; gap: 20px; border-bottom: var(--b); flex-wrap: wrap; }
.tabrow a { padding: 6px 0 9px; font-size: 13.5px; font-weight: 600; color: var(--grey); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.tabrow a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.fv { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 0; }
.sform.wide { max-width: 680px; gap: 16px; }
.sform h3, .stk h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sform .sub { margin: 0; font-size: 13px; font-weight: 700; }
.rule { border: 0; border-top: 1px solid var(--grey-3); margin: 2px 0; }
.chiprow { display: flex; gap: 6px; }
.chipr { position: relative; display: inline-flex; }
.chipr input { position: absolute; opacity: 0; pointer-events: none; }
.chipr label { cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--paper); color: var(--ink-2); }
.chipr label:hover { border-color: var(--ink); }
.chipr input:checked + label { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chipr input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.llmside { display: flex; flex-direction: column; gap: 16px; }
.llmcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: none; }
.llmcard[hidden] { display: none; }
.money { display: flex; align-items: center; gap: 10px; }
.money input { width: 130px; border: 1px solid var(--grey-2); border-radius: 10px; padding: 8px 12px; background: var(--paper); }
.ptable { display: grid; grid-template-columns: minmax(190px, 1.7fr) minmax(110px, 1fr) 90px 120px; gap: 14px; align-items: center; }
.ptable.head { padding: 10px 2px; border-bottom: var(--b); color: var(--grey); font-size: 12px; font-weight: 600; }
.ptable.row { padding: 14px 2px; border-bottom: 1px solid var(--grey-3); }
.ptable .who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ptable .who b { font-weight: 600; }
.ptable .who small { display: block; color: var(--grey); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptable .end { display: flex; justify-content: flex-end; }
.logo-sq { width: 30px; height: 30px; border: var(--b); border-radius: 8px; display: grid; place-items: center; font-weight: 700; flex: none; background: var(--paper); }
.logo-sq.on { background: var(--ink); color: var(--paper); }
.evgrid { display: grid; grid-template-columns: 1fr 80px 80px 80px; gap: 12px; padding: 12px 22px; align-items: center; border-bottom: 1px solid var(--grey-3); }
.evgrid.head { color: var(--grey); font-size: 12px; font-weight: 600; border-bottom: var(--b); }
.evgrid .c { display: flex; justify-content: center; }
.evgrid:last-child { border-bottom: 0; }
.evgrid input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
.evgrid.two { grid-template-columns: 1fr 80px 80px; }
.evgrid.one { grid-template-columns: 1fr 140px; }
/* Settings, Email delivery */
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow .field.grow { flex: 1 1 200px; }
.frow .field.port { flex: 0 0 90px; }
.frow .field.enc { flex: 0 0 130px; }
.passrep summary { display: flex; align-items: center; gap: 10px; min-height: 34px; cursor: pointer; list-style: none; }
.passrep summary::-webkit-details-marker { display: none; }
.passrep[open] summary .textbtn { display: none; }
.passrep summary .textbtn { text-decoration: underline; text-underline-offset: 3px; }
.modal-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(24,24,27,.14); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-wrap[hidden] { display: none; }
.modal { width: 100%; max-width: 480px; padding: 24px; }
.modal.wide { max-width: 580px; }
.modal .mh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.modal .mh h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.modal .mh .x { margin-left: auto; background: none; border: 0; font-size: 14px; color: var(--grey); }
.pickrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border: 1px solid var(--grey-2); border-radius: 12px; background: var(--paper); }
.pickrow:hover { border-color: var(--ink); }
.pickrow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pickrow .t small { color: var(--ink-2); font-size: 12px; }
.pickrow .go { font-weight: 600; font-size: 13px; }
.epgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.epgrid > div { border: 1px solid var(--grey-2); border-radius: 12px; padding: 11px 13px; }
.epgrid b { font-weight: 600; }
.epgrid small { display: block; color: var(--grey); font-size: 12px; margin-top: 4px; }
.sj-routing { display: flex; flex-direction: column; gap: 14px; }
.rt-ep { border: 1px solid var(--grey-2); border-radius: 14px; padding: 13px 15px; }
.rt-ep .rh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.rt-ep .rh b { font-weight: 600; }
.rt-ep .rh small { color: var(--grey); font-size: 12px; }
.rt-ep .rh .hint { margin-left: auto; font-size: 12px; }
.sj-rt-list { display: flex; flex-direction: column; gap: 4px; }
.sj-rt-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--grey-3); border-radius: 10px; background: var(--hdr); }
.sj-rt-row.on { border-color: var(--grey-2); background: var(--paper); }
.sj-rt-row label { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; cursor: pointer; }
.sj-rt-row input { accent-color: var(--ink); }
.sj-rt-row .nm { font-weight: 600; }
.sj-rt-row .sj-rt-primary { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sj-rt-row .sj-rt-primary[hidden] { display: none; }
.sj-rt-row .mv { display: flex; gap: 3px; flex: none; }
.sj-rt-row .mv button { width: 24px; height: 24px; border: 1px solid var(--grey-2); background: var(--paper); border-radius: 6px; font-size: 11px; line-height: 1; color: var(--ink-2); }
.sj-rt-row .mv button:hover { border-color: var(--ink); }
.saas { border: 1.5px dashed var(--ink); border-radius: var(--r); padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.saas .tg { align-self: flex-start; }
.saas h3 { margin: 0; font-size: 18px; font-weight: 600; }
.saas p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) {
  .split, .split.wide { grid-template-columns: 1fr; }
  .phead :is(h1, h2) { font-size: 32px; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--grey-3); }
  .ptable { grid-template-columns: minmax(0, 1fr) auto; }
  .ptable.head, .ptable .keycol { display: none; }
  .ptable.row > .who { grid-column: 1 / -1; }
  .epgrid { grid-template-columns: 1fr; }
  .evgrid { grid-template-columns: 1fr 56px 56px 56px; padding: 12px 14px; }
}
.field .sj-combo__field { padding-right: 30px; }
.actions.end { justify-content: flex-end; }
.actions.pt { padding-top: 14px; }
.mn { min-width: 0; }
.ph.tight { margin-bottom: 8px; }
.hint.mb { margin-bottom: 16px; }
.hint.nomg { margin: 0; }
.stk.tight { gap: 8px; }
.chk.strong { font-weight: 700; }
.sect { border-top: 1px solid var(--grey-3); }
.split.flat { gap: 0; }
.divr { border-right: 1px solid var(--grey-3); }
.ph.bandh { padding: 16px 22px 12px; margin: 0; border-bottom: 1px solid var(--grey-3); }
@media (max-width: 760px) { .divr { border-right: 0; } }

/* Task 12: shell dialogs, onboarding, the column-visibility menu, the bottom dock, mobile. */
.navmw, .colsmw { display: none; }
.menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.colsmenu button[aria-pressed]::after { content: "Hidden"; color: var(--grey); font-weight: 500; font-size: 12px; }
.colsmenu button[aria-pressed="true"]::after { content: "Shown"; color: var(--ink-2); }
.grid col.src { width: 120px; }
.grid col.nsrc { width: 104px; }
.grid td.nsrc { font-family: var(--font); font-size: 11px; text-align: right; color: var(--ink-2); }
.grid td.gained { animation: fill 2.4s ease-out; }
.grid col.actc { width: 74px; }
.confirm-wrap { z-index: 1000; }
.confirm h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.confirm p { margin: 0 0 20px; color: var(--ink-2); }
.onboard-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 max(28px, env(safe-area-inset-left, 0px)); padding: 8px 10px 8px 16px; border: var(--b); border-radius: 14px; background: var(--paper); font-size: 13px; }
.onboard-bar a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.onboard-bar .btn { margin-left: auto; }
#sj-onboard-modal { z-index: 800; }
.modal.onboard { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.onboard h3 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.onboard p { margin: 0; color: var(--ink-2); }
.onboard-note { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--grey-2); border-radius: 12px; background: var(--hdr); padding: 11px 14px; font-size: 12.5px; color: var(--ink-2); }
.onboard-note > b { color: var(--ink); }
.onboard-cta { justify-content: center; }
.onboard .onboard-or { display: flex; align-items: center; gap: 12px; color: var(--grey); font-size: 12px; }
.onboard-or::before, .onboard-or::after { content: ""; flex: 1; height: 1px; background: var(--grey-2); }
.onboard-key { display: flex; gap: 10px; margin: 0; }
.onboard-key input { flex: 1; min-width: 0; border: 1px solid var(--grey-2); border-radius: 10px; padding: 9px 12px; background: var(--paper); }

@media (max-width: 820px) {
  .c-body, .split, .split.wide { grid-template-columns: 1fr; }
  /* Home: the headline in two lines, left-aligned with the lede over a full-width box; the
     examples one row of chips that scrolls sideways to the page's edges (the page never does). */
  .hero { padding-top: 8px; align-items: stretch; text-align: left; }
  .home .hero h1 { font-size: min(39px, calc((100vw - 64px) / 8.5)); }   /* "Describe the data." keeps one line on the narrowest phones */
  .hero .lede { margin: 16px 0 0; font-size: 18px; line-height: 1.5; text-wrap: pretty; }
  .hgrid { margin-top: 24px; align-items: stretch; }
  .composer { padding: 16px 16px 14px; }
  .composer textarea { font-size: 21px; min-height: 84px; }
  .home .illo { display: none; }
  .stack { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; scroll-padding: 0 16px; }
  .stack::-webkit-scrollbar { display: none; }
  .idea { flex: none; padding: 5px 5px 5px 13px; }
  .home .idea .circ { width: 30px; height: 30px; min-height: 0; }
  .shead :is(h1, h2), .phead :is(h1, h2) { font-size: 32px; }
  .illo { max-width: 200px; }
  .home, .live { padding-left: 16px; padding-right: 16px; }
  .top { gap: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .onboard-bar { margin: 0 16px; }
  .logo .by-uj { margin-left: 2px; }
  .wb-tb > .wb-state { flex: 1 1 100%; }   /* the status line on its own row: the buttons below never move */
  .wb-tb > .grow { display: none; }
  .toast { right: 16px; }
  .nav, .hide-sm { display: none !important; }
  .navmw, .colsmw { display: inline-flex; }
  .navbtn { display: grid; }
  .qbar :is(h1, h2) { font-size: 21px; line-height: 1.2; flex-basis: 100%; }

  /* The grid scrolls sideways with the row numbers pinned; no column is hidden for room. */
  .live .gridbox { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .grid col.actc { width: 96px; }
  .grid .ra { position: static; opacity: 1; pointer-events: auto; }
  .wb.selecting .grid td.rh { cursor: pointer; }
  .grid td.rh .pick { width: 24px; height: 24px; }
  /* Select in the sheet's corner: a 40px target, the letters' row its height. */
  .grid { --letters-h: 41px; }
  .selmode { width: 40px; height: 40px; border-radius: 8px; }
  .selmode svg { width: 20px; height: 20px; }
  /* A row's ✎ beside its marks; a row waiting for a check has three of them. */
  .ra button.rnote svg { width: 16px; height: 16px; }
  /* The plan card's first look: room on each row for its 40px actions. */
  .plancard .pc-look-rows tr { --pcs-acts: 84px; min-height: 52px; }
  .plancard .pc-look-rows tr:has(.ra > :nth-child(3)) { --pcs-acts: 128px; }
  #workbook[data-view="check"]:not([data-view-now]) .grid col.actc, #workbook[data-view-now="check"] .grid col.actc { width: 140px; }

  .menu { max-width: calc(100vw - 32px); }
  /* Toolbar menus (Columns) open under the toolbar, full width, not off-screen. */
  .wb-tb .mw { position: static; }
  .wb-tb .mw > .menu { left: 12px; right: 12px; width: auto; max-width: none; top: calc(100% - 4px); }

  /* Touch targets: at least 40px. */
  .btn, .btn.sm, .outline, .textbtn, .tabs button, .tabrow a, .chipr label { min-height: 40px; }
  .circ, .circ.sm, .btn.ic, .ra button, .chip-x, .sj-rt-row .mv button { width: 40px; height: 40px; min-height: 40px; }
  .why-c, .fxb { min-height: 40px; }
  .msg.act { --msg-ctl: 40px; }   /* a message's controls keep the 40px touch target; the icon rule makes room */
  /* The bell's panel sits under the top bar across the screen: anchored to the bell it ran off the left edge. */
  .bell .menu.wide { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; max-height: min(70vh, 520px); }
  .bell .menu .nhead .textbtn { min-height: 40px; }   /* Mark all as read: a touch target too */
  .top .navmw .menu, .top .acct .menu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }   /* the menus open as panels under the bar, never off its edge */
  .top .newsearch { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; border-radius: 50%; }   /* New search: its mark, named for screen readers */
  .top .newsearch .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top .tr .running { height: 40px; min-width: 40px; padding: 0 12px; justify-content: center; }   /* the dot and the count, the words for screen readers */
  .top .tr .running .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .view .phead > .filter-mw { flex: 1 1 100%; margin-left: 0; }   /* Usage's search picker: full width under the title */
  .view .phead > .filter-mw > .btn { width: 100%; min-height: 40px; justify-content: space-between; }
  .view .phead > .filter-mw .menu { left: 0; right: 0; width: auto; max-width: none; }
  .sstatus a { min-height: 40px; }
  .chip-x { margin: -10px -6px -10px 0; }
  .seg button, .seg label { min-height: 40px; }
  .seg { padding: 2px; }
  .srow { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .menu a, .menu button, .menu .chk, .rlist a, .srow { min-height: 40px; align-items: center; }
  .grid .hd { min-height: 40px; }
  .field input, .field select, .tags-box, .sfilter input, .money input { min-height: 40px; }
  /* Home's limits: each a 40px target on one line. */
  .limit { display: inline-flex; align-items: center; gap: .3em; min-height: 40px; padding: 0 9px; white-space: nowrap; }
}

.sj-knowledge { padding: 16px 18px; margin-top: 10px; }   /* .gpage's 22px gap + 10px = 32px below the form stack */
.sj-knowledge h3 { margin: 0 0 4px; }
.sj-knowledge > .hint { margin: 0 0 12px; }
.sj-knowledge .msg, .sj-knowledge form { margin-top: 12px; }

/* Cut reason: a small field under the row's actions, and the reason in the cell bar. */
.grid td.act { position: relative; }
.why-box { position: absolute; color: var(--ink); right: 6px; top: calc(100% - 2px); z-index: 5; width: 300px; max-width: calc(100vw - 24px); background: var(--paper); border: var(--b); border-radius: 12px; box-shadow: var(--lip-s); padding: 8px; text-align: left; white-space: normal; }
.why-h { margin: 0 2px 6px; color: var(--grey); font-size: 12px; font-weight: 600; }
.why-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.why-c { border: 1px solid var(--grey-2); border-radius: 999px; background: var(--hdr); padding: 3px 10px; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.why-c:hover { border-color: var(--ink); }
.why-c[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.why-in { display: block; width: 100%; margin-top: 8px; border: 0; border-top: 1px solid var(--grid); background: transparent; font: inherit; font-size: 12.5px; padding: 6px 4px 2px; }
.why-in:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* The reason picker hangs below its row (above it near the bottom of the grid): its cell lets it out. */
.grid tr.why-open td.act { overflow: visible; }
.why-box.up { top: auto; bottom: calc(100% - 2px); }
/* A cell the user marked wrong (cell bar: Mark wrong), in the cut palette. */
.grid td.mk { background: var(--st-stop-bg); color: var(--st-stop); text-decoration: line-through; }
.menu [data-move-list] button { padding-left: 22px; font-weight: 500; }
.fxmark { flex: none; display: flex; }
.fxb { border: 0; border-left: 1px solid var(--grid); background: none; padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fxb:hover, .fxb[aria-expanded="true"] { color: var(--ink); background: var(--hdr); }
.fxb[hidden] { display: none; }
.fx .mw > .menu { top: calc(100% + 4px); }
.menu button[aria-pressed="true"] { background: var(--page); box-shadow: inset 3px 0 0 var(--st-stop); }
.menu button[hidden] { display: none; }
.fx .why { padding: 5px 10px; border-left: 1px solid var(--grid); color: var(--ink-2); max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx .why[hidden] { display: none; }
/* Cut selected's reason picker hangs under the bulk bar at its right edge (above it when the table has no room below). */
.wb-tb .bulk { position: relative; }
.wb-tb .bulk > .why-box { right: 0; top: calc(100% + 6px); }
.wb-tb .bulk > .why-box.up { top: auto; bottom: calc(100% + 6px); }
/* A row's note box (its ✎, workbook.js): the reason picker's, its heading a label, a refusal said under the field. */
.note-box .why-h { display: flex; align-items: center; gap: 6px; }
.note-box.is-busy .why-in { color: var(--ink-2); }
.note-msg:empty { display: none; }
.note-msg { display: block; margin: 6px 2px 0; font-size: 12.5px; }
/* A bulk mark with no row picked: off, as a disabled button looks, yet it keeps the focus (aria-disabled: workbook.js). */
.wb-tb .bulk .btn[aria-disabled="true"]:not(.is-busy) { opacity: .35; cursor: not-allowed; transform: none; }
.rowlist > div.note { color: var(--ink-2); font-style: italic; }
.rowlist > div.err > span[dir] { color: var(--red); }
/* "What happened": the latest lines show; the earlier ones open from "Show all". */
.morelines > summary { cursor: pointer; padding: 8px 0; font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.morelines[open] > summary { color: var(--grey); }

/* Row metadata (rows, credits, time) sits on the status line, not centred on the whole row. */
.srow .num, .rlist a .num, .rlist button .num { align-self: flex-end; line-height: 19px; }
.srow .num { align-self: end; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); margin-left: 6px; vertical-align: middle; }
/* Notes waiting for the next run, on the Steer button. */
.nbadge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 6px; padding: 0 4px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 600; line-height: 1; }
/* "Your notes" above the composer in Details: each note as written, with its status. */
.notes { display: flex; flex-direction: column; gap: 6px; }
.notes .hint { margin: 0; font-size: 12.5px; }
.notes-h { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; }
.notes-l { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.notes-l li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 6px 10px; border-radius: 10px; background: var(--hdr); border: 1px solid var(--grey-3); font-size: 13px; min-width: 0; }
.notes-l .nt { min-width: 0; overflow-wrap: anywhere; }
.notes-l .ns { flex: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.notes-l li.waiting .ns { color: var(--ink); font-weight: 600; }
@media (max-width: 480px) { .notes-l li { flex-direction: column; gap: 2px; } .notes-l .ns { white-space: normal; } }
/* The run on screen, before the state pill: "Run 3 Running". */
.runno { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.wb-state .runno { margin-right: -6px; }

/* ---- Messages: one component for what the server says, four levels ----
   <p class="msg err" role="alert">…</p>   something failed; says what and how to fix it (red)
   <p class="msg warn" role="alert">…</p>  it worked, with a catch the user should know (amber)
   <p class="msg info" role="status">…</p> neutral news about this screen (blue)
   <p class="msg ok" role="status">…</p>   it worked (green)
   The icon is drawn by CSS, so the markup is the class and the text. Modifiers: .bare (no box:
   inside a strip, a menu or the cell bar), .field (a field's own error, under the field), and a
   trailing <button class="msg-x" aria-label="Dismiss"> makes it dismissible (sj.js).
   Help text stays .hint: grey, no icon, never used for anything the server reports. */
/* One rule for every message's icon: it sits on the FIRST line of text, centred on that line
   (top = the box's top padding + half of what the line is taller than the icon), with the same
   gap to the text everywhere, whether the message is one line or wraps, and whatever action sits
   in it. Each variant only sets its padding (--msg-pt), its icon size (--msg-is) and where the
   icon starts (--msg-il); the text starts --msg-gap after the icon. */
.msg { --msg-lh: 1.45; --msg-is: 16px; --msg-pt: 9px; --msg-il: 12px; --msg-gap: 8px;
  position: relative; display: block; margin: 0; padding: var(--msg-pt) 14px var(--msg-pt) calc(var(--msg-il) + var(--msg-is) + var(--msg-gap));
  border: 1.5px solid currentColor; border-radius: 10px; font-size: 13px; font-weight: 500; line-height: var(--msg-lh); color: var(--msg-c); background: var(--msg-bg); overflow-wrap: anywhere; }
.msg::before { content: ""; position: absolute; left: var(--msg-il); top: calc(var(--msg-pt) + (var(--msg-lh) * 1em - var(--msg-is)) / 2);
  width: var(--msg-is); height: var(--msg-is); background: currentColor; -webkit-mask: var(--msg-i) center / contain no-repeat; mask: var(--msg-i) center / contain no-repeat; }
.msg b, .msg strong { font-weight: 700; }
.msg a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.msg.err { --msg-c: var(--red); --msg-bg: var(--red-soft); --msg-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M5.9 5.9l4.2 4.2M10.1 5.9l-4.2 4.2'/%3E%3C/svg%3E"); }
.msg.warn { --msg-c: var(--warn); --msg-bg: var(--warn-bg); --msg-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M8 1.9 14.7 13.6H1.3Z' stroke-linejoin='round'/%3E%3Cpath d='M8 6.2v3.5'/%3E%3Cpath d='M8 11.7v.1' stroke-width='2'/%3E%3C/svg%3E"); }
.msg.info { --msg-c: var(--st-run); --msg-bg: var(--st-run-bg); --msg-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 7.3v3.9'/%3E%3Cpath d='M8 4.9v.1' stroke-width='2'/%3E%3C/svg%3E"); }
.msg.ok { --msg-c: var(--st-done); --msg-bg: var(--st-done-bg); --msg-i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M5.3 8.2 7.2 10.1 10.8 6.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.msg.bare, .msg.field { --msg-pt: 0px; --msg-il: 0px; --msg-gap: 6px; border: 0; background: none; padding-right: 0; }
.msg.field { --msg-is: 14px; margin: -2px 0 0; font-size: 12.5px; font-weight: 600; }
span.msg.bare, span.msg.field { display: inline-block; }
.msg:has(> .msg-x) { padding-right: 40px; }
.msg-x { position: absolute; right: 6px; top: max(4px, calc(var(--msg-pt) + (var(--msg-lh) * 1em - 26px) / 2)); width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: inherit; padding: 0; font-size: 13px; line-height: 1; }
.msg-x:hover { background: rgba(24,24,27,.06); }
.msg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A message with its action (Undo, OK, Top up): the text from the top, as in any message, so the
   icon stays on its first line; each control is centred on that first line by a negative margin
   (it has a fixed height, --msg-ctl), and the box's padding grows to hold it. Wrapped actions keep
   a row gap. */
.msg.act { --msg-ctl: 30px; --msg-pt: max(9px, calc((var(--msg-ctl) - var(--msg-lh) * 1em) / 2 + 4px));
  display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 10px; row-gap: max(8px, calc(var(--msg-ctl) - var(--msg-lh) * 1em + 6px)); }
.msg.act > :not(.btn):not(form):not(.acts) { flex: 1 1 22em; min-width: 0; }   /* narrow screens: the actions go under the text */
.msg.act > :is(.btn, form, .acts) { margin-block: calc((var(--msg-lh) * 1em - var(--msg-ctl)) / 2); }
.msg.act .acts { display: inline-flex; gap: 8px; flex: none; }
.msg.act .btn { height: var(--msg-ctl); min-height: 0; padding-block: 0; display: inline-flex; align-items: center; border-color: currentColor; color: inherit; }
/* The planner's adjustment note: its head shows, the list of changes opens on demand. */
.adj-note { flex: 1; min-width: 0; }
.adj-note > summary { cursor: pointer; list-style: none; }
.adj-note > summary::-webkit-details-marker { display: none; }
.adj-note .adj-more { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.adj-note[open] .adj-more { display: none; }
.adj-note > p { margin: 6px 0 0; overflow-wrap: anywhere; }
.msg details > summary { cursor: pointer; }
.msg details ul { margin: 6px 0 0; padding-left: 18px; }
.msg small { font-weight: 500; opacity: .85; }
/* Page-level messages sit under the heading, one stack, same gap as the page. */
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msgs:empty, .msgs:not(:has(> :not([hidden]))) { display: none; }
/* Toasts are page-level messages too: same levels and icons, raised with the lip. */
.toast { position: fixed; right: 24px; bottom: calc(24px + var(--dock-h, 0px)); z-index: 1100; width: max-content; max-width: min(380px, calc(100vw - 32px)); box-shadow: var(--lip-s); font-size: 13.5px; font-weight: 600; animation: up .2s ease-out; }
.toast.msg { border-width: 1.5px; }
/* The cell bar: a value's warning in amber, a refused mark in red; Why and Marked stay grey. */
.fx .msg.bare { --msg-pt: 5px; --msg-il: 10px; flex: 0 1 auto; padding-right: 10px; border-left: 1px solid var(--grid); max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0; }
.fx .msg.bare[hidden] { display: none; }

/* ---- Busy states (sj.js sjBusy): a control that called the server shows it is working ----
   The control is disabled (no double submit) and shows a spinner, plus its data-busy label
   ("Saving…") when it has one, until the server answers. A region being replaced gets
   aria-busy="true" and dims. Under reduced motion the spinner is a still ring. */
.spin { display: inline-block; flex: none; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-busy { cursor: progress; }
.is-busy > .spin + * { margin-left: 0; }
button.is-busy:not(.btn) > .spin, a.is-busy:not(.btn) > .spin { margin-right: 6px; }
/* Icon-only controls (round buttons, the row's keep and cut): the spinner takes the glyph's place. */
.is-busy.busy-over { position: relative; color: transparent !important; }
.is-busy.busy-over > .spin { position: absolute; left: 50%; top: 50%; margin: -6.5px 0 0 -6.5px; border-color: var(--ink); border-right-color: transparent; }
.btn:not(.ghost).is-busy.busy-over > .spin { border-color: var(--paper); border-right-color: transparent; }
a.is-busy { pointer-events: none; }
[aria-busy="true"]:not(button):not(a) { cursor: progress; }
#details-pane[aria-busy="true"] > *, #sj-settings-form[aria-busy="true"], #sj-knowledge[aria-busy="true"] > :not(form), #wb-head[aria-busy="true"] { opacity: .55; transition: opacity .15s .1s; }
.pane-loading { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
/* The live stream's connection, next to the last update time. */
.live-conn { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.live-conn[hidden] { display: none; }
.live-conn.lost { color: var(--warn); font-weight: 600; }
.live-conn .spin { width: 10px; height: 10px; border-width: 1.5px; }
@media (prefers-reduced-motion: reduce) {
  .spin { animation: none !important; }
}

/* Small screens: the top bar fits 360px (the "by ujeebu" tag sat on the wordmark and pushed Account off). */
@media (max-width: 420px) {
  .by-uj { display: none; }
}

/* Error pages (ErrorPages, ErrorShield): an unknown address, a search that isn't there, a refused page, a server error.
   One card, its own heading, one way back. The hosted theme re-points the tokens. */
body.errpage { min-height: 100vh; display: flex; flex-direction: column; margin: 0; }
.err-top { display: flex; align-items: center; gap: 28px; padding: 22px 28px; }
.err-main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 48px; }
.err-card { width: 100%; max-width: 460px; background: var(--paper); border: var(--b); border-radius: var(--r); box-shadow: var(--lip-s); padding: 30px 32px 26px; }
.err-card h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.err-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.err-card .err-code { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--grey); text-transform: none; }
.err-card .err-actions { margin: 20px 0 0; }
@media (max-width: 420px) { .err-top { padding: 18px 16px; } .err-card { padding: 24px 20px 20px; } }

/* The status line never moves the buttons: on its own row, one line, the progress text cut with an ellipsis
   (it changes every few seconds while a search runs; wrapping it shifted the whole button block). */
.wb-state { flex-wrap: nowrap; min-width: 0; }
.wb-state .state { min-width: 0; white-space: nowrap; }
.wb-state .state .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Round 6: the plan-ready card, the live status, the elapsed time beside Pause, "you can leave". */
.ready-card { margin: 0 0 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.ready-card[hidden] { display: none; }
.ready-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.ready-head .hint { margin: 2px 0 0; }
.ready-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13.5px; }
.ready-facts dt { color: var(--grey); font-weight: 600; }
.ready-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ready-facts dd small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.ready-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ready-acts form { flex: 1 1 18em; margin: 0; }
.ready-acts .btns { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.ready-acts .btns form { flex: none; }
@media (max-width: 520px) {
  .ready-card { padding: 16px; }
  .ready-facts { grid-template-columns: 1fr; gap: 2px; }
  .ready-facts dd { margin-bottom: 8px; }
  .ready-acts .btns { width: 100%; justify-content: stretch; }
  .ready-acts .btns > * { flex: 1 1 auto; justify-content: center; }
}
/* Beside Pause: fixed width with tabular figures, so the ticking never moves the buttons. */
.wb-ctl .elapsed { display: inline-block; min-width: 4.6ch; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wb-leave { margin: 6px 16px 0; font-size: 12.5px; }
.wb-leave[hidden] { display: none; }
.adj-setup { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grey-3); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.adj-setup .hint { margin: 0; }

/* Round 7: Apply this change (a change saved while a pass runs). One small dialog; a bottom sheet on a phone. */
.apply-wrap { z-index: 1000; }
.apply h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.apply #apply-sub { margin: 0 0 14px; }
.apply-opts { border: 0; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.apply-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--grey-2); border-radius: 12px; cursor: pointer; }
.apply-opt:has(input:checked) { border-color: var(--ink); background: var(--hdr); }
.apply-opt.danger:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.apply-opt input { margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.apply-opt.danger input { accent-color: var(--red); }
.apply-opt b { font-weight: 600; }
.apply-opt .dflt { margin-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--grey); }
.apply-opt .line { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 520px) {
  .apply-wrap { align-items: flex-end; padding: 0; }
  .modal.apply { max-width: none; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 92vh; overflow: auto; }
  .apply .actions .btn { flex: 1 1 0; justify-content: center; }
}

/* Round 7: Setup, summary first. Short groups of "label: value" lines, one Edit each: the form opens
   in place (a bottom sheet on a phone); a short nav on top; the danger zone apart at the end. */
.setup.s2 { gap: 18px; }
.snav { position: sticky; top: -14px; z-index: 3; margin: -14px -18px 0; padding: 10px 18px 0; background: var(--paper); border-bottom: 1px solid var(--grey-3); display: flex; gap: 16px; font-size: 13px; font-weight: 600; overflow-x: auto; scrollbar-width: none; }
.snav::-webkit-scrollbar { display: none; }
.snav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 2px 0 8px; border-bottom: 2px solid transparent; }
.snav a:hover { color: var(--ink); }
.snav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.ssec { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 56px; }   /* the sticky nav's height and a little: a jump never hides the heading */
.ssec-h:focus { outline: none; }
.snav-end { display: block; height: 1px; margin-top: -1px; }
/* The Details sheet never scrolls itself (a focus or a jump scrolled its hidden overflow and took the
   tab row and the section nav out of view): only its pane does. */
.sheet { overflow: clip; }
.ssec-h { margin: 0; font-size: 12px; font-weight: 600; color: var(--grey); }
.sgc { border: 1px solid var(--grey-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.sgc-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.sgc-head h4 { margin: 0; flex: 1; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.sum { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; line-height: 1.45; }
.sum dt { color: var(--grey); }
.sum dd { margin: 0; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.sum dd small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--grey); }
.sum .n { font-variant-numeric: tabular-nums; }
.sum dd.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sgc > .msg, .sgc > .hint, .sgc .dup-rule .hint, .dz-row .hint { margin: 0; }
.sgc.editing > .sum, .sgc.editing > .msg.ok, .sgc.editing > .sgc-head [data-sgc-edit] { display: none; }
.sgc-ftitle { display: none; }
.sgc-acts { margin-top: 2px; }
.dup-rule { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* Duplicates, opened by Review on the workbook's line (#wb-dupes): the pairs, their merge and Dismiss, then what was done. */
.dup-review { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--grey-3); padding-top: 10px; }
.dup-review .msg, .dup-review .hint { margin: 0; }
.danger-zone { border-color: var(--st-stop-bg); gap: 0; }
.dz-row { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 0; }
.dz-row:first-child { padding-top: 0; }
.dz-row:last-child { padding-bottom: 0; }
.dz-row + .dz-row { border-top: 1px solid var(--grey-3); }
.dz-row > p, .dz-row > span { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.btn.dz-del { color: var(--red); border-color: var(--red); }
@media (max-width: 640px) {
  .sgc.editing > .sum, .sgc.editing > .msg.ok, .sgc.editing > .sgc-head [data-sgc-edit] { display: revert; }
  .sgc.editing > .sum { display: grid; }
  .sgc.editing::before { content: ""; position: fixed; inset: 0; z-index: 39; background: rgba(24,24,27,.28); }
  .sgc.editing > .sgc-form { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-top: var(--b); border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(24,24,27,.18); }
  .sgc-ftitle { display: block; margin: 0 0 2px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
  .sgc-acts { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom, 0px)); margin: 4px -16px calc(-16px - env(safe-area-inset-bottom, 0px)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--grey-3); }
  .sgc-acts .btn { flex: 1 1 0; justify-content: center; }
}

/* Round 8: Stop beside Pause, a danger outline (red text and border on white, never filled: the page
   keeps one primary action). Its confirm says what it does. */
.btn.stop { color: var(--red); border-color: var(--red); background: var(--paper); }
.btn.stop:hover { background: var(--red-soft); }

/* Round 10: one page grid for the app. Every signed-in page sits in a centred column up to 1280 px,
   with the top bar's gutters (28 px, 16 on a phone); the workbook, a data grid, keeps the full width.
   Prose keeps a readable measure (the page leads, the settings' descriptions). */
.main { width: 100%; max-width: calc(1280px + 56px); margin-inline: auto; box-sizing: border-box; }
.main:has(> .view.live) { max-width: none; }
.gpage { max-width: none; }
@media (min-width: 821px) { .home { padding-left: 0; padding-right: 0; } }   /* the page grid gives the gutters (a phone keeps Home's own, its chips scroll to the edge) */
.recent-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.recent-h .textbtn { font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; }
.recent-h .textbtn:hover { color: var(--ink); }
/* The workbook's way back to the list, small above its title. */
.live .crumb { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 -6px; min-height: 28px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.live .crumb svg { width: 14px; height: 14px; }
.live .crumb:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
/* The account menu holds the app's places, the page you are on marked. */
.acct-menu { width: 260px; }
.acct-nav { display: flex; flex-direction: column; }
.acct-menu .acct-nav a[aria-current="page"] { text-decoration: none; font-weight: 600; background: var(--grey-3); }   /* the current page: bold on a soft fill, no side bar */
/* Settings: each section a row, its title and what it does on the left, its controls on the right. */
.setrow { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 16px 48px; align-items: start; padding: 4px 0 28px; border-bottom: 1px solid var(--grey-3); }
.setrow:last-child { border-bottom: 0; }
.setrow > .sdesc h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.setrow > .sdesc p { margin: 0; max-width: 60ch; }
.setrow > .sbody { display: flex; flex-direction: column; gap: 14px; min-width: 0; max-width: 760px; }
@media (max-width: 900px) { .setrow { grid-template-columns: 1fr; gap: 12px; } }
.sform.wide.setrow { max-width: none; }

/* Round 11. Usage's search picker sits at the right edge of the column, on the title's line where
   it fits, its menu opening right-aligned so it never runs off the screen (a phone: full width). */
.phead > .filter-mw { flex: none; min-width: 0; margin-left: auto; }   /* not .phead > div's 240 px column: the button itself at the edge */
.filter-mw .menu { right: 0; left: auto; max-width: calc(100vw - 32px); }
/* Under the Home box: how many searches can run at once and how many more can start now. */
.composer .slots { margin: -4px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.composer .slots.busy { color: var(--ink); }
.composer .plan-note { margin: -4px 2px 0; line-height: 1.45; color: var(--grey-ink); }   /* what planning spends, said before Start: quiet, still 4.5:1 */
.slots-busy { flex: 1 1 260px; min-width: 0; }
/* The top bar's "2 running": a pulsing dot in the run colour (never the accent), to the running searches. */
.top .running { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 11px; border-radius: 999px; background: var(--st-run-bg); color: var(--st-run); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top .running[hidden] { display: none; }
.top .running:hover { box-shadow: inset 0 0 0 1px var(--st-run); }
.top .running .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; animation: sj-run-pulse 2s ease-out infinite; }
@keyframes sj-run-pulse { 0% { box-shadow: 0 0 0 0 rgba(30, 79, 156, .45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(30, 79, 156, 0); } }
@media (prefers-reduced-motion: reduce) { .top .running .pulse { animation: none; } }
/* Searches: All or Running, as links (the top bar's count leads to Running). */
.sstatus a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.sstatus a:hover { color: var(--ink); }
.sstatus a[aria-current="page"] { background: var(--grey-3); color: var(--ink); }
.sstatus a .n { font-weight: 500; }

/* The plan-ready line above the grid: the plan waits; the card in Details holds its lines and Proceed. */
.ready-line { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ready-line .ready-head { flex: 1 1 22em; min-width: 0; }
.ready-line .ready-head h2 { font-size: 17px; }
.ready-line > .msg { flex: 1 1 100%; order: 3; }
.ready-line .btns { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* Details, Plan: the plan card (_plan_card.tpl.php). Short by default: one line a part, long lists folded,
   a line's editor opens on the line itself, Proceed held at the foot of the pane. */
.plancard { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pc-head h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.pc-head .hint { margin: 2px 0 0; }
.pc-sec { margin: 6px 0 0; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--grey); }
.pc-lines { margin: 0; display: flex; flex-direction: column; }
.pc-line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 2px 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; border-top: 1px solid var(--grey-3); }
.pc-line:first-child { border-top: 0; }
.pc-line dt { color: var(--grey); font-weight: 600; font-size: 12.5px; padding-top: 2px; }
.pc-line dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; overflow-wrap: anywhere; }
.pc-line .pc-v { flex: 1 1 auto; min-width: 0; }
/* The cost line's words: one run of text (its price bold inside it), so the line's gaps never split "about 3,217 credits". */
.pc-line .pc-price { flex: 1 1 auto; min-inline-size: 0; }
.pc-line .pc-v small { display: block; color: var(--ink-2); font-size: 12px; margin-top: 1px; }
[data-editable] .pc-line:not(.editing) .pc-v { cursor: pointer; }
.pc-line.changed { background: var(--hdr); box-shadow: inset 3px 0 0 var(--ink); }
.pc-tag { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink); text-transform: none; }
.pc-pen { flex: none; width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.pc-pen svg { width: 14px; height: 14px; }
.pc-pen:hover, .pc-pen[aria-expanded="true"] { background: var(--grey-3); color: var(--ink); }
.pc-ed { flex: 1 1 100%; min-width: 0; padding-top: 6px; }
.pc-ed[hidden] { display: none; }
.pc-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pc-form .field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-form .field > span { font-size: 12px; color: var(--ink-2); }
.pc-form input[type="text"], .pc-form input[type="number"] { width: 100%; min-width: 0; }
.pc-form .unit { display: flex; align-items: center; gap: 6px; }
.pc-form .unit input { max-width: 9em; }
.pc-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-add { flex-direction: row; flex-wrap: wrap; align-items: center; }
.pc-add input[type="text"] { flex: 1 1 12em; width: auto; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1 1 100%; }
.pchip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-width: 0; border: 1px solid var(--grey-2); border-radius: 999px; padding: 1px 4px 1px 10px; font-size: 12.5px; background: var(--hdr); }
.pchip > span:first-child, .pchip > s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.skipped { color: var(--ink-2); background: transparent; border-style: dashed; }
.pchip form { display: inline-flex; margin: 0; }
.pc-move { display: inline-flex; }
.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1 1 100%; min-width: 0; }
.pc-list li { display: flex; align-items: center; gap: 4px; justify-content: space-between; min-width: 0; }
.pc-list li > span { min-width: 0; overflow-wrap: anywhere; }
.pc-list li form { display: inline-flex; margin: 0; flex: none; }
.pc-more { flex: 1 1 100%; min-width: 0; }
.pc-more > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink); width: max-content; padding: 2px 0; }
.pc-more[open] > summary { margin-bottom: 4px; }
/* The plan card's sources (PlanSources): each line its tool's name (or its site's) beside its words, place and language; a
   line with a reason opens on it (a disclosure), its cross after it. */
.pc-list li.pc-src { align-items: flex-start; }
.pc-list li.pc-src:has(.pc-src-n.sr-only) { padding-inline-start: 14px; }   /* under the name of the line above: same tool */
.pc-src > .pc-src-l, .pc-src > .pc-src-why { flex: 1 1 auto; min-width: 0; }
.pc-src-l, .pc-src-why > summary { display: block; padding: 2px 0; overflow-wrap: anywhere; }
.pc-src-why > summary { cursor: pointer; list-style: none; border-radius: 6px; }
.pc-src-why > summary::-webkit-details-marker { display: none; }
.pc-src-why > summary:hover .pc-src-n { text-decoration: underline; text-underline-offset: 2px; }
.pc-src-why > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The name stays whole (a long address after it breaks instead); a site's name longer than the line is cut with an ellipsis. */
.pc-src-n { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font-weight: 600; margin-inline-end: 6px; }
.pc-src-via, .pc-src-m { color: var(--ink-2); }
.pc-src-chev { width: 11px; height: 11px; margin-inline-start: 5px; vertical-align: -1px; color: var(--grey); transition: transform .15s; }
.pc-src-why[open] .pc-src-chev { transform: rotate(90deg); }
.pc-src-why > p { margin: 2px 0 6px; padding: 6px 10px; font-size: 12.5px; color: var(--ink-2); background: var(--hdr); border-radius: 8px; overflow-wrap: anywhere; }
.pc-q { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: var(--b); border-radius: 14px; background: var(--paper); }
.pc-q p { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.pc-qmark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 12px; }
.pc-q-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-q-other { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.pc-q-other label { font-size: 12.5px; color: var(--ink-2); flex: 1 1 100%; }
.pc-q-other input { flex: 1 1 12em; min-width: 0; }
.pc-planning { display: flex; align-items: center; gap: 8px; }
/* Proceed and the prompt line stay at the foot of the pane, the card scrolling above them. */
.pc-sticky { position: sticky; bottom: -14px; z-index: 2; background: var(--paper); margin: 0 -18px -14px; padding: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.pc-go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 10px; border-top: 1px solid var(--grey-3); }
.pc-go form { flex: 1 1 100%; margin: 0; font-size: 12.5px; }
.pc-go .btns { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 14px; margin-left: auto; }
.pc-go .btns form { flex: 0 0 auto; }   /* a button's own form (Look first, Skip the look) sits in the row, never on a line of its own */
.pc-adv { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; }
.pc-why { margin: 0; flex: 1 1 100%; text-align: right; }
.pc-prompt { display: flex; gap: 6px; align-items: center; }
.pc-prompt input { flex: 1 1 auto; min-width: 0; border-radius: 999px; padding-left: 14px; }
.pc-foot { margin: 4px 0 0; }
.pc-adj { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--grey-2); border-radius: 14px; background: var(--hdr); }
.pc-adj h4 { margin: 0; font-size: 14px; font-weight: 600; }
.pc-adj .hint { margin: 0; }
.pc-adj .pc-list li { display: list-item; list-style: disc; margin-left: 18px; }
.pc-adj form { align-self: flex-start; }
/* The questions together (several, or one about an assumption): each its options as choices and its own words, then one
   Continue. And the reading's choices on the card (Assumed, You chose): one line each, its pencil opening its options. */
.pc-qs { display: flex; flex-direction: column; gap: 14px; padding: 12px; border: var(--b); border-radius: 14px; background: var(--paper); min-width: 0; }
.pc-qq { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-qq + .pc-qq { padding-top: 14px; border-top: 1px solid var(--grey-3); }
.pc-qq > legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.pc-qq > legend + * { clear: both; }
.pc-opt { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--grey-2); border-radius: 10px; background: var(--paper); font-size: 13.5px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.pc-opt input { margin: 0; flex: none; accent-color: var(--ink); }
.pc-opt:has(input:checked) { border-color: var(--ink); background: var(--hdr); font-weight: 600; }
.pc-opt:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The time limit's line: its words wrap beside the pencil, which stays at the right of the first line. Its editor: the presets
   (one segmented row, each its own one-click form, the current one pressed), then a whole number and its unit. */
#pc-time > dd > .pc-v { flex: 1 1 0; }
.pc-time-presets { flex-wrap: wrap; max-width: 100%; margin-bottom: 8px; }
.pc-time-presets form { display: inline-flex; margin: 0; }
.pc-time-presets button { padding: 3px 8px; }
.pc-time-own :is(input[type="number"], select) { box-sizing: border-box; height: 36px; border: 1px solid var(--grey-2); border-radius: 10px; background: var(--paper); padding: 0 10px; font-size: 13px; }
.pc-time-own input[type="number"] { flex: 0 1 6em; width: 6em; text-align: right; }
.pc-time-own select { width: auto; padding-inline: 8px; }
.pc-qs .pc-q-err { margin: 0; font-size: 13px; }
.pc-qs-go { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pc-qs[data-sending] .pc-qq { opacity: .6; }
/* The reading's best guess, first among a question's options; the "Other" box, a choice of its own, for the person's words. */
.pc-best { flex: none; padding: 2px 7px; border: 1px solid var(--grey-2); border-radius: 999px; background: var(--paper); color: var(--ink-2);
  font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.pc-own { flex: 1 1 100%; cursor: text; }
.pc-own-k { flex: none; color: var(--ink-2); }
/* The box is its label's: the label is the touch target (a phone's 44px input rule is not this one's). */
.plancard .pc-own input[type="text"] { flex: 1 1 auto; min-width: 0; height: auto; min-height: 0; margin: 0; padding: 2px 0; border: 0; border-radius: 0; background: transparent;
  font: inherit; color: inherit; outline: none; box-shadow: none; }
.pc-own:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.pc-own:has(input:not(:placeholder-shown)) { border-color: var(--ink); background: var(--hdr); }
.pc-list li.pc-as { flex-wrap: wrap; align-items: baseline; }
.pc-as .pc-v { flex: 1 1 0; min-width: 0; }   /* the words wrap, the pencil stays at the right of the first line */
.pc-as-k { color: var(--ink-2); }
.pc-as-opts { margin: 0; padding: 0; border: 0; min-width: 0; }
.pc-as .pc-ed .hint { margin: 0; }
.pc-list li.pc-as .pc-ed form { display: flex; width: 100%; }   /* a whole editor, not a list line's small inline form */
/* The plan card's first look (FirstLook): its rows as a list, each its name on a line, its other values under it (two lines at
   most, the whole in the tooltip), and its actions as in the table (_row_acts) at the top right, where the table's reason picker
   and note box open under them. No sideways scroll in the command center. */
.pc-look { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-look .pc-sec { margin: 0; }
.pc-look-n { text-transform: none; letter-spacing: 0; font-weight: 500; margin-inline-start: 4px; }
.pc-look-wait { margin: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 600; }
.pc-look-wait .hint { font-weight: 400; }
.pc-look-rows, .pc-look-rows tbody { display: block; width: 100%; border-collapse: collapse; }
.pc-look-rows tr { --pcs-acts: 56px; position: relative; display: block; min-height: 34px; padding: 6px calc(var(--pcs-acts) + 6px) 6px 0;
  border-top: 1px solid var(--grey-3); }
.pc-look-rows tr:first-child { border-top: 0; }
.pc-look-rows tr:has(.ra > :nth-child(3)) { --pcs-acts: 84px; }   /* a row waiting for a check: Restore too */
.pc-look-rows td { display: block; padding: 0; min-width: 0; }
.pc-look-rows td.pcs-name { font-weight: 600; overflow-wrap: anywhere; }
.pc-look-rows td.pcs-v { margin-top: 1px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pc-look-rows .pcs-sep { color: var(--grey); }
.pc-look-rows td.act { position: absolute; top: 5px; right: 0; }
.pc-look-rows tr.why-open { z-index: 6; }
.pc-look-rows tr.cut td:not(.act) { color: var(--grey); text-decoration: line-through; }
@media (max-width: 640px) {
  .pc-line { grid-template-columns: 1fr; }
  .pc-pen { width: 40px; height: 40px; }
  .pc-pen svg { width: 16px; height: 16px; }
  .pchip .chip-x, .pc-list .chip-x { width: 32px; height: 32px; }
  .pc-list li.pc-src { min-height: 40px; }   /* a line as tall as its cross's touch target: it never reaches into the next one's */
  .pc-opt { min-height: 40px; }
  .pc-qs-go .btn { flex: 1 1 auto; justify-content: center; }
}

/* A proposal card (_proposal_card: "Suggested for run N", the planner's changes between runs, in the command center's
   feed): the card is a .cc-card; each change a line, its words first and its Apply, Edit and Skip after them (under
   them where the card is narrow), then Apply all and Skip all. */
.cc-card[hidden] { display: none; }
.proposals { flex: none; }
.proposals .hint { color: var(--ink-2); }   /* AA on the card's paper (the quiet --grey is under it) */
.pr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pr-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-block: 8px; border-block-start: 1px solid var(--grey-3); min-inline-size: 0; }
.pr-t { flex: 1 1 14em; min-inline-size: 0; overflow-wrap: anywhere; }
.pr-why { display: block; color: var(--ink-2); font-size: var(--fs-meta); margin-block-start: var(--gap-lines); }
.pr-ch s { color: var(--ink-2); }
.pr-acts, .pr-all { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-all { padding-block-start: 6px; border-block-start: 1px solid var(--grey-3); justify-content: flex-end; }
/* A change as a line (_change_line: the change cards, "Changed since the last plan"): what changes in bold, from struck
   through to after; the searches it touches folded under it, on a line of their own. */
.pr-change .pr-l { font-weight: 600; }
.pr-more { flex: 1 1 100%; min-inline-size: 0; }
.pr-more > summary { cursor: pointer; inline-size: fit-content; font-size: var(--fs-meta); color: var(--ink-2); text-decoration: underline; text-underline-offset: var(--underline-offset); }
.pr-more > summary:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.pr-detail { margin: 0; margin-block-start: var(--card-gap); padding-inline-start: var(--list-indent); font-size: var(--fs-meta); color: var(--ink-2); overflow-wrap: anywhere; }
.cc-proposal .hint { color: var(--ink-2); }   /* AA on the card's paper (the quiet --grey is under it) */
/* An engine v2 search's reconsideration suggestions (_state/suggest): a card each, spaced as the feed spaces its items; past
   three, the rest under "Show N more". */
.cc-suggest { display: flex; flex-direction: column; gap: 14px; }
.cc-suggest[hidden] { display: none; }
.cc-suggest-more > summary { cursor: pointer; inline-size: fit-content; list-style: none; font-size: var(--fs-meta); color: var(--ink-2); text-decoration: underline; text-underline-offset: var(--underline-offset); }
.cc-suggest-more > summary::-webkit-details-marker { display: none; }
.cc-suggest-more > summary:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.cc-suggest-more[open] > summary { display: none; }
.cc-suggest-more > .cc-card + .cc-card { margin-block-start: 14px; }
/* The plan card's "Changed since the last plan": the changes applied for the next run, listed as a change card lists them. */
.pc-since { display: flex; flex-direction: column; gap: var(--card-gap); padding: var(--card-pad); border: var(--hairline); border-radius: var(--card-r); background: var(--hdr); }
.pc-since h4 { margin: 0; font-size: var(--fs-h4); font-weight: 600; }
.pc-since .pr-list li:first-child { border-block-start: 0; padding-block-start: 0; }

/* The live Log (spec 2.4): "Jump to newest" while the reader is above the newest line; "Show earlier lines" at the
   top once older lines left the page. */
.log-jump { position: sticky; bottom: 4px; align-self: center; z-index: 3; box-shadow: 0 2px 0 var(--ink); }
.log-jump[hidden] { display: none; }
.log > li.learlier { padding: 6px 0 8px; text-align: center; border: 0; }
.log > li.learlier + li { border-top: 0; }

/* ---- The command center (spec 6.4, the operator's direction of 2026-11-19): a fixed, full-height frame on the left,
   400 px wide, below the top bar while that is in view (--cc-top, cc.js) and down to the window's foot; it never scrolls
   with the page, the table area scrolls on its own. Its top line, the feed (scrolls inside itself), then the buttons,
   the prompt and the hint. Folded, a 44 px rail. The views (Plan, Sources, Columns, Runs, Setup, Activity) open as a
   sheet over the table area. On a phone it is the main screen; "Table · N" shows the rows. ---- */
:root { --cc-w: 400px; --cc-gutter: 14px; }
.main:has(> .view.live.cc-on) { padding-left: calc(var(--cc-w) + 24px); }
.main:has(> .view.live.cc-on.cc-folded) { padding-left: calc(44px + 24px); }
.cc { position: fixed; left: 0; top: var(--cc-top, 64px); bottom: 0; width: var(--cc-w); z-index: 8; display: flex; flex-direction: column;
  background: var(--paper); border-right: 1.5px solid var(--ink); border-top: 1px solid var(--grey-3); box-sizing: border-box; min-width: 0; }
.cc-folded .cc { width: 44px; }
.cc-rail { display: none; }
.cc-folded .cc > :not(.cc-rail) { display: none; }
.cc-folded .cc-rail { display: flex; flex-direction: column; align-items: center; padding: 10px 0; }
.cc-top { position: relative; flex: none; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 8px; border-bottom: 1px solid var(--grey-3); min-width: 0; }
.cc-back { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ink); flex: none; }
.cc-back svg, .cc-top .circ svg { width: 16px; height: 16px; }
.cc-back:hover { background: var(--grey-3); }
.cc-top .st { flex: none; white-space: nowrap; }
.cc-more { position: relative; flex: none; }
.cc-more > summary { list-style: none; cursor: pointer; }
.cc-more > summary::-webkit-details-marker { display: none; }
.cc-more .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; z-index: 9; }
.cc-more:not([open]) .menu { display: none; }
.cc-table { display: none; }
/* What the search spent (#cc-spend, SpendSummary::view; spec item 19), on the top line beside the status: one short
   figure, a disclosure button (cc-spend-pop.js) whose popover holds the details, each a line of its own and never cut
   (the total, the run beside it, the next run's estimate, the units). The figure takes the room the line leaves and wraps
   inside itself where a phone has too little, so no figure is cut either. */
.cc-spend { flex: 0 1 auto; display: flex; min-inline-size: 0; margin-inline-end: auto; }
.cc-spend__fig { display: inline-flex; align-items: center; gap: 2px; min-inline-size: 0; min-block-size: 28px; margin: 0;
  padding-block: 3px; padding-inline: 8px 4px; border: 1px solid var(--grey-2); border-radius: 12px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: var(--fs-meta); font-weight: 600; line-height: 1.25; text-align: start; overflow-wrap: anywhere; cursor: pointer; }
.cc-spend__fig:hover, .cc-spend__fig[aria-expanded="true"] { border-color: var(--ink); }
.cc-spend__fig[aria-expanded="true"] { background: var(--hdr); }
.cc-spend__fig:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cc-spend__chev { flex: none; inline-size: 12px; block-size: 12px; }
.cc-spend__fig--short .cc-spend__more { display: none; }
.cc-spend__fig[aria-expanded="true"] .cc-spend__chev { transform: rotate(180deg); }
/* The popover hangs from the top line (.cc-top), inside the frame: as wide as its longest line, the legend one line. */
.cc-spend__pop { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 8px; z-index: 9; inline-size: max-content;
  min-inline-size: 240px; max-inline-size: calc(100% - 16px); display: flex; flex-direction: column; row-gap: 6px; margin: 0; padding-block: 12px; padding-inline: 14px;
  background: var(--paper); border: var(--b); border-radius: 14px; box-shadow: var(--lip-s); font-size: var(--fs-meta); line-height: 1.4; color: var(--ink-2); }
.cc-spend__pop[hidden] { display: none; }
.cc-spend__pop > p { margin: 0; min-inline-size: 0; overflow-wrap: anywhere; }
.cc-spend-now { color: var(--ink); font-weight: 600; }
.cc-spend-legend { padding-block-start: 6px; border-block-start: 1px solid var(--grey-3); font-style: italic; }
/* Its runs and where the spend went (SpendSummary rule 11): a small heading each, every line its label and its figures
   right-aligned in columns of tabular figures. A run opens (a details) on its own parts, their figures under its credits;
   the five newest runs, the rest under "+N more". Taller than the frame leaves, the popover scrolls inside itself. */
.cc-spend__pop { max-block-size: calc(var(--cc-vh, 100dvh) - var(--cc-top, 56px) - 72px); overflow-y: auto; overscroll-behavior: contain; }
/* With runs in it, the frame's width (the columns stay put while a live run's figures move), as on a phone (below). */
@media (min-width: 881px) { .cc-spend__pop:has(.cc-spend-sec) { inline-size: calc(100% - 16px); } }
.cc-spend-sec { display: flex; flex-direction: column; row-gap: 2px; min-inline-size: 0; padding-block-start: 6px; border-block-start: 1px solid var(--grey-3); }
.cc-spend-h { margin: 0 0 2px; font-size: var(--fs-meta); font-weight: 600; line-height: 1.4; color: var(--ink); }
.cc-spend-list { display: flex; flex-direction: column; row-gap: 2px; min-inline-size: 0; margin: 0; padding: 0; list-style: none; }
.cc-spend-row { display: flex; align-items: baseline; column-gap: 10px; min-inline-size: 0; }
.cc-spend-row__l { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; }
.cc-spend-row__n { flex: none; color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-spend-row--run { column-gap: 8px; padding-block: 3px; padding-inline: 4px; margin-inline: -4px; border-radius: 6px; }
.cc-spend-row--run .cc-spend-row__l { flex: none; min-inline-size: 3.6em; color: var(--ink); }
.cc-spend-row--run .cc-spend-row__c { flex: 1 1 auto; min-inline-size: 0; white-space: normal; }
.cc-spend-row--run .cc-spend-row__r { min-inline-size: 6.8em; color: var(--ink-2); }
/* The chevron of a run that opens; a run with no parts keeps its room, so the columns stay in line. */
.cc-spend-row--run::before, .cc-spend-more__s::before { content: ''; flex: none; align-self: center; inline-size: 5px; block-size: 5px; margin-inline: 1px 2px;
  border-inline-end: 1.5px solid transparent; border-block-end: 1.5px solid transparent; transform: rotate(-45deg); }
summary.cc-spend-row--run, .cc-spend-more__s { list-style: none; cursor: pointer; }
summary.cc-spend-row--run::-webkit-details-marker, .cc-spend-more__s::-webkit-details-marker { display: none; }
summary.cc-spend-row--run::before, .cc-spend-more__s::before { border-color: currentColor; }
.cc-spend-run__x[open] > summary.cc-spend-row--run::before, .cc-spend-more[open] > .cc-spend-more__s::before { transform: rotate(45deg); }
summary.cc-spend-row--run:hover, .cc-spend-run__x[open] > summary.cc-spend-row--run, .cc-spend-more__s:hover { background: var(--hdr); }
summary.cc-spend-row--run:focus-visible, .cc-spend-more__s:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.cc-spend-list--sub { padding-block: 2px 4px; padding-inline: 18px calc(6.8em + 8px); }
.cc-spend-list--sub .cc-spend-row { column-gap: 8px; }
/* "+N more": a line of the runs' own shape, its chevron in theirs. */
.cc-spend-more__s { display: flex; align-items: baseline; column-gap: 8px; padding-block: 3px; padding-inline: 4px; margin-inline: -4px; border-radius: 6px; color: var(--ink-2); }
.cc-spend-more[open] > .cc-spend-more__s { margin-block-end: 2px; }
@media (prefers-reduced-motion: no-preference) { .cc-spend__chev { transition: transform .15s; } }
.cc-feed { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.45; }
.cc-feed:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.cc-x { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cc-you { align-self: flex-end; max-width: 300px; margin: 0; background: var(--ink); color: var(--paper); padding: 10px 13px; border-radius: 14px 14px 4px 14px; overflow-wrap: anywhere; }
.cc-said { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-who { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cc-bubble { background: var(--hdr); border-radius: 14px 14px 14px 4px; padding: 10px 13px; display: flex; flex-direction: column; gap: 8px; overflow-wrap: anywhere; }
.cc-bubble p { margin: 0; }
.cc-bubble.err { background: var(--paper); border: 1.5px solid var(--red); }
.cc-facts { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cc-facts > div { display: flex; gap: 8px; }
.cc-facts dt { color: var(--ink-2); min-width: 8em; }
.cc-facts dd { margin: 0; font-weight: 600; }
.cc-links { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.cc-sources { margin: 0; padding-left: 18px; font-size: 13px; }
.cc-bubble a, .cc-sources a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.cc-review .cc-k { font-weight: 600; }
.cc-cost { font-size: 12px; color: var(--ink-2); }
.cc-chip { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--grey-3); color: var(--ink); }
.cc-chip.used { background: var(--st-run-bg); color: var(--st-run); }
/* A note deleted from the feed: its words stay, its chip says so, quietly (NoteDeletion). */
.cc-chip.deleted { background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--grey-2); }
/* Delete note under a note (_cc_note_delete): a quiet text control, after the bubble. */
.cc-note-del { align-self: flex-start; margin: 0; }
.cc-note-del .textbtn { font-size: var(--fs-meta); color: var(--ink-2); text-decoration: underline; text-underline-offset: var(--underline-offset); }
.cc-note-del .textbtn:hover { color: var(--ink); }
.cc-sys { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
/* The words sent, at the feed's end while their reply is on its way (cc-echo.js); the reply brings them back itself. */
.cc-x--pending .cc-you { white-space: pre-line; }
.cc-sys .dot, .cc-run .dot { display: inline-block; flex: none; width: 8px; height: 8px; margin: 0; border-radius: 999px; background: var(--grey); }
.cc-run { border: 1px solid var(--grey-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--hdr); min-width: 0; }
.cc-run.live { border: 1.5px solid var(--ink); background: var(--paper); }
.cc-run .dot.run { background: var(--st-run, #1E5FD8); }
.cc-run-h { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.cc-run-h b { color: var(--ink); font-size: 14px; }
.cc-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-2); }
.cc-lines li { overflow-wrap: anywhere; }
.cc-lines li.err { color: var(--red); }
.cc-log-btn { align-self: flex-start; font-size: 13px; }
/* Activity's two parts (_details_activity.tpl.php): What happened and Full log, the engine's lines (activity-log.js). */
.act-switch { display: flex; width: max-content; max-width: 100%; align-self: flex-start; margin-bottom: 14px; }
.seg button[aria-selected="true"] { background: var(--st-pause-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.act-log[hidden], .act-only[hidden] { display: none; }
.act-only { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.cc-plan .plancard { padding: 13px 14px; background: var(--paper); }
/* In the feed, Proceed and the prompt line close the card where it ends, scrolling with it (operator, 2026-11-23: no
   sticky buttons in the command center); the Plan view over the table keeps them at its foot. */
.cc-plan .pc-sticky { position: static; margin: 0; padding: 0; }
.cc-feed #wb-strip .strip.ask, .cc-feed #wb-strip .strip.done { display: none; }   /* the question is the plan card's; done, the buttons below say it */
.cc-card { border: 1.5px solid var(--ink); border-radius: 14px; padding: 13px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.cc-card-t { margin: 0; font-size: inherit; font-weight: 600; overflow-wrap: anywhere; }
.cc-card .hint { margin: 0; }
.cc-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-plan .plancard { border: 1.5px solid var(--ink); border-radius: 14px; }
/* The questions a change typed after a run asks first (SteerAsk), in the feed: the new search's question card, framed as the plan
   card is there; once answered, each question with its answer. */
.cc-askcard { padding: 13px 14px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper); }
.cc-askcard .pc-qs { padding: 0; border: 0; }
.cc-askcard .pc-head h3 { font-size: 16px; }
.cc-askcard .pc-head .hint { color: var(--ink-2); }   /* the grey hint is under 4.5:1 on paper */
.pc-qa { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-qa > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pc-qa dt { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.pc-qa dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cc-feed #wb-strip:empty { display: none; }
.cc-foot { flex: none; border-top: 1px solid var(--grey-3); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.cc-cmds { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cc-cmds .inline { display: contents; }
.cc-cmd { height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--grey-2); background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.cc-cmd:hover { border-color: var(--ink); }
.cc-cmd:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cc-form { position: relative; display: flex; align-items: flex-end; gap: 8px; margin: 0; border: 1.5px solid var(--ink); border-radius: 14px; padding: 8px 8px 8px 13px; background: var(--paper); }
.cc-form:focus-within { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.cc-form textarea { flex: 1; min-width: 0; border: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.45; padding: 2px 0; background: transparent; color: var(--ink); outline: none; overflow-y: auto; }
.cc-send { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--ink); color: var(--paper); cursor: pointer; }
.cc-send svg { width: 16px; height: 16px; }
.cc-send:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* On its way (sjBusy, no label: busy-over): the spinner alone, centred, in the button's own text colour. */
.cc-send.is-busy.busy-over > .spin { border-color: var(--paper); border-right-color: transparent; }
.cc-hint { margin: 0; font-size: 12px; color: var(--ink-2); }
.cmp-cmds { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 6; margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow: auto;
  background: var(--paper); border: var(--b); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .12); font-size: 13px; }
.cmp-cmds[hidden] { display: none; }
.cmp-cmds li { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cmp-cmds li span { color: var(--ink-2); min-width: 0; }
.cmp-cmds li .free { margin-left: auto; color: var(--ink-2); font-size: 11px; }
.cmp-cmds li[aria-selected="true"] { background: var(--grey-3); }
.cc-show { display: none; }
.cc-kept, .cc-kept * { display: none !important; }
.wb-found { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
/* The views, over the table area (never in the frame): from the frame's edge to the window's right, below the top bar. */
.view.live.cc-on > .sheet { position: fixed; top: var(--cc-top, 64px); left: var(--cc-w); right: 0; bottom: 0; width: auto; transform: none; transition: none;
  border-radius: 0; border: 0; border-top: 1px solid var(--grey-3); box-shadow: none; z-index: 7; background: var(--page); padding: 0 12px 12px; }
.view.live.cc-on.cc-folded > .sheet { left: 44px; }
.view.live.cc-on > .sheet[hidden] { display: none; }
.view.live.cc-on > .sheet .tabs { background: var(--page); }
.view.live.cc-on > .sheet .pane { background: var(--paper); border: var(--b); border-top: 0; border-radius: 0 0 var(--r) var(--r); }
@media (prefers-reduced-motion: reduce) { .cc, .view.live.cc-on > .sheet { transition: none; } }
@media (max-width: 880px) {
  /* A phone: the command center is the main screen; the table, when asked for ("Table · N"), takes it. */
  .main:has(> .view.live.cc-on), .main:has(> .view.live.cc-on.cc-folded) { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .cc, .cc-folded .cc { width: auto; right: 0; bottom: auto; height: calc(var(--cc-vh, 100dvh) - var(--cc-top, 56px)); border-right: 0; z-index: 6; }
  .cc-folded .cc > :not(.cc-rail) { display: flex; }
  .cc-folded .cc > .cc-feed { display: flex; }
  .cc-rail, .cc-folded .cc-rail, .cc-fold { display: none !important; }
  .cc-table { display: inline-flex; flex: none; }
  .cc-top { height: 56px; }
  .cc-back, .cc-top .circ { width: 44px; height: 44px; }
  /* Room for the figure beside the pill: a tighter line, no chevron (aria-expanded and the border say it opens); the figure
     a touch target that wraps inside itself; its popover the frame's whole width under the top line. */
  .cc-top { gap: 4px; padding-inline: 6px; }
  .cc-top .st { padding-inline: 7px; }
  .cc-top .cc-table { padding-inline: 10px; }
  .cc-spend__fig { min-block-size: 44px; padding-block: 2px; padding-inline: 7px; font-size: 12px; line-height: 1.15; }
  .cc-spend__chev { display: none; }
  .cc-spend__pop { inset-inline: 6px; inline-size: auto; min-inline-size: 0; max-inline-size: none; padding-inline: 12px; }
  .cc-spend-row--run { min-block-size: 36px; align-items: center; }
  .cc-spend-more__s { min-block-size: 36px; align-items: center; }
  .view.live.cc-on:not(.cc-table-view) > .wb-main { display: none; }
  .view.live.cc-on.cc-table-view > .cc { display: none; }
  .view.live.cc-on.cc-table-view .cc-show { display: inline-flex; }
  .cc-cmds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cc-cmds::-webkit-scrollbar { display: none; }
  .cc-cmd { height: 44px; padding: 0 14px; font-size: 14px; }
  .cc-send { width: 44px; height: 44px; border-radius: 12px; }
  .cc-form textarea { font-size: 16px; }   /* no zoom on focus (iOS) */
  .cc-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .view.live.cc-on > .sheet, .view.live.cc-on.cc-folded > .sheet { left: 0; z-index: 9; padding: 0 0 env(safe-area-inset-bottom, 0px); }
  /* Touch targets in the views and the feed: 44 px at least (spec 2.6). */
  .view.live > .sheet :is(.btn, .chip, select, input[type="text"], input[type="number"], input[type="search"], input[type="url"], input[type="email"], summary),
  .cc-feed :is(.btn, select, input[type="text"], input[type="number"]) { min-height: 44px; }
}

/* ---- The workbook area holds what acts on rows or on the workbook; the search's own messages are in the command center ---- */
/* The search's title: one small line, the weight of the command center's top line, cut with an ellipsis (its full text is the tooltip). */
.qbar #wb-title { flex: 1 1 0; min-width: 6ch; margin: 0; font-size: 14px; font-weight: 600; letter-spacing: normal; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbar { flex-wrap: nowrap; gap: 12px; padding: 2px 0; }
/* The status line says the state and the count; what the search is doing and its steps are the feed's. */
.wb-tb .wb-state :is(.what, .when, .steps) { display: none; }
/* What moved into the feed keeps the message component, laid out as a feed item. */
.cc-feed > .msg, .cc-feed > .wb-zero { margin: 0; }
.cc-feed > .wb-zero { padding: 13px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper); gap: 8px; }
.cc-feed > .wb-zero[hidden], .cc-feed > .msg[hidden] { display: none; }
.cc-feed .wb-zero h3 { font-size: 16px; font-weight: 600; }
.cc-feed .wb-zero .crow { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-feed .msg.act { flex-wrap: wrap; }
.cc-feed .wb-leave { margin: 0; padding: 0 2px; }
.cc > .msg { margin: 8px 14px 0; flex: none; }
.wb-empty { margin: 0; padding: 18px 16px; }
@media (max-width: 760px) {
  .qbar { flex-wrap: wrap; row-gap: 6px; }
  .qbar #wb-title { order: 3; flex: 1 1 100%; font-size: 14px; line-height: 1.5; }   /* its own line under the buttons, so the ellipsis has the width */
  .qbar .mw { margin-left: auto; }
}
