/* eBoss — one stylesheet, no build step. */

/* Colours. Light is the default; dark applies when the device prefers it
   (unless the person chose Light in the menu) or when they chose Dark.
   Chart colours (--series-*, --track, --critical) come from the data-viz
   reference palette, validated for both surfaces. */

:root {
  --page: #ffffff;
  --bg: #f5f6f7;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6878;
  --border: #e3e5e8;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --accent-soft: #e7effb;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf1d8;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --focus: #1f5fbf;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --track: #e8e7e3;
  --critical: #d03b3b;
  --logo-filter: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #121212;
    --bg: #222221;
    --surface: #1a1a19;
    --text: #f0efec;
    --muted: #a9a89f;
    --border: #34332f;
    --accent: #7aa7ff;
    --accent-text: #0d1420;
    --accent-soft: #1d2b44;
    --ok: #6fd39b;
    --ok-soft: #173325;
    --warn: #f0c060;
    --warn-soft: #3a2e14;
    --bad: #ff8a80;
    --bad-soft: #3d1c1a;
    --focus: #7aa7ff;
    --shadow: none;
    --series-1: #3987e5;
    --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --track: #383835;
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page: #121212;
  --bg: #222221;
  --surface: #1a1a19;
  --text: #f0efec;
  --muted: #a9a89f;
  --border: #34332f;
  --accent: #7aa7ff;
  --accent-text: #0d1420;
  --accent-soft: #1d2b44;
  --ok: #6fd39b;
  --ok-soft: #173325;
  --warn: #f0c060;
  --warn-soft: #3a2e14;
  --bad: #ff8a80;
  --bad-soft: #3d1c1a;
  --focus: #7aa7ff;
  --shadow: none;
  --series-1: #3987e5;
  --series-2: #d95926;
  --track: #383835;
  --logo-filter: invert(1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` always wins over a component's own display. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin-top: 1.25rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Layout */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 16px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.topbar-start { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.topbar-end { display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; }
.logo { display: block; height: 40px; width: auto; filter: var(--logo-filter); }
.logo.keep-colours { filter: none; }
.wordmark { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; white-space: nowrap; }

/* Menus are <details>: they open and close without JavaScript. A drop-down
   per module on the left, and the account menu on the right. */
.menu { position: relative; }
.menu summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { border-color: var(--muted); }
.menu-icon { width: 1.25rem; height: 1.25rem; }
.menu-label { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  z-index: 10;
  width: min(18rem, calc(100vw - 32px));
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(16 24 40 / 14%);
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.menu-panel li a:hover { background: var(--bg); }
.menu-panel li a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.theme-choice { margin: 0.4rem 0 0; padding: 0.6rem 0.75rem 0.4rem; border-top: 1px solid var(--border); display: grid; gap: 0.4rem; }
.theme-choice div { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.theme-choice button { padding: 0.35rem 0; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 0.875rem; cursor: pointer; }
.theme-choice button + button { border-left: 1px solid var(--border); }
.theme-choice button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu-signout { margin: 0.4rem 0 0; padding: 0.5rem 0.75rem 0.25rem; border-top: 1px solid var(--border); }

.module-nav { display: flex; align-items: center; gap: 0.15rem; }
.module-menu summary { gap: 0.3rem; padding: 0.35rem 0.6rem; border-color: transparent; background: transparent; font-weight: 600; white-space: nowrap; }
.module-menu summary:hover, .module-menu[open] summary { border-color: transparent; background: var(--bg); }
.module-menu.current summary { color: var(--accent); background: var(--accent-soft); }
.caret { width: 1rem; height: 1rem; transition: transform 0.15s; }
.module-menu[open] .caret { transform: rotate(180deg); }
.module-menu .menu-panel { width: max-content; min-width: 12rem; max-width: calc(100vw - 32px); }
.account-menu .menu-panel { left: auto; right: 0; }
.account-menu .theme-choice { margin-top: 0; border-top: 0; }
.phone-modules { display: none; }
.menu-heading { margin: 0.5rem 0 0.1rem; padding: 0 0.75rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Not enough room for a drop-down per module: list them in the account menu. */
@media (max-width: 900px) {
  .module-nav { display: none; }
  .phone-modules { display: block; }
  .account-menu .theme-choice { margin-top: 0.4rem; border-top: 1px solid var(--border); }
  .account-menu .menu-panel { max-height: calc(100vh - 5rem); overflow-y: auto; }
}

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

.impersonation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 16px;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.impersonation form { margin: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head p { margin: 0.25rem 0 0; max-width: 70ch; }
.crumbs { margin: 0 0 0.5rem; font-size: 0.9rem; }
.crumbs a::before { content: "← "; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.narrow { max-width: 28rem; margin: 3rem auto; }
.columns { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.columns > .card { margin-bottom: 0; }
.columns + .card { margin-top: 1.25rem; }

/* Text */

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.lead { font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--muted); margin: 0; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
blockquote { margin: 0.25rem 0 0; padding-left: 0.75rem; border-left: 3px solid var(--border); color: var(--muted); }

.error, .notice { padding: 0.75rem 1rem; border-radius: var(--radius); margin: 0 0 1.25rem; }
.error { background: var(--bad-soft); color: var(--bad); border: 1px solid currentColor; }
.notice { background: var(--warn-soft); color: var(--warn); }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--muted); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.approve { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.button.reject { color: var(--bad); border-color: var(--bad); }
.button.small { min-height: 2rem; padding: 0.25rem 0.7rem; font-size: 0.875rem; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.row-actions form { margin: 0; }
.button.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Forms */

label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
label .muted { font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 400; }
label.check input { width: auto; min-height: 0; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 0.9rem; align-content: start; }
legend { font-weight: 700; margin-bottom: 0.75rem; padding: 0; }
.stack { display: grid; gap: 0.9rem; }
.form-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.new-vendor { display: grid; gap: 0.75rem; padding: 0.9rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.new-vendor p { margin: 0; }
.alias-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.4rem; }
.alias-list form { display: flex; gap: 0.75rem; align-items: baseline; margin: 0; }
.backup-key code { display: block; padding: 0.75rem 1rem; font-size: 1.05rem; word-break: break-all; background: var(--track); border-radius: var(--radius); user-select: all; }
.backup-ready { border-color: var(--accent); }
.form-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.prefixed { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin: 0.75rem 0; }
.inline-form label { flex: 1 1 12rem; }
.inline-form label.check { flex: 0 0 auto; min-height: 2.5rem; }
.decision { border-left: 4px solid var(--accent); }
.decision label { margin-bottom: 0.75rem; }

/* Tables */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.65rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td form { margin: 0; }
.actions-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }

/* Status */

.badge, .chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  vertical-align: middle;
}
h1 .badge { font-size: 0.85rem; }
.pending { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.approved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.rejected { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.closed { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0 0 0.25rem; padding: 0; }

/* Order detail */

.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.gate { padding: 0.75rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.gate.pending { border-left: 4px solid var(--warn); }
.gate.approved { border-left: 4px solid var(--ok); }
.gate.rejected { border-left: 4px solid var(--bad); }
.gate p { margin: 0.35rem 0 0; }
.gate-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.gate-head h2, .gate-head h3 { margin: 0; }

/* Line items */

tfoot th, tfoot td { border-top: 2px solid var(--border); border-bottom: 0; }
tfoot th { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text); }
table.lines td, table.accounts td { vertical-align: middle; }
table.lines input, table.lines select { min-width: 6rem; }
table.lines input[name="item_name"] { min-width: 11rem; }
table.lines select { min-width: 13rem; }
table.lines input[type="checkbox"], table.lines input[type="file"] { min-width: 0; }
table.lines input.num { text-align: right; max-width: 8rem; }
table.lines .line-no { color: var(--muted); width: 2rem; }
tr.retired td { color: var(--muted); }
.account-filter { margin-bottom: 0.75rem; }
table.accounts input[name="departments"] { min-width: 12rem; }

/* Accessibility */

.held { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.digital { background: var(--accent-soft); color: var(--accent); border-color: transparent; margin-right: 0.35rem; }
table.lines tbody[data-line] + tbody[data-line] tr:first-child td { border-top: 1px solid var(--border); }
table.lines tr:first-child td { border-bottom: 0; }
table.lines .line-a11y td { padding-top: 0; }
.line-a11y label.check { font-size: 0.875rem; }
.vpat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.5rem 0 0 1.6rem; font-size: 0.875rem; }
.vpat-label { font-weight: 600; }
.vpat select { width: auto; min-width: 0; }
.vpat-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.vpat-upload input[type="file"] { width: auto; min-height: 0; padding: 0.25rem; }
.vpat-kept { color: var(--ok); }
.glyph { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.documents legend { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0; }
.documents legend .glyph { color: var(--accent); }
.document-grid { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.document-slot { display: flex; flex-direction: column; gap: 0.35rem; }
.document-label { font-weight: 600; }
.file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-top: 0.2rem; }
label.file-button { flex-direction: row; align-items: center; gap: 0.45rem; font-size: 0.95rem; cursor: pointer; }
label.file-button:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-name { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.file-name.kept { color: var(--ok); }
td .inline-form { margin: 0; flex-wrap: nowrap; }
td .inline-form label { flex: 0 1 auto; }
.hold-banner { border-left: 4px solid var(--warn); }
.hold-banner p { max-width: 72ch; }
.hold-reason { display: block; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.eeaap-form { max-width: 60rem; }
.eeaap h3 { margin-top: 1.25rem; font-size: 0.95rem; }
.earlier-heading { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); }
.signatures { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.signature { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); }
.signature.signed { border-left-color: var(--ok); }
.signature.signed .small { color: var(--ok); }
.signature.next { border-left-color: var(--warn); }
.signature.declined { border-left-color: var(--bad); }
.signature.waiting { color: var(--muted); }
.drive-links { margin: 0.75rem 0 0; font-weight: 600; }
.sign-form { display: grid; gap: 0.9rem; }
.sign-form label.check { align-items: flex-start; font-size: 0.95rem; max-width: 70ch; }
.sign-form label.check input { margin-top: 0.3rem; }
.sign-form input[name="signed_name"] { max-width: 24rem; }
.decline-form summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.decline-form label { margin-top: 0.75rem; }
.decline-form .actions { margin-top: 0.75rem; }
.placeholders { margin-top: 1rem; }
.placeholders summary { cursor: pointer; font-weight: 600; }
.eeaap .gate-head { margin-bottom: 0.5rem; }

/* Departments */

.org-name { display: inline-block; padding-left: calc(var(--depth, 0) * 1.25rem); font-weight: 600; }
table.departments td { vertical-align: middle; }

/* Budgets */

.budget-bar {
  display: flex;
  height: 0.6rem;
  min-width: 6rem;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: var(--track);
}
.budget-bar .spent { background: var(--series-1); }
.budget-bar .committed { background: var(--series-2); }
.budget-bar.over { outline: 2px solid var(--critical); outline-offset: 2px; }
.over-text { color: var(--bad); }
.budget-summary .budget-bar { height: 0.9rem; margin: 1rem 0 0.5rem; }
.budget-figures { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.budget-figures div { display: grid; gap: 0.15rem; }
.budget-figures strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin: 0; }
.legend .key { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; vertical-align: middle; }
.legend .key.spent { background: var(--series-1); }
.legend .key.committed { background: var(--series-2); }
.legend .key.left { background: var(--track); }
.budget-tree { display: grid; gap: 0.5rem; }
.budget-dept {
  margin-left: calc(var(--depth, 0) * 1.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.budget-dept summary {
  display: grid;
  grid-template-columns: minmax(10rem, 1.2fr) minmax(6rem, 2fr) minmax(11rem, auto);
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  list-style: none;
}
.budget-dept summary::-webkit-details-marker { display: none; }
.budget-name { font-weight: 600; }
.budget-name::before { content: "▸ "; color: var(--muted); }
.budget-dept[open] .budget-name::before { content: "▾ "; }
.budget-left { text-align: right; font-variant-numeric: tabular-nums; }
.budget-dept > .table-wrap, .budget-dept > p { margin: 0 1rem 1rem; }
.amount-form { display: flex; gap: 0.5rem; align-items: center; }
.amount-form input { max-width: 9rem; text-align: right; }

/* Home */

.section-title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 2rem 0 0.75rem; }
.home-top { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); align-items: stretch; }
.home-budget { margin: 0; padding: 1rem 1.1rem; }
.home-budget-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.75rem; }
.home-budget-head h2 { margin: 0; font-size: 1rem; }
.home-budget-head a { font-size: 0.875rem; }
.home-budget-body { display: flex; align-items: center; gap: 1.1rem; }
.donut { width: 7.5rem; height: 7.5rem; flex: none; }
.donut circle { fill: none; stroke-width: 5.5; }
.donut-track { stroke: var(--track); }
.donut-slice.spent { stroke: var(--series-1); }
.donut-slice.committed { stroke: var(--series-2); }
.donut-slice.left { stroke: var(--track); }
.donut-center { font-size: 7px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.donut-center-label { font-size: 3.6px; fill: var(--muted); text-anchor: middle; }
.donut-legend { flex: 1; display: grid; gap: 0.3rem; margin: 0; font-size: 0.875rem; }
.donut-legend div { display: flex; justify-content: space-between; gap: 0.75rem; }
.donut-legend dt { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.donut-legend dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.donut-legend .key { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; }
.donut-legend .key.spent { background: var(--series-1); }
.donut-legend .key.committed { background: var(--series-2); }
.donut-legend .key.left { background: var(--track); }
/* Project stages, in the categorical palette's fixed order. */
.donut-slice.stage-1 { stroke: var(--series-1); }
.donut-slice.stage-2 { stroke: var(--series-2); }
.donut-slice.stage-3 { stroke: var(--series-3); }
.donut-slice.stage-4 { stroke: var(--series-4); }
.donut-slice.stage-5 { stroke: var(--series-5); }
.donut-legend .key.stage-1 { background: var(--series-1); }
.donut-legend .key.stage-2 { background: var(--series-2); }
.donut-legend .key.stage-3 { background: var(--series-3); }
.donut-legend .key.stage-4 { background: var(--series-4); }
.donut-legend .key.stage-5 { background: var(--series-5); }
/* Categorical slots for any chart's slices, in the palette's fixed order. */
.donut-slice.cat-1 { stroke: var(--series-1); }
.donut-slice.cat-2 { stroke: var(--series-2); }
.donut-slice.cat-3 { stroke: var(--series-3); }
.donut-slice.cat-4 { stroke: var(--series-4); }
.donut-slice.cat-5 { stroke: var(--series-5); }
.donut-slice.cat-other { stroke: var(--muted); }
.donut-legend .key.cat-1 { background: var(--series-1); }
.donut-legend .key.cat-2 { background: var(--series-2); }
.donut-legend .key.cat-3 { background: var(--series-3); }
.donut-legend .key.cat-4 { background: var(--series-4); }
.donut-legend .key.cat-5 { background: var(--series-5); }
.donut-legend .key.cat-other { background: var(--muted); }
.status-counts { margin: 0.75rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--border); color: var(--muted); }
.status-counts a { color: inherit; text-decoration: none; }
.status-counts a:hover { color: var(--accent); text-decoration: underline; }
.status-counts strong { color: var(--text); font-variant-numeric: tabular-nums; }
.home-projects .donut-legend dt a { color: inherit; text-decoration: none; }
.home-projects .donut-legend dt a:hover { color: var(--accent); text-decoration: underline; }
.donut-total { padding-top: 0.3rem; border-top: 1px solid var(--border); }
.over-note { display: flex; align-items: center; gap: 0.4rem; margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--critical); font-weight: 600; }
.over-note svg { width: 1rem; height: 1rem; flex: none; }
.over-note a { color: inherit; }
.tiles { display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
}
.tile p { margin: 0.4rem 0 0.75rem; }
.tile-head { display: flex; align-items: center; gap: 0.6rem; }
.tile-head h3 { margin: 0; font-size: 1.1rem; flex: 1; }
.tile-head h3 a { color: var(--text); text-decoration: none; }
.tile-head h3 a:hover { text-decoration: underline; }
.icon { width: 2rem; height: 2rem; flex: none; padding: 0.35rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.tile.planned { background: transparent; border-style: dashed; box-shadow: none; }
.tile.planned .icon { background: var(--bg); color: var(--muted); }
.tile.planned h3 { color: var(--muted); }
.work-items { list-style: none; margin: auto 0 0; padding: 0; }
.work-items li { border-top: 1px solid var(--border); }
.work-items a { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; color: var(--text); text-decoration: none; }
.work-items a:hover span:first-child { text-decoration: underline; }
.work-items .count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.work-items li.attention .count { color: var(--warn); background: var(--warn-soft); padding: 0 0.5rem; border-radius: 999px; }
.integrations { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.integrations li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.integrations .icon { background: var(--bg); color: var(--muted); }

/* Order list tabs */

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: 0.5rem 0.8rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { font-size: 0.8rem; padding: 0 0.45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }

/* Projects */

.project-actions { margin: 0 0 1.25rem; }
.project-actions form { margin: 0; }
.score-line { margin: 0.25rem 0; }
.score { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.members { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.members li { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.members form { margin: 0; }
.signoff-form { margin-top: 0.75rem; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.hours-grid th[scope="row"], .hours-table th[scope="row"], table.capacity th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text); }
.hours-grid th[scope="row"], .hours-table th[scope="row"] { white-space: nowrap; }
.hours-grid input { width: 5.5rem; min-height: 2.25rem; text-align: right; }
.hours-grid .free { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.hours-grid .free.short { color: var(--bad); font-weight: 600; }
.hours-table tfoot th, .hours-table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; }

.ballot-form .criterion { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.ballot-form .criterion legend { margin-bottom: 0.25rem; }
.ballot-form .criterion p { margin: 0 0 0.5rem; }
.scale { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.scale label { flex-direction: row; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-weight: 600; cursor: pointer;
}
.scale input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.scale input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.add-task summary { cursor: pointer; }
.add-task form { margin-top: 1rem; }
.task-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.lanes { display: grid; gap: 1.25rem; }
.lane-title { font-size: 1.05rem; display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; }
.lane-title .count, .gantt-lane .count { font-size: 0.8rem; padding: 0 0.45rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.gantt-lane .gantt-label { padding-top: 0.75rem; }
.template-tasks input[name="notes"] { margin-top: 0.3rem; }
.template-tasks td[data-label="Task"] { min-width: 16rem; }
.template-tasks select[name="department"] { max-width: 13rem; }
.template-tasks td[data-label="Hours"] input, .template-tasks td[data-label="Starts on day"] input, .template-tasks td[data-label="Lasts (days)"] input, .template-tasks td[data-label="#"] input { max-width: 5.5rem; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; align-items: start; }
.board-column.kind-done { background: var(--ok-soft); }
.board-column.kind-blocked { background: var(--bad-soft); }
.column-editor summary { cursor: pointer; }
.column-editor form { margin-top: 1rem; }
.column-table td:first-child { width: 5rem; }
.column-table td:first-child input { width: 4rem; }
.column-table td:nth-child(3) { width: 12rem; }
.board-column { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; min-height: 8rem; }
.board-column.drop-target { border-color: var(--accent); }
.board-column h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.75rem; }
.board-column h3 .count { font-size: 0.8rem; padding: 0 0.45rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; min-height: 3rem; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem 0.75rem; box-shadow: var(--shadow); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: 0.5; }
.task-card.overdue { border-left: 4px solid var(--bad); }
.task-card:target { outline: 3px solid var(--focus); }
.task-card p { margin: 0.35rem 0 0; }
.task-title { display: block; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; color: var(--muted); }
.task-actions { display: flex; justify-content: space-between; gap: 0.4rem; margin-top: 0.5rem; }
.task-actions form { margin: 0; }
.task-actions form:only-child { margin-left: auto; }
.task-edit { margin-top: 0.4rem; }
.task-edit summary { cursor: pointer; color: var(--accent); }
.task-edit form { margin-top: 0.5rem; }

.gantt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(32rem, 1fr); border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-label { padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.1rem; border-right: 1px solid var(--border); min-width: 0; }
.gantt-label a { overflow-wrap: anywhere; }
.gantt-track { position: relative; min-height: 3rem; }
.gantt-head .gantt-track { min-height: 2.25rem; }
.gantt-month { position: absolute; top: 0; bottom: 0; padding: 0.5rem 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.gantt-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--critical); z-index: 1; }
.gantt-bar { position: absolute; top: 50%; height: 1rem; margin-top: -0.5rem; border-radius: 4px; background: var(--series-1); }
.gantt-bar.project { background: transparent; border: 2px solid var(--accent); }
.gantt-bar.todo { background: var(--muted); }
.gantt-bar.doing, .gantt-bar.active, .gantt-bar.approved, .gantt-bar.on_hold { background: var(--series-1); }
.gantt-bar.blocked { background: var(--critical); }
.gantt-bar.done, .gantt-bar.completed { background: var(--ok); }
.gantt-bar.proposal { background: repeating-linear-gradient(135deg, var(--series-2) 0 6px, transparent 6px 10px); border: 1px solid var(--series-2); }
.gantt-bar.milestone { height: 0.9rem; margin-top: -0.45rem; border-radius: 2px; transform: rotate(45deg); width: 0.9rem !important; }
.gantt-outside { position: absolute; top: 50%; transform: translateY(-50%); left: 0.5rem; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.75rem 0 1.25rem; }
.gantt-legend .key { display: inline-block; width: 0.9rem; height: 0.6rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: middle; background: var(--series-1); }
.gantt-legend .key.today { width: 2px; height: 0.9rem; background: var(--critical); }
.gantt-legend .key.project { background: transparent; border: 2px solid var(--accent); }
.gantt-legend .key.todo { background: var(--muted); }
.gantt-legend .key.blocked, .gantt-legend .key.over { background: var(--critical); }
.gantt-legend .key.done, .gantt-legend .key.completed { background: var(--ok); }
.gantt-legend .key.proposal { background: repeating-linear-gradient(135deg, var(--series-2) 0 3px, transparent 3px 5px); border: 1px solid var(--series-2); }

.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
table.capacity td { min-width: 6.5rem; }
table.capacity td.over { background: var(--bad-soft); }
.cap-bar { display: flex; height: 0.5rem; border-radius: 999px; overflow: hidden; background: var(--track); margin-bottom: 0.35rem; }
.cap-bar .committed { background: var(--series-1); }
.cap-bar .proposed { background: repeating-linear-gradient(135deg, var(--series-2) 0 3px, transparent 3px 5px); }
td.over .cap-bar .committed { background: var(--critical); }
.cap-figures { display: block; white-space: nowrap; font-size: 0.85rem; }
.project-hours { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.project-hours li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.project-hours .num { margin-left: auto; }

.rubric-numbers { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
table.criteria td:first-child { width: 2.5rem; }
table.criteria td:last-child { width: 7rem; }
.capacity-edit { display: flex; gap: 0.4rem; justify-content: flex-end; }
.capacity-edit input { width: 6rem; min-height: 2rem; text-align: right; }

.project-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-bottom: 0.5rem; }
.project-card { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.project-card:hover { border-color: var(--muted); }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.progress { display: block; height: 0.4rem; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }

/* Projects home */

.pm-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: -0.5rem 0 1.25rem; }
.pipeline { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.pipeline a { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.pipeline a:hover { border-color: var(--muted); }
.pipeline-count { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pipeline-label { font-size: 0.85rem; color: var(--muted); }
.pm-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); margin-bottom: 1.25rem; }
.pm-grid > .card { margin-bottom: 0; }
.pm-needs { border-left: 4px solid var(--accent); }
.action-list, .task-list, .capacity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.action-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.action-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.task-list li { display: flex; flex-direction: column; gap: 0.1rem; }
.capacity-list li { display: grid; gap: 0.3rem; }
.capacity-head { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.cap-bar.over .committed { background: var(--critical); }

/* Tickets */

.queue-cards a { gap: 0.2rem; }
.queue-name { font-weight: 600; color: var(--text); }
.priority { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.priority.low { color: var(--muted); }
.priority.high { color: var(--warn); }
.priority.urgent { color: var(--bad); }
.priority.urgent::before { content: "▲ "; }
.narrow-form { max-width: 44rem; }
.queue-choice { display: grid; gap: 0.5rem; }
.queue-option { align-items: flex-start; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.queue-option input { margin-top: 0.25rem; }
.queue-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ticket-body { margin: 0; }
.timeline { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.75rem; }
.timeline .entry { padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.timeline .entry.note { background: var(--warn-soft); border-color: transparent; }
.timeline .entry.event { padding: 0 1rem; background: none; border: 0; }
.timeline .entry p { margin: 0.3rem 0 0; }
.timeline .entry.event p { margin: 0; }
.entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.response h2 { margin: 0; }
.response-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.response .response-fields { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.response-fields { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.ticket-filters { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); align-items: end; margin: 0 0 0.5rem; }
.filter-actions { display: flex; align-items: center; gap: 0.75rem; min-height: 2.5rem; }
.template-pick { display: flex; align-items: center; gap: 0.5rem; }
.template-pick label { flex-direction: row; align-items: center; gap: 0.5rem; white-space: nowrap; }
.template-pick select { min-width: 12rem; min-height: 2.25rem; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.queues-table input { min-height: 2.25rem; }
.queues-table .small-input { margin-top: 0.35rem; font-size: 0.875rem; }
.queues-table .order-input { width: 4.5rem; text-align: right; }

/* Reports */

.report-filters { margin-top: 0; }
.date-filters label { flex: 0 1 11rem; }
.report-section { margin-top: 2rem; }
table.priorities td.rank { font-size: 1.1rem; font-weight: 700; }
.score-cell { display: flex; align-items: center; gap: 0.6rem; }
.score-bar { position: relative; display: inline-block; width: 7rem; height: 0.5rem; border-radius: 999px; background: var(--track); }
.score-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--series-1); }
.score-bar .fill.rejected { background: var(--muted); }
.score-bar .pass { position: absolute; top: -0.2rem; bottom: -0.2rem; width: 2px; margin-left: -1px; background: var(--text); }
.criteria-detail { margin-top: 0.3rem; }
.report-totals li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.report-totals .pipeline-count { font-size: 1.25rem; }
.progress-cell { display: grid; gap: 0.3rem; min-width: 8rem; }
.criteria-detail summary { cursor: pointer; color: var(--accent); }
.criteria-detail .details { margin-top: 0.4rem; }

/* Branding */

.logo-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.logo-preview > div { display: grid; gap: 0.4rem; justify-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
.logo-preview img { height: 40px; width: auto; max-width: 100%; }
.logo-preview-light { background: #ffffff; }
.logo-preview-dark { background: #121212; color: #f0efec; }
.logo-preview-dark img.inverted { filter: invert(1); }
.remove-logo { margin-top: 0.75rem; text-align: right; }

/* View as */

.role-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.role-grid .card { margin: 0; }
.role-choices { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.role-choices form { margin: 0; }
.button.current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); cursor: default; }
.impersonation .actions { align-items: center; }

/* Approval rules */

.gateway.disabled { opacity: 0.75; }
.conditions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.conditions li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.conditions li:last-child { border-bottom: 0; }
.conditions form, .remove-gateway { margin: 0; }
.add-condition { padding: 0.75rem; background: var(--bg); border-radius: var(--radius); }
.remove-gateway { text-align: right; margin-top: 0.5rem; }

/* Access */

.role-row { padding: 0.75rem 0; border-top: 1px solid var(--border); display: grid; gap: 0.6rem; justify-items: start; }
.role-row h3 { margin: 0; }
.role-row label:not(.check) { width: min(100%, 24rem); }
.checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }

.signin { text-align: center; }
.signin p { margin: 0.75rem 0; }

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .card { padding: 1rem; }
  .logo { height: 32px; }
  .menu-label { max-width: 7rem; }
  /* The panel spans the top bar, so it can't run off the edge. */
  .menu { position: static; }
  .menu-panel { left: 16px; right: 16px; width: auto; top: calc(100% - 0.2rem); }
  .account-menu .menu-panel { left: 16px; right: 16px; }
  .template-pick { width: 100%; align-items: flex-end; }
  .template-pick label { flex: 1; flex-direction: column; align-items: stretch; white-space: normal; }
  .template-pick select { min-width: 0; }

  .budget-dept { margin-left: calc(var(--depth, 0) * 0.75rem); }
  .budget-dept summary { grid-template-columns: 1fr; gap: 0.4rem; }
  .budget-left { text-align: left; }
  .home-top { grid-template-columns: 1fr; }
  .board { grid-auto-columns: minmax(80vw, 1fr); scroll-snap-type: x mandatory; }
  .board-column { scroll-snap-align: start; }
  .gantt-row { grid-template-columns: 9rem minmax(28rem, 1fr); }
  .date-pair { grid-template-columns: 1fr; }

  /* Order lists become one card per order. */
  table.stacked thead { display: none; }
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; }
  table.stacked tr { padding: 0.75rem; border-bottom: 1px solid var(--border); }
  table.stacked tbody tr:last-child { border-bottom: 0; }
  table.stacked td { border: 0; padding: 0.15rem 0; text-align: left; }
  table.stacked tfoot { display: block; }
  table.stacked tfoot tr { display: flex; justify-content: space-between; }
  table.stacked tfoot th, table.stacked tfoot td { display: block; border: 0; padding: 0; }
  table.stacked tfoot td:empty { display: none; }
  table.lines input.num { max-width: none; text-align: left; }
  table.lines input[name="item_name"], table.lines select { min-width: 0; }
  table.lines .line-no { width: auto; font-weight: 600; color: var(--text); }
  table.stacked td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 6.5rem;
    color: var(--muted);
    font-size: 0.8rem;
  }
}
