/* Noctuo: plain CSS, no build step (ADR 0002). A calm, information-dense layout:
   a sidebar with the organisation's sections (purchasing and sales apart), cards,
   readable tables, one badge style. Status is never conveyed by colour alone: every
   badge carries its words.

   The brand (ADR 0024, docs/BRAND.md): "The reader". Coral is the brand's colour, navy
   its ink and its actions, amber a highlight. Every colour is a token below, defined
   once for both themes with light-dark(): the device's theme, or the one a person chose
   (`data-theme` on <html>, set by the server: no flash, no script). */

/* --- Type ------------------------------------------------------------------------------
   Space Grotesk (SIL Open Font License 1.1, static/fonts/OFL.txt) for headings, figures
   and the name: one variable file per script, the Latin one preloaded, the other loaded
   only for a page that needs it. Text stays in the system's own face: nothing to load. */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/space-grotesk-latin.87c506d88b9f.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
                 U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/space-grotesk-latin-ext.0bb2ef2eda4e.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
                 U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens: light-dark(day, night) ---------------------------------------------------- */
:root {
  color-scheme: light dark;
  /* The brand's own colours, the same in both themes */
  --coral: #FF5A4E; --navy: #14213D; --amber: #FFB020;
  /* Surfaces and text (contrast of text on --surface: 15.9:1 and 14.5:1) */
  --bg: light-dark(#F6F7F9, #0D1628);
  --surface: light-dark(#FFFFFF, #14213D);
  --surface-2: light-dark(#F8F9FB, #1A2A4B);
  --text: light-dark(#14213D, #EEF1F7);
  --muted: light-dark(#535D75, #AAB4C8);  /* 6.6:1, 7.6:1 */
  --faint: light-dark(#67718A, #8E9AB2);  /* 4.9:1, 5.6:1 */
  --line: light-dark(#E3E6EC, #26365A);
  --line-strong: light-dark(#CBD1DC, #34476F);
  /* Actions: navy by day, coral by night (button text 15.9:1, 5.8:1) */
  --accent: light-dark(#14213D, #FF6E63);
  --accent-hover: light-dark(#26385F, #FF8378);
  --accent-text: light-dark(#FFFFFF, #14213D);
  /* The brand in the interface: what is current or chosen, links' underline, focus */
  --brand: light-dark(#FF5A4E, #FF6E63);
  --brand-ink: light-dark(#C4362B, #FF8A80);  /* coral as text: 5.4:1, 6.3:1 */
  --accent-soft: light-dark(#FFEDEB, #3A2430);  /* coral's tint behind what is current */
  --link: light-dark(#14213D, #EEF1F7);
  --link-line: light-dark(rgba(20, 33, 61, .3), rgba(238, 241, 247, .32));  /* a hairline in the text's tint */
  --focus: light-dark(#E8473B, #FF8A80);
  /* The two sides */
  --purchase: light-dark(#3F51C6, #9EA8F5); --purchase-soft: light-dark(#ECEEFB, #262C55);
  --sales: light-dark(#0B7D71, #5FD0C2); --sales-soft: light-dark(#E3F4F1, #133A37);
  /* States, always with their words */
  --ok: light-dark(#1E7A4C, #6CC48F); --ok-bg: light-dark(#E7F5EE, #15301F);
  --ok-line: light-dark(#2E8A5A, #6CC48F);
  --warn: light-dark(#8A5A00, #F0C163); --warn-bg: light-dark(#FFF4D6, #33290F);
  --warn-line: light-dark(#C08A00, #E0B54A);
  --err: light-dark(#B42318, #F59089); --err-bg: light-dark(#FDECEA, #3A1716);
  --err-line: light-dark(#C8372D, #F08A83);
  --info-bg: light-dark(#EEF2FA, #1B2A4A); --info-line: light-dark(#3A56B8, #8FA8F0);
  /* The logo's parts (includes/logo_mark.html) */
  --logo-frame: light-dark(#FF5A4E, #FF6E63); --logo-eye: light-dark(#14213D, #FFFFFF);
  --logo-glint: light-dark(#FFFFFF, #14213D); --logo-beak: #FFB020;
  /* Shape and depth */
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 2px light-dark(rgba(20, 33, 61, .06), transparent),
            0 1px 3px light-dark(rgba(20, 33, 61, .05), transparent);
  --shadow-pop: 0 10px 28px light-dark(rgba(20, 33, 61, .14), rgba(0, 0, 0, .45));
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sidebar: 15.5rem;
  /* One height for every control and button, so labels, fields and buttons in a row
     line up; tables use the compact one. */
  --control-h: 2.375rem; --control-h-sm: 2rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* --- Base ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
/* Links (the owner, 2026-12-01: lighter than a coral line): in running text a hairline
   in the text's own tint, coral on hover; where the place itself says "link" (lists,
   tables, the trail), no line until hover. */
a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px;
    text-decoration-color: var(--link-line); text-underline-offset: .22em;
    transition: color .12s ease, text-decoration-color .12s ease; }
a:hover { color: var(--brand-ink); text-decoration-color: currentColor; }
:where(.doc-list, .silence-list, .partner-matches, .ask-list, .story-line, .crumbs, .memory, table) a {
  text-decoration-line: none;
}
:where(.doc-list, .silence-list, .partner-matches, .ask-list, .story-line, .crumbs, .memory, table) a:hover {
  text-decoration-line: underline; text-decoration-color: var(--brand);
}
@media (prefers-reduced-motion: reduce) { a { transition: none; } }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: light-dark(#FFD5D0, #5A2A33); }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2);
       border: 1px solid var(--line); border-radius: 4px; padding: 0 .25rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--surface); padding: .4rem .6rem; z-index: 20; }

/* --- Top bar: the brand's coral line along its top ------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem 1.25rem;
  padding: .55rem 1.25rem .5rem; background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 3px 0 var(--brand);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em;
              line-height: 1; }
/* The mark (includes/logo_mark.html), coloured by the theme. */
.logo-mark { display: block; flex: none; }
.logo-frame { fill: none; stroke: var(--logo-frame); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.logo-eyes { fill: var(--logo-eye); }
.logo-glints { fill: var(--logo-glint); }
.logo-beak { fill: var(--logo-beak); stroke: var(--logo-beak); stroke-width: 2; stroke-linejoin: round; }
/* The logo above the sign-in and invitation forms. */
.brand-hero { display: flex; flex-direction: column; align-items: center; gap: .55rem; margin: .5rem 0 1.5rem;
              color: var(--text); }
.brand-hero-name { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; letter-spacing: -.02em;
                   line-height: 1; }
.orgname { color: var(--muted); font-weight: 600; padding-left: 1rem; border-left: 1px solid var(--line); }
.account { margin-left: auto; position: relative; }
.account summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
                   padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: "▾"; color: var(--faint); font-size: .8rem; }
.who { color: var(--muted); overflow-wrap: anywhere; font-size: .92rem; }
.account-menu { position: absolute; right: 0; top: calc(100% + .35rem); min-width: 15rem;
                display: grid; gap: .1rem; padding: .4rem; background: var(--surface);
                border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: .4rem .6rem;
                border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.account-menu form { margin: 0; }
.account-menu button { height: auto; background: none; border: 0; font: inherit; cursor: pointer; }
/* Theme: System, Light or Dark, for oneself (ADR 0024). */
.account-menu .theme-switch { display: grid; gap: .35rem; margin: .25rem 0; padding: .5rem .6rem;
                              border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.theme-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem; padding: .15rem;
                 border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.account-menu .theme-choices button { text-align: center; padding: .25rem .3rem; border-radius: 999px; font-size: .85rem; }
.account-menu .theme-choices button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text);
                                                           font-weight: 600; }

/* --- Shell: sidebar and content -------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 3.2rem); }
.app.no-nav { grid-template-columns: minmax(0, 1fr); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1rem .75rem 2rem; }
.sidebar .nav-group { margin: 0 0 1.1rem; }
.sidebar .nav-title { margin: 0 0 .3rem; padding: 0 .55rem; font-size: .72rem; font-weight: 700;
                      letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.sidebar .nav-group.purchase .nav-title { color: var(--purchase); }
.sidebar .nav-group.sales .nav-title { color: var(--sales); }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.sidebar a { display: block; padding: .38rem .55rem; border-radius: var(--radius-sm);
             color: var(--text); text-decoration: none; font-size: .95rem; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--brand-ink); font-weight: 650;
                                  box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .purchase a[aria-current="page"] { background: var(--purchase-soft); color: var(--purchase);
                                            box-shadow: inset 3px 0 0 var(--purchase); }
.sidebar .sales a[aria-current="page"] { background: var(--sales-soft); color: var(--sales);
                                         box-shadow: inset 3px 0 0 var(--sales); }
.orgnav { display: block; }

/* The page uses the whole width next to the sidebar: tables, panels and forms grow with
   the screen. Running text keeps a readable line length (below). */
.page { padding: 1.5rem 1.75rem 4rem; min-width: 0; }
.page :where(p:not(.msg), li, .lede) { max-width: 95ch; }
.app.no-nav .page { margin: 0 auto; max-width: 70rem; }

@media (max-width: 60rem) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 1rem .25rem;
             display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
  .sidebar .nav-group { margin-bottom: .6rem; }
  .sidebar ul { display: flex; flex-wrap: wrap; gap: .1rem .25rem; }
  .page { padding: 1.25rem 1rem 3rem; }
  .orgname { display: none; }
}

/* --- Page header -------------------------------------------------------------------- */
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: 1.7rem; line-height: 1.2; letter-spacing: -.02em; margin: .1rem 0 .35rem; font-weight: 700; }
h2 { font-size: 1.18rem; margin: 2rem 0 .75rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; margin: 1.25rem 0 .5rem; font-weight: 600; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
               gap: .75rem 1.5rem; margin: 0 0 1.25rem; }
.page-header h1 { margin-bottom: .2rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions form { margin: 0; }
.eyebrow { margin: 0; font-family: var(--font-display); font-size: .76rem; font-weight: 600; letter-spacing: .08em;
           text-transform: uppercase; color: var(--faint); }
.eyebrow.purchase { color: var(--purchase); }
.eyebrow.sales { color: var(--sales); }
.lede { color: var(--muted); margin: 0 0 1.25rem; max-width: 60rem; }
.page-header .lede { margin: 0; }
.crumbs { margin: 0 0 .75rem; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* --- Messages ---------------------------------------------------------------------- */
.messages { margin: 0; padding: 0; display: grid; gap: .5rem; margin-bottom: 1rem; }
.msg { margin: 0; padding: .6rem .85rem; border: 1px solid var(--line); border-left-width: 4px;
       border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.msg.success { background: var(--ok-bg); border-left-color: var(--ok-line); }
.msg.error { background: var(--err-bg); border-left-color: var(--err-line); }
.msg.warning { background: var(--warn-bg); border-left-color: var(--warn-line); }
.msg.info { background: var(--info-bg); border-left-color: var(--info-line); }
.msg.success::before { content: "✓ "; font-weight: 700; }
.msg.error::before { content: "⚠ "; }
.msg.warning::before { content: "! "; font-weight: 700; }

/* --- Cards and facts ----------------------------------------------------------------- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                box-shadow: var(--shadow); padding: .25rem 1.25rem 1.1rem; margin: 0 0 1.25rem; }
.panel > h2:first-child, .card > h2:first-child { margin-top: .9rem; }
.panel > h3:first-child { margin-top: .9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .6rem; margin: 1rem 0; padding: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
             padding: .55rem .75rem; }
.panel .facts div, .card .facts div { background: var(--surface-2); }
.facts dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.kpis dt a { color: var(--muted); text-decoration: none; }
.kpis dt a:hover { color: var(--brand-ink); text-decoration: underline; }
.kpis dd:first-of-type { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600;
                          font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpis dd.muted { font-size: .8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; }
/* Columns of tiles (Imports): side by side, the columns share their rows (subgrid), so
   every tile has the height of the tallest, and its form sits at the bottom, where the
   fields and buttons line up. One column on narrow screens. */
.tile-columns { display: grid; gap: 0 1.25rem; }
.tile-column > .eyebrow { margin: 0 0 .4rem; }
.tile { display: flex; flex-direction: column; }
.tile > form { margin-top: auto; }
@media (min-width: 56rem) {
  .tile-columns { grid-template-columns: 1fr 1fr; grid-template-rows: auto; grid-auto-rows: 1fr; }
  .tile-column { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
}
.empty { padding: 1.25rem; text-align: center; color: var(--muted); background: var(--surface);
         border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* --- Tables -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line);
              border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 1rem; }
.panel .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-wrap table { border: 0; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .76rem; color: var(--muted); font-weight: 650; text-transform: uppercase;
           letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td form { display: inline-flex; gap: .35rem; align-items: center; margin: 0 .5rem .25rem 0; }
td a:first-child { font-weight: 550; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Forms ----------------------------------------------------------------------------- */
form > div, form p { margin: 0 0 .9rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .93rem; }
td label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 400; }
/* In a table row: the compact height, label, field and buttons on one line. */
td input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), td select,
td button:not(.linklike), td .button { height: var(--control-h-sm); }
td form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 .4rem .3rem 0; }
input[type="email"], input[type="password"], input[type="text"], input[type="search"],
input[type="date"], input[type="number"], input[type="file"], select, textarea {
  font: inherit; line-height: 1.25; color: var(--text); background-color: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  height: var(--control-h); padding: 0 .65rem; margin: 0;
  width: 100%; max-width: 28rem; vertical-align: middle;
}
/* Browsers draw selects and dates at their own heights; these make them follow. */
select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2367718A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center; background-size: .7rem auto;
}
input[type="date"]::-webkit-datetime-edit, input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }
input[type="file"] { height: auto; min-height: var(--control-h); padding: .35rem; background-color: var(--surface-2); }
textarea { height: auto; padding: .45rem .65rem; line-height: 1.5; max-width: 40rem; }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); vertical-align: middle; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
td select { width: auto; }
.helptext, form .helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.errorlist { color: var(--err); margin: .25rem 0; padding-left: 1.1rem; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  height: var(--control-h); padding: 0 .9rem; margin: 0; text-decoration: none; line-height: 1.25;
  white-space: nowrap; vertical-align: middle;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
td button, .secondary, button.secondary, .button.secondary {
  background: var(--surface); color: var(--text); border-color: var(--line-strong);
}
td button:hover, .secondary:hover, button.secondary:hover, .button.secondary:hover {
  background: var(--surface-2); border-color: var(--muted);
}
a.button:hover { color: var(--accent-text); }
a.button.secondary:hover { color: var(--text); }
.linklike { height: auto; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline;
            text-decoration-thickness: 1px; text-decoration-color: var(--link-line); text-underline-offset: .22em;
            font-weight: 400; }
.linklike:hover { background: none; color: var(--brand-ink); text-decoration-color: currentColor; }
.muted { color: var(--muted); font-size: .88rem; }
.search, .filters-bar { display: flex; flex-wrap: wrap; gap: .6rem .75rem; align-items: center;
                        margin: 0 0 1.25rem; padding: .85rem 1rem; background: var(--surface);
                        border: 1px solid var(--line); border-radius: var(--radius); }
/* A filter row: every label, field, button and link is one control high, centred. */
.search > *, .search label { margin: 0; }
.search label, .search > a { display: inline-flex; align-items: center; gap: .4rem;
                             height: var(--control-h); white-space: nowrap; }
.search label { font-size: .8rem; color: var(--muted); }
.search input:not([type="checkbox"]):not([type="radio"]), .search select { width: auto; min-width: 10rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; align-items: center; }
.actions form { margin: 0; }
.mapping fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1rem;
                    padding: .5rem 1rem 1rem; background: var(--surface); }
.mapping legend { font-weight: 650; padding: 0 .35rem; }
.field { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: .25rem .75rem; align-items: center; margin: .35rem 0; }
.field > label { margin: 0; }
.field .errorlist { grid-column: 2; }
@media (max-width: 40rem) { .field { grid-template-columns: 1fr; } }
.correction { display: grid; gap: .6rem; max-width: 42rem; }
.correction label { display: block; }
.correction input, .correction select, .correction textarea { width: 100%; max-width: none; }
.decision { display: grid; gap: .45rem; min-width: 16rem; flex: 1; }
.decision textarea { max-width: none; }

/* --- Navigation within a list --------------------------------------------------------------- */
.pager, .revisions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .75rem 0; }
.pager a { padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
           background: var(--surface); text-decoration: none; }
.revisions a { padding: .1rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface); }
.revisions a[aria-current="page"] { border-color: var(--accent); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.filters a { padding: .3rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px;
             background: var(--surface); text-decoration: none; color: var(--text); font-size: .92rem; }
.filters a[aria-current] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.pairs { list-style: none; padding: 0; margin: .5rem 0 .75rem; display: grid; gap: .35rem; }
.pairs li form { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; margin: .2rem 0; }

/* The confirmation entry form: one row per line */
table.entry td { padding: .25rem .3rem; }
table.entry input, table.entry select { min-width: 4.5rem; width: 100%; padding: 0 .35rem; }
table.entry select { padding-right: 1.6rem; background-position: right .4rem center; }
table.entry input[name$="-delivery"] { min-width: 9rem; }
table.entry input[name$="-item_code"], table.entry input[name$="-supplier_item_code"] { min-width: 7rem; }

/* --- Badges: state, severity, level, flags (always with their words) -------------------------- */
.state, .sev, .level, .flag, .tag {
  display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .5rem; border-radius: 999px;
  font-size: .78rem; font-weight: 650; border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); white-space: nowrap; line-height: 1.5;
}
.sev-critical, .level-critical, .state-review_required, .state-failed, .state-quarantined, .state-unknown {
  background: var(--err-bg); border-color: var(--err-line); color: var(--err);
}
.sev-warning, .level-review, .flag, .state-needs_mapping, .state-refused, .state-sending,
.state-partly_applied, .state-not_applied {
  background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn);
}
.state-approved, .state-reconciled_clean, .state-completed, .state-applied, .flag-fixed, .state-created {
  background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok);
}
.sev-info, .level-approve, .state-rejected, .state-superseded, .state-withdrawn, .state-duplicate, .state-existing {
  color: var(--muted);
}
.state-withdrawn { text-decoration: line-through; }
.sev-critical::before, .level-critical::before { content: "●"; font-size: .6rem; }
a.flag { text-decoration: none; }
a.flag:hover, a.flag:focus-visible { text-decoration: underline; }
.tag.purchase { background: var(--purchase-soft); border-color: transparent; color: var(--purchase); }
.tag.sales { background: var(--sales-soft); border-color: transparent; color: var(--sales); }

/* --- The review workspace: the document beside the lines (slice 4.1) ------------------------ */
.page-text { margin: .5rem 0; }
.page-text pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .82rem;
                 background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                 padding: .75rem; max-height: 30rem; overflow: auto; margin: 0; }
.page-images { display: grid; gap: 1rem; }
.page-image { display: block; width: 100%; max-width: 60rem; height: auto; border: 1px solid var(--line);
              border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
@media (min-width: 75rem) {
  .workspace { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
  .workspace-doc { position: sticky; top: 4rem; max-height: calc(100vh - 5rem); overflow: auto; }
}
.workspace-doc .page-image { margin-bottom: 1rem; }

/* --- First steps, help ----------------------------------------------------------------------- */
.steps { padding-left: 1.25rem; display: grid; gap: .6rem; margin: .5rem 0; }
.guide { max-width: 48rem; }
.guide h2 { margin-top: 2.25rem; }
.guide nav ol { columns: 2; }
@media (max-width: 40rem) { .guide nav ol { columns: 1; } }

/* The overview's two sides (ADR 0016): one block each, marked by its colour. */
.side-block { margin: 1.5rem 0; padding-left: 1rem; border-left: 4px solid var(--line); }
.side-block.purchase { border-left-color: var(--purchase); }
.side-block.sales { border-left-color: var(--sales); }
.side-block > h2 { margin: 0 0 .5rem; }
.side-block > h2 .eyebrow { font-size: .95rem; }
.side-block .grid-2 { margin-bottom: 1.25rem; }
.side-block .panel > h3:first-child { margin-top: .9rem; }

/* --- Starting with a document (ADR 0019) ------------------------------------------------------ */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar .nav-start { margin: 0 0 1.1rem; }
.sidebar .nav-start a.button { display: flex; width: 100%; color: var(--accent-text); background: var(--accent); font-weight: 650; }
.sidebar .nav-start a.button[aria-current="page"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.upload-panel { padding-top: 1.1rem; }
/* The file field is the drop target itself: a browser takes a dropped file on it, and it
   shows the names chosen, with no script. */
.dropzone { display: grid; gap: .35rem; padding: 1.1rem; border: 2px dashed var(--line-strong);
            border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-weight: 650; font-size: 1.05rem; }
.dropzone input[type="file"] { width: 100%; max-width: none; height: auto; padding: 1.4rem .75rem;
                               border: 1px solid var(--line); border-radius: var(--radius-sm);
                               background: var(--surface); cursor: pointer; }
.kinds { border: 0; padding: 0; margin: 1rem 0 .25rem; display: grid; gap: .5rem;
         grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.kinds legend { font-weight: 650; padding: 0; margin-bottom: .5rem; }
.kind { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; cursor: pointer;
        border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.kind input { margin-top: .2rem; }
.kind > span { display: grid; gap: .1rem; }
.kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind.purchase:has(input:checked) { border-color: var(--purchase); background: var(--purchase-soft); }
.kind.sales:has(input:checked) { border-color: var(--sales); background: var(--sales-soft); }
.kind-choice { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 0; }
.kind-choice form { margin: 0; }

/* --- The steps under the top bar (ADR 0019) ---------------------------------------------------
   Five equal columns; the line between two steps runs through their dots, green once the
   step before it is done. Each step: its dot, its name, a note of up to two lines. */
.flowbar { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, 68rem) minmax(0, 1fr);
           align-items: center; column-gap: 1rem; padding: .7rem 1.75rem .55rem;
           background: var(--surface); border-bottom: 1px solid var(--line); }
/* The band runs under the top bar across the window, but its steps centre on the page
   beside the sidebar, on the same line as the page's own content. */
@media (min-width: 60.01rem) { .flowbar:has(+ .app:not(.no-nav)) { padding-left: calc(var(--sidebar) + 1.75rem); } }
@media (max-width: 60rem) { .flowbar { padding-inline: 1rem; } }
.flowbar.purchase { box-shadow: inset 4px 0 0 var(--purchase); }
.flowbar.sales { box-shadow: inset 4px 0 0 var(--sales); }
/* The side (Purchasing, Sales): a large label at the band's left (the owner, 2026-12-01),
   above the sidebar and in line with its button, out of the steps' grid so they stay
   centred on the page. */
.flowbar { position: relative; }
.flow-side { grid-column: 1; justify-self: start; }
.flowbar .flow-side { gap: .6rem; padding: .5rem 1rem; border-radius: var(--radius); font-family: var(--font-display);
                      font-size: 1.25rem; font-weight: 700; letter-spacing: -.005em; line-height: 1.2; }
.flowbar .flow-side::before { content: ""; flex: none; width: .65rem; height: .65rem; border-radius: 50%;
                              background: currentColor; }
@media (min-width: 60.01rem) {
  .flowbar:has(+ .app:not(.no-nav)) .flow-side { position: absolute; grid-column: auto; left: .75rem; top: 50%;
                                                 transform: translateY(-50%); width: calc(var(--sidebar) - 1.5rem); }
}
.flow { grid-column: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        list-style: none; margin: 0; padding: 0; min-width: 0; }
.flow-step { position: relative; min-width: 0; }
.flow-step + .flow-step::before { content: ""; position: absolute; top: calc(.2rem + .875rem - 1px);
                                  left: calc(-50% + 1.15rem); right: calc(50% + 1.15rem); height: 2px;
                                  border-radius: 2px; background: var(--line-strong); }
.flow-step.done + .flow-step::before { background: var(--ok-line); }
.flow-link { display: grid; justify-items: center; align-content: start; gap: .2rem; text-align: center;
             padding: .2rem .4rem .3rem; border-radius: var(--radius); color: var(--muted); text-decoration: none; }
a.flow-link:hover { background: var(--surface-2); }
a.flow-link:hover .flow-label { text-decoration: underline; text-underline-offset: 2px; }
.flow-dot { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem;
            border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface);
            font-size: .8rem; font-weight: 700; color: var(--muted); line-height: 1; }
.flow-label { font-size: .88rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.flow-note { font-size: .74rem; line-height: 1.3; color: var(--muted); max-width: 14rem; overflow: hidden;
             display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.flow-step.done .flow-dot { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.flow-step.current .flow-dot { border-color: var(--brand); color: var(--brand-ink); }
.flow-step.blocked .flow-dot { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.flow-step.blocked .flow-label, .flow-step.blocked .flow-note { color: var(--warn); }
.flow-step.todo .flow-label { color: var(--muted); font-weight: 500; }
.flow-step.skipped .flow-dot { border-style: dashed; }
.flow-step.skipped .flow-label { color: var(--muted); font-weight: 500; }
.flow-step.here .flow-dot { background: var(--brand); border-color: var(--brand); color: var(--navy);
                            box-shadow: 0 0 0 4px var(--accent-soft); }
.flow-step.here.blocked .flow-dot { background: var(--warn-line); border-color: var(--warn-line); color: var(--surface);
                                    box-shadow: 0 0 0 4px var(--warn-bg); }
.flow-step.here .flow-label { color: var(--brand-ink); font-weight: 700; }
.flow-step.here.blocked .flow-label { color: var(--warn); }
.flow-compact { grid-column: 1 / -1; display: none; margin: 0; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 650; color: var(--brand-ink); }
.flow-compact .flow-dot { width: 1.5rem; height: 1.5rem; background: var(--brand); border-color: var(--brand); color: var(--navy); }
@media (max-width: 56rem) { .flow-note { display: none; } .flow-label { font-size: .8rem; } .flow-side { display: none; } }
@media (max-width: 36rem) { .flow { display: none; } .flow-compact { display: flex; } }

/* The next step on a document's page, and a step in a list. */
.next-step { border-left: 4px solid var(--brand); }
.next-step.blocked { border-left-color: var(--warn-line); }
.next-step.done { border-left-color: var(--ok-line); }
.next-step h2 { margin-top: .2rem; }
.next-step .eyebrow { margin-top: .9rem; color: var(--brand-ink); }
.next-step.blocked .eyebrow { color: var(--warn); }
.next-step.done .eyebrow { color: var(--ok); }
.step-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.step-badge .flow-dot { width: 1.35rem; height: 1.35rem; font-size: .7rem; border-width: 1.5px; }
.step-badge.current .flow-dot { border-color: var(--brand); color: var(--brand-ink); }
.step-badge.blocked { color: var(--warn); }
.step-badge.blocked .flow-dot { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.step-badge.done .flow-dot { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

/* --- Feedback ----------------------------------------------------------------------------------- */
.feedback-form textarea { width: 100%; max-width: 48rem; }
.state-sent { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.state-waiting { color: var(--muted); }

/* --- v2: the upload at the centre of the first page --------------------------------------------
   One round drop target, the kind as a single row under it, the latest documents below.
   Dropping anywhere on the page uploads (static/js/start.js); without the script, a form. */
/* One rhythm, every gap set here (the owner, 2026-12-01: more room, truly centred): the
   title and its line close together, then the orb, the kind and the fine print each
   apart. The orb's ring is drawn outside its box, so the orb keeps that much margin. */
.launch { display: grid; justify-items: center; text-align: center; gap: 0; padding: 3rem 0 2.25rem; }
.launch-title { font-size: clamp(1.9rem, 3.2vw, 2.6rem); letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.launch-lede { color: var(--muted); font-size: 1.05rem; line-height: 1.55; max-width: 44ch; margin: 1rem auto 0;
               text-wrap: balance; }
.launch-note { text-align: left; max-width: 46rem; margin-top: 1.5rem; }
.launch-form { display: grid; justify-items: center; gap: 2.25rem; width: 100%; margin-top: 2.5rem; }
.orb { position: relative; display: grid; place-items: center; align-content: center; gap: .5rem; margin: 13px;
       width: min(21rem, 78vw); aspect-ratio: 1; border-radius: 50%; padding: 2.4rem; cursor: pointer;
       background: radial-gradient(circle, var(--surface) 0 55%, color-mix(in srgb, var(--brand) 8%, var(--surface)) 100%);
       border: 2px dashed var(--line-strong);
       box-shadow: 0 0 0 12px var(--surface-2), 0 0 0 13px var(--line), var(--shadow);
       transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.orb:hover { border-color: var(--brand); }
.orb:focus-within { outline: 3px solid var(--focus); outline-offset: 18px; }
.orb-icon { color: var(--brand-ink); display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%;
            background: color-mix(in srgb, var(--brand) 15%, var(--surface)); margin-bottom: .35rem; }
.orb-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.25; }
.orb-sub { font-size: .85rem; color: var(--muted); max-width: 15rem; line-height: 1.45; text-wrap: balance; }
.orb-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.is-dragging .orb { transform: scale(1.04); border-style: solid; border-color: var(--brand);
                    box-shadow: 0 0 0 16px var(--accent-soft), 0 0 0 17px var(--brand), var(--shadow); }
.is-sending .orb { opacity: .55; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .orb { transition: none; } .is-dragging .orb { transform: none; } }
/* What the document is: the options at their own widths; each sits centred in the bar,
   with no form label's bottom margin (the owner, 2026-12-01: vertical centring). */
.segmented { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2rem;
             margin: 0; padding: .3rem; min-inline-size: 0;
             border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.segmented label { position: relative; display: block; margin: 0; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: .45rem .95rem; border-radius: 999px; font-size: .9rem; line-height: 1.3;
                  color: var(--muted); cursor: pointer; }
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.segmented .purchase input:checked + span { background: var(--purchase); color: var(--accent-text); }
.segmented .sales input:checked + span { background: var(--sales); color: var(--accent-text); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.js .no-js-only { display: none; }
.launch-actions { display: flex; gap: .8rem; align-items: center; justify-content: center; }
/* With the script, the row only shows while a file uploads: no empty gap otherwise. */
.js .launch-actions:has(.launch-status:empty) { display: none; }
.launch-status { font-weight: 600; color: var(--brand-ink); }
.launch-fine { font-size: .82rem; color: var(--faint); margin: 0 auto; text-wrap: balance; }
.launch-form .launch-fine { margin-top: -.5rem; }  /* with the form: 1.75rem below the kind */
.launch > .launch-fine { margin-top: .6rem; }  /* the ERP's last read, just under it */
/* The night shift and the latest documents: as wide as the page allows, up to a width
   that still reads as one list. Their rows share columns (subgrid), so every row's kind,
   step and time start at the same place whatever the words in the row before. */
.recent { max-width: 80rem; margin: 1.5rem auto 0; }
.recent h2 { margin-top: 0; }
.doc-list { list-style: none; margin: 0 0 .8rem; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
            background: var(--surface); box-shadow: var(--shadow);
            display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(0, 1.7fr) auto; gap: 0 1rem; }
.doc-list > li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: .4rem; max-width: none;
                 align-items: center; padding: .65rem .95rem; border-top: 1px solid var(--line); }
.doc-list li:first-child { border-top: 0; }
.doc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 46rem) { .doc-list { grid-template-columns: minmax(0, 1fr) auto; } .doc-step { grid-column: 1 / -1; } }
.forward { display: grid; justify-items: center; gap: .35rem; margin-top: 2.25rem; padding: .9rem 1.1rem; max-width: 40rem;
           border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.forward p { margin: 0; }
.forward-title { font-weight: 600; }
.forward-address { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; }
.forward-address code { font-size: .92rem; padding: .25rem .5rem; overflow-wrap: anywhere; }
.forward-address .copy { height: var(--control-h-sm); }
.forward-change { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; align-items: baseline; margin: 0; }

/* --- v2: the night shift, under the upload (V2.3) --------------------------------------------- */
.briefing { max-width: 80rem; margin: 1.6rem auto 0; display: grid; gap: .9rem; }
.briefing-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; }
.briefing-head h2 { margin: 0; }
.briefing-head p { margin: 0; }
.briefing-quiet { margin: 0; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
/* Two counts, then one tile for the money at stake, every currency side by side (they
   wrap inside the tile rather than overflow it). */
.tally { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.tally.with-stakes { grid-template-columns: repeat(2, minmax(8.5rem, 1fr)) minmax(0, 3fr); }
.tally > div { display: grid; align-content: start; gap: .15rem; min-width: 0; padding: .8rem 1rem;
               border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tally b { font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; line-height: 1.2;
           font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally-amounts { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }
.tally-amounts small { font-size: .8rem; font-weight: 650; letter-spacing: .03em; color: var(--muted); }
.tally-label { color: var(--muted); font-size: .85rem; }
@media (max-width: 44rem) { .tally.with-stakes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tally-stakes { grid-column: 1 / -1; } }
.clean-all { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin: 0;
             padding: .8rem 1rem; border: 1px solid var(--ok-line); border-radius: var(--radius); background: var(--ok-bg); }
.clean-all p { margin: 0; }
.clean-all strong { color: var(--ok); }
/* One column of tags for every row (subgrid): the titles line up, the tags are as wide
   as the widest. */
.needs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .45rem .8rem; }
.needs > li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; max-width: none; }
.needs a { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: .4rem; align-items: center; padding: .65rem .85rem;
           border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.needs a:hover { border-color: var(--accent); }
.need-what { display: grid; gap: .05rem; min-width: 0; }
.need-what .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need-tag { min-width: 5.5rem; text-align: center; font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px;
            font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.need-tag.critical { border-color: var(--err-line); background: var(--err-bg); color: var(--err); }
.needs .tag { justify-self: end; }
@media (max-width: 34rem) { .needs { grid-template-columns: minmax(0, 1fr) auto; } .need-tag { grid-column: 1 / -1; justify-self: start; } }
.morning-toggle { margin: 0; font-size: .88rem; }

/* --- v2: deciding difference by difference (V2.4) --------------------------------------------- */
.dcards { display: grid; gap: 1rem; max-width: 38rem; }
.dcard { margin: 0; padding: 1.1rem 1.2rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
         box-shadow: var(--shadow); display: grid; gap: .8rem; }
.dcard.critical { border-top: 4px solid var(--err-line); }
.dcard.warning { border-top: 4px solid var(--warn-line); }
.dcard legend { display: grid; gap: .1rem; padding: 0; float: left; width: 100%; }
.dcard legend + * { clear: both; }
.dcard-where { font-size: .82rem; color: var(--muted); }
.dcard-what { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.dcard-versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .6rem; align-items: stretch; }
.dcard-versus > div { padding: .6rem .75rem; border-radius: 10px; border: 1px solid var(--line); display: grid; gap: .1rem; }
.dcard-versus .ours { background: var(--surface-2); }
.dcard-versus .theirs { background: var(--warn-bg); border-color: var(--warn-line); }
.dcard-versus small { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dcard-versus b { font-size: 1.3rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dcard-versus .arrow { align-self: center; color: var(--muted); }
.dcard-impact { margin: 0; }
.dcard-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dcard-answers label { position: relative; }
.dcard-answers input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dcard-answers span { display: grid; justify-items: center; gap: .15rem; padding: .65rem .4rem; border: 1px solid var(--line-strong);
                      border-radius: 10px; font-weight: 600; text-align: center; cursor: pointer; background: var(--surface); }
.dcard-answers kbd { font-family: var(--mono); font-size: .72rem; color: var(--muted); font-weight: 400; }
.dcard-answers input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dcard-answers input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.dcard-answers .off span { opacity: .45; cursor: not-allowed; }
.deck-end { max-width: 38rem; margin-top: 1rem; }
.deck-summary { font-weight: 600; margin: 0; }
.is-deck .dcard { min-height: 17rem; }
.message-body { width: 100%; max-width: 46rem; font-family: var(--mono); font-size: .88rem; }
@media (max-width: 30rem) { .dcard-answers { grid-template-columns: 1fr; } }

/* --- v2: the red pen on the document (V2.5) ---------------------------------------------------- */
.pen-page { position: relative; margin: 0 0 1rem; }
.pen-page .page-image { margin-bottom: 0; }
.pen-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pen-notes { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.pen-notes li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: start; padding: .55rem .7rem;
                border: 1px solid #e6cf6a; border-radius: var(--radius-sm); background: #fff4c2; color: #3d3100; }
.pen-notes li div { display: grid; gap: .1rem; }
.pen-n { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #d2281f; color: #fff;
         font-weight: 700; font-size: .78rem; }
.pen-key { font-weight: 700; }
.pen-key.ok { color: var(--ok); }
.pen-key.differs { color: var(--err); }
.pen-key.check { color: var(--warn); }

/* --- v2: ask the owl, in the top bar (V2.6) ---------------------------------------------------- */
.ask-field { position: relative; flex: 0 1 22rem; min-width: 10rem; margin: 0 0 0 auto; }
.ask-field input { width: 100%; height: var(--control-h-sm); padding: 0 4.2rem 0 .75rem; border-radius: 999px;
                   border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: .9rem; }
.ask-field input:focus { background: var(--surface); }
.ask-key { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: .7rem;
           color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; pointer-events: none; }
.ask-field ~ .account { margin-left: 0; }
@media (max-width: 40rem) { .ask-key { display: none; } .ask-field input { padding-right: .75rem; } }
.ask-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; }
.ask-groups h2 { margin-top: 0; }
.ask-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }

/* --- v2: the sparks (V2.7) ---------------------------------------------------------------------- */
.memory { display: grid; gap: .2rem; margin: 0 0 1rem; padding: .7rem .9rem; max-width: 38rem; border: 1px solid var(--line);
          border-radius: var(--radius); background: var(--surface-2); }
.memory-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.memory meter { width: 7rem; height: .7rem; }
.story-line { list-style: none; margin: 0 0 1.5rem; padding: 0 0 0 1rem; border-left: 2px solid var(--line-strong); display: grid; gap: .55rem; }
.story-line li { position: relative; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .8rem; }
.story-line li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .45rem; width: 10px; height: 10px; border-radius: 50%;
                         background: var(--surface); border: 2px solid var(--line-strong); }
.story-line .story-order::before { border-color: var(--brand); }
.story-line .story-received::before { border-color: var(--warn-line); }
.story-line .story-decided::before { border-color: var(--ok-line); background: var(--ok-bg); }
.story-line .story-erp::before { border-color: var(--purchase); }
.story-line time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .88rem; }
@media (max-width: 34rem) { .story-line li { grid-template-columns: 1fr; gap: 0; } }
.silence { display: grid; gap: .45rem; }
.silence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.silence-list > li { max-width: none; }
.silence-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem; padding: .55rem .85rem;
                   border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
/* The office wallboard: calm, large, readable from across the room. */
body.wall { background: var(--bg); color: var(--text); min-height: 100vh; }
.wall-main { max-width: 90rem; margin: 0 auto; padding: 2.5rem max(16px, 3vw) 2rem; display: grid; gap: 2.5rem; }
.wall-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.wall-brand { display: inline-flex; align-items: center; gap: .8rem; font-family: var(--font-display); font-size: 1.6rem;
               font-weight: 700; color: var(--text); }
.wall-brand img { border-radius: 8px; }
.wall-time { font-size: 1.4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wall-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; }
.wall-figures div { padding: 1.4rem 1.6rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: .3rem; }
.wall-figures b { font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5rem); font-weight: 600; line-height: 1;
                  color: var(--text); font-variant-numeric: tabular-nums; }
.wall-figures span { font-size: 1.2rem; color: var(--muted); }
.wall-figures .late b { color: var(--amber); }
.wall-orders h1 { color: var(--text); font-size: 1.5rem; margin: 0 0 1rem; }
.wall-dots { display: flex; flex-wrap: wrap; gap: .55rem; max-width: none; margin: 0; }
.dot { display: inline-block; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--line-strong); vertical-align: middle; }
.dot.done { background: var(--ok); }
.dot.late { background: var(--amber); box-shadow: 0 0 12px rgba(255, 176, 32, .55); }
.wall-key { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: 1.1rem; color: var(--muted); max-width: none; }
.wall-key .dot { width: 1rem; height: 1rem; }
.wall-fine { color: var(--muted); font-size: .9rem; }
.wall-fine a { color: var(--link); }

/* --- Choosing or creating a draft's partner (ADR 0023) ------------------------------------------ */
.partner-matches { list-style: none; margin: .25rem 0 1rem; padding: 0; display: grid; gap: .3rem; }
.partner-matches li { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.another-partner { margin: -.5rem 0 1.25rem; }
.another-partner summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin-bottom: .5rem; }
/* A line's number in a draft's table, as on the page beside it (ADR 0023). */
.row-n { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .2rem; border-radius: 999px;
         background: var(--accent); color: var(--accent-text); font-size: .74rem; font-weight: 700; }
.start-over { margin: .5rem 0; }
.start-over summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.start-over form { margin: .5rem 0 .25rem; }
