/* "Steel & hi-vis" theme. Navy steel, safety-yellow signal color, Barlow type.
   --brand comes from Settings > Company (accent color); --brand-ink is the text that sits on it. */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Regular.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-SemiBold.ttf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Bold.ttf"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-SemiBold.ttf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-Bold.ttf"); font-weight: 700; font-display: swap; }

:root {
  --brand: #FFC52E;
  --brand-ink: #15233B;
  --navy: #15233B;
  --navy-2: #1E3050;
  --navy-3: #2A3F63;
  --steel: #E9EDF2;
  --panel: #FFFFFF;
  --ink: #15233B;
  --ink-2: #4D5B70;
  --ink-3: #8592A5;
  --line: #D9DFE7;
  --line-2: #EEF1F5;
  --hover: #F5F7FA;
  --blue: #2457C5;
  --green: #1F8A4C; --green-bg: #DFF3E6;
  --yellow: #8A5A00; --yellow-bg: #FFF1CF;
  --orange: #B4530F; --orange-bg: #FDE6D3;
  --red: #C8302A;  --red-bg: #FCE4E2;
  --purple: #5B33B5; --purple-bg: #EBE3FB;
  --radius: 4px;
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--steel); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font: 600 36px/1.05 var(--cond); margin: 0; letter-spacing: -.005em; }
h2 { font: 600 21px/1.2 var(--cond); margin: 0 0 10px; }
h3 { font: 600 17px/1.2 var(--cond); margin: 0 0 8px; color: var(--ink-2); }
small, .muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C5D0DF; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand img { max-height: 36px; max-width: 150px; background: #fff; border-radius: 6px; padding: 3px; }
.brand .mark { width: 34px; height: 34px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 700 18px var(--cond); transform: skew(-8deg); flex: none; }
.brand .name { font: 600 19px/1.1 var(--cond); color: #fff; }
.brand-symbol { flex: none; width: 44px; height: 36px; display: grid; place-items: center; }
.brand-symbol img { width: 44px; height: 36px; object-fit: contain; }
.nav-label { font: 500 14px var(--cond); color: #6F82A0; padding: 16px 10px 5px; letter-spacing: .03em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius, 4px); color: #C5D0DF; font-weight: 500; }
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav a.soon { color: #8C9BB3; }
.nav a .tag { margin-left: auto; font-size: 12px; color: #6F82A0; }
.nav svg { width: 18px; height: 18px; flex: none; }

/* Keep the rail beside the workspace at every screen width. Expansion overlays it. */
.sidebar-toggle { display: none; }
@media screen {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .side { width: 76px; padding: 20px 12px; overflow-x: hidden; z-index: 30;
    scrollbar-width: thin; scrollbar-color: #526786 transparent;
    transition: width .4s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease; }
  .side .brand { width: 208px; padding: 2px 4px 22px; }
  .side .brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side .nav a { width: 208px; min-height: 40px; padding: 9px 17px; white-space: nowrap; }
  .side .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .side .nav-label { width: 208px; position: relative; padding-left: 17px; }
  .side .nav-label::after { content: ""; position: absolute; left: 17px; top: 29px; width: 18px; height: 1px;
    background: #3D506E; transition: opacity .2s ease; }
  .side .brand .name, .side .nav-text, .side .nav a .tag, .side .nav-label > span {
    opacity: 0; transform: translateX(-6px); transition: opacity .18s ease, transform .25s ease; }
  html[data-sidebar-open="true"] .side, html[data-sidebar-keyboard="true"] .side,
  html[data-sidebar-menu-open="true"] .side, html:not(.sidebar-managed) .side:focus-within {
    width: 232px; box-shadow: 8px 0 24px rgba(8, 19, 36, .2); }
  html[data-sidebar-open="true"] .side :is(.name, .nav-text, .tag, .nav-label > span),
  html[data-sidebar-keyboard="true"] .side :is(.name, .nav-text, .tag, .nav-label > span),
  html[data-sidebar-menu-open="true"] .side :is(.name, .nav-text, .tag, .nav-label > span),
  html:not(.sidebar-managed) .side:focus-within :is(.name, .nav-text, .tag, .nav-label > span) {
    opacity: 1; transform: translateX(0); transition-delay: .06s; }
  html[data-sidebar-open="true"] .side .nav-label::after,
  html[data-sidebar-keyboard="true"] .side .nav-label::after,
  html[data-sidebar-menu-open="true"] .side .nav-label::after, html:not(.sidebar-managed) .side:focus-within .nav-label::after { opacity: 0; }
  .sidebar-toggle { width: 44px; min-height: 40px; margin: 0 4px 14px; padding: 8px;
    align-items: center; justify-content: center; border: 1px solid #526786; border-radius: var(--radius, 4px);
    color: #C5D0DF; background: transparent; cursor: pointer; }
  .sidebar-toggle:hover { background: var(--navy-2); color: #fff; }
  .sidebar-toggle svg { width: 18px; height: 18px; }
}
@media screen and (hover: hover) and (pointer: fine) {
  html:not(.sidebar-managed) .side:hover { width: 232px; box-shadow: 8px 0 24px rgba(8, 19, 36, .2); }
  html:not(.sidebar-managed) .side:hover :is(.name, .nav-text, .tag, .nav-label > span) {
    opacity: 1; transform: translateX(0); transition-delay: .06s; }
  html:not(.sidebar-managed) .side:hover .nav-label::after { opacity: 0; }
}
@media screen and (max-width: 1000px), screen and (hover: none), screen and (pointer: coarse) {
  html.sidebar-managed .sidebar-toggle { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .side, .side .brand .name, .side .nav-text, .side .nav a .tag,
  .side .nav-label > span, .side .nav-label::after { transition: none !important; }
}

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(233, 237, 242, .94); backdrop-filter: blur(8px); padding: 14px 34px; display: flex; align-items: center; gap: 12px; }
.top .spacer { flex: 1; }
.content { padding: 14px 34px 64px; max-width: 1340px; }

/* ---------- page transitions ---------- */
/* Keep the old page visible while loading, then crossfade only the main content. */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-out { from { opacity: 1; } to { opacity: 0; } }
.content { animation: page-in .32s cubic-bezier(.22, 1, .36, 1); }
.native-page-transitions .content { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  /* A viewport snapshot stays aligned even when leaving a long, scrolled page. */
  :root { view-transition-name: root; }
  .side { view-transition-name: page-sidebar; }
  .top { view-transition-name: page-toolbar; }
  ::view-transition-group(root) { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: plus-lighter; }
  ::view-transition-old(root) { animation: page-out .32s cubic-bezier(.22, 1, .36, 1) both; }
  ::view-transition-new(root) { animation: page-in .32s cubic-bezier(.22, 1, .36, 1) both; }
  /* Keep navigation and the toolbar steady while the page beneath them changes. */
  ::view-transition-group(page-sidebar), ::view-transition-group(page-toolbar) { animation: none; }
  ::view-transition-old(page-sidebar), ::view-transition-old(page-toolbar) { display: none; }
  ::view-transition-new(page-sidebar), ::view-transition-new(page-toolbar) { animation: none; }
  /* Theme changes include toolbar and sidebar colors. */
  html.theme-transition :is(.top, .side) { view-transition-name: none; }
  html.theme-transition::view-transition-old(root),
  html.theme-transition::view-transition-new(root) {
    animation-duration: .3s;
    animation-timing-function: ease-in-out;
  }
}

/* ---------- side panel (drawer) ---------- */
/* an edit form that slides in from the right over a dimmed page (open/close: app.js, data-drawer) */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 46; width: min(440px, 100%); overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: 0 16px 40px rgba(21, 35, 59, .22);
  padding: 18px 20px; transform: translateX(40px); opacity: 0; visibility: hidden;
  transition: transform .15s, opacity .15s, visibility 0s .15s; }
.drawer.open { transform: none; opacity: 1; visibility: visible; transition: transform .15s, opacity .15s; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.drawer-head h2 { margin: 0; }
.drawer-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); text-align: right; }
.drawer-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(21, 35, 59, .28); opacity: 0; visibility: hidden;
  transition: opacity .15s, visibility 0s .15s; }
.drawer-scrim.open { opacity: 1; visibility: visible; transition: opacity .15s; }
body.drawer-on { overflow: hidden; }   /* the page behind doesn't scroll */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 6px; font-size: 16px; }
.back { display: inline-block; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- global search ---------- */
.gsearch { position: relative; flex: 1; max-width: 580px; }
.gsearch input[type=search] { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: inherit; color: var(--ink); }
.gsearch input[type=search]:focus { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--navy); }
.gsearch svg { position: absolute; left: 13px; top: 11px; width: 18px; height: 18px; color: var(--ink-3); }
.gresults { position: absolute; top: 46px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(21, 35, 59, .18); max-height: 70vh; overflow-y: auto; display: none; }
.gresults.open { display: block; }
.gresults .grp { font: 600 14px var(--cond); color: var(--ink-3); padding: 10px 14px 2px; }
.gresults a { display: block; padding: 7px 14px; color: var(--ink); }
.gresults a:hover, .gresults a.sel { background: var(--hover); text-decoration: none; box-shadow: inset 3px 0 0 var(--brand); }
.gresults a .l { font-weight: 600; }
.gresults a .s { display: block; font-size: 13px; color: var(--ink-3); }
.gresults a.muted .l { color: var(--ink-3); }
.gresults .empty { padding: 14px; color: var(--ink-3); }
.gresults .all { border-top: 1px solid var(--line-2); font-size: 14px; color: var(--blue); }

/* ---------- panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card-head a { font-weight: 500; }
.flush > .card-head { padding: 16px 20px 6px; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; color: var(--ink); }
.stat b { display: block; font: 700 32px/1 var(--cond); margin-bottom: 4px; }
.stat span { color: var(--ink-2); font-size: 14px; }
a.stat:hover { border-color: var(--navy); text-decoration: none; }

/* ---------- fleet strip (Home) ---------- */
.fleet { background: var(--navy); border-radius: var(--radius); padding: 16px 18px 18px; margin-bottom: 18px; color: #fff; }
.fleet .card-head h2 { color: #fff; }
.fleet .card-head span, .fleet .card-head a { color: #9FB0C8; font-size: 15px; }
.plates { display: flex; gap: 10px; flex-wrap: wrap; }
.plate { min-width: 96px; border-radius: var(--radius); background: var(--navy-2); padding: 9px 12px 10px; border-top: 4px solid var(--green); color: #fff; }
.plate:hover { text-decoration: none; background: var(--navy-3); }
.plate b { display: block; font: 700 30px/1 var(--cond); }
.plate i { font-style: normal; font-size: 13px; color: #9FB0C8; white-space: nowrap; }
.plate.down { border-top-color: var(--red); background: #3A2230; }
.plate.down i { color: #FFB4AE; }
.plate.support { border-top-color: #5C6F8C; }

/* ---------- attention list (Home) ---------- */
.attn { padding: 0; overflow: hidden; }
.attn .card-head { padding: 16px 20px 10px; margin: 0; border-bottom: 1px solid var(--line-2); }
.attn .count { font: 700 15px var(--cond); background: var(--brand); color: var(--brand-ink); border-radius: 6px; padding: 1px 9px; margin-left: 8px; vertical-align: 3px; }
.item { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 13px 20px 13px 0; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item .edge { align-self: stretch; border-radius: 0 4px 4px 0; }
.edge.red { background: var(--red); } .edge.orange { background: #E8771E; } .edge.yellow { background: #E9B10E; } .edge.blue { background: var(--blue); } .edge.gray { background: #B3BCC9; }
.item b { display: block; font-weight: 600; }
.item small { color: var(--ink-2); font-size: 14px; }
.allclear { padding: 26px 20px; color: var(--ink-2); display: flex; align-items: center; gap: 12px; }
.allclear::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font: 600 15px var(--cond); color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #F7F9FB; white-space: nowrap; }
.t th a { color: inherit; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--hover); }
.t tr.dim td { color: var(--ink-3); }
.t tr.dim td a { color: var(--ink-2); }
.t .num { text-align: right; }
.t td.nowrap { white-space: nowrap; }
.rowlink { font-weight: 600; color: var(--ink); }
.unitno { font: 700 22px/1 var(--cond); color: var(--ink); }

/* ---------- tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 5px; font: 600 14px/1.35 var(--cond); letter-spacing: .01em; white-space: nowrap; }
.pill.gray { background: #EDF0F4; color: var(--ink-2); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill.orange { background: var(--orange-bg); color: var(--orange); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.purple { background: var(--purple-bg); color: var(--purple); }
.pill.blue { background: #E3EBFB; color: var(--blue); }
.pill.dns { background: var(--red); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #E3E8F0; color: var(--ink-2); display: grid; place-items: center; font-weight: 600; font-size: 13.5px; flex: none; }

/* ---------- forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=search], input[type=password], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid #CBD3DE; border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 70%, transparent); outline-offset: 0; border-color: var(--navy); }
input[type=file] { font: inherit; }
.f { margin-bottom: 14px; }
.f .hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.frow { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); font-size: 15px; margin: 5px 0; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .f { margin: 0; }
.section-label { font: 600 18px var(--cond); color: var(--ink); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius, 4px); border: 1px solid #CBD3DE; background: #fff; color: var(--ink); font: 600 16px/1.2 var(--cond); letter-spacing: .01em; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(.95); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.small { padding: 4px 11px; font-size: 15px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--red); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
form.inline { display: inline; }

/* ---------- messages ---------- */
.flash { padding: 11px 16px; border-radius: 9px; margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--green-bg); border-color: #B5E0C5; color: #145532; }
.flash.error { background: var(--red-bg); border-color: #F2BDB9; color: #7A1A12; }
.flash.info { background: #E6EEFC; border-color: #C3D4F5; color: #1C3F8F; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.banner.red { background: var(--red-bg); border-color: #F2BDB9; color: #7A1A12; }
.banner.yellow { background: #FFF6DA; border-color: #F3D98A; color: #5D4800; }
.banner.blue { background: #E6EEFC; border-color: #C3D4F5; color: #1C3F8F; }

/* ---------- filters bar ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { width: 240px; }
.filters select { width: auto; }
.seg { display: inline-flex; border: 1px solid #CBD3DE; border-radius: var(--radius, 4px); overflow: hidden; background: #fff; }
.seg a { padding: 7px 14px; color: var(--ink-2); font: 600 15px var(--cond); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--navy); color: #fff; }
.seg a:hover { text-decoration: none; }
.seg a:not(.on):hover { background: var(--hover); }

/* ---------- record pages ---------- */
.rec-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.rec-head .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); margin-top: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; position: sticky; top: 68px; background: var(--steel); z-index: 10; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font: 600 17px var(--cond); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a .n { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
section.sec { scroll-margin-top: 130px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.contact { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.contact:last-child { border-bottom: 0; }
.contact .who { font-weight: 600; color: var(--ink); }
.contact .lines { color: var(--ink-2); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.person { display: flex; gap: 12px; align-items: center; }
.note { padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.note:last-child { border-bottom: 0; }
.note .by { font-size: 13px; color: var(--ink-3); }
.note p { margin: 2px 0 0; white-space: pre-wrap; }
.flaglist { display: flex; gap: 6px; flex-wrap: wrap; }
details.add { margin-top: 10px; }
details.add > summary { cursor: pointer; color: var(--blue); font-weight: 600; list-style: none; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 12px; }
details.edit > summary { list-style: none; cursor: pointer; }
details.edit > summary::-webkit-details-marker { display: none; }
.empty { color: var(--ink-3); padding: 12px 0; }
.empty-big { text-align: center; padding: 44px 20px; color: var(--ink-2); }

/* ---------- live lookups ---------- */
.lookup { border: 1px solid var(--line); border-radius: 9px; margin-top: 8px; display: none; background: #fff; overflow: hidden; }
.lookup.open { display: block; }
.lookup .item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line-2); grid-template-columns: none; }
.lookup .item:last-child { border-bottom: 0; }
.lookup .item .s { font-size: 13px; color: var(--ink-3); }

/* ---------- settings ---------- */
.settings-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: start; }
.subnav { position: sticky; top: 80px; }
.subnav a { display: block; padding: 8px 12px; border-radius: var(--radius, 4px); color: var(--ink-2); font-weight: 500; }
.subnav a.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.subnav a:hover { text-decoration: none; background: var(--panel); }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; min-width: 260px; }

/* ---------- import ---------- */
.map-row { display: grid; grid-template-columns: 1fr 1.2fr 290px; gap: 14px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--line-2); }
.map-row.head { font: 600 15px var(--cond); color: var(--ink-2); background: #F7F9FB; border-bottom: 1px solid var(--line); }
.map-row .col { font-weight: 600; }
.map-row .samples { color: var(--ink-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row select.set { border-color: var(--green); background: #F5FCF7; }
.steps { display: flex; gap: 0; margin-bottom: 18px; }
.steps span { font: 600 16px var(--cond); color: var(--ink-3); padding: 6px 16px 6px 0; }
.steps span.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); }
.steps span.sep { display: none; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; }

@media (max-width: 1000px) {
  .grid2, .grid3, .grid-side, .stats, .settings-wrap { grid-template-columns: 1fr; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .top { flex-wrap: wrap; gap: 8px; }
  .top .gsearch { flex-basis: 100%; min-width: 0; max-width: none; }
  .top .spacer { display: none; }
}
@media print {
  .side, .top, .actions, .tabs, details.add { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  /* no page fade for anyone who's asked for less motion */
  .content, .drawer, .drawer-scrim { animation: none !important; transition: none !important; }
}

/* ================================================================ phase 2 */
.whoami { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--radius, 4px); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.whoami svg { width: 18px; height: 18px; }
.whoami:hover { background: var(--line-2); text-decoration: none; }
.whoami.unset { background: #FFF6DA; color: #5D4800; border: 1px solid #F3D98A; }

/* stage tags */
.stage { display: inline-flex; padding: 2px 9px; border-radius: 5px; font: 600 14px/1.35 var(--cond); white-space: nowrap; }
.stage.quote { background: #EDF0F4; color: var(--ink-2); }
.stage.tentative { background: #FFF1CF; color: var(--yellow); }
.stage.scheduled { background: #E3EBFB; color: var(--blue); }
.stage.dispatched { background: var(--navy); color: #fff; }
.stage.completed { background: var(--green-bg); color: var(--green); }
.stage.billed { background: #E6F0EA; color: #4B6B57; }
.stage.lost, .stage.cancelled { background: #EDF0F4; color: var(--ink-3); text-decoration: line-through; }
.badge-pw { background: #EBE3FB; color: #5B33B5; }
.badge-cod { background: #FCE4E2; color: var(--red); }
.badge-fill { background: #E1F3F4; color: #11666E; }

/* ---------- warnings ---------- */
.warn { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-2); transition: opacity .15s; }   /* OK, intentional / Undo fade it in place (app.js) */
.warn:last-child { border-bottom: 0; }
.warn .edge { align-self: stretch; border-radius: 0 4px 4px 0; }
.warn b { display: block; font-weight: 600; }
.warn small { color: var(--ink-2); font-size: 14px; }
.warn.ok { opacity: .55; }
.warn.ok b { text-decoration: line-through; }
.warn-list.compact .warn { padding: 7px 12px 7px 0; }

/* ---------- week board ---------- */
.board-tools .seg a { padding: 6px 11px; }
.board-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.board-tools .range { font: 600 22px var(--cond); margin: 0 6px; }
.attnbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.attnbar > summary { list-style: none; cursor: pointer; padding: 11px 16px; display: flex; gap: 12px; align-items: center; font-weight: 600; }
.attnbar > summary::-webkit-details-marker { display: none; }
.attnbar > summary .count { font: 700 15px var(--cond); background: var(--brand); color: var(--brand-ink); border-radius: 6px; padding: 1px 9px; }
.attnbar > summary .chips { display: flex; gap: 6px; flex-wrap: wrap; font-weight: 500; }
.attnbar[open] > summary { border-bottom: 1px solid var(--line-2); }
.attnbar .warn-list { max-height: 340px; overflow-y: auto; }
.attnbar.clear > summary::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }

.board-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 205px); min-height: 360px; }
/* Slim, rounded rails on both boards; retain native controls in high-contrast mode. */
@media screen and (forced-colors: none) {
  :is(.board-wrap, .dayboard-wrap) {
    --board-scroll-track: #e4e9f0;
    --board-scroll-thumb: #728199;
    --board-scroll-hover: #52647e;
    scrollbar-width: thin;
    scrollbar-color: var(--board-scroll-thumb) var(--board-scroll-track);
  }
  html[data-theme="dark"] :is(.board-wrap, .dayboard-wrap) {
    --board-scroll-track: #222222;
    --board-scroll-thumb: #737373;
    --board-scroll-hover: #a3a3a3;
  }
  @supports selector(::-webkit-scrollbar) {
    /* Standard non-auto values override the detailed scrollbar styling in Chromium. */
    :is(.board-wrap, .dayboard-wrap) { scrollbar-width: auto; scrollbar-color: auto; }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar { width: 10px; height: 10px; }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar-track { background: var(--board-scroll-track); border-radius: 999px; }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar-thumb {
      background-color: var(--board-scroll-thumb); background-clip: padding-box;
      border: 2px solid transparent; border-radius: 999px; min-height: 36px; min-width: 36px;
    }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar-thumb:hover { background-color: var(--board-scroll-hover); }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
    :is(.board-wrap, .dayboard-wrap)::-webkit-scrollbar-corner { background: var(--board-scroll-track); }
  }
}
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1100px; table-layout: fixed; }
.board th, .board td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); vertical-align: top; }
.board thead th { position: sticky; top: 0; z-index: 4; background: #F7F9FB; padding: 8px 8px 7px; text-align: left; border-bottom: 1px solid var(--line); }
.board thead th.today { background: #FFF6DA; box-shadow: inset 0 -3px 0 var(--brand); }
.board thead th.weekend { background: #F1F3F6; }
.board thead .dname { font: 600 17px var(--cond); color: var(--ink); }
.board thead .dmeta { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; }
.board thead .dmeta .w { color: var(--red); font-weight: 600; }
.board thead .hol { display: block; margin-top: 3px; font: 600 13px var(--cond); color: #8A5A00; background: #FFF1CF; border-radius: 4px; padding: 0 6px; }
.board th.unitcol { position: sticky; left: 0; z-index: 5; width: 118px; background: #F7F9FB; }
.board tbody th.unitcol { z-index: 3; background: #fff; padding: 8px 10px; text-align: left; border-right: 1px solid var(--line); }
.board tbody th.unitcol a { color: var(--ink); }
.board tbody th.unitcol .no { font: 700 22px/1 var(--cond); display: block; }
.board tbody th.unitcol .sz { font-size: 12.5px; color: var(--ink-3); }
.board tbody th.unitcol .nm { font: 600 16px/1.15 var(--cond); display: block; }
.board tr.grp th { position: sticky; left: 0; z-index: 3; background: var(--navy); color: #fff; font: 600 15px var(--cond); padding: 5px 10px; text-align: left; letter-spacing: .02em; }
.board tr.grp td { background: var(--navy); }
.board td.cell { padding: 4px; height: 44px; background: #fff; }
.board td.cell.weekend { background: #FAFBFC; }
.board td.cell.today { background: #FFFCF0; }
.board td.cell.down { background: repeating-linear-gradient(135deg, #FCECEB 0 8px, #fff 8px 16px); }
.board td.cell.dragover { outline: 3px dashed var(--brand); outline-offset: -3px; background: #FFF8E1; }
.board td.cell .downlbl { font: 600 13px var(--cond); color: var(--red); display: block; margin-bottom: 3px; }
.board td.cell .add { display: block; min-height: 26px; color: transparent; border-radius: var(--radius, 4px); text-align: center; font: 600 18px/26px var(--cond); }
.board td.cell .chip + .add { min-height: 18px; line-height: 18px; }
.board td.cell:hover .add { color: var(--ink-3); background: var(--hover); text-decoration: none; }

.chip { display: block; position: relative; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 4px 7px 5px; margin-bottom: 4px; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.3; cursor: grab; }
.chip:hover { text-decoration: none; border-color: #B8C3D2; box-shadow: 0 2px 8px rgba(21,35,59,.12); }
.chip.dragging { opacity: .45; }
.chip .tl { font: 700 14.5px/1.2 var(--cond); display: flex; gap: 6px; align-items: baseline; }
.chip .tl .u { color: var(--ink); }
.chip .tl .tm { color: var(--ink-2); font-weight: 600; }
.chip .cu { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .ct { color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .tags { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.chip .tags span { font: 600 11.5px/1.3 var(--cond); padding: 0 5px; border-radius: 3px; background: #EDF0F4; color: var(--ink-2); }
.chip .tags .pw { background: #EBE3FB; color: #5B33B5; }
.chip .tags .cod { background: #FCE4E2; color: var(--red); }
.chip .tags .re { background: var(--red); color: #fff; }
.chip.st-tentative { border-left-color: #E9B10E; border-style: dashed solid dashed solid; border-left-style: solid; }
.chip.st-quote { border-left-color: #B3BCC9; }
.chip.st-dispatched { border-left-color: var(--navy); }
.chip.st-completed, .chip.st-billed { border-left-color: var(--green); opacity: .8; }
.chip.warn-red { box-shadow: 0 0 0 2px var(--red); border-color: var(--red); }
.chip.warn-orange { box-shadow: 0 0 0 2px #E8771E; border-color: #E8771E; }
.chip .wdot { position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.chip.warn-orange .wdot { background: #E8771E; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border-left: 4px solid; margin-right: 5px; vertical-align: -1px; background: #fff; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 9px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; }
.toast.err { background: var(--red); }

/* ---------- job page ---------- */
.job-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ticket { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; scroll-margin-top: 90px; }
.ticket.cancelled { opacity: .6; }
.ticket .th { display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: #FBFCFD; flex-wrap: wrap; }
.ticket .th .unit { font: 700 26px/1 var(--cond); min-width: 48px; }
.ticket .th .no { font: 600 16px var(--cond); color: var(--ink-2); }
.ticket .th .when { font-weight: 600; }
.ticket .tb { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; padding: 12px 16px; }
.ticket .tb h3 { margin-bottom: 4px; font-size: 15px; }
.ticket ul { list-style: none; margin: 0; padding: 0; }
.ticket li { padding: 3px 0; }
.ticket li .sent { color: var(--ink-3); font-size: 13px; }
.ticket .tw { border-top: 1px solid var(--line-2); }
.date-head { font: 600 19px var(--cond); margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.date-head .muted { font: 500 14px var(--font); }
.lockbar { display: flex; gap: 12px; align-items: center; background: #E6EEFC; border: 1px solid #C3D4F5; color: #1C3F8F; border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; font-weight: 500; }
.lockbar.mine { background: #FFF6DA; border-color: #F3D98A; color: #5D4800; }

/* ---------- forms with rows ---------- */
.rows { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rows .r { display: grid; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.rows .r:last-child { border-bottom: 0; }
.rows .r.hd { background: #F7F9FB; font: 600 14px var(--cond); color: var(--ink-2); padding-top: 6px; padding-bottom: 6px; }
.rows.lines .r { grid-template-columns: 210px minmax(0, 1fr) 170px 80px 34px; }
.rows.crew .r { grid-template-columns: minmax(0, 1fr) 140px 100px 150px 120px minmax(0, 1fr) 34px; }
.rows .x { border: 0; background: none; color: var(--ink-3); font-size: 20px; cursor: pointer; border-radius: var(--radius, 4px); height: 32px; }
.rows .x:hover { background: var(--red-bg); color: var(--red); }
.seg-radio { display: inline-flex; border: 1px solid #CBD3DE; border-radius: var(--radius, 4px); overflow: hidden; background: #fff; }
.seg-radio label { margin: 0; padding: 7px 11px; white-space: nowrap; font: 600 15px var(--cond); color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line); display: flex; align-items: center; }
.seg-radio label:last-child { border-right: 0; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio label:has(input:checked) { background: var(--navy); color: #fff; }
.seg-radio label:has(input:focus-visible) { outline: 3px solid var(--brand); }
.hide { display: none !important; }

/* ---------- new job ---------- */
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.step > h2 { display: flex; gap: 10px; align-items: center; }
.step > h2 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 15px var(--cond); }
.step.done > h2 .n { background: var(--green); }
.step.locked { opacity: .5; pointer-events: none; }
.finder { position: relative; }
.finder input { font-size: 17px; padding: 11px 14px; }
.results { border: 1px solid var(--line); border-radius: 9px; margin-top: 8px; overflow: hidden; }
.results .grp { font: 600 14px var(--cond); color: var(--ink-3); padding: 8px 14px 3px; background: #FBFCFD; }
.results .opt { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.results .opt:hover, .results .opt.sel { background: var(--hover); box-shadow: inset 3px 0 0 var(--brand); }
.results .opt b { display: block; }
.results .opt small { color: var(--ink-2); }
.results .opt.dns { cursor: not-allowed; opacity: .7; }
.picked { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #F5F8FB; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.picked b { font-size: 17px; }

/* ---------- day sheet ---------- */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; max-width: 900px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.sheet-head h1 { font-size: 30px; }
.sjob { display: grid; grid-template-columns: 74px 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding: 12px 0; break-inside: avoid; }
.sjob .u { font: 700 30px/1 var(--cond); }
.sjob .u small { display: block; font: 500 13px var(--font); color: var(--ink-3); margin-top: 3px; }
.sjob .g { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6px 18px; }
.sjob .k { color: var(--ink-3); font-size: 12.5px; }
.sjob .writein { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.sjob .writein span { border-bottom: 1px solid #B8C3D2; padding-top: 16px; }
@media print {
  .sheet { border: 0; padding: 0; max-width: none; }
  .no-print { display: none !important; }
  .content { padding: 0; }
  body { font-size: 12px; }
}

/* ---------- Today page: sections that open and close ---------- */
.sec-tools { display: flex; gap: 4px; }
.today-page { display: flex; flex-direction: column; gap: 12px; }
.sec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 18px; min-height: 56px; flex-wrap: wrap; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: var(--hover); }
.sec > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.sec > summary h2 { margin: 0; font-size: 22px; }
.sec > summary .h-date { color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.sec[open] > summary { border-bottom: 1px solid var(--line); }
.sec .chev { width: 22px; height: 22px; border-radius: var(--radius, 4px); background: var(--steel); position: relative; flex: none; }
.sec .chev::after { content: ""; position: absolute; left: 8px; top: 6px; width: 6px; height: 6px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; }
.sec[open] .chev::after { transform: rotate(45deg); left: 7px; top: 5px; }
.sec .count { font: 700 15px var(--cond); background: var(--brand); color: var(--brand-ink); border-radius: 6px; padding: 1px 9px; }
.sec .count.dark { background: var(--navy); color: #fff; }
.sec .peek { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 15px; margin-left: 6px; }
.sec .sec-link { margin-left: auto; font: 600 15px var(--cond); }
.sec .ok-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); margin-right: 6px; }
.sec-body { padding: 6px 18px 14px; }
.sec-body.flush { padding: 0; }
.sec-empty { padding: 18px; color: var(--ink-3); }
.sec-more { display: inline-block; margin-top: 8px; font-weight: 600; }
.sub-h { font: 600 14px var(--cond); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: #F7F9FB; padding: 7px 18px; border-bottom: 1px solid var(--line-2); display: flex; gap: 8px; }
.sub-h span { color: var(--ink-2); }
.sec .item { padding-left: 0; padding-right: 18px; }
.sec-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.sec-row .sec > summary h2 { font-size: 20px; }
.pill.pw { background: #EBE3FB; color: #5B33B5; }

/* job rows (today and next workday) */
.jrow { display: grid; grid-template-columns: 118px 64px minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink); border-left: 4px solid transparent; }
.jrow:last-child { border-bottom: 0; }
.jrow:hover { background: var(--hover); text-decoration: none; }
.jrow.warn-red { border-left-color: var(--red); }
.jrow.warn-orange { border-left-color: #E8771E; }
.jtime b { display: block; font: 700 24px/1 var(--cond); }
.jtime b.tbd { font-size: 18px; color: var(--yellow); }
.jtime small { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.jplate { display: block; background: var(--navy); color: #fff; border-radius: 7px; padding: 5px 0 6px; text-align: center; border-top: 3px solid var(--brand); }
.jplate b { display: block; font: 700 22px/1 var(--cond); }
.jplate i { font-style: normal; font-size: 11.5px; color: #B9C6D8; white-space: nowrap; }
.jplate.need { background: #E3EBFB; color: var(--blue); border-top-color: var(--blue); }
.jplate.need i { color: var(--blue); }
.jplate.out { background: #EDF0F4; color: var(--ink-2); border-top-color: #8592A5; }
.jplate.out i { color: var(--ink-3); }
.jmain b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jmain b em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.jmain small { display: block; color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcrew { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14.5px; font-weight: 500; }
.jcrew i { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 13px; }
.jcrew .none { color: var(--orange); }
.jtags { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; max-width: 300px; }

/* crew hours */
.hday { font: 600 17px var(--cond); margin: 12px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.hday b { font-weight: 700; }
.hday span { margin-left: auto; color: var(--orange); font-size: 15px; }
.hcard { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #FBFCFD; }
.hhead { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.hwho b { display: block; }
.hwho small { color: var(--ink-2); font-size: 13.5px; }
.htable { width: 100%; border-collapse: collapse; }
.htable th { text-align: left; font: 600 13px var(--cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 7px 12px 2px; }
.htable td { padding: 5px 12px; border-top: 1px solid var(--line-2); }
.htable tbody tr:first-child td { border-top: 0; }
.htable td small { color: var(--ink-3); }
.htable .c { text-align: center; width: 100px; }
.htable input[type=text] { width: 96px; padding: 6px 9px; }
.htable input.bad { border-color: var(--red); background: var(--red-bg); }
.htable input:disabled { opacity: .45; }
.htable .tot { font-weight: 600; white-space: nowrap; width: 240px; }
.htable tr.done td:first-child b { color: var(--ink-2); }
.htable input[type=checkbox] { width: 18px; height: 18px; }
.hfoot { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-2); }

/* fleet plates on a light card */
.plates.light .plate { background: #F2F5F9; color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--green); }
.plates.light .plate:hover { background: #E9EEF4; }
.plates.light .plate i { color: var(--ink-2); }
.plates.light .plate em { display: block; font: 600 12.5px var(--cond); font-style: normal; color: var(--blue); }
.plates.light .plate.busy { border-top-color: var(--navy); }
.plates.light .plate.support { border-top-color: #8592A5; }
.plates.light .plate.down { background: var(--red-bg); border-top-color: var(--red); }
.plates.light .plate.down i { color: var(--red); }
.plates.light { gap: 8px; padding-top: 8px; }
.plates.light .plate { min-width: 84px; }
.plate-key { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.plate-key i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: 3px; }
.k-green { background: var(--green); } .k-navy { background: var(--navy); } .k-red { background: var(--red); }

@media (max-width: 1250px) {
  .sec-row { grid-template-columns: 1fr; }
  .jrow { grid-template-columns: 104px 60px minmax(0, 1fr) auto; }
  .jcrew { grid-column: 3 / 5; }
}
.subsec > summary.sub-h { cursor: pointer; list-style: none; align-items: center; }
.subsec > summary.sub-h::-webkit-details-marker { display: none; }
.subsec > summary.sub-h:hover { background: #EEF2F6; }
.subsec .chev { width: 16px; height: 16px; border-radius: 4px; background: transparent; }
.subsec .chev::after { left: 4px; top: 3px; width: 5px; height: 5px; border-width: 0 2px 2px 0; border-style: solid; border-color: var(--ink-3); content: ""; position: absolute; transform: rotate(-45deg); transition: transform .15s; }
.subsec[open] .chev::after { transform: rotate(45deg); left: 4px; top: 2px; }
/* while a section slides shut (app.js), its arrow and divider already show it shut */
.sec[data-closing="1"] .chev::after { transform: rotate(-45deg); left: 8px; top: 6px; }
.subsec[data-closing="1"] .chev::after { transform: rotate(-45deg); left: 4px; top: 3px; }
.sec[data-closing="1"] > summary { border-bottom-color: transparent; }
.htable input::placeholder { color: #B8C1CE; font-style: italic; }

/* ---------- week board v2: shaded lanes, visible grid, readable job blocks ---------- */
.board-wrap { background: #E4E9F0; border-color: #C5CEDA; }
.board th, .board td { border-right: 1px solid #C9D2DE; border-bottom: 1px solid #C9D2DE; }
.board thead th { background: #F3F5F8; border-bottom: 2px solid #AEB9C8; }
.board thead th.today { background: #FFEDB8; box-shadow: inset 0 -4px 0 var(--brand); }
.board thead th.weekend { background: #E9EDF2; }
.board td.cell { background: #F4F6F9; padding: 5px; height: 52px; }
.board td.cell { position: relative; }
.board td.cell > :is(.chip, .downlbl, .add) { position: relative; z-index: 1; }
.board-down-fade { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.board tr.lane.alt td.cell { background: #EBEFF4; }
.board tr.lane td.cell.weekend { background: #E1E6ED; }
.board tr.lane td.cell.today { background: #FFF6D6; border-left: 2px solid var(--brand); border-right: 2px solid var(--brand); }
.board tr.lane td.cell.down { background: repeating-linear-gradient(135deg, #F8DCDA 0 8px, #F4F6F9 8px 16px); }
/* step 6a: a unit out on a bare rental, striped like a down unit but blue (it's booked, not broken) */
.board tr.lane td.cell.rented { background: repeating-linear-gradient(135deg, #E3EBFB 0 8px, #F4F6F9 8px 16px); }
.board td.cell .rentlbl { color: var(--blue); }
.board tbody th.unitcol { background: #fff; border-right: 2px solid #AEB9C8; }
.board tr.lane.alt th.unitcol { background: #F8F9FB; }
.board tbody th.unitcol .no { font-size: 26px; }
.board tr.lane td.cell .add { min-height: 30px; line-height: 30px; }
.board tr.lane td.cell:hover .add { color: var(--ink-2); background: rgba(255,255,255,.7); }

.chip { --chip-pad-x: 8px; --chip-pad-top: 6px; --chip-pad-bottom: 7px;
  background: #fff; border: 1px solid #C3CCD8; border-left-width: 5px; border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(21,35,59,.10); padding: var(--chip-pad-top) var(--chip-pad-x) var(--chip-pad-bottom); margin-bottom: 5px; }
.chip.warn-red, .chip.warn-orange { box-shadow: 0 1px 2px rgba(21,35,59,.10); border-color: #C3CCD8; }
.chip.st-tentative { border-style: dashed; border-left-style: solid; border-color: #C9A43A; border-left-color: #E9B10E; background: #FFFCF2; }
.chip.st-quote { border-left-color: #B3BCC9; background: #FAFBFC; }
.chip.st-scheduled { border-left-color: var(--blue); }
.chip.st-dispatched { border-left-color: var(--navy); }
.chip .tl { display: flex; flex-wrap: wrap; font: 700 15px/1.2 var(--cond); gap: 4px 6px;
  align-items: center; min-width: 0; font-variant-numeric: tabular-nums; }
.chip .tl .u { background: var(--navy); color: #fff; border-radius: 4px; padding: 1px 4px; font-size: 14px; line-height: 1.2;
  flex: 0 1 auto; min-width: 0; max-width: 100%; min-height: 18px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .time-window { display: flex; flex: 1 0 auto; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.chip.st-tentative .tl .u, .chip.st-quote .tl .u { background: #5C6F8C; }
.chip .tl .tm { flex: 1; color: var(--ink); font-weight: 700; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip .tl .tm .dash { color: var(--ink-3); margin: 0 1px; }
.chip.notime .tl .tm { color: var(--yellow); }
.chip .tl .dur { flex: none; margin-left: auto; color: var(--ink-2); font-weight: 600; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.chip .bar { display: block; position: relative; height: 4px; margin: 5px 0 6px; border-radius: 3px; background: #E3E8EF;
  background-image: linear-gradient(to right, transparent calc(50% - 1px), #C3CCD8 calc(50% - 1px), #C3CCD8 calc(50% + 1px), transparent calc(50% + 1px)); }
.chip .bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--blue); }
.chip.st-dispatched .bar i { background: var(--navy); }
.chip.st-completed .bar i, .chip.st-billed .bar i { background: var(--green); }
.chip.st-tentative .bar i { background: #E9B10E; }
.chip .bar i.early { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.chip .bar i.late { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip .bar.none { background: repeating-linear-gradient(90deg, #E3E8EF 0 6px, transparent 6px 10px); }
.chip .cu { font-size: 13.5px; line-height: 1.25; }
.chip .ct { margin-top: 2px; font-size: 12px; line-height: 1.3; }
.chip .ct:empty { display: none; }
.chip .tags { gap: 4px; margin-top: 5px; align-items: center; flex-wrap: nowrap; min-height: 17px; }
.chip .tags span { display: inline-flex; flex: none; align-items: center; min-height: 17px; max-width: 100%; padding: 1px 4px; font-size: 11.5px; line-height: 1.2; }
.chip .tags .crew { display: block; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Unusual combinations of three or more flags still have room to show every flag. */
.chip .tags:has(> :nth-child(4)) { flex-wrap: wrap; }
/* The warning strip uses the same insets as its card, including compact and TV sizes. */
.chip .wtag { --warning-height: 22px; --warning-pad-y: 3px;
  display: flex; gap: 5px; align-items: center; min-height: var(--warning-height);
  margin: 6px calc(-1 * var(--chip-pad-x)) calc(-1 * var(--chip-pad-bottom)); padding: var(--warning-pad-y) var(--chip-pad-x);
  font: 600 12px/1.2 var(--cond); border-radius: 0 0 calc(var(--radius) - 1px) 0; }
.chip .wtag .wicon { flex: none; width: 12px; height: 12px; }
.chip .wtag .wtext { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .wtag.red { background: var(--red); color: #fff; }
.chip .wtag.orange { background: #FDE6D3; color: var(--orange); }
.chip .wtag.gray, .chip .wtag.blue { background: #EDF0F4; color: var(--ink-2); }
.chip .wtag[class*="tone-"] { background: var(--warning-bg, #566578); color: var(--warning-ink, #fff); }
.chip .wtag.tone-cert, .chip .wtag.tone-red { --warning-bg: #b83e4c; }
.chip .wtag.tone-signoff { --warning-bg: #efc54a; --warning-ink: #342709; }
.chip .wtag.tone-training { --warning-bg: #dcaa45; --warning-ink: #32230a; }
.chip .wtag.tone-off { --warning-bg: #7055a3; }
.chip .wtag.tone-inactive { --warning-bg: #596372; }
.chip .wtag.tone-down { --warning-bg: #9d4f39; }
.chip .wtag.tone-rented { --warning-bg: #26747b; }
.chip .wtag.tone-overlap { --warning-bg: #9f3f68; }
.chip .wtag.tone-tight { --warning-bg: #a9541b; }
.chip .wtag.tone-short { --warning-bg: #94601b; }
.chip .wtag.tone-nounit, .chip .wtag.tone-blue { --warning-bg: #38689c; }
.chip .wtag.tone-notime { --warning-bg: #566578; }
.chip .wtag.tone-doc { --warning-bg: #866542; }
.chip .wtag.tone-holiday { --warning-bg: #706c2e; }
.chip .wtag.tone-dns { --warning-bg: #7a2833; }
.chip .wtag.tone-orange { --warning-bg: #f3d6b5; --warning-ink: #623b16; }
.chip .wtag.tone-gray { --warning-bg: #d7dbe0; --warning-ink: #354151; }
.chip.st-completed:has(> .wtag), .chip.st-billed:has(> .wtag) { opacity: 1; }
.chip .wtag b { flex: none; margin-left: auto; padding-left: 6px; border-left: 1px solid color-mix(in srgb, currentColor 30%, transparent); font-weight: 700; }
.chip .wdot { display: none; }
.legend .bar-key { display: inline-flex; align-items: center; gap: 6px; }
.legend .bar-key .bar { display: inline-block; position: relative; width: 56px; height: 6px; border-radius: 3px; background: #E3E8EF; }
.legend .bar-key .bar i { position: absolute; top: 0; bottom: 0; border: 0; margin: 0; width: auto; height: auto; border-radius: 3px; background: var(--blue); }
table.board.two-weeks { min-width: 1880px; }
.chip .wtag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- prevailing wage numbers ---------- */
.pwbox { margin: 10px 0 16px; padding: 12px 14px 4px; border: 1px solid #D9CCF5; border-left: 4px solid #5B33B5; border-radius: var(--radius); background: #F8F5FE; }
.pwbox .pw-ask { color: #3E2384; margin-bottom: 10px; font-size: 15px; }
.warn-txt { color: var(--orange); font-weight: 600; }
.pwnums { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; font-size: 15px; }
.pwnums b { font: 600 13px var(--cond); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-right: 6px; }
.pwnums .missing { color: var(--red); font-weight: 600; }
.t td.miss { color: var(--red); font-weight: 600; }
.banner.pwbar { background: #F8F5FE; border-color: #D9CCF5; color: var(--ink); border-left: 4px solid #5B33B5; }
.banner.pwbar.yellow { background: #FFF6DA; border-color: #F3D98A; border-left-color: #E9B10E; }
.banner.pwbar.red { background: var(--red-bg); border-color: #F2BDB9; border-left-color: var(--red); }

/* ================================================================ phase 3: next workday */
.page-head h1 .h-date { color: var(--ink-3); font-weight: 500; }
.banner.green { background: var(--green-bg); border-color: #B5E0C5; color: #145532; }
.run-steps .stat { border-top: 4px solid var(--line); }
.run-steps .stat b small { font: 600 18px var(--cond); color: var(--ink-3); }
.run-steps .stat.bad { border-top-color: var(--red); }
.run-steps .stat.bad b { color: var(--red); }
.run-steps .stat.good { border-top-color: var(--green); }
.print-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #F7F9FB; }
.print-bar .muted { font-size: 14px; }
.nrow .jmain b a { color: var(--ink); }
.nrow .jtags { align-items: center; }
.checklist { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checklist .check { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.checklist .check:last-child { border-bottom: 0; }
.checklist .check:hover { background: var(--hover); }
.unitno-s { font: 700 18px/1 var(--cond); min-width: 44px; }
.ctext { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) 190px; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.ctext:has(+ :not(.ctext)), .ctext:last-child { border-bottom: 0; }
.ctext .who { font-weight: 600; color: var(--ink); }
.ctext .lines { color: var(--ink-2); font-size: 14px; display: flex; gap: 4px 12px; flex-wrap: wrap; }
.ctext textarea { min-height: 0; resize: none; font-size: 14.5px; line-height: 1.45; background: #FBFCFD; }
.ctext.changed textarea { border-color: var(--red); }
.ctext-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ctext-side small { font-size: 13px; }
.ctext-btns { display: flex; gap: 6px; margin-top: 4px; }
.cside { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.ctext + .cside { margin-top: 0; }
.sec-note { color: var(--ink-3); margin: 8px 0 6px; }
.confirm-foot { display: flex; gap: 6px; align-items: center; padding-top: 10px; }
.in-hand { color: var(--ink-3); margin-top: 12px; }
.sec-empty.inset { padding: 8px 0; }
@media (max-width: 1000px) {
  .ctext { grid-template-columns: 1fr; }
  .run-steps { grid-template-columns: 1fr 1fr; }
}
.banner.ahead { flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.banner.ahead > span:first-child { margin-right: 6px; }
.tools-label { font: 600 16px var(--cond); color: var(--ink-2); margin-right: 2px; }
.hday.inset { margin: 0; padding: 10px 18px 8px; background: #F7F9FB; border-bottom: 1px solid var(--line-2); border-top: 1px solid var(--line); }
.sec-body.flush > .hday.inset:first-child { border-top: 0; }
.hday .pill { margin-left: 4px; }
.day-tag { font: 600 14px var(--cond); color: var(--ink-3); min-width: 34px; }
.cside-line { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 14px; color: var(--ink-2); padding: 10px 0 14px; border-top: 1px solid var(--line); margin-bottom: 4px; }
.cside-line b { font-weight: 600; color: var(--ink); }
.hday.inset > span:last-child, .sec-body > .hday > span:last-child { color: var(--ink-3); }

/* ================================================================ step 3e: boards grouped by size, Day view */
/* foldable groups (week board and Day view) */
.grp-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--cond); color: #fff; letter-spacing: .02em; }
.grp-toggle i { font-style: normal; font-weight: 500; color: #9FB0C8; font-size: 13.5px; }
.grp-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.grp-toggle .caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #9FB0C8; }
.folded .grp-toggle .caret { transform: rotate(-90deg); }
/* compact rows on the week board: one line per job */
.board-wrap.compact .board td.cell { height: 34px; padding: 3px; }
.board-wrap.compact .chip { --chip-pad-x: 6px; --chip-pad-top: 3px; --chip-pad-bottom: 4px; margin-bottom: 3px; }
.board-wrap.compact .chip .bar, .board-wrap.compact .chip .ct, .board-wrap.compact .chip .tags { display: none; }
.board-wrap.compact .chip .tl { font-size: 14px; gap: 4px; }
.board-wrap.compact .chip .tl .u { font-size: 12.5px; min-height: 17px; }
.board-wrap.compact .chip .tl .dur { font-size: 11.5px; }
.board-wrap.compact .chip .cu { font-size: 12.5px; margin-top: 3px; }
.board-wrap.compact .chip .wtag { --warning-height: 20px; --warning-pad-y: 2px; margin-top: 4px; font-size: 11.5px; }
.board-wrap.compact .board tbody th.unitcol { padding: 4px 10px; }
.board-wrap.compact .board tbody th.unitcol .no { font-size: 20px; }

/* Day view */
.board-tools h1 .h-date { color: var(--ink-3); font-weight: 500; }
.day-sum { color: var(--ink-2); margin: -4px 0 12px; }
.dayboard-wrap { --ucol: 104px; --rowh: 54px; background: var(--panel); border: 1px solid #C5CEDA; border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); min-height: 360px; position: relative; }
.dayboard-wrap.compact { --rowh: 36px; }
.dhead { position: sticky; top: 0; z-index: 8; display: grid; grid-template-columns: var(--ucol) 1fr; background: #F3F5F8; border-bottom: 2px solid #AEB9C8; height: 34px; min-width: 900px; }
.dhead .ucol { position: sticky; left: 0; background: #F3F5F8; border-right: 2px solid #AEB9C8; }
.dlane-h { position: relative; }
.dlane-h .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #C9D2DE; }
.dlane-h .tick span { position: absolute; left: 4px; top: 7px; font: 600 14px var(--cond); color: var(--ink-2); white-space: nowrap; }
.dlane-h .now-tag { position: absolute; top: 6px; margin-left: 3px; background: var(--red); color: #fff; font: 700 12.5px var(--cond); padding: 1px 6px; border-radius: 4px; z-index: 2; }
.dbody { position: relative; min-width: 900px; }
.dgrid { position: absolute; top: 0; bottom: 0; left: var(--ucol); right: 0; pointer-events: none; z-index: 1; }
.dgrid .vl { position: absolute; top: 0; bottom: 0; border-left: 1px solid #E3E8EF; }
.dgrid .vl.half { border-left-style: dashed; border-left-color: var(--line-2); }
.dgrid .past { position: absolute; top: 0; bottom: 0; left: 0; background: rgba(21, 35, 59, .045); }
.dgrid .now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--red); z-index: 6; }
.dgrp { position: relative; z-index: 7; display: flex; align-items: center; gap: 12px; background: var(--navy); padding: 4px 12px; }
.dgrp .grp-peek { color: #9FB0C8; font-size: 13px; }
.drow { display: grid; grid-template-columns: var(--ucol) 1fr; height: var(--rowh); border-bottom: 1px solid #DDE3EA; }
.drow .ucol { position: sticky; left: 0; z-index: 7; background: var(--panel); border-right: 2px solid #AEB9C8; padding: 5px 10px; }
.drow.alt .ucol { background: #F8F9FB; }
.drow .ucol a { color: var(--ink); text-decoration: none; }
.drow .ucol .no { font: 700 24px/1 var(--cond); display: block; }
.drow .ucol .sz { font-size: 12px; color: var(--ink-3); }
.drow .ucol .nm { font: 600 15px/1.1 var(--cond); color: var(--blue); }
.drow.special { background: #F5F8FE; }
.drow.special .ucol { background: #E3EBFB; }
.drow.special:last-of-type { border-bottom: 2px solid #AEB9C8; }
.dayboard-wrap.compact .drow .ucol { padding: 3px 10px; display: flex; align-items: baseline; gap: 6px; }
.dayboard-wrap.compact .drow .ucol .no { font-size: 19px; display: inline; }
.dlane { position: relative; }
.dlane.drop-on { background: #FFF8E1; box-shadow: inset 0 0 0 2px var(--brand); }
.dbar { position: absolute; top: 5px; bottom: 5px; z-index: 4; display: block; background: var(--panel); color: var(--ink); border: 1px solid #B8C3D2; border-left: 5px solid var(--blue); border-radius: 6px; padding: 3px 7px; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 2px rgba(21, 35, 59, .12); }
.dbar:hover { text-decoration: none; border-color: #8FA0B6; box-shadow: 0 2px 8px rgba(21, 35, 59, .16); z-index: 5; }
.dbar .l1 { display: flex; gap: 5px; align-items: center; font-size: 13.5px; line-height: 1.3; }
.dbar .l1 b { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.dbar .l1-time { display: none; color: var(--ink-2); font-size: 12.5px; }
.dbar .l2 { display: block; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.dbar .tag { font: 600 11.5px/1.3 var(--cond); padding: 0 5px; border-radius: 3px; background: #EDF0F4; color: var(--ink-2); flex: none; }
.dbar .tag.pw { background: #EBE3FB; color: #5B33B5; }
.dbar .tag.cod { background: var(--red-bg); color: var(--red); }
.dbar .tag.fill { background: #E1F3F4; color: #11666E; }
.dbar .tag.re, .dbar .tag.wt.red { background: var(--red); color: #fff; }
.dbar .tag.wt.orange { background: var(--orange-bg); color: var(--orange); }
.dbar.st-dispatched { border-left-color: var(--navy); background: #F4F6FA; }
.dbar.st-tentative, .dbar.st-quote { border-style: dashed; border-left-style: solid; border-color: #C9A43A; border-left-color: #E9B10E; background: #FFFCF2; }
.dbar.st-completed, .dbar.st-billed { border-left-color: var(--green); opacity: .85; }
.dbar.warn-red { box-shadow: 0 0 0 2px var(--red); }
.dbar.warn-orange { box-shadow: 0 0 0 2px #E8771E; }
.dbar.notime { z-index: 3; background: repeating-linear-gradient(135deg, #FFF6DA 0 10px, #FFFCF2 10px 20px); border-style: dashed; border-color: #C9A43A; border-left: 5px solid #E9B10E; }
.dbar.early { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.dbar.late { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dayboard-wrap.compact .dbar { top: 4px; bottom: 4px; padding: 2px 6px; }
.dayboard-wrap.compact .dbar .l2 { display: none; }
.dayboard-wrap.compact .dbar .l1-time { display: inline; }
.dbuf { position: absolute; top: 30%; bottom: 30%; z-index: 2; background: repeating-linear-gradient(135deg, #D5DCE6 0 4px, transparent 4px 8px); border-radius: 0 4px 4px 0; }
.dgap { position: absolute; top: 9px; bottom: 9px; z-index: 2; border: 1.5px dashed #9CCBAE; background: #F1FAF4; border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dgap span { font: 600 13.5px var(--cond); color: var(--green); white-space: nowrap; }
.dgap.tail { justify-content: flex-start; padding-left: 10px; }
.dayboard-wrap.compact .dgap { top: 6px; bottom: 6px; }
.ddown { position: absolute; inset: 5px 0; z-index: 3; background: repeating-linear-gradient(135deg, #F8DCDA 0 8px, #FDF1F0 8px 16px); border: 1px solid #F2BDB9; border-radius: 6px; padding: 6px 10px; color: #7A1A12; font-size: 13.5px; overflow: hidden; white-space: nowrap; }
.dnone { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 13.5px; }
.dadd { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 4; width: 26px; height: 26px; border-radius: var(--radius, 4px); text-align: center; font: 600 18px/26px var(--cond); color: transparent; }
.drow:hover .dadd { color: var(--ink-2); background: rgba(255, 255, 255, .85); border: 1px solid var(--line); }
.dadd:hover { text-decoration: none; }
.can-drag .dbar { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
.dbar.dragging { cursor: grabbing; opacity: .8; z-index: 9; box-shadow: 0 6px 18px rgba(21, 35, 59, .28); }
.dghost { position: fixed; z-index: 60; pointer-events: none; background: var(--navy); color: #fff; font: 700 14px var(--cond); padding: 3px 8px; border-radius: 5px; }
.dpop { position: fixed; z-index: 55; width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(21, 35, 59, .22); padding: 12px 14px; }
.dpop small { display: block; color: var(--ink-3); margin-top: 6px; font-size: 13px; }
.dpop-btns { display: flex; gap: 6px; margin-top: 10px; }
.signoff-pop { opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.signoff-pop.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .signoff-pop { transition: none; transform: none; }
}
.legend .lg-gap { background: #F1FAF4; border: 1.5px dashed #9CCBAE; }
.legend .lg-buf { background: repeating-linear-gradient(135deg, #D5DCE6 0 4px, #fff 4px 8px); border: 1px solid var(--line); }
.toast .btn { margin-left: 10px; }
.dbar .l1 b { flex: 0 0 auto; max-width: 100%; }   /* the name wins over the tags when a bar is short */
.dbar.stacked { padding-top: 1px; padding-bottom: 1px; }
.dbar.stacked .l2 { display: none; }
.dbar.stacked .l1-time { display: inline; }
.board-wrap.compact .board td.cell { position: relative; }
.board-wrap.compact .board td.cell > .chip:not([hidden]) ~ .add { position: absolute; right: 3px; bottom: 3px; width: 22px; height: 22px; min-height: 0; line-height: 22px; font-size: 16px; }
.board-wrap.compact .board td.cell .cell-jobs:has(.chip) + .add { position: absolute; right: 3px; bottom: 3px; width: 22px; height: 22px; min-height: 0; line-height: 22px; font-size: 16px; }
.board-wrap.compact .board td.cell:has(.chip[data-ticket]) { padding-bottom: 6px; }

/* ================================================================ step 3f: New job as the call screen */
.callgrid { display: grid; grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); gap: 18px; align-items: start; }
.callright { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.sizes label { margin: 0; min-width: 52px; min-height: 40px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border: 1px solid #CBD3DE; border-radius: var(--radius, 4px); background: #fff; font: 700 17px var(--cond); color: var(--ink-2); cursor: pointer; }
.sizes input { position: absolute; opacity: 0; pointer-events: none; }
.sizes label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.sizes label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 1px; }
#site-hint { font-weight: 500; }
.cb-answer { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.cb-k { font: 600 13px var(--cond); letter-spacing: .06em; text-transform: uppercase; color: #9FB0C8; }
.cb-big { font: 600 23px/1.15 var(--cond); }
.cb-note { color: #C9D3E1; font-size: 14px; }
.cb-board { --cbu: 128px; background: var(--panel); border: 1px solid #C5CEDA; border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 280px); min-height: 240px; }
.cb-board:empty { display: none; }
.cb-head { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: var(--cbu) 1fr; height: 30px; background: #F3F5F8; border-bottom: 2px solid #AEB9C8; min-width: 560px; }
.cb-head .cb-u { border-right: 2px solid #AEB9C8; }
.cb-lane { position: relative; }
.cb-head .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #C9D2DE; }
.cb-head .tick span { position: absolute; left: 4px; top: 6px; font: 600 13.5px var(--cond); color: var(--ink-2); white-space: nowrap; }
.cb-row { display: grid; grid-template-columns: var(--cbu) 1fr; height: 46px; border-bottom: 1px solid #E3E8EF; min-width: 560px; }
.cb-row .cb-lane { background: repeating-linear-gradient(to right, transparent 0 calc(100% / 14 - 1px), #EEF1F5 calc(100% / 14 - 1px) calc(100% / 14)); }
.cb-row button.cb-u { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 10px; border-right: 2px solid #AEB9C8; background: var(--panel); }
.cb-row button.cb-u:hover { background: var(--hover); }
.cb-row button.cb-u:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.cb-row button.cb-u:disabled { cursor: default; }
.cb-u .no { font: 700 19px/1 var(--cond); color: var(--ink); }
.cb-u .no small { font: 500 13px var(--font); color: var(--ink-3); margin-left: 5px; }
.cb-st { align-self: flex-start; font: 600 13px/1.3 var(--cond); padding: 0 6px; border-radius: 4px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cb-st.open { background: var(--brand); color: var(--brand-ink); }
.cb-st.busy { background: #E3E8EF; color: var(--navy-3); }
.cb-st.down { background: var(--red-bg); color: var(--red); }
.cb-st.past, .cb-st.small { color: var(--ink-3); padding-left: 0; }
.cb-row.small { opacity: .45; }
.cb-row.small:hover { opacity: .8; }
.cb-row.sel, .cb-row.sel button.cb-u { background: #FFF8E1; }
.cb-row.sel button.cb-u { box-shadow: inset 4px 0 0 var(--brand-ink); }
.cb-req { position: absolute; top: 3px; bottom: 3px; z-index: 1; background: rgba(255, 197, 46, .25); border: 2px dashed #C99700; border-radius: 6px; }
.cb-now { position: absolute; top: 0; bottom: 0; z-index: 3; border-left: 2px solid var(--red); }
.cb-bar { position: absolute; top: 8px; bottom: 8px; z-index: 2; background: #fff; color: var(--ink); border: 1px solid #B8C3D2; border-left: 4px solid var(--blue); border-radius: 5px; padding: 0 6px; font-size: 13px; font-weight: 600; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(21, 35, 59, .12); }
.cb-bar:hover { text-decoration: none; border-color: #8FA0B6; z-index: 4; }
.cb-bar.notime { background: repeating-linear-gradient(135deg, #FFF6DA 0 10px, #FFFCF2 10px 20px); border-style: dashed; border-color: #C9A43A; border-left: 4px solid #E9B10E; }
.cb-legend { margin-top: 0; }
.legend .lg-req { background: rgba(255, 197, 46, .25); border: 2px dashed #C99700; }
details.step.later > summary { list-style: none; cursor: pointer; }
details.step.later > summary::-webkit-details-marker { display: none; }
details.step.later > summary h2 { margin: 0; display: flex; gap: 10px; align-items: center; }
details.step.later > summary h2 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 15px var(--cond); flex: none; }
details.step.later > summary h2 .muted { font-weight: 500; }
details.step.later[open] > summary h2 { margin-bottom: 12px; }
details.step.later > summary h2::after { content: "Show"; margin-left: auto; font: 600 14px var(--font); color: var(--blue); }
details.step.later[open] > summary h2::after { content: "Hide"; }
@media (max-width: 1100px) {
  .callgrid { grid-template-columns: 1fr; }
  .callright { position: static; }
}
.banner.pw-call { background: #EBE3FB; color: #5B33B5; border-color: #D3C2F5; }
#eh.need { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--brand); }
.waiting { margin-top: 10px; border: 1px solid #F3D98A; background: #FFFBEB; border-radius: var(--radius); overflow: hidden; }
.waiting .w-h { font: 600 15px var(--cond); color: var(--yellow); padding: 8px 14px 4px; }
.waiting .w-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 14px; border-top: 1px solid #F6E5B0; }
.waiting .w-row b { display: block; font-weight: 600; }
.waiting .w-row small { color: var(--ink-2); }
.waiting .w-row .btn { flex: none; }
.waiting .w-foot { font-size: 13px; color: var(--ink-3); padding: 6px 14px 8px; border-top: 1px solid #F6E5B0; }

/* ================================================================ step 3g: Today in four sections */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.today-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.today-side .sec > summary h2 { font-size: 20px; }
.sec .snum { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 15px var(--cond); flex: none; }
.sec.roll { border: 2px solid var(--navy); }
.sec .item .kind { margin-right: 4px; vertical-align: 1px; }
.sub-h.static { border-top: 1px solid var(--line-2); }
.lbs { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 6px; }
.lbs .item { padding-right: 14px; }
.lbs .item:last-child { border-bottom: 0; }
.lb-ask { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lb-ask label { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 500; }
.mini { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.mini:hover { background: var(--hover); text-decoration: none; }
.mini.static:hover { background: none; }
.mini > b { font: 700 16px/1.3 var(--cond); min-width: 50px; flex: none; }
.mini > span { min-width: 0; }
.mini em { display: block; font-style: normal; font-weight: 600; }
.mini small { display: block; color: var(--ink-2); font-size: 13px; }
.mini.warn-red { box-shadow: inset 4px 0 0 var(--red); }
.mini.warn-orange { box-shadow: inset 4px 0 0 #E8771E; }
.today-page form.hcard { overflow-x: auto; }
@media (max-width: 1300px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================ step 3h: job page, finish this job */
.jstrip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.js-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 10px 16px 10px 18px; border-bottom: 1px solid var(--line-2); box-shadow: inset 5px 0 0 #B3BCC9; }
.js-line:last-child { border-bottom: 0; }
.js-line.red { box-shadow: inset 5px 0 0 var(--red); background: var(--red-bg); }
.js-line.yellow { box-shadow: inset 5px 0 0 #E9B10E; background: #FFF6DA; }
.js-line.blue { box-shadow: inset 5px 0 0 var(--blue); background: #E6EEFC; }
.js-line.pw:not(.red):not(.yellow) { box-shadow: inset 5px 0 0 #5B33B5; background: #F4EFFD; }
.js-line .pwnums { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.finish { border: 2px solid var(--navy); }
.fin-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.fin-k { font-weight: 600; position: relative; padding-left: 20px; }
.fin-k small { display: block; font-weight: 500; color: var(--ink-3); font-size: 13px; }
.fin-dot { position: absolute; left: 0; top: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #B3BCC9; box-sizing: border-box; }
.fin-dot.ok { background: var(--green); border-color: var(--green); }
.fin-form { display: flex; gap: 8px; align-items: flex-end; }
.fin-form textarea { flex: 1; }
.fin-day { padding-bottom: 10px; }
.fin-day + .fin-day { border-top: 1px dashed var(--line); padding-top: 10px; }
.fin-crew { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.fin-crew .pill .x { all: unset; box-sizing: border-box; cursor: pointer; margin-left: 4px; min-width: 28px; min-height: 28px; display: inline-grid; place-items: center; font: 700 20px/1 var(--font); color: var(--ink-2); border-radius: var(--radius, 4px); }
.fin-crew .pill .x:hover { color: var(--red); }
.fin-crew .pill .x:focus-visible { outline: 3px solid var(--navy); }
.fin-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fin-add select { width: auto; max-width: 190px; padding: 6px 8px; }
.fin-add select[name=role] { max-width: 120px; }
.fin-add input[type=time] { width: 118px; padding: 6px 8px; }
.fin-add .fin-note { flex-basis: 100%; font-size: 13px; }
.fin-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 700px) { .fin-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } .fin-form { flex-direction: column; align-items: stretch; } }

/* ================================================================ step 3i: Daily schedule */
.ds-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0 0 12px; }
.ds-day { font: 600 22px var(--cond); }
.ds-bar .seg button { border: 0; background: #fff; padding: 6px 12px; font: 600 15px var(--cond); color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line); }
.ds-bar .seg button:last-child { border-right: 0; }
.ds-bar .seg button.on { background: var(--navy); color: #fff; }
.ds-bar .seg button:not(.on):not(:disabled):hover { background: var(--hover); }
.ds-bar .seg button:disabled { color: var(--ink-3); cursor: not-allowed; }
.ds-bar .seg button:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.ds-find { margin: 0; }
.ds-find-in { width: 240px; padding: 6px 10px; }
.ds-warn { margin-bottom: 12px; }
.ds-table { background: var(--panel); border: 1px solid #C5CEDA; border-radius: var(--radius); overflow-x: auto; }
.ds-hd, .ds-row { display: grid; grid-template-columns: 74px 92px minmax(200px, 1.6fr) minmax(110px, 1fr) minmax(140px, 1.2fr) minmax(120px, 1fr) 22px; gap: 10px; align-items: center; padding: 0 14px; min-width: 900px; }
.ds-hd { font: 600 13px var(--cond); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); background: #F3F5F8; border-bottom: 2px solid #AEB9C8; min-height: 32px; }
.ds-job { border-bottom: 1px solid #E3E8EF; }
.ds-job > summary { list-style: none; cursor: pointer; min-height: 46px; }
.ds-job > summary::-webkit-details-marker { display: none; }
.ds-job > summary:hover { background: var(--hover); }
.ds-job > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.ds-job[open] > summary { background: #FFF8E1; }
.ds-job.warn-red > summary { box-shadow: inset 4px 0 0 var(--red); }
.ds-job.warn-orange > summary { box-shadow: inset 4px 0 0 #E8771E; }
.ds-time { font: 700 17px var(--cond); }
.ds-time.tbd { color: var(--yellow); font-size: 15px; }
.ds-unit { font: 700 19px var(--cond); white-space: nowrap; }
.ds-unit small { font: 500 12.5px var(--font); color: var(--ink-3); margin-left: 4px; }
.ds-unit .need { color: var(--blue); font-size: 16px; }
.ds-cut { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.ds-cut b { font-weight: 600; }
.ds-tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.ds-tags .pill { font-size: 12.5px; padding: 0 6px; }
.ds-job .chev { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink-3); transform: rotate(-90deg); justify-self: center; }
.ds-job[open] .chev { transform: none; }
.ds-pane { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; padding: 12px 14px 16px 112px; background: #FFFCF2; border-top: 1px solid var(--line); }
.ds-info { display: flex; flex-direction: column; gap: 5px; font-size: 14.5px; min-width: 0; }
.ds-k { font: 600 13px var(--cond); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin-right: 4px; }
.ds-work { font-size: 16px; font-weight: 500; white-space: pre-wrap; }
.ds-quick .f { margin-bottom: 8px; }
.ds-quick .f label { font-size: 13px; }
.ds-none { padding: 18px; color: var(--ink-3); }
.ds-foot { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.ds-foot b { color: var(--ink); }
@media (max-width: 900px) { .ds-pane { grid-template-columns: minmax(0, 1fr); padding-left: 14px; } .ds-find-in { width: 180px; } }
.ds-sort-l { margin: 0; font-weight: 600; }
.ds-sort { width: auto; padding: 6px 8px; }


/* ---- step 6b: storage item lines use .htable; the description box takes the spare width */
.htable input.grow { width: 100%; }

/* ---------- appearance: coordinated dark workspace and sidebar colors ---------- */
.top .gsearch { min-width: 0; }
.subtle-card { background: var(--surface-subtle, #FBFCFD); }
.cod-card { background: var(--cod-surface, #FFF8F7); border-color: var(--cod-border, #F2BDB9); }
.pw-reminder { color: var(--purple, #5B33B5); }

/* Screen-only colors keep receipts, tickets and printed schedules on white paper. */
@media screen {
  html[data-theme="dark"] { color-scheme: dark; }
  html[data-theme="dark"] body { background: #181818; }
  html[data-theme="dark"] .side {
    --navy: #222222; --navy-2: #353535; --navy-3: #444444;
    color-scheme: dark; color: #c6c6c6; scrollbar-color: #737373 transparent;
  }
  html[data-theme="dark"] .side .nav a { color: #c6c6c6; }
  html[data-theme="dark"] .side :is(.nav-label, .nav a .tag, .nav a.soon) { color: #a3a3a3; }
  html[data-theme="dark"] .side .nav-label::after { background: #555555; }
  html[data-theme="dark"] .side .sidebar-toggle { color: #c6c6c6; border-color: #696969; }
  html[data-theme="dark"] .side :is(.nav a:hover, .nav a.on, .sidebar-toggle:hover) { color: #fff; }
  html[data-theme="dark"] .main {
    --steel: #181818; --panel: #242424; --surface-2: #303030; --surface-subtle: #202020;
    --field: #1c1c1c; --field-border: #6b6b6b; --row-alt: #222222; --weekend: #1b1b1b;
    --ink: #eeeeee; --ink-2: #c6c6c6; --ink-3: #a3a3a3;
    --line: #484848; --line-2: #333333; --hover: #363636;
    --blue: #8eb9ff; --blue-bg: #203857;
    --green: #78d9af; --green-bg: #193c32;
    --yellow: #f4d17b; --yellow-bg: #3c331e;
    --orange: #ffbd88; --orange-bg: #463223;
    --red: #ff969d; --red-bg: #472a34;
    --purple: #c8b5ff; --purple-bg: #332b4c; --teal: #83d4d9; --teal-bg: #1b3c43;
    --cod-surface: var(--red-bg); --cod-border: #92545f;
    color: var(--ink); background: var(--steel);
  }
  html[data-theme="dark"] .top { background: rgba(24, 24, 24, .95); }

  /* Inputs, buttons and neutral surfaces. Primary actions retain the company accent. */
  html[data-theme="dark"] .main :is(input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
    input[type="date"], input[type="time"], input[type="number"], input[type="search"], input[type="password"], select, textarea) {
    color: var(--ink); background: var(--field); border-color: var(--field-border);
  }
  html[data-theme="dark"] .main :is(input, textarea)::placeholder { color: var(--ink-3); opacity: 1; }
  html[data-theme="dark"] .main .htable input.bad { background: var(--red-bg); border-color: var(--red); }
  html[data-theme="dark"] .main .ctext.changed textarea { border-color: var(--red); }
  html[data-theme="dark"] .main :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--brand); }
  html[data-theme="dark"] .main :is(.btn:not(.primary):not(.dark):not(.ghost), .seg, .seg-radio, .lookup) {
    background: var(--panel); border-color: var(--field-border);
  }
  html[data-theme="dark"] .main .btn:not(.primary):not(.dark):not(.ghost):hover { background: var(--hover); }
  html[data-theme="dark"] .main :is(.btn.dark, .seg a.on, .ds-bar .seg button.on, .seg-radio label:has(input:checked), .sizes label:has(input:checked)) {
    background: #444444; color: #fff; border-color: var(--field-border);
  }
  html[data-theme="dark"] .main :is(.sizes label:not(:has(input:checked)), .ds-bar .seg button:not(.on)) {
    background: var(--panel); border-color: var(--field-border);
  }
  html[data-theme="dark"] .main .ds-bar .seg button:not(.on):not(:disabled):hover { background: var(--hover); }
  html[data-theme="dark"] .main :is(.t th, .map-row.head, .rows .r.hd, .sub-h, .print-bar, .hday.inset,
    .ticket .th, .results .grp, .picked, .hcard, .plates.light .plate:not(.down)) { background: var(--surface-2); }
  html[data-theme="dark"] .main .plates.light .plate:not(.down):hover { background: var(--hover); }
  html[data-theme="dark"] .main .sheet { background: var(--panel); }

  /* Status colors stay distinct without bright pastel blocks. */
  html[data-theme="dark"] .main :is(.pill.gray, .avatar, .stage.quote, .stage.lost, .stage.cancelled, .jplate.out,
    .chip .tags span, .chip .wtag.gray:where(:not([class*="tone-"])), .chip .wtag.blue:where(:not([class*="tone-"])), .dbar .tag, .cb-st.busy) { background: var(--surface-2); color: var(--ink-2); }
  html[data-theme="dark"] .main :is(.pill.blue, .stage.scheduled, .jplate.need) { background: var(--blue-bg); color: var(--blue); }
  html[data-theme="dark"] .main .stage.tentative { background: var(--yellow-bg); color: var(--yellow); }
  html[data-theme="dark"] .main .stage.billed { background: var(--green-bg); color: var(--green); }
  html[data-theme="dark"] .main :is(.pill.pw, .badge-pw, .chip .tags .pw, .dbar .tag.pw) { background: var(--purple-bg); color: var(--purple); }
  html[data-theme="dark"] .main :is(.badge-fill, .dbar .tag.fill) { background: var(--teal-bg); color: var(--teal); }
  html[data-theme="dark"] .main :is(.badge-cod, .chip .tags .cod, .dbar .tag.cod) { background: var(--red-bg); color: var(--red); }
  html[data-theme="dark"] .main :is(.chip .wtag.red:where(:not([class*="tone-"])), .chip .tags .re, .dbar .tag.re, .dbar .tag.wt.red, .pill.dns, .dlane-h .now-tag) {
    background: #b83e4c; color: #fff;
  }
  html[data-theme="dark"] .main .chip .wtag.orange:where(:not([class*="tone-"])) { background: var(--orange-bg); color: var(--orange); }
  html[data-theme="dark"] .main :is(.flash.ok, .banner.green, .map-row select.set) {
    background: var(--green-bg); color: var(--green); border-color: #416e5d;
  }
  html[data-theme="dark"] .main :is(.flash.error, .banner.red) { background: var(--red-bg); color: var(--red); border-color: #92545f; }
  html[data-theme="dark"] .main :is(.flash.info, .banner.blue, .lockbar, .js-line.blue) { background: var(--blue-bg); color: var(--blue); border-color: #4d6c98; }
  html[data-theme="dark"] .main :is(.banner.yellow, .lockbar.mine, .whoami.unset, .js-line.yellow, .waiting) {
    background: var(--yellow-bg); color: var(--yellow); border-color: #78633b;
  }
  html[data-theme="dark"] .main :is(.waiting .w-row, .waiting .w-foot) { border-color: #78633b; }
  html[data-theme="dark"] .main :is(.pwbox, .banner.pwbar:not(.yellow):not(.red), .banner.pw-call, .js-line.pw:not(.red):not(.yellow)) {
    background: var(--purple-bg); color: var(--purple); border-color: #6f5b99;
  }
  html[data-theme="dark"] .main .pwbox .pw-ask { color: var(--purple); }

  /* Large workspace blocks stay neutral; navigation and status accents keep their colors. */
  html[data-theme="dark"] .main :is(.fleet, .cb-answer, .board tr.grp th, .board tr.grp td, .dgrp) { background: #353535; }
  html[data-theme="dark"] .main .fleet .plate { background: #292929; }
  html[data-theme="dark"] .main .fleet .plate:hover { background: #3b3b3b; }

  /* Week board keeps its distinct status stripes on neutral lanes. */
  html[data-theme="dark"] .main .board-wrap { background: var(--line-2); border-color: var(--line); }
  html[data-theme="dark"] .main :is(.board th, .board td) { border-right-color: var(--line); border-bottom-color: var(--line); }
  html[data-theme="dark"] .main :is(.board thead th, .board th.unitcol) { background: var(--surface-2); border-color: var(--line); }
  html[data-theme="dark"] .main .board thead th.weekend { background: var(--weekend); }
  html[data-theme="dark"] .main .board thead th.today { background: var(--yellow-bg); }
  html[data-theme="dark"] .main .board thead .hol { background: var(--yellow-bg); color: var(--yellow); }
  html[data-theme="dark"] .main :is(.board td.cell, .board tbody th.unitcol) { background: var(--panel); }
  html[data-theme="dark"] .main :is(.board tr.lane.alt td.cell, .board tr.lane.alt th.unitcol) { background: var(--row-alt); }
  html[data-theme="dark"] .main .board tr.lane td.cell.weekend { background: var(--weekend); }
  html[data-theme="dark"] .main .board tr.lane td.cell.today { background: var(--yellow-bg); }
  html[data-theme="dark"] .main :is(.board tr.lane td.cell.down, .ddown) {
    background: repeating-linear-gradient(135deg, #472a34 0 8px, #241f2c 8px 16px); color: var(--red); border-color: #92545f;
  }
  html[data-theme="dark"] .main .board tr.lane td.cell.rented { background: repeating-linear-gradient(135deg, var(--blue-bg) 0 8px, var(--surface-subtle) 8px 16px); }
  html[data-theme="dark"] .main :is(.board td.cell.dragover, .dlane.drop-on) { background: var(--yellow-bg); }
  html[data-theme="dark"] .main :is(.board tr.lane td.cell:hover .add, .drow:hover .dadd) { background: var(--hover); border-color: var(--line); }
  /* Warm ivory job cards stand apart from either dark board without a bright-white glare. */
  html[data-theme="dark"] .main .chip {
    --ink: #28313b; --ink-2: #434b54; --ink-3: #55514b;
    --surface-2: #c9c1b3; --surface-subtle: #d2ccc0;
    --line: #b6ad9e; --line-2: #c8c0b2;
    --blue: #3563a1; --green: #26704b;
    --yellow: #6e4f17; --yellow-bg: #e0d1aa;
    background: #d8d2c6; color: var(--ink);
    border-top-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line);
  }
  html[data-theme="dark"] .main .chip.st-tentative { background: var(--yellow-bg); border-color: #8f7845; border-left-color: #e9b10e; }
  html[data-theme="dark"] .main .chip.st-quote { background: var(--surface-subtle); border-left-color: #817d74; }
  html[data-theme="dark"] .main .chip.st-dispatched { border-left-color: var(--navy); }
  html[data-theme="dark"] .main .dbar.st-dispatched { border-left-color: #9db1ce; }
  html[data-theme="dark"] .main :is(.chip .bar, .legend .bar-key .bar) { background: var(--line-2); }
  html[data-theme="dark"] .main .chip .bar { background-image: linear-gradient(to right, transparent calc(50% - 1px), var(--line) calc(50% - 1px), var(--line) calc(50% + 1px), transparent calc(50% + 1px)); }
  html[data-theme="dark"] .main .chip .bar.none { background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px); }
  html[data-theme="dark"] .main .chip.st-dispatched .bar i { background: var(--navy); }
  /* Cover the pale outer border at the footer, keeping the card's total height steady. */
  html[data-theme="dark"] .main .chip .wtag {
    margin-right: calc(-1 * var(--chip-pad-x) - 1px);
    margin-bottom: calc(-1 * var(--chip-pad-bottom) - 1px);
    min-height: calc(var(--warning-height) + 1px);
    padding-bottom: calc(var(--warning-pad-y) + 1px);
    border-bottom-right-radius: var(--radius);
  }
  html[data-theme="dark"] .main .legend { --navy: #9db1ce; }

  /* Day view, call board and daily schedule use the same workspace palette. */
  html[data-theme="dark"] .main :is(.dayboard-wrap, .cb-board, .ds-table) { border-color: var(--line); }
  html[data-theme="dark"] .main :is(.dbar, .cb-bar) { border-top-color: var(--line); border-right-color: var(--line); border-bottom-color: var(--line); }
  html[data-theme="dark"] .main :is(.dhead, .dhead .ucol, .cb-head, .ds-hd, .drow.alt .ucol) { background: var(--surface-2); border-color: var(--line); }
  html[data-theme="dark"] .main :is(.drow, .drow .ucol, .cb-row, .ds-job, .cb-row button.cb-u, .cb-head .cb-u) { border-color: var(--line); }
  html[data-theme="dark"] .main :is(.dgrid .vl, .dlane-h .tick, .cb-head .tick) { border-left-color: var(--line-2); }
  html[data-theme="dark"] .main .dgrid .past { background: rgba(0, 0, 0, .16); }
  html[data-theme="dark"] .main .cb-row .cb-lane { background: repeating-linear-gradient(to right, transparent 0 calc(100% / 14 - 1px), var(--line-2) calc(100% / 14 - 1px) calc(100% / 14)); }
  html[data-theme="dark"] .main :is(.drow.special, .drow.special .ucol) { background: var(--blue-bg); }
  html[data-theme="dark"] .main :is(.dbar.st-dispatched, .cb-bar) { background: var(--panel); }
  html[data-theme="dark"] .main :is(.dbar.st-tentative, .dbar.st-quote, .cb-row.sel, .cb-row.sel button.cb-u, .ds-job[open] > summary, .ds-pane) { background: var(--yellow-bg); }
  html[data-theme="dark"] .main :is(.dbar.notime, .cb-bar.notime) { background: repeating-linear-gradient(135deg, #3c331e 0 10px, #2c291e 10px 20px); }
  html[data-theme="dark"] .main :is(.dgap, .legend .lg-gap) { background: var(--green-bg); border-color: #416e5d; }
  html[data-theme="dark"] .main :is(.dbuf, .legend .lg-buf) { background: repeating-linear-gradient(135deg, #454545 0 4px, transparent 4px 8px); border-color: var(--line); }
}

/* The original blue dark palette shares the same forms, statuses and paper styles. */
@media screen {
  html[data-theme="dark"][data-theme-palette="blue"] body { background: #101a28; }
  html[data-theme="dark"][data-theme-palette="blue"] .side {
    --navy: #15233b; --navy-2: #1e3050; --navy-3: #2a3f63;
    color-scheme: light; color: #c5d0df; scrollbar-color: #526786 transparent;
  }
  html[data-theme="dark"][data-theme-palette="blue"] .side .nav a { color: #c5d0df; }
  html[data-theme="dark"][data-theme-palette="blue"] .side :is(.nav-label, .nav a .tag) { color: #6f82a0; }
  html[data-theme="dark"][data-theme-palette="blue"] .side .nav a.soon { color: #8c9bb3; }
  html[data-theme="dark"][data-theme-palette="blue"] .side .nav-label::after { background: #3d506e; }
  html[data-theme="dark"][data-theme-palette="blue"] .side .sidebar-toggle { color: #c5d0df; border-color: #526786; }
  html[data-theme="dark"][data-theme-palette="blue"] .side :is(.nav a:hover, .nav a.on, .sidebar-toggle:hover) { color: #fff; }
  html[data-theme="dark"][data-theme-palette="blue"] .main {
    --steel: #101a28; --panel: #1c2a3d; --surface-2: #24354c; --surface-subtle: #192639;
    --field: #142133; --field-border: #5d728e; --row-alt: #172437; --weekend: #142032;
    --ink: #e7eef8; --ink-2: #bac8dc; --ink-3: #91a4bf;
    --line: #3c4e68; --line-2: #2b3c53; --hover: #2b3e58;
  }
  html[data-theme="dark"][data-theme-palette="blue"] .top { background: rgba(16, 26, 40, .95); }
  html[data-theme="dark"][data-theme-palette="blue"] :is(.board-wrap, .dayboard-wrap) {
    --board-scroll-track: #192639; --board-scroll-thumb: #6b819e; --board-scroll-hover: #91a8c6;
  }
  html[data-theme="dark"][data-theme-palette="blue"] .main :is(.btn.dark, .seg a.on, .ds-bar .seg button.on,
    .seg-radio label:has(input:checked), .sizes label:has(input:checked)) { background: #354c6a; }
  html[data-theme="dark"][data-theme-palette="blue"] .main :is(.fleet, .cb-answer, .board tr.grp th, .board tr.grp td, .dgrp) { background: var(--navy); }
  html[data-theme="dark"][data-theme-palette="blue"] .main .fleet .plate { background: var(--navy-2); }
  html[data-theme="dark"][data-theme-palette="blue"] .main .fleet .plate:hover { background: var(--navy-3); }
  html[data-theme="dark"][data-theme-palette="blue"] .main :is(.dbuf, .legend .lg-buf) {
    background: repeating-linear-gradient(135deg, #344760 0 4px, transparent 4px 8px);
  }
}

/* Staff week board: one card per busy unit/day, with the original jobs in a hover briefing. */
.day-job-summary[hidden] { display: none !important; }
.day-job-summary { width: 100%; text-align: left; font-family: var(--font); cursor: pointer; }
.day-job-summary .group-hint { display: block; margin-top: 5px; font: 500 11.5px/1.3 var(--cond); color: var(--ink-2); }
.day-job-summary .job-group-bars { display: grid; gap: 3px; margin: 6px 0; }
.day-job-summary .job-group-bars .bar { margin: 0; height: 3px; }
.day-job-summary[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--blue); }
.cell-jobs > .chip { z-index: 1; }
.chip .job-brief { display: none; }
.cell-jobs[popover] {
  position: fixed; inset: auto; margin: 0; width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 24px); padding: 14px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink);
  box-shadow: 0 12px 36px rgba(8, 17, 31, .25); overscroll-behavior: contain;
  opacity: 0; transform: translateY(6px); transition: opacity 200ms ease, transform 200ms cubic-bezier(.22, 1, .36, 1);
}
.cell-jobs[popover].is-open { opacity: 1; transform: translateY(0); }
.job-group-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.job-group-title { font: 600 18px/1.25 var(--cond); }
.job-group-title small { display: block; margin-top: 3px; font: 500 12.5px/1.3 var(--font); color: var(--ink-2); }
.job-group-close { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--radius, 4px); background: var(--hover); color: var(--ink-2); font: 500 22px/1 var(--font); cursor: pointer; }
.job-group-close:hover { background: var(--line-2); color: var(--ink); }
.job-group-foot { padding-top: 4px; font-size: 12px; color: var(--ink-2); }
.board-wrap .cell-jobs[popover] > .chip { --chip-pad-x: 10px; --chip-pad-top: 8px; --chip-pad-bottom: 9px; margin-bottom: 10px; }
.board-wrap .cell-jobs[popover] .chip .tl { font-size: 15px; gap: 6px; }
.board-wrap .cell-jobs[popover] .chip .tl .u { font-size: 14px; min-height: 18px; }
.board-wrap .cell-jobs[popover] .chip .tl .dur { font-size: 12px; }
.board-wrap .cell-jobs[popover] .chip .bar { display: block; }
.board-wrap .cell-jobs[popover] .chip .cu { font-size: 14px; margin-top: 0; white-space: normal; }
.board-wrap .cell-jobs[popover] .chip .ct { display: block; white-space: normal; }
.board-wrap .cell-jobs[popover] .chip .ct:empty { display: none; }
.board-wrap .cell-jobs[popover] .chip .tags { display: flex; flex-wrap: wrap; }
.board-wrap .cell-jobs[popover] .chip .job-brief { display: block; margin-top: 6px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.board-wrap .cell-jobs[popover] .chip .wtag { --warning-height: 22px; --warning-pad-y: 3px; margin-top: 7px; font-size: 12px; }
.board-wrap.compact .day-job-summary .group-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cell-jobs[popover] { transition: none; transform: none; }
}
