/* Acter app styles. Plain system fonts, white surfaces, color only where it means something. */
:root {
  --bg: #F3F4F6; --surface: #FFFFFF; --subtle: #F9FAFB; --line: #EAECF0; --line-strong: #D0D5DD;
  --text: #101828; --text-2: #344054; --muted: #667085; --faint: #98A2B3;
  --red: #D92D20; --green: #1E6B3E; --green-bg: #ECFDF3; --amber-bg: #FFFAEB; --amber: #93370D;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--text); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--text); }
:focus-visible { outline: 2px solid #101828; outline-offset: 2px; }
.loading { padding: 40px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout. 768 px and up: the sidebar on the left. Under 768 px (phones): a bar along the top, the menu behind its button
   (audit 2026-11-28 #14; it used to stack the whole sidebar above the page, and did so up to 800 px). */
.shell { display: flex; min-height: 100vh; }
.side { flex: 0 0 232px; width: 232px; background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
.side-menu { flex: 1 1 auto; display: flex; flex-direction: column; gap: 18px; }
.nav-toggle, .side-scrim { display: none; }
.content { flex: 1 1 0; min-width: 0; }
@media (max-width: 767px) {
  :root { --bar-h: 57px; }   /* 8 + 40 + 8 padding, 1 border */
  .shell { flex-direction: column; }
  .side { flex: none; width: auto; height: auto; align-self: stretch; padding: 8px 10px; gap: 0; overflow: visible; z-index: 40;
    border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-row { min-height: 40px; justify-content: flex-start; gap: 4px; }
  .brand { padding: 0 4px; }
  .brand-tools { margin-left: auto; }
  .nav-toggle { display: inline-flex; flex: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: 6px;
    background: transparent; color: var(--text); cursor: pointer; }
  .nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--subtle); }
  .side-menu { display: none; }
  .side.open .side-menu { display: flex; position: fixed; top: var(--bar-h); left: 0; bottom: 0; z-index: 46; width: min(320px, 88vw); overflow-y: auto;
    padding: 14px; background: var(--surface); border-right: 1px solid var(--line); box-shadow: 8px 0 24px -12px rgba(16, 24, 40, .35); }
  .side.open .side-scrim { display: block; position: fixed; top: var(--bar-h); left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(16, 24, 40, .35); }
  /* full-height pages fill the screen under the bar instead of running past it */
  .content :is(main.ak, main.au, main.siteview, .twin) { height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h)); }
}
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) { .side.open .side-menu { animation: side-in .16s ease-out; } }
@keyframes side-in { from { transform: translateX(-12px); opacity: .6; } }
.main { max-width: 1320px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 20px; }

/* Sidebar */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--text); }
.brand span { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 4px;
  text-decoration: none; color: var(--text-2); font-weight: 500; border: 0; background: transparent; width: 100%; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--subtle); }
.nav-item[aria-current="page"] { background: #F2F4F7; color: var(--text); font-weight: 600; }
.nav-item.soon { color: var(--faint); cursor: default; }
.nav-item.soon:hover { background: transparent; }
.nav-item .tag { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 500; }
.badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--text);
  color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sync-box { border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sync-box .when { font-size: 12px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 4px; background: var(--text); color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none; }
.avatar.round { border-radius: 50%; background: #F2F4F7; color: var(--text); }
.who-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.who-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sep { border-top: 1px solid var(--line); padding-top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 4px; border: 1.5px solid var(--text); background: var(--surface); color: var(--text); font-weight: 600;
  font-size: 13px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--subtle); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.fix { color: var(--red); min-width: 56px; min-height: 30px; padding: 0 12px; flex: none; }
.btn.quiet { border: 1px solid var(--line-strong); font-weight: 500; }
.btn.wide { width: 100%; }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; white-space: nowrap; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.top .date { flex: 1 1 auto; color: var(--muted); font-size: 13px; }
.chev { transition: transform .15s; }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* Key numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .num { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--text-2); }
.stat .sub.good { color: var(--green); }

/* Columns */
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.alerts { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: center; gap: 12px; }
.section-head h2 { flex: 1 1 auto; font-size: 18px; }

/* Sort menu */
.menu-wrap { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; border: 0; background: transparent;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.menu-btn b { color: var(--text); font-weight: 500; }
.menu { position: absolute; right: 0; top: 40px; z-index: 5; min-width: 170px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; box-shadow: 0 4px 12px rgba(16, 24, 40, .08); padding: 4px; display: flex; flex-direction: column; }
.menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.menu button:hover, .menu button[aria-checked="true"] { background: #F2F4F7; }

/* Alert cards */
.card { background: var(--surface); border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 1px 1px rgba(16,24,40,.04), 0 2px 4px rgba(16,24,40,.05), 0 8px 16px -8px rgba(16,24,40,.12); }
.card-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 4px; }
.card-open { flex: 1 1 auto; min-width: 0; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border: 0;
  border-radius: 4px; background: transparent; text-align: left; cursor: pointer; }
.card-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-body { margin: 0 14px 14px 36px; border-radius: 5px; background: var(--subtle); border: 1px solid var(--line); padding: 2px 14px; }
.rec { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rec:first-child { border-top: 0; }
.rec-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rec-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-text span { font-size: 13px; color: var(--muted); }
.money { font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.more { font-size: 13px; color: var(--muted); padding: 8px 0; border-top: 1px solid var(--line); }
.empty { border: 1px dashed var(--line-strong); border-radius: 5px; padding: 28px; text-align: center; color: var(--muted); background: var(--surface); }

/* Side panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 16px; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bar-label span span { color: var(--muted); }
.bar { height: 6px; background: #ECEEEA; border-radius: 3px; overflow: hidden; }
.bar div { height: 100%; background: var(--text-2); border-radius: 3px; }
.note { margin: 0; font-size: 12px; color: var(--muted); }
.app-row { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1px solid var(--faint); }
.dot.on { background: #2E8A4C; border-color: #2E8A4C; }
.app-row .name { flex: 1 1 auto; }
.app-row .state { font-size: 12px; color: var(--muted); }
.app-row .state.on { color: var(--green); }

/* Alert detail */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; border: 0; background: none; padding: 0; cursor: pointer; }
.back:hover { color: var(--text); }
.detail-head { display: flex; flex-direction: column; gap: 6px; }
.detail-head h1 { font-size: 26px; letter-spacing: -0.01em; }
.detail-head p { margin: 0; color: var(--text-2); font-size: 15px; }
.meta { font-size: 12px; color: var(--muted); }
.banner { border-radius: 5px; padding: 12px 14px; font-weight: 500; }
.banner.good { background: var(--green-bg); color: var(--green); border: 1px solid #ABEFC6; }
.banner.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid #FEDF89; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.panel p { margin: 0; color: var(--text-2); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .none { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Sign-in */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.signin { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px;
  display: flex; flex-direction: column; gap: 18px; text-align: center; box-shadow: 0 8px 24px -12px rgba(16,24,40,.18); }
.signin .brand { justify-content: center; }
.signin p { margin: 0; color: var(--muted); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px));
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: 5px; font-size: 13px; box-shadow: 0 8px 24px rgba(16,24,40,.25); z-index: 20; }
.toast.bad { background: #7A271A; }

@media (max-width: 640px) {
  .main { padding: 16px 16px 40px; }
  .card-body { margin-left: 14px; }
}

/* Pipeline view switch */
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { flex: 1 1 auto; }
.segs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px; gap: 2px; }
.seg { border: 0; background: transparent; padding: 3px 10px; border-radius: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg.on { background: var(--text); color: #fff; }
.bar.won div { background: #2E8A4C; }
.conv { font-size: 11px; color: var(--muted); }

/* Account card (company + signed-in person) */
.acct { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); overflow: hidden; }
.acct-co { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.acct-logo { width: 34px; height: 34px; border-radius: 4px; background: var(--text); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.acct-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acct-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-text > span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-status { display: inline-flex; align-items: center; gap: 6px; }
.acct-status .dot { width: 6px; height: 6px; }
.acct-user { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 12px; border-top: 1px solid var(--line); background: var(--subtle); }
.acct-avatar { width: 26px; height: 26px; border-radius: 50%; background: #E4E7EC; color: var(--text-2); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; }
.acct-user .acct-text strong { font-weight: 500; font-size: 12px; }
.icon-btn { flex: none; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: #EAECF0; color: var(--text); }
.acct-co .acct-text strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.acct-logo { width: 32px; height: 32px; }

/* Business twin */
.twin { padding: 20px 24px 16px; display: flex; flex-direction: column; gap: 12px; height: 100vh; }
.twin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.twin-title { flex: 1 1 260px; display: flex; flex-direction: column; }
.twin-title h1 { font-size: 22px; }
.twin-search { min-height: 36px; width: 240px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; font: inherit; background: var(--surface); }
.chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.chip[disabled] { opacity: .5; cursor: default; }
.zoom { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: var(--surface); }
.zoom button { min-width: 36px; min-height: 34px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px; }
.zoom button:first-child { border-left: 0; }
.zoom button:hover { background: var(--subtle); }
.twin-body { flex: 1 1 auto; min-height: 420px; display: flex; gap: 12px; }
.twin-canvas { flex: 1 1 auto; min-width: 0; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; cursor: grab; touch-action: none;
  background-image: radial-gradient(#E4E7EC 1px, transparent 1px); background-size: 22px 22px; }
.twin-canvas.grabbing { cursor: grabbing; }
.twin-svg { width: 100%; height: 100%; display: block; user-select: none; }
.twin-head { font-size: 13px; font-weight: 600; fill: var(--text-2); }
.twin-sub { font-size: 12px; font-weight: 600; fill: var(--muted); }
.twin-line { fill: none; stroke: #C4CAD4; stroke-width: 1.2; transition: opacity .15s; }
.twin-line.hot { stroke: #F04438; stroke-width: 1.6; }
.twin-line.sel { stroke: #101828; stroke-width: 2; }
.twin-line.sel.hot { stroke: #D92D20; }
.twin-line.dim { opacity: .12; }
.twin-card { cursor: pointer; transition: opacity .15s; }
.twin-card:focus { outline: none; }
.twin-rect { fill: #fff; stroke: #E4E7EC; filter: drop-shadow(0 1px 2px rgba(16, 24, 40, .08)); }
.twin-card:hover .twin-rect, .twin-card:focus-visible .twin-rect { stroke: #98A2B3; }
.twin-card.sel .twin-rect { stroke: #101828; stroke-width: 2; }
.twin-card.moving { cursor: grabbing; }
.twin-card.moving .twin-rect { stroke: #475467; filter: drop-shadow(0 6px 12px rgba(16, 24, 40, .18)); }
.twin-card.dim { opacity: .18; }
.twin-t { font-size: 13px; font-weight: 600; fill: var(--text); }
.twin-s { font-size: 12px; fill: var(--muted); }
.twin-dot { fill: #F04438; }
.twin-panel { flex: 0 0 340px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.twin-panel h2 { font-size: 18px; line-height: 1.3; }
.twin-panel .big { margin: 0; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel-top { display: flex; align-items: center; justify-content: space-between; }
.kind-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.kind-dot { width: 8px; height: 8px; border-radius: 2px; }
.panel-sec { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.panel-sec h3 { font-size: 13px; color: var(--muted); font-weight: 600; }
.props { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.conn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); padding: 8px 10px; cursor: pointer; font-size: 13px; }
.conn:hover { border-color: var(--line-strong); background: var(--subtle); }
.conn-label { color: var(--muted); font-size: 12px; flex: none; min-width: 74px; }
.conn-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.conn-val { flex: none; font-variant-numeric: tabular-nums; }
.alert-link { color: var(--red); font-weight: 500; font-size: 13px; }
.history { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.history li { display: flex; flex-direction: column; font-size: 13px; position: relative; }
.history li::before { content: ""; position: absolute; left: -19px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #98A2B3; }
.h-when { font-size: 12px; color: var(--muted); }
.twin-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg.muted { color: var(--muted); margin-left: auto; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.line { width: 18px; height: 0; border-top: 2px solid #C4CAD4; border-radius: 0; }
.sw.line.hot { border-top-color: #F04438; }
.map-link { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--line-strong); }
.map-link:hover { border-bottom-color: var(--text); }
@media (max-width: 900px) {
  .twin { height: auto; }
  .twin-body { flex-direction: column; }
  .twin-canvas { min-height: 480px; }
  .twin-panel { flex-basis: auto; }
}

/* Alerts menu item turns red when anything needs attention */
.badge.hot { background: #D92D20; }
.alert-label.hot { color: #B42318; }

/* Twin record panel */
.twin-panel { gap: 16px; padding: 18px; }
.tp-head { display: flex; align-items: flex-start; gap: 12px; }
.tp-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tp-id h2 { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.tp-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); flex: none; }
.tp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tp-stat { border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--subtle); }
.tp-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tp-v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tp-pill { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #EFF8FF; color: #175CD3; }
.tp-pill.won { background: #ECFDF3; color: #067647; }
.tp-pill.lost { background: #FEF3F2; color: #B42318; }
.tp-alerts { display: flex; flex-direction: column; gap: 6px; }
.tp-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 5px; background: #FEF3F2; border: 1px solid #FECDCA;
  color: #912018; text-decoration: none; font-size: 13px; font-weight: 500; }
.tp-alert:hover { background: #FEE4E2; }
.tp-alert-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; flex: none; }
.tp-alert span:nth-child(2) { flex: 1 1 auto; }
.tp-sec { display: flex; flex-direction: column; gap: 8px; }
.tp-sec h3 { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tp-props { margin: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.tp-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.tp-row:first-child { border-top: 0; }
.tp-row dt { color: var(--muted); }
.tp-row dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.tp-group { display: flex; flex-direction: column; gap: 4px; }
.tp-glabel { font-size: 12px; color: var(--muted); padding-left: 2px; }
.tp-conn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 5px; background: var(--surface); cursor: pointer; font-size: 13px; }
.tp-conn:hover { border-color: var(--line-strong); background: var(--subtle); }
.tp-ctitle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tp-cval { flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); }
.tp-chev { flex: none; color: var(--faint); font-size: 16px; line-height: 1; }
.tp-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tp-history li { position: relative; padding: 0 0 14px 22px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tp-history li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #2E90FA; box-shadow: 0 0 0 3px #EFF8FF; }
.tp-history li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tp-history li:last-child::after { display: none; }
.tp-history li.ev-created::before { background: #98A2B3; box-shadow: 0 0 0 3px #F2F4F7; }
.tp-history li.ev-removed::before { background: #F04438; box-shadow: 0 0 0 3px #FEF3F2; }
.tp-what { font-weight: 500; }
.tp-when { font-size: 12px; color: var(--muted); }

/* Twin: focus view, + Add card, card configurator */
.btn.primary { background: var(--text); color: #fff; }
.btn.primary:hover { background: #1D2939; }
.btn.danger { border: 1px solid #FDA29B; color: #B42318; font-weight: 600; align-self: flex-start; }
.btn.danger:hover, .btn.danger.confirm { background: #FEF3F2; }
.btn.danger.confirm { border-color: #D92D20; }
.add-card .plus { font-size: 18px; line-height: 1; font-weight: 500; margin-top: -2px; }
.twin-crumbs { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; pointer-events: none; }
.crumb { pointer-events: auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.crumb:hover { background: var(--subtle); }
.crumb-now { font-size: 13px; font-weight: 600; padding: 0 4px; }
.tp-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-btn { border: 0; background: none; padding: 4px 6px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.link-btn:hover { background: var(--subtle); }
.tp-danger { border-top: 1px solid var(--line); padding-top: 14px; }
.cf-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 40, .45); display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; overflow-y: auto; }
.cf { width: min(560px, 100%); background: var(--surface); border-radius: 6px; box-shadow: 0 20px 40px rgba(16, 24, 40, .25);
  padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.cf-head { display: flex; align-items: center; justify-content: space-between; }
.cf-head h2 { font-size: 18px; }
.cf-types { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cf-types legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.cf-type { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: 4px; background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.cf-type.on { border: 1.5px solid var(--text); background: var(--subtle); font-weight: 600; }
.cf-type[disabled] { color: var(--faint); cursor: default; }
.cf-type .soon { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: #F2F4F7; color: var(--muted);
  padding: 1px 6px; border-radius: 999px; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.cf-field.wide { grid-column: 1 / -1; }
.cf-input { min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; font: inherit; font-weight: 400;
  color: var(--text); background: var(--surface); width: 100%; }
.cf-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--subtle); cursor: pointer; }
.cf-toggle input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.cf-toggle > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cf-toggle .meta { font-size: 12px; }
.cf-sec-head { display: flex; justify-content: space-between; align-items: baseline; }
.cf-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 5px; }
.cf-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 400;
  color: var(--text); cursor: pointer; }
.cf-item:first-child { border-top: 0; }
.cf-item:hover { background: var(--subtle); }
.cf-item[hidden] { display: none; }
.cf-ititle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cf-ikind { flex: none; font-size: 12px; color: var(--muted); }
.cf-error { margin: 0; padding: 10px 12px; border-radius: 4px; background: #FEF3F2; color: #B42318; font-size: 13px; }
.cf-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Twin: Records | Process switch */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--text); color: #fff; }

/* Process view (isometric) */
.proc-canvas { background: #FBFCFD; background-image: none; }
.proc-svg { width: 100%; height: 100%; display: block; user-select: none; }
.plate { fill: #F2F4F7; stroke: #E4E7EC; }
.grid { stroke: #E4E7EC; stroke-width: .6; }
.slab { fill: #EAECF0; stroke: #D0D5DD; stroke-width: .6; }
.slab.yard { fill: #E4E1DC; }
.slab.dirt { fill: #E9E2D6; }
.iso-t { fill: #FCFCFD; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.iso-l { fill: #E4E7EC; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.iso-r { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.iso-cyl { fill: #DDE1E7; stroke: #98A2B3; stroke-width: .6; }
.dark-t { fill: #98A2B3; stroke: #667085; stroke-width: .6; }
.dark-l { fill: #667085; stroke: #475467; stroke-width: .6; }
.dark-r { fill: #475467; stroke: #344054; stroke-width: .6; }
.dark-t, .dark-l, .dark-r { stroke-linejoin: round; }
.veh-t { fill: #FEC84B; stroke: #B54708; stroke-width: .5; }
.veh-l { fill: #FDB022; stroke: #B54708; stroke-width: .5; }
.veh-r { fill: #F79009; stroke: #B54708; stroke-width: .5; }
.glass-t, .glass-l, .glass-r, .win { fill: #C7D7FE; stroke: #8098F9; stroke-width: .4; }
.win.r { fill: #A4BCFD; }
.mix-cyl { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.mix-t { fill: #EAECF0; stroke: #667085; stroke-width: .5; }
.pile-l { fill: #D6CFC4; stroke: #A39A8C; stroke-width: .6; }
.pile-r { fill: #BFB6A8; stroke: #A39A8C; stroke-width: .6; }
.pit-a { fill: #E7E2DA; stroke: #C9C1B4; stroke-width: .6; }
.pit-b { fill: #EFEBE5; stroke: #C9C1B4; stroke-width: .6; }
.pit-wall { fill: #CFC6B8; }
.pit-wall2 { fill: #DCD4C8; }
.steel { stroke: #667085; stroke-width: 1.4; }
.frame { fill: none; stroke: #667085; stroke-width: 1.2; }
.road { fill: #98A2B3; }
.road-line { stroke: #fff; stroke-width: 1.2; stroke-dasharray: 6 6; }
.belt { stroke: #475467; stroke-width: 5; stroke-linecap: round; }
.belt.hl { stroke: #101828; }
.belt-top { stroke: #98A2B3; stroke-width: 2; stroke-linecap: round; }
.belt-shadow { stroke: rgba(16, 24, 40, .08); stroke-width: 6; stroke-linecap: round; }
.road-path { fill: none; stroke: #D0D5DD; stroke-width: 9; stroke-linejoin: round; stroke-linecap: round; }
.haul-path { fill: none; stroke: #DDD5C8; stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; }
.road-path.hl, .haul-path.hl { stroke: #98A2B3; }
.flow-dash { fill: none; stroke: #fff; stroke-width: 1.4; stroke-dasharray: 5 7; }
.info-path { fill: none; stroke: #84ADFF; stroke-width: 1.4; stroke-dasharray: 3 5; opacity: .75; }
.info-path.hl { stroke: #155EEF; stroke-width: 2.2; opacity: 1; }
.flow.live { animation: flow 1.1s linear infinite; }
.info-path.live { stroke: #2E90FA; opacity: 1; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.station { cursor: pointer; transition: opacity .15s; }
.station:focus { outline: none; }
.station.dim, .plabel.dim { opacity: .35; }
.ring { fill: transparent; stroke: transparent; stroke-width: 2; }
.ring.ok { fill: rgba(18, 183, 106, .07); stroke: rgba(18, 183, 106, .35); }
.ring.watch { fill: rgba(247, 144, 9, .10); stroke: rgba(247, 144, 9, .6); }
.ring.problem { fill: rgba(240, 68, 56, .12); stroke: rgba(240, 68, 56, .75); animation: pulse 1.6s ease-in-out infinite; }
.ring.unknown { fill: transparent; stroke: transparent; }
.station:hover .ring, .station:focus-visible .ring, .station.sel .ring { stroke: #101828; stroke-dasharray: 4 4; }
@keyframes pulse { 50% { fill: rgba(240, 68, 56, .26); } }
.plabel { cursor: pointer; }
.plabel-box { fill: #fff; stroke: #D0D5DD; filter: drop-shadow(0 2px 4px rgba(16, 24, 40, .10)); }
.plabel.sel .plabel-box { stroke: #101828; stroke-width: 1.5; }
.plabel-stem { stroke: #98A2B3; stroke-width: 1; }
.plabel-t { font-size: 12px; font-weight: 600; fill: var(--text); }
.plabel-s { font-size: 9.5px; fill: var(--faint); }
.plabel-s.live { fill: #067647; }
.pdot { stroke: #fff; stroke-width: 1.5; }
.pdot.ok, .pstep.ok { fill: #12B76A; }
.pdot.watch, .pstep.watch { fill: #F79009; }
.pdot.problem, .pstep.problem { fill: #F04438; }
.pdot.unknown { fill: #D0D5DD; }
.pstep { stroke: #fff; stroke-width: 2; }
.pstep-n { font-size: 11px; font-weight: 700; fill: #fff; text-anchor: middle; }
.palert { fill: #F04438; }
.pdot-h { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: #D0D5DD; }
.pdot-h.ok { background: #12B76A; } .pdot-h.watch { background: #F79009; } .pdot-h.problem { background: #F04438; }
.sw.line.info { background: none; border-top: 2px dashed #2E90FA; height: 0; }
.ppill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #F2F4F7; color: var(--text-2); white-space: nowrap; }
.ppill.ok { background: #ECFDF3; color: #067647; } .ppill.watch { background: #FFFAEB; color: #B54708; } .ppill.problem { background: #FEF3F2; color: #B42318; }
.proc-note { margin: 0; font-size: 13px; color: var(--text-2); }
.proc-sys { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.proc-sys:first-of-type { border-top: 0; }
.proc-sys-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.proc-sys-name .meta { font-size: 12px; }
.proc-form { display: flex; flex-direction: column; gap: 12px; }
.proc-verdict { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 5px; font-size: 14px; border: 1px solid; }
.proc-verdict.ok { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.proc-verdict.watch { background: #FFFAEB; border-color: #FEDF89; color: #93370D; }
.proc-verdict.problem { background: #FEF3F2; border-color: #FECDCA; color: #B42318; }
.proc-verdict span { color: var(--text); }
.proc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.proc-steps li { display: flex; gap: 10px; font-size: 13px; }
.proc-steps li > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.pstep-h { flex: none; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: #12B76A; }
.pstep-h.watch { background: #F79009; } .pstep-h.problem { background: #F04438; }
.proc-est summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 0; }
.proc-est { display: flex; flex-direction: column; gap: 8px; }
.proc-est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.cf-field.changed .cf-input { border-color: #F79009; background: #FFFAEB; }
.tp-conn[disabled] { cursor: default; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .flow.live, .ring.problem { animation: none; } }
.proc .twin-panel { flex-basis: 380px; }
.proc-records { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--text);
  border-radius: 5px; background: var(--surface); cursor: pointer; font: inherit; }
.proc-records:hover { background: var(--subtle); }
.proc-records.empty { border: 1px dashed var(--line-strong); cursor: default; background: var(--subtle); }
.proc-records-n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 44px; }
.proc-records-t { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
/* Process layout: stages, job loop, branches */
.zone { fill: #F2F4F7; stroke: #D0D5DD; stroke-width: 1; }
.zone.branch { fill: #F5F3EF; stroke: #DCD4C8; stroke-dasharray: 5 4; }
.zone-t { font-size: 15px; font-weight: 700; letter-spacing: .08em; fill: #98A2B3; }
.loop-road { fill: none; stroke: #E4E7EC; stroke-width: 22; stroke-linejoin: round; }
.loop-hl { fill: none; stroke: #FECDCA; stroke-width: 22; stroke-linejoin: round; stroke-linecap: round; }
.loop-dash { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 6 8; }
.loop-dash.live { stroke: #12B76A; stroke-width: 2.2; }
.loop-arrow { fill: #98A2B3; }
.branch-path { fill: none; stroke: #DDD5C8; stroke-width: 8; stroke-linecap: round; }
.branch-path.hl { stroke: #FDA29B; }
.plabel-n { fill: var(--faint); font-weight: 700; }
.zone-tag rect { fill: #344054; }
.zone-tag text { fill: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.zone-tag.branch rect { fill: #fff; stroke: #DCD4C8; }
.zone-tag.branch text { fill: #7A6F60; }
.rock-t { fill: #BFB6A8; stroke: #8F8577; stroke-width: .5; }
.rock-l { fill: #A89E8F; stroke: #8F8577; stroke-width: .5; }
.rock-r { fill: #978C7C; stroke: #8F8577; stroke-width: .5; }
.wheel { fill: #344054; stroke: #101828; stroke-width: .8; }
.arm { stroke: #B54708; stroke-width: 3; stroke-linecap: round; }
.door { fill: #98A2B3; stroke: #667085; stroke-width: .5; }
/* Process: equipment, people, plan */
.proc-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; max-height: 300px; overflow-y: auto; }
.proc-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.proc-row:first-child { border-top: 0; }
.proc-row[hidden] { display: none; }
.proc-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.proc-row-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-row-main .meta { font-size: 12px; }
.proc-avatar { width: 28px; height: 28px; border-radius: 50%; background: #F2F4F7; color: var(--text-2); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12px; flex: none; }
.proc-demo { font-size: 12px; font-style: italic; margin: 0; }
.proc-when { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1 1 0; }
.plabel-crew { fill: var(--muted); font-weight: 500; }
.pglyph circle, .pglyph path { fill: var(--faint); }
.proc-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 4px; pointer-events: none; }
.mix-l { fill: #E4E7EC; stroke: #667085; stroke-width: .5; }
.mix-r { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.pcrew rect { fill: #F2F4F7; }
.pcrew text { font-size: 10.5px; font-weight: 600; fill: var(--text-2); }
.pcrew .pglyph circle, .pcrew .pglyph path { fill: #98A2B3; }
/* Twin view switch: Process | Records */
.mode-switch { display: inline-flex; gap: 2px; padding: 3px; background: #EAECF0; border-radius: 5px; }
.mode-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.mode-btn:hover { color: var(--text); }
.mode-btn.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .08); }
.mode-btn svg { flex: none; opacity: .8; }
.mode-btn.on svg { opacity: 1; }
.proc-title { position: absolute; left: 14px; top: 12px; padding: 6px 12px; border-radius: 5px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; pointer-events: none; }

/* Detail panels: clearer headings and an action list up top */
.twin-panel h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.tp-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tp-sq { width: 9px; height: 9px; border-radius: 2px; background: var(--kc); }
.tp-sec h3, .tp-actions h3 { font-size: 14px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; gap: 6px; }
.tp-count { font-size: 11px; font-weight: 700; color: var(--text-2); background: #F2F4F7; border-radius: 3px; padding: 1px 6px; }
.tp-actions { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--subtle); border: 1px solid var(--line); border-radius: 6px; }
.tp-actions h3 { margin-bottom: 2px; }
.tp-action { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; text-decoration: none; }
.tp-action:hover { border-color: var(--text); }
.tp-action-i { flex: none; width: 30px; height: 30px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: #F2F4F7; color: var(--text); font-weight: 700; font-size: 15px; }
.tp-action-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tp-action-t strong { font-size: 13.5px; font-weight: 650; }
.tp-action-t span { font-size: 12px; color: var(--muted); }
.tp-action.primary .tp-action-i { background: var(--text); color: #fff; }
.tp-action.danger { border-color: #FDA29B; }
.tp-action.danger .tp-action-i { background: #FEE4E2; color: #B42318; }
.tp-action.danger strong { color: #B42318; }
.tp-stat .meta { font-size: 12px; }
.tp-stat .tp-v { font-size: 22px; }
.tp-row dt { color: var(--text-2); }
.tp-row dd { font-weight: 600; }
.tp-conn-row { display: flex; gap: 6px; align-items: stretch; }
.tp-conn-row .tp-conn { flex: 1 1 auto; min-width: 0; }
.tp-remove { flex: none; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; }
.tp-remove:hover { border-color: #FDA29B; color: #B42318; }
.as-list { max-height: 340px; }
.as-team { flex: none; font-size: 10.5px; font-weight: 700; color: #155EEF; background: #EFF8FF; border-radius: 3px; padding: 1px 6px; }
.cf-item.done { color: var(--muted); }
.twin-more { font-size: 12px; font-weight: 600; fill: #155EEF; cursor: pointer; }

/* ---------------------------------------------------------------- dark, high-contrast side panels */
.twin-panel, .pjob {
  --surface: #2B2B2F; --subtle: #3A3A3E; --line: #4C4C51; --line-strong: #5C5C62;
  --text: #FAFAFA; --text-2: #D4D4D8; --muted: #A1A1AA; --faint: #71717A;
  background: var(--surface); color: var(--text); border-color: #000; box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
.twin-panel .tp-stat, .twin-panel .tp-actions, .twin-panel .cf-toggle { background: var(--subtle); }
.twin-panel .tp-action, .twin-panel .tp-conn, .twin-panel .proc-list, .twin-panel .cf-input, .twin-panel .twin-search { background: #232327; }
.twin-panel .tp-conn:hover, .twin-panel .tp-action:hover { background: #3A3A3E; border-color: #A1A1AA; }
.twin-panel .tp-action-i { background: #4C4C51; color: #fff; }
.twin-panel .tp-action.primary { border-color: #FAFAFA; }
.twin-panel .tp-action.primary .tp-action-i { background: #FAFAFA; color: #2B2B2F; }
.twin-panel .tp-action.danger { border-color: #912018; }
.twin-panel .tp-action.danger .tp-action-i { background: #55160C; color: #FDA29B; }
.twin-panel .tp-action.danger strong { color: #FDA29B; }
.twin-panel .icon-btn:hover, .pjob .icon-btn:hover { background: #4C4C51; color: #fff; }
.twin-panel .link-btn:hover { background: #3A3A3E; }
.twin-panel .btn:hover, .pjob .btn:hover { background: #3A3A3E; }
.twin-panel .seg button.on, .twin-panel .chip.on { background: #FAFAFA; color: #2B2B2F; border-color: #FAFAFA; }
.twin-panel .tp-pill, .pjob .tp-pill { background: #102A56; color: #84CAFF; }
.twin-panel .tp-pill.won { background: #053321; color: #75E0A7; }
.twin-panel .tp-pill.lost, .twin-panel .tp-alert { background: #55160C; color: #FDA29B; }
.twin-panel .tp-alert { border-color: #912018; }
.twin-panel .tp-alert:hover { background: #7A271A; }
.twin-panel .ppill, .pjob .ppill { background: #4C4C51; color: #F4F4F5; }
.twin-panel .ppill.ok, .pjob .ppill.ok { background: #053321; color: #75E0A7; }
.twin-panel .ppill.watch, .pjob .ppill.watch { background: #4E1D09; color: #FEC84B; }
.twin-panel .ppill.problem, .pjob .ppill.problem { background: #55160C; color: #FDA29B; }
.twin-panel .proc-verdict.ok { background: #053321; border-color: #085D3A; color: #75E0A7; }
.twin-panel .proc-verdict.watch { background: #4E1D09; border-color: #93370D; color: #FEC84B; }
.twin-panel .proc-verdict.problem { background: #55160C; border-color: #912018; color: #FDA29B; }
.twin-panel .cf-field.changed .cf-input { background: #4E1D09; }
.twin-panel .tp-history li::before { box-shadow: 0 0 0 3px #102A56; }
.twin-panel a { color: #84CAFF; }

/* ---------------------------------------------------------------- find a job (process view) */
.pjob-find { position: relative; }
.pjob-results { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 340px; max-width: 80vw; max-height: 360px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: #2B2B2F; border: 1px solid #000; border-radius: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.pjob-results[hidden] { display: none; }
.pjob-results button { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 0; border-radius: 4px;
  background: transparent; color: #FAFAFA; text-align: left; cursor: pointer; font: inherit; }
.pjob-results button:hover, .pjob-results button:focus-visible { background: #3A3A3E; outline: none; }
.pjob-results strong { font-size: 13px; font-weight: 600; }
.pjob-results span { font-size: 12px; color: #A1A1AA; }
.pjob-empty { padding: 10px; font-size: 13px; color: #A1A1AA; }

/* the job card that floats over the step the job is at */
.pjob { position: absolute; left: 0; top: 0; z-index: 20; width: 340px; max-width: calc(100% - 24px); max-height: calc(100% - 70px); overflow-y: auto;
  border: 1px solid #000; border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; pointer-events: auto; }
.pjob::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #2E90FA; border-radius: 6px 0 0 6px; }
.pjob-head { display: flex; align-items: flex-start; gap: 10px; }
.pjob-head > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pjob-head h3 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.pjob-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #84CAFF; }
.pjob-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--text-2); }
.pjob-sec { display: flex; flex-direction: column; gap: 8px; }
.pjob-sec h4 { margin: 0; font-size: 13px; font-weight: 700; }
.pjob-acts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pjob-acts button { width: 100%; display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px;
  background: #232327; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pjob-acts button:hover { border-color: #FEC84B; }
.pjob-acts button > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pjob-acts strong { font-size: 13px; }
.pjob-acts span span { font-size: 12px; color: var(--muted); }
.pjob-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #F79009; color: #2B2B2F; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.pjob-people { display: flex; flex-wrap: wrap; gap: 6px; }
.pjob-person { font-size: 12px; padding: 3px 9px; border-radius: 3px; background: var(--subtle); border: 1px solid var(--line); }
.pjob-none { margin: 0; font-size: 13px; color: var(--muted); }
.pjob-open { margin-top: 2px; }

/* the map: where the job is (blue) and who acts next (amber) */
.ring.here { fill: rgba(46, 144, 250, .14); stroke: #2E90FA; stroke-width: 2.5; animation: pulse 1.6s ease-in-out infinite; }
.ring.act { fill: rgba(247, 144, 9, .12); stroke: #F79009; stroke-width: 2; }
.pdot.here, .pstep.here { fill: #2E90FA; }
.pdot.act, .pstep.act { fill: #F79009; }
.pjob-linklayer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 19; overflow: visible; }
.pjob-link { fill: none; stroke: #2E90FA; stroke-width: 2; stroke-dasharray: 5 4; }
.pjob-pin { fill: #2E90FA; stroke: #fff; stroke-width: 2.5; }
.twin-panel .tp-count { background: #4C4C51; color: #F4F4F5; }
.twin-panel a.tp-action, .twin-panel a.btn { color: var(--text); }

/* "What you can do": one clean list, no box-in-a-box */
.twin-panel .tp-actions { padding: 0; background: none; border: 0; gap: 8px; }
.twin-panel .tp-actions h3 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.twin-panel .tp-action { gap: 14px; padding: 12px 14px; background: #3A3A3E; border: 1px solid transparent; border-radius: 8px;
  transition: background .12s, border-color .12s; }
.twin-panel .tp-action:hover, .twin-panel .tp-action:focus-visible { background: #46464B; border-color: #5C5C62; outline: none; }
.twin-panel .tp-action-i { width: 36px; height: 36px; border-radius: 8px; background: rgba(46, 144, 250, .16); color: #84CAFF; }
.twin-panel .tp-action-i svg { width: 18px; height: 18px; }
.twin-panel .tp-action-t { gap: 3px; }
.twin-panel .tp-action-t strong { font-size: 14px; font-weight: 600; color: #FAFAFA; }
.twin-panel .tp-action-t span { font-size: 12.5px; line-height: 1.4; color: #A1A1AA; }
.twin-panel .tp-action > .tp-chev, .twin-panel .tp-action > span:last-child:not(.tp-action-t) { color: #71717A; transition: transform .12s, color .12s; }
.twin-panel .tp-action:hover > span:last-child:not(.tp-action-t) { color: #FAFAFA; transform: translateX(2px); }
.twin-panel .tp-action.primary { border-color: transparent; }
.twin-panel .tp-action.primary .tp-action-i { background: #2E90FA; color: #fff; }
.twin-panel .tp-action.danger { background: rgba(240, 68, 56, .10); border-color: transparent; }
.twin-panel .tp-action.danger .tp-action-i { background: rgba(240, 68, 56, .18); color: #FDA29B; }
.twin-panel .tp-action-i { font-size: 17px; }
.twin-panel .proc-avatar, .twin-panel .avatar, .twin-panel .avatar.round { background: #4C4C51; color: #F4F4F5; }
.twin-panel .link-btn { color: #84CAFF; }
/* Main buttons inside dark panels: solid blue, white text */
.twin-panel .btn.primary, .pjob .btn.primary { background: #2E90FA; border-color: #2E90FA; color: #fff; }
.twin-panel .btn.primary:hover, .pjob .btn.primary:hover { background: #1570EF; border-color: #1570EF; }
.twin-panel .btn.primary[disabled] { background: #4C4C51; border-color: #4C4C51; color: #A1A1AA; opacity: 1; }
/* Station panel: issues */
.proc-issue { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid #912018; border-radius: 6px;
  background: rgba(240, 68, 56, .10); color: var(--text); text-align: left; font: inherit; }
button.proc-issue { cursor: pointer; }
button.proc-issue:hover { background: rgba(240, 68, 56, .18); }
.proc-issue-i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #F04438; color: #fff; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; }
.proc-issue-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.proc-issue-t strong { font-size: 13.5px; font-weight: 600; }
.proc-issue-t span { font-size: 12px; color: var(--muted); }
.proc-ok { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #75E0A7; }
.proc-ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #12B76A; }
.tp-count.bad, .twin-panel .tp-count.bad { background: #F04438; color: #fff; }
.proc-recs-link { align-self: flex-start; padding-left: 0; }
/* job card pops up above its step, with a pointer */
.pjob { overflow: visible; max-height: none; }
.pjob::before { display: none; }
.pjob { border-top: 3px solid #2E90FA; }
.pjob::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -9px; width: 16px; height: 16px; margin-left: -8px;
  background: var(--surface); border-right: 1px solid #000; border-bottom: 1px solid #000; transform: rotate(45deg); }
.pjob.below::after { bottom: auto; top: -10px; border: 0; border-left: 1px solid #2E90FA; border-top: 3px solid #2E90FA; background: var(--surface); }
.pjob-acts button { padding: 7px 10px; }
.pjob { gap: 10px; }
/* station panel: jobs list */
.proc-job { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; align-items: flex-start; }
.proc-job:hover { background: var(--subtle); }
.proc-job-tag { flex: none; margin-top: 2px; min-width: 44px; text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 3px; }
.proc-job-tag.here { background: rgba(46, 144, 250, .18); color: #84CAFF; }
.proc-job-tag.act { background: rgba(247, 144, 9, .18); color: #FEC84B; }
.proc-job-do { font-size: 12px; color: #FEC84B; }
.proc-job-v { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.proc-jobgroup { display: flex; flex-direction: column; gap: 6px; }
.proc-jobgroup-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #FEC84B; }
.proc-jobgroup-h::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: #F79009; }
.proc-jobgroup-h.here { color: #84CAFF; }
.proc-jobgroup-h.here::before { background: #2E90FA; }
.proc-job { align-items: center; }
.proc-job .proc-row-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-jobgroup .proc-list { max-height: 260px; }

/* ---------------------------------------------------------------- software: logo + green "On" light */
.sw-list { display: flex; flex-direction: column; gap: 6px; }
.sw-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--subtle); border: 1px solid transparent; }
.sw-row.on { border-color: rgba(18, 183, 106, .45); background: rgba(18, 183, 106, .08); }
.sw-logo { flex: none; width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--text-2); font-size: 12px; font-weight: 800; letter-spacing: .02em; overflow: hidden; }
.sw-logo.on { background: #F4F4F5; color: #18181B; }
.sw-logo.has-img { background: #fff; padding: 5px; }
.sw-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sw-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sw-name strong { font-size: 13.5px; font-weight: 600; }
.sw-name .meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-state { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sw-light { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.sw-state.on { color: #47CD89; }
.sw-state.on .sw-light { background: #17B26A; box-shadow: 0 0 0 3px rgba(23, 178, 106, .22), 0 0 10px rgba(23, 178, 106, .9); animation: swpulse 2s ease-in-out infinite; }
.sw-state.ready { color: #84CAFF; }
.sw-state.ready .sw-light { background: transparent; border: 2px solid #84CAFF; width: 8px; height: 8px; }
@keyframes swpulse { 50% { box-shadow: 0 0 0 5px rgba(23, 178, 106, .10), 0 0 14px rgba(23, 178, 106, .6); } }
@media (prefers-reduced-motion: reduce) { .sw-state.on .sw-light { animation: none; } }

/* ---------------------------------------------------------------- build and remove buildings */
.build-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.build-kind { min-height: 40px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--subtle); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.build-kind:hover { border-color: var(--line-strong); }
.build-kind.on { border-color: #2E90FA; background: rgba(46, 144, 250, .16); color: #fff; }
.btn.quiet.on { background: var(--text); color: #fff; border-color: var(--text); }
.proc-canvas.placing, .proc-canvas.placing .proc-svg { cursor: crosshair; }
.build-banner { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 8px; background: #101828; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(16, 24, 40, .25); }
.build-banner .btn { background: transparent; color: #fff; border-color: #475467; }
.ghost { pointer-events: none; }
.ghost-foot { stroke-width: 2; stroke-dasharray: 6 4; }
.ghost.ok .ghost-foot { fill: rgba(23, 178, 106, .18); stroke: #17B26A; }
.ghost.bad .ghost-foot { fill: rgba(240, 68, 56, .16); stroke: #F04438; }
.ghost-t { font-size: 12px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.ghost.ok .ghost-t { fill: #067647; } .ghost.bad .ghost-t { fill: #B42318; }
.proc-remove { display: flex; gap: 8px; }
.twin-panel .tp-danger { border-top-color: var(--line); }
.twin-panel .btn.danger { background: transparent; border-color: rgba(240, 68, 56, .55); color: #FDA29B; }
.twin-panel .btn.danger:hover { background: rgba(240, 68, 56, .12); }
.twin-panel .btn.danger.sure { background: #D92D20; border-color: #D92D20; color: #fff; }

/* ---------------------------------------------------------------- job card: frosted glass, black text, black outlines */
.pjob {
  --surface: rgba(255, 255, 255, .62); --subtle: rgba(255, 255, 255, .55); --line: #101828; --line-strong: #101828;
  --text: #0A0A0A; --text-2: #1D2939; --muted: #344054; --faint: #475467;
  color-scheme: light; color: #0A0A0A;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  border: 1.5px solid #0A0A0A; border-top: 1.5px solid #0A0A0A; border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 18px 40px rgba(16, 24, 40, .22);
}
.pjob::after { background: rgba(255, 255, 255, .85); border-right: 1.5px solid #0A0A0A; border-bottom: 1.5px solid #0A0A0A; }
.pjob.below::after { border: 0; border-left: 1.5px solid #0A0A0A; border-top: 1.5px solid #0A0A0A; }
.pjob-eyebrow { color: #0A0A0A; opacity: .7; }
.pjob-head h3 { color: #0A0A0A; }
.pjob-facts { color: #1D2939; }
.pjob-sec h4 { color: #0A0A0A; }
.pjob-acts button { background: rgba(255, 255, 255, .55); border: 1.5px solid #0A0A0A; border-radius: 8px; color: #0A0A0A; }
.pjob-acts button:hover { background: rgba(255, 255, 255, .9); border-color: #0A0A0A; }
.pjob-acts span span { color: #344054; }
.pjob-n { background: #0A0A0A; color: #fff; }
.pjob-person { background: rgba(255, 255, 255, .6); border: 1px solid #0A0A0A; color: #0A0A0A; }
.pjob-none { color: #344054; }
.pjob .icon-btn { color: #0A0A0A; }
.pjob .icon-btn:hover { background: rgba(16, 24, 40, .08); color: #0A0A0A; }
.pjob .btn.pjob-open { background: #0A0A0A; color: #fff; border-color: #0A0A0A; border-radius: 8px; }
.pjob .btn.pjob-open:hover { background: #262626; }
.pjob .ppill { border: 1px solid #0A0A0A; background: rgba(255, 255, 255, .7); color: #0A0A0A; }
.pjob .ppill.ok { background: #DCFAE6; color: #054F31; }
.pjob-link { stroke: #0A0A0A; }
.pjob-pin { fill: #0A0A0A; }

/* ---------------------------------------------------------------- design pass: buildings */
.pshadow { fill: url(#pshadow-grad); pointer-events: none; }
.iso-t { fill: #FFFFFF; stroke: #7A8599; stroke-width: .7; }
.iso-l { fill: #EDEFF3; stroke: #7A8599; stroke-width: .7; }
.iso-r { fill: #D3D8E1; stroke: #7A8599; stroke-width: .7; }
.win { fill: #B2CCFF; stroke: #6172F3; stroke-width: .45; }
.win.r { fill: #8BB1FF; }
.slab { fill: #EEF0F3; stroke: #D0D5DD; }
.station { transition: opacity .15s; }
.station:hover .iso-t { fill: #F5F8FF; }
/* machine-down issue: what to do next */
.proc-issue.down { flex-direction: column; align-items: stretch; gap: 10px; }
.proc-issue-top { display: flex; align-items: center; gap: 12px; }
.proc-issue-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 38px; }
.twin-panel .btn.issue-act { min-height: 30px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); color: #FAFAFA; font-weight: 600; }
.twin-panel .btn.issue-act:hover { background: rgba(255, 255, 255, .14); }
.twin-panel .btn.issue-act.primary { background: #FAFAFA; color: #18181B; border-color: #FAFAFA; }
.twin-panel .btn.issue-act.primary:hover { background: #E4E4E7; }

/* ---------------------------------------------------------------- line icons, value tiles, lighter action cards */
.licon { display: block; flex: none; }
.zoom button { display: inline-flex; align-items: center; justify-content: center; }
.btn .licon { margin-left: -2px; }
.tp-action-i .licon, .tp-chev .licon { display: block; }
.tp-chev { display: inline-flex; align-items: center; }

/* value / status tiles: same height, label on top, value on one line */
.tp-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tp-stat { justify-content: flex-start; gap: 8px; min-height: 76px; }
.tp-stat .tp-v { font-size: 21px; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-stat .tp-pill { align-self: flex-start; font-size: 13px; line-height: 1.2; padding: 4px 10px; margin-top: 1px; }

/* action cards: much lighter grey, minimal icon tiles */
.twin-panel .tp-action { background: #52525A; border: 1px solid transparent; }
.twin-panel .tp-action:hover, .twin-panel .tp-action:focus-visible { background: #5E5E67; border-color: rgba(255, 255, 255, .22); }
.twin-panel .tp-action-i { width: 36px; height: 36px; border-radius: 8px; background: transparent; border: 1px solid rgba(255, 255, 255, .28); color: #FAFAFA; }
.twin-panel .tp-action.primary .tp-action-i { background: #FAFAFA; border-color: #FAFAFA; color: #18181B; }
.twin-panel .tp-action.danger { background: #5A3A3A; }
.twin-panel .tp-action.danger .tp-action-i { background: transparent; border-color: rgba(253, 162, 155, .6); color: #FDA29B; }
.twin-panel .tp-action-t span { color: #D4D4D8; }
.twin-panel .tp-action > .tp-chev { color: #A1A1AA; }
.icon-link { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------------------------------------------------------- building the map */
.build-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: bs; }
.build-steps li { counter-increment: bs; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.build-steps li::before { content: counter(bs); flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; border: 1px solid var(--line-strong); color: var(--muted); }
.build-steps li.on { color: var(--text); font-weight: 600; }
.build-steps li.on::before { background: #FAFAFA; color: #18181B; border-color: #FAFAFA; }
.build-steps li.done::before { content: "✓"; background: #17B26A; border-color: #17B26A; color: #fff; }
.build-kind { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.build-kind strong { font-size: 13px; }
.build-kind span { font-size: 11px; font-weight: 500; color: var(--muted); }
.twin-panel .build-kind { background: #52525A; border-color: transparent; }
.twin-panel .build-kind:hover { background: #5E5E67; }
.twin-panel .build-kind.on { background: #FAFAFA; color: #18181B; }
.twin-panel .build-kind.on span { color: #52525B; }

.proc-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.proc-rename-row { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.proc-rename-row .cf-input { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 600; }
.tp-sec-acts { display: flex; align-items: center; gap: 2px; }

.setup-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 8px; background: rgba(46, 144, 250, .12); border: 1px solid rgba(46, 144, 250, .45); }
.setup-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; border: 0; background: #52525A; color: #FAFAFA;
  font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.setup-step:hover { background: #5E5E67; }
.setup-step > span:nth-child(2) { flex: 1 1 auto; }
.setup-check { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #A1A1AA; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.setup-step.done { opacity: .75; }
.setup-step.done .setup-check { background: #17B26A; border-color: #17B26A; color: #fff; }

.proc-inline-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 8px; background: #3A3A3E; border: 1px solid #5C5C62; }
.pif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pif-head strong { font-size: 13.5px; }
.pif-err { margin: 0; font-size: 12.5px; color: #FDA29B; }
.cf-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: -4px; }
.twin-panel select.cf-input { appearance: auto; }
.proc-dir { flex: none; color: var(--muted); display: inline-flex; }
.loop-road.spur { stroke-linecap: round; }

/* ---------------------------------------------------------------- data library */
.lib-body { flex: 1 1 auto; min-height: 420px; display: flex; gap: 12px; }
.lib-nav { flex: 0 0 236px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.lib-group { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.lib-group:hover { background: var(--surface); border-color: var(--line); }
.lib-group.on { background: var(--surface); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.lib-group.on strong { color: #101828; }
.lib-group-top { display: flex; align-items: center; gap: 8px; }
.lib-group-top strong { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.lib-count { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-issue { font-size: 11px; font-weight: 700; color: #fff; background: #F04438; border-radius: 999px; min-width: 18px; padding: 1px 6px; text-align: center; }
.lib-group-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-group.soon { cursor: default; opacity: .6; }
.lib-soon { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #F2F4F7; border-radius: 3px; padding: 1px 6px; }
.lib-imports { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.lib-imports h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.lib-import { display: flex; align-items: center; gap: 8px; padding: 4px; }
.lib-import-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lib-import-t strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-import-t .meta { font-size: 11.5px; }
.lib-import.undone { opacity: .55; }

.lib-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lib-main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.lib-main-head h2 { font-size: 18px; }
.lib-total { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.lib-table-wrap { flex: 1 1 auto; overflow: auto; }
.lib-table-wrap.small { max-height: 220px; border: 1px solid var(--line); border-radius: 5px; flex: none; }
.lib-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lib-table th { position: sticky; top: 0; z-index: 1; background: var(--subtle); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lib-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-table tbody tr { cursor: pointer; }
.lib-table tbody tr:hover { background: var(--subtle); }
.lib-table tbody tr.sel { background: #EFF8FF; box-shadow: inset 3px 0 0 #2E90FA; }
.lib-table tbody tr:focus-visible { outline: 2px solid #2E90FA; outline-offset: -2px; }
.lib-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lib-name { display: flex; flex-direction: column; gap: 1px; }
.lib-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lib-name .meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.lib-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #F2F4F7; color: #344054; }
.lib-pill.good { background: #ECFDF3; color: #067647; } .lib-pill.bad { background: #FEF3F2; color: #B42318; }
.twin-panel .lib-pill { background: #3A3A3E; color: #F4F4F5; } .twin-panel .lib-pill.good { background: #053321; color: #75E0A7; } .twin-panel .lib-pill.bad { background: #55160C; color: #FDA29B; }
.lib-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.lib-pager .meta { margin-right: auto; }
.lib-empty { margin: auto; max-width: 360px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lib-pad { padding: 18px; }
.lib-body .twin-panel { flex: 0 0 360px; }

.lib-import-dialog { width: min(720px, 100%); display: flex; flex-direction: column; gap: 14px; }
.lib-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 20px; border: 2px dashed var(--line-strong);
  border-radius: 8px; text-align: center; cursor: pointer; color: var(--text-2); }
.lib-drop:hover, .lib-drop:focus-within { border-color: #2E90FA; background: #F5FAFF; }
.lib-drop.busy { opacity: .6; pointer-events: none; }
.lib-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lib-file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; background: var(--subtle); }
.lib-file-row strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-map { display: flex; flex-direction: column; gap: 10px; }
.lib-map .cf-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.lib-check { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 6px; border: 1px solid #ABEFC6; background: #F6FEF9; }
.lib-check p { margin: 0; font-size: 13px; }
@media (max-width: 900px) { .lib-body { flex-direction: column; } .lib-nav { flex-basis: auto; flex-direction: row; overflow-x: auto; } .lib-group { min-width: 160px; } }

/* sections that open and close */
.fold-head { align-items: center; }
.fold-btn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fold-btn h3 { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.fold-chev { flex: none; display: inline-flex; color: var(--muted); transition: transform .15s; }
.fold-btn.open .fold-chev { transform: rotate(90deg); }
.fold-sub { margin-left: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tp-sec.fold { padding: 2px 0; border-top: 1px solid var(--line); }
.fold-btn:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.tp-sec-acts { flex: none; white-space: nowrap; gap: 4px; }

/* ---------------------------------------------------------------- process menu: light shell, dark grey cards */
.proc .twin-panel {
  --surface: #F7F7F8; --subtle: #EDEDEF; --line: #E4E4E7; --line-strong: #D4D4D8;
  --text: #18181B; --text-2: #3F3F46; --muted: #71717A; --faint: #A1A1AA;
  background: var(--surface); color: var(--text); border-color: #D4D4D8; box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
  gap: 12px;
}
.proc .twin-panel .tp-head .link-btn { color: #175CD3; }
.proc .twin-panel .tp-head .link-btn:hover, .proc .twin-panel .tp-head .icon-btn:hover { background: #E4E4E7; color: #18181B; }
.proc .twin-panel .tp-head .cf-input { background: #fff; color: #18181B; border-color: #D4D4D8; }
.proc .twin-panel .tp-head .btn { background: #fff; color: #18181B; border-color: #D4D4D8; }
.proc .twin-panel .tp-head .btn.primary { background: #18181B; border-color: #18181B; color: #fff; }
/* Everything under the title is a dark grey card. */
.proc .twin-panel > :not(.tp-head) {
  --surface: #2B2B2F; --subtle: #3A3A3E; --line: #4C4C51; --line-strong: #5C5C62;
  --text: #FAFAFA; --text-2: #D4D4D8; --muted: #A1A1AA; --faint: #71717A;
  background: #2B2B2F; color: var(--text); border: 0; border-radius: 10px; padding: 12px 14px;
}
.proc .twin-panel > .tp-sec.fold { padding: 8px 14px; border-top: 0; }
.proc .twin-panel > .tp-sec.fold.open { padding-bottom: 14px; }
.proc .twin-panel > .tp-danger { padding-top: 12px; }

/* Header actions (Rename, Email all, Add, Move in, Connect): one size, one line, centred. */
.proc-title-row { align-items: center; }
.proc-title-row .link-btn { padding: 0 10px; height: 28px; display: inline-flex; align-items: center; font-size: 13px; border-radius: 6px; }
.tp-sec-head .link-btn, .tp-sec-acts .link-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  background: rgba(255, 255, 255, .08); color: #F4F4F5;
}
.tp-sec-head .link-btn:hover, .tp-sec-acts .link-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.tp-sec-head .link-btn svg, .tp-sec-acts .link-btn svg { width: 14px; height: 14px; flex: none; }
.tp-sec-acts { gap: 6px; }
/* Inter sits a little high in a fixed-height box: nudge the text down, keep icons centred. */
.tp-sec-head .link-btn, .tp-sec-acts .link-btn, .proc-title-row .link-btn { padding-top: 2px; }
.tp-sec-head .link-btn svg, .tp-sec-acts .link-btn svg { margin-top: -2px; }
/* Footnotes stay plain text on the light shell. */
.proc .twin-panel > p { background: none; padding: 0 2px; color: #71717A; --text: #18181B; --muted: #71717A; }

/* ---------------------------------------------------------------- documents in Records */
.lib-docs-group { margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; padding-top: 12px; }
.lib-docs-group.on { border-radius: 6px; }
.lib-docs-group .lib-group-top strong { display: inline-flex; align-items: center; gap: 6px; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.lib-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lib-chip:hover { border-color: var(--line-strong); color: var(--text); }
.lib-chip.on { background: #18181B; border-color: #18181B; color: #fff; }
.lib-chip-n { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-chip.on .lib-chip-n { color: #A1A1AA; }
.lib-lock { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 3px; background: #FEF0C7; color: #93370D; }
.lib-docs tbody tr { cursor: default; }
.lib-docs td.act, .lib-docs th.act { width: 1%; text-align: right; }
.lib-doc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lib-doc-i { flex: none; width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #EFF8FF; color: #175CD3; }
.lib-doc-acts { display: inline-flex; align-items: center; gap: 6px; }
.lib-doc-acts .btn { text-decoration: none; }
.lib-doc-acts .btn.danger { background: #D92D20; border-color: #D92D20; color: #fff; }
.lib-up-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.lib-up-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.lib-up-row .cf-input { flex: 1 1 auto; min-width: 0; }
.lib-up-row .meta { flex: none; font-size: 12px; }
.lib-secure { margin: 0; font-size: 12px; }

/* ---------------------------------------------------------------- menu round 3 */
/* Lighter grey cards (was #2B2B2F). */
.proc .twin-panel > :not(.tp-head) {
  --surface: #3F3F46; --subtle: #52525B; --line: #5A5A63; --line-strong: #6B6B74;
  background: #3F3F46;
}
.proc .twin-panel .proc-list, .proc .twin-panel .cf-input, .proc .twin-panel .twin-search { background: #35353B; }
.proc .twin-panel .tp-action { background: #4A4A52; }
.proc .twin-panel .tp-action:hover { background: #55555E; }
.proc .twin-panel .tp-count { background: #5A5A63; }
/* Issues sit right on the card: no red box, the red dot says it. */
.proc .twin-panel .proc-issue, .proc .twin-panel button.proc-issue { background: none; border: 0; padding: 4px 0; }
.proc .twin-panel button.proc-issue:hover { background: rgba(255, 255, 255, .05); }
/* Section headers never overlap: the title keeps its width, actions wrap below if needed. */
.fold-btn { flex: 1 1 auto; min-width: 0; }
.fold-btn h3, .fold-chev { flex: none; white-space: nowrap; }
.fold-sub { flex: 1 1 auto; }
.proc .twin-panel .tp-count.bad { background: #F04438; color: #fff; }
/* Where does it go: the same switch as Process | Records, in blue. */
.where-switch { display: flex; width: 100%; background: #E0EAFF; }
.where-switch .mode-btn { flex: 1 1 0; justify-content: center; padding: 0 8px; color: #3538CD; }
.where-switch .mode-btn:hover { color: #2D31A6; }
.where-switch .mode-btn.on { background: #fff; color: #2D31A6; }
.proc .twin-panel .where-switch { background: #2D31A6; }
.proc .twin-panel .where-switch .mode-btn { color: #C7D7FE; }
.proc .twin-panel .where-switch .mode-btn:hover { color: #fff; }
.proc .twin-panel .where-switch .mode-btn.on { background: #fff; color: #2D31A6; }
.where-switch .mode-btn { white-space: nowrap; font-size: 13px; }

/* ---------------------------------------------------------------- stages: clickable tags, and connections drawn on the map */
.zone-tag { cursor: pointer; }
.zone-tag rect { transition: fill .12s; }
.zone-tag:hover rect { fill: #1D2939; }
.zone-tag.sel rect { fill: #175CD3; stroke: #fff; stroke-width: 2; }
.zone-tag:focus-visible { outline: none; }
.zone-tag:focus-visible rect { stroke: #2E90FA; stroke-width: 3; }
.ghost-tag { pointer-events: none; opacity: .85; }
.ghost-tag rect { fill: #175CD3; stroke: #fff; stroke-width: 2; stroke-dasharray: 4 3; }
.ghost-tag text { fill: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.link-path { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-dasharray: 7 5; opacity: .9; }
.link-path.info { stroke: #6172F3; }
.link-path.material { stroke: #B54708; }
.link-path.road { stroke: #475467; }
.link-path.sel { stroke-width: 3.25; opacity: 1; stroke-dasharray: none; }
.link-end { stroke: #fff; stroke-width: 1.5; }
.link-end.info { fill: #6172F3; } .link-end.material { fill: #B54708; } .link-end.road { fill: #475467; }
.link-arrow { fill: #475467; }
.proc-tag-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- hover lights the pad; one clean switch style; calm buttons */
.station:hover .ring, .station:focus-visible .ring, .station.sel .ring { stroke-dasharray: none; }
.station:hover .ring.ok, .station:hover .ring.unknown, .station.sel .ring.ok, .station.sel .ring.unknown,
.station:focus-visible .ring.ok, .station:focus-visible .ring.unknown { stroke: transparent; }
.hover-pad { fill: rgba(46, 144, 250, 0); stroke: rgba(46, 144, 250, 0); stroke-width: 1.5; transition: fill .15s, stroke .15s; pointer-events: none; }
.station:hover .hover-pad, .station:focus-visible .hover-pad { fill: rgba(46, 144, 250, .16); stroke: rgba(46, 144, 250, .55); }
.station.sel .hover-pad { fill: rgba(46, 144, 250, .24); stroke: #2E90FA; }

/* Every segmented choice in the menus looks like the Process | Records switch. */
.twin-panel .seg, .twin-panel .where-switch {
  display: flex; width: 100%; gap: 2px; padding: 3px; border: 0; border-radius: 6px; overflow: visible; background: rgba(255, 255, 255, .08);
}
.twin-panel .seg button, .twin-panel .where-switch .mode-btn {
  flex: 1 1 0; min-height: 34px; padding: 0 10px; border: 0; border-left: 0; border-radius: 4px; background: transparent;
  color: #D4D4D8; font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.twin-panel .seg button:hover, .twin-panel .where-switch .mode-btn:hover { color: #fff; }
.twin-panel .seg button.on, .twin-panel .where-switch .mode-btn.on, .proc .twin-panel .where-switch .mode-btn.on {
  background: #fff; color: #18181B; border-color: transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .25), 0 1px 3px rgba(16, 24, 40, .2);
}
.proc .twin-panel .where-switch { background: rgba(255, 255, 255, .08); }
.proc .twin-panel .where-switch .mode-btn { color: #D4D4D8; }

/* Buttons in the menus: white, not blue. Blue is kept for Connect and Add person. */
.twin-panel .btn.primary { background: #FAFAFA; border-color: #FAFAFA; color: #18181B; }
.twin-panel .btn.primary:hover { background: #E4E4E7; border-color: #E4E4E7; color: #18181B; }
.twin-panel .btn.primary.accent { background: #2E90FA; border-color: #2E90FA; color: #fff; }
.twin-panel .btn.primary.accent:hover { background: #1570EF; border-color: #1570EF; }
.proc .twin-panel .tp-head .btn.primary { background: #18181B; border-color: #18181B; color: #fff; }
.proc .twin-panel > p { background: none; padding: 0 2px; color: #71717A; }

/* road access row in Connections */
.proc-road { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; background: var(--subtle); }
.proc-road-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.proc-road-t strong { font-size: 13px; }
.proc-road-t .meta { font-size: 12px; }

/* Switches and forms never spill past the right edge; cards scroll fully into view. */
.twin-panel .seg, .twin-panel .where-switch, .twin-panel .mode-switch { box-sizing: border-box; max-width: 100%; min-width: 0; }
.twin-panel .seg button, .twin-panel .where-switch .mode-btn { min-width: 0; padding: 0 6px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.twin-panel .proc-inline-form, .twin-panel .where-form, .twin-panel .cf-input, .twin-panel .btn.wide { box-sizing: border-box; max-width: 100%; min-width: 0; }
.twin-panel > * { scroll-margin: 16px; }

/* A step with an open issue (alert or machine down): its label lights up red. */
.plabel.issue .plabel-box { fill: #FEF3F2; stroke: #F04438; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(240, 68, 56, .45)); animation: issue-glow 1.8s ease-in-out infinite; }
.plabel.issue .plabel-t, .plabel.issue .plabel-n { fill: #B42318; }
.plabel.issue .pcrew rect { fill: #FEE4E2; }
.plabel.issue .pcrew text, .plabel.issue .pglyph circle, .plabel.issue .pglyph path { fill: #B42318; }
.plabel.issue.sel .plabel-box { stroke: #B42318; stroke-width: 2; }
@keyframes issue-glow { 0%, 100% { filter: drop-shadow(0 0 3px rgba(240, 68, 56, .35)); } 50% { filter: drop-shadow(0 0 9px rgba(240, 68, 56, .6)); } }
@media (prefers-reduced-motion: reduce) { .plabel.issue .plabel-box { animation: none; } }

/* ---------------------------------------------------------------- map top bar: name + build tools */
.proc-topbar { position: absolute; left: 14px; top: 12px; right: 14px; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.proc-topbar .proc-title { position: static; }
.map-tools { pointer-events: auto; display: inline-flex; gap: 2px; padding: 3px; background: #EAECF0; border-radius: 6px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.map-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.map-tool:hover { color: var(--text); background: rgba(255, 255, 255, .6); }
.map-tool.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .08); }
.map-tool svg { flex: none; }

/* ---------------------------------------------------------------- vehicles */
.grey-t { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.grey-l { fill: #98A2B3; stroke: #475467; stroke-width: .5; }
.grey-r { fill: #667085; stroke: #344054; stroke-width: .5; }
.svc-t { fill: #FFFFFF; stroke: #98A2B3; stroke-width: .5; }
.svc-l { fill: #F2F4F7; stroke: #98A2B3; stroke-width: .5; }
.svc-r { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.trail-t { fill: #E4E7EC; stroke: #667085; stroke-width: .5; }
.trail-l { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.trail-r { fill: #98A2B3; stroke: #475467; stroke-width: .5; }
.semi-t { fill: #528BFF; stroke: #1849A9; stroke-width: .5; }
.semi-l { fill: #2970FF; stroke: #1849A9; stroke-width: .5; }
.semi-r { fill: #155EEF; stroke: #1849A9; stroke-width: .5; }
.vobj { cursor: pointer; }
.vobj:focus { outline: none; }
.vpad { fill: rgba(46, 144, 250, 0); stroke: rgba(46, 144, 250, 0); stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.vobj:hover .vpad, .vobj:focus-visible .vpad { fill: rgba(46, 144, 250, .16); stroke: rgba(46, 144, 250, .55); }
.vobj.sel .vpad { fill: rgba(46, 144, 250, .24); stroke: #2E90FA; }
.vobj.down .vpad { fill: rgba(240, 68, 56, .18); stroke: #F04438; animation: pulse 1.6s ease-in-out infinite; }
.ghost-veh { pointer-events: none; opacity: .65; }
.ghost-veh .ghost-foot { fill: rgba(46, 144, 250, .18); stroke: #2E90FA; stroke-dasharray: 4 3; }
.veh-form { gap: 10px; }
.cf-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf-grid.three { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 8px; }
.twin-panel .build-kind span { font-size: 12px; }

/* ---------------------------------------------------------------- clickable lines, drawing lines, stacked HQ labels, vehicle groups */
.line-hit { fill: none; stroke: transparent; stroke-width: 14; stroke-linecap: round; cursor: pointer; pointer-events: stroke; }
.line-hit:hover + *, .line-hit:hover { stroke: rgba(46, 144, 250, .18); }
.branch-path.sel { stroke: #2E90FA; stroke-width: 7; opacity: 1; }
.info-path.sel, .link-path.sel { stroke-width: 3.5; opacity: 1; stroke-dasharray: none; }
.rubber-line { fill: none; stroke: #2E90FA; stroke-width: 2.5; stroke-dasharray: 6 5; pointer-events: none; }
.proc-canvas.drawing, .proc-canvas.drawing .station, .proc-canvas.drawing .plabel, .proc-canvas.drawing .vobj, .proc-canvas.drawing .zone-tag { cursor: crosshair; }
.proc-canvas.drawing .station:hover .hover-pad, .proc-canvas.drawing .vobj:hover .vpad { fill: rgba(46, 144, 250, .3); stroke: #2E90FA; }
.plabel-hit { fill: transparent; cursor: pointer; }
.plabel-row.sub .plabel-t { font-weight: 500; }
.plabel-div { stroke: #EAECF0; stroke-width: 1; }
.plabel-row.on .plabel-hit { fill: rgba(46, 144, 250, .10); }
.plabel-row:hover .plabel-hit { fill: rgba(16, 24, 40, .04); }
.plabel.issue .plabel-row:not(.issue) .plabel-t, .plabel.issue .plabel-row:not(.issue) .plabel-n { fill: var(--text); }
.plabel.issue .plabel-row:not(.issue) .pcrew rect { fill: #F2F4F7; }
.plabel.issue .plabel-row:not(.issue) .pcrew text, .plabel.issue .plabel-row:not(.issue) .pglyph circle, .plabel.issue .plabel-row:not(.issue) .pglyph path { fill: #475467; }
.vcount rect { fill: #101828; stroke: #fff; stroke-width: 1.5; }
.vcount text { fill: #fff; font-size: 11px; font-weight: 800; text-anchor: middle; }
.proc-row-link { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.proc-row-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Generate
   Acter's look: black and white, soft depth, color only where it means something. */
.gen-page { min-height: 100vh; padding: 28px 28px 56px; box-sizing: border-box; }
.gen-hero { max-width: 720px; margin: 14vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.gen-hero h1 { margin: 6px 0 0; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; }
.gen-sub { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.gen-mark { color: var(--text); flex: none; }

.gen-box { width: 100%; box-sizing: border-box; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 14px 10px 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .14);
  transition: border-color .15s, box-shadow .15s; }
.gen-box:focus-within { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -14px rgba(16, 24, 40, .22); }
.gen-input { display: block; width: 100%; box-sizing: border-box; border: 0; outline: none; resize: none; background: transparent; padding: 4px 0;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--text); min-height: 28px; max-height: 240px; }
.gen-input::placeholder { color: var(--faint); }
.gen-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.gen-fine { font-size: 12px; color: var(--faint); }
.gen-send { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--text); color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .15s, transform .1s; }
.gen-send:hover:not(:disabled) { opacity: .85; }
.gen-send:active:not(:disabled) { transform: scale(.96); }
.gen-send:disabled { opacity: .25; cursor: default; }
.gen-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: currentColor; animation: gen-spin .8s linear infinite; }
@keyframes gen-spin { to { transform: rotate(360deg); } }
.gen-off { margin: 0; font-size: 13px; color: var(--muted); }
.gen-error { margin: 0; font-size: 13px; color: var(--red); }

.gen-split { display: flex; gap: 28px; align-items: flex-start; max-width: 1240px; margin: 0 auto; }
.gen-rail { flex: 0 0 220px; position: sticky; top: 28px; display: flex; flex-direction: column; gap: 2px; }
.gen-rail h2 { margin: 4px 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.gen-hist { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; color: var(--text-2); cursor: pointer; }
.gen-hist:hover { background: var(--subtle); }
.gen-hist.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 0 0 1px var(--line); }
.gen-hist-t { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-hist-m { font-size: 12px; color: var(--faint); }
.gen-stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 22px; max-width: 880px; }
.gen-top { display: flex; flex-direction: column; gap: 8px; }
.gen-sheet { display: flex; flex-direction: column; gap: 10px; }
.gen-toolbar { display: flex; align-items: center; gap: 6px; }
.gen-asked { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.gen-act:hover { color: var(--text); border-color: var(--line-strong); }

/* The sheet: always white paper, like the printout. */
.gen-paper { background: #fff; color: #18181B; border-radius: 4px; padding: 56px 64px 44px;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -18px rgba(16, 24, 40, .18); }
.gen-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 340px; text-align: center; }
.gen-eye { color: #18181B; margin-bottom: 10px; overflow: visible; }
.gen-wait-t { font-size: 16px; font-weight: 600; color: #18181B; }
.gen-wait-s { font-size: 13px; color: #71717A; }
/* The eye looks left, then right, comes back to the middle and squints (never shuts). */
/* The loading eye: looks right, then left, then rests in the centre for about a second. It never blinks. */
.gen-eye-pupil { animation: gen-look 3.2s cubic-bezier(.45, 0, .25, 1) infinite; }
.gen-eye-lid { animation: none; }
@keyframes gen-look { 0%, 6% { transform: translateX(0); } 18%, 30% { transform: translateX(9px); } 44%, 56% { transform: translateX(-9px); } 68%, 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .gen-spin, .gen-eye-pupil, .gen-eye-lid { animation: none; } }

.doc { display: flex; flex-direction: column; gap: 16px; font-size: 14.5px; line-height: 1.6; }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid #E4E4E7; }
.doc-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: #18181B; }
.doc-head-r { font-size: 12px; color: #71717A; text-align: right; }
.doc-title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 650; letter-spacing: -0.022em; color: #09090B; }
.doc-lead { margin: 0 0 6px; font-size: 16.5px; line-height: 1.55; color: #3F3F46; }
.doc-h { margin: 18px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: #09090B; }
.doc-p { margin: 0; white-space: pre-line; color: #27272A; }
.doc-note { padding: 12px 16px; border-radius: 8px; background: #F4F4F5; }
.doc-note-k { display: block; font-size: 12px; font-weight: 600; color: #52525B; margin-bottom: 2px; }
.doc-note p { margin: 0; color: #27272A; }
.doc-list, .doc-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: #27272A; }
.doc-list li::marker { color: #A1A1AA; }
.doc-steps { list-style: none; padding: 0; counter-reset: step; }
.doc-steps li { position: relative; padding-left: 34px; counter-increment: step; }
.doc-steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #D4D4D8;
  font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; color: #18181B; font-variant-numeric: tabular-nums; }
/* Key numbers: an even grid with hairlines between cells; text lines up with the page edge. */
.doc-metrics { display: grid; gap: 1px; background: #E4E4E7; margin: 4px 0; }
.doc-metric { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; background: #fff; min-width: 0; }
.doc-metric-v { font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; color: #09090B; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-metric.c0 { padding-left: 0; }
.doc-metrics.sm .doc-metric-v { font-size: 22px; }
.doc-metrics.xs .doc-metric-v { font-size: 19px; }
.doc-metric-k { font-size: 12.5px; color: #71717A; }
.doc-fig { margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.doc-fig figcaption { font-size: 14px; font-weight: 600; color: #18181B; }
.gen-chart { width: 100%; height: auto; max-height: 320px; }
.gen-grid { stroke: #F4F4F5; }
.gen-axis { font-size: 11px; fill: #71717A; font-variant-numeric: tabular-nums; }
.doc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #52525B; }
.doc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.doc-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.doc-table { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.doc-table-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-table-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: #18181B; }
.doc-table-wrap { overflow-x: auto; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { text-align: left; font-size: 12px; font-weight: 600; color: #52525B; padding: 8px 16px; border-bottom: 1px solid #18181B; white-space: nowrap; }
.doc-table td { padding: 9px 16px; border-bottom: 1px solid #F4F4F5; color: #27272A; vertical-align: top; }
.doc-table th:first-child, .doc-table td:first-child { padding-left: 0; }
.doc-table th:last-child, .doc-table td:last-child { padding-right: 0; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-co { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.doc-logo { display: block; max-height: 44px; max-width: 220px; width: auto; height: auto; object-fit: contain; object-position: left center; }
.doc-co-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #09090B; }
.doc-co-lines { font-size: 12px; color: #71717A; }
.doc-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid #E4E4E7; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.doc-foot-t { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: #A1A1AA; }
.doc-made { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 11.5px; font-weight: 600; color: #52525B; }
.doc-made .gen-mark { color: #18181B; }

@media (max-width: 1000px) {
  .gen-split { flex-direction: column; } .gen-rail { position: static; flex-basis: auto; width: 100%; }
  .gen-paper { padding: 32px 24px; }
}

/* Printing a sheet: only the sheet, on letter paper, nothing cut in half. */
@media print {
  @page { size: letter; margin: 16mm 16mm 18mm; }
  .side, .gen-rail, .gen-top, .no-print, #toast, .pop-backdrop { display: none !important; }
  html, body, .shell, .content, .gen-page, .gen-split, .gen-stage, .gen-sheet { display: block !important; background: #fff !important; padding: 0 !important; margin: 0 !important;
    max-width: none !important; min-height: 0 !important; box-shadow: none !important; }
  .gen-paper { box-shadow: none; border-radius: 0; padding: 0; }
  .doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 11pt; }
  .doc-h, .doc-table-head, .doc-fig figcaption { break-after: avoid; }
  .doc-fig, .doc-metrics, .doc-note, .doc-table tr, .doc-steps li { break-inside: avoid; }
  .doc-table-wrap { overflow: visible; }
  .doc-table thead { display: table-header-group; }
}

/* ---------------------------------------------------------------- trucks hauling, loop move, keep on road */
.hobj { cursor: pointer; }
.hobj:hover .vpad, .hobj.sel .vpad { fill: rgba(46, 144, 250, .22); stroke: #2E90FA; }
.htag rect { fill: #101828; stroke: #fff; stroke-width: 1.5; }
.htag text { fill: #fff; font-size: 10.5px; font-weight: 700; text-anchor: middle; }
.hobj.sel .htag rect { fill: #175CD3; }
.ghost-loop { pointer-events: none; }
.ghost-loop-r { fill: rgba(46, 144, 250, .08); stroke: #2E90FA; stroke-width: 2; stroke-dasharray: 8 6; }
.keep-road { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--subtle); cursor: pointer; }
.keep-road input { margin-top: 3px; width: 16px; height: 16px; accent-color: #2E90FA; flex: none; }
.keep-road span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.proc-why { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--subtle); font-size: 13px; line-height: 1.5; }
.htag.more rect { fill: #475467; }

/* ---------------------------------------------------------------- vehicle details: wheels as discs, bumpers, lights */
.tire-wall { fill: #101828; stroke: #101828; stroke-width: .4; }
.tire { fill: #344054; stroke: #101828; stroke-width: .7; stroke-linejoin: round; }
.hub { fill: #98A2B3; stroke: #475467; stroke-width: .5; }
.bumper { fill: #475467; stroke: #344054; stroke-width: .4; }
.headlight { fill: #FEF0C7; stroke: #DC6803; stroke-width: .3; }
.turn-slider { width: 100%; accent-color: #2E90FA; }
.turn-deg { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Records: easier to find and sort */
.lib-nav { flex-basis: 220px; gap: 14px; padding: 2px 0; }
.lib-sec { display: flex; flex-direction: column; gap: 2px; }
.lib-sec-t { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 4px; }
.lib-nav .lib-group { flex-direction: row; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 7px; }
.lib-group-name { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-nav .lib-group:hover { background: #fff; border-color: var(--line); }
.lib-nav .lib-group.on { background: #18181B; border-color: #18181B; box-shadow: none; }
.lib-nav .lib-group.on .lib-group-name { color: #fff; }
.lib-nav .lib-group.on .lib-count { color: #A1A1AA; }
.lib-count.zero { color: var(--faint); }
.lib-imports { margin-top: 4px; }

.lib-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.lib-chips.flat { padding: 0; border: 0; }
.lib-tools-r { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.lib-select { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lib-select:hover { border-color: var(--line-strong); }
.lib-select select { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text); font-weight: 600; padding: 0 4px; height: 28px; cursor: pointer; max-width: 210px; }
.lib-select select:focus-visible { outline: 2px solid #2E90FA; border-radius: 4px; }

.lib-table th.sortable { padding: 0; }
.lib-th { display: inline-flex; align-items: center; gap: 6px; width: 100%; padding: 9px 14px; border: 0; background: none; font: inherit; color: inherit;
  letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-align: left; }
.num .lib-th { justify-content: flex-end; }
.lib-th:hover { color: var(--text); background: rgba(0, 0, 0, .03); }
.lib-arrow { font-size: 11px; color: var(--faint); letter-spacing: 0; }
th.on .lib-th { color: var(--text); }
th.on .lib-arrow { color: #175CD3; }
.lib-pager-btns { display: inline-flex; align-items: center; gap: 6px; }

/* The record menu: light shell, dark grey cards (same as the process menu). */
.lib .twin-panel.lib-rec {
  --surface: #F7F7F8; --subtle: #EDEDEF; --line: #E4E4E7; --line-strong: #D4D4D8;
  --text: #18181B; --text-2: #3F3F46; --muted: #71717A; --faint: #A1A1AA;
  background: #F4F4F5; color: var(--text); border: 1px solid #D4D4D8; box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
  gap: 10px; overflow-y: auto; align-self: stretch;
}
.lib .twin-panel.lib-rec .icon-btn:hover { background: #E4E4E7; color: #18181B; }
.lib-rec .lib-card {
  --surface: #3F3F46; --subtle: #52525B; --line: #5A5A63; --line-strong: #6B6B74;
  --text: #FAFAFA; --text-2: #D4D4D8; --muted: #A1A1AA; --faint: #8B8B94;
  background: #3F3F46; color: var(--text); border-radius: 10px; padding: 12px 14px; gap: 10px;
}
.lib-rec .lib-card h3 { color: #FAFAFA; }
.lib-rec .lib-card .tp-count { background: #5A5A63; color: #F4F4F5; }
.lib-rec .lib-card .tp-count.bad { background: #F04438; color: #fff; }
.lib-rec .tp-props { border-color: #5A5A63; background: #35353B; }
.lib-rec .tp-row { border-color: #4C4C55; }
.lib-rec .tp-conn { background: #4A4A52; border-color: transparent; color: #FAFAFA; border-radius: 7px; }
.lib-rec .tp-conn:hover { background: #55555E; border-color: #6B6B74; }
.lib-rec .tp-conn .lib-pill { flex: none; }
.lib-rec .tp-history li::before { box-shadow: 0 0 0 3px #3F3F46; }
.lib-rec .tp-history li::after { background: #5A5A63; }
.lib-rec .proc-issue, .lib-rec button.proc-issue { background: none; border: 0; padding: 4px 0; color: #FAFAFA; }
.lib-rec .lib-attn { box-shadow: inset 3px 0 0 #F04438; }
.lib-rec-head .tp-id { gap: 4px; }
.lib-back { align-self: flex-start; display: inline-flex; align-items: center; max-width: 100%; height: 26px; padding: 0 10px 0 8px; margin-bottom: 4px; border: 1px solid #D4D4D8;
  border-radius: 999px; background: #fff; color: #3F3F46; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lib-back-i { font-size: 16px; line-height: 1; margin: -2px 6px 0 0; flex: none; }
.lib-back span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-back:hover { border-color: #18181B; color: #18181B; }
.lib-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.lib-stat { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 8px; background: #35353B; min-width: 0; }
.lib-stat .tp-k { color: #A1A1AA; font-size: 10.5px; }
.lib-v { font-size: 15px; font-weight: 650; color: #FAFAFA; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-v.muted { color: #8B8B94; }
.lib-stat .lib-pill { align-self: flex-start; }
.lib-mapbtn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border: 0; border-radius: 8px; background: #4A4A52;
  color: #FAFAFA; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lib-mapbtn:hover { background: #55555E; }
.lib-more { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: #84CAFF; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.lib-more:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Pills read on dark cards. */
.lib-rec .lib-pill { background: #52525B; color: #F4F4F5; }
.lib-rec .lib-pill.good { background: #053321; color: #75E0A7; }
.lib-rec .lib-pill.bad { background: #55160C; color: #FDA29B; }
/* Dropping a vehicle on a road: the ghost turns green when it lines up. */
.ghost-veh.snap .ghost-foot { fill: rgba(18, 183, 106, .18); stroke: #12B76A; }

/* ---------------------------------------------------------------- parking lots, machines, job sites */
.slab.lot { fill: #D0D5DD; stroke: #98A2B3; }
.lot-line { stroke: #fff; stroke-width: 1.2; opacity: .85; }
.vehicle .belt { stroke-width: 4; }
.vehicle .belt-top { stroke: #F79009; stroke-width: 1.4; }
.ghost-park .park-pad { fill: rgba(46, 144, 250, .16); stroke: #2E90FA; stroke-width: 1.5; stroke-dasharray: 5 4; }
.ghost-park rect { fill: #175CD3; }
.ghost-park text { fill: #fff; font-size: 12.5px; font-weight: 600; text-anchor: middle; }
/* Driver picker */
.cf-field.pick { position: relative; }
.pick-list { position: absolute; z-index: 30; top: 100%; left: auto; right: 0; width: max(100%, 240px); margin: 4px 0 0; padding: 4px; list-style: none; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid #D4D4D8; border-radius: 8px; box-shadow: 0 12px 28px rgba(16, 24, 40, .18); color: #18181B; }
.pick-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.pick-item strong { font-size: 13.5px; font-weight: 600; }
.pick-item span { font-size: 12px; color: #71717A; }
.pick-item:hover, .pick-item.on { background: #F4F4F5; }
.pick-empty { padding: 8px 10px; font-size: 12.5px; color: #71717A; }
/* Loop size: − Loop 100% + */
.loop-size { display: inline-flex; align-items: center; gap: 0; }
.loop-size .map-tool { padding: 0 9px; font-size: 15px; font-weight: 600; }
.loop-size .map-tool[disabled] { opacity: .4; cursor: default; }
.loop-pct { gap: 5px; font-size: 13px !important; }
.loop-pct span { color: #71717A; font-weight: 500; }
.loop-pct strong { font-variant-numeric: tabular-nums; min-width: 36px; text-align: left; }
/* Job sites */
.site { cursor: pointer; }
.site .hover-pad { fill: transparent; stroke: none; }
.site:hover .hover-pad, .site:focus-visible .hover-pad { fill: rgba(46, 144, 250, .12); stroke: #84ADFF; stroke-width: 1; }
.site.sel .hover-pad { fill: rgba(46, 144, 250, .2); stroke: #2E90FA; stroke-width: 1.6; }
.site:focus { outline: none; }
.pave { fill: #475467; stroke: #344054; stroke-width: .6; }
.form { fill: #F2F4F7; stroke: #98A2B3; stroke-width: .8; stroke-dasharray: 3 2; }
.site-road { opacity: .9; }
.site-tag { pointer-events: none; }
.site-tag rect { fill: rgba(255, 255, 255, .94); stroke: #D0D5DD; stroke-width: 1; }
.site-tag text { font-size: 10.5px; font-weight: 600; fill: #344054; }
.site-tag.busy rect { stroke: #84ADFF; }
.site-tag.sel rect { fill: #175CD3; stroke: #175CD3; }
.site-tag.sel text { fill: #fff; }
.site-tag .site-n { fill: #175CD3; stroke: none; }
.site-tag.sel .site-n { fill: #fff; }
.site-tag .site-n-t { fill: #fff; font-size: 9.5px; font-weight: 700; text-anchor: middle; }
.site-tag.sel .site-n-t { fill: #175CD3; }
/* Roads: click to select, round handles to drag */
.road-hit { fill: none; stroke: transparent; stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; cursor: pointer; }
.road-hit:hover { stroke: rgba(46, 144, 250, .12); }
.road-sel { fill: none; stroke: rgba(46, 144, 250, .28); stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.road-handle { fill: #fff; stroke: #2E90FA; stroke-width: 2.5; cursor: grab; }
.road-handle:hover { fill: #EFF8FF; stroke-width: 3.5; }
.road-handle.corner { stroke-dasharray: 3 2; }
.road-handle.hooked { fill: #2E90FA; stroke: #fff; }
.road-preview { fill: none; stroke: rgba(46, 144, 250, .55); stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.road-preview.rubber { stroke: rgba(46, 144, 250, .3); stroke-dasharray: 2 14; }
.ghost.ok .ghost-dot { fill: #17B26A; } .ghost.bad .ghost-dot { fill: #F04438; }

/* ---------------------------------------------------------------- menu round 4: lighter grey cards */
.proc .twin-panel > :not(.tp-head), .lib-rec .lib-card {
  --surface: #52525B; --subtle: #5E5E68; --line: #6B6B75; --line-strong: #7C7C86;
  --text: #FAFAFA; --text-2: #E4E4E7; --muted: #D4D4D8; --faint: #A1A1AA;
  background: #52525B;
}
/* Lists, inputs and rows inside a card: a step lighter than the card, not darker. */
.proc .twin-panel .proc-list, .proc .twin-panel .cf-input, .proc .twin-panel .twin-search,
.lib-rec .tp-props, .lib-rec .lib-stat { background: #5E5E68; border-color: #6B6B75; }
.proc .twin-panel .proc-row, .lib-rec .tp-row { border-color: #6B6B75; }
.proc .twin-panel .tp-action, .lib-rec .tp-conn, .lib-rec .lib-mapbtn { background: #63636D; }
.proc .twin-panel .tp-action:hover, .lib-rec .tp-conn:hover, .lib-rec .lib-mapbtn:hover { background: #71717B; }
.proc .twin-panel .tp-count, .lib-rec .lib-card .tp-count { background: #71717B; }
.proc .twin-panel .btn.quiet { background: #63636D; border-color: #7C7C86; color: #FAFAFA; }
.proc .twin-panel .btn.quiet:hover { background: #71717B; }
.lib-rec .tp-history li::before { box-shadow: 0 0 0 3px #52525B; }

/* ================================================================ Settings */
.settings { max-width: 860px; }
.settings-head { display: flex; flex-direction: column; gap: 4px; }
.settings-head h1 { font-size: 24px; letter-spacing: -0.01em; }
.settings-card { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.settings-card-head { display: flex; flex-direction: column; gap: 2px; }
.settings-card-head h2 { font-size: 16px; }
.theme-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.theme-opt { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); cursor: pointer; text-align: left; color: var(--text); }
.theme-opt:hover { border-color: var(--text-2); }
.theme-opt.on { border-color: #2E90FA; box-shadow: 0 0 0 3px rgba(46, 144, 250, .2); }
.theme-opt-t { display: flex; flex-direction: column; gap: 1px; }

/* Settings > Integrations: connected systems up top, then everything Acter can (or will) read from.
   Plain initials instead of other companies' logos; green only means "connected". */
.int-sec { display: flex; flex-direction: column; gap: 10px; }
.int-sec + .int-sec { padding-top: 18px; border-top: 1px solid var(--line); }
.int-sec-h { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.int-sec-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.int-search { width: 240px; max-width: 100%; height: 32px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit; font-size: 13px; background: var(--surface); color: var(--text); }
.int-search:focus { outline: none; border-color: var(--text); }
.int-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.int-cat { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; cursor: pointer; }
.int-cat:hover { border-color: var(--line-strong); color: var(--text); }
.int-cat.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.int-live-list { display: flex; flex-direction: column; gap: 8px; }
.int-live { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); }
.int-mark { flex: none; width: 36px; height: 36px; box-sizing: border-box; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); }
.int-mark.solid { background: var(--text); border-color: var(--text); color: var(--surface); }
.int-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.int-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.int-name strong { font-size: 14.5px; }
.int-pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--green-bg); color: var(--green);
  font-size: 11.5px; font-weight: 600; }
.int-dot { width: 7px; height: 7px; border-radius: 50%; background: #12B76A; display: inline-block; flex: none; }
.int-ro { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.int-reads { font-size: 12.5px; color: var(--muted); }
.int-detail { font-size: 12.5px; color: var(--text-2); }
.int-detail.bad { color: var(--red); }
.int-none { margin: 0; font-size: 13px; color: var(--muted); }
.int-group { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.int-group-h { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.int-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0;
  transition: border-color .15s; }
.int-tile:hover { border-color: var(--line-strong); }
.int-tile.on { border-color: var(--line-strong); background: var(--subtle); }
.int-tile-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.int-tile-top .int-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.int-tile-n { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-tile .int-reads { flex: 1 1 auto; line-height: 1.4; }
.int-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.int-soon { font-size: 11.5px; color: var(--faint); }
.int-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
.int-state.on { color: var(--green); }
.int-state.asked, .int-state.ready { color: var(--text-2); }
.int-tile[hidden], .int-group[hidden], .int-empty[hidden] { display: none; }
.int-empty { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .int-sec-top { flex-direction: column; align-items: stretch; } .int-search { width: 100%; } .int-live { flex-wrap: wrap; } }
.theme-opt-t strong { font-size: 14px; }
.theme-opt-t span { font-size: 12.5px; color: var(--muted); }
.theme-prev { display: flex; height: 110px; border-radius: 7px; overflow: hidden; border: 1px solid #D0D5DD; }
.theme-prev .tp-side { flex: 0 0 26%; }
.theme-prev .tp-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; padding: 10px; }
.theme-prev .tp-bar { height: 10px; width: 55%; border-radius: 3px; }
.theme-prev .tp-card { height: 26px; border-radius: 4px; }
.theme-prev .tp-card.short { width: 70%; }
.theme-prev.light .tp-side { background: #fff; border-right: 1px solid #EAECF0; }
.theme-prev.light .tp-main { background: #F3F4F6; }
.theme-prev.light .tp-bar { background: #101828; }
.theme-prev.light .tp-card { background: #fff; border: 1px solid #EAECF0; }
.theme-prev.dark { border-color: #2E2E2E; }
.theme-prev.dark .tp-side { background: #1A1A1A; border-right: 1px solid #2E2E2E; }
.theme-prev.dark .tp-main { background: #121212; }
.theme-prev.dark .tp-bar { background: #F5F5F5; }
.theme-prev.dark .tp-card { background: #1F1F1F; border: 1px solid #2E2E2E; }

/* ================================================================ dark map (the twin's ground) */
.map-theme { display: inline-flex; align-items: center; justify-content: center; }
.proc-canvas.map-dark { background: #161616; }
.map-dark .slab { fill: #262626; stroke: #343434; }
.map-dark .slab.yard { fill: #2B2823; }
.map-dark .slab.dirt { fill: #302B24; }
.map-dark .slab.lot { fill: #2E2E2E; stroke: #3D3D3D; }
.map-dark .lot-line { stroke: rgba(255, 255, 255, .22); }
.map-dark .loop-road { stroke: #323232; }
.map-dark .loop-dash { stroke: rgba(255, 255, 255, .35); }
.map-dark .loop-dash.live { stroke: #12B76A; }
.map-dark .branch-path { stroke: #5C5041; }
.map-dark .road { fill: #3D3D3D; }
.map-dark .iso-t { fill: #E5E5E5; stroke: #616161; }
.map-dark .iso-l { fill: #C8C8C8; stroke: #616161; }
.map-dark .iso-r { fill: #ADADAD; stroke: #616161; }
.map-dark .pshadow { opacity: .25; }
.map-dark .proc-hint { background: rgba(26, 26, 26, .88); color: #A3A3A3; }
.map-dark .proc-title, .map-dark .map-tools { background: #1F1F1F; color: #F5F5F5; }
.map-dark .proc-title h2, .map-dark .proc-title { color: #F5F5F5; border-color: #2E2E2E; }
.map-dark .map-tool { color: #D4D4D4; }
.map-dark .map-tool:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.map-dark .map-tool.on { background: #3D3D3D; color: #fff; }
.map-dark .site-tag rect { fill: rgba(31, 31, 31, .94); stroke: #3D3D3D; }
.map-dark .site-tag text { fill: #E5E5E5; }
.map-dark .zone-tag.branch rect { fill: #1F1F1F; stroke: #5C5041; }
.map-dark .zone-tag.branch text { fill: #D9CBB4; }
.map-dark .road-handle { fill: #1F1F1F; }
.map-dark .ghost-t { fill: #F5F5F5; }

/* ================================================================ dark app */
:root[data-theme="dark"] {
  --bg: #191919; --surface: #191919; --subtle: #202020; --line: #2E2E2E; --line-strong: #3D3D3D;
  --text: #F5F5F5; --text-2: #D4D4D4; --muted: #A3A3A3; --faint: #737373;
  --green-bg: #053321; --green: #75E0A7; --amber-bg: #4E1D09; --amber: #FEC84B;
  color-scheme: dark;
}
[data-theme="dark"] :focus-visible { outline-color: #84ADFF; }
[data-theme="dark"] .nav-item[aria-current="page"], [data-theme="dark"] .avatar.round, [data-theme="dark"] .menu button:hover,
[data-theme="dark"] .menu button[aria-checked="true"], [data-theme="dark"] .ppill, [data-theme="dark"] .proc-avatar,
[data-theme="dark"] .tp-count, [data-theme="dark"] .lib-pill, [data-theme="dark"] .lib-soon, [data-theme="dark"] .cf-type .soon { background: #2A2A2A; }
[data-theme="dark"] .icon-btn:hover { background: #2E2E2E; }
[data-theme="dark"] .mode-switch, [data-theme="dark"] .map-tools { background: #262626; }
[data-theme="dark"] .mode-btn.on, [data-theme="dark"] .map-tool.on { background: #3D3D3D; color: #fff; box-shadow: none; }
[data-theme="dark"] .map-tool:hover { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .btn.primary, [data-theme="dark"] .chip.on, [data-theme="dark"] .btn.quiet.on, [data-theme="dark"] .lib-chip.on,
[data-theme="dark"] .lib-nav .lib-group.on { background: #F5F5F5; color: #171717; border-color: #F5F5F5; }
[data-theme="dark"] .lib-nav .lib-group.on .lib-group-name { color: #171717; }
[data-theme="dark"] .lib-nav .lib-group.on .lib-count { color: #525252; }
[data-theme="dark"] .btn.primary:hover { background: #D4D4D4; }
[data-theme="dark"] .badge { background: #F5F5F5; color: #171717; }
[data-theme="dark"] .btn.danger { border-color: #912018; color: #FDA29B; }
[data-theme="dark"] .btn.danger:hover, [data-theme="dark"] .btn.danger.confirm { background: #55160C; }
[data-theme="dark"] .proc-title { background: rgba(26, 26, 26, .92); border-color: #2E2E2E; }
[data-theme="dark"] .proc-hint { background: rgba(26, 26, 26, .88); }
[data-theme="dark"] .lib-table tbody tr.sel { background: #102A56; }
[data-theme="dark"] .lib-nav .lib-group:hover { background: var(--surface); }
[data-theme="dark"] .pick-list { background: var(--surface); color: var(--text); border-color: var(--line); }
[data-theme="dark"] .pick-item:hover, [data-theme="dark"] .pick-item.on { background: #2A2A2A; }
[data-theme="dark"] .pick-item span { color: var(--muted); }
[data-theme="dark"] .theme-prev.light { border-color: #3D3D3D; }
[data-theme="dark"] .toast { background: #F5F5F5; color: #171717; }
[data-theme="dark"] .toast.bad { background: #FDA29B; color: #55160C; }
/* Side menus on the map and in Records: a dark shell, the cards a step lighter. */
[data-theme="dark"] .proc .twin-panel, [data-theme="dark"] .lib .twin-panel.lib-rec {
  --surface: #1A1A1A; --subtle: #222222; --line: #2E2E2E; --line-strong: #3D3D3D;
  --text: #F5F5F5; --text-2: #D4D4D4; --muted: #A3A3A3; --faint: #737373;
  background: #1A1A1A; border-color: #2E2E2E; box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .proc .twin-panel > :not(.tp-head), [data-theme="dark"] .lib-rec .lib-card { background: #2D2D2D; }
[data-theme="dark"] .proc .twin-panel .proc-list, [data-theme="dark"] .proc .twin-panel .cf-input, [data-theme="dark"] .proc .twin-panel .twin-search,
[data-theme="dark"] .lib-rec .tp-props, [data-theme="dark"] .lib-rec .lib-stat { background: #363636; border-color: #424242; }
[data-theme="dark"] .proc .twin-panel .tp-head .btn, [data-theme="dark"] .proc .twin-panel .tp-head .cf-input, [data-theme="dark"] .lib-back {
  background: #262626; color: #F5F5F5; border-color: #3D3D3D; }
[data-theme="dark"] .proc .twin-panel .tp-head .link-btn { color: #84ADFF; }
[data-theme="dark"] .proc .twin-panel .tp-head .link-btn:hover, [data-theme="dark"] .proc .twin-panel .tp-head .icon-btn:hover,
[data-theme="dark"] .lib .twin-panel.lib-rec .icon-btn:hover { background: #2E2E2E; color: #fff; }
[data-theme="dark"] .proc .twin-panel > p { color: #A3A3A3; }
[data-theme="dark"] .cf { background: var(--surface); color: var(--text); }
/* dark app: logo, avatar, map name tags, menu boxes */
[data-theme="dark"] .logo-ink { stroke: #F5F5F5; }
[data-theme="dark"] .logo-dot { fill: #F5F5F5; }
[data-theme="dark"] .avatar.round { background: #2E2E2E; color: #F5F5F5; }
[data-theme="dark"] .plabel-box { fill: #1F1F1F; stroke: #3D3D3D; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
[data-theme="dark"] .plabel.sel .plabel-box { stroke: #84ADFF; }
[data-theme="dark"] .plabel-div { stroke: #2E2E2E; }
[data-theme="dark"] .plabel-row:hover .plabel-hit { fill: rgba(255, 255, 255, .05); }
[data-theme="dark"] .pcrew rect, [data-theme="dark"] .plabel.issue .plabel-row:not(.issue) .pcrew rect { fill: #2E2E2E; }
[data-theme="dark"] .plabel.issue .plabel-box { fill: #2A1412; }
[data-theme="dark"] .plabel.issue .plabel-t, [data-theme="dark"] .plabel.issue .plabel-n { fill: #FDA29B; }
[data-theme="dark"] .proc .twin-panel > :not(.tp-head), [data-theme="dark"] .lib-rec .lib-card {
  --surface: #2D2D2D; --subtle: #363636; --line: #424242; --line-strong: #4D4D4D; }
[data-theme="dark"] .proc .twin-panel .tp-action, [data-theme="dark"] .lib-rec .tp-conn, [data-theme="dark"] .lib-rec .lib-mapbtn,
[data-theme="dark"] .proc .twin-panel .btn.quiet { background: #363636; border-color: #4D4D4D; }
[data-theme="dark"] .proc .twin-panel .tp-action:hover, [data-theme="dark"] .lib-rec .tp-conn:hover, [data-theme="dark"] .lib-rec .lib-mapbtn:hover,
[data-theme="dark"] .proc .twin-panel .btn.quiet:hover { background: #424242; }
[data-theme="dark"] .proc .twin-panel .tp-count, [data-theme="dark"] .lib-rec .lib-card .tp-count { background: #424242; }
[data-theme="dark"] .lib-rec .tp-history li::before { box-shadow: 0 0 0 3px #2D2D2D; }
[data-theme="dark"] .avatar, [data-theme="dark"] .acct-logo { color: #171717; }
[data-theme="dark"] .acct-avatar { background: #2E2E2E; color: #F5F5F5; }
/* dark app: page and cards #191919, every popup (dialogs, menus, dropdowns, Ask boxes, tooltips) one step lighter at #252525. */
[data-theme="dark"] .pop,
[data-theme="dark"] .cf,
[data-theme="dark"] .menu,
[data-theme="dark"] .acct-menu,
[data-theme="dark"] .ui-dd-panel,
[data-theme="dark"] .pick-list,
[data-theme="dark"] .pjob-results,
[data-theme="dark"] .gen-at,
[data-theme="dark"] .sv-help,
[data-theme="dark"] .vw-pop,
[data-theme="dark"] .kp-tip,
[data-theme="dark"] .au-pop,
[data-theme="dark"] .au-inline-approve,
[data-theme="dark"] .cr-pop,
[data-theme="dark"] .wb-sugg,
[data-theme="dark"] .hq-menu {
  --surface: #252525; --subtle: #2E2E2E; --line: #363636; --line-strong: #444444;
  background: #252525; border-color: #363636; }
[data-theme="dark"] .vw-pop::after { background: #252525; }
[data-theme="dark"] .menu button:hover, [data-theme="dark"] .menu button[aria-checked="true"],
[data-theme="dark"] .pick-item:hover, [data-theme="dark"] .pick-item.on { background: #333333; }
[data-theme="dark"] .proc .twin-panel, [data-theme="dark"] .lib .twin-panel.lib-rec { --surface: #191919; background: #191919; }

/* ================================================================ Field view (the real map) */
.field-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 100%; }
.field-tools .twin-search { width: 260px; }
.field-layers { display: inline-flex; gap: 12px; padding: 0 6px; }
.field-layer { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.field-map { position: relative; flex: 1 1 auto; min-height: 560px; height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #E4E7EC; }
/* Mapbox's stylesheet loads after ours and sets .mapboxgl-map { position: relative }, which would collapse the map to 0px tall. */
.field-map > .field-map-inner { position: absolute; inset: 0; width: 100%; height: 100%; }
.field-map.loading-map, .field-map.setup { display: flex; align-items: center; justify-content: center; }
.field-setup { max-width: 420px; padding: 22px 24px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.field-setup .meta { margin: 0; }
.field-map.placing .mapboxgl-canvas-container { cursor: crosshair; }
.field-legend { position: absolute; left: 12px; bottom: 36px; z-index: 2; display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 10px; border-radius: 6px;
  background: rgba(255, 255, 255, .92); font-size: 12px; color: #344054; pointer-events: none; }
.field-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.field-legend .lg-b { background: #D0D5DD; border: 1px solid #667085; }
.field-legend .lg-s { background: #2E90FA; border-radius: 50%; }
.field-legend .lg-r { background: #2E90FA; height: 3px; width: 14px; vertical-align: 3px; }
.field-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid #D0D5DD;
  background: #fff; color: #101828; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(16, 24, 40, .18); }
.field-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: #98A2B3; }
.field-tag .dot.ok { background: #12B76A; } .field-tag .dot.watch { background: #F79009; } .field-tag .dot.problem { background: #F04438; }
.field-tag.problem { border-color: #F04438; color: #B42318; }
.field-tag.sel { border-color: #175CD3; box-shadow: 0 0 0 3px rgba(46, 144, 250, .35); }
.field-crew { font-size: 11px; color: #667085; font-weight: 600; }
.field-site { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 4px; border-radius: 11px; border: 1px solid #84ADFF;
  background: rgba(255, 255, 255, .95); color: #1849A9; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.field-site .pin { width: 12px; height: 12px; border-radius: 50%; background: #2E90FA; border: 2px solid #fff; box-shadow: 0 0 0 1px #2E90FA; }
.field-site .n { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #175CD3; color: #fff; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; }
.field-site.sel { background: #175CD3; color: #fff; border-color: #175CD3; }
.field-truck { display: inline-flex; flex-direction: column; align-items: center; border: 0; padding: 0; background: none; cursor: pointer; }
.field-truck svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.field-truck .lbl { margin-top: 2px; padding: 0 5px; border-radius: 8px; background: #101828; color: #fff; font-size: 10px; font-weight: 700; }
.field-truck.sel svg { outline: 2px solid #2E90FA; outline-offset: 2px; border-radius: 3px; }
.field .twin-body { align-items: stretch; }
.field .build-kinds .build-kind { min-height: 40px; }
.field-map-inner.far .field-site .nm, .field-map-inner.far .field-truck .lbl, .field-map-inner.far .field-crew { display: none; }
.field-map-inner.far .field-site { padding: 0 3px; }

/* ---------------------------------------------------------------- field view: the menu floats over the map */
.field-map > .twin-panel.field-float {
  position: absolute; top: 12px; right: 12px; z-index: 4; width: 360px; max-width: calc(100% - 24px); max-height: calc(100% - 150px);
  display: flex; flex-direction: column; gap: 10px; padding: 0; overflow-y: auto;
  background: transparent; border: 0; box-shadow: none; pointer-events: none;
}
.field-float > * { pointer-events: auto; flex: none; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .28); }
.field-float > .tp-head {
  --text: #FAFAFA; --text-2: #E4E4E7; --muted: #D4D4D8;
  background: #52525B; color: #FAFAFA; padding: 12px 14px;
}
.field-float > .tp-head .icon-btn { color: #E4E4E7; }
.field-float > .tp-head .icon-btn:hover { background: #6B6B75; color: #fff; }
.fence-range { width: 100%; accent-color: #2E90FA; }
.fence-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fence-presets .btn.on { background: #2E90FA; border-color: #2E90FA; color: #fff; }
/* While placing a building or drawing a geofence, clicks go through pins and labels to the map. */
.field-map.placing .mapboxgl-marker, .field-map.placing .field-site, .field-map.placing .field-tag, .field-map.placing .field-truck { pointer-events: none; }
.fence-drawing { outline: 2px solid #F79009; outline-offset: -2px; }

/* ---------------------------------------------------------------- field view HUD: dark glass cards over the map */
.field .twin-bar { margin-bottom: 8px; }
.field-map { height: calc(100vh - 120px); min-height: 600px; }
.hud { position: absolute; z-index: 5; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-card {
  background: rgba(39, 39, 42, .86); color: #FAFAFA; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-top-left { top: 12px; left: 12px; width: 300px; max-width: calc(100% - 24px); }
.hud-top-center { top: 12px; left: 324px; }  /* beside the search / tools column, clear of the menu on the right */
.hud-bottom-right { right: 56px; bottom: 28px; }
.hud-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 5px; }
.hud-search-i { padding: 0 2px 0 8px; color: #A1A1AA; font-size: 16px; }
.hud-search { flex: 1 1 auto; min-width: 0; height: 32px; border: 0; background: transparent; color: #FAFAFA; font: inherit; font-size: 14px; outline: none; }
.hud-search::placeholder { color: #A1A1AA; }
.hud-chip {
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #E4E4E7;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.hud-chip:hover:not(:disabled) { background: rgba(255, 255, 255, .10); color: #fff; }
.hud-chip.on { background: #FAFAFA; color: #18181B; }
.hud-chip:disabled { opacity: .45; cursor: default; }
.hud-chip:focus-visible, .hud-stat:focus-visible, .hud-layers-head:focus-visible { outline: 2px solid #84ADFF; outline-offset: 1px; }
.hud-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .16); margin: 0 4px; }

.hud-layers-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: #FAFAFA;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; border-radius: 12px; }
.hud-count { font-weight: 600; color: #A1A1AA; font-size: 12px; }
.hud-caret { margin-left: auto; color: #A1A1AA; }
.hud-layer-list { display: flex; flex-direction: column; padding: 0 6px 8px; }
.hud-switch { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; font-size: 13px; color: #E4E4E7; cursor: pointer; }
.hud-switch:hover { background: rgba(255, 255, 255, .06); }
.hud-switch input { position: absolute; opacity: 0; pointer-events: none; }
.hud-knob { position: relative; flex: none; width: 30px; height: 18px; border-radius: 9px; background: #52525B; transition: background .15s; }
.hud-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.hud-switch input:checked + .hud-knob { background: #2E90FA; }
.hud-switch input:checked + .hud-knob::after { transform: translateX(12px); }
.hud-switch input:focus-visible + .hud-knob { outline: 2px solid #84ADFF; outline-offset: 2px; }

.hud-stats { display: flex; align-items: stretch; padding: 4px; }
.hud-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 14px; border: 0; background: transparent; color: #FAFAFA;
  border-radius: 8px; font: inherit; cursor: pointer; text-align: left; }
.hud-stat + .hud-stat { border-left: 1px solid rgba(255, 255, 255, .08); border-radius: 0 8px 8px 0; }
.hud-stat:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.hud-stat:disabled { cursor: default; }
.hud-stat strong { font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hud-stat span { font-size: 11.5px; color: #A1A1AA; white-space: nowrap; }
.hud-stat.bad strong { color: #FDA29B; }
.hud-stat.ok strong { color: #75E0A7; }

.field-legend.hud-card { left: 12px; bottom: 36px; padding: 7px 12px; gap: 14px; font-size: 12px; color: #E4E4E7; background: rgba(39, 39, 42, .86); border-color: rgba(255, 255, 255, .08); }
.field-legend .lg-f { background: rgba(46, 144, 250, .25); border: 1.5px dashed #2E90FA; border-radius: 50%; }
.hud-tag { padding: 1px 7px; border-radius: 10px; background: rgba(253, 176, 34, .18); color: #FEC84B; font-weight: 600; }
.field .build-banner { top: 76px; }
.field-site.no-name .nm { display: none; }
.field-site.no-name { padding-right: 4px; }

@media (max-width: 1100px) {
  .hud-top-center { top: auto; bottom: 76px; left: 12px; }
  .hud-stat span { display: none; }
}

/* ---------------------------------------------------------------- field view HUD, round 2: buttons that look pressable */
.hud-search-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px; cursor: text; }
.hud-search-row:focus-within { border-color: #84ADFF; }
.hud-search-i { display: inline-flex; color: #A1A1AA; }
.hud-build { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.hud-cap { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #A1A1AA; padding: 0 2px; }
.hud-btns { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hud-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 8px; background: #3F3F46; color: #FAFAFA;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 2px 4px rgba(0, 0, 0, .35); transition: background .12s, transform .06s, border-color .12s;
}
.hud-btn:hover:not(:disabled) { background: #52525B; border-color: rgba(255, 255, 255, .38); }
.hud-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.hud-btn.primary { background: #2E90FA; border-color: #53B1FD; color: #fff; }
.hud-btn.primary:hover:not(:disabled) { background: #1570EF; border-color: #84CAFF; }
.hud-btn.on { background: #FAFAFA; border-color: #FAFAFA; color: #18181B; box-shadow: 0 0 0 3px rgba(132, 173, 255, .55); }
.hud-btn.wide { width: 100%; }
.hud-btn:disabled { opacity: .5; cursor: default; }
.hud-btn:focus-visible { outline: 2px solid #84ADFF; outline-offset: 2px; }
.hud-badge { position: absolute; top: -7px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #F79009; color: #18181B;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; pointer-events: none; }
.hud-layers-head svg { color: #A1A1AA; }
.hud-layers-head:hover { background: rgba(255, 255, 255, .06); }
.hud-caret { display: inline-flex; transition: transform .15s; }
.hud-caret.open { transform: rotate(90deg); }
.hud-go { display: inline-flex; margin-left: 3px; vertical-align: -1px; opacity: .6; }
.hud-stat:hover:not(:disabled) .hud-go { opacity: 1; }
.hud-view { display: flex; align-items: center; gap: 8px; padding: 6px; }
.hud-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .10); }
.hud-seg-opt { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #D4D4D8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.hud-seg-opt:hover:not(.on) { background: rgba(255, 255, 255, .10); color: #fff; }
.hud-seg-opt.on { background: #FAFAFA; color: #18181B; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); cursor: default; }
.hud-seg-opt:focus-visible { outline: 2px solid #84ADFF; outline-offset: 1px; }

/* Build buttons never spill out of their card: equal columns that can shrink, long labels end in "…". */
.hud-btns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hud-btn { min-width: 0; overflow: hidden; }
.hud-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-btn > svg { flex: none; }
.hud-top-left { width: 320px; }
.hud-top-center { left: 344px; }
/* The numbers strip moves down to sit above the legend when there isn't room for it beside the tools
   (and the menu, when one is open), so cards never cover each other. */
.field-map { container-type: inline-size; container-name: fieldmap; }
@container fieldmap (max-width: 860px) {
  .hud-top-center { top: auto; bottom: 84px; left: 12px; }
}
@container fieldmap (max-width: 1240px) {
  .field-map:has(.field-float) .hud-top-center { top: auto; bottom: 84px; left: 12px; }
}
/* Everything drawn on the map (pins, names, trucks) stays underneath the HUD cards. */
.field-map > .field-map-inner { z-index: 0; isolation: isolate; }
.field-legend.hud-card { z-index: 5; }
.hud-top-left { width: 340px; }
.hud-top-center { left: 364px; }
.hud-btn { padding: 0 10px; gap: 6px; }

/* ---------------------------------------------------------------- field view page: the same dark grey as the HUD cards (the map itself is unchanged) */
.content:has(> main.field) { background: #27272A; }
main.twin.field { background: #27272A; color: #FAFAFA; min-height: 100vh; }
main.field .twin-title h1 { color: #FAFAFA; }
main.field .twin-title .meta, main.field > .meta { color: #A1A1AA; }
main.field .field-map { border-color: rgba(255, 255, 255, .10); }

/* ---------------------------------------------------------------- field view editor: tool rail, options bar, status bar, popovers */
.ed-rail { position: absolute; top: 12px; left: 12px; z-index: 6; display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.rail-btn { position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: #D4D4D8; cursor: pointer; }
.rail-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .10); color: #fff; }
.rail-btn.on { background: #2E90FA; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset; }
.rail-btn:disabled { opacity: .35; cursor: default; }
.rail-btn:focus-visible { outline: 2px solid #84ADFF; outline-offset: 1px; }
.rail-btn[data-tip]:hover::after, .rail-btn[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 20;
  padding: 5px 9px; border-radius: 6px; background: #18181B; color: #FAFAFA; font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35); pointer-events: none;
}
.rail-sep { height: 1px; margin: 4px 6px; background: rgba(255, 255, 255, .14); }

.ed-options { position: absolute; top: 12px; left: 76px; right: 12px; z-index: 6; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 14px; }
.field-map:has(.field-float) .ed-options { right: 384px; }
.ed-tool-name { flex: none; font-size: 13px; font-weight: 700; color: #FAFAFA; white-space: nowrap; }
.ed-vsep { flex: none; width: 1px; height: 24px; background: rgba(255, 255, 255, .14); }
.ed-opts { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ed-hint { font-size: 12.5px; color: #A1A1AA; }
.ed-btn { height: 30px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 7px; background: #3F3F46; color: #FAFAFA;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.ed-btn:hover:not(:disabled) { background: #52525B; border-color: rgba(255, 255, 255, .38); }
.ed-btn.primary { background: #2E90FA; border-color: #53B1FD; color: #fff; }
.ed-btn.primary:hover:not(:disabled) { background: #1570EF; }
.ed-btn:disabled { opacity: .45; cursor: default; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-chip { height: 28px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; background: transparent; color: #E4E4E7;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ed-chip:hover:not(.on) { background: rgba(255, 255, 255, .10); }
.ed-chip.on { background: #FAFAFA; border-color: #FAFAFA; color: #18181B; }
.ed-input { height: 30px; width: 180px; max-width: 100%; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 7px;
  background: rgba(0, 0, 0, .35); color: #FAFAFA; font: inherit; font-size: 13px; }
.ed-input:focus { outline: none; border-color: #84ADFF; }
.ed-input option { color: #18181B; }
.ed-count { font-size: 12.5px; font-weight: 600; color: #D4D4D8; white-space: nowrap; }
.ed-measure { font-size: 16px; color: #fff; font-variant-numeric: tabular-nums; }
.ed-search { flex: none; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px;
  background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .14); color: #A1A1AA; cursor: text; }
.ed-search:focus-within { border-color: #84ADFF; }
.ed-search input { width: 160px; border: 0; background: transparent; color: #FAFAFA; font: inherit; font-size: 13px; outline: none; }
.ed-search input::placeholder { color: #A1A1AA; }

.ed-status { position: absolute; left: 12px; right: 56px; bottom: 34px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 4px 6px; overflow: hidden; }
.ed-stat { display: inline-flex; align-items: baseline; gap: 5px; flex: none; padding: 5px 10px; border: 0; border-radius: 7px; background: transparent;
  color: #FAFAFA; font: inherit; cursor: pointer; white-space: nowrap; }
.ed-stat:hover:not(:disabled) { background: rgba(255, 255, 255, .10); }
.ed-stat:disabled { cursor: default; }
.ed-stat strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.ed-stat span { font-size: 12px; color: #A1A1AA; }
.ed-stat.bad strong { color: #FDA29B; }
.ed-stat.ok strong { color: #75E0A7; }
.ed-grow { flex: 1 1 auto; min-width: 0; }
.ed-coord { flex: none; padding: 0 8px; font-size: 12px; color: #A1A1AA; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ed-status .hud-seg { flex: none; }

.ed-pop { position: absolute; top: 76px; left: 76px; z-index: 7; width: 290px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.ed-help { width: 360px; }
.ed-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 8px; font-size: 13px; }
.ed-pop-head .icon-btn { color: #D4D4D8; }
.ed-swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.ed-swatch.lg-b { background: #D0D5DD; border: 1px solid #667085; }
.ed-swatch.lg-s { background: #2E90FA; border-radius: 50%; }
.ed-swatch.lg-f { background: rgba(46, 144, 250, .25); border: 1.5px dashed #2E90FA; border-radius: 50%; }
.ed-swatch.lg-r { height: 3px; background: #2E90FA; border-radius: 2px; }
.ed-swatch.lg-t { background: #FDB022; border: 1px solid #101828; }
.ed-note { align-self: flex-start; margin: 6px 6px 0; }
.ed-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; padding: 0 6px 4px; font-size: 13px; color: #E4E4E7; }
.ed-keys dt { margin: 0; }
.ed-keys dd { margin: 0; align-self: center; }
.ed-keys kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .22); border-bottom-width: 2px;
  background: #3F3F46; color: #FAFAFA; font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
.field-map.dragging, .field-map.dragging * { cursor: grabbing !important; }
.field-map > .twin-panel.field-float { max-height: calc(100% - 104px); }
/* Popovers open beside the rail, above the status bar, so a tall (wrapped) options bar never covers them. */
.ed-pop { top: auto; bottom: 92px; max-height: calc(100% - 180px); overflow-y: auto; }
.ed-rail { z-index: 8; }  /* its tooltips show over the options bar */
.ed-kind { width: 190px; }
.rail-btn.on, .rail-btn.on:hover:not(:disabled) { background: #2E90FA; color: #fff; }

/* Live scale house: a truck is on the scale right now (pushed from the scale software).
   The light follows the pad: a bloom around its edge, a glowing rim, ripples in the pad's shape,
   a lit deck, a column of light through the truck, and a live strip in the scale house's label. */
.station.on-scale .ring { display: none; }
.onscale-glow, .onscale-beam, .onscale-rim, .onscale-deck { pointer-events: none; }
.onscale-bloom { fill: #32D583; opacity: .55; filter: url(#scale-bloom); animation: scale-breathe 2.4s ease-in-out infinite; }
.onscale-rim { fill: rgba(50, 213, 131, .10); stroke: #12B76A; stroke-width: 2.2; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(50, 213, 131, .9)) drop-shadow(0 0 10px rgba(50, 213, 131, .6));
  animation: scale-rim 2.4s ease-in-out infinite; }
.onscale-ping { fill: none; stroke: #32D583; stroke-width: 2; stroke-linejoin: round; transform-box: fill-box; transform-origin: center;
  animation: scale-ripple 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.onscale-ping.late { animation-delay: 1.2s; }
.onscale-deck { fill: rgba(50, 213, 131, .38); stroke: #32D583; stroke-width: 1.2; animation: scale-breathe 1.2s ease-in-out infinite; }
.onscale-beam-side { fill: url(#scale-beam-grad); }
.onscale-beam { mix-blend-mode: screen; animation: scale-breathe 2.4s ease-in-out infinite; }
/* The label grows a live strip: the truck on the scale, and how it was identified. */
.plabel.live .plabel-box { stroke: #12B76A; stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(50, 213, 131, .55)) drop-shadow(0 4px 10px rgba(6, 118, 71, .22)); }
.plabel-live { cursor: pointer; animation: scale-strip-in .35s cubic-bezier(.2, .8, .3, 1.2) both; }
.plabel-live-bg { fill: #ECFDF3; stroke: #ABEFC6; stroke-width: .8; }
.plabel-live-dot { fill: #12B76A; }
.plabel-live-ring { fill: none; stroke: #12B76A; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: scale-ping 1.6s ease-out infinite; }
.plabel-live-t { fill: #053321; font: 700 12.5px/1 Inter, system-ui, -apple-system, sans-serif; }
.plabel-live-s { fill: #067647; font: 500 10.5px/1 Inter, system-ui, -apple-system, sans-serif; }
[data-theme="dark"] .plabel-live-bg, .map-dark .plabel-live-bg { fill: rgba(50, 213, 131, .12); stroke: rgba(50, 213, 131, .35); }
[data-theme="dark"] .plabel-live-t, .map-dark .plabel-live-t { fill: #D1FADF; }
[data-theme="dark"] .plabel-live-s, .map-dark .plabel-live-s { fill: #75E0A7; }
@keyframes scale-ping { from { transform: scale(.85); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
@keyframes scale-ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.32); opacity: 0; } }
@keyframes scale-breathe { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes scale-rim { 0%, 100% { stroke-opacity: .75; } 50% { stroke-opacity: 1; } }
@keyframes scale-strip-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .onscale-bloom, .onscale-rim, .onscale-deck, .onscale-beam, .plabel-live, .plabel-live-ring { animation: none; }
  .onscale-ping { display: none; }
}

/* ---------------------------------------------------------------- detailed scale house */
.ramp { fill: #D9DCE1; stroke: #B9BEC7; stroke-width: .5; }
.stop-bar { fill: #FFFFFF; stroke: #D0D5DD; stroke-width: .3; }
.deck-t { fill: #7C8597; stroke: #4B5565; stroke-width: .6; stroke-linejoin: round; }
.deck-l { fill: #5D6B82; stroke: #4B5565; stroke-width: .5; }
.deck-r { fill: #4B5565; stroke: #364152; stroke-width: .5; }
.deck-seam { stroke: #5D6B82; stroke-width: .8; }
.rail-t { fill: #FDB022; stroke: #B54708; stroke-width: .4; }
.rail-l { fill: #F79009; stroke: #B54708; stroke-width: .4; }
.rail-r { fill: #DC6803; stroke: #B54708; stroke-width: .4; }
.bollard-cyl { fill: #FDB022; stroke: #B54708; stroke-width: .5; }
.bollard-t { fill: #FEC84B; stroke: #B54708; stroke-width: .5; }
.pole { stroke: #667085; stroke-width: 1.6; stroke-linecap: round; }
.pier { stroke: #98A2B3; stroke-width: 3; }
.reader-t { fill: #344054; stroke: #101828; stroke-width: .4; }
.reader-l { fill: #1D2939; stroke: #101828; stroke-width: .4; }
.reader-r { fill: #101828; stroke: #101828; stroke-width: .4; }
.reader-led { fill: #F79009; }
.reader-led.on { fill: #32D583; filter: drop-shadow(0 0 3px #32D583); }
.sig { fill: #344054; }
.sig.red.on { fill: #F04438; filter: drop-shadow(0 0 3px #F04438); }
.sig.green.on { fill: #32D583; filter: drop-shadow(0 0 4px #32D583); }
.mullion { stroke: #7A8599; stroke-width: 1; }
.step-t { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .4; }
.step-l { fill: #B9C0CB; stroke: #98A2B3; stroke-width: .4; }
.step-r { fill: #A4ACB9; stroke: #98A2B3; stroke-width: .4; }
.roof-t { fill: #F2F4F7; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.roof-l { fill: #98A2B3; stroke: #667085; stroke-width: .5; }
.roof-r { fill: #7A8599; stroke: #667085; stroke-width: .5; }
.ac-fan { fill: #475467; stroke: #344054; stroke-width: .4; }
.map-dark .ramp { fill: #323232; stroke: #3D3D3D; }
.map-dark .stop-bar { fill: #C8C8C8; }
.map-dark .roof-t { fill: #D4D4D4; }

/* ---------------------------------------------------------------- detailed trucks, mixer and loader */
.vehd-t { fill: #F79009; stroke: #B54708; stroke-width: .4; }
.vehd-l { fill: #DC6803; stroke: #B54708; stroke-width: .4; }
.vehd-r { fill: #B54708; stroke: #93370D; stroke-width: .4; }
.chrome-t { fill: #F2F4F7; stroke: #667085; stroke-width: .4; }
.chrome-l { fill: #D0D5DD; stroke: #667085; stroke-width: .4; }
.chrome-r { fill: #98A2B3; stroke: #667085; stroke-width: .4; }
.chrome-end { fill: #E4E7EC; stroke: #667085; stroke-width: .4; }
.amber-t, .amber-l, .amber-r { fill: #FEC84B; stroke: #DC6803; stroke-width: .4; }
.grille-t, .grille-l, .grille-r { fill: #344054; stroke: #101828; stroke-width: .4; }
.steelb-t, .steelb-l, .steelb-r { fill: #98A2B3; stroke: #344054; stroke-width: .3; }
.mix-end { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.mixband-t { fill: #FDB022; stroke: #B54708; stroke-width: .4; }
.mixband-l { fill: #F79009; stroke: #B54708; stroke-width: .4; }
.mixband-r { fill: #DC6803; stroke: #B54708; stroke-width: .4; }
.mixband-end { display: none; }  /* a painted band, not a disc */
.ladder { stroke: #98A2B3; stroke-width: 1; }
.chute { stroke: #667085; stroke-width: 3; stroke-linecap: round; }
.ram { stroke: #D0D5DD; stroke-width: 1.6; stroke-linecap: round; }
.rim { fill: #98A2B3; stroke: #475467; stroke-width: .4; }
.hubcap { fill: #E4E7EC; stroke: #667085; stroke-width: .3; }
.wheelset .hub { fill: #667085; }

.tp-live { margin-left: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #067647;
  background: rgba(18, 183, 106, .14); padding: 2px 6px; border-radius: 999px; vertical-align: 1px; }
[data-theme="dark"] .tp-live { color: #75E0A7; background: rgba(117, 224, 167, .14); }
.scale-now { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.scale-now div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scale-now-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #12B76A; flex: none;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, .2); }
.scale-tix { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.scale-tix-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; text-align: left; padding: 8px 10px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.scale-tix-row:hover:not(:disabled) { border-color: currentColor; }
.scale-tix-row:disabled { cursor: default; opacity: .85; }
.scale-tix-no { font-weight: 600; font-variant-numeric: tabular-nums; grid-row: span 2; }
.scale-tix-t { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scale-tix-s { font-size: 12px; opacity: .75; }
.scale-tix-row.void .scale-tix-no, .scale-tix-row.void .scale-tix-t { text-decoration: line-through; opacity: .7; }

/* ---------------------------------------------------------------- Records makeover: one search for everything,
   group icons, a home with tiles and recent changes, grouped results, and scale tickets shown as receipts. */
.lib-gsearch { flex: 1 1 380px; max-width: 560px; height: 40px; font-size: 14px; }
.lib-nav .lib-group-name .licon { flex: none; color: var(--muted); }
.lib-nav .lib-group.on .lib-group-name .licon { color: #A1A1AA; }
.lib-main-head { align-items: center; }
.lib-head-t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-head-i { flex: none; width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: #F2F4F7; color: #344054; }
.lib-head-r { display: flex; align-items: center; gap: 10px; }
.lib-filter { height: 32px; width: 220px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13px; background: var(--surface); color: var(--text); }
.lib-filter:focus-visible { outline: 2px solid #2E90FA; outline-offset: 0; border-color: transparent; }
/* Results, grouped */
.lib-results, .lib-home { flex: 1 1 auto; overflow: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.lib-rgroup { display: flex; flex-direction: column; gap: 2px; }
.lib-rgroup-h { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; }
.lib-rgroup-t { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.lib-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lib-hit:hover { background: var(--subtle); border-color: var(--line); }
.lib-hit.sel { background: #EFF8FF; border-color: #B2DDFF; }
.lib-hit:focus-visible { outline: 2px solid #2E90FA; outline-offset: -2px; }
.lib-hit-i { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #F2F4F7; color: #475467; }
.lib-hit-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lib-hit-t strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-hit-t .meta { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-hit mark { background: #FEF0C7; color: inherit; border-radius: 2px; padding: 0 1px; }
.lib-hit-v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lib-hit-when { flex: none; min-width: 74px; text-align: right; font-size: 12px; }
.lib-exact { flex: none; font-size: 11px; font-weight: 700; color: #067647; background: #ECFDF3; border-radius: 999px; padding: 2px 8px; }
/* Home: one card per group, in Acter's black and white. Red is the only color here, so anything that
   needs attention stands out. Cards differ by icon, name, count and the newest names in them. */
.lib-home { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); padding: 16px 16px 20px; gap: 18px; }
.lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.lib-tile { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; min-height: 204px; box-sizing: border-box;
  padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 14px; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: border-color .15s, box-shadow .15s, transform .15s; }
.lib-tile:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 28px -18px rgba(16, 24, 40, .45); }
.lib-tile:focus-visible { outline: 2px solid #2E90FA; outline-offset: 2px; }
.lib-tile.attn { border-color: #FDA29B; box-shadow: 0 0 0 1px #FEE4E2, 0 1px 2px rgba(16, 24, 40, .05); }
.lib-tile.attn:hover { border-color: #F97066; }
.lib-tile-top { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 16px; }
.lib-tile-i { flex: none; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: #18181B; color: #fff; }
.lib-tile-label { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-tile-attn { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: #D92D20; color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 2px 6px -2px rgba(217, 45, 32, .6); }
.lib-tile-n { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.lib-tile-latest { margin: 12px 0 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lib-tile-latest span { display: block; font-size: 12.5px; line-height: 1.45; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-tile-latest span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 8px 2px 1px; border-radius: 50%;
  background: var(--faint); vertical-align: middle; }
.lib-tile-about { margin: 12px 0 14px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.lib-tile-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); }
.lib-tile-src { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-tile-src b { color: #B42318; font-weight: 600; }
.lib-tile-go { flex: none; font-size: 15px; line-height: 1; color: var(--text); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.lib-tile:hover .lib-tile-go, .lib-tile:focus-visible .lib-tile-go { opacity: 1; transform: none; }
/* A group with nothing in it yet: drawn as an outline, so the full ones stand out. */
.lib-tile.empty { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--line-strong); }
.lib-tile.empty:hover { box-shadow: none; transform: none; border-color: var(--muted); }
.lib-tile.empty .lib-tile-i { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.lib-tile.empty .lib-tile-label { color: var(--text-2); }
.lib-tile.empty .lib-tile-n { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.lib-tile.empty .lib-tile-foot { border-top-style: dashed; }
/* Recently changed: its own card under the groups */
.lib-recent { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.lib-recent .lib-rgroup-h { padding: 0 8px 6px; }
/* A group's page header and a record's panel get the same black badge as its card. */
.lib-head-i[class*="g-"] { background: #18181B; color: #fff; }
.lib-rec-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-rec-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lib-rec-i { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #18181B; color: #fff; }
.lib-conn-i { flex: none; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #5A5A63; color: #F4F4F5; }
/* A scale ticket: a paper receipt in the record panel */
.rc { background: #FFFFFF; color: #101828; border-radius: 10px; padding: 16px 16px 14px; gap: 10px; display: flex; flex-direction: column;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.twin-panel .rc { border: 0; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-no { font: 700 18px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.01em; }
.rc-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; }
.rc-badge.good { background: #ECFDF3; color: #067647; } .rc-badge.bad { background: #FEF3F2; color: #B42318; }
.rc-when { font-size: 12.5px; color: #475467; margin-top: -6px; }
.rc-block { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-top: 1px dashed #D0D5DD; border-bottom: 1px dashed #D0D5DD; }
.rc-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.rc-line span { color: #667085; flex: none; }
.rc-line strong { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.rc-weights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rc-weights div { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 7px; background: #F9FAFB; }
.rc-weights span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #667085; }
.rc-weights strong { font-size: 13px; font-weight: 600; }
.rc-weights .net { background: #101828; }
.rc-weights .net span { color: #98A2B3; } .rc-weights .net strong { color: #FFFFFF; font-size: 15px; }
.rc-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 2px; }
.rc-total span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #667085; }
.rc-total strong { font-size: 20px; font-weight: 700; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-tag { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #F2F4F7; color: #344054; }
.rc-tag.good { background: #ECFDF3; color: #067647; } .rc-tag.bad { background: #FEF3F2; color: #B42318; }
.rc-void { margin: 0; font-size: 12.5px; color: #B42318; }
.rc.void .rc-no, .rc.void .rc-total strong { text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .6); }
[data-theme="dark"] .lib-head-i, [data-theme="dark"] .lib-hit-i { background: #2A2A2A; color: #D4D4D4; }
[data-theme="dark"] .lib-head-i[class*="g-"], [data-theme="dark"] .lib-tile-i, [data-theme="dark"] .lib-rec-i { background: #F5F5F5; color: #171717; }
[data-theme="dark"] .lib-tile.empty .lib-tile-i { background: transparent; color: var(--muted); }
[data-theme="dark"] .lib-tile { box-shadow: none; }
[data-theme="dark"] .lib-tile.attn { border-color: #B42318; box-shadow: 0 0 0 1px rgba(240, 68, 56, .25); }
[data-theme="dark"] .lib-tile-src b { color: #FDA29B; }
[data-theme="dark"] .lib-hit.sel { background: rgba(46, 144, 250, .12); border-color: rgba(46, 144, 250, .35); }
[data-theme="dark"] .lib-hit mark { background: rgba(253, 176, 34, .3); }
[data-theme="dark"] .lib-exact { background: rgba(50, 213, 131, .14); color: #75E0A7; }
@media (max-width: 900px) { .lib-head-r { flex-wrap: wrap; } .lib-filter { width: 100%; } .lib-hit-when { display: none; } }
/* The receipt stays paper-white inside the grey record cards. */
.lib-rec .lib-card.rc {
  --surface: #FFFFFF; --subtle: #F9FAFB; --line: #E4E7EC; --line-strong: #D0D5DD;
  --text: #101828; --text-2: #344054; --muted: #667085; --faint: #98A2B3;
  background: #FFFFFF; color: #101828; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.lib-rec .rc strong, .lib-rec .rc .rc-no { color: #101828; }
.lib-rec .rc .rc-weights .net strong { color: #FFFFFF; }

/* Bell next to the logo; turns red with a count when there are open alerts. Click opens the alerts popup. */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
/* three tools (Style, Search, Alerts) beside the name: 32px each so the bell keeps clear of the menu's edge (2026-11-30) */
.brand-tools { display: inline-flex; align-items: center; gap: 0; flex: none; }
.brand-row .brand { gap: 8px; padding: 0 4px; min-width: 0; }
.brand-row .brand-tools .bell, .brand-row .brand-tools .vw-tk-btn { width: 32px; height: 32px; }
/* the Style button's slot in the header, beside the bell (audit 2026-11-28 #13): views.css places it on the page by default */
.brand-row .vw-tk-btn { position: static; width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 6px; }
.brand-row .vw-tk-btn span { display: none; }
.bell { position: relative; width: 36px; height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.bell:hover { background: var(--subtle); color: var(--text); }
.bell.hot { color: var(--red); }
/* alert rules switched off in Logic: quiet lines under the alerts (audit 2026-11-28 #4) */
.al-off { list-style: none; margin: 4px 0 0; padding: 10px 2px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--muted); }
.al-off li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.al-off a { color: var(--text-2); font-weight: 600; }
.al-off a:hover { color: var(--text); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-bottom .nav { margin-bottom: 4px; }
.pop-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 50; display: flex; align-items: flex-start;
  justify-content: center; padding: 64px 16px 16px; }
.pop { width: min(640px, 100%); max-height: calc(100vh - 96px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .22); display: flex; flex-direction: column; overflow: hidden; }
.pop-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop-head h2 { margin: 0; font-size: 17px; margin-right: auto; }
.pop-body { overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; }

/* Account menu (sidebar bottom) and the Your account / Company dialogs */
.acct-wrap { position: relative; }
.acct-btn { width: 100%; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.acct-btn:hover { border-color: var(--line-strong); }
.acct-btn .acct-co { flex: 1 1 auto; min-width: 0; }
.acct-btn > svg { flex: none; color: var(--muted); }
.acct-img { display: block; width: auto; max-width: 64px; object-fit: contain; flex: none; }
.acct-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: 0 12px 32px -12px rgba(16, 24, 40, .28); display: flex; flex-direction: column; gap: 2px; }
.acct-menu button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.acct-menu button:hover { background: var(--subtle); }
.acct-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.acct-label { display: flex; align-items: center; gap: 6px; padding: 4px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.acct-menu button.acct-co-item { min-width: 0; }
.acct-menu button:disabled { opacity: .55; cursor: default; }
.acct-co-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-logo.hq { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.acct-tag { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: var(--subtle);
  color: var(--text-2); border: 1px solid var(--line); }
.acct-mini { width: 22px; display: inline-flex; justify-content: center; }
.acct-menu button.acct-hq { font-weight: 600; }
.acct-menu button.acct-hq > svg { flex: none; margin-left: auto; color: var(--muted); }
.acct-hq-ic { width: 22px; height: 22px; border-radius: 5px; flex: none; display: block; }
.acct-mini .acct-logo { width: 22px; height: 22px; font-size: 9px; }
.acct-avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.acct-avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.pop-narrow { width: min(520px, 100%); }
.pop-body.form { gap: 14px; }
.who-big { display: flex; align-items: center; gap: 12px; }
.who-big > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 4px 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.row-end { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.logo-row { display: flex; gap: 16px; align-items: flex-start; }
.logo-box { flex: none; width: 160px; height: 88px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; padding: 10px; box-sizing: border-box; font-size: 12px; color: var(--faint); }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.logo-acts { display: flex; gap: 8px; margin-top: 6px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.fld input { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 14px; font-weight: 400;
  color: var(--text); background: var(--surface); }
.fld input:focus { outline: none; border-color: var(--text); }
.fld input:disabled { background: var(--subtle); color: var(--text-2); }
.fld-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fld-2, .logo-row { grid-template-columns: 1fr; flex-direction: column; } }

/* Generate: upload files into the request (attach button, chips) */
.gen-box { position: relative; }
.gen-box-foot .gen-fine { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-attach { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.gen-attach:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.gen-attach:disabled { opacity: .45; cursor: default; }
.gen-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.gen-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 4px 0 10px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); }
.gen-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.gen-chip button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.gen-chip button:hover { background: var(--line); color: var(--text); }
.gen-box.drag { border-color: var(--text); border-style: dashed; }

/* Generate: templates under the box. Paper-white previews so they read like the documents they make. */
.gen-tpls { width: 100%; margin-top: 18px; text-align: left; }
.gen-tpls.compact { margin-top: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gen-tpls-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.gen-tpls-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.gen-tpls-note { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--faint); }
.gen-tpls-hide { border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.gen-tpls-hide:hover { color: var(--text); background: var(--subtle); }
.gen-tpls-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.gen-tpls-toggle:hover { border-color: var(--line-strong); color: var(--text); }
.gen-tpls-n { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: var(--subtle); color: var(--muted);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.gen-tpls-using { color: var(--muted); font-weight: 400; }
.gen-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.gen-tpls.compact .gen-tpl-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.gen-tpl { position: relative; min-width: 0; }
.gen-tpl-main, .gen-tpl-new { width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; text-align: left; color: var(--text); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.gen-tpl-main:hover, .gen-tpl-new:hover { border-color: var(--line-strong); transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 22px -14px rgba(16, 24, 40, .3); }
.gen-tpl.on .gen-tpl-main { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.gen-tpl-p { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 17 / 22; margin-bottom: 6px; overflow: hidden;
  border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .08); }
.gen-tpls.compact .gen-tpl-p { aspect-ratio: 4 / 3; }
.gen-tpl-p.img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.gen-tpl-p.tile span { font-size: 11px; font-weight: 650; letter-spacing: .06em; color: #71717A; padding: 4px 8px; border: 1px solid #E4E4E7; border-radius: 5px; }
.gen-tpl-new .gen-tpl-p.plus { background: var(--subtle); box-shadow: none; border: 1.5px dashed var(--line-strong); box-sizing: border-box; color: var(--muted); }
.gen-tpl-new:hover .gen-tpl-p.plus, .gen-tpl-new.on .gen-tpl-p.plus { color: var(--text); border-color: var(--text); }
.gen-tpl-t { font-size: 13px; font-weight: 550; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.gen-tpl-m { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-tpl.on:not(.gen-tpl-new) .gen-tpl-m { color: var(--text); font-weight: 500; }
.gen-tpl-x { position: absolute; top: 13px; right: 13px; min-width: 24px; height: 24px; padding: 0 6px; box-sizing: border-box; border: 0; border-radius: 999px;
  background: rgba(24, 24, 27, .78); color: #fff; font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; opacity: 0; transition: opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; }
.gen-tpl:hover .gen-tpl-x, .gen-tpl-x:focus-visible, .gen-tpl-x.sure { opacity: 1; }
.gen-tpl-x.sure { background: var(--red); }
@media (hover: none) { .gen-tpl-x { opacity: 1; } }
/* A layout saved from Generate, drawn as a tiny page: title, then each part in order. */
.gen-tpl-p.sketch { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 5px; padding: 13% 12% 10%; box-sizing: border-box; }
.gen-tpls.compact .gen-tpl-p.sketch { padding: 9% 10%; gap: 4px; }
.gen-tpl-p.sketch i { display: block; flex: none; }
.sk-title { height: 6px; width: 62%; border-radius: 2px; background: #27272A; margin-bottom: 3px; }
.sk { width: 100%; border-radius: 1px; }
.sk-heading { height: 4px; width: 42%; background: #71717A; margin-top: 2px; }
.sk-paragraph { height: 12px; background: repeating-linear-gradient(to bottom, #D4D4D8 0 2px, transparent 2px 5px); }
.sk-fine_print { height: 7px; background: repeating-linear-gradient(to bottom, #E4E4E7 0 1.5px, transparent 1.5px 3.5px); }
.sk-bullets, .sk-steps { height: 12px; background: repeating-linear-gradient(to bottom, #D4D4D8 0 2px, transparent 2px 5px) 6px 0 / calc(100% - 6px) 100% no-repeat,
  repeating-linear-gradient(to bottom, #A1A1AA 0 2px, transparent 2px 5px) 0 0 / 3px 100% no-repeat; }
.sk-callout { height: 9px; border-radius: 2px; background: #F4F4F5; box-shadow: inset 0 0 0 1px #E4E4E7; }
.sk-metrics { height: 11px; background: linear-gradient(90deg, #EDEDEF 0 31%, transparent 31% 34.5%, #EDEDEF 34.5% 65.5%, transparent 65.5% 69%, #EDEDEF 69% 100%); }
.sk-table { height: 20px; box-sizing: border-box; border: 1px solid #D4D4D8; background: linear-gradient(#E4E4E7, #E4E4E7) top / 100% 5px no-repeat,
  repeating-linear-gradient(to bottom, transparent 0 4px, #EDEDEF 4px 5px); }
.sk-chart { height: 18px; box-sizing: border-box; border-bottom: 1px solid #D4D4D8;
  background: linear-gradient(#A1A1AA, #A1A1AA) 4% 100% / 13% 55% no-repeat, linear-gradient(#A1A1AA, #A1A1AA) 27% 100% / 13% 85% no-repeat,
    linear-gradient(#A1A1AA, #A1A1AA) 50% 100% / 13% 40% no-repeat, linear-gradient(#A1A1AA, #A1A1AA) 73% 100% / 13% 70% no-repeat,
    linear-gradient(#A1A1AA, #A1A1AA) 96% 100% / 13% 95% no-repeat; }
.sk-fields, .sk-columns { height: 12px; background: repeating-linear-gradient(to bottom, #D4D4D8 0 2px, transparent 2px 5px) 0 0 / 44% 100% no-repeat,
  repeating-linear-gradient(to bottom, #D4D4D8 0 2px, transparent 2px 5px) 100% 0 / 44% 100% no-repeat; }
.sk-columns { background: linear-gradient(#71717A, #71717A) 0 0 / 30% 2px no-repeat, linear-gradient(#71717A, #71717A) 72% 0 / 30% 2px no-repeat,
  repeating-linear-gradient(to bottom, transparent 0 4px, #D4D4D8 4px 6px, transparent 6px 8px) 0 0 / 44% 100% no-repeat,
  repeating-linear-gradient(to bottom, transparent 0 4px, #D4D4D8 4px 6px, transparent 6px 8px) 100% 0 / 44% 100% no-repeat; }
.sk-signature { height: 9px; margin-top: auto; background: linear-gradient(#71717A, #71717A) 0 100% / 42% 1px no-repeat, linear-gradient(#71717A, #71717A) 100% 100% / 42% 1px no-repeat; }

.gen-newtpl { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 10px 28px -18px rgba(16, 24, 40, .3); }
.gen-tpls.compact .gen-newtpl { box-shadow: none; background: var(--subtle); }
.gen-newtpl-file { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 10px;
  font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.gen-newtpl-file:hover, .gen-newtpl-file:focus-within { border-color: var(--text); color: var(--text); }
.gen-newtpl-file.has { border-style: solid; color: var(--text); font-weight: 500; }
.gen-newtpl-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gen-newtpl-name { height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.gen-newtpl-name:focus { outline: none; border-color: var(--text); }
.gen-newtpl-acts { display: flex; align-items: center; gap: 8px; }
.gen-newtpl-acts > span { flex: 1 1 auto; min-width: 0; }
.gen-act { white-space: nowrap; }
.gen-act.primary { background: var(--text); border-color: var(--text); color: var(--surface); }
.gen-act.primary:hover { opacity: .88; color: var(--surface); }
.gen-act:disabled { opacity: .5; cursor: default; }
.gen-act[aria-expanded="true"] { border-color: var(--text); color: var(--text); }
.gen-savetpl { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gen-savetpl-k { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.gen-savetpl input { flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 13.5px;
  background: var(--surface); color: var(--text); }
.gen-savetpl input:focus { outline: none; border-color: var(--text); }
@media (max-width: 640px) { .gen-savetpl { flex-wrap: wrap; } .gen-savetpl input { flex-basis: 100%; order: 2; } .gen-savetpl-k { flex-basis: 100%; } }
.gen-asked { display: flex; flex-direction: column; gap: 2px; }
.gen-asked > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-followed { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--faint); }

/* Document parts: label/value fields, From/To columns, totals, blanks to fill in, terms, signature lines */
.doc-fields { margin: 2px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
.doc-field { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 12px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid #F4F4F5; }
.doc-field dt { font-size: 12px; color: #71717A; }
.doc-field dd { margin: 0; font-size: 14px; color: #18181B; overflow-wrap: anywhere; }
.doc-cols { display: grid; gap: 28px; margin: 2px 0 4px; }
.doc-col { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: #3F3F46; min-width: 0; overflow-wrap: anywhere; }
.doc-col-t { font-size: 12px; font-weight: 600; color: #71717A; margin-bottom: 4px; }
.doc-col-1 { font-weight: 600; color: #18181B; }
.doc-totals { margin: 6px 0 0 auto; width: min(320px, 100%); display: flex; flex-direction: column; }
.doc-total { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 13.5px; }
.doc-total dt { color: #52525B; }
.doc-total dd { margin: 0; font-variant-numeric: tabular-nums; color: #18181B; }
.doc-total.last { border-top: 1px solid #18181B; margin-top: 2px; padding-top: 8px; font-weight: 650; }
.doc-total.last dt { color: #18181B; }
.doc-blank { position: relative; display: inline-block; min-width: 110px; height: 1.15em; border-bottom: 1px solid #A1A1AA; vertical-align: bottom; }
.doc-table .num .doc-blank { min-width: 70px; }
.doc-blank-tag { position: absolute; left: 0; bottom: 2px; font-size: 10.5px; font-weight: 600; color: #B45309; background: #FEF3C7;
  padding: 0 5px; border-radius: 4px; line-height: 1.5; white-space: nowrap; }
.doc-fine { margin: 6px 0 0; font-size: 11.5px; line-height: 1.55; color: #52525B; white-space: pre-line; }
.doc-sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin-top: 18px; }
.doc-sign-i { display: flex; flex-direction: column; gap: 6px; }
.doc-sign-line { display: block; height: 34px; border-bottom: 1px solid #18181B; }
.doc-sign-k { font-size: 12px; color: #52525B; }
@media (max-width: 700px) { .doc-fields, .doc-sign { grid-template-columns: 1fr; } .doc-cols { grid-template-columns: 1fr !important; } }
@media print {
  .doc-field, .doc-cols, .doc-totals, .doc-sign, .doc-fine { break-inside: avoid; }
  .doc-blank { border-bottom-color: #18181B; }
}

.cf-actions .lib-keep { margin-right: auto; }

/* Records > Documents: a preview of each document instead of an icon */
.lib-doc { align-items: center; }
.lib-thumb { flex: none; width: 54px; height: 70px; border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 10px -6px rgba(16, 24, 40, .18); display: block; }
.lib-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.lib-thumb.tile { position: relative; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 9px; box-sizing: border-box;
  background: var(--subtle); }
.lib-thumb.tile::before { content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px; background: var(--line);
  border-bottom-left-radius: 4px; }
.lib-thumb-ext { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }

/* ================================================================ Site: a jobsite in 3D at true scale
   A clay-grey stage with glassy controls floating over the model. */
.twin.site { gap: 12px; }
.s3d-stage { position: relative; flex: 1 1 auto; min-height: 480px; border-radius: 12px; overflow: hidden; background: #D3D3D1;
  border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.s3d-host { position: absolute; inset: 0; }
.s3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.s3d-canvas:active { cursor: grabbing; }
.s3d-loading { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #52525B; }
.s3d-tools, .s3d-progress { position: absolute; top: 14px; display: flex; gap: 6px; padding: 6px; border-radius: 12px;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(24, 24, 27, .08), 0 8px 24px -12px rgba(24, 24, 27, .35); }
.s3d-tools { left: 14px; }
.s3d-progress { right: 14px; flex-direction: column; gap: 8px; padding: 10px 12px; min-width: 250px; }
.s3d-chip { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #18181B; font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.s3d-chip:hover { background: rgba(24, 24, 27, .07); }
.s3d-chip:focus-visible { outline: 2px solid #2E90FA; outline-offset: 1px; }
.s3d-chip.dark { background: #18181B; color: #fff; }
.s3d-chip.dark:hover { background: #3F3F46; }
.s3d-chip:disabled { opacity: .5; cursor: default; }
.s3d-range { display: grid; grid-template-columns: 92px 1fr 54px; align-items: center; gap: 8px; font-size: 12px; color: #3F3F46; }
.s3d-range strong { font-size: 12px; font-weight: 650; color: #18181B; text-align: right; font-variant-numeric: tabular-nums; }
.s3d-range input { width: 100%; accent-color: #18181B; }
.s3d-progress-acts { display: flex; justify-content: space-between; gap: 6px; }
.s3d-hint, .s3d-name { position: absolute; bottom: 12px; margin: 0; font-size: 12px; color: #3F3F46; pointer-events: none; }
.s3d-hint { left: 16px; }
.s3d-name { right: 16px; display: flex; align-items: center; gap: 8px; }
.s3d-name strong { color: #18181B; font-weight: 650; }
.s3d-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: #18181B; color: #fff; }
.s3d-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line);
  background: radial-gradient(120% 90% at 50% 0%, #E7E7E5 0%, #D3D3D1 70%); }
.s3d-empty-card { max-width: 460px; margin: 24px; padding: 28px; border-radius: 16px; background: rgba(255, 255, 255, .8); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 0 0 1px rgba(24, 24, 27, .06), 0 18px 40px -20px rgba(24, 24, 27, .4); }
.s3d-empty-card h2 { margin: 4px 0 0; font-size: 19px; color: #18181B; }
.s3d-empty-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #3F3F46; }
.s3d-empty-card .meta { font-size: 12px; color: #71717A; }
.s3d-empty-i { width: 52px; height: 52px; border-radius: 14px; background: #18181B; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) {
  .s3d-progress { left: 14px; right: 14px; top: auto; bottom: 40px; min-width: 0; }
  .s3d-hint { display: none; }
}

/* ---------------------------------------------------------------- Records: documents' buttons never get cut off */
.lib-docs td.act { max-width: none; overflow: visible; }
.lib-doc-acts { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.btn.icon-only { width: 30px; min-width: 30px; padding: 0; }
.lib-docs td.lib-docjob-td { max-width: 220px; }
.lib-docjob { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.lib-docjob-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lib-docjob-pic { flex: none; width: 40px; height: 26px; object-fit: cover; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.lib-docjob-td .cf-input { min-width: 180px; height: 32px; }
/* jobs show their 3D jobsite: in the list, on their card, and on what's connected to them */
.lib-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lib-row-pic { flex: none; width: 52px; height: 32px; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px var(--line); background: #D3D3D1; }
.lib-site { display: flex; flex-direction: column; gap: 10px; }
.lib-site-pic { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: #D3D3D1; }
.lib-site-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 16 / 7; border-radius: 8px;
  background: rgba(255, 255, 255, .06); border: 1px dashed rgba(255, 255, 255, .25); font-size: 12.5px; color: #D4D4D8; }
.lib-conn-pic { flex: none; width: 34px; height: 22px; object-fit: cover; border-radius: 4px; background: #D3D3D1; }
.lib-bp-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--subtle); }
/* building the 3D jobsite from a blueprint */
.lib-bp-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0 8px; text-align: center; color: #18181B; }
.lib-bp-wait .gen-eye { margin-bottom: 6px; }
.lib-bp-list { display: flex; flex-direction: column; gap: 6px; }
.lib-bp-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.lib-bp-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.lib-bp-row.building .lib-bp-dot { background: #18181B; animation: s3d-pulse 1s ease-in-out infinite; }
.lib-bp-row.done .lib-bp-dot { background: #12B76A; }
.lib-bp-row.failed .lib-bp-dot { background: #D92D20; }
.lib-bp-row.failed .meta { color: #B42318; }
.lib-bp-row.placeholder .lib-bp-dot { background: #F79009; }
.lib-bp-row.placeholder .meta { color: #93370D; }
@keyframes s3d-pulse { 50% { opacity: .3; } }

/* ---------------------------------------------------------------- Site: parts, shortages, sizes */
.s3d-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: rgba(24, 24, 27, .12); }
.s3d-chip { display: inline-flex; align-items: center; gap: 6px; }
.s3d-chip.on { background: #18181B; color: #fff; }
.s3d-chip.on:hover { background: #3F3F46; }
.s3d-chip.bad { background: #D92D20; color: #fff; }
.s3d-chip.bad:hover { background: #B42318; }
.s3d-chip.risk { background: #FEE4E2; color: #B42318; }
.s3d-chip.risk:hover { background: #FECDCA; }
.s3d-bad { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #D92D20; color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.s3d-dim { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .88); color: #18181B;
  font-size: 12px; font-weight: 650; white-space: nowrap; pointer-events: none; box-shadow: 0 0 0 1px rgba(24, 24, 27, .08); font-variant-numeric: tabular-nums; }
.s3d-dim[hidden] { display: none; }
.s3d-parts { position: absolute; left: 14px; top: 62px; bottom: 56px; width: 300px; display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border-radius: 12px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 1px rgba(24, 24, 27, .08), 0 12px 30px -16px rgba(24, 24, 27, .4); color: #18181B; }
.s3d-parts-head { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.s3d-parts-head strong { font-size: 14px; }
.s3d-parts-head .meta { flex: 1 1 auto; }
.s3d-parts-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.s3d-part { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.s3d-part:hover { background: rgba(24, 24, 27, .06); }
.s3d-part.on { background: #EFF4FF; box-shadow: inset 0 0 0 1px #84ADFF; }
.s3d-part.short { background: #FEF3F2; }
.s3d-part.at_risk { background: #FFFBFA; }
.s3d-part-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.s3d-part-t strong { font-size: 13px; font-weight: 600; }
.s3d-part-t .meta { font-size: 11.5px; }
.s3d-tag.bad { background: #D92D20; color: #fff; }
.s3d-tag.risk { background: #FEE4E2; color: #B42318; }
.s3d-tag.built { background: #E4E4E7; color: #3F3F46; }
.s3d-tag.planned { background: transparent; color: #71717A; box-shadow: inset 0 0 0 1px #D4D4D8; }
.s3d-tag.dark { background: #18181B; color: #fff; }
.s3d-part-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px rgba(24, 24, 27, .08); }
.s3d-part-card.short { box-shadow: 0 0 0 1.5px #D92D20; }
.s3d-part-card.at_risk { box-shadow: 0 0 0 1.5px #F97066; }
.s3d-part-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s3d-part-top strong { font-size: 14px; }
.s3d-part-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: #3F3F46; }
.s3d-part-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.s3d-part-acts .s3d-chip { height: 28px; padding: 0 10px; background: #F4F4F5; }
.s3d-part-acts .s3d-chip.on, .s3d-part-acts .s3d-chip.bad { background: #18181B; color: #fff; }
.s3d-part-acts .s3d-chip.bad { background: #D92D20; }
.s3d-part-acts .s3d-chip.risk { background: #FEE4E2; color: #B42318; }
.s3d-flag { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid #F4F4F5; }
.s3d-flag .cf-input { height: 32px; font-size: 12.5px; }
.s3d-name { pointer-events: auto; flex-direction: column; align-items: flex-end; gap: 4px; padding: 8px 10px; border-radius: 10px; max-width: 46%;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 0 0 1px rgba(24, 24, 27, .08); text-align: right; }
.s3d-name-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.s3d-jobname { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #3F3F46; }
.s3d-job { height: 30px; font-size: 12.5px; min-width: 200px; }
.s3d-why { max-width: 420px; text-align: left; font-size: 12.5px; line-height: 1.5; color: #3F3F46; }
.s3d-why p { margin: 0 0 4px; color: #18181B; }
.s3d-why ul { margin: 0; padding-left: 18px; }
.s3d-stage.with-parts .s3d-hint { left: 330px; }
@media (max-width: 760px) { .s3d-parts { left: 8px; right: 8px; width: auto; top: auto; bottom: 120px; max-height: 50%; } }

/* documents: actions sit under the name, so the row always fits the panel */
.lib-docs td.lib-doc-td { max-width: 420px; white-space: normal; }
.lib-docs td.lib-doc-td strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-doc-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.lib-doc-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.lib-doc-link:hover { text-decoration-color: var(--text); }
.lib-doc-link:disabled { color: var(--muted); cursor: default; }

/* Alerts about jobsite parts: the same red as the parts on the 3D model */
.part-flag { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.part-flag.short { background: var(--red); color: #fff; }
.part-flag.risk { background: #FEE4E2; color: #B42318; }

/* Site: a house's framing progress names the stage it's at */
.s3d-stage-name { font-size: 12.5px; font-weight: 600; color: #18181B; padding-left: 100px; margin-top: -4px; }
@media (max-width: 700px) { .s3d-stage-name { padding-left: 0; } }

/* Site: a placeholder jobsite (the drawings couldn't be read yet) */
.s3d-tag.ph { background: #FFFAEB; color: #B54708; box-shadow: inset 0 0 0 1px #FEC84B; }
.s3d-ph-note { font-size: 12px; color: #93370D; max-width: 300px; text-align: right; }

/* Site: the site's size on its border can be changed by clicking it */
.s3d-dim.edit { pointer-events: auto; cursor: pointer; }
.s3d-dim.edit:hover, .s3d-dim.edit:focus-visible { background: #fff; box-shadow: 0 0 0 1.5px #18181B; outline: none; }
.s3d-dim-in { width: 64px; height: 22px; padding: 0 6px; border: 0; border-radius: 4px; background: #F4F4F5; font: inherit; font-weight: 650;
  color: #18181B; text-align: right; font-variant-numeric: tabular-nums; }
.s3d-dim-in:focus { outline: 2px solid #18181B; outline-offset: 1px; }

/* Site: a problem part's action. Who to call, what to tell them, the call, the purchase order. */
.s3d-part-spec { font-size: 11.5px; }
.s3d-act, .site-act { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin: 2px 0; border-radius: 8px; background: #FAFAFA;
  box-shadow: inset 0 0 0 1px #E4E4E7; }
.s3d-act-t, .site-act h3 { margin: 0; font-size: 12.5px; font-weight: 650; color: #18181B; }
.s3d-brief { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.4; color: #3F3F46; }
.s3d-brief li::marker { color: #A1A1AA; }
.s3d-act-btns, .site-act-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.s3d-call { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; background: #18181B; color: #fff;
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.s3d-call:hover { background: #27272A; }
.s3d-po { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid #D4D4D8; background: #fff;
  color: #18181B; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.s3d-po:hover { border-color: #18181B; }
.s3d-act-fine { font-size: 11px; }
.s3d-phone { display: inline-flex; gap: 6px; align-items: center; }
.s3d-phone .cf-input { width: 132px; height: 32px; }
.s3d-flag-open { align-self: flex-start; font-size: 12.5px; }
.s3d-ff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.s3d-ff { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: #52525B; min-width: 0; }
.s3d-ff .cf-input { height: 30px; font-size: 12.5px; min-width: 0; width: 100%; }
.site-act { margin: 0 0 12px; padding: 14px; background: #fff; }
.site-act h3 { font-size: 14px; }
.site-act .s3d-brief { font-size: 13.5px; }

/* Site: the picked item (crane, office, material): drag it, turn it, remove it */
.s3d-item { position: absolute; left: 14px; bottom: 44px; width: 260px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 1.5px #1570EF, 0 8px 24px -12px rgba(16, 24, 40, .35); }
.s3d-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s3d-item-top strong { font-size: 13.5px; font-weight: 650; color: #18181B; }
.s3d-item .meta { font-size: 12px; }
@media (max-width: 700px) { .s3d-item { left: 10px; right: 10px; width: auto; bottom: 120px; } }

/* ================================================================ process map: routes along the roads */
.route-path { fill: none; stroke: #B54708; stroke-opacity: .55; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.route-path.hl { stroke: #D92D20; stroke-opacity: .7; }
.route-path.sel { stroke: #2E90FA; stroke-opacity: .9; }
.route-arrow { fill: #B54708; }
.route-tag rect { fill: #FFFAEB; stroke: #FEC84B; }
.route-tag text { fill: #93370D; font-size: 10.5px; font-weight: 600; text-anchor: middle; }
.map-dark .route-tag rect { fill: #2B2416; stroke: #93370D; }
.map-dark .route-tag text { fill: #FEC84B; }

/* ================================================================ process map: plant and building detail */
.rib { stroke: rgba(52, 64, 84, .22); stroke-width: .5; }
.band { stroke: rgba(52, 64, 84, .28); stroke-width: .6; }
.slat { stroke: rgba(52, 64, 84, .3); stroke-width: .4; }
.rollup { fill: #D0D5DD; stroke: #667085; stroke-width: .5; }
.steel-thin { stroke: #667085; stroke-width: .8; stroke-linecap: round; }
.handrail { stroke: #F79009; stroke-width: .8; stroke-linecap: round; }
.truss { stroke: #475467; stroke-width: .6; }
.truss-face { fill: rgba(102, 112, 133, .18); stroke: #475467; stroke-width: .6; }
.belt-deck { fill: #98A2B3; stroke: #475467; stroke-width: .5; }
.belt-rubber { stroke: #344054; stroke-width: 1.6; stroke-linecap: round; }
.ramp-road { fill: #CDBFA9; stroke: #B3A38A; stroke-width: .6; }
.ramp-earth { fill: #DCD4C8; stroke: #B5AB9C; stroke-width: .6; }
.berm { stroke: #C9C1B4; stroke-width: 2.4; stroke-linecap: round; }
.pit-seam { stroke: rgba(120, 108, 92, .35); stroke-width: .6; }
.conc-t { fill: #EAECF0; stroke: #98A2B3; stroke-width: .5; }
.conc-l { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .5; }
.conc-r { fill: #B9C0CB; stroke: #98A2B3; stroke-width: .5; }
.tank-cyl { fill: url(#cyl-grad); stroke: #7A8599; stroke-width: .6; }
.tank-t { fill: #F2F4F7; stroke: #7A8599; stroke-width: .6; }
.tank-l { fill: #E4E7EC; stroke: #7A8599; stroke-width: .4; }
.tank-r { fill: #C8CED8; stroke: #7A8599; stroke-width: .4; }
.tank-end { fill: #D9DEE5; stroke: #7A8599; stroke-width: .6; }
.tankroof-l { fill: #F2F4F7; stroke: #7A8599; stroke-width: .5; }
.tankroof-r { fill: #D9DEE5; stroke: #7A8599; stroke-width: .5; }
.tank-band { fill: none; stroke: rgba(52, 64, 84, .35); stroke-width: .7; }
.ladder { stroke: #475467; stroke-width: 1.4; stroke-dasharray: 1.4 1.1; }
.drum-t { fill: #98A2B3; stroke: #344054; stroke-width: .4; }
.drum-l { fill: #667085; stroke: #344054; stroke-width: .4; }
.drum-r { fill: #475467; stroke: #344054; stroke-width: .4; }
.drum-end, .dark-end { fill: #344054; stroke: #1D2939; stroke-width: .5; }
.dark-cyl { fill: #667085; stroke: #344054; stroke-width: .5; }
.steelc-l { fill: #98A2B3; stroke: #475467; stroke-width: .5; }
.steelc-r { fill: #667085; stroke: #475467; stroke-width: .5; }
.sand-l { fill: #EAD9B8; stroke: #B9A27A; stroke-width: .6; }
.sand-r { fill: #D7C29A; stroke: #B9A27A; stroke-width: .6; }
.base-l { fill: #C4C7CC; stroke: #8E949D; stroke-width: .6; }
.base-r { fill: #A9AEB6; stroke: #8E949D; stroke-width: .6; }
.cont-t { fill: #D0D5DD; stroke: #667085; stroke-width: .4; }
.cont-l { fill: #98A2B3; stroke: #475467; stroke-width: .4; }
.cont-r { fill: #7A8599; stroke: #475467; stroke-width: .4; }
.pump-t, .pump-l, .pump-r { fill: #F2F4F7; stroke: #475467; stroke-width: .5; }
.canopy-t { fill: #FFFFFF; stroke: #98A2B3; stroke-width: .6; }
.canopy-l, .canopy-r { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .5; }
.tote-t { fill: #F2F4F7; stroke: #98A2B3; stroke-width: .4; }
.tote-l, .tote-r { fill: #E4E7EC; stroke: #98A2B3; stroke-width: .4; }
.pipe { stroke: #98A2B3; stroke-width: 2; stroke-linecap: round; }
.crane { stroke: #DC6803; stroke-width: 1.5; stroke-linecap: round; }
.crane-thin { stroke: #F79009; stroke-width: .7; }
.cable { stroke: #344054; stroke-width: .6; }
.fence { stroke: #98A2B3; stroke-width: .8; stroke-dasharray: 2 2; }
.map-dark .tank-t, .map-dark .canopy-t, .map-dark .conc-t { fill: #D4D4D4; }
.map-dark .ramp-road, .map-dark .ramp-earth { fill: #3A342B; stroke: #4A4337; }
.map-dark .berm { stroke: #4A4337; }

/* ================================================================ process map: the land (grass over soil, one concrete pad) */
.land { pointer-events: none; }
.land-top { fill: #C9DDB0; stroke: #B3CB97; stroke-width: 1; }
.land-soil.l { fill: #9DBE7C; } .land-soil.r { fill: #8BAE6B; }
.land-clay.l { fill: #A88D6C; } .land-clay.r { fill: #977D5E; }
.land-soil, .land-clay { stroke: rgba(60, 45, 30, .2); stroke-width: .6; stroke-linejoin: round; }
.pad-top { fill: #F1F2F4; stroke: #D0D5DD; stroke-width: 1; }
.pad-side.l { fill: #D9DDE3; } .pad-side.r { fill: #C8CDD5; }
.pad-side { stroke: #B9C0CB; stroke-width: .5; }
.pad-joint { stroke: rgba(102, 112, 133, .12); stroke-width: .6; }
.map-dark .land-top { fill: #243020; stroke: #2E3B28; }
.map-dark .land-soil.l { fill: #2F3E28; } .map-dark .land-soil.r { fill: #283522; }
.map-dark .land-clay.l { fill: #463B2E; } .map-dark .land-clay.r { fill: #3C3227; }
.map-dark .pad-top { fill: #2A2A2A; stroke: #353A43; }
.map-dark .pad-side.l { fill: #353535; } .map-dark .pad-side.r { fill: #2A2E35; }
.map-dark .pad-joint { stroke: rgba(255, 255, 255, .05); }

/* ================================================================ process map: a job's own building (from its drawings) */
.mass-t { fill: #FFFFFF; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.mass-l { fill: #EAECF0; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.mass-r { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .6; stroke-linejoin: round; }
.ghostm-t, .ghostm-l, .ghostm-r { fill: rgba(255, 255, 255, .25); stroke: #98A2B3; stroke-width: .6; stroke-dasharray: 2 2; }
.site-short { fill: none; stroke: #F04438; stroke-width: 1.6; }
.map-dark .mass-t { fill: #E5E5E5; } .map-dark .mass-l { fill: #C8C8C8; } .map-dark .mass-r { fill: #ADADAD; }
.map-dark .ghostm-t, .map-dark .ghostm-l, .map-dark .ghostm-r { fill: rgba(255, 255, 255, .05); stroke: #737373; }

/* Generate: @ to tag a record. A plain list under the box; the picked row is the only dark one. */
.gen-at { position: absolute; left: 12px; right: 12px; top: calc(100% - 44px); z-index: 30; max-height: 280px; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(16, 24, 40, .35); }
.gen-at[hidden] { display: none; }
.gen-at-row { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.gen-at-row.on, .gen-at-row:hover { background: var(--subtle); }
.gen-at-kind { flex: none; width: 76px; color: var(--muted); font-size: 12px; }
.gen-at-t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-at-s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gen-at-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* ================================================================ process map: reshaping roads */
.road-handle.mid { fill: rgba(255, 255, 255, .85); stroke-width: 1.6; stroke-dasharray: 2 1.5; cursor: copy; }
.road-handle.curve { fill: #D1E9FF; }
.road-sel + .road-hit { cursor: move; }
.map-dark .road-handle.mid { fill: rgba(31, 31, 31, .85); }

/* ================================================================ process map: the HQ's floors */
.hqsel-t { fill: #D1E9FF; stroke: #2E90FA; stroke-width: .7; }
.hqsel-l { fill: #B2DDFF; stroke: #2E90FA; stroke-width: .7; }
.hqsel-r { fill: #84CAFF; stroke: #2E90FA; stroke-width: .7; }
.floor-tag { display: none; cursor: pointer; }
.floor-tag.open, .zoom-near .floor-tag { display: inline; }
.floor-tag rect { fill: rgba(255, 255, 255, .96); stroke: #D0D5DD; }
.floor-tag.on rect { stroke: #2E90FA; stroke-width: 1.5; }
.floor-tag text { font-size: 11px; font-weight: 600; fill: #344054; }
.floor-tag-stem { stroke: #98A2B3; stroke-width: 1; }
.map-dark .floor-tag rect { fill: rgba(31, 31, 31, .95); stroke: #3D3D3D; }
.map-dark .floor-tag text { fill: #E5E5E5; }
.shoe { stroke: rgba(16, 24, 40, .45); stroke-width: .7; }
.rod { stroke: #475467; stroke-width: 1.2; }
.spill { stroke: #A39A8C; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1.5 2; opacity: .8; }
.drill-hole { fill: rgba(70, 60, 48, .55); }
.sump { fill: #B9C7D6; stroke: #98A8BA; stroke-width: .6; }
.map-dark .sump { fill: #2B3644; stroke: #3B4A5C; }
.sign-t, .sign-l, .sign-r { fill: #FFFFFF; stroke: #475467; stroke-width: .5; }
.drum-cyl { fill: #667085; stroke: #344054; stroke-width: .5; }
.wash-pad { fill: #D0D5DD; stroke: #98A2B3; stroke-width: .6; }
.washout { fill: #C8CDD5; stroke: #98A2B3; stroke-width: .6; }
.map-dark .wash-pad, .map-dark .washout { fill: #353535; stroke: #3D3D3D; }

/* Road points: the picked one is filled; its × deletes it. */
.road-handle.picked { fill: #2E90FA; stroke: #fff; stroke-width: 3; }
.road-del { cursor: pointer; }
.road-del circle { fill: #18181B; stroke: #fff; stroke-width: 2; }
.road-del path { stroke: #fff; stroke-width: 2; stroke-linecap: round; fill: none; }
.road-del:hover circle { fill: #D92D20; }

/* Job site panel: the job's blueprint, first page as a picture. */
.tp-print { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.tp-print-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.tp-print-img.none { display: flex; align-items: center; justify-content: center; background: var(--subtle); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.tp-print-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.tp-print-t { display: flex; flex-direction: column; min-width: 0; }
.tp-print-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A job's building on the map before its drawings are read: the same shape, paler (no dashes). */
.massp-t { fill: #F9FAFB; stroke: #B9C0CB; stroke-width: .6; stroke-linejoin: round; }
.massp-l { fill: #F2F4F7; stroke: #B9C0CB; stroke-width: .6; stroke-linejoin: round; }
.massp-r { fill: #EAECF0; stroke: #B9C0CB; stroke-width: .6; stroke-linejoin: round; }
.map-dark .massp-t { fill: #D4D4D4; } .map-dark .massp-l { fill: #B9C0CB; } .map-dark .massp-r { fill: #A3A3A3; }

/* Generate: typing into a document's blanks. While filling, each blank is a soft amber box; after Done, typed
   values read as normal document text and empty blanks are plain lines for the next person. */
.doc-input { font: inherit; color: #18181B; width: 100%; min-width: 110px; max-width: 320px; box-sizing: border-box; padding: 3px 7px; border: 1px solid #FCD34D;
  border-radius: 5px; background: #FFFBEB; outline: none; }
.doc-input:focus { border-color: #B45309; background: #fff; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.doc-input::placeholder { color: #B45309; opacity: .75; font-size: 12px; font-weight: 600; }
.doc-input.num { text-align: right; min-width: 70px; font-variant-numeric: tabular-nums; }
.doc-table td .doc-input { max-width: none; }
.doc-filled { color: #18181B; }
.gen-fillcount { font-size: 12px; color: #B45309; font-weight: 600; white-space: nowrap; }
@media print {
  .doc-input { border: 0; border-bottom: 1px solid #A1A1AA; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
  .doc-input::placeholder { color: transparent; }
}

/* Templates: an eye on the left to look at one before using it (the × to remove is on the right). */
.gen-tpl-eye { position: absolute; top: 13px; left: 13px; z-index: 1; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(24, 24, 27, .78); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; display: inline-flex; align-items: center; justify-content: center; }
.gen-tpl:hover .gen-tpl-eye, .gen-tpl-eye:focus-visible { opacity: 1; }
@media (hover: none) { .gen-tpl-eye { opacity: 1; } }
.pop.wide { width: min(900px, 100%); }
.gen-tplv .pop-body { background: var(--subtle); }
.gen-tplv-t { margin-right: auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gen-tplv-t h2 { margin: 0; font-size: 17px; }
.gen-sheet.preview .gen-paper { box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }
.gen-tplv-file { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gen-tplv-file img { max-width: 100%; max-height: 70vh; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.gen-tplv-none { width: 220px; aspect-ratio: 17 / 22; display: flex; align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-weight: 600; letter-spacing: .06em; }

/* Sign in: pick a role (demo). */
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.acct-k { display: block; padding: 6px 12px 2px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.acct-menu button.on { font-weight: 600; }

/* Role views (My jobs, What's late, Risk & money). Black and white; red and amber only where something is wrong. */
.work { padding: 28px 32px 48px; max-width: 1180px; }
.work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.work-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.work-head p { margin: 4px 0 0; }
.work-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.work-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.work-tile-v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-tile-k { font-size: 12.5px; color: var(--muted); }
.work-tile.bad .work-tile-v { color: var(--red); }
.work-tile.warn .work-tile-v { color: #B45309; }
.work-sec { margin-top: 18px; }
.work-sec h2 { font-size: 16px; margin: 0 0 10px; }
.work-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.work-sec-head h2 { margin: 0; }
.work-search { width: min(320px, 100%); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.work-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.work-job { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.work-job.bad { border-left-color: var(--red); }
.work-job.warn { border-left-color: #F59E0B; }
.work-job-top { display: flex; justify-content: space-between; gap: 10px; }
.work-job-t { display: flex; flex-direction: column; min-width: 0; }
.work-job-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-job-v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.work-badges, .work-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.work-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--subtle); color: var(--text); white-space: nowrap; }
.work-badge.bad { background: #FEE4E2; color: #B42318; }
.work-badge.warn { background: #FEF3C7; color: #B45309; }
.work-badge.quiet { color: var(--muted); font-weight: 500; }
.work-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.work-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.work-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.work-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.work-table tr:last-child td { border-bottom: 0; }
.work-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.work-table .block { display: block; }
.work-row-acts { white-space: nowrap; text-align: right; }
.work-row-acts .btn + .btn { margin-left: 6px; }
.work-days { font-weight: 600; white-space: nowrap; }
.work-days.bad { color: var(--red); }
.work-days.warn { color: #B45309; }
.work-alerts { display: flex; flex-direction: column; gap: 8px; }
.work-alert { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid #F59E0B; border-radius: 10px; font: inherit; color: var(--text); cursor: pointer; }
.work-alert.high { border-left-color: var(--red); }
.work-alert:hover { border-color: var(--line-strong); }
.work-alert-m { flex: none; min-width: 90px; font-weight: 650; font-variant-numeric: tabular-nums; }
.work-alert-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.work-empty { color: var(--muted); padding: 18px 0; }
@media (max-width: 760px) {
  .work { padding: 20px 16px 40px; }
  .work-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-sec-head { flex-direction: column; align-items: stretch; }
  .work-search { width: 100%; }
}

/* Blanks inside a sentence: a small box to type in while filling; a line on paper. */
.doc-input.inline { display: inline-block; width: auto; min-width: 0; max-width: 100%; padding: 1px 6px; vertical-align: baseline; }
.doc-col-blank { display: block; max-width: 260px; }
.doc-col-blank .doc-blank { min-width: 160px; }

/* A template's own look (read from its file). Fixed choices only; no fonts are downloaded (the page loads nothing from
   outside), so serif uses the computer's Cambria/Georgia and sans its Calibri/Segoe/Arial. */
.doc.styled { --doc-accent: #18181B; }
.doc.styled.hf-serif .doc-h, .doc.styled.hf-serif .doc-title { font-family: Cambria, Georgia, "Times New Roman", serif; letter-spacing: 0; font-weight: 600; }
.doc.styled.bf-serif { font-family: Cambria, Georgia, "Times New Roman", serif; }
.doc.styled.bf-sans { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; }
.doc.styled .doc-h { color: var(--doc-accent); }
.doc.styled.rules .doc-h { padding-bottom: 3px; border-bottom: 2px solid var(--doc-accent); }
.doc.styled.rules .doc-h:first-of-type { font-size: 21px; }
.doc.styled.sz-small { font-size: 13px; }
.doc.styled.sz-large { font-size: 16px; }
.doc.styled .doc-p, .doc.styled .doc-list li { color: #18181B; }
.doc.styled.indent .doc-p { padding-left: 2.2em; }
.doc.styled .doc-cols span { color: #18181B; }
.doc.styled .doc-col-1 { font-weight: 400; }
.doc.styled .doc-h + * { margin-top: -6px; }
.doc-list.cols-2 { columns: 2; column-gap: 40px; }
.doc-list.cols-3 { columns: 3; column-gap: 32px; }
.doc-list.cols-2 li, .doc-list.cols-3 li { break-inside: avoid; }
.doc.styled.tb-grid .doc-table-wrap { border: 0; border-radius: 0; }
.doc.styled.tb-grid table { border-collapse: collapse; }
.doc.styled.tb-grid td, .doc.styled.tb-grid th { border: 1px solid #18181B; padding: 3px 12px; }
.doc.styled.tb-grid td:first-child { padding-left: 2.2em; }
.doc.styled.tb-grid td:last-child { width: 22%; }
.doc-total-row td { font-weight: 650; }
.doc-total-row td:first-child { text-align: right; }
.doc.styled .doc-table-head:has(> span:only-of-type) { display: none; }
@media print { .doc.styled .doc-table-head { display: none; } }

/* Editing a document in place. */
.doc-ed { outline: none; border-radius: 4px; transition: background .12s, box-shadow .12s; cursor: text; min-width: 1ch; }
.doc-ed:hover { background: rgba(46, 144, 250, .06); }
.doc-ed:focus { background: #fff; box-shadow: 0 0 0 2px rgba(46, 144, 250, .45); }
.doc-ed:empty::before { content: attr(data-ph); color: #A1A1AA; }
.doc-edblock { position: relative; border-radius: 6px; margin: 0 -10px; padding: 4px 10px; }
.doc-edblock:hover { box-shadow: inset 0 0 0 1px #E4E4E7; }
.doc-edtools { position: absolute; top: -12px; right: 6px; display: none; gap: 4px; z-index: 2; }
.doc-edblock:hover > .doc-edtools, .doc-edblock:focus-within > .doc-edtools { display: flex; }
.doc-tiny { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 1px solid #E4E4E7; border-radius: 999px; background: #fff;
  color: #3F3F46; font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; }
.doc-tiny:hover { border-color: #A1A1AA; color: #18181B; }
.doc-tiny.del { width: 22px; padding: 0; justify-content: center; }
.doc-tiny.del:hover { background: #FEE4E2; border-color: #FDA29B; color: #B42318; }
.doc-edblock > .doc-tiny:not(.del), .doc-edblock .doc-table > .doc-tiny, .doc-col > .doc-tiny { margin-top: 6px; align-self: flex-start; }
.doc-edrow { position: relative; }
.doc-edrow > .doc-tiny.del { position: absolute; right: -28px; top: 1px; opacity: 0; }
.doc-edrow:hover > .doc-tiny.del, .doc-edrow:focus-within > .doc-tiny.del { opacity: 1; }
.doc-col .doc-edrow { display: block; }
.doc-edcell { width: 30px; border: 0 !important; padding: 0 0 0 6px !important; }
.doc-edcell .doc-tiny.del { opacity: .5; }
.doc-edcell .doc-tiny.del:hover { opacity: 1; }
.doc-edlocked { color: #71717A; font-size: 13px; padding: 10px 0; }

/* My Apps */
.apps { padding: 28px 32px 48px; max-width: 1180px; }
.apps-empty { margin-top: 12px; padding: 56px 24px; border: 1px dashed var(--line-strong); border-radius: 16px; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.apps-empty h2 { margin: 8px 0 0; font-size: 18px; }
.apps-empty p { margin: 0; max-width: 460px; color: var(--muted); }
.apps-empty-art { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; }
.apps-empty-art span { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); }
.apps-empty-art span.on { background: var(--text); border-color: var(--text); }
@media (max-width: 760px) { .apps { padding: 20px 16px 40px; } }

/* Generate: the History bar, full height between the menu and the page. */
.gen-wrap { display: flex; align-items: stretch; min-height: 100vh; }
.gen-wrap > .gen-page { flex: 1 1 auto; min-width: 0; }
.gen-hbar { flex: 0 0 252px; box-sizing: border-box; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 10px 24px;
  background: var(--surface); border-right: 1px solid var(--line); }
.gen-hhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 10px; }
.gen-hhead h2 { margin: 0; font-size: 14px; font-weight: 650; }
.gen-hgroup h3 { margin: 14px 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: none; }
.gen-hrow { position: relative; display: flex; align-items: center; border-radius: 8px; }
.gen-hrow:hover { background: var(--subtle); }
.gen-hrow.on { background: var(--subtle); box-shadow: inset 2px 0 0 var(--text); }
.gen-hitem { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 7px 8px; border: 0; background: none; text-align: left;
  font: inherit; color: var(--text); cursor: pointer; }
.gen-hdel { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-width: 22px; height: 22px; padding: 0 6px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; opacity: 0; box-shadow: 0 0 0 1px var(--line);
  display: inline-flex; align-items: center; justify-content: center; }
.gen-hrow:hover .gen-hdel, .gen-hdel:focus-visible, .gen-hdel.sure { opacity: 1; }
.gen-hdel.sure { background: var(--red); color: #fff; box-shadow: none; }
@media (hover: none) { .gen-hdel { opacity: .7; } }
.gen-hnote { margin: 6px 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.gen-split { justify-content: center; }
@media (max-width: 960px) {
  .gen-wrap { flex-direction: column; }
  .gen-hbar { position: static; height: auto; max-height: 240px; flex-basis: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media print { .gen-hbar { display: none !important; } .gen-wrap { display: block; } }

/* My Apps with nothing in it yet: everything in the middle of the page. */
.apps.empty { min-height: 100vh; box-sizing: border-box; max-width: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 16px; }
.apps.empty .work-head { justify-content: center; margin-bottom: 8px; }
.apps.empty .apps-empty { margin-top: 0; width: min(560px, 100%); box-sizing: border-box; }

/* Site view: overhead map of the facility. The map fills the page; the title and notes float over it. */
main.siteview { position: relative; height: 100vh; min-height: 480px; overflow: hidden; background: #1F2937; }
.sv-map { position: absolute; inset: 0; }
.sv-ui { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.sv-ui > * { pointer-events: auto; }
.sv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; }
.sv-title { background: var(--surface); border-radius: var(--radius); padding: 10px 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-title h1 { font-size: 18px; line-height: 1.2; }
.sv-title .meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.sv-actions .btn { box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-note { align-self: flex-start; max-width: 560px; background: var(--surface); color: var(--text-2); border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px; box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-note.bad { color: var(--red); }
.sv-legend { align-self: flex-start; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: rgba(255, 255, 255, .94);
  border-radius: var(--radius); padding: 6px 12px; font-size: 12px; color: var(--text-2); box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-key { width: 18px; height: 3px; border-radius: 2px; background: #f5b301; }
.sv-soon { color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line-strong); }
.sv-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #f5b301; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.sv-dot.sv-drag { width: 18px; height: 18px; cursor: grab; }
.sv-dot.sv-drag:active { cursor: grabbing; }
.sv-tag { background: rgba(16, 24, 40, .82); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
[data-theme="dark"] .sv-title, [data-theme="dark"] .sv-note { background: #1C1C1C; color: #E5E5E5; }
[data-theme="dark"] .sv-title h1 { color: #FAFAFA; }
[data-theme="dark"] .sv-legend { background: rgba(24, 24, 27, .92); color: #E5E5E5; }
/* Site view: the 3D model of the facility */
.sv-3d { position: absolute; inset: 0; background: #dde4ea; overflow: hidden; }
.sv-3d[hidden], .sv-map[hidden] { display: none; }
.f3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.f3d-label { position: absolute; left: 0; top: 0; background: rgba(16, 24, 40, .86); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
.f3d-label.bld { pointer-events: auto; cursor: pointer; }
.f3d-label.bld.on { background: #1570ef; }
.f3d-label.ref { background: #f5b301; color: #111; }
/* Site view: moving a machine (double-click it, drag it, Done) */
.f3d-move { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  background: rgba(16, 24, 40, .92); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 10px 8px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(16, 24, 40, .28); }
.f3d-move[hidden] { display: none; }
.f3d-move span { margin-right: 4px; }
.f3d-move button { border: 0; font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; background: rgba(255, 255, 255, .16); color: #fff; white-space: nowrap; }
.f3d-move button:hover { background: rgba(255, 255, 255, .26); }
.f3d-move button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.f3d-move .f3d-move-done { background: #1570ef; }
.f3d-move .f3d-move-done:hover { background: #175cd3; }
.f3d-move.busy { opacity: .7; pointer-events: none; }
.f3d-north { position: absolute; right: 16px; bottom: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .25); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text); }
.sv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-tabs { display: inline-flex; background: var(--surface); border-radius: var(--radius); padding: 3px; box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-tab { border: 0; background: none; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.sv-tab.on { background: #101828; color: #fff; }
.sv-card-slot { position: absolute; left: 16px; bottom: 16px; pointer-events: none; }
.sv-card { pointer-events: auto; width: 300px; background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 4px 16px rgba(16, 24, 40, .22); }
.sv-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sv-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 13px; }
.sv-card dt { color: var(--muted); }
.sv-card dd { margin: 0; color: var(--text); }
.sv-card .meta { margin: 0; font-size: 12px; color: var(--muted); }
.sv-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); }
[data-theme="dark"] .sv-tabs, [data-theme="dark"] .sv-card { background: #1C1C1C; }
[data-theme="dark"] .sv-card dd, [data-theme="dark"] .sv-card strong { color: #FAFAFA; }
[data-theme="dark"] .sv-tab.on { background: #FAFAFA; color: #1C1C1C; }
/* Site view: yard areas and inventory */
.f3d-label.zone { background: rgba(255, 255, 255, .9); color: #1d2939; border: 1px solid rgba(16, 24, 40, .18); font-size: 11px; font-weight: 600;
  padding: 2px 6px; pointer-events: auto; cursor: pointer; }
.f3d-label.zone.on { background: #1570ef; color: #fff; border-color: #1570ef; }
/* alerts (facility3d.js › setAlerts): a station with a problem, and the building it's in, get red labels that say how many */
.f3d-label.bld.alert, .f3d-label.zone.alert { background: #d92d20; color: #fff; border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217, 45, 32, .25); }
.f3d-label.alert[data-alert]::after { content: attr(data-alert); margin-left: 6px; padding: 0 5px; border-radius: 3px; background: #fff; color: #b42318; font-weight: 700; }
.f3d-label.editing::after { content: none; }
.sv-card { max-height: calc(100vh - 220px); overflow: auto; }
.sv-card.wide { width: 340px; }
.sv-card > .meta { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.sv-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sv-list button { width: 100%; display: flex; justify-content: space-between; gap: 8px; border: 0; background: var(--subtle); padding: 6px 8px;
  border-radius: 4px; cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.sv-list button:hover { background: var(--line); }
.sv-list .meta { color: var(--muted); font-size: 12px; }
.sv-form { display: flex; flex-direction: column; gap: 8px; }
.sv-form textarea, .sv-card select { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.sv-form select { height: 36px; }
.sv-form textarea { resize: vertical; min-height: 52px; }
.sv-size { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.sv-size input { width: 0; flex: 1; height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 14px; }
.sv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sv-two .fld input { width: 100%; }
.sv-row { display: flex; gap: 8px; align-items: center; }
.sv-row select { flex: 1; height: 34px; min-width: 0; }
.sv-acts { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.sv-err { color: var(--red); font-size: 13px; margin: 0; }
[data-theme="dark"] .sv-list button { background: #2A2A2A; color: #FAFAFA; }
.sv-about { margin: 0 0 8px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.sv-legend.bad { color: var(--red); }
.sv-dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.sv-dot-live.on { background: #12b76a; }
.sv-link { border: 0; background: none; padding: 0 0 0 8px; border-left: 1px solid var(--line-strong); color: #1570ef; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.sv-link:disabled { color: var(--muted); cursor: default; }
.f3d-label.stop { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #101828; font-weight: 600; letter-spacing: -.005em;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 6px 18px rgba(16, 24, 40, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.f3d-label.stop b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eff4ff; color: #1570ef; box-shadow: inset 0 0 0 1.5px #1570ef;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.f3d-label.stop.now { background: #1570ef; color: #fff; box-shadow: 0 0 0 4px rgba(21, 112, 239, .22), 0 6px 18px rgba(16, 24, 40, .25); }
.f3d-label.stop.now b { background: #fff; color: #1570ef; box-shadow: none; }

/* Team (owners): one row per person, role and position change in place */
.pop-team { width: min(680px, 100%); }
.team-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 170px; gap: 10px; align-items: end; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.team-row:first-child { border-top: 0; }
.team-row.off { opacity: .6; }
.team-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-self: center; }
.team-who strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-fld { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
/* Role and Position: flat dropdowns in the app's colors, not the Mac's gray buttons. The arrow is drawn
   with gradients (no url()), so the page's strict policy is untouched; tokens make dark mode follow. */
.team-fld select { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; font-size: 13px; font-weight: 500; color: var(--text);
  background-color: var(--surface); cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
  transition: border-color .12s ease, box-shadow .12s ease; }
.team-fld select:hover:not(:disabled) { border-color: var(--faint); }
.team-fld select:focus-visible { outline: none; border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent); }
.team-fld select:has(> option[value=""]:checked) { color: var(--muted); font-weight: 400; }
.team-fld select option { color: var(--text); font-weight: 400; }
.team-fld select:disabled { background-color: var(--subtle); color: var(--muted); cursor: not-allowed;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); }
@media (max-width: 560px) { .team-row { grid-template-columns: 1fr 1fr; } .team-who { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- Silverdale apps on the base (apps.js)
   Black and white with depth (cards), red only where something is at risk. */
.ap { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 16px; max-width: 1500px; }
.ap-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ap-head h1 { font-size: 24px; }
.ap-actions, .ap-row { display: flex; align-items: center; gap: 8px; }
.ap-row.wrap { flex-wrap: wrap; }
.ap-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap-card h2 { font-size: 15px; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ap-pad { padding: 8px 2px; }
.ap-err { color: var(--red); font-weight: 600; }
.ap-errs { margin: 0; padding-left: 18px; color: var(--text); }
.ap-empty { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; color: var(--muted); background: var(--surface); }
.ap-table-wrap { overflow-x: auto; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ap-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.ap-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ap-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-table tr.click { cursor: pointer; }
.ap-table tr.click:hover, .ap-table tr.click:focus-visible { background: var(--subtle); }
.ap-bar { display: inline-flex; align-items: center; gap: 8px; width: 128px; }
.ap-bar-t { position: relative; flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ap-bar-t span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--text); transition: width .3s ease; }
.ap-bar.done .ap-bar-t span { background: var(--green); }
.ap-bar.risk .ap-bar-t span { background: var(--red); }
.ap-bar em { flex: 0 0 34px; text-align: right; font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-2); }
.ap-bar.none em { color: var(--faint); font-weight: 500; }
.ap-bar.done em { color: var(--green); }
.ap-bar.risk em { color: var(--red); }
.ap-tag { align-self: flex-start; display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ap-tag.risk { border-color: var(--red); color: var(--red); }
.ap-tag.ok { background: var(--subtle); }
.ap-tag.first { background: var(--text); border-color: var(--text); color: var(--surface); }
.ap-mt-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 14px 12px 34px; }
/* inside an open ticket it sits on the same grey as the row above and the scans below (2026-11-23: it showed as a white
   strip with the button touching its bottom edge) */
.ap-mt.open .ap-mt-acts { background: var(--subtle); }
/* Push to first (Landon, 2026-11-23: "fix this formatting"): one compact control, filled when it's the action, outlined when undoing */
.ap-push { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 6px; flex: none;
  border: 1px solid var(--text); background: var(--text); color: var(--surface); font: inherit; font-size: 13px; font-weight: 500;
  line-height: 1; white-space: nowrap; cursor: pointer; transition: opacity .12s ease-out, background-color .12s ease-out; }
.ap-push:hover { opacity: .88; }
.ap-push.on { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.ap-push.on:hover { opacity: 1; background: var(--subtle); }
.ap-push:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
.ap-push[disabled] { opacity: .55; cursor: default; }
.ap-push svg { flex: none; margin-left: -2px; }
.ap-push-note { font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ap-push { transition: none; } }
.ap-big { font-size: 22px; font-weight: 700; }
.ap-queues { display: flex; gap: 10px; flex-wrap: wrap; }
.ap-q { font: inherit; color: var(--text); text-align: left; cursor: pointer; width: 100%; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
/* Machines on Production (apps.js › machines): the card's colour is the machine's andon light, in the station app's
   colours (station.css): green = a ticket checked in, red = an open problem or the machine is down, white = nothing being
   worked. The word (Working / Problem) is on the card too, so the colour never carries the meaning alone. */
.ap-machines { display: flex; flex-direction: column; gap: 12px; }
.ap-q-wrap { display: flex; }
.ap-q { --m: transparent; --m-s: var(--surface); --m-k: var(--text); position: relative; background: var(--m-s);
  transition: transform .12s ease-out, box-shadow .12s ease-out; }
.ap-q:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,24,40,.06), 0 10px 20px -8px rgba(16,24,40,.18); }
.ap-q.m-working { --m: #12894C; --m-s: #E3F4EA; --m-k: #0B6536; border-color: var(--m); }
.ap-q.m-problem { --m: #D3271D; --m-s: #FDECEA; --m-k: #9C1A12; border-color: var(--m); }
/* A tinted card (green / red) carries its own ink: dark text on the light tint, whatever the page's Style says.
   Without this, a dark Style (views-theme.js sets --text to white) put white text on the light green. */
.ap-q:is(.m-working, .m-problem) { --text: #101828; --text-2: #344054; --muted: #475467; --line-strong: rgba(16,24,40,.32);
  --surface: #FFFFFF; --red: #B42318; color: var(--text); }
.ap-q.on { outline: 2px solid var(--text); outline-offset: 2px; }
.ap-q-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-q-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--m-k); }
.ap-q-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--m); }
.ap-q-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.ap-q.m-problem .ap-tag.risk { background: var(--surface); }
.ap-mp { --m: var(--line-strong); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--m); }
.ap-mp.m-working { --m: #12894C; }
.ap-mp.m-problem { --m: #D3271D; }
.ap-mp-head { display: flex; align-items: flex-start; gap: 12px; }
.ap-mp-title { flex: 1 1 auto; min-width: 0; }
.ap-mp-head h2 { font-size: 18px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ap-mp-name { font-size: 14px; font-weight: 500; color: var(--muted); }
.ap-mp-state { flex: none; align-self: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--subtle); color: var(--text-2); border: 1px solid var(--line-strong); }
.ap-mp-state.m-working { background: #E3F4EA; color: #0B6536; border-color: #12894C; }
.ap-mp-state.m-problem { background: #FDECEA; color: #9C1A12; border-color: #D3271D; }
.ap-mp h3 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.ap-mp-problems { border: 1px solid #F4B7B1; background: #FDECEA; border-radius: var(--radius); padding: 10px 14px; }
.ap-mp-problems h3 { color: #9C1A12; }
.ap-mp-problems ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ap-mp-problems li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #5A130D; }
.ap-mp-problems li + li { border-top: 1px solid #F8CFCA; padding-top: 6px; }
/* each problem: what and when on the left, Done / Mistake (or Undo while it's closing) on the right (apps.js › problemRow) */
.ap-mp-pb { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ap-mp-pb-acts { flex: none; display: flex; gap: 6px; }
.ap-mp-problems .btn.small { background: #fff; border: 1px solid #F4B7B1; color: #9C1A12; font-weight: 500; }
.ap-mp-problems .btn.small:hover { background: #FBD5D1; }
.ap-mp-problems .btn.small:focus-visible { outline: 2px solid #9C1A12; outline-offset: 1px; }
.ap-mp-problems li.closing .ap-mp-pb { opacity: .7; }
.ap-mp-problems li.closing strong { text-decoration: line-through; }
.ap-mp-problems strong { color: #9C1A12; }
.ap-mt-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ap-mt + .ap-mt { border-top: 1px solid var(--line); }
.ap-mt { --t: var(--line-strong); }
.ap-mt.t-working { --t: #12894C; }
.ap-mt.t-held { --t: #F6C414; }
.ap-mt.t-waiting { --t: var(--faint); }
.ap-mt-row { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 0; background: var(--surface); text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.ap-mt-row:hover, .ap-mt.open .ap-mt-row { background: var(--subtle); }
.ap-mt-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--t); }
.ap-mt.t-waiting .ap-mt-dot { background: transparent; border: 2px solid var(--t); }
.ap-mt-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ap-mt-line { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.ap-mt-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ap-mt-now { font-size: 13px; color: var(--text); }
.ap-mt-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ap-mt-qty { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-mono { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.ap-mt .ap-timeline { padding: 4px 14px 12px 34px; background: var(--subtle); }
[data-theme="dark"] .ap-q.m-working { --m: #47CD89; --m-s: #0B2E1D; --m-k: #75E0A7; }
[data-theme="dark"] .ap-q.m-problem { --m: #F97066; --m-s: #3A1210; --m-k: #FDA29B; }
/* the app-wide dark theme tints the card dark, so its ink goes light again */
[data-theme="dark"] .ap-q:is(.m-working, .m-problem) { --text: #F2F4F7; --text-2: #D0D5DD; --muted: #98A2B3;
  --line-strong: rgba(255,255,255,.3); --surface: #101828; --red: #FDA29B; }
[data-theme="dark"] .ap-mp-state.m-working { background: #0B2E1D; color: #75E0A7; border-color: #47CD89; }
[data-theme="dark"] .ap-mp-state.m-problem, [data-theme="dark"] .ap-mp-problems { background: #3A1210; color: #FDA29B; border-color: #F97066; }
[data-theme="dark"] .ap-mp-problems h3, [data-theme="dark"] .ap-mp-problems strong, [data-theme="dark"] .ap-mp-problems li { color: #FDA29B; }
[data-theme="dark"] .ap-mp-problems li + li { border-top-color: #6B231E; }
[data-theme="dark"] .ap-mp-problems .btn.small { background: transparent; border-color: #F97066; color: #FDA29B; }
[data-theme="dark"] .ap-mp-problems .btn.small:hover { background: #5A1D19; }
@media (prefers-reduced-motion: reduce) { .ap-q { transition: none; } .ap-q:hover { transform: none; } }
/* Ask on Production and KPIs (apps.js › askBox): Ask Acter's own composer (ak-box, ak-input, ak-send, ak-chip in ask.css),
   plus only what's different here: quick questions in the tool row, a spinner while it looks, the answer under the box. */
.ap-ask { display: flex; flex-direction: column; gap: 14px; }
.ap-ask .ak-box { padding: 12px 10px 8px 16px; }
.ap-ask .ak-input { min-height: 48px; }
.ap-ask .ak-tools { gap: 8px; }
.ap-ask-quicks { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.ap-ask-quick { height: 30px; flex: none; }
.ap-ask-quick:disabled { opacity: .5; cursor: default; border-color: var(--line-strong); color: var(--text-2); }
.ap-ask .ak-send.ap-busy:disabled { background: var(--text); }
.ap-ask-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ap-ask-spin .7s linear infinite; }
@keyframes ap-ask-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ap-ask-spin { animation-duration: 2.4s; } }
.ap-ask-out .ak-body { padding: 12px 16px 6px; }
.ap-ask-q { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.ap-answer { margin: 0; white-space: pre-line; }
.ap-ask-out .ak-foot { align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ap-ask-fine { margin-left: auto; padding: 0 8px; font-size: 12px; color: var(--faint); }
@media (max-width: 760px) {
  .ap-ask-quick:nth-child(n+2), .ap-ask-open span { display: none; }
  .ap-ask-out.ak-acter { grid-template-columns: minmax(0, 1fr); }
  .ap-ask-out .ak-mark { display: none; }
  .ap-ask-fine { margin-left: 0; }
}
.ap-assist { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ap-assist input { min-height: 38px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: 4px; font: inherit; }
.ap-assist .btn { min-height: 48px; font-size: 15px; }
.ap-timeline { border-top: 1px solid var(--line); padding-top: 10px; }
.ap-timeline ol { margin: 6px 0; padding-left: 20px; }
.ap-list { margin: 0; padding-left: 18px; }
.ap-num { width: 84px; min-height: 36px; padding: 0 8px; border: 1.5px solid var(--line-strong); border-radius: 4px; font: inherit; }
.ap-board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.ap-col { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ap-mini { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--subtle); }
.ap-kpi-area { display: flex; flex-direction: column; gap: 10px; }
.ap-kpi-area > h2 { font-size: 16px; }
.ap-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ap-kpi { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ap-kpi.open { grid-column: span 2; }
.ap-kpi-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.ap-kpi-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ap-kpi-val { font-size: 24px; font-variant-numeric: tabular-nums; }
.ap-kpi-val.none { font-size: 14px; color: var(--muted); font-weight: 600; }
.ap-kpi-how { border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.ap-kpi-how p { margin: 0 0 4px; }
.ap-spark { width: 120px; height: 32px; }
.ap-spark-line { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ap-spark-hit { fill: transparent; stroke: none; cursor: default; }
.ap-spark-hit:hover { fill: var(--text); }
.ap-report { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .ap { padding: 16px; } .ap-kpi.open { grid-column: auto; } .ap-board { grid-template-columns: repeat(4, 220px); } }
/* Site view route mode (2026-11-16) */
.sv-route { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.sv-route .sv-link { text-align: left; white-space: normal; border-left: 0; padding: 0; }
/* Route view: the ticket's route history (siteview.js historyView). Stops numbered like the stops on the map, joined by the
   route's blue; the stop it's at now is filled blue, as on the map. Each scan: time · what was done · who. */
.sv-card.sv-routing { width: 344px; }
.sv-hist-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sv-hist-title { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sv-hist-top .btn { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.sv-hist { list-style: none; margin: 0 0 12px; padding: 0; }
.sv-hist-stop { position: relative; padding: 0 0 14px 32px; }
.sv-hist-stop::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 2px; border-radius: 1px; background: rgba(21, 112, 239, .35); }
.sv-hist-stop:last-child { padding-bottom: 0; }
.sv-hist-stop:last-child::before { display: none; }
.sv-hist-n { position: absolute; left: 0; top: 0; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #1570ef; background: var(--surface); color: #1570ef; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sv-hist-stop.now .sv-hist-n { background: #1570ef; color: #fff; }
.sv-hist-stop.off .sv-hist-n { width: 12px; height: 12px; left: 5px; top: 5px; border-color: var(--faint); }
.sv-hist-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.sv-hist-head strong { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-hist-day { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sv-hist-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sv-hist-step { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 12.5px; line-height: 1.35; }
.sv-hist-t { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sv-hist-did { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.sv-hist-detail { color: var(--muted); font-size: 12px; }
.sv-hist-who { display: flex; flex-direction: column; align-items: flex-end; max-width: 108px; color: var(--text-2); font-weight: 500; text-align: right; }
.sv-hist-who > span:first-child { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-hist-nopin { font-size: 11px; color: var(--amber); }
.sv-hist-daybreak { font-size: 11.5px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.sv-card .sv-hist-note { margin: 4px 0 0; }
.sv-more { margin: 0 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.sv-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sv-more[open] summary { margin-bottom: 8px; }
[data-theme="dark"] .sv-hist-n { border-color: #84adff; color: #84adff; background: #1C1C1C; }
[data-theme="dark"] .sv-hist-stop.now .sv-hist-n { background: #2e90fa; border-color: #2e90fa; color: #fff; }
[data-theme="dark"] .sv-hist-stop::before { background: rgba(132, 173, 255, .35); }
.sv-exit-route { font-weight: 700; }
/* left nav: the Apps section (2026-11-16) */
.nav-sec { margin: 14px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.nav-ext { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Apps page: one square per app */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.app-sq { aspect-ratio: 1 / 1; display: flex; flex-direction: column; gap: 8px; padding: 20px; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease; }
.app-sq:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12); transform: translateY(-1px); }
.app-sq:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.app-sq-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--text); color: var(--surface); display: grid; place-items: center; }
.app-sq-img { width: 52px; height: 52px; border-radius: 12px; display: block; }
.app-sq-n { margin-top: 6px; font-size: 16px; }
.app-sq-about { font-size: 13px; color: var(--muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.app-sq-open { margin-top: auto; font-size: 13px; font-weight: 600; }
/* coming soon (soon: true in site_data/silverdale_apps.json): greyscale, not clickable */
.app-sq-soon { filter: grayscale(1); opacity: 0.55; cursor: default; user-select: none; }
.app-sq-soon:hover { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); transform: none; }
.app-sq-soon .app-sq-open { color: var(--muted); }

/* Site view HUD (2026-11-16): title card with stats, camera switch top right, dock bottom right */
.sv-title { min-width: 240px; max-width: 420px; padding: 12px 14px; }
.sv-title-top { display: flex; align-items: center; gap: 8px; }
.sv-scale { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px; }
.sv-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sv-stat { display: flex; flex-direction: column; line-height: 1.15; }
.sv-stat strong { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.sv-stat span { font-size: 11px; color: var(--muted); }
.sv-floor { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.sv-floor.bad { color: var(--red); }
.sv-floor .sv-link { margin-left: auto; }
/* the red line in the title card: how many problems and where; each name flies there (siteview.js › alertLine) */
.sv-alerts { margin-top: 10px; padding: 7px 10px; border-radius: 6px; line-height: 1.5;
  background: #fdecea; border: 1px solid #f4b7b1; color: #9c1a12; font-size: 12px; font-weight: 600; }
.sv-alert-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d92d20; margin-right: 6px; vertical-align: 0; }
.sv-alert-go { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sv-alert-go:focus-visible { outline: 2px solid #9c1a12; outline-offset: 2px; border-radius: 2px; }
/* the problems at a machine or area, in its card */
.sv-problems { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: #fdecea; border: 1px solid #f4b7b1; color: #5a130d; font-size: 12px; }
.sv-problems > strong { display: block; color: #9c1a12; font-size: 12px; margin-bottom: 4px; }
.sv-problems ul { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sv-problems li { display: flex; flex-direction: column; }
.sv-problems .meta { color: #7a2e26; font-size: 12px; }
.sv-pb-title { font-weight: 600; color: #9c1a12; display: flex; align-items: center; gap: 6px; }
.sv-pb-now { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #d92d20; color: #fff; border-radius: 3px; padding: 1px 5px; }
.sv-problems .sv-link { border-left: 0; padding: 0; color: #9c1a12; text-decoration: underline; }
[data-theme="dark"] .sv-alerts, [data-theme="dark"] .sv-problems { background: #3a1210; border-color: #f97066; color: #fda29b; }
[data-theme="dark"] .sv-problems > strong, [data-theme="dark"] .sv-pb-title, [data-theme="dark"] .sv-problems .meta, [data-theme="dark"] .sv-problems .sv-link { color: #fda29b; }
.sv-head { align-items: flex-start; }
.sv-actions { justify-content: flex-end; }
.sv-pill { height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-pill:hover { background: var(--subtle); }
.sv-pill.on { background: #101828; color: #fff; }
.sv-seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
.sv-seg-b { height: 28px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sv-seg-b.on { background: #101828; color: #fff; }
.sv-seg-b:disabled { cursor: default; }

.sv-dock { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sv-dock[hidden] { display: none; }
.sv-dgroup { display: flex; flex-direction: column; background: var(--surface); border-radius: 10px; box-shadow: 0 2px 8px rgba(16, 24, 40, .2); overflow: hidden; }
.sv-db { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--text); cursor: pointer; }
.sv-db + .sv-db { border-top: 1px solid var(--line); }
.sv-db:hover { background: var(--subtle); }
.sv-db:focus-visible, .sv-compass:focus-visible, .sv-pill:focus-visible, .sv-seg-b:focus-visible { outline: 2px solid #1570ef; outline-offset: 2px; }
.sv-db.off { color: var(--muted); }
.sv-db.on { background: #101828; color: #fff; }
.sv-compass { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; box-shadow: 0 2px 8px rgba(16, 24, 40, .2); }
.sv-needle { position: absolute; inset: 7px; display: block; transition: transform .08s linear; }
.sv-needle i { position: absolute; left: 50%; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; transform: translateX(-50%); }
.sv-needle i.n { top: 0; border-bottom: 15px solid #d92d20; }
.sv-needle i.s { bottom: 0; border-top: 15px solid #98a2b3; }
.sv-compass-n { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: var(--text);
  background: var(--surface); border-radius: 4px; padding: 0 3px; line-height: 14px; pointer-events: none; }

.sv-help { position: absolute; right: 68px; bottom: 16px; width: 360px; background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .22); }
.sv-help[hidden] { display: none; }
.sv-help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13px; align-items: center; }
.sv-help dd { margin: 0; color: var(--text-2); }
.sv-help kbd { font: inherit; font-size: 12px; font-weight: 600; background: var(--subtle); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; white-space: nowrap; color: var(--text); }
.sv-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  background: rgba(16, 24, 40, .88); color: #fff; font-size: 13px; padding: 8px 8px 8px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgba(16, 24, 40, .3); }
.sv-hint[hidden] { display: none; }
.sv-hint-x { border: 0; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.sv-hint-x:hover { background: rgba(255, 255, 255, .26); }

/* labels off: everything but route stops and what's picked */
.f3d-nolabels .f3d-label:not(.stop):not(.on):not(.alert) { display: none; }

[data-theme="dark"] .sv-pill, [data-theme="dark"] .sv-seg, [data-theme="dark"] .sv-dgroup, [data-theme="dark"] .sv-compass,
[data-theme="dark"] .sv-help, [data-theme="dark"] .sv-compass-n { background: #1C1C1C; color: #E5E5E5; }
[data-theme="dark"] .sv-stat strong, [data-theme="dark"] .sv-db { color: #FAFAFA; }
[data-theme="dark"] .sv-pill.on, [data-theme="dark"] .sv-seg-b.on, [data-theme="dark"] .sv-db.on { background: #FAFAFA; color: #1C1C1C; }
[data-theme="dark"] .sv-db:hover { background: #2A2A2A; }
@media (max-width: 760px) { .sv-hint { display: none; } .sv-title { min-width: 0; } }

/* dropdown */
.ui-dd { position: relative; }
.ui-dd-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: border-color .12s, background .12s; white-space: nowrap; }
.ui-dd-btn:hover { border-color: #98A2B3; }
.ui-dd-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(16, 24, 40, .1); border-color: #101828; }
.ui-dd-btn.open { border-color: #101828; box-shadow: 0 0 0 4px rgba(16, 24, 40, .08); }
.ui-dd-btn.set { background: #F2F4F7; border-color: #101828; }
.ui-dd-l { color: var(--muted); }
.ui-dd-v { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ui-dd-btn svg { color: var(--muted); transition: transform .15s; }
.ui-dd-btn.open svg { transform: rotate(180deg); }
.ui-dd-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 260px; max-width: 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px -6px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08); padding: 6px; outline: none;
  animation: ui-pop .12s ease-out; }
.ui-dd.right .ui-dd-panel { left: auto; right: 0; }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.ui-dd-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 0 0 6px; height: 36px; border-bottom: 1px solid var(--line); color: var(--muted); }
.ui-dd-q { flex: 1; border: 0; outline: none; background: none; font: inherit; font-size: 13.5px; color: var(--text); min-width: 0; }
.ui-dd-list { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; }
.ui-dd-opt { display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px 0 8px; border-radius: 7px;
  font-size: 13.5px; color: var(--text); cursor: pointer; user-select: none; }
.ui-dd-opt.hi { background: #F2F4F7; }
.ui-dd-opt.sel .ui-dd-txt { font-weight: 600; }
.ui-dd-tick { display: flex; color: var(--text); }
.ui-dd-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-dd-hint { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.ui-dd-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.ui-dd-none { padding: 14px 10px; font-size: 13px; color: var(--muted); text-align: center; }

/* toggle button with a check box, filter token, neutral badge */

.ui-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #344054;
  background: #F2F4F7; border: 1px solid #EAECF0; white-space: nowrap; }
.ui-badge.t-contractor { background: #101828; color: #fff; border-color: #101828; }
.ui-badge.t-wholesale { background: #fff; color: #101828; border-color: #101828; }

/* the table */

[data-theme="dark"] .ui-dd-btn, [data-theme="dark"] .ui-dd-panel { background: #1C1C1C; border-color: #424242; }
[data-theme="dark"] .ui-dd-opt.hi, [data-theme="dark"] .ui-dd-btn.set { background: #2A2A2A; }
[data-theme="dark"] .ui-badge { background: #2A2A2A; border-color: #424242; color: #E5E5E5; }

/* ================================================================ operator edits (2026-11-16) */
/* nav: pages that work on top, the ones coming soon under their own heading */
.nav-sep { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

/* alerts: a dismiss icon next to Fix; one click asks, the second dismisses */
.al-dismiss { width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); }
.al-dismiss:hover { color: var(--text); }
.al-confirm { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.al-confirm-q { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 2px; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* Site view: double-click a building's or an area's name to rename it */
.f3d-label.editing { padding: 2px; pointer-events: auto; z-index: 5; }
.f3d-label.saving { opacity: .7; }
.f3d-label-in { font: inherit; font-size: 12px; font-weight: 600; color: #101828; background: #fff; border: 1px solid #1570ef; border-radius: 3px;
  padding: 2px 6px; outline: none; box-shadow: 0 0 0 3px rgba(21, 112, 239, .25); }
.f3d-label.bld, .f3d-label.zone { user-select: none; -webkit-user-select: none; }
/* deleting a ticket from the line: one click, then confirm */
.sv-del { align-self: flex-start; }
.sv-del-confirm { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #FDA29B; border-radius: 8px; background: #FEF3F2; }
.sv-del-confirm strong { color: #B42318; font-size: 13.5px; }
.sv-del-confirm .fld { display: flex; flex-direction: column; gap: 6px; }
.sv-why-l { font-size: 12px; font-weight: 600; color: var(--text-2); }
.sv-why { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sv-why-b { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.sv-why-b:hover { border-color: var(--text); }
.sv-why-b.on { background: #101828; border-color: #101828; color: #fff; }
.sv-why-b:focus-visible { outline: 2px solid #1570ef; outline-offset: 2px; }
.sv-del-yes { background: #D92D20; border: 1px solid #D92D20; color: #fff; font-weight: 600; }
.sv-del-yes:hover:not(:disabled) { background: #B42318; border-color: #B42318; }
.sv-del-yes:disabled { background: #FDA29B; border-color: #FDA29B; color: #fff; cursor: not-allowed; }
[data-theme="dark"] .sv-why-b.on { background: #F5F5F5; border-color: #F5F5F5; color: #171717; }
[data-theme="dark"] .sv-del-yes:disabled { background: #55160C; border-color: #55160C; color: #A3A3A3; }
[data-theme="dark"] .sv-del-confirm { background: rgba(217, 45, 32, .12); border-color: #912018; }
[data-theme="dark"] .sv-del-confirm strong { color: #FDA29B; }

/* Settings › the Sheets card opens and closes */
.sheets-card { padding: 0; }
.sheets-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; padding: 18px 20px; border-radius: inherit; }
.sheets-toggle:hover { background: var(--subtle); }
.sheets-toggle svg { flex: none; color: var(--muted); transition: transform .15s; }
.sheets-card.open .sheets-toggle svg { transform: rotate(180deg); }
.sheets-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheets-t h2 { font-size: 16px; }
.sheets-t .meta.bad { color: var(--red); }
.sheets-body { padding: 0 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.sheets-card.open .sheets-toggle { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.sheets-card.open .sheets-body { padding-top: 14px; }

/* Customer page: the list down the left, neighbours by name, jump to a section */

/* ---- photos from the station iPads (taken at Complete), on the Production ticket and the Site view card */
.tkph { margin: 4px 0 8px; }
.tkph h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tkph-strip { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 10px; overflow-x: auto; }
.tkph-strip li { display: flex; flex-direction: column; gap: 3px; flex: none; width: 144px; }
.tkph-strip .meta { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tkph-link { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--subtle); aspect-ratio: 4 / 3; cursor: zoom-in; }
.tkph-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tkph-link:hover { border-color: var(--text); }
.sv-photos { display: grid; gap: 6px; margin: 2px 0 6px; }
.sv-photos ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sv-photos a { display: block; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--subtle); aspect-ratio: 4 / 3; cursor: zoom-in; }
.sv-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-photos a:hover { border-color: var(--text); }

/* Settings › Data bank: the whole card opens the Data bank (2026-11-23) */
.db-card { flex-direction: row; align-items: center; gap: 16px; color: inherit; text-decoration: none; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.db-card:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px -8px rgba(16,24,40,.25); }
.db-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.db-card-ic { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--subtle); border: 1px solid var(--line); display: inline-flex;
  align-items: center; justify-content: center; color: var(--text); }
.db-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.db-card-t { font-size: 16px; font-weight: 600; color: var(--text); }
.db-card-s { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.db-card-list { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--text-2); }
.db-card-list li { overflow-wrap: anywhere; }
.db-card-list li.bad { color: var(--red); }
.db-card-go { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.db-card:hover .db-card-go { color: var(--text); }


/* ---- the 8:30 packet, made and shown on the page (apps.js packet830) */
.pk-open { overflow: hidden; }
.pk-back { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: rgba(20, 22, 26, .72); }
.pk-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface, #fff); border-bottom: 1px solid var(--line, #e5e7eb); }
.pk-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.pk-title strong { font-size: 16px; }
.pk-status { font-size: 13px; color: var(--text-2, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-status.bad { color: #b91c1c; font-weight: 600; }
.pk-dl[aria-disabled="true"] { pointer-events: none; opacity: .5; }
.pk-pages { flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px 16px 48px; }
.pk-page { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pk-page img { display: block; width: min(816px, 92vw); height: auto; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.pk-page figcaption { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .85); }
@media print {
  @page { size: letter; margin: 0; }
  body.pk-printing > *:not(.pk-back) { display: none !important; }
  body.pk-printing .pk-back { position: static; background: none; display: block; }
  body.pk-printing .pk-bar, body.pk-printing .pk-page figcaption { display: none !important; }
  body.pk-printing .pk-pages { display: block; overflow: visible; padding: 0; }
  body.pk-printing .pk-page { display: block; break-after: page; page-break-after: always; }
  body.pk-printing .pk-page:last-child { break-after: auto; page-break-after: auto; }
  body.pk-printing .pk-page img { width: 8.5in; height: 11in; box-shadow: none; }
}

/* ⌘K search (palette.js, 2026-11-30). Classes are pal-*: .kp belongs to the KPI page (kpis.css) */
.pal-back { position: fixed; inset: 0; z-index: 90; background: rgba(16, 24, 40, .32); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 20px 48px rgba(16, 24, 40, .22); overflow: hidden; }
.pal-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pal-in { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 6px 0; }
.pal-esc { font: 11px/1 inherit; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 5px; }
.pal-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.pal-h { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pal-row { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.pal-row[aria-selected="true"] { background: var(--subtle); box-shadow: inset 2px 0 0 var(--text); }
.pal-l { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-note { padding: 12px 10px; color: var(--muted); }
.pal-foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
@media (max-width: 767px) { .pal-back { padding: 8px; } .pal { max-height: calc(100vh - 16px); } .pal-foot { display: none; } }

/* Acter's own "are you sure?" box (app.js confirmBox, 2026-11-30) */
.ac-dlg-back { position: fixed; inset: 0; z-index: 95; background: rgba(16, 24, 40, .32); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ac-dlg { width: min(420px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 20px 48px rgba(16, 24, 40, .22); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.ac-dlg h2 { font-size: 16px; }
.ac-dlg p { margin: 0; color: var(--text-2); }
.ac-dlg-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
