/* Romeoville open work orders. Tokens and components follow the R&D tracker / Work Order Insight look.
   app.js always sets data-theme on <html>; the media query only covers the moment before it runs. */
:root {
  --surface:#ffffff; --page:#eef1f5; --zebra:#f6f8fb; --select:#dfe7f5; --ink:#0f1729; --ink2:#4a5265;
  --muted:#5f6779; --grid:#e8ecf1; --axis:#c3cad6; --line:#dde2ea; --primary:#16213a; --accent:#16213a;
  --unfav:#e34948; --fav:#2a78d6; --unfav_text:#b42828; --fav_text:#1c5cab; --warn:#c88a00;
  --wash:rgba(42,120,214,0.12);
  --fill-bad:#b42828; --fill-warn:#c88a00; --fill-good:#1c5cab;
  --tag-bad-bg:#fbe4e4; --tag-bad:#b42828; --tag-warn-bg:#fbefd2; --tag-warn:#7a5600; --tag-good-bg:#e3edfa; --tag-good:#1c5cab;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* header: white in the light theme so the logo shows in its own brand colours (navy #283343, blue #193d66) */
  --bar:#ffffff; --bar2:#e8edf4; --bar_ink:#0f1729; --bar_muted:#4a5265;
  --pill-bg:#eef1f5; --pill-ink:#4a5265; --reload-bg:#193d66; --reload-hover:#244f80;
  --logo-a:#283343; --logo-b:#193d66;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface:#182031; --page:#0f1420; --zebra:#1c2538; --select:#2a3756; --ink:#eef1f6; --ink2:#c4cad6;
    --muted:#97a0b2; --grid:#263046; --axis:#3a4560; --line:#2a3449; --bar:#0b1020; --bar2:#22304f;
    --bar_ink:#ffffff; --bar_muted:#a9b3c7; --primary:#3d5a99; --accent:#a9c1ff;
    --unfav:#e66767; --fav:#3987e5; --unfav_text:#f29a9a; --fav_text:#8dbaf2; --warn:#e0a72a;
    --wash:rgba(57,135,229,0.18);
    --fill-bad:#e66767; --fill-warn:#e0a72a; --fill-good:#3987e5;
    --tag-bad-bg:#3a1d1f; --tag-bad:#f29a9a; --tag-warn-bg:#3b3322; --tag-warn:#f6c96a; --tag-good-bg:#1d2c4a; --tag-good:#8dbaf2;
    --pill-bg:#26324f; --pill-ink:#d5dbe7; --reload-bg:#22304f; --reload-hover:#33446b; --logo-a:#e9edf4; --logo-b:#7fa7d9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface:#182031; --page:#0f1420; --zebra:#1c2538; --select:#2a3756; --ink:#eef1f6; --ink2:#c4cad6;
  --muted:#97a0b2; --grid:#263046; --axis:#3a4560; --line:#2a3449; --bar:#0b1020; --bar2:#22304f;
  --bar_ink:#ffffff; --bar_muted:#a9b3c7; --primary:#3d5a99; --accent:#a9c1ff;
  --unfav:#e66767; --fav:#3987e5; --unfav_text:#f29a9a; --fav_text:#8dbaf2; --warn:#e0a72a;
  --wash:rgba(57,135,229,0.18);
  --fill-bad:#e66767; --fill-warn:#e0a72a; --fill-good:#3987e5;
  --tag-bad-bg:#3a1d1f; --tag-bad:#f29a9a; --tag-warn-bg:#3b3322; --tag-warn:#f6c96a; --tag-good-bg:#1d2c4a; --tag-good:#8dbaf2;
  --pill-bg:#26324f; --pill-ink:#d5dbe7; --reload-bg:#22304f; --reload-hover:#33446b; --logo-a:#e9edf4; --logo-b:#7fa7d9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.4 var(--font); min-height: 100vh;
       display: flex; flex-direction: column; }
button, input, select { font: inherit; color: inherit; }
input, select { background: var(--surface); border: 1px solid var(--axis); border-radius: 6px; padding: 5px 8px; }
input[type="search"] { width: min(340px, 100%); }
code { font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* app bar */
.appbar { background: var(--bar); color: var(--bar_muted); display: flex; align-items: center; gap: 12px;
          padding: 10px 24px; min-height: 76px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; padding-right: 8px; flex: none; white-space: nowrap; }
/* the US Hose Titeflex logo, traced from the brand PNG into two paths; colours follow the theme */
.logo { height: 50px; width: auto; flex: none; display: block; }
.logo .lg-a { fill: var(--logo-a); } .logo .lg-b { fill: var(--logo-b); }
.bsep { width: 1px; align-self: stretch; margin: 4px 0; background: var(--line); }
.btxt { display: flex; flex-direction: column; line-height: 1.2; }
.brand .sub { font-size: 13px; letter-spacing: .3px; }
.brand .title { color: var(--bar_ink); font-weight: 600; font-size: 18px; }
/* the status pill is the one item in the bar that gives way (ellipsis) so logo, tabs and buttons stay on one row */
.pill { margin-left: auto; max-width: min(680px, 100%); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        padding: 4px 12px; border-radius: 12px; background: var(--pill-bg); color: var(--pill-ink); font-size: 13px; }
@media (min-width: 1100px) { .appbar { flex-wrap: nowrap; } }
.reload { display: inline-flex; align-items: center; gap: 7px; background: var(--reload-bg); color: #fff; border: 0;
          border-radius: 7px; padding: 7px 15px; font-size: 14px; font-weight: 600; cursor: pointer; flex: none; }
.reload svg { width: 15px; height: 15px; }
.reload:hover { background: var(--reload-hover); }
.reload:disabled { opacity: .55; cursor: default; }
.reload:disabled svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill.warn { background: var(--tag-warn-bg); color: var(--tag-warn); }
.pill.error { background: var(--tag-bad-bg); color: var(--tag-bad); }
.theme-btn { background: none; border: 0; color: var(--bar_muted); width: 36px; height: 36px; padding: 8px;
  border-radius: 7px; cursor: pointer; flex: none; }
.theme-btn:hover { background: var(--bar2); color: var(--bar_ink); }
.theme-btn svg { width: 20px; height: 20px; display: block; }
.theme-btn .sun, [data-theme="dark"] .theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: inline; }

/* body */
main { padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
/* tabs sit in the app bar, after the brand; the underline of the open tab rests on the bar's bottom edge */
.tabs { display: flex; align-self: stretch; margin: -10px 0 -1px 4px; overflow-x: auto; min-width: 0; flex: 0 1 auto; }
@media (min-width: 1100px) { .tabs { flex: none; } }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--bar_muted); padding: 0 12px;
               cursor: pointer; white-space: nowrap; font-size: 15px; }
.tabs button:hover { color: var(--bar_ink); }
.tabs button.on { color: var(--bar_ink); font-weight: 600; border-bottom-color: var(--accent); }
.tabs .count { color: var(--bar_muted); opacity: .8; font-weight: 400; }
.tab { display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.chipx { display: inline-flex; align-items: center; gap: 6px; background: var(--wash); color: var(--fav_text);
         border-radius: 12px; padding: 3px 4px 3px 10px; font-size: 12.5px; font-weight: 600; }
.chipx button { all: unset; cursor: pointer; width: 18px; height: 18px; border-radius: 9px; text-align: center; line-height: 18px; }
.chipx button:hover { background: var(--select); }

/* answer card */
.answer { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px;
          display: flex; gap: 16px; align-items: center; }
.answer .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.answer .top { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
           white-space: nowrap; }
.tagx { border-radius: 9px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tagx.bad { background: var(--tag-bad-bg); color: var(--tag-bad); }
.tagx.warn { background: var(--tag-warn-bg); color: var(--tag-warn); }
.tagx.good { background: var(--tag-good-bg); color: var(--tag-good); }
.tagx.plain { background: var(--zebra); color: var(--ink2); border: 1px solid var(--line); }
.headline { font-size: 19px; font-weight: 600; }
.detail { color: var(--ink2); font-size: 13px; }
.facts { color: var(--muted); font-size: 12px; }
.answer.error .headline { color: var(--unfav_text); }
.how { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink2); } .how li { margin: 3px 0; }

/* tables */
.table { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 460px; }
.table.tall { max-height: min(64vh, 680px); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--ink2); text-align: left; font-weight: 600;
     padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 6px 8px; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
tbody tr:nth-child(even) > td { background: var(--zebra); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.go { cursor: pointer; } tr.go:hover > td { background: var(--select); }
tr.go.on > td { background: var(--select); }
tr.go:focus-visible { outline: 2px solid var(--fav); outline-offset: -2px; }
.mo { font-weight: 700; font-variant-numeric: tabular-nums; }
td.desc { max-width: 150px; }
td.duecell { white-space: normal; min-width: 150px; }
td.nowat { max-width: 165px; }
@media (min-width: 1500px) { td.nowat { max-width: 260px; } }
td.duecell > span:first-child { white-space: nowrap; }
@media (min-width: 1500px) { td.desc { max-width: 320px; } }
#orders th, #orders td { padding-left: 7px; padding-right: 7px; }
.answer { padding: 10px 18px; }
.answer .facts:empty { display: none; }
.late { color: var(--unfav_text); font-weight: 600; }
.behind { color: var(--tag-warn); font-weight: 600; }
.empty-msg { color: var(--muted); padding: 20px; text-align: center; white-space: normal; }
.status { color: var(--muted); padding: 4px 20px 8px; font-size: 12px; min-height: 24px; }
.wcbars { display: flex; gap: 1px; min-width: 120px; }
.wcbar { display: block; flex: none; height: 10px; border-radius: 2px; background: var(--fill-good); vertical-align: middle;
         transform-origin: left; animation: growX .45s cubic-bezier(.2,.7,.2,1) both; }
.wcbar.b { background: var(--fill-warn); } .wcbar.l { background: var(--fill-bad); }
td.wcbarcell { width: 24%; min-width: 160px; }
/* a bar drawn past the scale: a slanted gap near its end shows it is cut short */
.wcbars.cut { position: relative; padding-right: 14px; }
.wcbars.cut::after { content: ""; position: absolute; right: 22px; top: -3px; width: 14px; height: 16px;
  background: linear-gradient(115deg, transparent 0 30%, var(--surface) 30% 45%, transparent 45% 55%, var(--surface) 55% 70%, transparent 70%); }
.wcbars.cut::before { content: "›"; position: absolute; right: 2px; top: -5px; font-size: 15px; font-weight: 700; color: var(--muted); }
.wcbars.cut .wcbar:last-of-type { border-radius: 2px 0 0 2px; }
.wckey { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.wckey .sw { width: 9px; height: 9px; } .wckey .sw.good { margin-left: 6px; }

/* holds grouping */
#holds .ghead { cursor: pointer; }
#holds .ghead > td { background: var(--zebra); font-weight: 600; }
#holds .ghead .chev { display: inline-block; margin-right: 6px; transition: transform .2s ease; transform: rotate(90deg); }
#holds .ghead.shut .chev { transform: rotate(0deg); }
#holds tr.hid { display: none; }

/* order detail */
tr.odrow > td { padding: 0; background: var(--surface) !important; white-space: normal; max-width: none; }
.odetail { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 20px 18px 28px;
           display: flex; flex-direction: column; gap: 14px; animation: fadeUp .25s ease both;
           position: sticky; left: 0; max-width: calc(100vw - 44px); }
.facts4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 10px 24px; }
.facts4 > div, .sect { display: flex; flex-direction: column; gap: 2px; }
.sect { gap: 6px; }
.facts4 .big { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts4 .k { font-size: 12px; color: var(--muted); }
.routing { display: flex; overflow-x: auto; padding: 0 0 4px 1px; }
.rs { flex: 1 1 0; min-width: 112px; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; margin-left: -1px;
      border: 1px solid var(--line); border-top-width: 3px; background: var(--surface); font-size: 12px; line-height: 1.3;
      animation: stepIn .3s ease both; animation-delay: calc(80ms + var(--i, 0) * 35ms); }
.rs .nm { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rs .rk { font-weight: 600; font-size: 10.5px; color: var(--ink2); background: var(--zebra); border: 1px solid var(--line);
          border-radius: 8px; padding: 0 5px; white-space: nowrap; }
.rs .cd { font-size: 11px; color: var(--muted); } .rs .sb { font-size: 11px; color: var(--ink2); }
.rs.done { border-top-color: var(--axis); background: var(--zebra); }
.rs.skip { border-top-color: var(--line); background: repeating-linear-gradient(135deg, var(--surface) 0 4px, var(--zebra) 4px 8px); }
.rs.skip .nm { color: var(--muted); }
.rs.info { flex: 0 0 auto; min-width: 70px; border-style: dotted; border-top-style: solid; border-top-color: var(--line); color: var(--muted); }
.rs.info .nm { color: var(--muted); font-weight: 400; }
.rs.now { border-top-color: var(--fill-good); } .rs.now .sb { color: var(--fav_text); font-weight: 600; }
.rs.now.warn { border-top-color: var(--fill-warn); } .rs.now.warn .sb { color: var(--tag-warn); }
.rs.now.bad { border-top-color: var(--fill-bad); } .rs.now.bad .sb { color: var(--unfav_text); }
.needtbl { max-height: 320px; }
.needtbl tr.short > td { background: color-mix(in srgb, var(--fill-bad) 8%, var(--surface)); }
.needtbl tr.insp > td { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.holdlist { margin: 0; padding-left: 18px; font-size: 13px; }
.holdlist li { color: var(--unfav_text); }

@media (max-width: 1100px) {
  th { white-space: normal; vertical-align: bottom; }
  td { white-space: normal; overflow-wrap: anywhere; }
  td.num, td .tagx, td.mo, td.kind { white-space: nowrap; overflow-wrap: normal; }
}
@media (max-width: 640px) {
  main { padding-left: 16px; padding-right: 16px; }
  .answer { padding: 12px 14px; }
  .headline { font-size: 16px; }
  .pill { margin-left: 0; }
  .odetail { padding-left: 14px; padding-right: 14px; }
}
@media (min-width: 700px) and (max-height: 820px) {
  main { padding-top: 8px; gap: 8px; }
  .answer { padding: 8px 16px; }
  .headline { font-size: 16px; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.tab:not([hidden]) { animation: fadeUp .25s ease both; }
.tabs button { transition: color .15s ease, border-color .2s ease; }
tr.go > td { transition: background-color .15s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- stage map (grouped by process; same look as the R&D tracker) ---------- */
/* process groups: one compact segmented row */
.gpick { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
         width: fit-content; max-width: 100%; overflow: hidden; }
.gpick button { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
                padding: 7px 14px; font-size: 13px; color: var(--ink2); border-left: 1px solid var(--line); white-space: nowrap; }
.gpick button:first-child { border-left: 0; }
.gpick button:hover { background: var(--zebra); color: var(--ink); }
.gpick button:focus-visible { outline: 2px solid var(--fav); outline-offset: -2px; }
.gpick button.on { background: var(--select); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.gpick b { font-variant-numeric: tabular-nums; color: var(--ink); }
.gpick .fl { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 5px; border-radius: 9px; text-align: center;
             font-variant-numeric: tabular-nums; }
.gpick .fl.bad { background: var(--tag-bad-bg); color: var(--tag-bad); }
.gpick .fl.warn { background: var(--tag-warn-bg); color: var(--tag-warn); }
.gsum { font-size: 13px; color: var(--ink2); }
.gsum b { color: var(--ink); }
#gsum { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 18px; }
#gsum b { color: var(--ink2); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--ink2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .vsep { width: 1px; height: 18px; background: var(--line); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.sw.bad { background: var(--fill-bad); } .sw.warn { background: var(--fill-warn); } .sw.good { background: var(--fill-good); } .sw.none { background: var(--axis); }
.map-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mapscroll { overflow-x: auto; }
.mrow { display: grid; grid-template-columns: var(--cols); }
.mhead { border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--ink2); }
.mhead > div { padding: 8px 3px 7px; border-left: 1px solid var(--grid); display: flex; flex-direction: column; align-items: center;
               justify-content: flex-end; gap: 4px; text-align: center; line-height: 1.15; min-width: 0; }
.mhead .cn { overflow-wrap: anywhere; hyphens: auto; max-width: 100%; }
.mhead > div.ohead { border-left: 0; align-items: flex-start; justify-content: space-between; padding: 8px 10px 7px 14px; text-align: left; gap: 6px; }
.mhead .n { min-width: 20px; padding: 0 5px; border-radius: 3px; font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: center; color: var(--muted); }
.mhead .n.has { background: var(--primary); color: #fff; }
/* the colour key lives in the Order column head, so it stays in view while the rows scroll */
.mkey { display: grid; grid-template-columns: repeat(3, auto); gap: 3px 12px; font-size: 11px; font-weight: 400; color: var(--muted); }
.mkey > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mkey .sw { width: 9px; height: 9px; }
.orow { border-bottom: 1px solid var(--grid); background: var(--surface); }
.orow:last-child { border-bottom: 0; }
.orow.z { background: var(--zebra); }
.orow.open { background: var(--select); }
.obtn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px 6px 12px; min-height: 44px; width: 100%; min-width: 0; }
.obtn:hover { background: rgba(127,140,170,0.10); }
.obtn:focus-visible { outline: 2px solid var(--fav); outline-offset: -2px; }
.obtn .chev { flex: none; margin-top: 4px; transition: transform .12s; color: var(--muted); }
.orow.open .obtn .chev { transform: rotate(90deg); }
.obtn .o1 { display: flex; gap: 8px; align-items: center; min-width: 0; }
.obtn .wo { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.obtn .it { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.obtn .o2 { font-size: 12px; color: var(--ink2); display: flex; align-items: center; gap: 6px; padding-left: 18px; white-space: nowrap; min-width: 0;
            overflow: hidden; font-variant-numeric: tabular-nums; }
.obtn .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cell { position: relative; display: flex; align-items: center; justify-content: center; padding: 4px 2px; border-left: 1px solid var(--grid); min-height: 44px; }
/* step markers: small dots so the eye goes straight to the coloured "here now" block */
.nd { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--axis); box-sizing: border-box; flex: none; }
.nd.done { background: var(--muted); border-color: var(--muted); }
.nd.skip { background: var(--surface); border: 1.5px dashed var(--muted); }
.nd.end { width: 7px; height: 7px; border-radius: 1px; }
.orow .nd { cursor: default; }
.trk { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; }
.trk.first { left: 50%; } .trk.last { right: 50%; }
.trk.done { background: var(--axis); }
.trk.ahead, .trk.cur.first { background: repeating-linear-gradient(90deg, var(--axis) 0 4px, transparent 4px 8px); }
.trk.cur.bad:not(.first) { background: linear-gradient(90deg, var(--fill-bad) 50%, transparent 50%), repeating-linear-gradient(90deg, var(--axis) 0 4px, transparent 4px 8px); }
.trk.cur.warn:not(.first) { background: linear-gradient(90deg, var(--fill-warn) 50%, transparent 50%), repeating-linear-gradient(90deg, var(--axis) 0 4px, transparent 4px 8px); }
.trk.cur.good:not(.first), .trk.cur.none:not(.first) { background: linear-gradient(90deg, var(--fill-good) 50%, transparent 50%), repeating-linear-gradient(90deg, var(--axis) 0 4px, transparent 4px 8px); }
.trk.cur.bad.last { background: var(--fill-bad); } .trk.cur.warn.last { background: var(--fill-warn); } .trk.cur.good.last { background: var(--fill-good); }
.node { position: relative; width: 8px; height: 8px; border-radius: 1px; }
.node.done { background: var(--axis); }
.node.ahead { background: var(--surface); border: 2px solid var(--axis); }
.blk { position: relative; display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600;
       white-space: nowrap; border: 1px solid var(--axis); background: var(--surface); color: var(--ink2); line-height: 1; font-variant-numeric: tabular-nums;
       transition: transform .15s ease; }
.blk:hover { transform: translateY(-1px); }
.blk.done { background: var(--grid); border-color: var(--grid); }
.blk.first { border: 1.5px solid var(--ink); color: var(--ink); }
.blk.skip { background: repeating-linear-gradient(135deg, var(--surface) 0 3px, var(--grid) 3px 6px); border-color: var(--line); color: var(--muted); }
.blk.now { height: 24px; font-size: 12px; }
.blk.now.bad { background: var(--fill-bad); border-color: var(--fill-bad); color: var(--on-fill-bad, #fff); }
.blk.now.warn { background: var(--fill-warn); border-color: var(--fill-warn); color: var(--on-fill-warn, #0f1729); }
.blk.now.good { background: var(--fill-good); border-color: var(--fill-good); color: var(--on-fill-good, #fff); }
.blk.now.none { background: var(--axis); border-color: var(--axis); color: var(--ink); }
.tagx.mini { padding: 0 6px; font-size: 11px; }
.maphow { font-size: 12px; color: var(--muted); }
.orow .odetail { border-top: 1px solid var(--line); border-bottom: 0; padding-left: 36px; }
@media (prefers-reduced-motion: no-preference) { .map-intro .orow { animation: stepIn .3s ease both; } }
.blk { min-width: 22px; justify-content: center; }

/* ---------- lead-time tab ---------- */
/* two charts a row on a laptop, three on a big monitor (was four small ones) */
.lcharts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr)); gap: 12px; }
.lchart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 6px; }
.lchart h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.lchart h3 span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.lchart svg { width: 100%; height: auto; display: block; }
.lchart text { fill: var(--muted); font-size: 13px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.lchart text.lbl { font-weight: 700; font-size: 13.5px; }
.lchart .gl { stroke: var(--grid); stroke-width: 1; }
.ln { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.ln.p50 { stroke: var(--fill-good); } .ln.p85 { stroke: var(--fill-warn); }
/* the two lines that often run together: different hue AND shape. "promised" is a wide soft band underneath, "wait before the
   first booking" a dashed line on top, so both stay visible where they overlap. Hues checked with the dataviz validator
   (green/magenta: light CVD dE 8.1; dark 7.1 = floor, legal because of the shape difference + direct labels). */
:root { --ln-start: #008300; --ln-due: #d55181; }
:root[data-theme="dark"] { --ln-start: #0ca30c; --ln-due: #e87ba4; }
.ln.start { stroke: var(--ln-start); stroke-dasharray: 7 5; stroke-width: 2.4; }
.ln.due { stroke: var(--ln-due); stroke-width: 8; stroke-opacity: .45; }
:root[data-theme="dark"] .ln.due { stroke-opacity: .6; }
.lchart circle.p50 { fill: var(--fill-good); } .lchart circle.p85 { fill: var(--fill-warn); }
.lchart text.p50 { fill: var(--fill-good); } .lchart text.p85 { fill: var(--fill-warn); } .lchart text.start { fill: var(--ln-start); } .lchart text.due { fill: var(--ln-due); }
.ln-key { display: inline-block; width: 24px; height: 0; border-top: 3px solid; vertical-align: middle; }
.ln-key.p50 { border-color: var(--fill-good); } .ln-key.p85 { border-color: var(--fill-warn); }
.ln-key.start { border-color: var(--ln-start); border-top-style: dashed; }
.ln-key.due { border: 0; height: 8px; border-radius: 4px; background: var(--ln-due); opacity: .5; }
:root[data-theme="dark"] .ln-key.due { opacity: .65; }
#lead_tbl td.up { color: var(--tag-warn); font-weight: 600; }
/* ---------- stage map: which orders to show ---------- */
.vpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vpick button { all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
                font-size: 13px; color: var(--ink2); display: inline-flex; gap: 6px; align-items: baseline; }
.vpick button:hover { border-color: var(--axis); color: var(--ink); }
.vpick button:focus-visible { outline: 2px solid var(--fav); outline-offset: 1px; }
.vpick button.on { border-color: var(--accent); background: var(--select); color: var(--ink); font-weight: 600; }
.vpick button b { font-variant-numeric: tabular-nums; }
.vpick button { padding: 4px 11px; }
.bar .vpick { margin-right: 6px; }
#mq { width: min(260px, 100%); }
/* ---------- stage map: filters and column heads stay put while the rows scroll ---------- */
.mstick { position: sticky; top: 0; z-index: 6; background: var(--page); display: flex; flex-direction: column; gap: 6px; padding: 4px 0 6px; }
.map-card { overflow: visible; }      /* a clipping ancestor would stop the header sticking; wide maps scroll the page sideways */
.mapscroll { overflow: visible; }
.mhead { position: sticky; top: var(--stickh, 0px); z-index: 5; background: var(--surface); border-top-left-radius: 10px; border-top-right-radius: 10px; }
.answer[hidden] { display: none; }
/* sales-order links and copy buttons (2 Dec 2026) */
.solink { color: var(--fav_text); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; white-space: nowrap; margin-left: 8px; }
.socell .solink, .so1 .solink { margin-left: 0; }
.obtn .so1 { flex: none; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.obtn .so1 .muted { font-weight: 400; }
.solink:hover { text-decoration-style: solid; }
.cpy { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; padding: 2px; border-radius: 4px; cursor: pointer; opacity: .55; }
.cpy:hover, .cpy:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.cpy.done { opacity: 1; color: var(--fav_text); }
.sowos { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.sowo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sowo.me b { text-decoration: underline; }
#orders tr.sohead > td { background: color-mix(in srgb, var(--fav) 9%, var(--surface)); padding-top: 9px; padding-bottom: 7px; border-top: 2px solid var(--line); }
#orders tr.sohead .tagx { margin-left: 6px; }
