/* Foundry screens. Tokens, shell, kit and motion from FSW_Prototype_v0_2.html (Factory Software); Geist, one signal
   blue, the decision card dark. Motion is CSS only and stills under reduced motion. Foundry Build Chat 17: the shell. */
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bg: #f3f4f6; --panel: #ffffff; --soft: #fbfbfc; --sunk: #f5f6f8; --line: #e6e8ee; --line2: #eff1f4;
  --fg: #0b0f1a; --fg2: #3a4252; --fg3: #6b7385; --fg4: #b6bcc8;
  --accent: #0f47ff; --accent2: #6e8eff; --accent-bg: #eef2ff; --accent-line: #c9d6ff; --on-accent: #ffffff;
  --ink: #0b0f1a; --on-ink: #ffffff;
  --ok: #15803d; --ok-bg: #ecfdf3; --warn: #b45309; --warn-bg: #fff6e8; --warn-line: #f5d9a8;
  --bad: #b42318; --bad-bg: #fef3f2;
  --shadow: 0 18px 40px -22px rgba(11, 15, 26, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10; --panel: #12151c; --soft: #151922; --sunk: #0f1218; --line: #242936; --line2: #1c212c;
    --fg: #eef0f5; --fg2: #c3c9d6; --fg3: #8c95a8; --fg4: #4a5162;
    --accent: #6e8eff; --accent2: #9db2ff; --accent-bg: #18214a; --accent-line: #2f3f86; --on-accent: #0a0c10;
    --ink: #eef0f5; --on-ink: #0b0f1a;
    --ok: #4ade80; --ok-bg: #10281a; --warn: #fbbf24; --warn-bg: #291f0c; --warn-line: #5a4314;
    --bad: #f97066; --bad-bg: #2a1210; color-scheme: dark;
  }
}
:root[data-theme="dark"], .dz {
  --bg: #0a0c10; --panel: #12151c; --soft: #151922; --sunk: #0f1218; --line: #242936; --line2: #1c212c;
  --fg: #eef0f5; --fg2: #c3c9d6; --fg3: #8c95a8; --fg4: #4a5162;
  --accent: #6e8eff; --accent2: #9db2ff; --accent-bg: #18214a; --accent-line: #2f3f86; --on-accent: #0a0c10;
  --ink: #eef0f5; --on-ink: #0b0f1a;
  --ok: #4ade80; --ok-bg: #10281a; --warn: #fbbf24; --warn-bg: #291f0c; --warn-line: #5a4314;
  --bad: #f97066; --bad-bg: #2a1210; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
/* one look per kind of thing (FSW_Screens_v0_3.md §0 rule 3): a link is underlined text; a button is filled (main) or outlined;
   a tag or a status never takes a click and never reacts to the pointer */
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell (gap list G-S1, G-S3 to G-S10): the sidebar floats on the gray page; the screen is ONE white panel. */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; min-height: 100vh; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.side { position: sticky; top: 10px; align-self: start; height: calc(100vh - 20px); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 6px 0 4px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px; }
.brand b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
/* G-S2: the B mark's slot, left empty until John's mark files are placed (never a drawn imitation) */
.markslot { display: inline-block; flex: none; width: var(--s, 24px); height: var(--s, 24px); border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--fg4); background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line2) 4px 5px); }
.wmslot { display: inline-flex; align-self: flex-start; padding: 4px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--fg3); box-shadow: inset 0 0 0 1.5px var(--line); border: 1px dashed var(--fg4); }
.role { display: grid; grid-template-columns: repeat(2, 1fr); padding: 3px; border-radius: 10px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.role button { border: 0; background: transparent; height: 28px; border-radius: 7px; font-size: 12.5px; color: var(--fg3); cursor: pointer; }
.role button[aria-pressed="true"] { background: var(--panel); color: var(--fg); font-weight: 550; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16, 24, 40, .06); }
.role button[disabled] { cursor: not-allowed; opacity: .55; }
.jump { justify-content: flex-start; color: var(--fg3); font-weight: 400; background: var(--panel); }
.jump .kbd { margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav h4 { margin: 0 0 4px; padding: 0 8px; font-size: 11.5px; font-weight: 500; color: var(--fg3); display: flex; align-items: center; gap: 7px; }
.nav h4 i { width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--ok)); flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 8px; color: var(--fg2); text-decoration: none; }
.nav a:hover { background: var(--sunk); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--panel); color: var(--fg); font-weight: 550; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16, 24, 40, .05); }
.nav a svg { flex: none; }
.nav a .badge { margin-left: auto; }
.badge { font: 500 11px/1.45 var(--mono); color: var(--on-accent); background: var(--accent); border-radius: 6px; padding: 1px 6px; }
.sidefoot { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 9px; font-size: 12px; color: var(--fg3); }
.sidefoot .runner { display: flex; align-items: center; gap: 8px; color: var(--fg2); }
/* the client's view leaves out the operator's chrome (foundry/clientview.py has the rest) */
.clientview .sidefoot .runner, .clientview .jump, .clientview .brand .tag, .clientview .top [data-act="palette"] { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c, #16a34a); }
.themebtn { border: 0; background: transparent; color: var(--fg3); font-size: 12px; text-align: left; padding: 0; cursor: pointer; }
.themebtn:hover { color: var(--fg); }
.main { min-width: 0; background: var(--panel); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(16, 24, 40, .04); padding: 20px 26px 28px; overflow-wrap: anywhere; }
.main:focus { outline: none; }
.top, .tabs, .scrim { display: none; }
.iconbtn { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--fg); cursor: pointer; }
.iconbtn:hover { background: var(--sunk); }
.side .closebtn { display: none; }
/* G-S8: the panel's top row, the breadcrumb at left and a small chip at right */
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--fg3); margin-bottom: 14px; }
/* G-S6: the command palette (Ctrl K) */
.pal[hidden] { display: none; }
.pal { position: fixed; inset: 0; z-index: 70; background: rgba(11, 15, 26, .36); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.pal .box { width: 100%; max-width: 560px; background: var(--panel); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), var(--shadow); overflow: hidden; }
.pal input[type="text"] { width: 100%; border: 0; border-radius: 0; outline: 0; padding: 16px 18px; font-size: 16px; background: transparent; color: var(--fg); border-bottom: 1px solid var(--line2); }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 420px); overflow-y: auto; }
.pal li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--fg); text-decoration: none; }
.pal li a small { margin-left: auto; color: var(--fg3); font-size: 12px; }
.pal li a[aria-selected="true"] { background: var(--accent-bg); color: var(--accent); }

.h1 { font-size: 26px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 4px; }
.h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.sub { font-size: 13px; color: var(--fg3); margin: 0 0 18px; }
.label { font-size: 12px; color: var(--fg3); }
.mono { font-family: var(--mono); }
.big { font: 500 24px var(--mono); letter-spacing: -.02em; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(var(--min, 160px), 1fr)); }
.stack > * + * { margin-top: 16px; }
.card { background: var(--panel); border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 16px; min-width: 0; }
.card.flat { box-shadow: 0 0 0 1px var(--line); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.muted { color: var(--fg3); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line2); }
.list > li:first-child { border-top: 0; }
.tag { font: 11px var(--mono); border-radius: 6px; padding: 2px 6px; background: var(--sunk); color: var(--fg2); white-space: nowrap; }
.tag.code { background: var(--accent-bg); color: var(--accent); }
.tag.model { background: var(--warn-bg); color: var(--warn); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg2); white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fg4); flex: none; }
.st.PASS::before, .st.RAN::before { background: var(--ok); }
.st.FAIL::before { background: var(--bad); }
.st.FLAG::before { background: var(--warn); }
.notrun { border-radius: 10px; padding: 10px 12px; background: var(--sunk); color: var(--fg2); font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--fg3); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tablewrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.track { display: flex; gap: 3px; min-width: 120px; }
.track i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.track i.RAN { background: var(--accent); }
.track i.NOT { background: var(--line); }
.track i.model.RAN { background: var(--accent2); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; box-shadow: inset 0 0 0 1px var(--fg4); color: var(--fg); font-weight: 500; text-decoration: none; }
.btn:hover { box-shadow: inset 0 0 0 1px var(--fg2); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn.primary:hover { filter: brightness(1.08); }
.btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn { white-space: nowrap; flex: none; } /* a button label never wraps (John's Home shot, 2 Nov: "Sen / d") */
kbd { font: 11px var(--mono); border-radius: 5px; padding: 1px 5px; background: rgba(127, 127, 127, .18); }
.kbd { font: 11px var(--mono); padding: 0 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px currentColor; opacity: .6; white-space: nowrap; }
input[type="text"], input[type="number"], select, textarea { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; }

.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
/* the decision inbox, board 2 (gap list G-D1 to G-D8; Foundry Build Chat 18) */
.dgrid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.dlist-h { align-items: center; margin-bottom: 10px; }
.dlist-h .h2 { margin: 0; }
.dp-item { cursor: pointer; font: inherit; }
.dp-item:hover { background: var(--soft); }
.dp-item[aria-current="true"] { background: var(--accent-bg); }
.dnote { margin: 10px 0 0; }
.fg2 { color: var(--fg2); }
.dz { background: #0c0e13; color: var(--fg); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.dcard { display: flex; flex-direction: column; gap: 16px; overflow: hidden; scroll-margin-top: 72px; }
.dcard .tag { background: transparent; color: var(--fg3); box-shadow: inset 0 0 0 1px var(--line); }
.dcrumb { margin: 0; overflow-wrap: anywhere; }
.dtitle { font-size: clamp(20px, 3vw, 26px); line-height: 1.15; margin: 0 0 6px; }
.dlead { margin: 0; }
.drec { display: flex; flex-direction: column; gap: 10px; border-radius: 14px; padding: 16px; background: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.drec .drec-h { font-weight: 600; flex-wrap: nowrap; --g: 10px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dhead .tag { flex: none; }
.dcard .err:empty { display: none; }
.drec ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.dopts { --g: 8px; }
.dz .opt { background: var(--sunk); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); font-weight: 550; }
.dz .opt.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -14px var(--accent); }
.dz .opt[aria-pressed="true"] { outline: 2px solid var(--accent2); outline-offset: 2px; }
.dfields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.dfields input { margin-top: 4px; }
.dwho b { color: var(--fg); font-weight: 550; }
.dwho { gap: 8px; margin: 0; }
.ddef { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg2); }
.ddef input { margin: 2px 0 0; flex: none; }
.dslack { display: flex; flex-direction: column; gap: 8px; border-radius: 14px; padding: 14px 16px; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 899px) { .dgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) { .dfields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dfields .dnote-f { grid-column: 1 / -1; } }
.ok-note { color: var(--ok); font-weight: 500; }
.err { color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 9; }
.toast[hidden] { display: none; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week > div { border-radius: 10px; padding: 8px; background: var(--sunk); font-size: 12px; min-height: 58px; min-width: 0; }
.week > div > .mono:first-child { white-space: nowrap; }
.week > div.used { background: var(--accent-bg); color: var(--accent); }
.week > div.today { box-shadow: inset 0 0 0 1px var(--accent); }
.empty { padding: 26px; text-align: center; color: var(--fg3); }

/* Component kit (G-S11), from the prototype. A figure is always a value read from the run folder; the
   prototype's "[value]" brackets marked its example data and are not copied. */
.ic { flex: none; vertical-align: -3px; }
.ok-c { color: var(--ok); } .acc-c { color: var(--accent); } .warn-c { color: var(--warn); } .bad-c { color: var(--bad); } .mute-c { color: var(--fg4); }
.fig { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: normal; }
.segbar { display: flex; gap: 3px; }
.segbar span { width: 18px; height: 5px; border-radius: 3px; background: var(--line); flex: none; }
.segbar span.d { background: var(--ink); }
.segbar span.n { background: var(--accent); }
.segbar span.f { background: var(--bad); }
.segbar span.p { background: var(--accent2); }
.rows { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--fg); text-decoration: none; border: 0; border-top: 1px solid var(--line2); background: var(--panel); width: 100%; text-align: left; }
.li:first-child { border-top: 0; }
a.li:hover, button.li:hover { background: var(--soft); text-decoration: none; }
.li .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.li .t { font-weight: 550; }
.li .s { font-size: 13px; color: var(--fg3); }
.ib { width: 28px; height: 28px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-bg); color: var(--accent); }
.ib.warn { background: var(--warn-bg); color: var(--warn); }
.ib.ok { background: var(--ok-bg); color: var(--ok); }
.ib.bad { background: var(--bad-bg); color: var(--bad); }
.ib.mute { background: var(--sunk); color: var(--fg3); }


/* Layout helpers from the prototype */
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g, 8px); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 22px; align-items: start; }
.tbl { border-radius: 12px; box-shadow: 0 0 0 1px var(--line); overflow-x: auto; }
.tbl table { min-width: var(--tmin, 520px); }
.tbl th { padding: 10px 12px; white-space: nowrap; border-bottom: 0; }
.tbl td { padding: 11px 12px; border-top: 1px solid var(--line2); border-bottom: 0; vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td { overflow-wrap: normal; }
.tbl td:first-child { white-space: nowrap; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 10px; padding-bottom: 11px; }
.step .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

/* Home (G-H1 to G-H8) */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 0 8px; }
.hero-h { font-size: 32px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; margin: 4px 0 0; text-wrap: balance; }
.hero-s { margin: 0; font-size: 14px; color: var(--fg2); }
  background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -22px var(--accent); }
.hero-note { max-width: 680px; margin: 0; }
.home-split { margin-top: 26px; }
.home-split > .stack > * + * { margin-top: 24px; }
.sec-h { margin-bottom: 10px; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.strip-h { font-weight: 550; margin-right: 4px; }
.strip-n { flex-basis: 100%; text-align: right; }
a.cl { color: var(--fg); font-weight: 550; font-size: 15px; }
.live { padding: 16px 16px 14px; background: var(--soft); }
.live-h { margin-bottom: 14px; align-items: center; }
.live-st { font-size: 13px; color: var(--fg3); }
.live-f { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; margin-top: 2px; border-top: 1px solid var(--line); }
.live-f .fig { font-size: 15px; }
@media (max-width: 1179px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) { .hero-h { font-size: 26px; } .hero { padding-top: 12px; } }

/* Motion (G-S12): the prototype's keyframes, CSS only; every one is still under reduced motion */
@keyframes fd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Under 1024px: a drawer and a sticky top bar (G-S10) */
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-block: 12px; }
  .top { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; height: 56px; padding: 0 16px; background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line); }
  :root[data-theme="dark"] .top, :root[data-theme="dark"] .tabs { background: rgba(18, 21, 28, .78); }
  .top .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .sp { margin-left: auto; display: flex; gap: 6px; }
  .side { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); background: var(--bg); padding: 14px; box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .7, .2, 1); visibility: hidden; }
  body.drawer .side { transform: none; visibility: visible; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(11, 15, 26, .36); }
  .side .closebtn { display: inline-flex; margin-left: auto; }
  .main { padding: 18px 18px 20px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
/* Under 640px: five bottom tabs (G-S10) */
@media (max-width: 639px) {
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 0 8px env(safe-area-inset-bottom, 0px); background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border-top: 1px solid var(--line); }
  .tabs a, .tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; border: 0; background: transparent; font-size: 11px; color: var(--fg3); text-decoration: none; position: relative; cursor: pointer; }
  .tabs [aria-current="page"] { color: var(--accent); font-weight: 550; }
  .tabs .badge { position: absolute; top: 6px; left: calc(50% + 6px); font-size: 10px; padding: 0 4px; }
  .app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .main { padding: 16px 16px 18px; border-radius: 14px; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toast { bottom: 84px; }
}
@media (prefers-color-scheme: dark) {
  @media (max-width: 1023px) { :root:not([data-theme="light"]) .top, :root:not([data-theme="light"]) .tabs { background: rgba(18, 21, 28, .78); } }
}
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.tag.now { background: transparent; color: var(--fg); font-weight: 700; }
/* the run view, board 10 (gap list G-R1 to G-R5; Foundry Build Chat 18) */
.crumb b { color: var(--fg); font-weight: 500; }
.runhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; margin-bottom: 16px; }
.runhead .h1 { margin: 0; }
.runid { margin: 4px 0 0; overflow-wrap: anywhere; }
.runsplit { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.card.soft { background: var(--soft); }
.stages { margin-top: 6px; }
.stg { border-top: 1px solid var(--line2); }
.stg:first-child { border-top: 0; }
.stg > summary, .checks > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; cursor: pointer; list-style: none; }
.stg > summary::-webkit-details-marker, .checks > summary::-webkit-details-marker { display: none; }
.stg > summary .grow, .checks > summary .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.stg > summary .t, .checks > summary .t { font-weight: 550; }
.stg > summary:hover .t { color: var(--accent); }
.stg[data-cur] > summary .t { color: var(--accent); }
.stg-steps { margin: 0 0 8px 30px; }
.stg-steps > li { padding: 6px 0; }
.checks > summary { min-height: 0; padding: 0; }
.checks[open] > summary { margin-bottom: 8px; }
.rulev { font: 12px/1.7 var(--mono); color: var(--fg2); overflow-wrap: anywhere; }
.rulev span { color: var(--fg); }
.btn.block { width: 100%; justify-content: center; height: 44px; border-radius: 12px; }
@media (max-width: 899px) { .runsplit { grid-template-columns: minmax(0, 1fr); } }
.checks > summary > .label { white-space: nowrap; }

/* screen 9: client build page (board 9; Foundry Build Chat 19) */
.chead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.chead .h1 { margin: 0; }
.chead .sub { margin: 2px 0 0; }
.ctile { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 16px; }
.cact { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 280px; text-align: right; }
.ctabs { margin-bottom: 18px; }
.csplit .ccards { gap: 14px; }
.ccards .card { display: flex; flex-direction: column; gap: 10px; }
.ccards .card p { margin: 0; }
.cshape { min-height: 96px; border-radius: 10px; border: 1px dashed var(--line); background: var(--sunk); display: grid; place-items: center; padding: 12px; text-align: center; }
.csplit .li .btn { flex: none; }
.cfile { overflow-wrap: anywhere; }
@media (max-width: 640px) { .csplit .li { flex-wrap: wrap; } .csplit .li .grow { flex-basis: 100%; } }
.ctl { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 14px; }
.ctl li { display: flex; gap: 10px; align-items: flex-start; }
.ctl li > svg { flex: none; margin-top: 1px; }
.ctl .t, .ctl .label { display: block; }
.ctl .t { overflow-wrap: anywhere; }
.ctime { border-top: 1px solid var(--line2); margin-top: 16px; padding-top: 14px; display: grid; gap: 8px; }
.ctime p, .ctime ul { margin: 0; }
.ctime .ctrack { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ctime .ctrack span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 640px) { .cact { align-items: flex-start; text-align: left; max-width: none; width: 100%; } }

/* screen 6: QA (board 6; Foundry Build Chat 19) */
.qhero { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 14px; }
.qhero .h1 { margin: 0 0 4px; }
.qhero p { margin: 0 0 10px; }
.qring { flex: none; color: var(--fg); }
.qtiles { gap: 10px; margin-bottom: 18px; }
.qtile { display: grid; gap: 4px; align-content: start; }
.qtile .qv { font-weight: 600; overflow-wrap: anywhere; }
.qchecks { margin: 0; padding: 0; list-style: none; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: var(--panel); }
.qchecks > li { padding: 12px 14px; border-top: 1px solid var(--line2); }
.qchecks > li:first-child { border-top: 0; }
.qrow > .grow { flex: 1; min-width: 0; }
.qrow { display: flex; align-items: flex-start; gap: 12px; }
.qrow > .st { flex: none; min-width: 64px; text-align: center; }
.qrow .t, .qrow .label { display: block; }
.qrow .t { overflow-wrap: anywhere; }
.qrow > .tag { flex: none; }
@media (max-width: 640px) { .qhero { flex-direction: column; align-items: flex-start; } }

/* the simplicity pass (FSW_Screens_v0_3.md §0): Details, overview sections, the quiet line, the two motions */
details.more { margin-top: 12px; }
details.more > summary { cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: 13px; width: max-content; }
details.more > .more-b { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; color: var(--fg2); overflow-wrap: anywhere; }
.page { max-width: 760px; display: flex; flex-direction: column; gap: 24px; }
.sect > .h2 { margin: 0 0 8px; }
.oneline { margin: 0; color: var(--fg3); }
.quiet { margin: 0; font-size: 12.5px; color: var(--fg3); }
.showall { margin-top: 8px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead .h1 { margin: 0; }
.fd-working { animation: fd-spin 1.4s linear infinite; }
@keyframes fd-changed { from { background: var(--accent-bg); } to { background: transparent; } }
.fd-changed { animation: fd-changed 1.6s ease-out; }
.chead .btn { margin-left: auto; }
.chead .grow { flex: 1 1 auto; min-width: 0; }

/* the board, the lights and the ready check (brief v0.3 package A; Foundry Build Local Chat 8.2) */
.page.wide { max-width: none; }
.board { display: flex; flex-wrap: wrap; gap: 16px 12px; align-items: flex-start; }
.bcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 200px; max-width: 340px; }
.bcol.bnone { flex: 0 0 auto; min-width: 84px; }
@media (max-width: 640px) { .bcol, .bcol.bnone { flex: 1 1 100%; max-width: none; } .bcol.bnone { flex-direction: row; gap: 8px; align-items: baseline; } }
.bh { font-size: 13px; font-weight: 600; color: var(--fg3); margin: 0; display: flex; gap: 6px; align-items: baseline; }
.bcol.bnone .oneline { margin: 0; font-size: 13px; color: var(--fg4); }
.bcard { display: flex; flex-direction: column; gap: 4px; padding: 12px; min-height: 44px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line);
  background: var(--panel); color: var(--fg); text-decoration: none; min-width: 0; }
.bcard.you { box-shadow: 0 0 0 1px var(--accent); }
.bcard .t { font-weight: 550; overflow-wrap: anywhere; }
.bcard .s { font-size: 13px; color: var(--fg3); }
.bcard .w { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.bcard .w .dot { position: relative; top: -1px; }
.bcard .w.you .dot { --c: var(--accent); } .bcard .w.client .dot { --c: var(--warn); }
.bcard .w.foundry .dot { --c: var(--fg4); } .bcard .w.done .dot { --c: var(--ok); }
.lights { display: inline-flex; gap: 4px; align-items: center; }
.lt { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--fg4); }
.lt.green, .lt.ticked { background: var(--ok); }
.lt.red { background: var(--bad); }
.lt.tick { background: transparent; box-shadow: inset 0 0 0 2px var(--warn); }
.lt.NOTRUN { background: transparent; box-shadow: inset 0 0 0 2px var(--fg4); }
.nowrap { white-space: nowrap; flex: none; }
