/* ===========================================================================
   Single Reporting Platform — Manufacturer's guide
   Direction B "Workspace" — cool, neutral, app/docs-like.
   Plain static stylesheet; tokens from the design handoff.
   ========================================================================= */

:root {
  /* surfaces */
  --bg:            #eef1f4;
  --sidebar:       #fbfcfd;
  --card:          #ffffff;
  --card-alt:      #f5f7f9;
  --group-row:     #f0f5f5;
  --hairline:      #e2e7ec;
  --hairline-soft: #eef1f4;
  --group-rule:    #e7ecf0;

  /* ink */
  --ink:    #16191d;
  --body:   #5e666f;
  --muted:  #6b727b;
  --faint:  #8b939c;
  --faintest: #a3abb3;

  /* accent (teal) */
  --accent:        #16636b;
  --accent-tint:   #eef4f4;
  --accent-strong: #0f5b58;
  --rail-halo:     #e3f0f0;
  --rail-line:     #dfe4e9;

  /* amber */
  --amber-text:    #8a5a1a;
  --amber-dot:     #c08a2e;
  --amber-chip-bg: #fbe6cf;
  --amber-callout-bg: #fdf4e3;
  --amber-callout-border: #efdfc0;

  /* info callout */
  --info-bg:     #eef3f6;
  --info-border: #d8e3ea;
  --callout-ink: #3f4853;

  /* status chips */
  --chip-mand-bg: #def0ef; --chip-mand-text: #0f5b58;
  --chip-cond-bg: #fbe6cf; --chip-cond-text: #8a5a1a;
  --chip-opt-bg:  #e6eaee; --chip-opt-text:  #687079;
}

/* ---------- dark palette ---------------------------------------------- */
:root[data-theme="dark"] {
  --bg:            #0f1316;
  --sidebar:       #161a1f;
  --card:          #1a1f25;
  --card-alt:      #20262d;
  --group-row:     #1f2a2a;
  --hairline:      #2a313a;
  --hairline-soft: #1f252c;
  --group-rule:    #2a313a;

  --ink:    #eef1f4;
  --body:   #b6bec7;
  --muted:  #9aa2ab;
  --faint:  #7a828b;
  --faintest: #5e666f;

  --accent:        #4cb6b8;
  --accent-tint:   #16363a;
  --accent-strong: #7fd1d2;
  --rail-halo:     #1d3034;
  --rail-line:     #323a44;

  --amber-text:    #d8a558;
  --amber-dot:     #d8a558;
  --amber-chip-bg: #3a2a16;
  --amber-callout-bg: #2a2114;
  --amber-callout-border: #4a3a1e;

  --info-bg:     #19222a;
  --info-border: #2a3640;
  --callout-ink: #c2c9d2;

  --chip-mand-bg: #16363a; --chip-mand-text: #7fd1d2;
  --chip-cond-bg: #3a2a16; --chip-cond-text: #d8a558;
  --chip-opt-bg:  #262d35; --chip-opt-text:  #a3abb3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0f1316;
    --sidebar:       #161a1f;
    --card:          #1a1f25;
    --card-alt:      #20262d;
    --group-row:     #1f2a2a;
    --hairline:      #2a313a;
    --hairline-soft: #1f252c;
    --group-rule:    #2a313a;

    --ink:    #eef1f4;
    --body:   #b6bec7;
    --muted:  #9aa2ab;
    --faint:  #7a828b;
    --faintest: #5e666f;

    --accent:        #4cb6b8;
    --accent-tint:   #16363a;
    --accent-strong: #7fd1d2;
    --rail-halo:     #1d3034;
    --rail-line:     #323a44;

    --amber-text:    #d8a558;
    --amber-dot:     #d8a558;
    --amber-chip-bg: #3a2a16;
    --amber-callout-bg: #2a2114;
    --amber-callout-border: #4a3a1e;

    --info-bg:     #19222a;
    --info-border: #2a3640;
    --callout-ink: #c2c9d2;

    --chip-mand-bg: #16363a; --chip-mand-text: #7fd1d2;
    --chip-cond-bg: #3a2a16; --chip-cond-text: #d8a558;
    --chip-opt-bg:  #262d35; --chip-opt-text:  #a3abb3;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); }
.intro a, li.step a, .callout a, .faq-body a, .footer-legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- layout shell ---------------------------------------------- */
.shell { min-height: 100vh; background: var(--bg); }

.main { margin-left: 264px; min-width: 0; }
.content { max-width: 1040px; margin: 0 auto; padding: 0 56px; }

/* ---------- sidebar --------------------------------------------------- */
.side {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 264px;
  background: var(--sidebar);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  z-index: 40;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none;
  padding: 20px 22px;
  border-bottom: 1px solid var(--hairline-soft);
}
.brand-tile {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 600 11px/1 'IBM Plex Mono', monospace;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name .b-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.brand-name .b-sub { font-size: 12px; color: var(--faint); }

.sidenav { flex: 1; overflow: auto; padding: 20px 14px; }
.sidenav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--faintest); padding: 0 10px 10px;
}
.toc-link {
  display: grid; grid-template-columns: 24px 1fr; gap: 11px; align-items: start;
  text-decoration: none; padding: 9px 10px; border-radius: 7px;
  color: var(--ink); background: transparent;
  transition: background .15s ease;
}
.toc-link:hover { background: #f1f4f6; }
.toc-link.active,
.toc-link.active:hover { background: var(--accent-tint); }
.toc-num { font: 500 12px/1.4 'IBM Plex Mono', monospace; color: var(--accent); }
.toc-body { display: flex; flex-direction: column; gap: 1px; }
.toc-title { font-size: 13px; font-weight: 600; }
.toc-sub { font-size: 12px; color: var(--faint); }
.toc-link.simple {
  display: block; padding: 9px 10px; border-radius: 7px;
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.sidenav-divider { height: 1px; background: var(--hairline-soft); margin: 16px 10px; }

.sidefoot { padding: 16px 22px; border-top: 1px solid var(--hairline-soft); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--amber-text);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-dot); }
.sidefoot p { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--faintest); }

/* ---------- hero ------------------------------------------------------ */
.hero { padding: 54px 0 8px; }
.eyebrow { font: 500 12px/1 'IBM Plex Mono', monospace; color: var(--faint); margin-bottom: 22px; }
h1 {
  margin: 0; max-width: 760px;
  font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  color: var(--ink); text-wrap: balance;
}
.lede {
  margin: 20px 0 0; font-size: 17px; line-height: 1.6; color: var(--body);
  text-wrap: pretty;
}

/* ---------- deadline rail --------------------------------------------- */
.rail-card {
  margin: 34px 0 8px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 24px 28px;
}
.rail-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.rail-sub { margin: 0 0 22px; font-size: 13px; color: var(--faint); }
.rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.rail-node { position: relative; padding-right: 14px; }
.rail-dotline { display: flex; align-items: center; margin-bottom: 12px; position: relative; }
.rail-dot {
  width: 11px; height: 11px; border-radius: 50%; background: var(--accent);
  flex: none; box-shadow: 0 0 0 4px var(--rail-halo);
}
.rail-line { flex: 1; height: 2px; background: var(--rail-line); }
.rail-t { font: 500 12px/1 'IBM Plex Mono', monospace; color: var(--accent); margin-bottom: 7px; }
.rail-label { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.rail-node.pre .rail-dot {
  background: transparent; border: 2px solid var(--faint);
  box-shadow: 0 0 0 4px var(--hairline-soft); box-sizing: border-box;
}
.rail-node.pre .rail-line {
  background: none; height: 0;
  border-top: 2px dashed var(--rail-line);
}
.rail-node.pre .rail-t { color: var(--faint); }
.rail-node.pre .rail-label { color: var(--body); }
.rail-annot {
  position: absolute; bottom: calc(100% + 4px); left: 22px; right: 0;
  text-align: center; white-space: nowrap;
  font: 400 11px/1 'IBM Plex Mono', monospace;
  color: var(--faint); letter-spacing: .02em;
}

/* ---------- sections -------------------------------------------------- */
.phase { scroll-margin-top: 24px; padding-top: 56px; }
.phase.divider {
  padding-top: 60px;
  border-top: 1px solid var(--hairline);
  margin-top: 54px;
}
.phase-eyebrow { font: 500 12px/1 'IBM Plex Mono', monospace; color: var(--accent); margin-bottom: 11px; }
.phase-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.phase-tag { font: 500 12px/1 'IBM Plex Mono', monospace; color: var(--accent); }
.chip-deadline {
  font: 500 12px/1 'IBM Plex Mono', monospace;
  padding: 4px 9px; border-radius: 5px;
  background: var(--amber-chip-bg); color: var(--amber-text);
}
h2 {
  margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
.intro { margin: 16px 0 0; font-size: 15.5px; line-height: 1.62; color: var(--body); }

/* section labels (Required data / Procedure / From the platform) */
.seclabel { display: flex; align-items: center; gap: 11px; margin: 36px 0 14px; }
.seclabel.proc { margin: 36px 0 16px; }
.seclabel.shots { margin: 38px 0 16px; }
.seclabel-bar { width: 3px; height: 15px; background: var(--accent); border-radius: 2px; }
.seclabel-text { font-size: 14px; font-weight: 600; color: var(--ink); }
.seclabel-hint { margin-left: auto; font: 400 11px/1 'IBM Plex Mono', monospace; color: var(--faintest); }

/* ---------- data tables ----------------------------------------------- */
.table-wrap {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 10px; overflow: hidden;
}
table.data { width: 100%; font-size: 14px; border-collapse: collapse; }
.col-field { width: 40%; }
.col-status { width: 128px; }
table.data thead tr { background: var(--card-alt); }
table.data th {
  text-align: left; padding: 11px 18px;
  font-size: 12px; font-weight: 600; color: var(--faint);
  border-bottom: 1px solid var(--hairline);
}
table.data th.c-status { padding: 11px 14px; }
table.data td { padding: 12px 18px; vertical-align: top; border-top: 1px solid var(--hairline-soft); }
td.c-field { color: var(--ink); font-weight: 500; }
td.c-status { padding: 12px 14px; }
td.c-note { color: var(--muted); line-height: 1.5; }
tr.group td {
  padding: 8px 18px; background: var(--group-row);
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--accent);
  border-top: 1px solid var(--group-rule); border-bottom: 1px solid var(--group-rule);
}

/* status chips */
.chip {
  display: inline-block; white-space: nowrap;
  font: 500 12px/1.4 'IBM Plex Sans', sans-serif;
  padding: 4px 10px; border-radius: 5px;
}
.chip.mandatory   { background: var(--chip-mand-bg); color: var(--chip-mand-text); }
.chip.conditional { background: var(--chip-cond-bg); color: var(--chip-cond-text); }
.chip.optional    { background: var(--chip-opt-bg);  color: var(--chip-opt-text); }
.chip.carried     { background: var(--card-alt);     color: var(--faint); }
.chip.na          { background: transparent;         color: var(--faintest); border: 1px dashed var(--hairline); padding: 3px 9px; }

/* ---------- guided walkthrough ---------------------------------------- */
ol.walk { margin: 0; padding: 0; list-style: none; counter-reset: wstep; }
li.wstep { padding: 0 0 26px; border-bottom: 1px solid var(--hairline-soft); margin-bottom: 26px; }
li.wstep:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wstep-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.wstep-num {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font: 600 12px/24px 'IBM Plex Mono', monospace; text-align: center;
}
.wstep-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4; }
/* 720px is the measure the field-card bodies already use, so a screenshot
   sits at the guide's reading width rather than the full 928px column */
li.wstep > figure { margin: 0 0 14px; max-width: 720px; }
li.wstep > figure.wide { max-width: 100%; }     /* a wide screen, shown wide: at 720px its type went below the guidance's */
li.wstep > figure.narrow { max-width: 400px; }  /* a zoomed crop: at its own 445px its type towered over the guidance's */
li.wstep > figure figcaption { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--faint); }
.wstep-lede { margin: 0 0 14px; font-size: 14px; line-height: 1.7; color: var(--body); }
.wstep-lede a, .wstep-more a, .ownnote a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.wstep-more { margin: 12px 0 0; font-size: 13px; line-height: 1.6; color: var(--faint); }
li.wstep .table-wrap { margin-bottom: 0; }
li.wstep .callout { margin-top: 14px; }
.ownnote {
  margin: 14px 0 0; padding: 12px 16px; font-size: 14px; line-height: 1.7;
  color: var(--body); background: var(--card-alt);
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
}

/* narrow screens: the three-column field table becomes stacked cards, or the
   prose column ends up one word wide */
@media (max-width: 620px) {
  li.wstep table.data thead { display: none; }
  li.wstep table.data, li.wstep table.data tbody, li.wstep table.data tr, li.wstep table.data td { display: block; width: auto; }
  li.wstep table.data tr { padding: 14px 16px; border-top: 1px solid var(--hairline-soft); }
  li.wstep table.data tr:first-child { border-top: none; }
  li.wstep table.data td { padding: 0; border: none; }
  li.wstep td.c-field { margin-bottom: 8px; }
  li.wstep td.c-status { display: inline-block; margin-bottom: 8px; }
  li.wstep td.c-note { line-height: 1.65; }
  li.wstep .col-field, li.wstep .col-status { width: auto; }
  li.wstep table.data tr.group td { padding: 0; }
  li.wstep table.data tr.group {
    padding: 8px 16px; background: var(--card-alt);
    font: 500 11px/1.4 'IBM Plex Mono', monospace; letter-spacing: .04em;
    text-transform: uppercase; color: var(--faintest);
  }
}

/* ---------- field reference ------------------------------------------- */
.fieldgroup-sub { margin: -6px 0 12px; font-size: 13px; line-height: 1.6; color: var(--faint); }
details.faq.field > summary { gap: 12px; }
.field-chips { display: flex; gap: 6px; flex: 0 0 auto; }
.field-chips .chip { font-size: 11px; padding: 3px 8px; }
.field-src { font: 400 12px/1.5 'IBM Plex Mono', monospace; color: var(--faintest); margin: 0 0 12px; }
.field-gl { color: var(--faint); }
.field-ex { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink); }
.field-foot { font-size: 13px; color: var(--faint); font-style: italic; }
.field-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.field-status .chip { font-size: 11px; padding: 3px 8px; }
a.fieldref {
  display: inline-block; margin-left: 8px; vertical-align: 1px;
  font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--accent);
  text-decoration: none;
  padding: 3px 6px; border-radius: 4px;
  border: 1px solid var(--hairline); background: var(--card-alt);
}
a.fieldref:hover, a.fieldref:focus-visible {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
a.fieldref::after { content: '\2197'; margin-left: 3px; opacity: .55; }

/* the entry a field number lands on, briefly marked so it is findable
   (a box-shadow would be clipped by .faq-wrap's overflow: hidden) */
details.field.flash > summary { background: var(--accent-tint); }
details.field.flash { border-left: 3px solid var(--accent); }
details.field { border-left: 3px solid transparent; transition: border-color .3s ease; }
/* the stage chips wrap under the field name on narrow screens rather than
   disappearing — they are the only place the per-stage status is stated */
@media (max-width: 720px) {
  details.faq.field > summary { flex-wrap: wrap; gap: 10px 16px; }
  .field .faq-qwrap { order: 0; }
  .field .faq-chev { order: 1; }   /* stays on the title's line */
  .field .notemarks { order: 2; flex-basis: 100%; }
  .field .field-chips { order: 3; flex-basis: 100%; }
}

/* ---------- procedure steps ------------------------------------------- */
ol.steps { margin: 0; padding: 0; list-style: none; }
li.step {
  position: relative; padding: 0 0 16px 38px;
  font-size: 14px; line-height: 1.6; color: var(--body);
}
.step-num {
  position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font: 500 12px/1 'IBM Plex Mono', monospace;
}
li.step strong { color: var(--ink); font-weight: 600; }

/* ---------- callouts -------------------------------------------------- */
.callout { margin: 24px 0 0; padding: 16px 18px; border-radius: 10px; }
.callout p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--callout-ink); }
.callout p.lead { margin: 0 0 10px; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout.info  { background: var(--info-bg); border: 1px solid var(--info-border); }
.callout.amber { background: var(--amber-callout-bg); border: 1px solid var(--amber-callout-border); }
.callout.amber strong.lead-in { color: var(--amber-text); }
.callout.neutral { background: var(--card-alt); border: 1px solid var(--hairline); }
.callout ul { margin: 0; padding-left: 18px; }
.callout li { font-size: 13px; line-height: 1.55; color: var(--callout-ink); margin-bottom: 5px; }
.callout li:last-child { margin-bottom: 0; }

/* ---------- screenshot grid ------------------------------------------- */
/* screenshots render at their capture size at most: stretching them past it
   blew the UI type up past the guidance type around it, and made the inline
   image larger than the lightbox, which opens at natural size */
.shot {
  display: block; width: auto; max-width: 100%; height: auto;
  border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--card);
  cursor: zoom-in;
}
/* fallback box when a screenshot is missing */
figure.missing .shot { display: none; }
.imgsrc { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.imgsrc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.shot-ph {
  display: none; width: 100%; aspect-ratio: 16/10;
  border: 1px dashed var(--hairline); border-radius: 8px;
  background: var(--card-alt);
  align-items: center; justify-content: center;
  font: 400 12px/1.4 'IBM Plex Mono', monospace; color: var(--faintest);
  text-align: center; padding: 0 16px;
}
figure.missing .shot-ph { display: flex; }

/* ---------- lightbox -------------------------------------------------- */
#lb {
  position: fixed; inset: 0; z-index: 999;
  display: none; align-items: center; justify-content: center;
  padding: 30px;
  background: rgba(22, 25, 29, .82);
  cursor: zoom-out;
}
#lb[hidden] { display: none; }
#lb.open { display: flex; }
.lb-img {
  max-width: 95%; max-height: 92%;
  border-radius: 8px; background: var(--card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  cursor: default;
}
.lb-cap {
  position: absolute; left: 0; right: 0; bottom: 18px;
  text-align: center;
  font: 400 12px/1.4 'IBM Plex Mono', monospace; color: #dde3ec;
}
.lb-x {
  position: absolute; top: 16px; right: 22px;
  background: none; border: none; padding: 0;
  font: 300 30px/1 'IBM Plex Sans', sans-serif; color: #fff;
  cursor: pointer;
}
.lb-x:hover { color: #fff; opacity: .8; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); border: none; color: #fff;
  font: 300 30px/1 'IBM Plex Sans', sans-serif; cursor: pointer;
  transition: background .15s ease;
}
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
@media (max-width: 560px) {
  .lb-nav { width: 40px; height: 40px; font-size: 24px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* ---------- floating section bar (mobile) ----------------------------- */
.floatbar {
  display: none; /* shown ≤860px via the media query */
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 14px; z-index: 60;
  align-items: center; gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 4px;
  background: var(--sidebar);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: 0 6px 22px rgba(22, 25, 29, .16);
}
.fb-btn {
  flex: none; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 999px;
  font: 400 22px/1 'IBM Plex Sans', sans-serif; color: var(--accent);
  cursor: pointer;
}
.fb-btn:disabled { color: var(--faintest); cursor: default; }
.fb-btn:not(:disabled):active { background: var(--accent-tint); }
.fb-cur {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px;
  border: none; background: none; border-radius: 999px;
  font-family: inherit; color: var(--ink); cursor: pointer;
}
.fb-num { font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--accent); }
.fb-label {
  font-size: 13px; font-weight: 600;
  max-width: 44vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-caret { font-size: 9px; color: var(--faint); transition: transform .2s ease; }
.floatbar.menu-open .fb-caret { transform: rotate(180deg); }

.fb-menu {
  display: none;
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 230px; padding: 6px;
  background: var(--sidebar);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(22, 25, 29, .18);
}
.floatbar.menu-open .fb-menu { display: block; }
.fb-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600;
}
.fb-menu a .fb-mnum {
  flex: none; width: 18px;
  font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--accent);
}
.fb-menu a.active { background: var(--accent-tint); }
.fb-menu a:active { background: #f1f4f6; }

/* ---------- FAQ ------------------------------------------------------- */
.faq-wrap {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 10px; overflow: hidden;
}
details.faq { border-top: 1px solid var(--hairline-soft); }
details.faq:first-child { border-top: none; }
details.faq > summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 16px 20px; font-size: 15.5px; font-weight: 600; color: var(--ink);
}
details.faq > summary::-webkit-details-marker { display: none; }
.faq-chev {
  flex: none; font: 300 22px/1 'IBM Plex Sans', sans-serif; color: var(--accent);
  transition: transform .2s ease;
}
details.faq[open] > summary .faq-chev { transform: rotate(45deg); }
.faq-body { padding: 0 20px 20px; max-width: 720px; }
.faq-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.66; color: var(--body); }
.faq-body p:last-child { margin-bottom: 0; }
.faq-body ul { margin: 2px 0 12px; padding-left: 20px; }
.faq-body li { font-size: 14px; line-height: 1.6; color: var(--body); margin-bottom: 6px; }

/* FAQ items amended with unofficial (Expert Group demo) information */
.faq-qwrap { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.faq-qwrap > span:not([class]) { flex: 1 1 auto; min-width: 0; }
.faq-num {
  flex: none; min-width: 28px;
  font: 500 12px/1 'IBM Plex Mono', monospace; letter-spacing: .02em;
  color: var(--faint);
}
.faq-amend {
  margin-top: 14px; padding: 12px 14px;
  background: var(--amber-callout-bg); border: 1px solid var(--amber-callout-border);
  border-radius: 8px;
}
.amend-label {
  display: block; margin-bottom: 6px;
  font: 600 11px/1 'IBM Plex Mono', monospace; letter-spacing: .03em;
  color: var(--amber-text); text-transform: uppercase;
}
.faq-amend p { margin: 0 0 8px; font-style: italic; font-size: 14px; line-height: 1.6; color: var(--callout-ink); }
.faq-amend p:last-child { margin-bottom: 0; }
.faq-amend ul { margin: 2px 0 8px; padding-left: 20px; }
.faq-amend li { font-style: italic; font-size: 14px; line-height: 1.55; color: var(--callout-ink); margin-bottom: 5px; }

/* ---------- footer ---------------------------------------------------- */
footer.foot { margin-top: 56px; padding: 30px 0 80px; border-top: 1px solid var(--hairline); }
.footer-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
dl.facts { margin: 0 0 28px; display: grid; grid-template-columns: 200px 1fr; gap: 0; }
dl.facts dt { padding: 11px 0; border-top: 1px solid var(--hairline-soft); font-size: 13px; color: var(--faint); }
dl.facts dd { margin: 0; padding: 11px 0; border-top: 1px solid var(--hairline-soft); font-size: 13px; color: var(--ink); font-weight: 500; }
.footer-legal { margin: 0 0 8px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.footer-legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.footer-disc { margin: 0; font-size: 12.5px; color: var(--faintest); }

/* ---------- responsive ------------------------------------------------ */
@media (max-width: 860px) {
  /* sidebar collapses to a clean top bar: brand + status only.
     Phase navigation moves to the floating bar (.floatbar). */
  .side {
    position: static; width: auto; inset: auto; height: auto;
    border-right: none; border-bottom: 1px solid var(--hairline);
    flex-direction: row; align-items: center;
  }
  .side-brand { flex: 1; border-bottom: none; padding: 13px 18px; }
  .sidenav { display: none; }
  .sidefoot { border-top: none; padding: 13px 18px; }
  .sidefoot p { display: none; }
  .main { margin-left: 0; }
  .rail { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .content { padding-left: 24px; padding-right: 24px; }
  h1 { font-size: 31px; }
  .floatbar { display: flex; }
}
@media (max-width: 520px) {
  .rail { grid-template-columns: 1fr 1fr; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { padding-bottom: 0; }
  dl.facts dd { border-top: none; padding-top: 2px; }
}

/* ---------- theme toggle --------------------------------------------- */
.theme-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; margin-bottom: 12px;
  background: transparent; border: 1px solid var(--hairline);
  border-radius: 8px; cursor: pointer;
  color: var(--body); font: 500 12px/1 'IBM Plex Sans', sans-serif;
}
.theme-toggle:hover { background: var(--card-alt); color: var(--ink); }
.theme-toggle-track {
  position: relative; flex: none;
  width: 26px; height: 14px;
  background: var(--hairline); border-radius: 999px;
  transition: background .2s ease;
}
.theme-toggle-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--sidebar);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .2s ease, background .2s ease;
}
.theme-toggle[aria-pressed="true"] .theme-toggle-track { background: var(--accent); }
.theme-toggle[aria-pressed="true"] .theme-toggle-thumb { transform: translateX(12px); }

/* dark-mode screenshot framing: lift white-bg shots off the dark card */
:root[data-theme="dark"] .shot { box-shadow: 0 0 0 1px var(--hairline); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot { box-shadow: 0 0 0 1px var(--hairline); }
}


/* ---------- who may do what: permission cells -------------------------- */
.col-perm { width: 21%; }
th.c-perm { text-align: left; }
td.c-func { font-weight: 500; color: var(--ink); }
.perm {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12.5px/1.3 'IBM Plex Sans', sans-serif;
  padding: 4px 10px 4px 6px; border-radius: 5px; white-space: nowrap;
}
.perm-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 11px; line-height: 1; font-weight: 700;
}
.perm.yes { background: var(--chip-mand-bg); color: var(--chip-mand-text); }
.perm.yes .perm-ic { background: var(--chip-mand-text); color: var(--chip-mand-bg); }
.perm.no  { background: var(--chip-opt-bg);  color: var(--chip-opt-text); }
.perm.no  .perm-ic { background: var(--chip-opt-text); color: var(--chip-opt-bg); }
.perm.req { background: var(--chip-cond-bg); color: var(--chip-cond-text); }
.perm.req .perm-ic { background: var(--chip-cond-text); color: var(--chip-cond-bg); }
.perm.na  { background: transparent; color: var(--faintest); padding-left: 4px; }
.perm.na .perm-ic { width: auto; }
.perm-nalabel { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; }

/* ---------- field reference: cards / full table switch ----------------- */
.viewswitch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 26px 0 18px; padding: 12px 14px;
  background: var(--card-alt); border: 1px solid var(--hairline); border-radius: 8px;
}
.viewswitch-label {
  font: 500 11px/1 'IBM Plex Mono', monospace; letter-spacing: .04em;
  text-transform: uppercase; color: var(--faintest); margin-right: 2px;
}
.vsbtn {
  font: 500 13px/1 'IBM Plex Sans', sans-serif; cursor: pointer;
  padding: 7px 13px; border-radius: 6px;
  border: 1px solid var(--hairline); background: var(--card); color: var(--body);
}
.vsbtn:hover { border-color: var(--accent); color: var(--accent); }
.vsbtn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.viewswitch-hint {
  flex: 1 1 260px; font-size: 12.5px; line-height: 1.5; color: var(--faint);
}

table.fieldtable { font-size: 13px; line-height: 1.55; }
table.fieldtable th, table.fieldtable td { vertical-align: top; }
table.fieldtable .ft-num { width: 44px; }
table.fieldtable .ft-name { width: 17%; }
table.fieldtable .ft-mean { width: 23%; }
table.fieldtable .ft-how { width: auto; }
table.fieldtable .ft-st { width: 136px; }
table.fieldtable td.ft-name strong { display: block; color: var(--ink); }
table.fieldtable .ft-src {
  display: block; margin-top: 5px;
  font: 400 11.5px/1.5 'IBM Plex Mono', monospace; color: var(--faintest);
}
table.fieldtable .ft-sub {
  display: block; margin-top: 8px; font-size: 12.5px; color: var(--faint);
}
table.fieldtable .ft-sub b {
  font: 500 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: .04em;
  text-transform: uppercase; color: var(--faintest); margin-right: 6px;
}
table.fieldtable .ft-sub.note { font-style: italic; }
table.fieldtable .ft-stage { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
table.fieldtable .ft-stage b {
  flex: 0 0 26px;
  font: 500 10.5px/1 'IBM Plex Mono', monospace; color: var(--faintest); text-align: right;
}
table.fieldtable td.ft-st .chip { font-size: 11px; padding: 3px 8px; }
table.fieldtable .faq-num { font: 500 12px/1 'IBM Plex Mono', monospace; color: var(--accent); }
#fieldtable .table-wrap { overflow-x: auto; }

@media (max-width: 860px) {
  table.fieldtable { min-width: 820px; }
}

/* ---------- field cards: structured explanation ------------------------
   Scoped to .field throughout: details.faq, summary and .faq-body are
   shared with the 29 Q&A entries, which this must not touch. */

/* the collapsed row: stage chips carry their stage name, as in the table view */
.field-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
.fchip { display: inline-flex; align-items: center; gap: 5px; }
.fchip > b {
  font: 500 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: .02em;
  color: var(--faintest); font-weight: 500;
}

/* note markers, generated from the card's content by app.js */
.notemarks { display: inline-flex; flex-wrap: wrap; gap: 6px; flex: none; }
.notemark {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 11px/1 'IBM Plex Sans', sans-serif; white-space: nowrap;
  padding: 4px 9px 4px 7px; border-radius: 5px;
}
.notemark-ic { font-size: 11px; line-height: 1; }
.notemark.own { background: var(--accent-tint); color: var(--accent-strong); }
.notemark.src { background: var(--amber-chip-bg); color: var(--amber-text); }

/* the open card, told apart from the closed rows around it */
details.faq.field[open] { border-left-color: var(--accent); background: var(--card-alt); }
details.faq.field[open] > summary { color: var(--ink); }

/* body: one eyebrow per block instead of an inline bold run-in */
.fdef-label {
  display: block; margin-bottom: 5px;
  font: 500 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: .05em;
  text-transform: uppercase; color: var(--faintest);
}
.field .faq-body { padding-top: 4px; }

/* format first: what kind of control this is, in one line */
p.field-format {
  margin: 0 0 16px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 7px;
}
details.faq.field[open] p.field-format { background: var(--card); }
p.field-format > span[data-k] {
  font: 500 13.5px/1.5 'IBM Plex Mono', monospace; color: var(--ink);
}

dl.fdef { margin: 0 0 16px; }
dl.fdef dt {
  margin-bottom: 5px;
  font: 500 10.5px/1 'IBM Plex Mono', monospace; letter-spacing: .05em;
  text-transform: uppercase; color: var(--faintest);
}
dl.fdef dd {
  margin: 0 0 16px; font-size: 14px; line-height: 1.66; color: var(--body);
}
dl.fdef dd:last-child { margin-bottom: 0; }

/* the example reads as quoted, because it is */
figure.field-example {
  margin: 0 0 16px; padding: 10px 14px;
  border-left: 3px solid var(--accent); background: var(--accent-tint);
  border-radius: 0 7px 7px 0;
}
figure.field-example .fdef-label { color: var(--accent-strong); opacity: .8; }
figure.field-example p {
  margin: 0;
  font: 400 13px/1.6 'IBM Plex Mono', monospace; color: var(--ink);
}

/* your own note, last thing in the card */
.field .ownnote { margin: 16px 0 0; }

/* the cross-reference, demoted to a footer line */
.field p.field-src {
  margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid var(--hairline-soft);
}

.field p.field-foot { margin: 0 0 16px; }
.field .faq-amend { margin: 0 0 16px; }

/* open all / close all, one per group */
.seclabel .openall {
  margin-left: auto; cursor: pointer;
  font: 500 11.5px/1 'IBM Plex Sans', sans-serif;
  padding: 5px 10px; border-radius: 5px;
  border: 1px solid var(--hairline); background: var(--card); color: var(--faint);
}
.seclabel .openall:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 720px) {
  /* the summary wraps: title (with the chevron beside it), then the markers,
     then the stage chips — each on its own line rather than fighting for one */
}

/* ---------- abbreviations: hover / focus for the meaning ---------------
   Wrapped by app.js from one definitions map. The tooltip is CSS, not the
   browser's title bubble, so it appears at once and works on focus — which
   a tap gives on a phone, since each abbr is focusable. */
abbr.ab {
  position: relative; cursor: help;
  text-decoration: underline dotted; text-decoration-color: var(--faintest);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  border-radius: 2px;
}
abbr.ab:hover, abbr.ab:focus-visible { text-decoration-color: var(--accent); outline: none; }
abbr.ab:focus-visible { box-shadow: 0 0 0 2px var(--accent-tint); }
abbr.ab::after {
  content: attr(data-def);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(320px, 80vw);
  padding: 8px 11px; border-radius: 7px;
  background: var(--ink); color: var(--bg);
  font: 400 12.5px/1.5 'IBM Plex Sans', sans-serif; text-align: left; white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  display: none; pointer-events: none; z-index: 20;
}
abbr.ab::before {
  content: ''; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
  display: none; pointer-events: none; z-index: 20;
}
abbr.ab:hover::after, abbr.ab:focus-visible::after,
abbr.ab:hover::before, abbr.ab:focus-visible::before { display: block; }

/* a table cell or card near the top of the viewport has no room above;
   the tooltip of an abbr inside a table header or the first table row would
   clip — let those open below instead */
thead abbr.ab::after, tr:first-child abbr.ab::after { bottom: auto; top: calc(100% + 8px); }
thead abbr.ab::before, tr:first-child abbr.ab::before { bottom: auto; top: calc(100% + 3px); border-top-color: transparent; border-bottom-color: var(--ink); }

/* footer list, filled from the same map */
.abbr-hint { margin: -6px 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
#abbrlist { margin-bottom: 28px; }
#abbrlist dt { font: 500 13px/1.5 'IBM Plex Mono', monospace; color: var(--ink); }
#abbrlist dd { font-weight: 400; color: var(--body); line-height: 1.55; }
#abbrlist dd strong { font-weight: 600; color: var(--ink); }
