/*
  AIE (aie.cseam.com): the one stylesheet for every face of the first factory.
  Order 107, drawn by CT 100's product designer, 23 Nov 2026 (order 106's sheet kept and extended; its
  "builder" and operator faces withdrawn: the business builds its own co-workers, and the person building is "you").
  Looked at: the form of /srv/shared/joseph/projects/logicdart/v2-drawings/ (static HTML, one stylesheet,
  phone and desk in the same file). Its brand is not used. AIE is CSEAM's product and gets a plain look of its own.

  FOR CT 200:
  1. Every colour, corner and size is a custom property in :root. Change them there, nowhere else.
  2. Four faces share this file:
     body.ws  the business's own workshop and skill creator (W, K): desk first, usable on a tablet;
     body.ow  the team at work (T, staff) and the owner's view (O): phone first;
     body.bx  the enterprise box (E): desk first, for the owner or the business's IT person.
     The CSEAM operator view is not drawn in order 107.
  3. Status is carried by a word and a mark, never by colour alone. The five outcome words are fixed:
     Done, Not done, Waiting for you, Draft, Could not confirm.
  4. Classes marked "drawing only" (.dn, .check, .state-label, .tbd) explain the drawing. They are not built.
  5. Contrast: every text colour below meets 4.5:1 on its own background; the ratio is written beside it.
*/

:root {
  --accent: #0B5CAD;        /* buttons, links, current item; white on it 6.4:1 */
  --accent-press: #08467F;
  --wash: #EDF3F9;          /* page tint behind cards on the workshop and operator faces */
  --ink: #16222E;           /* text, 16:1 */
  --ink2: #4A5866;          /* second text, 7.2:1 on white */
  --line: #D5DEE8;
  --field-line: #5E6E7E;    /* field border, 5.2:1 */
  --card: #FFFFFF;
  --foot-bg: #16222E;
  --foot-text: #D6DEE6;     /* 11:1 on the footer */

  --done-bg: #E3F3E8;   --done-ink: #0E6A3A;    /* 6.1:1 */
  --not-bg: #FDECEA;    --not-ink: #B42318;     /* 5.6:1 */
  --wait-bg: #E6EFFA;   --wait-ink: #0B5CAD;    /* 5.6:1 */
  --draft-bg: #EEF1F4;  --draft-ink: #3F4B57;   /* 8.4:1 */
  --unsure-bg: #FFF3D6; --unsure-ink: #6E4300;  /* 7.6:1 */

  --r-card: 14px;
  --r-btn: 10px;
  --r-field: 8px;
  --r-pill: 999px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs: 16px;
  --fs-owner: 17px;         /* the owner reads on a phone: one step larger */
  --fs-small: 15px;         /* the smallest size anyone must read */

  --tap: 44px;
  --btn-h: 48px;
  --field-h: 48px;
  --bar-h: 64px;
  --menu-w: 248px;
  --gutter: 16px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--ink);
  background: var(--wash); min-height: 100vh; display: flex; flex-direction: column;
}
body.ow { font-size: var(--fs-owner); background: #FFFFFF; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 10px; }
a { color: var(--accent); font-weight: 650; }
a:hover { color: var(--accent-press); }
.small, small { font-size: var(--fs-small); }
.muted { color: var(--ink2); }
code, .mono { font-family: var(--mono); font-size: 0.92em; overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.foot :focus-visible { outline-color: #FFFFFF; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--accent); color: #FFFFFF; padding: 12px 16px; border-radius: var(--r-btn); }
.skip:focus { top: 12px; color: #FFFFFF; }
ul.plain { list-style: none; margin: 0; padding: 0; }

/* ---------- top bar and brand ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px var(--gutter); background: #FFFFFF; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand .mk-box { fill: var(--accent); }
.brand .mk-line { fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.wm { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.wm-by { font-size: var(--fs-small); font-weight: 500; color: var(--ink2); }
.face { font-size: var(--fs-small); font-weight: 700; color: var(--ink2); padding-left: 12px; border-left: 1px solid var(--line); }
.who { margin: 0 0 0 auto; font-size: var(--fs-small); display: flex; gap: 8px; align-items: center; }
.who strong { font-weight: 700; }

/* ---------- menus ---------- */
.shell { flex: 1 0 auto; width: 100%; }
.side { display: none; }
.menu-phone { width: 100%; }
.menu-phone > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-pill); font-weight: 700; list-style: none; background: #FFFFFF;
}
.menu-phone > summary::-webkit-details-marker { display: none; }
.menu-phone[open] > summary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap);
  padding: 0 12px; margin: 1px 0; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 550;
}
.nav a:hover { background: var(--wash); }
.nav a[aria-current] { background: var(--wash); color: var(--accent); font-weight: 800; box-shadow: inset 4px 0 0 var(--accent); }
.nav .grp { font-size: var(--fs-small); font-weight: 700; color: var(--ink2); margin: 14px 12px 4px; }
.nav .num-step { font-size: var(--fs-small); color: var(--ink2); font-weight: 600; }
.count {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--not-ink); color: #FFFFFF; font-size: var(--fs-small); font-weight: 800;
}
.main { padding: 18px var(--gutter) 40px; min-width: 0; }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin: 0 0 16px; }
.pagehead h1 { margin: 0 0 4px; }
.pagehead p { margin: 0; color: var(--ink2); }
.crumb { font-size: var(--fs-small); margin: 0 0 6px; color: var(--ink2); }
.crumb a { font-weight: 600; }

/* the workforce bar: which workforce the builder is in, and its manifest state */
.wfbar {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 10px var(--gutter);
  background: #FFFFFF; border-bottom: 1px solid var(--line); font-size: var(--fs-small);
}
.wfbar strong { font-size: var(--fs); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-not { border-left: 6px solid var(--not-ink); }
.card-wait { border-left: 6px solid var(--wait-ink); }
.card-done { border-left: 6px solid var(--done-ink); }
.card-unsure { border-left: 6px solid var(--unsure-ink); }
.card-off { background: var(--draft-bg); }
.kicker { font-size: var(--fs-small); font-weight: 700; color: var(--ink2); margin: 0 0 4px; }
.section { margin: 0 0 26px; }
.grid2, .grid3 { display: grid; gap: 16px; }

/* ---------- status: word and mark, colour never alone ---------- */
.st {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-small); font-weight: 750; line-height: 1.5; white-space: nowrap; border: 1px solid currentColor;
}
.st::before { font-weight: 900; }
.st.done   { background: var(--done-bg); color: var(--done-ink); }      .st.done::before { content: "\2713"; }
.st.not    { background: var(--not-bg); color: var(--not-ink); }        .st.not::before { content: "\2715"; }
.st.wait   { background: var(--wait-bg); color: var(--wait-ink); }      .st.wait::before { content: "\25CF"; font-size: 10px; }
.st.draft  { background: var(--draft-bg); color: var(--draft-ink); }    .st.draft::before { content: "\270E"; }
.st.unsure { background: var(--unsure-bg); color: var(--unsure-ink); }  .st.unsure::before { content: "?"; }
/* other words that share the shape: manifest states, bench results, plain tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-small); font-weight: 700; white-space: nowrap; background: var(--draft-bg); color: var(--draft-ink);
  border: 1px solid var(--line);
}
.tag.pass { background: var(--done-bg); color: var(--done-ink); border-color: currentColor; }
.tag.pass::before { content: "\2713"; font-weight: 900; }
.tag.fail { background: var(--not-bg); color: var(--not-ink); border-color: currentColor; }
.tag.fail::before { content: "\2715"; font-weight: 900; }
.tag.warn { background: var(--unsure-bg); color: var(--unsure-ink); border-color: currentColor; }
.tag.warn::before { content: "!"; font-weight: 900; }
.tag.run { background: var(--wait-bg); color: var(--wait-ink); border-color: currentColor; }
.tag.yours { background: #FFFFFF; color: var(--ink); border: 2px solid var(--ink); }
.tag.later { background: #FFFFFF; color: var(--ink2); border: 2px dashed var(--field-line); }
/* manifest states */
.tag.m-draft::before { content: "\270E"; }
.tag.m-benched { background: var(--wait-bg); color: var(--wait-ink); border-color: currentColor; }
.tag.m-benched::before { content: "\25B8"; }
.tag.m-released { background: var(--done-bg); color: var(--done-ink); border-color: currentColor; }
.tag.m-released::before { content: "\2713"; font-weight: 900; }

/* an agent's claim with no record behind it: struck out, with the reason in plain words */
.claim { margin: 8px 0 0; padding: 10px 12px; border: 1px dashed var(--field-line); border-radius: 8px; background: #FFFFFF; }
.claim del { color: var(--ink2); text-decoration-thickness: 2px; }
.claim .why { display: block; margin-top: 4px; font-weight: 700; color: var(--not-ink); font-size: var(--fs-small); }

/* a receipt block */
.receipt { border: 1px solid var(--done-ink); background: var(--done-bg); border-radius: 10px; padding: 12px 14px; margin: 10px 0 0; }
.receipt.not { border-color: var(--not-ink); background: var(--not-bg); }
.receipt.unsure { border-color: var(--unsure-ink); background: var(--unsure-bg); }
.receipt p { margin: 0 0 4px; }

/* the actual call an approval will make */
.call { background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.call dl { margin: 0; }

/* ---------- key and value ---------- */
.kv { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 6px 12px; margin: 0 0 10px; }
.kv dt { color: var(--ink2); font-weight: 700; font-size: var(--fs-small); padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 20px;
  font: inherit; font-weight: 700; color: #FFFFFF; background: var(--accent); border: 2px solid var(--accent);
  border-radius: var(--r-btn); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-press); border-color: var(--accent-press); color: #FFFFFF; }
.btn-2 { background: #FFFFFF; color: var(--accent); }
.btn-2:hover { background: var(--wash); color: var(--accent-press); }
.btn-danger { background: var(--not-ink); border-color: var(--not-ink); }
.btn-danger:hover { background: #8C1B12; border-color: #8C1B12; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--draft-bg); border-color: var(--draft-bg); color: var(--draft-ink); cursor: not-allowed; }
.btn-sm { min-height: var(--tap); padding: 0 14px; font-size: var(--fs-small); }
.btn-full { width: 100%; }
.link { display: inline-flex; align-items: center; min-height: var(--tap); background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: var(--not-ink); }
.acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 12px 0 0; }
.acts-col { display: grid; gap: 10px; margin: 12px 0 0; }

/* ---------- fields ---------- */
.field { margin: 0 0 16px; }
.field > label, .field > .label, legend { display: block; font-weight: 700; margin: 0 0 6px; }
.hint { display: block; font-size: var(--fs-small); color: var(--ink2); font-weight: 400; margin: 0 0 6px; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="time"], select, textarea {
  width: 100%; min-height: var(--field-h); padding: 10px 12px; font: inherit; font-size: max(16px, 1em); color: var(--ink);
  background: #FFFFFF; border: 2px solid var(--field-line); border-radius: var(--r-field);
}
textarea { min-height: 96px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
input[readonly], textarea[readonly] { background: var(--draft-bg); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.choice { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap); padding: 8px 0; font-weight: 400; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice strong { display: block; }
.err { display: flex; gap: 8px; color: var(--not-ink); font-weight: 700; font-size: var(--fs-small); margin: 6px 0 0; }
.err::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--not-ink); color: #FFFFFF; font-size: 13px; }
.has-error input, .has-error select { border-color: var(--not-ink); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; vertical-align: top; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.table thead th { font-size: var(--fs-small); color: var(--ink2); background: var(--wash); font-weight: 700; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-head { padding: 16px 18px 0; }
.table-card > .card-foot { padding: 10px 18px 16px; margin: 0; }
.scroll { overflow-x: auto; max-width: 100%; }
@media (max-width: 899px) {
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack, .stack tbody, .stack tr, .stack td, .stack th { display: block; width: 100%; }
  .stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .stack td, .stack th { border: 0; padding: 3px 0 3px 8.5em; position: relative; overflow-wrap: anywhere; }
  .stack td::before, .stack th::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 8em; font-size: var(--fs-small); font-weight: 700; color: var(--ink2); }
  .stack .first { padding-left: 0; font-weight: 800; }
  .stack .first::before { content: none; }
  .stack td.num { text-align: left; }
}

/* ---------- number tiles (operator home) ---------- */
.nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.nums li { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.nums .n-label { font-size: var(--fs-small); color: var(--ink2); font-weight: 700; }
.nums .n-value { font-size: 26px; font-weight: 800; }
.nums .n-sub { font-size: var(--fs-small); color: var(--ink2); }
.nums li.bad { border-left: 6px solid var(--not-ink); }

/* ---------- lists of work (owner) ---------- */
.items { list-style: none; margin: 0; padding: 0; }
.items > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.items > li:last-child { border-bottom: 0; }
.item-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; align-items: baseline; }
.item-top h3 { margin: 0; font-size: 17px; }
.item-meta { font-size: var(--fs-small); color: var(--ink2); margin: 2px 0 0; }
.daylabel { font-size: var(--fs-small); font-weight: 800; color: var(--ink2); margin: 18px 0 0; }
.band { padding: 12px var(--gutter); font-size: var(--fs-small); border-bottom: 1px solid var(--line); }
.band.off { background: var(--unsure-bg); color: var(--unsure-ink); font-weight: 700; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 6px; margin: 0 0 12px; list-style: none; }
.filters a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; white-space: nowrap; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); text-decoration: none; background: #FFFFFF; font-weight: 600; }
.filters a[aria-current] { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }

/* ---------- workshop: conversation and manifest side by side ---------- */
.phases { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; counter-reset: ph; }
.phases li { counter-increment: ph; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #FFFFFF; font-size: var(--fs-small); font-weight: 650; }
.phases li::before { content: counter(ph) "."; font-weight: 800; }
.phases li.is-done { color: var(--done-ink); border-color: var(--done-ink); }
.phases li.is-done::after { content: "\2713"; font-weight: 900; }
.phases li[aria-current] { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.split { display: grid; gap: 16px; }
.talk { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; }
.msg .who-says { display: block; font-size: var(--fs-small); font-weight: 700; color: var(--ink2); margin: 0 0 2px; }
.msg.ai { background: var(--wash); align-self: flex-start; }
.msg.me { background: #FFFFFF; border: 1px solid var(--line); align-self: flex-end; }
.msg.sys { align-self: center; background: none; font-size: var(--fs-small); color: var(--ink2); text-align: center; }
.mf { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.mf > li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mf > li:last-child { border-bottom: 0; }
.mf .mf-k { display: block; font-weight: 800; color: var(--ink); }
.mf .new { background: var(--done-bg); color: var(--done-ink); font-weight: 700; padding: 0 6px; border-radius: 4px; }
.mf .empty { color: var(--ink2); font-style: italic; }

/* side by side, nothing merged (W15) */
.sbs { display: grid; gap: 12px; }
.sbs > div { border: 2px solid var(--line); border-radius: 10px; padding: 12px; background: #FFFFFF; }
.sbs h4 { margin: 0 0 6px; font-size: var(--fs-small); }
.sbs pre { white-space: pre-wrap; margin: 0; font-family: var(--mono); font-size: 14px; }
.chg { background: var(--unsure-bg); outline: 1px solid var(--unsure-ink); }

/* read-back recipe (W8) */
.recipe { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: rs; }
.recipe li { counter-increment: rs; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 8px; padding: 6px 0; }
.recipe li::before { content: counter(rs); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-weight: 800; font-size: 14px; }

/* fingerprint and keys */
.fp { font-family: var(--mono); font-size: 14px; background: var(--draft-bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: inline-block; overflow-wrap: anywhere; }

/* ---------- owner face: bottom bar on the phone ---------- */
body.ow .shell { padding-bottom: calc(var(--bar-h) + 8px); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #FFFFFF; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs ul { list-style: none; margin: 0; padding: 0; display: flex; }
.tabs li { flex: 1 1 0; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bar-h); font-size: 13px; font-weight: 650; color: var(--ink2); text-decoration: none; border-top: 4px solid transparent; position: relative; }
.tabs a[aria-current] { color: var(--accent); border-top-color: var(--accent); background: var(--wash); font-weight: 800; }
.tabs .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs .count { position: absolute; top: 4px; right: 18%; min-width: 22px; height: 22px; font-size: 12px; }
.ow .main { max-width: 760px; margin: 0 auto; }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding: 16px var(--gutter); background: var(--foot-bg); color: var(--foot-text); font-size: var(--fs-small); }
.foot p { margin: 0; }
.foot a { color: #FFFFFF; }
.sample { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--unsure-bg); color: var(--unsure-ink); font-weight: 800; }
body.ow .foot { margin-bottom: var(--bar-h); }

/* ---------- drawing only ---------- */
.dn { border: 2px dashed var(--field-line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: var(--fs-small); color: var(--ink2); background: #FFFFFF; }
.dn::before { content: "Drawing note: "; font-weight: 800; color: var(--ink); }
.check { border: 2px dashed var(--accent); border-radius: 10px; padding: 12px 14px; margin: 26px 0 0; font-size: var(--fs-small); background: #FFFFFF; }
.check::before { content: "Walk check (drawing only): "; font-weight: 800; color: var(--accent); }
.state-label { font-size: var(--fs-small); font-weight: 800; color: var(--ink2); text-transform: uppercase; letter-spacing: 0.05em; margin: 30px 0 8px; padding-top: 14px; border-top: 2px dashed var(--line); }
.tbd { display: inline-block; font-size: var(--fs-small); font-weight: 700; color: var(--unsure-ink); background: var(--unsure-bg); border: 1px solid #E2C27A; border-radius: 6px; padding: 0 6px; vertical-align: middle; }

/* ---------- widths ---------- */
@media (min-width: 700px) {
  .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  :root { --gutter: 28px; }
  h1 { font-size: 30px; }
  .menu-phone { display: none; }
  .shell.has-side { display: grid; grid-template-columns: var(--menu-w) minmax(0, 1fr); }
  .side { display: block; padding: 16px 12px; background: #FFFFFF; border-right: 1px solid var(--line); }
  .split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .split > .pane-mf { position: sticky; top: 80px; }
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nums { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* the owner's face on a desk: the bottom bar becomes a left menu */
  body.ow { background: var(--wash); }
  body.ow .shell { padding-bottom: 0; }
  .tabs { display: none; }
  body.ow .foot { margin-bottom: 0; }
}

/* ---------- order 107 additions ---------- */
body.bx { background: var(--wash); }

/* the selling line, shown where it belongs (W1, W2, W14, O6, O9, O12, E1) */
.sell { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; padding: 12px 16px; margin: 0 0 16px; border-radius: var(--r-card); background: var(--ink); color: #FFFFFF; font-weight: 700; }
.sell span { display: inline-flex; align-items: center; gap: 8px; }
.sell span::before { content: "\2713"; color: #9FD8B4; font-weight: 900; }   /* mark is decoration; the words carry it */
.sell.roof { background: var(--accent-press); }

/* what a part cannot do, said plainly (phone member, box, distant member) */
.limits { border: 2px solid var(--unsure-ink); background: var(--unsure-bg); border-radius: var(--r-card); padding: 14px 16px; margin: 0 0 16px; }
.limits h2, .limits h3 { color: var(--unsure-ink); }
.limits ul { margin: 0; padding-left: 20px; }
.limits li { margin: 0 0 6px; }

/* line states: word and mark */
.tag.up { background: var(--done-bg); color: var(--done-ink); border-color: currentColor; }
.tag.up::before { content: "\25B2"; font-size: 11px; }
.tag.down { background: var(--not-bg); color: var(--not-ink); border-color: currentColor; }
.tag.down::before { content: "\25BC"; font-size: 11px; }
/* ours (from the pool) and yours (the business made it) */
.tag.ours { background: var(--wash); color: var(--accent-press); border-color: var(--accent); }
.tag.yours::before { content: "\2605"; }

/* a member as a row: name, what it does, how to reach it */
.member { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member .av { width: 44px; height: 44px; border-radius: 12px; background: var(--wash); color: var(--accent-press); display: grid; place-items: center; font-weight: 800; border: 1px solid var(--line); }
.member h3 { margin: 0; font-size: 17px; }
.member p { margin: 0; }
.reach { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.reach a, .reach span { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: #FFFFFF; font-size: var(--fs-small); font-weight: 650; text-decoration: none; color: var(--ink); }
.reach a:hover { background: var(--wash); }
.reach .none { color: var(--ink2); border-style: dashed; font-weight: 500; }

/* the team's record: exchanges, each with who, when, and what it is */
.rec { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.rec > li { position: relative; padding: 8px 0 12px 16px; }
.rec > li::before { content: ""; position: absolute; left: -8px; top: 14px; width: 13px; height: 13px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--accent); }
.rec > li.gap::before { border-color: var(--unsure-ink); }
.rec .rec-meta { font-size: var(--fs-small); color: var(--ink2); }

/* chat composer at the foot of a conversation */
.composer { display: flex; gap: 8px; align-items: flex-end; margin: 14px 0 0; }
.composer textarea { min-height: var(--field-h); flex: 1; }
.msg .work { margin: 8px 0 0; padding: 10px 12px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; }
.msg.ai .st { margin-right: 4px; }

/* a test call transcript (W13, T4) */
.say { margin: 0 0 8px; }
.say b { display: inline-block; min-width: 5.5em; color: var(--ink2); font-size: var(--fs-small); }

/* a plain key panel for the box (E) */
.health { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0 0 20px; padding: 0; }
.health li { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.health .h-k { display: block; font-size: var(--fs-small); color: var(--ink2); font-weight: 700; }
.health .h-v { display: block; font-size: 19px; font-weight: 800; margin: 4px 0 2px; }
.health li.bad { border-left: 6px solid var(--not-ink); }
.health li.warn { border-left: 6px solid var(--unsure-ink); }
@media (min-width: 900px) { .health { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* the index */
.idx { list-style: none; margin: 0; padding: 0; }
.idx li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.idx li:last-child { border-bottom: 0; }
.idx .code { font-family: var(--mono); font-weight: 800; color: var(--ink); padding-top: 2px; }
.idx .why { display: block; color: var(--ink2); font-size: var(--fs-small); }
.idx .trade { display: inline-block; font-size: 13px; font-weight: 700; color: var(--draft-ink); background: var(--draft-bg); border-radius: var(--r-pill); padding: 0 8px; margin-left: 6px; }

/* helpers, so no page carries a style of its own */
.m0 { margin: 0; }
.mt { margin-top: 14px; }
.narrow { max-width: 460px; margin: 0 auto; }
.index-main { max-width: 1100px; margin: 0 auto; width: 100%; }

/* W17 draw a duty (order 108): the canvas is a view of the duty's steps in the manifest, never a file of its own */
.dz { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); }
@media (min-width: 1100px) { .dz { grid-template-columns: 200px minmax(0, 1fr) 320px; } }
.dz-pal { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dz-pal li { border: 1px solid var(--field-line); border-radius: var(--r-field); padding: 8px 10px; background: var(--card); font-size: var(--fs-small); min-height: var(--tap); }
.dz-pal li strong { display: block; color: var(--ink); }
.dz-pal li.box-only { border-style: dashed; color: var(--ink2); }
.dz-canvas { background: var(--wash); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; overflow-x: auto;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 20px 20px; }
.dz-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); column-gap: 28px; row-gap: 26px; min-width: 500px; }
.dz-node { position: relative; background: var(--card); border: 2px solid var(--field-line); border-radius: var(--r-field); padding: 10px 12px; font-size: var(--fs-small); }
.dz-node.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--wait-bg); }
.dz-node .k { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); }
.dz-node .n { font-family: var(--mono); font-weight: 800; color: var(--accent); margin-right: 6px; }
.dz-node a { display: block; font-weight: 700; color: var(--ink); text-decoration: none; min-height: 24px; }
.dz-node a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dz-node.write { border-left-width: 6px; }
.dz-node.person { border-color: var(--unsure-ink); }
.dz-node.bad { border-color: var(--not-ink); background: var(--not-bg); }
.dz-node::after { content: ""; position: absolute; left: 50%; bottom: -26px; height: 24px; border-left: 2px solid var(--field-line); }
.dz-node.end::after { display: none; }
.dz-span { grid-column: 1 / -1; max-width: 380px; justify-self: center; width: 100%; }
.dz-branch { font-size: 13px; font-weight: 700; color: var(--ink2); display: block; margin-bottom: 4px; }
.dz-side { display: grid; gap: var(--gutter); align-content: start; }
.dz-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--ink2); margin: 12px 0 0; }
.dz-phone-note { display: none; }
@media (max-width: 899px) { .dz-canvas { display: none; } .dz-phone-note { display: block; } }

/* ---------- R6: the shell, and the finish every screen shares ---------- */
[hidden] { display: none !important; }   /* a hidden error line or card stays hidden whatever its class says */
/* the phone menu: a button at the right of the bar that opens a panel under it, scrollable on a short phone */
.top { position: sticky; }
.top .menu-phone { width: auto; margin-left: auto; }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 64px); overflow-y: auto;
  padding: 4px var(--gutter) 16px; background: #FFFFFF; border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(22, 34, 46, 0.12); }
.nav .grp:first-child { margin-top: 6px; }
.nav .link.sign-out { width: 100%; justify-content: flex-start; padding: 0 12px; text-decoration: none; color: var(--ink); font-weight: 550; }
.nav .link.sign-out:hover { background: var(--wash); border-radius: 8px; }
/* the owner's face has no bottom bar in the build: no room is kept for one */
body.ow .shell, body.ow .foot { padding-bottom: 0; margin-bottom: 0; }
.foot { margin-top: 24px; }
.main > :last-child { margin-bottom: 0; }

/* a bare button takes the button look; a form field without a class takes the field look */
.main button:not([class]), .main input[type="submit"]:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 20px;
  font: inherit; font-weight: 700; color: #FFFFFF; background: var(--accent); border: 2px solid var(--accent);
  border-radius: var(--r-btn); cursor: pointer;
}
.main button:not([class]):hover { background: var(--accent-press); border-color: var(--accent-press); }
.main button:not([class])[disabled] { background: var(--draft-bg); border-color: var(--draft-bg); color: var(--draft-ink); cursor: not-allowed; }
.main input:not([type]), .main input[type="password"], .main input[type="tel"], .main input[type="url"],
.main input[type="date"], .main input[type="datetime-local"] {
  width: 100%; min-height: var(--field-h); padding: 10px 12px; font: inherit; font-size: max(16px, 1em); color: var(--ink);
  background: #FFFFFF; border: 2px solid var(--field-line); border-radius: var(--r-field);
}
.main input[type="checkbox"], .main input[type="radio"] { width: 22px; height: 22px; accent-color: var(--accent); vertical-align: middle; }
.main input[type="file"] { font: inherit; min-height: var(--tap); }
.main form > label:not(:has(input)), .main form > p > label:not(:has(input)) { display: block; font-weight: 700; margin: 0 0 6px; }
.main form > label + input, .main form > label + select, .main form > label + textarea { margin-bottom: 16px; }
.main form p:has(> label + input, > label + select, > label + textarea) { margin: 0 0 16px; }
/* a radio or a checkbox with its words: the choice look */
.main fieldset > label:not(.choice), .main label:has(> input[type="checkbox"]):not(.choice), .main label:has(> input[type="radio"]):not(.choice) {
  display: block; position: relative; min-height: var(--tap); padding: 8px 0 8px 34px; font-weight: 400; }
.main label:not(.choice) > input[type="checkbox"], .main label:not(.choice) > input[type="radio"] { position: absolute; left: 0; top: 10px; margin: 0; }
.main fieldset > legend { margin-bottom: 4px; }
.member.no-av { grid-template-columns: minmax(0, 1fr); }
.main .wfbar { border: 1px solid var(--line); border-radius: var(--r-card); margin: 0 0 16px; }

/* the empty state, a note, a lead line, a notice, a figure line */
.empty { padding: 18px; margin: 0 0 16px; border: 2px dashed var(--line); border-radius: var(--r-card); background: #FFFFFF; color: var(--ink2); }
.empty > :last-child { margin-bottom: 0; }
.empty h2 { color: var(--ink); }
.lead { color: var(--ink2); }
.note { font-size: var(--fs-small); color: var(--ink2); }
.notice { padding: 12px 14px; margin: 0 0 16px; border-radius: 10px; background: var(--wait-bg); color: var(--wait-ink); font-weight: 650; }
.fig, .figures { font-variant-numeric: tabular-nums; }
.inline { display: inline; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* lists inside cards read as rows */
.card > ul:not([class]), .card > ol:not([class]) { padding-left: 20px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.grid-cards { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; }
@media (min-width: 700px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-cards > li > .card { height: 100%; margin: 0; }
.rows .tag { white-space: normal; }
.phases li[aria-current] a { color: #FFFFFF; }
