/* BuildIQ pages (on top of style.css, shared with the Backorder Tracker). Its own look: "Prism frost" (the owner's
   pick, 10/28/26, grown from "light aurora"): a soft blue-grey page with four pools of aurora colour behind it (drifting
   very slowly on the sign-in page), milky see-through panels, tiles and rail where light catches the top
   edge, rainbow "prism" edges on the page you're on, dialogs and hovered tiles and buttons, a violet-blue accent, page
   titles shading from indigo to teal, and a matching dark twin. Red still always means "short"; amber and green keep
   their meaning. The data itself (the Build Plan sheet, tables, inputs) stays on solid surfaces. The page-wide pieces
   of the look are in "Prism frost" at the end.

   Tokens: light, then dark (the saved choice, or the system's before sign-in), then the ones built from them. --hi is
   the highlight for what's new or changed (counters, starred changes, the open SMT day); --title / -2 / -3 the page
   title's shading; --row-line the thin line between table rows; --frozen the SMT frozen zone (a plain blue, apart from
   the accent); --glass / --glass-strong the see-through panels, --edge-* their borders; --prism-* the rainbow edge's
   colours; --aurora-* the pools of colour; --bead the shine on status pills. */
:root {
  --bg: #eef0fb; --surface: #ffffff; --ink: #12142b; --muted: #4e5378; --line: #e4e6f3; --line-strong: #d3d6ea;
  --row-line: #eef0f8; --brand: #c8161d; --accent: #5b4dff; --accent-2: #0e7490; --accent-ink: #ffffff;
  --accent-soft: #ecebff; --accent-deep: #4338ca; --cat-bg: #f1f0fd; --title: #1a1452; --title-2: #3b2fd6;
  --title-3: #0f5568; --hi: #5b4dff; --frozen: #2563eb; --rail-ink: #4e5378; --rail-on: #4338ca;
  --row-hover: rgba(91, 77, 255, .06); --hover: rgba(91, 77, 255, .08); --radius-lg: 18px; --sheet-head: #f5f4ff;
  --focus-halo: rgba(91, 77, 255, .22); --veil: rgba(29, 23, 84, .28); --glow-c: rgba(91, 77, 255, .45);
  --shadow: 0 1px 1px rgba(18, 20, 43, .04), 0 12px 32px -12px rgba(60, 48, 170, .2);
  --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .86); --glass-edge: rgba(255, 255, 255, .95);
  --edge-top: rgba(255, 255, 255, .95); --edge-side: rgba(206, 210, 236, .7); --edge-bottom: rgba(186, 191, 224, .85);
  --on-tint-1: rgba(91, 77, 255, .14); --on-tint-2: rgba(56, 189, 248, .1);
  --btn-grad: linear-gradient(135deg, #5b4dff 0%, #4f46e5 50%, #2563eb 100%);
  --prism-1: #7b6cff; --prism-2: #38bdf8; --prism-3: #f0abfc; --prism-4: #a5b4fc;
  --aurora-1: rgba(123, 108, 255, .32); --aurora-2: rgba(56, 198, 232, .28); --aurora-3: rgba(240, 138, 216, .24);
  --aurora-4: rgba(127, 224, 184, .22); --bead: .55; --silk: #5b7cff;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .3 0 0 0 0 .45 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  accent-color: var(--accent);
}
:root[data-theme="dark"] {
  --bg: #04050f; --surface: #0f1119; --ink: #e9edf7; --muted: #9aa3bd; --line: #21232f; --line-strong: #2e3242;
  --row-line: #181a24; --brand: #b4161b; --accent: #5b7cff; --accent-2: #38bdf8; --accent-ink: #050814;
  --accent-soft: #16224d; --accent-deep: #a9c1ff; --cat-bg: #161925; --title: #e6edff; --title-2: #a9c1ff;
  --title-3: #7dd3fc; --hi: #6c8cff; --frozen: #6fb3e0; --rail-ink: #9aa3bd; --rail-on: #a9c1ff;
  --row-hover: rgba(91, 124, 255, .08); --hover: rgba(91, 124, 255, .1); --sheet-head: #131622;
  --focus-halo: rgba(91, 124, 255, .3); --veil: rgba(0, 0, 0, .6); --glow-c: rgba(60, 100, 255, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 16px 40px -14px rgba(0, 0, 0, .7);
  --glass: rgba(16, 17, 26, .74); --glass-strong: rgba(14, 15, 24, .9); --glass-edge: rgba(255, 255, 255, .08);
  --edge-top: rgba(255, 255, 255, .13); --edge-side: rgba(255, 255, 255, .05); --edge-bottom: rgba(0, 0, 0, .5);
  --on-tint-1: rgba(91, 124, 255, .22); --on-tint-2: rgba(56, 189, 248, .1);
  --btn-grad: linear-gradient(135deg, #7c95ff 0%, #5b7cff 45%, #3ba5f5 100%);
  --prism-1: #4f7bff; --prism-2: #22d3ee; --prism-3: #a5c8ff; --prism-4: #3b82f6;
  --aurora-1: rgba(59, 91, 255, .3); --aurora-2: rgba(34, 140, 255, .2); --aurora-3: rgba(40, 70, 200, .2);
  --aurora-4: rgba(14, 165, 233, .1); --bead: .08; --silk: rgba(170, 200, 255, .92);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #04050f; --surface: #0f1119; --ink: #e9edf7; --muted: #9aa3bd; --line: #21232f; --line-strong: #2e3242;
    --row-line: #181a24; --brand: #b4161b; --accent: #5b7cff; --accent-2: #38bdf8; --accent-ink: #050814;
    --accent-soft: #16224d; --accent-deep: #a9c1ff; --cat-bg: #161925; --title: #e6edff; --title-2: #a9c1ff;
    --title-3: #7dd3fc; --hi: #6c8cff; --frozen: #6fb3e0; --rail-ink: #9aa3bd; --rail-on: #a9c1ff;
    --row-hover: rgba(91, 124, 255, .08); --hover: rgba(91, 124, 255, .1); --sheet-head: #131622;
    --focus-halo: rgba(91, 124, 255, .3); --veil: rgba(0, 0, 0, .6); --glow-c: rgba(60, 100, 255, .55);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 16px 40px -14px rgba(0, 0, 0, .7);
    --glass: rgba(16, 17, 26, .74); --glass-strong: rgba(14, 15, 24, .9); --glass-edge: rgba(255, 255, 255, .08);
    --edge-top: rgba(255, 255, 255, .13); --edge-side: rgba(255, 255, 255, .05); --edge-bottom: rgba(0, 0, 0, .5);
    --on-tint-1: rgba(91, 124, 255, .22); --on-tint-2: rgba(56, 189, 248, .1);
    --btn-grad: linear-gradient(135deg, #7c95ff 0%, #5b7cff 45%, #3ba5f5 100%);
    --prism-1: #4f7bff; --prism-2: #22d3ee; --prism-3: #a5c8ff; --prism-4: #3b82f6;
    --aurora-1: rgba(59, 91, 255, .3); --aurora-2: rgba(34, 140, 255, .2); --aurora-3: rgba(40, 70, 200, .2);
    --aurora-4: rgba(14, 165, 233, .1); --bead: .08; --silk: rgba(170, 200, 255, .92);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}
/* The display font (titles, the rail's name and headings, tile numbers): Space Grotesk, kept here because the CSP
   blocks fonts from other sites (fonts/SpaceGrotesk-OFL.txt is its licence). Latin only; Bahnschrift stands in until
   it loads and for anything outside it. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
             src: url("fonts/space-grotesk-latin-wght-normal.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; }
/* Built from the tokens above, so they follow light and dark. The aurora's pools are sized and placed in vw / vh from
   a box 15% bigger than the window on every side: the sign-in page's drifting layer is that box, the still one is drawn from it. */
:root {
  --prism: linear-gradient(115deg, var(--prism-1) 0%, var(--prism-2) 30%, var(--prism-3) 62%, var(--prism-4) 82%,
                           var(--prism-1) 100%);
  --prism-v: linear-gradient(180deg, color-mix(in srgb, var(--prism-4) 90%, transparent),
                             color-mix(in srgb, var(--prism-1) 80%, transparent) 30%,
                             color-mix(in srgb, var(--prism-2) 70%, transparent) 60%,
                             color-mix(in srgb, var(--prism-3) 70%, transparent));
  --aurora: radial-gradient(47vw 52vh at 40vw 12vh, var(--aurora-1), transparent 70%),
            radial-gradient(44vw 49vh at 109vw 10vh, var(--aurora-2), transparent 70%),
            radial-gradient(55vw 60vh at 96vw 102vh, var(--aurora-3), transparent 70%),
            radial-gradient(42vw 47vh at 40vw 112vh, var(--aurora-4), transparent 70%);
  --font-display: "Space Grotesk", Bahnschrift, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
/* Links are violet: underlined only on hover (the Build Plan's GPNs are bold). */
main a:not(.btn):not(.chip):not(.gpn):not(.my-tile) { text-decoration: none; }
main a:not(.btn):not(.chip):not(.gpn):not(.my-tile):hover { text-decoration: underline; text-underline-offset: 2px; }
table.sheet a.gpn { font-weight: 600; }
table.sheet a.gpn:hover { text-decoration: underline; }
button, .btn, .chip.on, .view-switch button.on { color: var(--accent-ink); }
.btn.ghost { color: var(--accent); }
button.link { color: var(--muted); }
.btn.ghost:hover { border-color: var(--accent); }

/* The icon rail: icons only; each one's name pops out beside it on hover or keyboard focus. */
body.with-side { grid-template-columns: 60px minmax(0, 1fr); }
/* The rail's graphic, top layer first: the silkscreen of a strip of one of our boards (U80, U21/U16, X1,
   U51/U50, U46; white lines drawn at 2x, from the assembly drawing), signal red fading down into carbon fibre.
   A graphic, so the same in light and dark mode. */
.side.rail { width: 60px; padding: 10px 8px; gap: 2px; overflow: visible; z-index: 40;
             background-color: #141414;
             background-image: url("rail-board.png"),
               linear-gradient(180deg, rgba(200, 22, 29, .95) 0%, rgba(200, 22, 29, .75) 35%, rgba(20, 20, 20, 0) 100%),
               conic-gradient(from 45deg, #141414 25%, #262626 0 50%, #141414 0 75%, #262626 0);
             background-size: 60px auto, 100% 100%, 8px 8px;
             border-right: 1px solid rgba(255, 255, 255, .08); align-items: center; }
.rail .ic { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--hi) 75%, transparent)); }
.rail a.on .ic { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--hi) 95%, transparent)); }
.rail .side-brand { padding: 2px 0 14px; justify-content: center; }
.rail .side-brand img { border-radius: 8px; }
.rail .side-brand .brand-mrp { display: none; }      /* only in the wide rail (below), where there's room */
.rail nav, .rail .side-foot { display: grid; gap: 4px; justify-items: center; width: 100%; }
.rail a, .rail .side-link { position: relative; justify-content: center; width: 44px; height: 40px; padding: 0;
                            border-radius: 8px; color: var(--rail-ink); }
.rail a:hover, .rail .side-link:hover { background: rgba(255,255,255,.12); color: var(--rail-on); }
/* Bubble buttons: each electric-blue icon glows in a round dark bubble; the open page's bubble is tinted blue
   with a glowing ring. */
.rail nav a, .rail .side-foot a, .rail .side-link, .rail .find-btn {
  width: 38px; height: 38px; margin: 1px 0; border-radius: 50%; background: rgba(0,0,0,.36);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.35); }
.rail nav a:hover, .rail .side-foot a:hover, .rail .side-link:hover, .rail .find-btn:hover {
  background: rgba(0,0,0,.46); color: var(--rail-on); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.35); }
.rail a.on, .rail a.on:hover { background: color-mix(in srgb, var(--hi) 28%, transparent); color: var(--rail-on);
  box-shadow: inset 0 0 0 1.5px var(--rail-ink), 0 0 8px color-mix(in srgb, var(--hi) 55%, transparent); }
.rail .ic { width: 20px; height: 20px; stroke-width: 2.5; overflow: visible; }
.rail .ic rect { rx: 4.5px; }
.rail .side-sep { width: 28px; height: 1px; padding: 0; margin: 8px 0; background: rgba(255,255,255,.14); }
.rail .side-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
.rail form { width: auto; }
.rail .side-user { position: relative; padding: 8px 0 2px; justify-content: center; }
.rail .avatar { width: 30px; height: 30px; background: rgba(255,255,255,.92); color: #b4161b; }
.rail .lbl { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 100;
             background: #0b0e11; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; padding: 5px 10px;
             border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.3); opacity: 0; pointer-events: none;
             transition: opacity .12s; }
.rail a:hover .lbl, .rail a:focus-visible .lbl, .rail .side-link:hover .lbl, .rail .side-link:focus-visible .lbl,
.rail .side-user:hover .lbl, .rail .side-user:focus-visible .lbl { opacity: 1; }
.rail .side-brand .lbl { left: calc(100% + 4px); }
@media (max-width: 900px) {
  body.with-side { grid-template-columns: 1fr; }
  .side.rail { width: auto; flex-direction: row; justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav, .rail .side-foot { display: flex; width: auto; border: 0; padding: 0; margin: 0; }
  .rail .side-brand { padding: 0 6px 0 0; }
  .rail .side-sep { width: 1px; height: 24px; margin: 0 4px; }
  .rail .lbl { left: 50%; top: calc(100% + 6px); transform: translateX(-50%); }
  /* Hidden labels take no room: one near the right edge would otherwise widen the page. */
  .rail .lbl { display: none; }
  .rail a:hover .lbl, .rail a:focus-visible .lbl, .rail .side-link:hover .lbl, .rail .side-link:focus-visible .lbl,
  .rail .side-user:hover .lbl, .rail .side-user:focus-visible .lbl, .rail .find-btn:hover .lbl,
  .rail .find-btn:focus-visible .lbl { display: block; }
}

/* Priority colours from the old sheet's legend (on the PRI and GPN cells). */
:root { --pri-0: #ff9900; --pri-1: #e06666; --pri-2: #76a5af; --pri-3: #b6d7a8; --pri-3-3: #d9d2e9; --pri-3-5: #40e0d0; --pri-4: #ffe599;
        --pri-ink: #1c2330; --alt-bg: #fff3a6; --neg-bg: #f4c7c3; --neg-ink: #8a1c13; }
:root[data-theme="dark"] { --pri-0: #b86e00; --pri-1: #9c3d3d; --pri-2: #4e7a84; --pri-3: #4f7a43; --pri-3-3: #5f5482; --pri-3-5: #1d7f78;
        --pri-4: #8a7420; --pri-ink: #f3f5f8; --alt-bg: #5a5016; --neg-bg: #4a2020; --neg-ink: #ffb4ab; }

.sheet-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.sheet-top h1 { margin: 0; }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; flex: 1; font-size: 13px; }
.strip b { font-variant-numeric: tabular-nums; }
.strip .bad, .strip .bad b { color: var(--bad); }
.strip a { color: var(--ink); }
.strip-sep { width: 1px; height: 18px; background: var(--line); }
.sheet-filters { margin: 10px 0 8px; }
.sheet-filters label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.banner { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: var(--radius); margin: 0 0 8px; }
.banner button.link { color: inherit; text-decoration: underline; font-size: inherit; }

/* The big table scrolls inside its own box, so headings and the first three columns stay put. */
body.page-sheet > main { max-width: none; padding-bottom: 10px; }
.sheet-wrap { overflow: auto; max-height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: var(--radius);
              background: var(--surface); }
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
table.sheet th, table.sheet td { padding: 3px 7px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
                                 vertical-align: top; }
table.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); cursor: pointer; user-select: none;
                       white-space: nowrap; vertical-align: bottom; line-height: 1.25; }
table.sheet thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
table.sheet thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
/* One line per part, like the sheet: long text is cut off with "…"; click a cell to see all of it. */
table.sheet td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
table.sheet .sticky1, table.sheet .sticky2, table.sheet .sticky3 { position: sticky; z-index: 1; background: var(--surface); }
table.sheet thead .sticky1, table.sheet thead .sticky2, table.sheet thead .sticky3 { z-index: 3; }
table.sheet .sticky1 { left: 0; width: 48px; min-width: 48px; max-width: 48px; }
table.sheet .sticky2 { left: 48px; width: 44px; min-width: 44px; max-width: 44px; text-align: center; }
table.sheet .sticky3 { left: 92px; width: 86px; min-width: 86px; box-shadow: 2px 0 0 var(--line); }
table.sheet td.c-desc { max-width: 260px; }
table.sheet td.c-notes { min-width: 200px; max-width: 340px; }
table.sheet td.c-notes2 { max-width: 200px; }
table.sheet tbody td.ed { cursor: text; }
table.sheet tbody td.ed:hover { box-shadow: inset 0 0 0 1px var(--accent); }
table.sheet tbody td.ed:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
table.sheet tbody tr:hover td { background-image: linear-gradient(var(--row-hover), var(--row-hover)); }
table.sheet td.dem { font-weight: 600; }
table.sheet td.neg { background: var(--neg-bg); color: var(--neg-ink); }
table.sheet td.alt-used { background: var(--alt-bg); }
table.sheet .bstart { border-left: 3px solid var(--line); }
table.sheet th.bcol { font-weight: 600; cursor: default; }
table.sheet th.bcol .bname { display: block; font-weight: 700; color: var(--ink); max-width: 210px; overflow: hidden;
                             text-overflow: ellipsis; }

/* Priority colours on the PRI and GPN cells. */
tr.pri-0 :is(.sticky2, .sticky3) { background: var(--pri-0); color: var(--pri-ink); }
tr.pri-1 :is(.sticky2, .sticky3) { background: var(--pri-1); color: var(--pri-ink); }
tr.pri-2 :is(.sticky2, .sticky3) { background: var(--pri-2); color: var(--pri-ink); }
tr.pri-3 :is(.sticky2, .sticky3) { background: var(--pri-3); color: var(--pri-ink); }
tr.pri-3-3 :is(.sticky2, .sticky3) { background: var(--pri-3-3); color: var(--pri-ink); }
tr.pri-3-5 :is(.sticky2, .sticky3) { background: var(--pri-3-5); color: var(--pri-ink); }
tr.pri-4 :is(.sticky2, .sticky3) { background: var(--pri-4); color: var(--pri-ink); }
tr[class*="pri-"]:not(.pri-5) .sticky3 a { color: var(--pri-ink); text-decoration: underline; }
.pri-chip { display: inline-block; min-width: 26px; text-align: center; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.pri-chip.pri-0 { background: var(--pri-0); color: var(--pri-ink); } .pri-chip.pri-1 { background: var(--pri-1); color: var(--pri-ink); }
.pri-chip.pri-2 { background: var(--pri-2); color: var(--pri-ink); } .pri-chip.pri-3 { background: var(--pri-3); color: var(--pri-ink); }
.pri-chip.pri-3-3 { background: var(--pri-3-3); color: var(--pri-ink); } .pri-chip.pri-4 { background: var(--pri-4); color: var(--pri-ink); }
.pri-chip.pri-3-5 { background: var(--pri-3-5); color: var(--pri-ink); }
.pri-chip.pri-5 { background: var(--cat-bg); }

/* Saving feedback. */
td.saving { opacity: .55; }
@keyframes flash-ok { from { background: var(--good-bg); } }
@keyframes flash-bad { from { background: var(--bad-bg); } }
@keyframes flash-chg { from { background: var(--warn-bg); } }
td.saved { animation: flash-ok 1.6s ease-out; }
td.failed { animation: flash-bad 3s ease-out; }
td.changed { animation: flash-chg 4s ease-out; }
.cell-editor { position: absolute; z-index: 50; font: inherit; font-size: 13px; padding: 4px 6px; resize: both;
               border: 2px solid var(--accent); border-radius: 4px; background: var(--surface); color: var(--ink);
               box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 560px; }
textarea.cell-editor { min-height: 2.2em; }

/* Build columns picker. */
.builds-pick { margin: 0 0 10px; }
.pick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.pick-list { columns: 4 240px; column-gap: 18px; font-size: 13px; }
.pick-list label { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; break-inside: avoid; }
.builds-pick button.link { font-size: 13px; color: var(--accent); }

/* Part, build and schedule pages. */
.facts .v.bad { color: var(--bad); }
.part-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.part-fields label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.part-fields label.wide { grid-column: 1 / -1; }
.part-fields textarea, .part-fields input, .part-fields select { color: var(--ink); width: 100%; font: inherit; }
.part-fields textarea { resize: vertical; min-height: 34px; }
.part-fields .ro { color: var(--ink); white-space: pre-line; padding: 6px 0; min-height: 30px; }
td.neg, span.neg { color: var(--bad); font-weight: 700; }
tr.short-row td { background: var(--bad-bg); }
.notes-list { margin: 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.sched td input[type=number] { width: 90px; text-align: right; }
.sched td input.pos { width: 60px; }
.sched tr.unchanged-count td { }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.upload-grid .panel { margin: 0; }
.upload-grid form { display: grid; gap: 10px; }
.upload-grid input[type=file] { max-width: 100%; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); color: var(--accent); }
table.compact td.wrap { white-space: normal; }
h1 .sub { font-weight: 500; font-size: 15px; color: var(--muted); margin-left: 8px; }
.pager-nav { display: flex; gap: 12px; align-items: center; margin: 0 0 12px; font-size: 13px; }

:root[data-layout="compact"] table.sheet th, :root[data-layout="compact"] table.sheet td { padding: 1px 5px; font-size: 12px; }

/* Buyers' stock additions: the Stock cell is marked, and opens a popup to see or add them. */
table.sheet td.stk { cursor: pointer; }
table.sheet td.stk:hover { box-shadow: inset 0 0 0 1px var(--accent); }
table.sheet td.stk.adj { color: var(--accent); font-weight: 700; }
table.sheet td.stk.adj::before { content: "+ "; font-size: 10px; vertical-align: 1px; }
.stock-pop { position: fixed; z-index: 55; width: 430px; max-width: calc(100vw - 16px); background: var(--surface);
             border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pop-head button.link { font-size: 14px; }
.stock-pop p { margin: 6px 0; }
.sp-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.sp-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sp-list li .note { flex: 1; }
.sp-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 4px; }
.sp-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.sp-form label.grow { flex: 1; min-width: 160px; }
.sp-form input { color: var(--ink); width: 100%; }
.sp-form input[name=qty] { width: 110px; }

/* New parts window. */
.new-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.review-dlg { width: min(1400px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line);
              border-radius: 10px; background: var(--surface); color: var(--ink); }
.review-dlg::backdrop { background: rgba(10, 14, 20, .55); }
.review-dlg form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.review-head { padding: 16px 20px 8px; border-bottom: 1px solid var(--line); }
.review-head h2 { margin: 0 0 4px; font-size: 17px; }
.review-head p { margin: 0 0 8px; max-width: 980px; }
.review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.review-tools label { display: flex; align-items: center; gap: 6px; }
.review-tools button.link { color: var(--accent); font-size: 13px; }
.review-scroll { overflow: auto; flex: 1; padding: 0 20px 10px; }
.review-table thead th { position: sticky; top: 0; z-index: 1; }
.review-table td { vertical-align: top; }
.review-table textarea { width: 100%; min-width: 110px; font: inherit; font-size: 12.5px; resize: vertical; padding: 3px 6px; }
.review-table textarea.wide { min-width: 260px; }
.review-table select, .review-table input { font-size: 12.5px; padding: 3px 6px; }
.review-actions { padding: 12px 20px; border-top: 1px solid var(--line); align-items: center; }
.review-actions button:disabled { opacity: .45; cursor: not-allowed; }
details.dismissed { margin-top: 12px; }
details.dismissed summary { cursor: pointer; color: var(--muted); }
.mode-swatch span:first-child { background: #c8161d; }
.mode-dark span:nth-child(2) { background: #f4f4f5; }
.mode-light span:nth-child(2) { background: #1f2328; }

/* The part you opened, pointed out when you come back to the Build Plan. */
@keyframes came-back { 0%, 60% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
table.sheet tr.came-back td { animation: came-back 3.5s ease-out; }

/* ---- Build Plan table, drawn a screenful at a time (sheet.html). Every row is the same height,
   columns have fixed widths (resizable, saved per user). */
:root { --sheet-row: 25px; }
:root[data-layout="compact"] { --sheet-row: 21px; }
table.sheet { table-layout: fixed; min-width: 0; }
table.sheet td { max-width: none; }
table.sheet tbody td { height: var(--sheet-row); padding-top: 0; padding-bottom: 0; line-height: calc(var(--sheet-row) - 1px); }
table.sheet tbody tr.gap td { height: auto; padding: 0; border: 0; background: none; }
table.sheet td.empty { text-align: center; color: var(--muted); padding: 24px; height: auto; }
table.sheet .sticky { position: sticky; z-index: 1; background: var(--surface); }
table.sheet thead th.sticky { z-index: 4; }
table.sheet .sticky.edge { box-shadow: 2px 0 0 var(--line); }
table.sheet td.c { text-align: center; }
table.sheet thead th { position: sticky; top: 0; }
table.sheet thead th .rz { position: absolute; top: 0; right: -4px; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
table.sheet thead th .rz:hover, body.resizing table.sheet thead th .rz { background: color-mix(in srgb, var(--accent) 45%, transparent); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
tr.pri-0 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-0); color: var(--pri-ink); }
tr.pri-1 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-1); color: var(--pri-ink); }
tr.pri-2 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-2); color: var(--pri-ink); }
tr.pri-3 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-3); color: var(--pri-ink); }
tr.pri-3-3 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-3-3); color: var(--pri-ink); }
tr.pri-3-5 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-3-5); color: var(--pri-ink); }
tr.pri-4 td:is([data-f="pri"], [data-f="star"], [data-f="gpn"]) { background: var(--pri-4); color: var(--pri-ink); }
tr:is(.pri-0, .pri-1, .pri-2, .pri-3, .pri-3-3, .pri-3-5, .pri-4) td[data-f="gpn"] a { color: var(--pri-ink); text-decoration: underline; }
table.sheet tr.sel td { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
table.sheet tr.sel td.sticky.edge { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent), 2px 0 0 var(--line); }

/* Part details beside the sheet. */
.part-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(580px, 94vw); display: flex;
              flex-direction: column; background: var(--bg); border-left: 1px solid var(--line);
              box-shadow: -10px 0 30px rgba(0,0,0,.25); }
.pp-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line);
           background: var(--surface); font-size: 14px; }
.pp-head strong { font-size: 16px; }
.pp-head button.link { font-size: 16px; padding: 2px 6px; }
.pp-content { flex: 1; overflow-y: auto; padding: 12px 16px 40px; }
.pp-content h1 { font-size: 18px; }
.pp-content .facts { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.pp-content .part-fields { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pp-content .table-wrap { overflow-x: auto; }
@media (min-width: 1300px) { body.with-panel.page-sheet > main { padding-right: min(600px, 44vw); } }

/* Builds page: drag a build by its grip, or use the arrows, to change the order. */
.sched td.move { width: 1%; color: var(--muted); }
.sched .grip { cursor: grab; padding: 0 6px 0 2px; letter-spacing: -2px; font-size: 15px; user-select: none; }
.sched .grip:hover { color: var(--accent); }
.sched td.move button.link { font-size: 11px; padding: 0 3px; color: var(--muted); }
.sched td.move button.link:hover, .sched td.move button.link:focus-visible { color: var(--accent); }
.sched tr.dragging td { opacity: .45; background: var(--accent-soft); }
@keyframes moved { from { background: var(--accent-soft); } }
.sched tr.moved td { animation: moved 1.4s ease-out; }
/* Each build line a little bigger (the owner, 10/30/26): roomier rows, larger text and boxes; the headings keep their
   size so the table still fits a 1440-wide screen. Compact keeps the dense table. */
:root:not([data-layout="compact"]) table.sched td { padding: 8px 8px; font-size: 14.5px; }
:root:not([data-layout="compact"]) table.sched td.n { white-space: nowrap; }   /* "1,245 use" on one line */
:root:not([data-layout="compact"]) table.sched th { white-space: normal; }     /* "Using / alternates" when it's tight */
:root:not([data-layout="compact"]) table.sched td :is(input, select) { padding: 7px 8px; font-size: 14.5px; }
:root:not([data-layout="compact"]) table.sched td input[type=number] { width: 92px; }
:root:not([data-layout="compact"]) table.sched td input.pos { width: 60px; }
:root:not([data-layout="compact"]) table.sched td .small { font-size: 13px; }
:root:not([data-layout="compact"]) table.sched .mech-chip { padding: 2px 9px; font-size: 12px; }
:root:not([data-layout="compact"]) table.sched .grip { font-size: 17px; }
:root:not([data-layout="compact"]) table.sched td.move button.link { font-size: 12.5px; }
.order-note { margin: 12px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Quick views: one click sets filters, sort and build columns. */
.views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 10px; font-size: 13px; }
.views .chip { cursor: pointer; font: inherit; font-size: 12.5px; }
.views .chip.on { color: var(--accent-ink); }
.views .chip.saved { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; }
.views .chip.saved button.link { color: inherit; font-size: 12.5px; padding: 0; }
.views .chip.saved button.x { font-size: 11px; padding: 0 4px; opacity: .7; }
.views .chip.saved button.x:hover { opacity: 1; color: var(--bad); }
.views .view-ask { display: inline-flex; align-items: center; gap: 6px; }
.views .view-ask input, .views .view-ask select { padding: 3px 8px; font-size: 13px; }
.views button.link { color: var(--accent); font-size: 12.5px; }
.btn.small { padding: 3px 10px; font-size: 12px; }

/* Summary: shortages by buyer, priority and build; each number filters the sheet. */
.summary { margin: 10px 0 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.summary-toggle { display: flex; align-items: center; gap: 6px; width: 100%; background: none; color: var(--ink);
                  font-weight: 600; font-size: 13px; padding: 7px 12px; text-align: left; border-radius: var(--radius); }
.summary-toggle::after { content: "▾"; color: var(--muted); }
.summary.closed .summary-toggle::after { content: "▸"; }
.summary-toggle:hover { background: var(--cat-bg); }
.summary-body { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(260px, 2fr);
                gap: 6px 22px; padding: 2px 12px 10px; }
.summary.closed .summary-body { display: none; }
.sum-group h3 { margin: 4px 0 6px; font-size: 11.5px; }
.sum-group { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px 6px; }
.sum-group h3 { flex-basis: 100%; }
.sum-item { display: inline-flex; align-items: center; gap: 8px; background: var(--cat-bg); color: var(--ink);
            border: 1px solid transparent; border-radius: 6px; padding: 3px 9px; font-size: 12.5px; }
.sum-item b { color: var(--bad); font-variant-numeric: tabular-nums; }
.sum-item:hover, .sum-item:focus-visible { border-color: var(--accent); }
.sum-item.build { max-width: 100%; }
.sum-item.build .sum-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.sum-total { grid-column: 1 / -1; margin: 2px 0 0; }
@media (max-width: 1000px) { .summary-body { grid-template-columns: 1fr; } }

/* Sideways scrolling stops on a column edge, like Google Sheets: the next column always starts
   right after the frozen Buyer / PRI / GPN columns instead of sliding half under them. */
.sheet-wrap { scroll-snap-type: x mandatory; }
table.sheet thead th:not(.sticky) { scroll-snap-align: start; }

/* Activity filters. */
.activity-filters label.small { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.activity-filters input[type=search] { min-width: 180px; }

/* Build page: can we build it? */
.can-build-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.can-build { border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 6px; padding: 10px 12px; }
.can-build.ok { border-left-color: var(--good); }
.can-build .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.can-build .v { font-size: 24px; font-weight: 700; margin: 2px 0; }
.can-build.ok .v { color: var(--good); }
.can-build.short .v { color: var(--bad); }
.can-build .v .of { font-size: 14px; font-weight: 500; color: var(--muted); }
.can-build .limits { margin-top: 6px; line-height: 1.6; }
.can-build-panel p .btn { margin-left: 8px; }

/* Bulk change: tick parts, then set one column on all of them. */
table.sheet .selc { text-align: center; padding: 0; }
table.sheet .selc input { margin: 0; vertical-align: middle; cursor: pointer; }
table.sheet tr.ticked td:not(.sticky) { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); }
table.sheet tr.ticked td.selc, table.sheet tr.ticked td[data-f="buyer"] { background: var(--accent-soft); }
.bulk-bar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
            margin: 0 0 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft);
            border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); font-size: 13px; }
.bulk-bar label { display: flex; align-items: center; gap: 6px; }
.bulk-bar select, .bulk-bar input { padding: 3px 8px; font-size: 13px; }
.bulk-bar button.link { color: var(--accent); font-size: 13px; }
#bulk-confirm { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
#bulk-confirm[hidden] { display: none; }

/* Full text of a cut-off cell, shown on hover. */
.hover-pop { position: fixed; z-index: 58; max-width: 440px; max-height: 320px; overflow: auto; white-space: pre-wrap;
             overflow-wrap: anywhere; padding: 8px 11px; border-radius: 6px; font-size: 13px; line-height: 1.45;
             background: var(--surface); color: var(--ink); border: 1px solid var(--line);
             box-shadow: 0 8px 24px rgba(0,0,0,.28); pointer-events: none; }

/* Parts other people changed since my last visit: a dot by the GPN. */
table.sheet td.chg a.gpn::before, .chg-dot { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 1.5px var(--surface); }
.views .chip .chg-dot { margin-right: 6px; }

/* Find a part (Ctrl+K). */
#find-dlg { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 1px solid var(--line);
            border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.35); }
#find-dlg::backdrop { background: rgba(10, 14, 20, .5); }
#find-dlg input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0;
                  padding: 14px 16px; font-size: 16px; background: transparent; }
#find-dlg input:focus { outline: none; box-shadow: none; }
.find-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.find-list li { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.find-list li.on, .find-list li:hover { background: var(--accent-soft); }
.find-list .gp { font-weight: 700; color: var(--accent); }
.find-list .ids { color: var(--muted); font-size: 12px; }
.find-list .desc { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-empty, .find-hint { padding: 10px 16px; font-size: 12.5px; color: var(--muted); margin: 0; }
.find-hint kbd { border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: inherit; font-size: 11.5px; }
.rail .find-btn { position: relative; justify-content: center; padding: 0; color: var(--rail-ink); display: flex; align-items: center; }
.rail .find-btn:hover .lbl, .rail .find-btn:focus-visible .lbl { opacity: 1; }

/* Notes: add a dated line (part page, side panel, and the Notes pop-up on the Build Plan). */
.note-add-form { margin: 0 0 14px; }
.note-add-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.note-add-row { display: flex; gap: 8px; }
.note-add-row input { flex: 1; min-width: 0; color: var(--ink); }
.notes-pop { width: 480px; }
.np-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; font-size: 13px; line-height: 1.45;
           background: var(--cat-bg); border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.notes-pop p button.link { color: var(--accent); font-size: 12px; margin-left: 6px; }

/* Inventory preview. */
.preview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.preview-actions form { margin: 0; }
.preview-grid { align-items: start; }
.preview-grid .panel { margin: 0; overflow-x: auto; }
.preview-grid td.clip { max-width: 240px; }
td.good, span.good { color: var(--good); font-weight: 700; }

/* ---- Text size (Settings): the page zooms; the rail stays as it is. Heights based on the window
   are divided by the zoom so they still fit it. */
:root { --z: 1; }
:root[data-size="xsmall"] { --z: .8; }
:root[data-size="small"] { --z: .85; }
:root[data-size="large"] { --z: 1.15; }
body > main { zoom: var(--z); }
.sheet-wrap { max-height: calc((100vh - 150px) / var(--z)); }
.part-panel { width: min(580px, calc(94vw / var(--z))); }
.text-sample.size-xsmall { font-size: 17px; } .text-sample.size-xsmall small { font-size: 8.5px; }
.text-sample.size-small { font-size: 21px; } .text-sample.size-small small { font-size: 10px; }
.text-sample.size-medium { font-size: 26px; }
.text-sample.size-large { font-size: 31px; } .text-sample.size-large small { font-size: 12.5px; }

/* ---- Counters on the rail icons. */
.rail .badge { position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
               background: var(--hi); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
               box-shadow: 0 0 0 2px #141414, 0 0 7px color-mix(in srgb, var(--hi) 75%, transparent); pointer-events: none; }
.rail .badge[hidden] { display: none; }
.rail .lbl .muted { color: #b9c0c9; font-weight: 500; }

/* ---- Pop-up messages, the same on every page: green saved, red error, amber conflict. */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end;
          gap: 8px; max-width: min(460px, calc(100vw - 36px)); font-size: calc(14px * var(--z)); pointer-events: none; }
.toast-item { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px;
              border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
              border-left: 4px solid var(--good); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); animation: toast-in .18s ease-out; }
.toast-item::before { content: "✓"; font-weight: 800; color: var(--good); line-height: 1.4; }
.toast-item.error { border-left-color: var(--bad); } .toast-item.error::before { content: "!"; color: var(--bad); }
.toast-item.warn { border-left-color: var(--warn); } .toast-item.warn::before { content: "⚠"; color: var(--warn); }
.toast-item.info { border-left-color: var(--muted); } .toast-item.info::before { content: "i"; color: var(--muted); }
.toast-item .flash { flex: 1; background: none; color: inherit; padding: 0; margin: 0; border-radius: 0; line-height: 1.4;
                     white-space: pre-line; overflow-wrap: anywhere; }
.toast-item .undo { background: none; border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 12.5px;
                    padding: 2px 10px; border-radius: 6px; }
.toast-item .undo:hover { border-color: var(--accent); }
.toast-item .x { background: none; color: var(--muted); padding: 0 4px; font-size: 13px; line-height: 1.5; }
.toast-item .x:hover { color: var(--ink); }
.toast-item.going { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- Watch list: the star. */
.part-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.part-head h1 { margin-right: auto; }
.watch-form { margin: 0; }
.watch-btn { display: inline-flex; align-items: center; gap: 6px; background: none; color: var(--ink); border: 1px solid var(--line);
             border-radius: 18px; padding: 4px 12px 4px 9px; font-size: 13px; font-weight: 600; }
.watch-btn .ic { width: 16px; height: 16px; }
.watch-btn:hover { border-color: var(--accent); }
.watch-btn.on { color: #a37800; border-color: currentColor; }
:root[data-theme="dark"] .watch-btn.on { color: #f2c14e; }
.watch-btn.on .ic { fill: currentColor; }
.watch-note { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; font-size: 13px;
              background: color-mix(in srgb, var(--hi) 13%, transparent); }
.watch-note .ic { width: 15px; height: 15px; color: var(--hi); fill: currentColor; flex: none; }
.wstar { color: #c99400; margin-right: 4px; font-size: 11px; }
:root[data-theme="dark"] .wstar { color: #f2c14e; }
.wstar.new, :root[data-theme="dark"] .wstar.new { color: var(--hi); text-shadow: 0 0 6px color-mix(in srgb, var(--hi) 85%, transparent); }
tr:is(.pri-0, .pri-1, .pri-2, .pri-3, .pri-3-3, .pri-3-5, .pri-4) td[data-f="gpn"] .wstar:not(.new) { color: var(--pri-ink); }
.views .chip .wstar { margin-right: 5px; }

/* ---- First short build, and Shipment Date warnings. */
table.sheet a.fsl { color: inherit; text-decoration: none; }
table.sheet a.fsl:hover { text-decoration: underline; }
table.sheet td.date-late { background: var(--neg-bg); color: var(--neg-ink); font-weight: 600; }
table.sheet td.date-soon { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.date-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.date-pill.late { background: var(--neg-bg); color: var(--neg-ink); }
.date-pill.soon { background: var(--warn-bg); color: var(--warn); }
.late-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 6px; vertical-align: 1px; }
.fact .v.small-v { font-size: 14px; }
.fact .v a { color: inherit; }

/* ---- The part's stock across the builds (part page and side panel). */
.stock-line { margin: 0 0 14px; }
.stock-line svg.spark { display: block; width: 100%; height: auto; max-height: 130px; margin-top: 6px; background: var(--cat-bg);
                        border-radius: 6px; }
.spark .zero { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .negzone { fill: var(--neg-bg); }
.spark .ln { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark circle { fill: var(--accent); }
.spark circle.neg { fill: var(--bad); }
.spark circle.first { fill: var(--bad); stroke: var(--surface); stroke-width: 1.5; }

/* ---- Loading: grey placeholder rows while the Build Plan arrives, and in the side panel. */
.sheet-skeleton { padding: 30px 0 6px; }
.sk-row { display: grid; grid-template-columns: 40px 34px 96px minmax(0, 1fr) 120px; gap: 14px; padding: 8px 10px;
          border-bottom: 1px solid var(--line); }
.sk-row span, .pp-skeleton span { display: block; height: 9px; border-radius: 5px;
  background: linear-gradient(90deg, var(--cat-bg) 25%, color-mix(in srgb, var(--cat-bg) 45%, var(--surface)) 50%, var(--cat-bg) 75%);
  background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
.sk-row:nth-child(3n) span:nth-child(4) { width: 70%; } .sk-row:nth-child(3n+1) span:nth-child(4) { width: 85%; }
.pp-skeleton { display: grid; gap: 14px; padding-top: 6px; }
.pp-skeleton .w40 { width: 40%; } .pp-skeleton .w60 { width: 60%; height: 18px; } .pp-skeleton .w70 { width: 70%; }
.pp-skeleton .w80 { width: 80%; } .pp-skeleton .box { height: 56px; border-radius: 8px; } .pp-skeleton .tall { height: 170px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-row span, .pp-skeleton span { animation: none; } }

/* ---- Phones and small tablets: a card per part instead of the wide table (read-only). */
.card-list { padding: 8px; }
.card-list .empty { text-align: center; color: var(--muted); padding: 24px; }
.pcard { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; height: 96px; margin: 0 0 8px;
         padding: 7px 11px; box-sizing: border-box; text-align: left; background: var(--surface); color: var(--ink);
         border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; font-weight: 400; }
.pcard.sel, .pcard:hover { border-color: var(--accent); }
.pc-top { display: flex; align-items: center; gap: 8px; }
.pc-gpn { font-size: 14px; }
.pc-buyer { color: var(--muted); font-size: 12px; }
.pc-dem { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-dem.neg { color: var(--bad); }
.pc-desc, .pc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta { font-size: 12px; color: var(--muted); }
.cards-mode :is(#cols-btn, #builds-btn, #bulk-bar, #builds-pick, #cols-pick) { display: none !important; }
@media (max-width: 700px) {
  .part-panel { width: calc(100vw / var(--z)); }
  .sheet-wrap { max-height: calc(80vh / var(--z)); }
  .summary-body { padding: 2px 10px 10px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; align-items: stretch; }
}

/* ---- The IntrepidCS MRP logo (_mrp_logo.html): its words, wherever it's drawn. */
.mrp-logo .mrp-co { font-family: Bahnschrift, "Arial Narrow", "Segoe UI", Arial, sans-serif; font-weight: 700;
  font-stretch: semi-condensed; font-size: 92px; }
.mrp-logo .mrp-name { font-family: Impact, "Arial Black", "Segoe UI Black", sans-serif; font-weight: 400;
  font-size: 130px; letter-spacing: 10px; fill: #000; }                                /* black spray paint */
.mrp-logo .mrp-drips { fill: none; stroke: #000; stroke-linecap: round; }      /* width: per size, _mrp_logo.html */
.mrp-small .mrp-name { letter-spacing: 20px; }                    /* small (the sidebar): letters kept apart */

/* ---- My day. */
.my-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.my-head h1 { margin: 0; }
.me-form { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; }
.me-form label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.me-form select { padding: 3px 8px; font-size: 13px; }
.my-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 16px; }
main a.my-tile { display: grid; gap: 4px; padding: 11px 14px; border-radius: 10px; background: var(--surface); color: var(--ink);
                 border: 1px solid var(--line); border-left: 4px solid var(--line); text-decoration: none; }
.my-tile .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.my-tile b { font-size: 24px; font-variant-numeric: tabular-nums; }
.my-tile.bad { border-left-color: var(--bad); } .my-tile.bad b { color: var(--bad); }
.my-tile.warn { border-left-color: var(--warn); } .my-tile.warn b { color: var(--warn); }
.my-tile.accent { border-left-color: var(--hi); }
main a.my-tile:hover { border-color: var(--accent); }
.my-table td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-table td.pre { white-space: pre-line; min-width: 160px; font-size: 12.5px; }
.my-table .gpn-link { font-weight: 700; }
.my-table tr.w-changed td { background: color-mix(in srgb, var(--hi) 9%, transparent); }
.my-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.my-notes li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.my-notes .note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.panel-head-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.panel-head-row h2 { margin-right: auto; }
.panel-head-row form { margin: 0; }
h2 .ic { width: 16px; height: 16px; vertical-align: -2px; color: #c99400; fill: currentColor; }
form.inline { display: inline; margin: 0 0 0 8px; }

/* ---- Empty pages and views: what it means and what to do next. */
.empty-state { display: flex; gap: 14px; align-items: flex-start; padding: 22px 24px; margin: 8px 0 16px; border: 1px dashed var(--line);
               border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; white-space: normal; }
.empty-state.small { padding: 14px 16px; margin: 4px 0; }
.empty-state .es-icon { flex: none; color: var(--good); }
.empty-state strong { display: block; font-size: 15px; margin: 2px 0 4px; }
.empty-state p { margin: 0 0 6px; color: var(--muted); max-width: 640px; line-height: 1.45; }
.empty-state .es-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
table.sheet td.empty, .card-list .empty { padding: 18px; text-align: left; }
table.sheet td.empty .empty-state { margin: 0 auto 0 0; max-width: 620px; position: sticky; left: 12px; }
.sum-item.good b { color: var(--good); }
.date-pill.ok { background: var(--good-bg); color: var(--good); }

/* ---- Shortage map: short parts against the scheduled builds. */
body.page-map > main { max-width: none; }
.map-help { margin: 6px 0 10px; max-width: 980px; line-height: 1.6; }
.map-help .key, .smap td.u, .smap td.s, .smap td.f { border-radius: 3px; }
.map-help .key { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin: 0 3px 0 6px; }
.key.u, .smap td.u { background: color-mix(in srgb, var(--good) 45%, var(--surface)); }
.key.s, .smap td.s { background: color-mix(in srgb, var(--bad) 55%, var(--surface)); }
.key.f, .smap td.f { background: var(--bad); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 40%, transparent); }
.map-wrap { overflow: auto; max-height: calc((100vh - 190px) / var(--z)); border: 1px solid var(--line); border-radius: var(--radius);
            background: var(--surface); }
/* PRI, GPN and Demand take only what they need; the page script sets --cw so the build columns share the rest. */
table.smap { width: auto; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.smap td { width: var(--cw, 15px); min-width: var(--cw, 15px); height: 15px; padding: 0; }
.smap td.u, .smap td.s, .smap td.f { cursor: help; }
.smap td:hover { outline: 2px solid var(--accent); }
.smap .mg { position: sticky; z-index: 2; background: var(--surface); padding: 0 6px; white-space: nowrap; width: auto; }
.smap .mg:first-child { left: 0; }
.smap .mg.gp { left: var(--gp-left, 44px); font-weight: 700; }
.smap .mg.dem { left: var(--dem-left, 130px); text-align: right; color: var(--bad); font-variant-numeric: tabular-nums; box-shadow: 2px 0 0 var(--line); }
.smap td.mg:hover { outline: none; }
.smap .mg .tag { font-size: 9.5px; padding: 0 4px; }
.smap thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); vertical-align: bottom; }
.smap thead th.mg { z-index: 4; text-align: left; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.smap th.bh { width: var(--cw, 15px); height: 150px; padding: 0 0 2px; position: sticky; }
.smap th.bh a { display: block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; overflow: hidden;
                text-overflow: ellipsis; max-height: 118px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; margin: 0 auto; }
.smap th.bh a:hover { color: var(--ink); }
.smap th.bh i { display: block; width: calc(var(--cw, 15px) * .6); margin: 3px auto 0; background: var(--bad); border-radius: 2px; }
.smap .map-empty { padding: 20px; width: auto; height: auto; white-space: normal; }

/* ---- Orders (part page) and the On order / Next ETA columns. */
.orders-table td { vertical-align: middle; }
.eta-form { display: inline-flex; gap: 4px; align-items: center; margin: 0 0 0 8px; }
.eta-form input { width: 74px; padding: 2px 6px; font-size: 12px; }
.eta-form button.link, form.inline button.link { color: var(--accent); font-size: 12px; }
.order-form input[name=qty] { width: 90px; }
.order-form input[name=eta] { width: 96px; }
.order-form input[name=po] { width: 120px; }
table.sheet td.covers { color: var(--good); font-weight: 700; }
table.sheet td.covers::after { content: " ✓"; font-size: 10px; }
td.n .good { color: var(--good); font-weight: 700; }
#find-dlg .find-head { display: block; padding: 4px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
                       color: var(--muted); cursor: default; }
#find-dlg .find-head:hover { background: none; }
.recent-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
main a.chip { text-decoration: none; }

/* ---- Roomy rows (Settings > View): taller Build Plan rows showing two lines of each cell. */
:root[data-layout="roomy"] { --sheet-row: 44px; }
:root[data-layout="roomy"] table.sheet tbody td { line-height: 19px; padding-top: 3px; padding-bottom: 2px; }
table.sheet .cl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal;
                  overflow-wrap: anywhere; }
.view-roomy { gap: 6px; }
.view-roomy span { height: 22px; }

/* ---- Builds: list / readiness board switch, and the board. */
.view-switch-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.view-switch-row .muted { margin-left: 8px; }
body.page-board > main { max-width: none; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: 10px;
         padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bcard.ok { border-top-color: var(--good); } .bcard.part { border-top-color: var(--warn); } .bcard.no { border-top-color: var(--bad); }
.bcard header { display: flex; align-items: baseline; gap: 8px; }
.bcard header a { font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.bcard header a:hover { text-decoration: underline; }
.bcard .bn { color: var(--muted); font-weight: 600; }
.bcard .bc { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.bcard .big { font-size: 19px; font-weight: 700; margin: 2px 0; }
.bcard.ok .big { color: var(--good); } .bcard.no .big { color: var(--bad); } .bcard.part .big { color: var(--warn); }
.bcard .big .of { font-size: 13px; font-weight: 500; color: var(--muted); }
.bcard p { margin: 0; }
.meter { height: 6px; border-radius: 3px; background: var(--cat-bg); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.bcard.part .meter i { background: var(--warn); } .bcard.no .meter i { background: var(--bad); }
.blockers { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; }
.blockers li { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; border-top: 1px solid var(--line); padding-top: 5px; }
.blockers .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blockers .bk { grid-column: 1 / -1; color: var(--bad); font-size: 12px; }
.blockers .ord { color: var(--good); }

/* ---- Vendors. */
.vendor-list { display: grid; gap: 8px; }
.vgroup { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.vgroup > summary { display: flex; align-items: baseline; gap: 16px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.vgroup > summary::before { content: "▸"; color: var(--muted); }
.vgroup[open] > summary::before { content: "▾"; }
.vgroup .vname { font-weight: 700; font-size: 15px; min-width: 180px; }
.vgroup .vstat { color: var(--muted); font-size: 13px; }
.vgroup .vstat b { color: var(--ink); font-variant-numeric: tabular-nums; }
.vgroup .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.vtable td.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Account menu behind your initial (Change password, Sign out). */
.rail button.side-user { background: none; border: 0; padding: 8px 0 2px; cursor: pointer; width: auto; }
.rail button.side-user:hover .avatar, .rail button.side-user[aria-expanded="true"] .avatar { box-shadow: 0 0 0 2px var(--hi), 0 0 8px color-mix(in srgb, var(--hi) 60%, transparent); }
.rail .side-foot { position: relative; }
.acct-menu { position: absolute; left: calc(100% + 10px); bottom: 0; z-index: 120; min-width: 200px; display: grid; gap: 2px;
             background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px;
             box-shadow: 0 12px 34px rgba(0,0,0,.35); }
.acct-menu[hidden] { display: none; }
.acct-menu .am-name { font-size: 12.5px; color: var(--muted); padding: 4px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-menu .am-name b { color: var(--ink); }
.acct-menu a, .acct-menu button.link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 6px;
             color: var(--ink); font-size: 13.5px; text-decoration: none; background: none; text-align: left; }
.acct-menu a:hover, .acct-menu button.link:hover { background: var(--accent-soft); color: var(--ink); }
.acct-menu .ic { width: 16px; height: 16px; }
.acct-menu form { margin: 0; }
@media (max-width: 900px) { .acct-menu { left: auto; right: 8px; top: 100%; bottom: auto; }
  .rail .side-user { display: flex; } }          /* style.css hides it on phones; it holds Sign out now */
/* The rail's round icon buttons mustn't apply to the menu's rows. */
.rail .acct-menu a, .rail .acct-menu a:hover, .rail .acct-menu button.link {
  width: 100%; height: auto; margin: 0; padding: 7px 8px; border-radius: 6px; justify-content: flex-start; box-shadow: none;
  background: none; color: var(--ink); }
.rail .acct-menu a:hover, .rail .acct-menu button.link:hover { background: var(--accent-soft); }
.rail .acct-menu .ic { width: 16px; height: 16px; filter: none; stroke-width: 2; }
/* The Backorder Tracker's own icon under your initial: opens that app in a new tab. */
.rail .side-foot a.app-link, .rail .side-foot a.app-link:hover { width: 38px; height: 38px; margin: 4px 0 0; border-radius: 9px;
  background: none; box-shadow: none; }
.rail a.app-link img { display: block; border-radius: 7px; box-shadow: 0 1px 3px rgba(0,0,0,.45); transition: box-shadow .12s, transform .12s; }
.rail a.app-link:hover img, .rail a.app-link:focus-visible img { box-shadow: 0 0 0 2px var(--hi), 0 0 8px color-mix(in srgb, var(--hi) 60%, transparent); transform: translateY(-1px); }

/* ---- Sending: the form on the Inbox, part pages and build pages. */
.send-box { margin: 4px 0 12px; }
.send-box > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent); font-size: 13px;
                      font-weight: 600; list-style: none; padding: 4px 0; }
.send-box > summary::-webkit-details-marker { display: none; }
.send-box > summary .ic { width: 16px; height: 16px; }
.send-box[open] > summary { margin-bottom: 6px; }
.send-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.send-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; }
.send-row.end { justify-content: space-between; }
.send-row label { display: flex; align-items: center; gap: 6px; }
.send-row input, .send-row select { padding: 3px 8px; font-size: 13px; color: var(--ink); }
.send-form .due { display: none; }
.send-form:has(input[value="action"]:checked) .due { display: flex; }
.to-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.to-pick legend { float: left; font-size: 12px; color: var(--muted); margin-right: 6px; padding: 0; }
.to-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border: 1px solid var(--line);
           border-radius: 14px; font-size: 12.5px; cursor: pointer; user-select: none; }
.to-chip.group { font-weight: 700; }
.to-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.to-chip input { margin: 0; }
.send-form textarea { width: 100%; font: inherit; color: var(--ink); resize: vertical; min-height: 64px; }
.compose > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.compose > summary::-webkit-details-marker { display: none; }
.compose[open] > summary { margin-bottom: 10px; }
details.panel.compose { padding: 10px 14px; }

/* ---- Inbox. */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 10px; }
.tabs a { padding: 7px 14px; color: var(--muted); text-decoration: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px;
          font-weight: 600; font-size: 13.5px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--hi); color: var(--accent-ink);
            font-size: 11px; text-align: center; }
.msg-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.msg-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 9px 14px;
               border-bottom: 1px solid var(--line); }
.msg-list li:last-child { border-bottom: 0; }
.msg-list.actions li { grid-template-columns: auto minmax(0, 1fr) auto; }
.msg-list .to-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-link { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; color: var(--ink);
            text-decoration: none !important; min-width: 0; }
.msg-list.actions .msg-link, .msg-list.sent .msg-link { grid-template-columns: minmax(0, 1fr) auto; }
.msg-link .who, .msg-link .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-link .what b { font-weight: 500; }
.msg-list li.unread { background: color-mix(in srgb, var(--hi) 7%, var(--surface)); }
.msg-list li.unread .who, .msg-list li.unread .what b { font-weight: 800; }
.msg-list li.unread .who::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hi);
                                   margin-right: 6px; vertical-align: 1px; }
.msg-list li.done .what b { text-decoration: line-through; color: var(--muted); }
.msg-link:hover .what b { text-decoration: underline; }
.ctxs { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.ctx { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--cat-bg); color: var(--ink);
       text-decoration: none !important; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
a.ctx:hover { background: var(--accent-soft); }
.tag.action { background: color-mix(in srgb, var(--hi) 20%, transparent); color: var(--ink); margin-right: 4px; }
.tag.action.done { background: var(--good-bg); color: var(--good); }
.date-pill.plain { background: var(--cat-bg); color: var(--ink); }
.st { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--cat-bg); color: var(--muted); }
.st.read { color: var(--ink); }
.st.done { background: var(--good-bg); color: var(--good); font-weight: 700; }
form.tick { margin: 0; }
.tick-btn { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: none; color: transparent;
            font-weight: 800; font-size: 13px; line-height: 20px; }
.tick-btn:hover { border-color: var(--good); color: var(--good); }
.tick-btn.on { background: var(--good); border-color: var(--good); color: #fff; }

/* ---- A conversation. */
.thread-head h1 { font-size: 20px; }
.action-box { display: grid; gap: 8px; }
.action-box p { margin: 0; }
.action-done { display: flex; align-items: center; gap: 10px; margin: 0; }
.action-box .st { margin-right: 6px; }
ol.thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; max-width: 860px; }
ol.thread li { display: flex; }
ol.thread li.mine { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
li.mine .bubble { background: color-mix(in srgb, var(--hi) 12%, var(--surface)); border-color: color-mix(in srgb, var(--hi) 35%, var(--line)); }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.45; }
.bubble .seen { margin-top: 4px; text-align: right; }
.reply-form { display: grid; gap: 8px; max-width: 860px; }
.reply-form textarea { width: 100%; font: inherit; color: var(--ink); resize: vertical; }
.reply-form button { justify-self: end; }

/* ---- My day: For you. */
.for-you { margin: 12px 0 0; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--hi) 45%, var(--line)); border-radius: 10px;
           background: color-mix(in srgb, var(--hi) 6%, var(--surface)); }
.fy-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fy-head a { margin-left: auto; font-size: 13px; }
.fy-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.fy-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 700px) { .msg-link { grid-template-columns: minmax(0, 1fr); } .bubble { max-width: 92%; } }

/* ---- Team. */
body.page-team > main { max-width: none; }
.team-table td a { font-weight: 700; text-decoration: none; }
.team-table td a.neg { color: var(--bad); }
.team-table td a:hover { text-decoration: underline; }
.pri-mix { display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 260px; }
.team-table th, .team-table td { white-space: nowrap; }
.pri-mix a { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ---- Part page: alternates side by side. */
.alt-table tr.this td { background: var(--cat-bg); }
.alt-table td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .v.good { color: var(--good); }

/* ---- Vendors: order list download. */
.vgroup .vdl { margin-left: auto; }

/* ---- Welcome tour. */
.tour-ring { position: fixed; z-index: 200; border-radius: 12px; pointer-events: none; transition: all .25s ease;
             box-shadow: 0 0 0 3px var(--hi), 0 0 0 9999px rgba(8, 10, 14, .55); }
.tour-card { position: fixed; z-index: 201; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
             border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); transition: top .25s, left .25s; }
.tour-card h2 { font-size: 16px; margin: 2px 0 6px; }
.tour-card p { margin: 0 0 12px; line-height: 1.45; color: var(--ink); }
.tour-card .tc-step { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--hi); font-weight: 700; }
.tour-card .tc-buttons { display: flex; align-items: center; gap: 8px; }
.tour-card .tc-buttons button.link { color: var(--muted); font-size: 12.5px; }
.tour-card .spacer { flex: 1; }
@media (prefers-reduced-motion: reduce) { .tour-ring, .tour-card { transition: none; } }

/* ---- Rail size (Settings): Slim = the 60px icon rail above, names pop out on hover; Wide (the default) = 240px with
   each page's name beside its icon, small group headings, and a status line that opens on hover and on the open page. */
.rail .bub { display: contents; }
.rail .rail-group, .rail .tail { display: none; }
.rail .lbl .det { color: #b9c0c9; font-weight: 500; margin-left: 4px; }
.rail .lbl .det:not(.news) { display: none; }
.rail .lbl .det.news::before { content: "· "; }

@media (min-width: 901px) {
  html[data-rail="wide"] body.with-side { grid-template-columns: 240px minmax(0, 1fr); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .side.rail {
    width: 240px; padding: 10px 10px; align-items: stretch;
    background-image: url("rail-board-wide.png"),
      linear-gradient(180deg, rgba(200, 22, 29, .95) 0%, rgba(200, 22, 29, .75) 35%, rgba(20, 20, 20, 0) 100%),
      conic-gradient(from 45deg, #141414 25%, #262626 0 50%, #141414 0 75%, #262626 0);
    background-size: 240px auto, 100% 100%, 8px 8px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot { justify-items: stretch; gap: 3px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-sep { display: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .rail-group { display: block; margin: 10px 8px 2px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: rgba(255, 255, 255, .62); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

  /* Rows: a round icon bubble, then the name (and the status line under it). */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav a, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot > a, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user {
    display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: auto; height: auto; min-height: 38px;
    margin: 0; padding: 0 10px 0 3px; border-radius: 12px; background: none; box-shadow: none; text-align: left;
    transition: background .15s, min-height .15s; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .bub { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0, 0, 0, .36); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .35); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .bub .ic { width: 18px; height: 18px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl { position: static; transform: none; opacity: 1; display: grid; min-width: 0; padding: 0; background: none;
    box-shadow: none; border-radius: 0; line-height: 1.2; color: #f1f4f8; font-size: 13.5px; font-weight: 600; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .65); transition: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .nm { overflow: hidden; text-overflow: ellipsis; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .det:not(.news) { display: block; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .det { display: block; margin: 0; font-size: 11px; color: #b9c0c9; font-weight: 500; overflow: hidden;
    text-overflow: ellipsis; max-height: 0; opacity: 0; transition: max-height .15s, opacity .15s; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .det.news::before { content: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .badge { position: static; order: 3; margin-left: auto; flex: none; box-shadow: 0 0 6px color-mix(in srgb, var(--hi) 60%, transparent); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .tail { display: inline; order: 4; margin-left: auto; color: #c9d1db; font-size: 12px; }

  /* Hover: the row becomes a dark glass bar and its status line opens. */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav a:hover:not(.on), html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot > a:hover:not(.on),
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn:hover, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user:hover,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user[aria-expanded="true"] {
    min-height: 44px; background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); color: var(--rail-on); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a:hover .det, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn:hover .det,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user:hover .det, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user[aria-expanded="true"] .det,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .det { max-height: 16px; opacity: 1; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a:hover .bub, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn:hover .bub { color: var(--rail-on); }
  /* The page you're on: a blue glass bar with its status line showing. */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on:hover {
    min-height: 44px; background: color-mix(in srgb, var(--hi) 24%, transparent); color: var(--rail-on);
    box-shadow: inset 0 0 0 1.5px var(--rail-ink), 0 0 10px color-mix(in srgb, var(--hi) 45%, transparent); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .bub { background: color-mix(in srgb, var(--hi) 30%, transparent); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .lbl { color: #fff; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .det { color: #d6ecff; }

  /* Name beside the mark at the top; your initial and the Backorder Tracker at the bottom. */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: auto; height: auto;
    padding: 2px 6px 8px; background: none; box-shadow: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand .lbl .nm { font-size: 16px; font-weight: 800; color: #fff; }
  /* The IntrepidCS MRP logo on the right of the name (base.html). */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand .brand-mrp { display: block; margin-left: auto; height: 81px; padding: 4px 5px;
    background: #fff; border: 2px solid #111; border-radius: 8px; box-sizing: border-box; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand .brand-mrp svg { display: block; height: 100%; width: auto; }
  /* With the logo: the mark above the name in a white box the same size and look as the logo's (74 x 81 px, its
     border), the logo on the right. The box is the grid's ::before, under the mark and the name. */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) { display: grid; grid-template-columns: auto 1fr;
    grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp)::before { content: ""; grid-column: 1; grid-row: 1 / span 2;
    width: 74px; height: 81px; box-sizing: border-box; background: #fff; border: 2px solid #111; border-radius: 8px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) > img { grid-column: 1; grid-row: 1; justify-self: center; align-self: end;
    width: 54px; height: 54px; border-radius: 0; }      /* the cube large, the name under it smaller */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) .lbl { grid-column: 1; grid-row: 2; justify-self: center; align-self: start;
    flex: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) .lbl .nm { font-size: 15px; line-height: 1.05; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) .nm-build { color: #000; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) .nm-iq { color: #c8161d; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp) .brand-mrp { grid-column: 2; grid-row: 1 / span 2;
    justify-self: end; margin-left: 0; margin-right: 10px; }    /* right edge in line with the buttons below */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot { padding-top: 8px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user { padding: 0 10px 0 4px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user:hover .avatar { box-shadow: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot a.app-link { padding-left: 5px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot a.app-link img { width: 26px; height: 26px; margin: 0 3px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.app-link:hover img { box-shadow: 0 1px 3px rgba(0, 0, 0, .45); transform: none; }
}
/* The page list scrolls on its own when the window is too short for it; Settings, your initial and the Backorder
   Tracker stay at the bottom. */
@media (min-width: 901px) {
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; margin-right: -6px; padding-right: 6px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot { flex: none; }
}
/* Short windows: tighter rows so the wide rail still fits. */
@media (min-width: 901px) and (max-height: 1080px) {
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .rail-group { margin: 5px 8px 1px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav a, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot > a, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user { min-height: 33px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .bub { width: 28px; height: 28px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .avatar { width: 28px; height: 28px; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand { padding-bottom: 4px; }
}

/* Settings > Rail size: little pictures of each. */
.rail-sample { display: flex; width: 92px; height: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.rail-sample .rs-rail { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; background: linear-gradient(180deg, #c8161d, #1c1c1c); }
.rail-slim .rs-rail, .rail-retract .rs-rail { width: 9px; align-items: center; }
.rail-wide .rs-rail { width: 34px; }
.rs-rail > span { display: flex; align-items: center; gap: 3px; }
.rs-rail i { width: 5px; height: 5px; border-radius: 50%; background: var(--hi); flex: none; box-shadow: 0 0 3px color-mix(in srgb, var(--hi) 80%, transparent); }
.rs-rail b { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .75); }
.rail-slim .rs-rail b, .rail-retract .rs-rail b { display: none; }
.rs-page { flex: 1; background: repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 8px); }

/* ---- Star column on the Build Plan (between PRI and GPN): click to star a part; My day lists them. */
td[data-f="star"] { padding: 0; text-align: center; }
th[data-key="star"] { padding-left: 0; padding-right: 0; text-align: center; }
.star-btn { display: block; width: 100%; height: calc(var(--sheet-row) - 1px); border: 0; padding: 0; background: none; cursor: pointer;
            font-size: 15px; line-height: 1; color: var(--muted); opacity: .45; }
.star-btn:hover, .star-btn:focus-visible { opacity: 1; color: #c99400; }
.star-btn.on { opacity: 1; color: #c99400; }
:root[data-theme="dark"] .star-btn:is(.on, :hover, :focus-visible) { color: #f2c14e; }
.star-btn.new, :root[data-theme="dark"] .star-btn.new { color: var(--hi); text-shadow: 0 0 6px color-mix(in srgb, var(--hi) 85%, transparent); }
/* On coloured PRI rows the star sits on the same colour as PRI and GPN. */
tr:is(.pri-0, .pri-1, .pri-2, .pri-3, .pri-3-3, .pri-3-5, .pri-4) .star-btn:not(.new) { color: var(--pri-ink); }
tr:is(.pri-0, .pri-1, .pri-2, .pri-3, .pri-3-3, .pri-3-5, .pri-4) .star-btn:not(.on):not(:hover) { opacity: .4; }
.star-table td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Documents on a part: drawings, quotes, datasheets, each with its revision. */
.doc-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }   /* one column in the side panel */
.doc-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; }
.doc-group h3 .muted { font-weight: 500; }
.doc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.doc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.doc-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-dl { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--accent); flex: none; }
.doc-dl:hover { background: var(--accent-soft); }
.doc-dl .ic { width: 17px; height: 17px; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.rev-pill { flex: none; font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
            background: color-mix(in srgb, var(--hi) 16%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hi) 45%, transparent); }
:root[data-theme="dark"] .rev-pill { color: var(--hi); }
.rev-pill.na { background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.rev-pill.small { font-size: 10.5px; padding: 0 6px; }
.doc details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 5px; }
.doc-older ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.doc-older li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.doc-form { display: grid; gap: 6px; margin-top: 6px; }
.doc-form .radio { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.doc-form input[type=file] { font-size: 12.5px; max-width: 100%; }
.doc-buttons { display: flex; align-items: center; gap: 8px; }
.doc-buttons .spacer { flex: 1; }
button.link.danger { color: var(--bad); }
.doc-none { margin: 0 0 8px; }
.rev-pick { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rev-pick label { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.rev-dot { font-size: 18px; line-height: 1; }
.rev-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.doc-add { margin-top: 10px; }
.doc-add > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.doc-add > summary .ic { width: 16px; height: 16px; }
.doc-add .doc-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }

/* Minor is greyed out while Major is N/A. */
.rev-pick select:disabled { opacity: .45; cursor: not-allowed; }
.rev-pick label:has(select:disabled) { color: var(--muted); opacity: .7; }

/* ---- Deleting a GPN: the request banner, the deleted banner, the section at the bottom of a part. */
.del-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
              border: 1px solid rgba(214, 69, 65, .55); background: rgba(214, 69, 65, .12); }
.del-banner.gone { border-color: var(--line); background: var(--surface); }
.del-banner .ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--bad); }
.del-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.del-reject { display: inline-flex; gap: 6px; align-items: center; }
.del-reject input { width: 170px; }
button.danger-btn { background: #c62828; border-color: #c62828; color: #fff; }
button.danger-btn:hover { filter: brightness(1.1); }
.del-section h2 { color: var(--bad); }
td[data-f="gpn"].del-asked { outline: 2px dashed currentColor; outline-offset: -3px; }
td[data-f="gpn"].del-asked a { text-decoration: line-through; }

/* ---- Usage: the button in the Build Plan's Usage column, the "Used on" strip on a part, the usage page. */
.use-btn { display: inline-block; max-width: 100%; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; text-decoration: none;
           background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.use-btn:hover { text-decoration: none; filter: brightness(1.15); box-shadow: inset 0 0 0 1px var(--accent); }
.use-btn.none { background: none; color: var(--muted); font-weight: 500; }
.used-on { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin: 0 0 12px; }
.uo-k { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.use-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted); }
.use-chip.sched { color: var(--ink); border-color: var(--accent); }
.use-chip.alt { border-style: dashed; }
.see-usage { font-size: 12.5px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.usage-table tfoot td { border-top: 2px solid var(--line); }
tr.muted-row td { color: var(--muted); }

/* ---- IPN / MPN pairs: the ▾ picker in the Build Plan cells, its pop-up, and the list under the GPN. */
td.src-cell { position: relative; padding-right: 34px; }
.src-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 999px; padding: 0 6px;
           font-size: 10.5px; font-weight: 800; line-height: 16px; cursor: pointer; background: var(--accent-soft); color: var(--accent); }
.src-btn:hover, .src-btn:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
tr:is(.pri-0, .pri-1, .pri-2, .pri-3, .pri-3-3, .pri-3-5, .pri-4) td.src-cell .src-btn { background: var(--accent-soft); }
.src-pop { width: 460px; }
.src-pop.mk { width: 600px; }               /* with each pair's manufacturer */
.src-pop.mk .src-cols, .src-pop.mk .src-row, .src-pairs.mk .src-row { grid-template-columns: 14px minmax(80px, 1fr) minmax(110px, 1.4fr) minmax(100px, 1.3fr) 64px; }
.src-row .src-mk { overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 700px) {                /* phones: the manufacturer under the IPN and MPN, not a fifth column */
  .src-pop.mk { width: 460px; }
  .src-pop.mk .src-cols, .src-pop.mk .src-row, .src-pairs.mk .src-row { grid-template-columns: 14px minmax(90px, 1fr) minmax(120px, 1.6fr) 64px; }
  .src-pop.mk .src-row .src-mk, .src-pairs.mk .src-row .src-mk { grid-row: 2; grid-column: 2 / 4; }
  .src-pop.mk .src-cols span:nth-child(4) { display: none; }
}
.src-list { display: grid; gap: 3px; }
.src-cols { display: grid; grid-template-columns: 14px minmax(90px, 1fr) minmax(120px, 1.6fr) 64px; gap: 8px; padding: 0 8px;
            font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.src-row { display: grid; grid-template-columns: 14px minmax(90px, 1fr) minmax(120px, 1.6fr) 64px; gap: 8px; align-items: center; width: 100%;
           padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
           text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.src-row { cursor: auto; user-select: text; }
.src-row:hover { border-color: var(--accent); }
.src-pick { display: grid; place-items: center; width: 18px; height: 18px; margin: -2px; padding: 0; border: 0; background: none; cursor: pointer; }
.src-pick:disabled { cursor: default; }
.src-buy { justify-self: end; white-space: nowrap; }
.src-pref { justify-self: end; }
.src-row b, .src-row .src-mpn { overflow-wrap: anywhere; }
.src-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); }
.src-row.on { border-color: var(--accent); background: var(--accent-soft); }
.src-row.on .src-dot { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 5px var(--surface); background: var(--accent); }
.src-pref { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.src-pairs { display: grid; gap: 4px; margin: 0 0 12px; max-width: 640px; }
.src-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.src-form { margin: 0; }

/* Adding an approved IPN / MPN pair. */
.src-add { margin-top: 4px; }
.src-add > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; }
.src-add .sp-form { margin-top: 6px; }
.src-more { margin: 8px 0 0; }

/* The table is read-only: a purchasing cell opens the part's side panel at that field. */
table.sheet tbody td.go { cursor: pointer; }
table.sheet tbody td.go:hover { box-shadow: inset 0 0 0 1px var(--line); }
table.sheet tbody td.go:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Notes on approved GPNs. */
.alt-note-form { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.alt-note-form textarea { flex: 1; min-height: 44px; }
.alt-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alt-notes li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.an-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.an-head form { margin-left: auto; }

/* Approved tick boxes on the Approved GPNs page. */
.appr-box { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 5px; font-size: 13px; font-weight: 900;
            line-height: 1; border: 1.5px solid var(--muted); background: var(--surface); color: #fff; cursor: pointer; }
.appr-box.on { background: var(--good); border-color: var(--good); }
.appr-box.ro { cursor: default; }
button.appr-box:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
tr.not-ok td { color: var(--muted); }
tr.not-ok td a b { text-decoration: line-through; }

/* ---- Purchases (Qty Purchased, Shipment Date, Vendor, Notes line by line) and the PO page. */
.po-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; border-radius: 999px; padding: 0 6px;
          font-size: 10.5px; font-weight: 800; line-height: 16px; cursor: pointer; background: var(--accent-soft); color: var(--accent); }
.po-btn:hover, .po-btn:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
td.src-cell .src-v { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-pop { width: 640px; }
.po-pop .table-wrap { max-height: 50vh; overflow: auto; }
.po-table td.wrap { min-width: 200px; }
.po-table tr.note-only td { color: var(--muted); }
.purchases { display: grid; gap: 4px; margin: 0 0 14px; }
.po-form { margin-top: 10px; }
.po-form label input { min-width: 110px; }
.po-checks { display: grid; gap: 2px; flex-basis: 100%; }
.po-h { font-size: 14px; margin: 16px 0 6px; }
.po-part h2 { margin-top: 12px; }
.po-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.po-checks label.check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.po-checks label.check input { min-width: 0; width: auto; margin: 0; }

/* PO: paste several; received lines. */
.po-paste { margin-top: 12px; }
.po-paste > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; }
.po-paste-form { display: grid; gap: 8px; margin-top: 8px; }
.po-paste-form textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.po-paste-form button { justify-self: start; }
.po-table tr.got td:not(:first-child) { color: var(--muted); }

/* Order history from the PO sheet. */
.po-history { margin-top: 10px; }
.po-history > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.po-apply { display: grid; gap: 6px; }
.po-apply .check { display: flex; align-items: center; gap: 6px; }

/* ---- SMT Schedule: weeks of Mon-Fri, builds as bars coloured by status, a tray and a Complete column. */
body.page-smt > main { max-width: none; }
.smt-top { align-items: center; }
.smt-key { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.s-running { background: #2fb344; color: #062b10; }
.s-ready { background: #f2c94c; color: #3b2b00; }
.s-scheduled { background: #d64541; color: #fff; }
.s-note { background: #3d6fd6; color: #fff; }
.s-complete { background: var(--line); color: var(--muted); }
.smt-cal { display: grid; gap: 8px; }
.smt-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto repeat(var(--lanes), 30px);
            column-gap: 0; row-gap: 3px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.smt-dh { grid-row: 1; padding: 4px 8px; font-size: 12px; color: var(--muted); background: var(--accent-soft); border-left: 1px solid var(--line); }
.smt-dh:first-child { border-left: 0; }
.smt-dh b { color: var(--ink); }
.smt-dh.today { background: var(--hi); color: var(--accent-ink); }
.smt-dh.today b { color: var(--accent-ink); }
.smt-day { border-left: 1px solid var(--line); min-height: 100%; }
.smt-day:nth-of-type(6) { border-left: 0; }
.smt-day.past, .smt-dh.past { opacity: .75; }
.smt-day.today { background: color-mix(in srgb, var(--hi) 7%, transparent); }
.smt-day.drop-here, .smt-tray.drop-here { background: color-mix(in srgb, var(--hi) 22%, transparent); box-shadow: inset 0 0 0 2px var(--hi); }
.smt-bar { position: relative; z-index: 1; margin: 0 3px; padding: 0 22px 0 8px; border-radius: 6px; display: flex; align-items: center; gap: 6px;
           font-size: 12.5px; font-weight: 700; overflow: hidden; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.smt-bar.cont { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.smt-bar.more { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; padding-right: 8px; }
.smt-bar.dragging, .smt-box.dragging { opacity: .45; }
.smt-tray { display: grid; gap: 6px; min-height: 48px; padding: 6px; border: 1px dashed var(--line); border-radius: 8px; }
.smt-box { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 6px; font-size: 12.5px;
           font-weight: 700; cursor: grab; }
.smt-done { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 60vh; overflow: auto; font-size: 13px; }
.smt-dlg { width: min(560px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: var(--surface); color: var(--ink); }
.smt-dlg h2 { margin: 0 0 10px; font-size: 17px; }
.smt-dlg fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.smt-dlg label { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.smt-dlg label.check { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.smt-dlg select, .smt-dlg input:not([type=radio]) { width: 100%; }
.smt-dlg label.check input[type=checkbox] { width: auto; flex: none; }
.smt-row { display: grid; grid-template-columns: 1fr 90px 1.2fr; gap: 10px; }
.smt-buttons { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.smt-buttons .spacer { flex: 1; }
/* Export COGS BOM's pop-up (a completed build): the labor to use and prices for the parts with none. */
.cogs-x-dlg { width: min(760px, calc(100vw - 24px)); }
.cogs-exp-kinds { display: grid; gap: 10px; }
.cogs-x-dlg .cogs-x-h { margin: 14px 0 6px; font-size: 14px; }
.cogs-x-dlg .cogs-x-wrap { max-height: min(40vh, 360px); overflow: auto; margin-bottom: 10px; }
.cogs-x-dlg td.cogs-x-desc { max-width: 280px; }
.cogs-x-dlg td input { width: 110px; text-align: right; }
table.smt-need.short-only tr.ok-row { display: none; }
/* Phones and narrow windows: the menu row keeps its own height on short pages (the page takes the rest). */
@media (max-width: 900px) { body.with-side { grid-template-rows: auto 1fr; align-content: start; } }

/* Completing an SMT build: how many were built. */
.smt-built-dlg { width: min(380px, calc(100vw - 24px)); }
.smt-complete-btn { background: #2fb344; border-color: #2fb344; color: #062b10; }

/* COGS: what each BOM costs to build. */
.cogs-tag.ok { background: var(--good-bg); color: var(--good); }
.cogs-tag.review { background: var(--warn-bg); color: var(--warn); }
.cogs-tag.none { background: var(--cat-bg); color: var(--muted); }
.cogs-table td.cogs-desc { min-width: 220px; max-width: 420px; }
.cogs-issue { font-size: 12px; color: var(--bad); margin-top: 2px; }
.cogs-detail { max-width: 260px; }
.cogs-pct { display: inline-block; min-width: 38px; margin-left: 4px; font-size: 11px; color: var(--muted); }
.cogs-pct.up { color: var(--bad); font-weight: 700; }
.cogs-pct.down { color: var(--good); font-weight: 700; }
.cogs-table .tag { white-space: nowrap; }
.tag.src-cogs { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.tag.src-price { background: var(--cat-bg); color: var(--ink); }
.tag.src-purchase { background: var(--warn-bg); color: var(--warn); }
.tag.src-missing { background: var(--bad-bg); color: var(--bad); }
.cogs-price-btn { background: none; color: var(--accent); border: 1px dashed transparent; padding: 1px 4px; font-variant-numeric: tabular-nums; }
.cogs-price-btn:hover { border-color: var(--accent); }
tr.short-row .cogs-price-btn { color: var(--bad); font-weight: 700; }
.cogs-qty { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 4px 0 12px; }
.cogs-qty label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.cogs-qty input { width: 120px; color: var(--ink); }
.cogs-qty .muted { padding-bottom: 7px; }
.cogs-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 0; margin: 0 0 12px; counter-reset: step; }
.cogs-steps li { counter-increment: step; display: grid; gap: 2px; padding: 8px 12px 8px 40px; position: relative;
                 background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.cogs-steps li::before { content: counter(step); position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
                         width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
                         background: var(--cat-bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.cogs-steps li.done::before { content: "✓"; background: var(--good-bg); color: var(--good); }
.cogs-steps li span { color: var(--muted); font-size: 12px; }
.cogs-alert, .cogs-banner { background: var(--warn-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
                            border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.cogs-banner { background: var(--cat-bg); border-color: var(--line); display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.cogs-banner > div:first-child { flex: 1 1 320px; }
.cogs-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cogs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.cogs-layout.cogs-compare { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cogs-layout.cogs-compare { grid-template-columns: minmax(0, 1fr); } }
.cogs-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.cogs-layout > .panel { margin: 0; }
.cogs-side .panel { margin: 0; }
.cogs-side h2 { font-size: 15px; margin: 0 0 10px; }
.cogs-summary dl, .cogs-labor-ro { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 13px; }
.cogs-summary dt, .cogs-labor-ro dt { color: var(--muted); }
.cogs-summary dd, .cogs-labor-ro dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.cogs-summary .big { font-size: 15px; font-weight: 700; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line); }
.cogs-total { display: grid; gap: 2px; margin: 12px 0 0; padding: 12px; border-radius: var(--radius); background: var(--cat-bg); }
.cogs-total span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cogs-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.cogs-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; margin-top: 12px; }
.cogs-save { width: 100%; }
.cogs-save summary { list-style: none; display: inline-block; }
.cogs-save summary::-webkit-details-marker { display: none; }
.cogs-save form, .cogs-compare-form { display: grid; gap: 8px; margin-top: 10px; }
.cogs-save label, .cogs-compare-form label, .cogs-copy { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.cogs-save input, .cogs-compare-form select, .cogs-compare-form input, .cogs-copy select { width: 100%; color: var(--ink); }
.cogs-save .btn, .cogs-compare-form .btn { justify-self: start; }
.cogs-compare-form + .cogs-compare-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cogs-labor { display: grid; gap: 7px; }
.cogs-labor > label { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.cogs-money { position: relative; }
.cogs-money::before { content: "$"; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.cogs-money input { width: 100%; padding-left: 18px; text-align: right; color: var(--ink); }
.cogs-labor-total { display: flex; justify-content: space-between; padding-top: 7px; border-top: 1px solid var(--line); font-size: 13px; }
.cogs-labor .btn { justify-self: start; }
.cogs-labor .muted.small, .cogs-labor-ro + .muted { margin: 0; }
.cogs-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.cogs-runs li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; }
.cogs-runs li .n { grid-column: 1 / -1; text-align: left; color: var(--muted); font-size: 12px; }
.cogs-runs li .muted.small { grid-column: 1 / -1; }
.cogs-runs li > span.muted.small:first-of-type { grid-column: auto; }
.cogs-skipped { margin-top: 10px; font-size: 13px; }
.cogs-skipped summary { cursor: pointer; color: var(--muted); }
.cogs-filter { margin: 2px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.cogs-up { color: var(--bad); font-weight: 600; }
.cogs-down { color: var(--good); font-weight: 600; }
.cogs-strong td { font-weight: 700; }
.cogs-verdict { font-size: 14px; margin: 12px 0 6px; }
@media (max-width: 700px) {
  .cogs-qty input { width: 96px; }
  .cogs-labor > label { grid-template-columns: 1fr 110px; }
}

/* COGS: DigiKey / Mouser search in the price dialog. */
.cogs-price-dlg { width: min(940px, calc(100vw - 24px)); }
.cogs-search { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cat-bg); }
.cogs-search-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.cogs-search-row label { flex: 1 1 260px; display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.cogs-search-row input { width: 100%; color: var(--ink); }
.cogs-sup-head { margin: 12px 0 4px; font-size: 13px; }
.cogs-sup-head .link { color: var(--accent); }
.cogs-sup-wrap { max-height: 320px; overflow: auto; }
.cogs-sup td .btn.small { padding: 1px 8px; margin-left: 4px; }
.cogs-sup tr.cogs-sup-out td { opacity: .7; }
#cogs-search-out > p { margin: 8px 0 0; }
.supplier-keys label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 12px; color: var(--muted); }
.supplier-keys input:not([type=checkbox]), .supplier-keys select { width: 100%; max-width: 100%; min-width: 0;
  box-sizing: border-box; color: var(--ink); }
.supplier-keys select { text-overflow: ellipsis; }
.supplier-keys label.check { display: flex; align-items: center; gap: 6px; }
.supplier-remove { display: grid; gap: 4px; }
.supplier-test { margin-top: 8px; }
.supplier-ok { color: var(--good); font-weight: 600; }

/* Planned Build Shortages: the next build quantity box. */
.sheet-top + .cogs-qty { margin-top: 12px; }

/* Builds: Save schedule above the list too. */
.sched-save-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.sched-save-top .order-note { margin: 0; }

/* Build Plan summary: Inventory cost (managers and admins). */
.sum-cost { align-items: baseline; }
.sum-cost .sum-money { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; flex-basis: 100%; }
.sum-cost p { margin: 0; flex-basis: 100%; max-width: 420px; }

/* COGS price dialog: up to 5 price breaks to pick from. */
.cogs-breaks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 240px; }
.cogs-break { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
              font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cogs-break span { color: var(--muted); }
.cogs-break:hover, .cogs-break:focus-visible { border-color: var(--accent); }
.cogs-break.here { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cogs-break.picked { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cogs-break.picked span { color: inherit; }

/* COGS: Export Excel with its own build and dev quantities. */
.cogs-export-qty { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cogs-export-qty input { width: 100%; color: var(--ink); }
.cogs-export form > p { margin: 0; }

/* COGS labor: profiles list and Add labor. */
.cogs-labor-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cogs-profiles td.n { white-space: nowrap; }
.labor-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.cogs-labor > label.cogs-copy { grid-template-columns: 1fr; gap: 3px; font-size: 12px; color: var(--muted); }
.cogs-labor > label.cogs-copy select { width: 100%; }

/* COGS labor: the note that Save labor will update the picked profile too. */
.cogs-profile-note { margin: 0; padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--ink); }

/* Material plan (MRP). */
.mrp-act { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.mrp-act.a-late { background: var(--bad); color: #fff; }
.mrp-act.a-order { background: var(--warn-bg); color: var(--warn); }
.mrp-act.a-expedite { background: color-mix(in srgb, #2b9bff 22%, transparent); color: var(--ink); }
.mrp-act.a-covered { background: var(--good-bg); color: var(--good); }
.mrp-act.a-wait { background: var(--cat-bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
/* My day: the buyer's material plan to-dos. */
.mp-badge { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
            background: var(--accent); color: var(--accent-ink); vertical-align: 1px; }
.mp-table tr.mp-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mp-btns form { margin: 0 2px 0 0; }
.mp-acked { margin-top: 8px; }
.mp-acked > summary { cursor: pointer; color: var(--muted); }
table.sched input.changed { outline: 2px solid var(--accent); outline-offset: -1px; }
.mrp-late { color: var(--bad); font-weight: 600; }
.mrp-table td.clip { max-width: 190px; }
.mrp-table td, .mrp-table th { padding-left: 6px; padding-right: 6px; }
.mrp-filters { flex-wrap: wrap; row-gap: 8px; }
.mrp-filters .views { display: inline-flex; flex-wrap: wrap; gap: 4px; }
tr.ev-order td { background: color-mix(in srgb, var(--good) 8%, transparent); }
tr.ev-stock td { font-weight: 600; }
tr.ev-build td, tr.ev-planned td { background: color-mix(in srgb, var(--hi) 8%, transparent); }
.mrp-act.a-make { outline: 1px dashed currentColor; outline-offset: -1px; }
.mrp-nobom { color: var(--warn); }
.mrp-nobom-note { margin: 10px 0 0; padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--ink); }
.inline-h2 { display: inline; margin: 0; font-size: inherit; }
details > summary .inline-h2 { font-size: 16px; }
.rules-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.rules-upload { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rules-form input { width: 96px; }
.ordered-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ordered-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.ordered-grid label.wide { grid-column: 1 / -1; }
.ordered-grid input { color: var(--ink); width: 100%; }

/* Forecasting (app/forecast.py): products by product code, each BOM's forecast. */
body.page-forecast > main { max-width: none; }
.fc-head { flex-wrap: wrap; row-gap: 8px; gap: 12px; }
@media (min-width: 900px) {
  /* The Products line stays at the top while the list scrolls, the column headings just under it. */
  .fc-head { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: 8px 0; margin-top: -8px; }
  body.with-side .fc-wrap.sticky-head thead th { top: var(--fc-head, 0px); }
}
.fc-head .views { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.fc-sec { font-size: 16px; margin: 20px 0 6px; color: var(--ink); text-transform: none; letter-spacing: normal; }
.fc-sec:first-of-type { margin-top: 6px; }
.fc-q { flex: 1; min-width: 200px; max-width: 360px; }
.fc-table td.fc-name { max-width: 300px; }
.fc-table tr.fc-zero td { color: var(--muted); }
.fc-table td.fc-map { min-width: 220px; }
.fc-sug { color: var(--muted); font-style: italic; }
.fc-btns { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.fc-dlg { width: min(560px, calc(100vw - 24px)); }
.fc-grid { display: grid; grid-template-columns: 1fr 130px; gap: 10px 12px; }
.fc-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.fc-grid select, .fc-grid input { color: var(--ink); width: 100%; }
#fc-rows { display: grid; gap: 10px; }
#fc-rows .fc-grid { grid-template-columns: 1fr 130px 64px; align-items: end; }
.fc-more .fc-del { justify-self: start; padding-bottom: 7px; }
.sales-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 600px) { .fc-grid { grid-template-columns: 1fr; }
                             #fc-rows .fc-grid { grid-template-columns: 1fr 64px; }
                             #fc-rows .fc-grid > label:first-child { grid-column: 1 / -1; } }

/* Purchase Orders: the PO sheet's columns, across the whole screen. */
body.page-po-reg > main { max-width: none; }
.po-head { flex-wrap: wrap; row-gap: 8px; gap: 12px; }
.po-head .views { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.po-search { display: inline-flex; gap: 6px; align-items: center; flex: 1; min-width: 220px; }
.po-search input[type=search] { flex: 1; min-width: 0; }
.po-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.po-upload-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.po-upload p { margin: 8px 0 0; }
.po-reg td, .po-reg th { white-space: nowrap; }
/* The heading row frozen (the owner, 11/05/26), as Cable Inventory's: the lines scroll in their own box both ways, at
   most a screen tall (_cab_frozen.html fits it to the window), so Date, Vendor, PO Number … stay at the box's top. */
.table-wrap.po-frozen { overflow: auto; max-height: var(--cab-fit, calc((100vh - 150px) / var(--z))); }
.po-frozen .po-reg thead th { position: sticky; top: 0; z-index: 2; background: var(--surface);
                              box-shadow: inset 0 -1px 0 var(--line-strong); }
@media (max-width: 700px) { .table-wrap.po-frozen { max-height: var(--cab-fit, calc(80vh / var(--z))); } }
@media print { .table-wrap.po-frozen { max-height: none; } }
.po-reg td.pre, .pre { white-space: pre-line; }
.po-reg td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.po-reg td.po-vendor { max-width: 230px; }
.po-reg td.po-notes { max-width: 300px; white-space: nowrap; }
.po-reg tr.po-click { cursor: pointer; }
.po-reg tr.po-click:hover td, .po-reg tr.po-click:focus td { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.po-reg tr.po-late td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.po-reg tr.po-late td:nth-child(9) { color: var(--bad); font-weight: 600; }
.po-reg tr.po-done td { color: var(--muted); }
/* Late from the first promise; the count to the date the vendor gives now; Lead time opens the vendor's updates. */
.po-reg .po-countdown { color: var(--muted); font-weight: 400; }
.po-reg .po-countdown.neg { color: var(--bad); }
.po-reg .po-lead { display: block; margin-top: 2px; font-weight: 400; }
/* Expedite / Push out / Cancel order: the asks still open under the PO Number, the line dialog's buttons, the pop-up. */
.po-reg .po-asked { color: var(--warn); font-weight: 600; }
.po-reg .po-ask { display: block; margin-top: 2px; }
.po-ask-btns { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.ask-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.smt-dlg .ask-kinds label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink); cursor: pointer; }
.smt-dlg .ask-kinds label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.smt-dlg .ask-note textarea { width: 100%; font: inherit; color: var(--ink); }
/* Send cart: the button under My Cart, carts waiting for an answer, and the Incoming Cart panel in the Inbox. */
.cart-send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.cart-waiting ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.smt-dlg textarea { width: 100%; font: inherit; color: var(--ink); }
.cart-in-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.cart-in-reject { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cart-in-reject input { min-width: 220px; }
.po-dlg { width: min(860px, calc(100vw - 24px)); }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 12px; }
.po-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.po-grid input, .po-grid textarea { color: var(--ink); width: 100%; font: inherit; }
.po-grid .wide { grid-column: 1 / -1; }
.po-grid .wide2 { grid-column: span 2; }
.po-grid h3 { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.po-sums { margin: 0; }
.pager { display: flex; gap: 16px; }
@media (max-width: 600px) { .po-grid .wide2 { grid-column: 1 / -1; } }
.po-reg td.po-recv { white-space: nowrap; }
.po-reg td.po-recv .pre { display: inline-block; vertical-align: middle; margin-right: 6px; }
.po-receive { padding: 2px 10px; }
.rcv-dlg { width: min(560px, calc(100vw - 24px)); }
.rcv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin: 8px 0; }
.rcv-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.rcv-grid input { color: var(--ink); width: 100%; font: inherit; }
.rcv-grid .wide { grid-column: 1 / -1; }
.rcv-signed { font-weight: 700; background: transparent; }

/* ---- Lifecycle (the scan, app/lifecycle.py): the Build Plan's EOL column, the part page's Lifecycle box, the
   Lifecycle scan box. EOL is plum; O (Obsolete) is solid red, as the owner asked (a full badge, so it doesn't look
   like a short cell's pale red). */
:root { --eol: #a3127a; --eol-bg: #fbe7f3; }
:root[data-theme="dark"] { --eol: #f08bd0; --eol-bg: #3b1730; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --eol: #f08bd0; --eol-bg: #3b1730; } }
.lc-pill { display: inline-block; min-width: 36px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
           line-height: 18px; text-align: center; white-space: nowrap; vertical-align: middle; text-decoration: none !important; }
a.lc-pill:hover { filter: brightness(1.12); }
.lc-eol { background: var(--eol-bg); color: var(--eol); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--eol) 45%, transparent); }
.lc-aeol { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.lc-o { background: #d92d20; color: #fff; }
.lc-active { background: var(--good-bg); color: var(--good); }
.lc-na { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.lc-none { color: var(--muted); font-weight: 600; }
.lc-pill sup { font-size: 9px; margin-left: 1px; }
.lc-list { display: grid; gap: 8px; }
.lc-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px;
          border: 1px solid var(--line); border-radius: var(--radius); }
.lc-row .lc-pill { margin-top: 1px; }
.lc-body { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.lc-body .src-mpn { font-weight: 700; }
.lc-error { color: var(--warn); }
.lc-scan { margin-top: 16px; }
.lc-counts .lc-pill { margin-right: 2px; }
.lc-forms { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; margin: 8px 0; }
.lc-forms form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lc-count { width: 80px; }
.lc-running { padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); margin: 8px 0; }
.lc-runs td, .lc-runs th { white-space: nowrap; }
.lc-runs td.small { white-space: normal; min-width: 180px; }
@media (max-width: 700px) { .lc-row { grid-template-columns: 52px minmax(0, 1fr); } .lc-row form { grid-column: 2; } }
.lc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.lc-dot.lc-eol { background: var(--eol); }
.lc-dot.lc-aeol { background: var(--warn); }
.lc-dot.lc-o { background: #d92d20; }

/* WIP (wip.html, wip_board.html, _wip_dialogs.html) */
.wip-table th.n, .wip-table td.n { min-width: 64px; }
.wip-table tbody tr[hidden] { display: none; }
button.wip-n { background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 8px; min-width: 44px; font: inherit;
  color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; cursor: pointer; }
button.wip-n:hover, button.wip-n:focus-visible { border-color: var(--accent); background: var(--cat-bg); }
button.wip-n.zero, .wip-stage.zero .v { color: var(--muted); }
.wip-n.neg, span.neg, .wip-stage.neg .v { color: var(--bad); font-weight: 700; }
.wip-acts { text-align: right; }
.wip-acts .btn { margin-left: 4px; }
.wip-dlg .wm-grid { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 10px; }
.wip-dlg .wc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wip-dlg .dlg-actions { margin-top: 14px; }
@media (max-width: 560px) { .wip-dlg .wm-grid, .wip-dlg .wc-grid { grid-template-columns: 1fr 1fr; } }
.wip-stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.wip-stage { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.wip-stage .k { font-size: 12px; color: var(--muted); }
.wip-stage .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wip-stage .v button.wip-n { font-size: 20px; font-weight: 700; padding: 0 4px; text-align: left; }
@media (max-width: 700px) { .wip-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wip-history tr.undone td { color: var(--muted); }
.wip-history tr.undone td:nth-child(3) { text-decoration: line-through; }
.wip-admin { display: grid; gap: 8px; margin-top: 16px; }
.wip-admin details { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.wip-admin summary { cursor: pointer; font-weight: 600; }
.wip-admin .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.wip-weights { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; margin-top: 8px; }
.wip-weights label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.wip-weights input { width: 56px; text-align: right; }
ul.tight { margin: 4px 0 0; padding-left: 18px; }

/* Cable Inventory (cables.html, cable.html, cable_moves.html, cable_month.html; cable_pull.html prints on its own) */
.cab-table tbody tr[hidden] { display: none; }
.cab-table thead th { white-space: normal; vertical-align: bottom; min-width: 64px; }
/* The whole width: long names and notes wrap (up to 3 lines; the full text is in the cell's title and on the cable's
   page) instead of being cut off or running into the next column. Each tab A-Z (Obsolete: Cables, then Accessories). */
body.page-cables > main { max-width: none; }
.cab-table td { vertical-align: top; }
.cab-table td.cab-name { min-width: 230px; max-width: 360px; }
.cab-table td.cab-name a { white-space: normal; overflow-wrap: anywhere; }
.cab-table td.clip.cab-gpn { max-width: 110px; }
.cab-txt { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical;
           -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.cab-table td.cab-location .cab-txt { min-width: 180px; max-width: 340px; }
.cab-table td.cab-po_notes .cab-txt { min-width: 90px; max-width: 150px; }
.cab-table td.cab-reorder_ref .cab-txt { min-width: 320px; max-width: 560px; }   /* takes the width the qty columns give up */
.cab-table td:is(.cab-qty_supplier, .cab-trigger_qty, .cab-reorder_qty, .cab-lead_time) .cab-txt { max-width: 110px; }
/* PO# and Order Reference Information (the owner, 11/04/26, as on the Backorder Tracker): each line as typed, its own
   line, never wrapped or cut; the column is as wide as its longest line (the table scrolls sideways in its box). */
.cab-table td .cab-txt.cab-lines { display: block; white-space: pre; overflow-wrap: normal; overflow: visible;
                                   -webkit-line-clamp: unset; line-clamp: none; min-width: 0; max-width: none; }
/* Marked obsolete (the owner, 11/04/26): a tag next to its name on the list and on its page. */
/* PO# is as wide as its longest line, up to 30 characters (the owner, 11/04/26): a line that long or shorter (a PO
   number) stays on one line, a longer note wraps at its spaces. */
.cab-table td.cab-po_notes .cab-txt.cab-lines { width: max-content; max-width: 30ch; white-space: pre-wrap;
                                               overflow-wrap: break-word; }
.tag.obsolete { background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.cab-table td.cab-name .tag.obsolete { font-size: 11px; padding: 1px 6px; vertical-align: 1px; }
/* What the stock is worth (the owner, 11/05/26, as on the Backorder Tracker): a line of totals above the list. */
.cab-worth { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin: 4px 0 12px; padding: 10px 14px;
             background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.cab-worth-item { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cab-worth-item b { font-size: 16px; margin-left: 4px; }
.cab-worth-total b { font-size: 18px; color: var(--accent); }
/* Order Now (the owner, 11/05/26): the filter of everything below its re-order level, set apart from the tabs, red when
   there's something to order. On it every line is red, so none of them flash. */
.chip.chip-order { margin-left: 8px; }
.chip.chip-order.chip-hot:not(.on) { border-color: var(--bad); color: var(--bad); }
.chip.chip-order.chip-hot .muted { color: inherit; font-weight: 700; }
.cab-order tbody tr.cab-low > td { animation: none; }
/* A kit's items: in the Add new / Edit pop-up, and on the kit's page (and the kits an item is in, on its page). */
.cab-kit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.cab-kit legend { font-weight: 600; padding: 0 4px; }
.cab-kit-items td.n, .cab-kit-items th.n { text-align: right; font-variant-numeric: tabular-nums; }
/* Below its re-order level (the owner, 11/05/26: "flash line red"): the cable's line red, flashing three times as the
   list opens, then staying red; its Stock Count in red too, and on hover it says so (cables.below_reorder). Come back
   to such a line (cab-here, below), it flashes red instead of lighting up yellow: the flashing wins while it lasts.
   Without the flashing for those who ask for less motion. */
.cab-table tbody tr.cab-low > td { background-color: var(--bad-bg); animation: cab-low-flash 1.2s ease-in-out 3; }
.cab-table tbody tr.cab-low > td.cab-csr_count { color: var(--bad); font-weight: 700; }
@keyframes cab-low-flash { 50% { background-color: color-mix(in srgb, var(--bad) 35%, var(--surface)); } }
@media (prefers-reduced-motion: reduce) { .cab-table tbody tr.cab-low > td { animation: none; } }
/* Back on the list at the cable just edited or opened (#cable-<id>): its line lit up for a moment. */
.cab-table tbody tr > td { transition: background-color .8s; }
.cab-table tbody tr.cab-here > td { background-color: var(--warn-bg); }
/* The qty and lead time headings wrap ("Re-Order / Level"), so those columns are only as wide as their longest word or
   value; a full-width table would otherwise share its spare width out to them. PO# too (a line at a time). */
.cab-table th:is(.cab-qty_supplier, .cab-trigger_qty, .cab-reorder_qty, .cab-lead_time) { width: 1%; min-width: 72px; }
.cab-table th.cab-po_notes { width: 1%; min-width: 90px; }
.cab-table tr.cab-grp th { position: static; padding: 14px 10px 6px; text-align: left; font: 600 16px var(--font-display);
                           color: var(--title); background: var(--sheet-head); border-bottom: 1px solid var(--line-strong); }
.cab-table tr.cab-grp th .muted { font-size: 12px; font-weight: 500; margin-left: 6px; }
.cab-table td.cab-notes .cab-txt { min-width: 140px; max-width: 280px; }
/* Stock Count: narrow; a count with a note wraps onto the next line. */
.cab-table td.cab-csr_count { max-width: 96px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.cab-table th.cab-csr_count { width: 70px; }
/* Sold / Receiving pop-up: a line per product (searched by name or GPN) and its qty; + Add for another. */
.cab-move { width: min(640px, calc(100vw - 24px)); }
.cm-head, .cm-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 24px; gap: 8px; align-items: start; }
.cm-head { margin: 4px 0; }
.cm-line { margin-bottom: 8px; }
.cm-pick { display: grid; gap: 2px; min-width: 0; }
.cm-pick input, .cm-qty { width: 100%; }
.cm-x { font-size: 14px; padding-top: 8px; }
.cm-err { color: var(--bad); font-weight: 600; }
/* Transactions: Sold in red, Received in green; numbered pages. */
.cm-kind { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cm-kind.cm-sold { background: var(--bad-bg); color: var(--bad); }
.cm-kind.cm-received { background: var(--good-bg); color: var(--good); }
.cm-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0; }
/* Product Location, PO# and Order Reference Information typed on the list (admins, Purchasing Managers): the cell
   shows it can be clicked. */
.cab-table td.cab-ed { cursor: text; }
.cab-table td.cab-ed:hover, .cab-table td.cab-ed:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.cab-table td.cab-ed textarea { width: 100%; min-width: 300px; font: inherit; resize: vertical; }
.cab-ed-bar { display: flex; gap: 6px; margin-top: 4px; }
.cab-ed-msg { color: var(--bad); margin-top: 4px; }
/* Pull List pop-up (its Print list opens cable_pull.html, the printable page). */
.cab-pull { width: min(760px, calc(100vw - 24px)); }
.pl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pl-row label { display: flex; align-items: center; gap: 6px; }
.pl-hint.pl-bad { color: var(--bad); font-weight: 600; }
.pl-preview { max-height: 34vh; overflow: auto; margin-top: 4px; }
.pl-loc { white-space: pre-line; }
/* Previous: the month pop-up (a drop-down of the months, View); a month's page has the list's look, read-only. */
.cab-prev { width: min(460px, calc(100vw - 24px)); }
.cab-prev select { color: var(--ink); }
.pm-none { margin: 4px 0 0; line-height: 1.5; }
/* The Add new / Edit pop-up: two columns, the long fields across; every column of the cable's page (11/04/26). */
.cab-add { width: min(720px, calc(100vw - 24px)); }
.cab-dlg-grid { grid-template-columns: 1fr 1fr; } .cab-dlg-grid .wide { grid-column: 1 / -1; }
.cab-dlg-grid textarea { resize: vertical; font: inherit; }
.cab-table th:first-child, .cab-table td.cab-name { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cab-table thead th:first-child { z-index: 3; }
/* The list (every tab) and a month's page (Previous): the table scrolls in its own box both ways, at most a
   screen tall less 150px as the Build Plan's sheet (.sheet-wrap; 80% of the screen on phones, where the menu scrolls
   away: nothing is pinned above it), so its heading row stays frozen at the top of the box, above the cells, the
   cable's name and an open cell's box. A shadow draws the line under the heading (the sheet's colour): the table's own
   border scrolls away with the cells. _cab_frozen.html sets --cab-fit to the window's room less what follows the box
   (so the page's end never takes the heading out of sight); these heights are the fallback without it. Focusing a box
   typed on the list scrolls it clear of the frozen heading row and the cable's name (scroll-padding). */
.table-wrap.cab-frozen { overflow: auto; max-height: var(--cab-fit, calc((100vh - 150px) / var(--z))); scroll-padding: 80px 0 0 260px; }
.cab-frozen .cab-table thead th { top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line-strong); }
.cab-frozen .cab-table thead th:first-child { z-index: 3; }
@media (max-width: 700px) { .table-wrap.cab-frozen { max-height: var(--cab-fit, calc(80vh / var(--z))); } }
@media print { .table-wrap.cab-frozen { max-height: none; } }     /* printed, every row as before */
/* Lines between the columns (the owner, 11/04/26, as on the Backorder Tracker), the cable's name's line too: each
   cell's right edge, drawn as a shadow so the lines move with the frozen heading row and the cable's name (a collapsed
   table's own borders would stay behind as they scroll). None after the last column, where the box's frame is. In the
   frozen heading the line under it (the sheet's colour) comes first, so it runs unbroken past each column line.
   Printed (nothing scrolls) and in Windows' contrast themes (which draw no shadows) the column lines are borders, and
   the heading keeps the line under it. */
.cab-table :is(th, td):not(:last-child) { box-shadow: inset -1px 0 0 var(--line); }
.cab-frozen .cab-table thead th:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line-strong), inset -1px 0 0 var(--line); }
@media print, (forced-colors: active) {
  .cab-table :is(th, td):not(:last-child) { box-shadow: none; border-right: 1px solid var(--line); }
  .cab-frozen .cab-table thead th:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line-strong); border-right: 1px solid var(--line); }
}
.cab-col { font-weight: 400; font-size: 11px; color: var(--muted); opacity: .8; }
.cab-form textarea { resize: vertical; font: inherit; }
.cab-form .cab-save { grid-column: 1 / -1; }
.cab-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.cab-fields .wide { grid-column: 1 / -1; }
.cab-fields dt { font-size: 12px; color: var(--muted); }
.cab-fields dd { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.cab-history td.cab-was, .cab-history td.cab-now { white-space: pre-line; overflow-wrap: anywhere; max-width: 380px; }
.cab-history td.cab-was { color: var(--muted); }
.page-cables .wip-admin .inline-form label { display: flex; align-items: center; gap: 4px; color: var(--muted); }
@media (max-width: 700px) { .cab-fields { grid-template-columns: 1fr 1fr; } }

/* Order Forecast (app/ordercast.py): the part's window, the Order schedule page. */
body.page-order-schedule > main { max-width: none; }
.os-table td.os-desc { max-width: 280px; }
.os-up { color: var(--warn); }
.tag-changed { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 11px;
               background: var(--accent-soft); color: var(--muted); }
.os-flag { color: var(--muted); }
.os-flag::before { content: "\26A0  "; }
.os-claude { color: var(--ink); font-style: italic; }
.of-dlg { width: min(760px, calc(100vw - 24px)); }
.of-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.of-top h2 { margin: 0; }
.of-sub { margin: 2px 0 0; }
.of-close { font-size: 18px; }
.of-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.of-facts > div { display: grid; background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; }
.of-facts .k { font-size: 12px; color: var(--muted); }
.of-facts b { font-size: 18px; }
.of-chart { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end;
            height: 84px; margin: 4px 0 12px; }
.of-col { display: grid; justify-items: center; align-content: end; gap: 2px; }
.of-col span { width: 70%; background: var(--accent); border-radius: 3px 3px 0 0; }
.of-col.bought span { background: none; border: 1.5px dashed var(--accent); }
.of-col i { font-style: normal; font-size: 10px; color: var(--muted); }
.of-rate { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--bad); pointer-events: none; }
.of-plan { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.of-plan.buy { background: var(--bad-bg); color: var(--bad); }
.of-plan.buy b { font-size: 15px; }
.os-buy { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12px; font-weight: 700;
          background: var(--bad-bg); color: var(--bad); }
.of-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 8px; }
.of-inputs label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.of-inputs input { width: 110px; color: var(--ink); }
.of-table tr.of-rec td { background: var(--accent-soft); }
.of-table tr.of-pick td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.of-badge { display: inline-block; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 700;
            background: var(--accent); color: var(--accent-ink); }
.of-saved { font-size: 11px; color: var(--muted); }
.of-why { border-left: 2px solid var(--accent); padding: 2px 0 2px 10px; margin: 8px 0; }
.of-why p { margin: 2px 0 0; }
.of-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.of-actions .spacer { flex: 1; }
@media (max-width: 600px) { .of-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Planning next year (plan.py): the one-line banner on the Build Plan. */
.plan-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 0; padding: 6px 12px;
               border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.plan-banner .btn { margin-left: auto; }
/* Live stock from InControl (app/livestock.py). */
.live-form { display: grid; gap: 8px; max-width: 460px; }
.live-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.live-form input, .live-form select { color: var(--ink); }
.live-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.of-advice { display: grid; gap: 3px; margin: 0 0 10px; }
.os-leads { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
/* Vendor performance (app/vendorperf.py). */
body.page-vendor-perf > main { max-width: none; }
.os-ok { color: var(--good); }
.vp-table td.n { white-space: nowrap; }
/* Trouble: a part that gives us issues (app/pushes.py; marked by a buyer, or PO history). */
.trouble-box { position: relative; }
.trouble-box > summary { list-style: none; cursor: pointer; }
.trouble-box > summary::-webkit-details-marker { display: none; }
.trouble-badge, .trouble-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--bad-bg); color: var(--bad); border: 1px solid currentColor; }
.trouble-tag { padding: 0 7px; font-size: 11px; vertical-align: 1px; margin-left: 4px; cursor: help; }
.trouble-add { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 10px; }
.trouble-add:hover { color: var(--ink); border-color: var(--muted); }
.trouble-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(380px, 86vw); padding: 10px 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.trouble-pop p { margin: 0 0 6px; }
.trouble-pop ul { margin: 0 0 8px; padding-left: 18px; }
.trouble-pop form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 0; }
.trouble-form input[name="reason"] { flex: 1 1 180px; min-width: 0; }
.po-pushed { color: var(--bad); }
/* BOM categories (Inventory & BOMs): pick Mechanical / Electrical / Full Build before uploading. */
.bom-cat-pick { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 8px; margin: 0 0 10px;
  display: flex; flex-wrap: wrap; gap: 4px 16px; }
.bom-cat-pick legend { padding: 0 4px; color: var(--muted); }
.bom-cat-opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.bom-cat-form select { padding: 1px 4px; font-size: 13px; }
/* BOM revisions (app/bomrev.py). */
.rev-cur { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--good-bg); color: var(--good); }
.bom-diff td.add { color: var(--good); }
.bom-diff td.del { color: var(--bad); text-decoration: line-through; }
/* Forecasting: the seasonal pattern. */
.season-table input { width: 3.6em; text-align: right; padding: 2px 4px; }
.season-actions { display: flex; gap: 8px; margin: 8px 0 4px; }
.season-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
/* The BOM upload's preview: keep the file name from pushing the rest off the page. */
.bom-preview-table td div.clip { max-width: 260px; }
.bom-preview-table td:nth-child(5) { min-width: 200px; }
/* Builds: a Mechanical BOM attached to an Electrical build (HAS MECH / NO MECH; click to choose). */
.mech-pick { margin-top: 4px; }
.mech-pick > summary { list-style: none; cursor: pointer; }
.mech-pick > summary::-webkit-details-marker { display: none; }
.mech-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 700; letter-spacing: .02em; border: 1px solid currentColor; }
.mech-chip.has { color: var(--good); background: var(--good-bg); }
.mech-chip.need { color: #a15c00; background: rgba(255, 170, 0, .12); }
:root[data-theme="dark"] .mech-chip.need { color: #f2b24e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .mech-chip.need { color: #f2b24e; } }
.mech-chip.none, .mech-chip.incl { color: var(--muted); background: transparent; font-weight: 600; }
.mech-name { font-weight: 500; letter-spacing: 0; }
.mech-choose { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.mech-choose select { font-size: 12px; padding: 1px 4px; max-width: 260px; }
.bom-pick { display: flex; align-items: center; gap: 6px; }
.bom-pick select { max-width: 280px; font-weight: 600; }
/* SMT capacity (app/smtcap.py). */
.cap-bar { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--line); vertical-align: middle;
  margin-right: 6px; overflow: hidden; }
.cap-bar > span { display: block; height: 100%; background: var(--good); }
.cap-bar > span.busy { background: #d99a00; }
.cap-bar > span.over { background: var(--bad); }
.cap-per input { width: 6em; text-align: right; padding: 2px 4px; }
.cap-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 10px; }
.cap-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.cap-form input { width: 9em; }
.cap-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(80px, .8fr) minmax(110px, 1fr) minmax(110px, 1fr) auto;
  gap: 8px; align-items: center; margin: 0; }
.cap-row input { width: 100%; box-sizing: border-box; min-width: 0; }
.cap-btns { display: flex; gap: 6px; white-space: nowrap; }
.cap-machines td { padding-top: 5px; padding-bottom: 5px; }
.cap-add td { border-top: 1px dashed var(--line); }
@media (max-width: 700px) { .cap-row { grid-template-columns: 1fr 1fr; } .cap-btns { grid-column: 1 / -1; } }
/* Phone width: grid items (a vendor's group, the part page's purchases) shrink to the screen; their tables scroll. */
.vendor-list > .vgroup, .purchases > * { min-width: 0; }
.fc-q { max-width: min(360px, 100%); }
/* Excess & obsolete: the facts are links to their lists; a coloured tag per kind. */
a.fact-link { color: inherit; text-decoration: none; border: 1px solid transparent; }
a.fact-link:hover { border-color: var(--line); }
a.fact-link.on { border-color: var(--accent, var(--ink)); }
.eo-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 10px; }
.eo-table td.eo-desc { max-width: 280px; }
.eo-table td.eo-why { min-width: 240px; max-width: 360px; }
.eo-kind { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: var(--cat-bg); }
.eo-kind.eo-obsolete { background: var(--bad); color: #fff; }
.eo-kind.eo-no_plan { background: #d99a00; color: #111; }
/* The frozen zone: its days shaded on the SMT Schedule, firm builds marked, a tag in the Material plan. */
.smt-day.frozen { background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--frozen) 7%, transparent) 8px 16px); }
.smt-dh.frozen b { text-decoration: underline dotted; }
.smt-bar.firm { box-shadow: inset 3px 0 0 var(--frozen); }
.smt-bar.firm.cont { box-shadow: none; }
.mrp-frozen { color: var(--frozen); font-weight: 600; }
input.frozen-weeks { width: 5em; }
/* QuickBooks POs: the preview's inputs, unticked lines dimmed, the settings form. */
.qb-table input.qb-num { width: 7em; text-align: right; }
.qb-table input.qb-memo { width: 100%; min-width: 260px; }
.qb-table tr.qb-off td { opacity: .45; }
.qb-po .panel-head-row select.qb-vendor { max-width: min(420px, 100%); }
form.qb-settings { display: grid; gap: 8px; max-width: 520px; }
form.qb-settings input, form.qb-settings textarea { width: 100%; }
/* Stock check: pasted GPNs, then one row per MPN with DigiKey's and Mouser's answers filled in as they come. */
form.stock-ask { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
form.stock-ask label { display: grid; gap: 4px; flex: 1 1 320px; }
form.stock-ask textarea { width: 100%; font-family: inherit; }
.stock-table tr.first td { border-top: 1px solid var(--line, #ddd); }
.stock-table td.stock-cell { min-width: 9em; vertical-align: top; }
.stock-breaks summary { cursor: pointer; color: var(--accent); }
.stock-breaks table { margin-left: auto; border-collapse: collapse; }
.stock-breaks td { padding: 0 0 0 10px; border: 0; }
.stock-breaks tr.on td { font-weight: 700; }
/* PO page: a whole PO (its own boxes, then a line per part), filled by hand or from a PO file. */
.po-read { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.po-whole .po-head { margin-bottom: 8px; }
.po-lines input { width: 100%; min-width: 6em; }
.po-lines input.po-gpn, .po-lines input.po-ipn { min-width: 8em; }
.po-lines .po-ipn-as { max-width: 16em; margin-top: 2px; }
.po-lines input.po-note { min-width: 14em; }
.po-lines input.po-qty, .po-lines input.po-cost { text-align: right; max-width: 9em; }
.po-lines tr.bad td { background: var(--bad-bg); }
.po-lines .po-read-as { max-width: 32em; margin-top: 2px; }
/* My Cart and the BUY box. */
.cart-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.cart-tabs .chip { text-decoration: none; }
.cart-table input.cart-qty { width: 7em; text-align: right; }
.cart-table input.cart-price { width: 7em; text-align: right; }
.cart-table input.cart-vendor-in { width: min(260px, 40vw); }
form.cart-export, form.cart-excel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.cart-done summary h2 { display: inline; }
.buy-dlg { width: min(460px, calc(100vw - 32px)); }
.buy-dlg form { display: grid; gap: 8px; }
.buy-dlg label { display: grid; gap: 4px; }
.buy-dlg .buy-ids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.buy-dlg .buy-ids dt { font-size: 12px; color: var(--muted); }
.buy-dlg .buy-ids dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.buy-dlg .buy-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.buy-dlg .dlg-actions { display: flex; align-items: center; gap: 8px; }
.buy-dlg .dlg-actions .spacer { flex: 1; }
.buy-dlg .chip { cursor: pointer; font: inherit; font-size: 12.5px; }
.buy-btn { font-size: 12px; padding: 1px 8px; }
/* Available to promise: the question, the answer in big type. */
form.atp-ask { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
form.atp-ask input[name=q] { width: min(360px, 100%); }
form.atp-ask input.atp-qty { width: 8em; }
.atp-big { font-size: 18px; margin: 6px 0 10px; }
.atp-steps { margin: 6px 0 12px; padding-left: 18px; }
.atp-parts td.atp-desc { max-width: 320px; }
/* What today's parts can build (the owner, 10/30/26): a gauge a build, blue = what it can build, neon red = short of its
   Build count; a chart opens the pop-up of its parts short (ETA or NA) and when a quantity can be built. The arc sweeps
   in once on load; nothing keeps moving. Its colours, light then dark (as the SMT bars' holo colours): */
.atp-gauges { --gauge-ok: #3366ff; --gauge-ok-2: #5fa2ff; --gauge-short: #f0123f; --glow-ok: rgba(51, 102, 255, .38);
  --glow-short: rgba(240, 18, 63, .34); --gauge-track: rgba(18, 20, 43, .07); --gauge-tick: rgba(18, 20, 43, .2);
  --gauge-haze: rgba(51, 102, 255, .1); --gauge-haze-short: rgba(240, 18, 63, .08); }
:root[data-theme="dark"] .atp-gauges { --gauge-ok: #3f6bff; --gauge-ok-2: #78b4ff; --gauge-short: #ff2d55;
  --glow-ok: rgba(63, 107, 255, .8); --glow-short: rgba(255, 45, 85, .78); --gauge-track: rgba(255, 255, 255, .06);
  --gauge-tick: rgba(255, 255, 255, .17); --gauge-haze: rgba(63, 107, 255, .2); --gauge-haze-short: rgba(255, 45, 85, .12); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .atp-gauges { --gauge-ok: #3f6bff; --gauge-ok-2: #78b4ff; --gauge-short: #ff2d55;
    --glow-ok: rgba(63, 107, 255, .8); --glow-short: rgba(255, 45, 85, .78); --gauge-track: rgba(255, 255, 255, .06);
    --gauge-tick: rgba(255, 255, 255, .17); --gauge-haze: rgba(63, 107, 255, .2); --gauge-haze-short: rgba(255, 45, 85, .12); }
}
.atp-gauges { margin-top: 44px; }
.gauge-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.gauge-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px; }
.gauge-head h2 { margin: 0; font: 600 20px var(--font-display); letter-spacing: -.01em; }
.atp-gauges i.ok, .atp-gauges i.short { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 5px 1px 2px;
  vertical-align: middle; }
.atp-gauges i.ok { background: var(--gauge-ok); box-shadow: 0 0 8px var(--glow-ok); }
.atp-gauges i.short { background: var(--gauge-short); box-shadow: 0 0 8px var(--glow-short); }
.g-key { white-space: nowrap; margin-left: 4px; }
.gauge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
.gauge-card { position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 14px 16px 12px;
  border-radius: var(--radius-lg); background: var(--glass-strong); border: 1px solid var(--edge-side);
  box-shadow: inset 0 1px 0 var(--edge-top), var(--shadow); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.gauge-card::before { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; top: 22%; height: 62%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--gauge-haze), transparent); }
.gauge-card.g-none::before { background: radial-gradient(closest-side, var(--gauge-haze-short), transparent); }
.gauge-card:has(.gauge-btn:hover), .gauge-card:has(.gauge-btn:focus-visible) { border-color: color-mix(in srgb, var(--gauge-ok) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--edge-top), var(--shadow), 0 0 24px -6px var(--glow-ok); }
.gauge-card header { display: flex; align-items: flex-start; gap: 8px; min-height: 38px; }
.g-n { flex: none; padding-top: 2px; font: 600 11px var(--font-display); color: var(--muted); letter-spacing: .04em; }
.g-name { flex: 1; min-width: 0; font: 600 14.5px/1.3 var(--font-display); color: var(--ink); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-name:hover { color: var(--accent); text-decoration: none; }
.g-open { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-size: 14px;
  border: 1px solid var(--edge-side); color: var(--muted); text-decoration: none; }
.g-open:hover { color: var(--ink); border-color: var(--gauge-ok); text-decoration: none; }
.atp-gauges .gauge-btn { position: relative; display: block; width: 100%; margin: 2px 0 0; padding: 0; border: 0; border-radius: 14px;
  background: none; color: var(--ink); cursor: pointer; text-align: center; }
.atp-gauges .gauge-btn:focus-visible { outline: 2px solid var(--gauge-ok); outline-offset: 4px; }
.gauge { display: block; width: 100%; height: auto; overflow: visible; }
.gauge path { fill: none; stroke-linecap: round; }
.gauge .g-ticks { stroke: var(--gauge-tick); stroke-width: 5; stroke-linecap: butt; stroke-dasharray: .35 4.65; }
.gauge .g-track { stroke: var(--gauge-track); stroke-width: 18; }
.gauge .g-inner { stroke: var(--gauge-tick); stroke-width: 1; stroke-dasharray: 1 2; }
.gauge .g-ok { stroke: url(#gauge-blue); stroke-width: 14; filter: drop-shadow(0 0 6px var(--glow-ok));
  animation: gauge-sweep 1.2s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
.gauge .g-short { stroke: var(--gauge-short); stroke-width: 14; filter: drop-shadow(0 0 6px var(--glow-short));
  animation: gauge-light .8s ease-out both; animation-delay: calc(var(--i, 0) * 35ms + .3s); }
.gauge-btn:hover .g-ok { filter: drop-shadow(0 0 10px var(--glow-ok)); }
.gauge-btn:hover .g-short { filter: drop-shadow(0 0 10px var(--glow-short)); }
.g-stop-1 { stop-color: var(--gauge-ok); }
.g-stop-2 { stop-color: var(--gauge-ok-2); }
@keyframes gauge-sweep { from { stroke-dasharray: 0 200; } }
@keyframes gauge-light { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gauge .g-ok, .gauge .g-short { animation: none; } }
.gauge-mid { position: absolute; left: 0; right: 0; bottom: 2px; display: grid; justify-items: center; line-height: 1.1;
  pointer-events: none; }
.g-label { font: 600 10.5px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.g-num { font: 700 30px/1.1 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.g-full .g-num { color: var(--gauge-ok-2); text-shadow: 0 0 18px var(--glow-ok); }
.g-none .g-num { text-shadow: 0 0 16px var(--glow-short); }
.g-of { font-size: 12px; color: var(--muted); }
.g-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.g-stop { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gauge-dlg { width: min(940px, calc(100vw - 24px)); }
.gauge-dlg .gd-when { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin: 0 0 10px; }
.gauge-dlg .gd-when label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.gauge-dlg .gd-when input.atp-qty { width: 8em; }
.gd-answer { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gauge-ok) 40%, transparent);
  background: color-mix(in srgb, var(--gauge-ok) 8%, var(--surface)); }
.gd-answer p { margin: 2px 0; }
.gd-answer .gd-big { font-size: 16px; }
.gd-answer .gd-big b { color: var(--gauge-ok); }
.gauge-dlg .gd-wrap { max-height: min(56vh, 540px); overflow: auto; }
.gd-table td.gd-desc { max-width: 300px; }
.gd-table td.gd-na { color: var(--gauge-short); font-weight: 700; }
/* Mouser carts and orders: the order form, the confirmation box. */
form.mouser-order { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 6px 0; }
form.mouser-order select { max-width: min(320px, 100%); }
input.mouser-confirm { width: 7em; text-transform: uppercase; }
table.mouser-sum td:first-child { color: var(--muted); padding-right: 16px; }
/* DigiKey's order status on Purchase Orders and the part page. */
.dk-status { color: var(--muted); white-space: normal; max-width: 260px; }
.dk-bar form.inline { display: inline; }
/* DigiKey: the sign-in and order contact form, the bag scan box. */
fieldset.dk-contact { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
fieldset.dk-contact input { width: 100%; }
.dk-connect { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
form.dk-scan-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
form.dk-scan-form input { width: min(420px, 100%); }
#dk-scan-pick { display: flex; flex-wrap: wrap; gap: 6px; }
/* BOM revisions taking over on a day. */
.rev-from { color: var(--hi); font-weight: 600; }
form.rev-from-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 6px; }

/* People's faces (_avatar.html): their picture, icon, emoji or initial; the full name shows on pointing. */
.face { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
        vertical-align: middle; overflow: hidden; font-size: 11px; font-weight: 700; line-height: 1; color: #fff;
        background: var(--cat-bg); cursor: default; user-select: none; }
.face.f-initial.fc0 { background: #b4161b; } .face.f-initial.fc1 { background: #1f6fb2; } .face.f-initial.fc2 { background: #2e7d4f; }
.face.f-initial.fc3 { background: #8a4fbf; } .face.f-initial.fc4 { background: #c26a00; } .face.f-initial.fc5 { background: #00838f; }
.face.f-initial.fc6 { background: #5d6b82; } .face.f-initial.fc7 { background: #ad1457; }
.face.f-icon { color: var(--ink); } .face.f-icon svg { width: 14px; height: 14px; }
.face.f-emoji { font-size: 14px; font-weight: 400; }
.face img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face.xl { width: 72px; height: 72px; font-size: 30px; } .face.xl.f-emoji { font-size: 40px; }
.face.xl.f-icon svg { width: 40px; height: 40px; }
.rail .avatar { overflow: hidden; } .rail .avatar.f-emoji { font-size: 17px; } .rail .avatar.f-icon svg { width: 18px; height: 18px; }
.msg-list .who .face { margin-right: 6px; }
.to-status .st { display: inline-flex; align-items: center; gap: 3px; padding: 2px; }
.to-status .st.new .face { opacity: .55; }
.thread .meta .face { width: 24px; height: 24px; }
/* Your picture (the menu > Change picture) */
.pic-now { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pic-now > div { flex: 1; min-width: 220px; }
.pic-now p { margin: 4px 0 0; }
.pic-now form { margin-left: auto; }
.pic-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
canvas.face.xl { border-radius: 50%; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.pic-choice { display: grid; place-items: center; height: 44px; padding: 0; border-radius: 50%; background: var(--cat-bg);
              color: var(--ink); border: 2px solid transparent; font-size: 22px; }
.pic-choice svg { width: 22px; height: 22px; }
.pic-choice:hover { border-color: var(--line); }
.pic-choice.on { border-color: var(--hi); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hi) 25%, transparent); }
.pic-paste { display: flex; align-items: end; gap: 8px; margin-top: 12px; }

/* Settings > Planning: SMT Schedule + Builds or Builds only */
.plan-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.plan-pick .chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.plan-pick .chip:has(input:checked) { border-color: var(--hi); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hi) 25%, transparent); }

/* Packing slips (Purchase Orders > Packing slip, packing_slip.html) */
.ps-wrap { display: grid; grid-template-columns: minmax(260px, 2fr) 5fr; gap: 14px; align-items: start; }
.ps-wrap.no-pic { grid-template-columns: 1fr; }
.ps-file img { width: 100%; height: auto; display: block; border-radius: 6px; background: #fff; }
.ps-file { position: sticky; top: 8px; }
.ps-table select { max-width: 330px; }
.ps-table tr.ps-more td { border-top-style: dashed; }
.ps-table tr.ps-none td { background: var(--warn-bg, rgba(255, 170, 0, .07)); }
.ps-hand { font-style: italic; }
.ps-go { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 1000px) { .ps-wrap { grid-template-columns: 1fr; } .ps-file { position: static; } }
.ps-waiting { margin-top: 8px; }
.ps-slip { white-space: nowrap; }
.ps-slip form { display: inline; }
.ps-slip .x { background: none; border: 0; color: var(--muted); padding: 0 3px; margin-left: 2px; font-size: 11px; line-height: 1;
              cursor: pointer; vertical-align: 1px; }
.ps-slip .x:hover { color: var(--bad); }

/* Users: role headings wrap (Manufacturing Manager) so the table stays narrow; an old role is a tickable tag */
thead th.role { white-space: normal; text-align: center; min-width: 64px; max-width: 96px; line-height: 1.2; }
.tag.old-role { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; background: var(--warn-bg); color: var(--warn);
                white-space: nowrap; cursor: pointer; }

/* Drawing sign-off (_signoff.html): the bubble by a revision, who signed, and the box to approve or reject. */
.doc-badge { flex: none; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
             letter-spacing: .02em; }
.doc-badge.small { font-size: 10px; padding: 0 6px; }
.doc-badge.approved { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
.doc-badge.obsolete { background: var(--cat-bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.doc-badge.waiting { background: var(--warn-bg); color: var(--warn); }
.doc-badge.rejected { background: var(--bad-bg); color: var(--bad); }
.doc-badge.none { background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.so-line { font-size: 12px; color: var(--good); margin-top: 4px; }
.signoff { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--warn-bg); font-size: 12.5px; }
.signoff.rejected { background: var(--bad-bg); }
.so-head { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.so-roles { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.so-roles li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.so-roles li.ok .so-mark { color: var(--good); font-weight: 800; }
.so-mark { width: 1em; text-align: center; color: var(--muted); }
.so-reason { margin: 6px 0 0; color: var(--bad); white-space: pre-line; }
.so-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; }
.so-reject { display: inline-flex; gap: 6px; align-items: center; flex: 1; min-width: 200px; }
.so-reject input { flex: 1; min-width: 0; font-size: 12.5px; }
.so-send { margin-top: 6px; }
.so-panel .doc-top { flex-wrap: wrap; }

/* Cost history on a part (app/costhist.py): Price Per as a step line, each PO's unit cost as a dot. */
.ch-chart { margin: 0 0 10px; max-width: 560px; }
.ch-chart svg { display: block; width: 100%; height: auto; background: var(--cat-bg); border-radius: 8px; }
.ch-price { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.ch-po { fill: var(--warn); stroke: var(--surface); stroke-width: 1; }
.ch-chart figcaption { margin-top: 4px; }
.ch-key { display: inline-block; width: 14px; height: 3px; margin: 0 4px 2px 0; vertical-align: middle; background: var(--accent); }
.ch-key.po { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-left: 8px; }
.ch-tag { font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 999px; white-space: nowrap; }
.ch-tag.po { background: var(--warn-bg); color: var(--warn); }
.ch-tag.price { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ch-tag.broker { background: var(--neg-bg); color: var(--neg-ink); }
/* Missing prices (My day's box): the count and Save stay in view while the list scrolls. */
.mp-views { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.mp-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 8px 0; margin-bottom: 6px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mp-bar .mp-count { margin-right: auto; }
.mp-table td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-table .mp-quote { min-width: 180px; }
.mp-table input { font: inherit; }
/* Price Per from Purchase Orders. */
.ppf-table td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The PO line dialog: Broker Order in its top right corner. */
.po-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.po-dlg-head h2 { margin: 0; }
.smt-dlg .po-broker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; cursor: pointer; }
.smt-dlg .po-broker input { width: auto; }
.ch-table td:first-child { width: 7em; }
.ch-more summary, .ch-months summary { cursor: pointer; color: var(--accent); margin-top: 6px; }

/* Inventory value by month: a bar per month, longest = the biggest month. */
.iv-bar { width: 30%; min-width: 80px; }
.iv-bar span { display: block; height: 10px; border-radius: 3px; background: var(--accent); min-width: 2px; }
.ch-now { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .8; }
.ch-key.now { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 8px); }

/* Usage history on a part and the Usage trends page (app/usagetrend.py). */
.uh-chart { margin: 0 0 10px; }
.uh-chart svg { display: block; width: 100%; height: auto; max-height: 220px; }
.uh-base { stroke: var(--line); }
.uh-bar { fill: color-mix(in srgb, var(--muted) 55%, transparent); }
.uh-bar.tracked { fill: var(--accent); }
.uh-bar.partial { opacity: .5; }
.uh-bar.outlier { fill: var(--bad); opacity: .55; }
.uh-in { fill: var(--good); stroke: var(--surface); stroke-width: 1; }
.uh-year { font-size: 9px; fill: var(--muted); }
.ch-key.uh-k { width: 9px; height: 9px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 55%, transparent); }
.ch-key.uh-k.tracked { background: var(--accent); margin-left: 6px; }
.ch-key.po.uh-ink { background: var(--good); }
.uh-facts { margin: 4px 0 8px; }
.uh-months summary, .uh-moves summary { cursor: pointer; color: var(--accent); margin-top: 6px; }
.ut-spark { width: 60px; height: 16px; display: block; }
.ut-spark rect { fill: var(--accent); }

/* ==== Prism frost (the owner's pick, 10/28/26): the page-wide pieces, last in the file on purpose. Colours, corners,
   lines and light only: no size the Build Plan sheet (its fixed row height, sticky columns) or the rail's layout relies
   on changes here. The sheet, tables and inputs keep solid backgrounds (see-through or blurred layers there would slow
   scrolling and soften text); the glass is the rail, panels, tiles, chips and toasts. Tokens are at the top of this
   file. */

/* The prism edge's angle: hovering a tile or a ghost button turns it (when motion is on). */
@property --prism-angle { syntax: "<angle>"; inherits: true; initial-value: 210deg; }

/* The page: four pools of colour (--aurora) behind everything, painted still (a moving layer under a page turns
   Chrome's ClearType text off and has the window recomposited). The sign-in page draws its own sky (login.css). */
body { background-color: var(--bg); background-image: var(--aurora); background-position: -15vw -15vh;
       background-size: 130vw 200vh; background-repeat: no-repeat; }

/* The rail: frosted glass with a thin seam of prism light on its right; the page you're on is a lit glass pill with a
   prism rim (and, wide, a bar of light on its left). */
.side.rail { background: var(--grain), var(--glass); border-right: 1px solid var(--line); }
@media (min-width: 901px) { .side.rail { border-image: var(--prism-v) 1; } }
@media (max-width: 900px) { .side.rail { border-right: 0; } }
/* The board silkscreen from the old red rail, back at the top: its lines (static/rail-silk*.png, made from
   rail-board*.png a little stronger and fading out by half way) painted in --silk, under the rail's content (the rail
   is its own stacking context). Desktop only: on phones the rail is a bar across the top. */
@media (min-width: 901px) {
  .side.rail::before { content: ""; position: absolute; top: 0; left: 0; width: 60px; height: 336px; z-index: -1;
    pointer-events: none; background: var(--silk);
    -webkit-mask: url("rail-silk.png") 0 0 / 100% 100% no-repeat; mask: url("rail-silk.png") 0 0 / 100% 100% no-repeat; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .side.rail::before { width: 240px; -webkit-mask-image: url("rail-silk-wide.png");
                                              mask-image: url("rail-silk-wide.png"); }
}
.rail .ic, .rail a.on .ic { filter: none; }
.rail a:hover, .rail .side-link:hover { background: var(--hover); color: var(--ink); }
.rail nav a, .rail .side-foot > a, .rail .side-link, .rail .find-btn { background: transparent; box-shadow: none; }
.rail nav a:hover, .rail .side-foot > a:hover, .rail .side-link:hover, .rail .find-btn:hover {
  background: var(--hover); color: var(--ink); box-shadow: none; }
.rail a.on, .rail a.on:hover { background: linear-gradient(100deg, var(--on-tint-1), var(--on-tint-2)), var(--glass-strong);
                               color: var(--rail-on); box-shadow: inset 0 1px 0 var(--glass-edge), 0 6px 18px -8px var(--glow-c); }
.rail a.on::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--prism-angle, 210deg), var(--prism-1), var(--prism-2), var(--prism-3), var(--prism-4),
                             var(--prism-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.rail .side-sep { background: var(--line); }
.rail .side-foot { border-top-color: var(--line); }
.rail .avatar { background: var(--accent-soft); color: var(--accent-deep); }
.rail .lbl { background: var(--ink); color: var(--surface); box-shadow: var(--shadow); }
.rail .lbl .det, .rail .lbl .muted { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.rail .badge { z-index: 1; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
               box-shadow: 0 0 0 2px var(--glass-strong), 0 0 10px var(--glow-c); }
.rail a.app-link img { box-shadow: 0 0 0 1px var(--line); }
.rail .acct-menu a:hover, .rail .acct-menu button.link:hover { background: var(--accent-soft); color: var(--ink); }
@media (min-width: 901px) {
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .side.rail { background: var(--grain), var(--glass); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .rail-group { color: var(--muted); text-shadow: none; font-family: var(--font-display);
                                             letter-spacing: .16em; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .bub { background: transparent; box-shadow: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl { color: var(--ink); text-shadow: none; font-weight: 500; background: none; box-shadow: none; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .det, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .lbl .muted { color: var(--muted); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .badge { box-shadow: 0 0 10px var(--glow-c); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .tail { color: var(--muted); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav a:hover:not(.on), html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-foot > a:hover:not(.on),
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn:hover, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user:hover,
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail button.side-user[aria-expanded="true"] { background: var(--hover); box-shadow: none; color: var(--ink); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a:hover .bub, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .find-btn:hover .bub { color: var(--accent); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on, html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on:hover {
    background: linear-gradient(100deg, var(--on-tint-1), var(--on-tint-2)), var(--glass-strong); color: var(--rail-on);
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 6px 18px -8px var(--glow-c); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on::before { content: ""; position: absolute; left: 2px; top: 11px; bottom: 11px; width: 3px;
    border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 8px var(--glow-c); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .bub { background: transparent; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .lbl { color: var(--title); font-weight: 600; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.on .det { color: var(--rail-on); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand .lbl .nm { color: var(--title); font-family: var(--font-display); letter-spacing: -.01em; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand .brand-mrp { border-color: var(--line-strong); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail .side-brand:has(.brand-mrp)::before { border-color: var(--line-strong); }   /* BuildIQ's box, the same */
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail a.app-link:hover img { box-shadow: 0 0 0 1px var(--line); }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav { scrollbar-color: var(--line-strong) transparent; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) .rail nav :focus-visible { outline-offset: -2px; }      /* the list scrolls, so it clips */
}
/* The sign-in page's strip and Settings' pictures of the rail and of light / dark: the same look. */
.rail-sample .rs-rail { background: var(--glass-strong); border-right: 1px solid var(--line); border-image: var(--prism-v) 1; }
.rs-rail i { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: none; }
.rs-rail b { background: var(--line-strong); }
.mode-swatch { border-color: var(--line-strong); }
.mode-light { background: #eef0fb; } .mode-light span { background: #e4e6f3; }
.mode-dark { background: #04050f; } .mode-dark span { background: #21232f; }
.mode-system { background: linear-gradient(135deg, #eef0fb 50%, #04050f 50%); }
.mode-swatch span:first-child { background: linear-gradient(135deg, #5b4dff, #0e7490); }
.mode-light span:nth-child(2) { background: #ecebff; } .mode-dark span:nth-child(2) { background: #16224d; }

/* Titles in the display font; the page title shades from indigo to teal (fixed in px, so short titles still show it;
   anything inside it keeps its own colour). */
main h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--title);
          background: linear-gradient(92deg, var(--title) 0, var(--title-2) 180px, var(--title-3) 360px);
          -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
main h1 > * { -webkit-text-fill-color: initial; }
.crumb a, .pager-nav a { color: var(--accent-deep); }
main h2 { font-family: var(--font-display); letter-spacing: -.005em; }
h2 .ic { color: var(--accent); fill: none; }          /* thin violet outlines; the Starred parts star stays a gold star */
#watching h2 .ic { color: #c99400; fill: currentColor; }

/* Panels, tiles and boxes: milky glass, light catching the top edge (the same 1px borders, a colour per side). */
.panel, .table-wrap, .sheet-wrap, .empty-state { border-radius: var(--radius-lg); }
.panel { background: var(--grain), linear-gradient(160deg, var(--glass-strong), var(--glass));
         border-color: var(--edge-top) var(--edge-side) var(--edge-bottom); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }
.preview-grid .panel { background: var(--surface); }   /* it scrolls sideways: keep it solid */
.fact { background: var(--glass-strong); border: 1px solid; border-color: var(--edge-top) var(--edge-side) var(--edge-bottom);
        border-radius: 12px; box-shadow: inset 0 1px 0 var(--glass-edge); }
.fact .v { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.empty-state { background: var(--glass-strong); }
.flash { border-radius: 12px; }
.toast-item { border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: blur(16px) saturate(1.4);
              backdrop-filter: blur(16px) saturate(1.4); }
/* Inbox sender names: style.css's .who (the old top bar's pale grey) reached them too. */
.msg-link .who { color: var(--ink); }
/* My day's tiles read like instruments: an LED in the tile's colour before the label, the number in the display font
   with a faint glow of the same colour; pointing at one lights a prism rim. The coloured left edge stays. */
main a.my-tile { --k: var(--muted); position: relative; border-radius: 16px;
                 background: var(--grain), linear-gradient(160deg, var(--glass-strong), var(--glass));
                 border-color: var(--edge-top) var(--edge-side) var(--edge-bottom);
                 box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }
.my-tile.bad { --k: var(--bad); } .my-tile.warn { --k: var(--warn); } .my-tile.accent { --k: var(--hi); }
.my-tile .k { letter-spacing: .06em; font-weight: 600; }
.my-tile .k::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%;
                      vertical-align: 1px; background: var(--k); box-shadow: 0 0 6px var(--k); }
.my-tile b { font-family: var(--font-display); font-variant-numeric: tabular-nums;
             text-shadow: 0 0 18px color-mix(in srgb, var(--k) 35%, transparent); }
.my-tile.accent b { color: var(--hi); }
main a.my-tile:hover { box-shadow: inset 0 1px 0 var(--glass-edge), 0 10px 30px -12px var(--glow-c); }
main a.my-tile::after { content: ""; position: absolute; inset: -1px -1px -1px -4px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--prism-angle, 210deg), var(--prism-1), var(--prism-2), var(--prism-3), var(--prism-4),
                             var(--prism-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: 0; transition: opacity .2s; }
main a.my-tile:hover::after, main a.my-tile:focus-visible::after { opacity: 1; }

/* Buttons: pills. Primary is a lit gradient (style.css's button rule takes --btn-grad, so every button with its own
   colour keeps it) with a soft glow; small ones (in table rows) don't glow. Ghost is glass with a prism ring on hover. */
.btn, button:not([class]), button.small, button.danger, .toast-item .undo { border-radius: 999px; }
:is(.btn, button:not([class])):not(.ghost, .danger, .danger-ghost, .small, .link, .smt-complete-btn) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 18px -8px var(--glow-c); }
:is(.btn, button:not([class])):not(.ghost, .danger, .danger-ghost, .small, .link, .smt-complete-btn):hover {
  filter: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 24px -6px var(--glow-c); }
.btn.ghost { background: var(--glass-strong); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: transparent; color: var(--accent-deep); filter: none;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              conic-gradient(from var(--prism-angle, 210deg), var(--prism-1), var(--prism-2), var(--prism-3), var(--prism-4),
                             var(--prism-1)) border-box; }
.btn.ghost.danger-ghost:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.chip { background: var(--glass-strong); border-color: var(--line-strong); }
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip.on, .chip.on:hover { background: var(--btn-grad); border-color: transparent; color: var(--accent-ink);
                           box-shadow: 0 4px 12px -4px var(--glow-c); }
.chip.on .muted { color: var(--accent-ink); }
.chip.on .wstar, .chip.on .wstar.new { color: var(--accent-ink); text-shadow: none; }
.views .chip.saved.on button.x:hover { color: var(--bad); background: var(--bad-bg); border-radius: 999px; }
.chip.on :is(.late-dot, .lc-dot, .chg-dot) { box-shadow: 0 0 0 1.5px var(--accent-ink); }
.pri-chip, .sum-item, .tag-changed, .os-buy, .of-badge, .mp-badge, .eo-kind, .smt-key { border-radius: 999px; }
@media (prefers-reduced-motion: no-preference) {
  main a.my-tile, .btn.ghost { transition: --prism-angle .9s ease; }
  main a.my-tile:hover, .btn.ghost:hover { --prism-angle: 330deg; }
}

/* Tables: thin, light lines between rows; a faint violet wash on the row you point at (the sheet has its own). */
th, td { border-bottom-color: var(--row-line); }
table.sheet th, table.sheet td { border-color: var(--row-line); }
table:not(.sheet) tbody tr:hover > td { background-image: linear-gradient(var(--row-hover), var(--row-hover)); }
/* The Build Plan sheet is solid "data glass": a soft violet frame, a tinted header, short cells with a red edge, quiet
   Buy buttons that fill on hover. Its backgrounds stay solid colours, so it scrolls as fast as before. */
.sheet-wrap { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); box-shadow: var(--shadow); }
table.sheet thead th, table.sheet thead th.sticky { background: var(--sheet-head); border-bottom-color: var(--line-strong); }
table.sheet td.neg { box-shadow: inset 2px 0 0 var(--bad); }
table.sheet .buy-btn { background: var(--accent-soft); color: var(--accent-deep);
                       box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
table.sheet .buy-btn:hover { background: var(--btn-grad); color: var(--accent-ink); box-shadow: none; }
/* Status pills and usage badges: glass beads (a shine on top); their colours and meanings are unchanged. */
.lc-pill:not(.lc-o), .use-btn:not(.none) { background-image: linear-gradient(180deg, rgba(255, 255, 255, var(--bead)), transparent 60%); }
.lc-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 40%, transparent); }

/* Fields, focus and dialogs (solid, with a prism rim). */
input:not([type=checkbox]):not([type=radio]), select, textarea { border-color: var(--line-strong); border-radius: 10px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px var(--focus-halo); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:is(.smt-dlg, .review-dlg, .buy-dlg, #confirm-dlg, #notice-dlg, #find-dlg) {
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--prism) border-box;
  box-shadow: 0 24px 60px -12px var(--glow-c), 0 2px 6px rgba(0, 0, 0, .12); }
dialog::backdrop, .review-dlg::backdrop, #find-dlg::backdrop, #confirm-dlg::backdrop, #notice-dlg::backdrop {
  background: var(--veil); }

/* SMT Schedule, futuristic (the owner, 10/28/26): hologram run bars that keep their meaning (green running, yellow
   ready, red scheduled / preparing, blue day note): dark glass tinted their colour (--holo-fill), a neon rim
   (--holo-rim) and glowing text (--holo-ink), with a glow of their own colour (--glow). Light mode uses deeper rims and
   dark text so they read on white. Bigger text in the display font fills taller lanes (34px; the page's script only
   counts lanes); glass weeks with a lit top edge; a neon today; glowing capacity gauges. */
.s-running { --holo-fill: linear-gradient(180deg, rgba(0, 200, 100, .3), rgba(0, 200, 100, .18)); --holo-rim: #12b866; --holo-ink: #035c31; --glow: rgba(18, 184, 102, .45); }
.s-ready { --holo-fill: linear-gradient(180deg, rgba(255, 190, 0, .38), rgba(255, 190, 0, .24)); --holo-rim: #e0a800; --holo-ink: #5c3f00; --glow: rgba(224, 168, 0, .45); }
.s-scheduled { --holo-fill: linear-gradient(180deg, rgba(225, 29, 72, .24), rgba(225, 29, 72, .14)); --holo-rim: #e11d48; --holo-ink: #9f1239; --glow: rgba(225, 29, 72, .4); }
.s-note { --holo-fill: linear-gradient(180deg, rgba(37, 99, 235, .24), rgba(37, 99, 235, .14)); --holo-rim: #2563eb; --holo-ink: #1e3a8a; --glow: rgba(37, 99, 235, .4); }
:root[data-theme="dark"] .s-running { --holo-fill: linear-gradient(180deg, rgba(0, 255, 120, .34), rgba(0, 255, 120, .2)); --holo-rim: #2bff88; --holo-ink: #8dffc0; --glow: rgba(43, 255, 136, .8); }
:root[data-theme="dark"] .s-ready { --holo-fill: linear-gradient(180deg, rgba(255, 200, 0, .32), rgba(255, 200, 0, .18)); --holo-rim: #ffd23f; --holo-ink: #ffe48a; --glow: rgba(255, 210, 40, .8); }
:root[data-theme="dark"] .s-scheduled { --holo-fill: linear-gradient(180deg, rgba(255, 40, 80, .38), rgba(255, 40, 80, .22)); --holo-rim: #ff3b5c; --holo-ink: #ff9aac; --glow: rgba(255, 59, 92, .85); }
:root[data-theme="dark"] .s-note { --holo-fill: linear-gradient(180deg, rgba(59, 130, 246, .4), rgba(59, 130, 246, .24)); --holo-rim: #4f8dff; --holo-ink: #a5c8ff; --glow: rgba(79, 141, 255, .85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .s-running { --holo-fill: linear-gradient(180deg, rgba(0, 255, 120, .34), rgba(0, 255, 120, .2)); --holo-rim: #2bff88; --holo-ink: #8dffc0; --glow: rgba(43, 255, 136, .8); }
  :root:not([data-theme]) .s-ready { --holo-fill: linear-gradient(180deg, rgba(255, 200, 0, .32), rgba(255, 200, 0, .18)); --holo-rim: #ffd23f; --holo-ink: #ffe48a; --glow: rgba(255, 210, 40, .8); }
  :root:not([data-theme]) .s-scheduled { --holo-fill: linear-gradient(180deg, rgba(255, 40, 80, .38), rgba(255, 40, 80, .22)); --holo-rim: #ff3b5c; --holo-ink: #ff9aac; --glow: rgba(255, 59, 92, .85); }
  :root:not([data-theme]) .s-note { --holo-fill: linear-gradient(180deg, rgba(59, 130, 246, .4), rgba(59, 130, 246, .24)); --holo-rim: #4f8dff; --holo-ink: #a5c8ff; --glow: rgba(79, 141, 255, .85); }
}
:is(.smt-bar, .smt-box, .smt-key):is(.s-running, .s-ready, .s-scheduled, .s-note) {
  background: var(--holo-fill); border: 1px solid var(--holo-rim); color: var(--holo-ink);
  text-shadow: 0 0 8px color-mix(in srgb, var(--glow) 70%, transparent); }
.smt-key:is(.s-running, .s-ready, .s-scheduled, .s-note) { box-shadow: inset 0 0 10px -4px var(--glow), 0 0 10px -4px var(--glow); }
.smt-week { grid-template-rows: auto repeat(var(--lanes), 34px); row-gap: 4px; border-radius: 14px;
            border-color: var(--edge-top) var(--edge-side) var(--edge-bottom); box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow); }
.smt-bar, .smt-box { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: .005em; border-radius: 9px;
  box-shadow: inset 0 0 14px -4px var(--glow, transparent), 0 0 14px -4px var(--glow, transparent); }
.smt-bar.firm { box-shadow: inset 3px 0 0 var(--frozen), inset 0 0 14px -4px var(--glow, transparent), 0 0 14px -4px var(--glow, transparent); }
.smt-bar.firm.cont { box-shadow: inset 0 0 14px -4px var(--glow, transparent), 0 0 14px -4px var(--glow, transparent); }
.smt-complete-btn { background: linear-gradient(180deg, #5dff9d, #19d36b); border-color: transparent; color: #00290f; }
/* Day headings: bigger and full-contrast (the day in ink, the date in the title colour); past days are muted
   instead of faded, and the frozen zone's dotted line sits clear of the date. */
.smt-dh { font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .03em; color: var(--ink);
          padding: 5px 10px; background: color-mix(in srgb, var(--accent) 15%, var(--surface));
          border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.smt-dh b { font-size: 14.5px; font-weight: 700; letter-spacing: 0; color: var(--title); }
.smt-dh.past { opacity: 1; color: var(--muted); }
.smt-dh.past b { color: var(--muted); }
.smt-dh.frozen b { text-decoration-color: var(--frozen); text-underline-offset: 3px; }
.smt-dh.today { background: var(--btn-grad); color: var(--accent-ink); box-shadow: 0 0 16px -2px var(--glow-c); }
.smt-day.today { background: linear-gradient(180deg, color-mix(in srgb, var(--hi) 16%, transparent), transparent 80%); }

/* SMT Schedule: our two Europlacer lines (the ii-A2 and ii-N2, cut out of their photos in static/smt) stand faintly
   behind the calendar, side by side at half height, the pair centred 30% across the space beside the rail (--smt-w)
   with 132px between them, but never closer than 2vw to the rail (the ii-A2 is --smt-h x 1.166 wide); the weeks are
   frosted so they show through.
   Desktop only: on phones the calendar needs the whole screen. */
@media (min-width: 901px) {
  body.page-smt::before { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 60px; z-index: -1; pointer-events: none;
    --smt-h: min(44vh, 26vw); --smt-w: calc(100vw - 60px); --smt-a2: calc(var(--smt-h) * 1.166);
    --smt-x: max(2vw, calc(var(--smt-w) * .3 - 66px - var(--smt-a2)));
    background: url("smt/europlacer-ii-a2.webp") var(--smt-x) 50% / auto var(--smt-h) no-repeat,
                url("smt/europlacer-ii-n2.webp") calc(var(--smt-x) + var(--smt-a2) + 132px) 50% / auto var(--smt-h) no-repeat;
    opacity: .32; }
  html:is([data-rail="wide"], [data-rail="retract"][data-rail-open]) body.page-smt::before { left: 240px; --smt-w: calc(100vw - 240px); }
  :root[data-theme="dark"] body.page-smt::before { opacity: .2; }
  body.page-smt .smt-week { background: color-mix(in srgb, var(--surface) 78%, transparent); }
}
@media (min-width: 901px) and (prefers-color-scheme: dark) { :root:not([data-theme]) body.page-smt::before { opacity: .2; } }

/* Less see-through, no gradient text and no aurora where they'd get in the way. */
@media (prefers-reduced-transparency: reduce) { :root:root:root { --glass: var(--surface); --glass-strong: var(--surface); } }
@media (forced-colors: active) {
  main h1 { background: none; -webkit-text-fill-color: currentColor; }
  .rail a.on::after, main a.my-tile::after { display: none; }
}
@media print {
  body { background: none; }
  body::before { display: none; }
  main h1 { background: none; -webkit-text-fill-color: currentColor; }
}

/* Material plan: needed within 3 months, or a long lead time (mrp.is_priority) */
.mrp-pri { color: var(--accent); font-weight: 700; }
/* Forecasting: COGS, the build rhythm */
.fc-cogs { white-space: nowrap; }
.fc-cogs .fc-part { color: var(--bad); }
.fc-rhythm select { font-size: 12px; padding: 1px 4px; }
.fc-send { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.api-new-key { font-family: var(--mono, monospace); width: 100%; max-width: 560px; }
.live-form label.check { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink); }
.live-form label.check input { width: auto; flex: none; margin-top: 2px; }

/* VIP Viewer (base.html): forms that would change something are greyed out */
form.vip-locked :disabled { cursor: not-allowed; }

/* Ask AI (static/ask.js): the bubble at the bottom right of every page, and its conversation panel */
.ask-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 7px;
           padding: 10px 15px; border: 0; border-radius: 999px; background: var(--btn-grad, var(--accent)); color: var(--accent-ink, #fff);
           font: inherit; font-weight: 700; box-shadow: var(--shadow, 0 6px 20px rgba(0, 0, 0, .18)); cursor: pointer; }
.ask-fab svg { width: 19px; height: 19px; }
.ask-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ask-fab[aria-expanded="true"] { display: none; }
body:has(.ask-fab) .toasts { bottom: 76px; }               /* messages pop up above the bubble */
body:has(.ask-panel:not([hidden])) .toasts { right: 446px; } /* and beside the open panel, not over it */
body.page-sheet:has(.ask-fab) .sheet-wrap { max-height: calc(100vh - 200px); }   /* the table's scrollbar clears the bubble */
body:has(.ask-fab) .pp-content { padding-bottom: 76px; }  /* and the part panel's last lines */
.ask-panel { position: fixed; right: 18px; bottom: 18px; z-index: 65; width: 410px; max-width: calc(100vw - 24px);
             height: min(620px, calc(100vh - 36px)); display: flex; flex-direction: column; background: var(--surface);
             color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow, 0 12px 40px rgba(0, 0, 0, .25)); }
.ask-panel[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ask-head .muted { flex: 1; min-width: 0; }
.ask-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; }
.ask-close svg { width: 16px; height: 16px; }
.ask-list { flex: 1; overflow: auto; padding: 12px; display: grid; align-content: start; gap: 8px;
            font-size: calc(13.5px * var(--z, 1)); }   /* Settings > Text size */
.ask-q { justify-self: end; max-width: 85%; padding: 7px 10px; border-radius: 12px 12px 3px 12px; background: var(--accent-soft);
         white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-a { justify-self: start; max-width: 94%; padding: 8px 10px; border-radius: 12px 12px 12px 3px; background: var(--bg);
         border: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.45; }
.ask-a p { margin: 0 0 6px; }
.ask-a p:last-child, .ask-a ul:last-child { margin-bottom: 0; }
.ask-a ul { margin: 0 0 6px; padding-left: 18px; }
.ask-a code { font-size: 12px; }
.ask-err { background: var(--neg-bg, #fdecea); color: var(--neg-ink, #b42318); }
.ask-wait { color: var(--muted); }
.ask-link { display: inline-block; max-width: 100%; margin: 1px 0; padding: 1px 9px; border: 1px solid var(--accent);
            border-radius: 999px; color: var(--accent); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.ask-link:hover, .ask-link:focus-visible { background: var(--accent-soft); }
.ask-hello { color: var(--muted); display: grid; gap: 6px; justify-items: start; }
.ask-hello p { margin: 0 0 4px; }
.ask-eg { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px;
          font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ask-eg:hover { border-color: var(--accent); }
.ask-form { display: flex; gap: 6px; align-items: flex-end; padding: 8px 10px; border-top: 1px solid var(--line); }
.ask-form textarea { flex: 1; resize: none; font: inherit; font-size: calc(14px * var(--z, 1)); min-height: 40px; max-height: 120px; }
.ask-send { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0;
            border-radius: 10px; background: var(--btn-grad, var(--accent)); color: var(--accent-ink, #fff); cursor: pointer; }
.ask-send:disabled { opacity: .5; cursor: default; }
.ask-send svg { width: 18px; height: 18px; }
.ask-foot { margin: 0; padding: 0 12px 8px; }
.ask-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.ask-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: ask-dot 1s infinite ease-in-out; }
.ask-dots i:nth-child(2) { animation-delay: .15s; }
.ask-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ask-dots i { animation: none; opacity: .6; } }
@media (max-width: 700px) {                 /* phones: the panel fills the screen; the bubble shows only its icon */
  .ask-fab { right: 12px; bottom: 12px; padding: 12px; }
  .ask-fab span { display: none; }
  body:has(.ask-fab) .toasts { bottom: 70px; }
  .ask-panel { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; max-width: none; height: auto; z-index: 75; }
  body:has(.ask-panel:not([hidden])) .toasts { right: 12px; }      /* under the open panel, which fills the screen */
}
@media print { .ask-fab, .ask-panel { display: none !important; } }

/* Retractable (Settings, the owner 11/18/26): the slim rail that opens to the wide one while the pointer is over it, or
   while keyboard focus is inside it, and goes back to slim a moment after it leaves (base.html's script sets and clears
   html[data-rail-open]). The page keeps the slim rail's 60px column, so the open rail lies over the page (the rail is
   sticky with z-index 40) instead of pushing it sideways. The names never fade (a fade as it closes left them hanging
   beside the slim rail), and closed they're hidden: pointing at the rail opens it instead of showing one name. */
@media (min-width: 901px) {
  html[data-rail="retract"][data-rail-open] .side.rail {
    background-color: var(--bg); box-shadow: 10px 0 28px rgba(0, 0, 0, .45); }   /* the glass rail, solid: the page under it doesn't show through */
}
html[data-rail="retract"] .rail .lbl, html[data-rail="retract"] .rail .lbl .det { transition: none; }
html[data-rail="retract"]:not([data-rail-open]) .rail .lbl { visibility: hidden; }
.rail-sample.rail-retract { position: relative; }
.rail-sample.rail-retract::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 9px; width: 25px;
  border: 1px dashed var(--muted); border-left: 0; border-radius: 0 4px 4px 0; opacity: .8; }

/* Edit a BOM's lines (bom_edit.html, 11/20/26) */
.bom-edit-note { max-width: 70em; }
.bom-edit-table td { padding: 2px 4px; }
.bom-edit-table input { width: 100%; min-width: 7em; font-size: 12.5px; padding: 3px 6px; box-sizing: border-box; }
.bom-edit-table input.be-qty { min-width: 4.5em; width: 4.5em; text-align: right; }
.bom-edit-table input.be-desc { min-width: 18em; }
.bom-edit-table input.be-alts { min-width: 12em; }
.bom-edit-table tr.be-added td { background: var(--good-bg); }
.bom-edit-table .be-remove { font-size: 18px; line-height: 1; padding: 0 6px; color: var(--bad); }
.bom-edit-gap { flex: 1; }
div.neg, b.neg { color: var(--bad); }
.bom-edited-warn { margin-top: 4px; font-weight: 400; }

/* The Build Plan's scrollbars: wide, easy to see, a handle never too small to grab; a click on the track jumps there
   (sheet.html). THUMB_MIN there matches the handle's min-height (11/23/26). */
.sheet-wrap::-webkit-scrollbar { width: 16px; height: 14px; }
.sheet-wrap::-webkit-scrollbar-track { background: color-mix(in srgb, var(--muted) 14%, transparent); }
.sheet-wrap::-webkit-scrollbar-thumb { min-height: 56px; min-width: 56px; border-radius: 8px; border: 3px solid transparent;
  background: color-mix(in srgb, var(--muted) 70%, transparent) padding-box; }
.sheet-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent) padding-box; }
.sheet-wrap::-webkit-scrollbar-thumb:active { background: var(--accent) padding-box; }
.sheet-wrap::-webkit-scrollbar-button { display: none; }
.sheet-wrap::-webkit-scrollbar-corner { background: transparent; }
