/* Strata — site-signage world.
   Status speaks the ISO 7010 code: go (green) · caution (amber) · action (mandatory blue) · stop (red). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(/fonts/barlowc-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/fonts/barlowc-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlowc-700.woff2) format("woff2"); }

:root {
  --chrome: #3a3d40;
  --chrome-deep: #2e3133;
  --chrome-line: #4b4f53;
  --chrome-ink: #eceeeb;
  --chrome-muted: #a7acaf;
  --ground: #f4f4f1;
  --action-deep: #164d8a;
  --plate: #ffffff;
  --rule: #dcddd7;
  --rule-strong: #c7c9c2;
  --ink: #1d2124;
  --ink-2: #464b4f;
  --muted: #5c6165;
  --go: #216536;
  --go-deep: #19512b;
  --go-wash: #e8f1ea;
  --caution: #f2b705;
  --caution-ink: #6b5100;
  --caution-wash: #fdf6dc;
  --action: #1d5fa8;
  --action-wash: #e8eff8;
  --stop: #c8312a;
  --stop-wash: #fbecea;
  --neutral-plate: #e6e7e2;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(29, 33, 36, .05), 0 2px 8px -4px rgba(29, 33, 36, .08);
  --shadow-lift: 0 2px 4px rgba(29, 33, 36, .06), 0 12px 28px -12px rgba(29, 33, 36, .22);
  --rail: 252px;
  --top: 56px;
  --font: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Barlow", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--ground); font-variant-numeric: tabular-nums; caret-color: var(--go);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--neutral-plate); color: var(--ink); }
a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: #b9bbb4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c2c4bd; border-radius: 10px; border: 2px solid var(--ground); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 .75em; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------------- Shell ---------------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--chrome); color: var(--chrome-ink);
  display: flex; flex-direction: column; scrollbar-color: #5a5f63 transparent;
}
.brand { display: flex; align-items: center; gap: 10px; height: var(--top); padding: 0 18px; border-bottom: 1px solid var(--chrome-line); text-decoration: none; color: #fff; flex: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name { font-family: var(--cond); font-weight: 700; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; }
.brand-co { font-size: 11px; color: var(--chrome-muted); letter-spacing: .02em; display: block; margin-top: -3px; }
.nav { padding: 10px 10px 24px; }
.nav-sec { margin-top: 6px; }
.nav-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 5px;
  font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--chrome-muted);
}
.nav-sec > summary::-webkit-details-marker { display: none; }
.nav-sec > summary:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-sec > summary .chev { margin-left: auto; transition: transform .25s var(--ease); width: 14px; height: 14px; }
.nav-sec[open] > summary .chev { transform: rotate(90deg); }
.nav a.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 12px; border-radius: 5px; color: var(--chrome-ink);
  text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.25;
}
.nav a.nav-item svg { color: var(--chrome-muted); width: 17px; height: 17px; }
.nav a.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.nav-item.on { background: var(--ground); color: var(--ink); font-weight: 600; }
.nav a.nav-item.on svg { color: var(--go); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 3px; background: var(--action); color: #fff; }
.nav .count.stop { background: var(--stop); }
.rail-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--chrome-line); font-size: 12px; color: var(--chrome-muted); }
.sec-ico, .nav-fly-title { display: none; }
.rail-btn .when-mini { display: none; }

/* Collapsed rail (desktop): icons only, each section opens as a fly-out beside the rail. Remembered per browser. */
@media (min-width: 992px) {
  .shell { transition: grid-template-columns .25s var(--ease); }
  .rail-mini .shell { grid-template-columns: 68px 1fr; }
  .rail-mini .rail { overflow-x: hidden; z-index: 45; }
  .rail-mini .brand { padding: 0; justify-content: center; }
  .rail-mini .brand-text, .rail-mini .rail-foot, .rail-mini .nav-label, .rail-mini .nav-sec > summary .chev { display: none; }
  .rail-mini .nav { padding: 10px 8px 24px; }
  .rail-mini .nav > a.nav-item, .rail-mini .nav-sec > summary { justify-content: center; padding: 10px 0; position: relative; }
  .rail-mini .nav > a.nav-item svg, .rail-mini .sec-ico { display: block; width: 19px; height: 19px; color: var(--chrome-muted); }
  .rail-mini .nav > a.nav-item.on svg { color: var(--go); }
  .rail-mini .nav-sec > summary:hover .sec-ico { color: #fff; }
  .rail-mini .nav-sec.has-on > summary { background: rgba(255,255,255,.08); }
  .rail-mini .nav-sec.has-on > summary .sec-ico { color: #f2b705; }
  .rail-mini .nav-sec[open] > summary { background: rgba(255,255,255,.12); }
  .rail-mini .nav .count { position: absolute; top: 3px; right: 6px; min-width: 0; padding: 0 4px; font-size: 10px; line-height: 15px; }
  .rail-mini .nav-sec-items { position: fixed; left: 72px; z-index: 70; width: 248px; max-height: calc(100vh - 24px); overflow-y: auto;
    background: var(--chrome); border: 1px solid var(--chrome-line); border-radius: 6px; padding: 6px; box-shadow: 10px 12px 34px rgba(0,0,0,.35); }
  .rail-mini .nav-sec-items .nav-label { display: inline; }
  .rail-mini .nav-fly-title { display: block; padding: 8px 10px 6px; font-family: var(--cond); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--chrome-muted); }
  .rail-mini .rail-btn .when-open { display: none; }
  .rail-mini .rail-btn .when-mini { display: block; }
}
@media (max-width: 991px) { .rail-btn { display: none !important; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top); background: var(--chrome); color: #fff; display: flex; align-items: center;
  gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--chrome-deep);
}
.search { flex: 1; max-width: 520px; position: relative; }
.search input[type=search] {
  width: 100%; height: 36px; border-radius: 5px; border: 1px solid #55595d; background: var(--chrome-deep); color: #fff;
  padding: 0 12px 0 36px; font: inherit; font-size: 14px;
}
.search input::placeholder { color: #9ca1a4; }
.search input[type=search]:focus { outline: none; border-color: #8fb4dd; background: #26292b; }
.search svg { position: absolute; left: 11px; top: 9px; width: 18px; height: 18px; color: #9ca1a4; pointer-events: none; z-index: 1; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 5px; color: #dfe2e0;
  background: transparent; border: 0; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 3px; background: var(--stop); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.who { display: flex; align-items: center; gap: 10px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--chrome-line); color: #fff; text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 4px; background: var(--chrome-line); color: #fff; display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .03em; flex: none; }
.who-name { font-size: 14px; font-weight: 600; line-height: 1.15; }
.who-role { font-size: 12px; color: var(--chrome-muted); line-height: 1.2; }

.page { padding: 28px 32px 64px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--cond); font-weight: 600; font-size: 32px; letter-spacing: .005em; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------------- Plates (surfaces) ---------------- */
.plate { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.plate + .plate { margin-top: 18px; }
.plate-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--rule); min-height: 50px; }
.plate-head h2, .plate-head h3 {
  font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink);
}
.plate-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.plate-body { padding: 18px; }
.plate-body.tight { padding: 0; }
.plate.hazard { position: relative; overflow: hidden; }
.plate.hazard::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: repeating-linear-gradient(-45deg, var(--caution) 0 10px, var(--ink) 10px 20px);
}
.plate.hazard .plate-head { padding-top: 17px; }

.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.stack > * + * { margin-top: 18px; }

/* ---------------- Status plates (signs) ---------------- */
.sign {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 3px; white-space: nowrap;
  font-family: var(--cond); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
  background: var(--neutral-plate); color: var(--chrome);
}
.sign.t-go { background: var(--go); color: #fff; }
.sign.t-caution { background: var(--caution); color: #1d2124; }
.sign.t-action { background: var(--action); color: #fff; }
.sign.t-stop { background: var(--stop); color: #fff; }
.sign.lg { height: 28px; font-size: 14px; padding: 0 11px; }
.sign svg { width: 13px; height: 13px; stroke-width: 2.4; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 3px; border: 1px solid var(--rule-strong); font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fff; white-space: nowrap; }
.cg { font-family: var(--cond); font-weight: 700; font-size: 13px; color: var(--ink-2); letter-spacing: .02em; }

/* Stamp: posted / void records */
.stamp {
  display: inline-block; padding: 4px 12px; border: 3px double currentColor; border-radius: 4px; transform: rotate(-4deg);
  font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.1;
}
.stamp.go { color: var(--go); } .stamp.stop { color: var(--stop); } .stamp.action { color: var(--action); }

/* ---------------- Boards (fixed-column lists) ---------------- */
.board-wrap { overflow-x: auto; }
table.board { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.board th {
  position: sticky; top: 0; z-index: 1; text-align: left; padding: 9px 12px; background: #eeefeb; color: var(--muted);
  font-family: var(--cond); font-weight: 700; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--rule-strong);
}
.board th.num { text-align: right; }
.board td { padding: 10px 12px; border-bottom: 1px solid #ecede8; vertical-align: middle; }
.board tbody tr { transition: background-color .15s; }
.board tbody tr:hover { background: #f8f8f5; }
.board tbody tr.r-stop { background: var(--stop-wash); }
.board tbody tr.r-action { background: #f3f7fc; }
.board tbody tr:last-child td { border-bottom: 0; }
.board tfoot td { padding: 10px 12px; font-weight: 700; border-top: 2px solid var(--ink); background: #fafaf8; }
.board a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.board a.row-link:hover { color: var(--action); text-decoration: underline; }
.board .ref { font-family: var(--cond); font-weight: 600; font-size: 14.5px; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; }
.board td.sub { color: var(--muted); font-size: 13px; }
.board input, .board select { height: 34px; font-size: 14px; }
@media (min-width: 992px) {
  table[data-lines] { min-width: 980px; }
  table[data-lines] td input[name$=".Description"] { min-width: 240px; }
}
.board .w-qty { width: 110px; } .board .w-rate { width: 120px; } .board .w-unit { width: 80px; }
.board tr.group td { background: #f3f3ef; font-family: var(--cond); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: 13px; color: var(--ink-2); }
.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty h3 { font-family: var(--cond); font-weight: 600; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }

/* ---------------- Toolbar / filters ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 4px; border: 1px solid var(--rule-strong);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--chrome); border-color: var(--chrome); color: #fff; }
.chip .n { font-size: 12px; color: inherit; opacity: .7; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 5px;
  border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--go); border-color: var(--go); color: #fff; }
.btn.primary:hover { background: var(--go-deep); border-color: var(--go-deep); }
.btn.action { background: var(--action); border-color: var(--action); color: #fff; }
.btn.action:hover { background: var(--action-deep); }
.btn.danger { color: var(--stop); border-color: #e3b1ad; }
.btn.danger:hover { background: var(--stop); color: #fff; border-color: var(--stop); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #ecece8; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
form.inline { display: inline; }
label.btn:has(:focus-visible) { outline: 2px solid var(--action); outline-offset: 2px; }
label.btn { cursor: pointer; }
.btn.block { width: 100%; }
.sig { border-top: 1px solid #333; padding-top: 6px; }
a.figure { color: inherit; text-decoration: none; }
a.figure:hover .v { text-decoration: underline; text-decoration-thickness: 2px; }
.feed li.r-stop { background: var(--stop-wash); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.f { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.s3 { grid-column: span 3; } .f.s4 { grid-column: span 4; } .f.s8 { grid-column: span 8; } .f.s12 { grid-column: span 12; } .f.s2 { grid-column: span 2; }
label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.req::after { content: " *"; color: var(--stop); }
.hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=time], input[type=month], input:not([type]), select, textarea {
  width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--rule-strong); border-radius: 5px; background: #fff; color: var(--ink);
  font: 400 15px/1.3 var(--font); font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 92px; padding: 9px 11px; line-height: 1.45; resize: vertical; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23464b4f' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: #a9aca4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px rgba(29, 95, 168, .18); }
input::placeholder, textarea::placeholder { color: #80858a; }
input[readonly] { background: #f6f6f3; }
input.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--go); }
.field-error, .validation-summary-errors { color: var(--stop); font-size: 13px; font-weight: 600; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.input-validation-error { border-color: var(--stop) !important; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.form-actions .right { margin-left: auto; display: flex; gap: 10px; }
fieldset { border: 0; padding: 0; margin: 0; }
.file-drop { border: 1.5px dashed var(--rule-strong); border-radius: 6px; padding: 26px; text-align: center; background: #fafaf8; transition: border-color .15s, background-color .15s; cursor: pointer; display: block; }
.file-drop:hover, .file-drop.over { border-color: var(--go); background: var(--go-wash); }
.file-drop strong { display: block; font-size: 15px; margin: 8px 0 2px; }

/* ---------------- Flash / notices ---------------- */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--go-wash); border-color: #b9d4c0; color: #123d20; }
.flash.err { background: var(--stop-wash); border-color: #ecc1bd; color: #7d1d17; }
.flash.info { background: var(--neutral-plate); border-color: var(--rule-strong); color: var(--ink); }
.flash.warn { background: var(--caution-wash); border-color: #ecd89a; color: #4f3c00; }
.flash svg { margin-top: 2px; }
[data-flip] { animation: flip .55s var(--ease) both; transform-origin: 50% 0; }
@keyframes flip { from { transform: perspective(600px) rotateX(-80deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Key facts ---------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; }
.fact { padding: 14px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.fact dt { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.fact dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.fact dd.big { font-family: var(--cond); font-size: 24px; font-weight: 600; letter-spacing: .01em; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 0; }

/* Figures row: money/quantity read at a glance (not hero metrics; a ruled strip) */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure { padding: 14px 18px; border-right: 1px solid var(--rule); min-width: 0; }
.figure:last-child { border-right: 0; }
.figure .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.figure .v { font-family: var(--cond); font-weight: 600; font-size: 27px; line-height: 1.1; margin-top: 4px; letter-spacing: .005em; white-space: nowrap; }
.figure .v small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.figure .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.figure .d.stop { color: var(--stop); font-weight: 600; } .figure .d.go { color: var(--go); font-weight: 600; }

/* ---------------- Your move board ---------------- */
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px; }
.move {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 13px; border-radius: 5px; background: #fff; border: 1px solid var(--rule);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
  position: relative; min-height: 104px;
}
.move:hover { border-color: var(--ink-2); color: var(--ink); }
.move .top { display: flex; align-items: center; gap: 8px; }
.move .when { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.move .when.stop { color: var(--stop); }
.move .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.move .m { font-size: 13px; color: var(--muted); margin-top: auto; }
.move.t-stop { border-color: #e8b4af; }

/* ---------------- Lifecycle strip ---------------- */
.lifecycle { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; padding: 16px; counter-reset: step; }
.lifecycle.vertical { grid-template-columns: 1fr; }
.lifecycle.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lifecycle.two .step { min-height: 58px; }
.figures.side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figures.side .figure { border-bottom: 1px solid var(--rule); }
.figures.side .figure:nth-child(2n) { border-right: 0; }
.figures.side .figure .v { font-size: 24px; }
.step { position: relative; padding: 9px 10px 10px; border-radius: 4px; background: var(--neutral-plate); color: var(--ink-2); min-height: 66px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.step .n { font-family: var(--cond); font-weight: 700; font-size: 13px; opacity: .75; }
.step .l { font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }
.step .c { font-size: 12px; margin-top: auto; font-weight: 600; }
.step.done { background: var(--go); color: #fff; }
.step.current { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.step.ledger::after { content: "GL"; position: absolute; top: 7px; right: 8px; font-family: var(--cond); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; opacity: .7; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a .n { font-size: 12px; margin-left: 4px; color: var(--muted); }

/* ---------------- Bars, meters, gantt ---------------- */
.meter { height: 8px; border-radius: 2px; background: #e3e4df; overflow: hidden; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--go); border-radius: 2px; }
.meter.caution > span { background: var(--caution); } .meter.stop > span { background: var(--stop); } .meter.action > span { background: var(--action); }
.hbar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 12px; align-items: center; padding: 8px 18px; font-size: 14px; }
.hbar + .hbar { border-top: 1px solid #f0f0ec; }
.hbar .bar { height: 14px; background: #ebebe7; border-radius: 2px; position: relative; overflow: hidden; }
.hbar .bar > span { position: absolute; inset: 0 auto 0 0; background: var(--chrome); border-radius: 2px; }
.hbar .bar > span.go { background: var(--go); } .hbar .bar > span.stop { background: var(--stop); } .hbar .bar > span.caution { background: var(--caution); }
.hbar .bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }

.gantt { display: grid; font-size: 13px; overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; min-height: 36px; border-bottom: 1px solid #efefeb; }
.gantt-row .name { padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.gantt-track { position: relative; height: 36px; }
.gantt-bar { position: absolute; top: 10px; height: 16px; border-radius: 3px; background: #c9cbc4; overflow: hidden; }
.gantt-bar > span { position: absolute; inset: 0 auto 0 0; background: var(--go); }
.gantt-bar.late { background: #efc4c0; } .gantt-bar.late > span { background: var(--stop); }
.gantt-ms { position: absolute; top: 10px; width: 16px; height: 16px; background: var(--ink); transform: rotate(45deg); margin-left: -8px; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--action); z-index: 1; }
.gantt-scale { display: grid; grid-template-columns: 260px 1fr; font-family: var(--cond); font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--rule-strong); background: #eeefeb; }
.gantt-scale .months { position: relative; height: 30px; }
.gantt-scale .months span { position: absolute; top: 8px; border-left: 1px solid var(--rule-strong); padding-left: 5px; white-space: nowrap; }

/* SVG chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); padding: 0 18px 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }


/* Chart hover layer: values lead, labels follow; line keys */
.tip { position: absolute; z-index: 5; min-width: 150px; padding: 9px 11px; background: #fff; border: 1px solid var(--rule-strong); border-radius: 5px; box-shadow: var(--shadow-lift); pointer-events: none; font-size: 13px; }
.tip-h { font-family: var(--cond); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tip-r { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: center; line-height: 1.6; }
.tip-r i { width: 14px; height: 3px; border-radius: 2px; }
.tip-r strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.tip-r span { color: var(--muted); }
.chart .mark { cursor: default; outline: none; }
.chart .mark path { transition: opacity .15s; }
.chart .mark.dim path { opacity: .35; }
.chart .mark:focus-visible rect { stroke: var(--action); stroke-width: 2; }
details.table-view { border-top: 1px solid var(--rule); }
details.table-view summary { cursor: pointer; padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
details.table-view .board { font-size: 13px; }
.board td.num, .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Activity / comments ---------------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f0f0ec; font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .avatar { width: 28px; height: 28px; font-size: 13px; background: var(--neutral-plate); color: var(--ink); }
.feed .meta { font-size: 12.5px; color: var(--muted); }

/* ---------------- AI take-off ---------------- */
.ai-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--neutral-plate); border-radius: 5px; color: var(--ink); font-size: 14px; }
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.conf .meter { width: 54px; height: 6px; }
.reading { display: flex; align-items: center; gap: 14px; padding: 28px; }
/* Static drawing sheet beside the "Reading the drawing…" text; no motion (the only motion moment is [data-flip]). */
.reading .scan { width: 140px; height: 96px; border: 1px solid var(--rule-strong); border-radius: 4px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(0deg, transparent 0 11px, #e6e7e2 11px 12px), repeating-linear-gradient(90deg, transparent 0 11px, #e6e7e2 11px 12px); flex: none; }

/* ---------------- Auth ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--chrome); }
.auth-scene { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; }
.auth-scene svg.scene { position: relative; display: block; flex: 1 1 auto; width: calc(100% + 96px); min-height: 160px; max-height: 620px; margin: 28px -48px -48px; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.auth-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 6px; padding: 8px 12px; height: 60px; }
.auth-logo img { max-height: 44px; max-width: 200px; width: auto; height: auto; display: block; }
.auth-brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-co-name { font-family: var(--cond); font-weight: 600; font-size: 20px; line-height: 1.1; color: #fff; max-width: 26ch; }
.auth-on { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #aeb3b0; letter-spacing: .04em; }
.auth-scene .brand-name { font-size: 30px; }
.auth-scene h1 { font-family: var(--cond); font-weight: 600; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; max-width: 14ch; margin-top: 56px; position: relative; }
.auth-scene p { color: #cfd3d1; max-width: 46ch; font-size: 16px; position: relative; margin-top: 14px; }
.auth-panel { background: var(--ground); display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-family: var(--cond); font-weight: 600; font-size: 30px; margin-bottom: 4px; }
.auth-card .f { margin-top: 14px; }
.demo-logins { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 16px; }
.demo-logins .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-logins button { text-align: left; height: auto; white-space: normal; min-width: 0; padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 1px; }
.demo-logins button span { font-size: 12px; color: var(--muted); font-weight: 500; }
.auth-panel { flex-direction: column; }
.auth-panel .auth-card { margin: auto 0; }
.auth-foot { width: 100%; max-width: 380px; margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.auth-foot strong { color: var(--ink-2); font-weight: 600; }

/* Login scene: the drawing becomes the building. Every element is drawn in its finished place, so with no
   animation (or reduced motion) the final picture shows; the keyframes start from the earlier states. */
.scene .s-draft { stroke-dasharray: 1; animation: s-draft 1.1s cubic-bezier(.16,1,.3,1) .15s both; }
.scene .s-draft.s-late { animation-delay: .55s; }
.scene .s-fill { animation: s-fade .6s ease-out .9s both; }
.scene .s-trolley { animation: s-travel 7s 1.2s both; }
.scene .s-hoist { animation: s-hoist 7s 1.2s both; }
.scene .s-cable { transform-box: fill-box; transform-origin: 50% 0; animation: s-cable 7s 1.2s both; }
.scene .s-load { animation: s-handoff-out 7s 1.2s both; }
.scene .s-placed { animation: s-handoff-in 7s 1.2s both; }
.scene .s-bay { transform-box: fill-box; transform-origin: 50% 100%; animation: s-pour 7s 1.2s both; }
.scene .s-beacon { animation: s-beacon 2.4s ease-in-out 8.2s infinite; }
.scene-paused .scene * { animation-play-state: paused !important; }

@keyframes s-draft { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes s-fade { from { opacity: 0; } }
/* trolley rides the jib from over the pipe rack (x 430) to the bay (x 663) */
@keyframes s-travel {
  0%, 26% { transform: translateX(-233px); animation-timing-function: cubic-bezier(.45,0,.2,1); }
  60%, 100% { transform: translateX(0); }
}
/* hook: resting on the rack (+91), lifted (0), lowered onto the frame (+20), back up empty (0) */
@keyframes s-hoist {
  0%, 6% { transform: translateY(91px); animation-timing-function: cubic-bezier(.4,0,.2,1); }
  24%, 62% { transform: translateY(0); animation-timing-function: cubic-bezier(.4,0,.6,1); }
  72%, 78% { transform: translateY(20px); animation-timing-function: cubic-bezier(.4,0,.2,1); }
  90%, 100% { transform: translateY(0); }
}
@keyframes s-cable {
  0%, 6% { transform: scaleY(2.625); animation-timing-function: cubic-bezier(.4,0,.2,1); }
  24%, 62% { transform: scaleY(1); animation-timing-function: cubic-bezier(.4,0,.6,1); }
  72%, 78% { transform: scaleY(1.357); animation-timing-function: cubic-bezier(.4,0,.2,1); }
  90%, 100% { transform: scaleY(1); }
}
@keyframes s-handoff-out { 0%, 74% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes s-handoff-in { 0%, 74% { opacity: 0; } 75%, 100% { opacity: 1; } }
/* the bay under the new beam fills, like a pour rising */
@keyframes s-pour { 0%, 80% { transform: scaleY(0); animation-timing-function: cubic-bezier(.16,1,.3,1); } 100% { transform: scaleY(1); } }
@keyframes s-beacon { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------------- Print ---------------- */
@media screen { .print-only { display: none !important; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .rail, .topbar, .no-print, .tabbar, .page-head .actions, .form-actions, .toolbar { display: none !important; }
  .shell { display: block; } .page { padding: 0; max-width: none; }
  .plate { box-shadow: none; border-color: #999; break-inside: avoid; }
  .print-only { display: block; } .doc-head.print-only { display: flex; }
  .board th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sign { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 3px solid var(--ink); }
.doc-head .co { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.doc-head .co strong { font-size: 18px; font-family: var(--cond); letter-spacing: .04em; display: block; color: var(--ink); }
.doc-title { font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .08em; text-transform: uppercase; text-align: right; }
.doc-printed { text-align: right; font-size: 11px; color: #666; }
.doc-logo { max-height: 48px; display: block; margin-bottom: 6px; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; font-size: 13px; }
.print-sub { font-family: var(--cond); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; margin: 18px 0 6px; }
.total-fig { text-align: right; font-family: var(--cond); font-size: 18px; font-weight: 600; }
.total-fig.lg { font-size: 20px; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; margin-top: 56px; font-size: 12px; }
.sig-grid.two { grid-template-columns: 1fr 1fr; }
.sig-grid.wide { gap: 48px; }
.pay-note { margin-top: 18px; padding: 10px 12px; border: 1px solid #bbb; border-radius: 4px; font-size: 12.5px; }

/* ---------------- Small components (formerly inline) ---------------- */
.ref-code { font-family: var(--cond); font-weight: 600; }
.link-strong, .link-plain { color: var(--ink); text-decoration: none; }
.link-strong { font-weight: 600; }
.boxed { border: 1px solid var(--rule); border-radius: 5px; }
.check.check-tile { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 5px; background: var(--plate); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.inset-note { padding: 12px 18px 0; }
.logo-box { height: 110px; border: 1px solid var(--rule); border-radius: 5px; display: grid; place-items: center; background: var(--plate); padding: 10px; }
.audit-diff { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; padding: 10px; background: #f6f6f3; border-radius: 4px; }
.legend i.k-in { background: var(--go); }
.legend i.k-out { background: #c9853a; }

/* ---------------- Utilities ----------------
   Single-purpose classes that replaced repeated inline style="" attributes.
   They carry !important so they keep the precedence the inline style had over component rules
   (e.g. .board tfoot td, .board td padding, mobile .f spans). Display utilities (.flex, .d-block,
   .d-contents; .grid above) deliberately do not, so [hidden] and print hiding still win. */
.flex { display: flex; }
.d-block { display: block; }
.d-contents { display: contents; }
.flex-col { flex-direction: column !important; } .flex-row { flex-direction: row !important; } .wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; } .flex-none { flex: none !important; } .minw-0 { min-width: 0 !important; }
.ai-c { align-items: center !important; } .ai-start { align-items: flex-start !important; }
.jc-end { justify-content: flex-end !important; } .jc-start { justify-content: flex-start !important; } .jc-between { justify-content: space-between !important; }
.gap-6 { gap: 6px !important; } .gap-8 { gap: 8px !important; } .gap-10 { gap: 10px !important; } .gap-12 { gap: 12px !important; } .gap-14 { gap: 14px !important; } .gap-16 { gap: 16px !important; }
.span-6 { grid-column: span 6 !important; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: 2px !important; } .mt-4 { margin-top: 4px !important; } .mt-6 { margin-top: 6px !important; } .mt-8 { margin-top: 8px !important; }
.mt-10 { margin-top: 10px !important; } .mt-12 { margin-top: 12px !important; } .mt-14 { margin-top: 14px !important; } .mt-18 { margin-top: 18px !important; }
.mb-4 { margin-bottom: 4px !important; } .mb-6 { margin-bottom: 6px !important; } .mb-10 { margin-bottom: 10px !important; } .mb-12 { margin-bottom: 12px !important; } .mb-16 { margin-bottom: 16px !important; } .mb-18 { margin-bottom: 18px !important; }
.ml-4 { margin-left: 4px !important; } .ml-6 { margin-left: 6px !important; } .ml-8 { margin-left: 8px !important; } .ml-12 { margin-left: 12px !important; } .ml-auto { margin-left: auto !important; }
.p-0 { padding: 0 !important; } .pt-0 { padding-top: 0 !important; } .pt-12 { padding-top: 12px !important; } .py-8 { padding-top: 8px !important; padding-bottom: 8px !important; padding-left: 0 !important; padding-right: 0 !important; }
.indent { padding-left: 28px !important; }
.rule-top { border-top: 1px solid var(--rule) !important; } .rule-bottom { border-bottom: 1px solid var(--rule) !important; }
.b-0 { border: 0 !important; } .bt-0 { border-top: 0 !important; } .bb-0 { border-bottom: 0 !important; }
.w-34 { width: 34px !important; } .w-40 { width: 40px !important; } .w-44 { width: 44px !important; } .w-80 { width: 80px !important; } .w-96 { width: 96px !important; }
.w-110 { width: 110px !important; } .w-120 { width: 120px !important; } .w-150 { width: 150px !important; } .w-170 { width: 170px !important; } .w-full { width: 100% !important; }
.h-32 { height: 32px !important; }
.minw-150 { min-width: 150px !important; } .minw-240 { min-width: 240px !important; } .minw-280 { min-width: 280px !important; }
/* Max-width caps, mostly for filter selects and inputs in toolbars */
.mw-150 { max-width: 150px !important; } .mw-160 { max-width: 160px !important; } .mw-170 { max-width: 170px !important; } .mw-180 { max-width: 180px !important; }
.mw-200 { max-width: 200px !important; } .mw-220 { max-width: 220px !important; } .mw-240 { max-width: 240px !important; } .mw-260 { max-width: 260px !important; }
.mw-280 { max-width: 280px !important; } .mw-300 { max-width: 300px !important; } .mw-320 { max-width: 320px !important; }
.ta-r { text-align: right !important; } .ta-c { text-align: center !important; }
.cond { font-family: var(--cond) !important; }
.fine { font-size: 12.5px !important; }
.lh-40 { line-height: 40px !important; }
.fw-400 { font-weight: 400 !important; } .fw-500 { font-weight: 500 !important; } .fw-600 { font-weight: 600 !important; } .fw-700 { font-weight: 700 !important; }
.c-go { color: var(--go) !important; } .c-ink { color: var(--ink) !important; } .c-ink2 { color: var(--ink-2) !important; }
.c-stop { color: var(--stop) !important; } .m-12 { margin: 12px !important; } .pb-0 { padding-bottom: 0 !important; }
.pre-wrap { white-space: pre-wrap !important; }
.ellipsis { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.list-none { list-style: none !important; }
.pointer { cursor: pointer !important; }

/* ---------------- Phone shell (FR-PF9) ---------------- */
.tabbar { display: none; }
.sheet-backdrop { display: none; }
@media (max-width: 1180px) {
  .g-main { grid-template-columns: 1fr; }
  .lifecycle, .lifecycle.two { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 60; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: 8px 0 40px rgba(0,0,0,.35); }
  body.menu-open .rail { transform: none; }
  body.menu-open .sheet-backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 22, 24, .5); z-index: 55; }
  .topbar { padding: 0 12px; gap: 8px; }
  .who-name, .who-role { display: none; } .who { border: 0; padding: 0; }
  .search { max-width: none; }
  .page { padding: 18px 14px 96px; }
  .page-head h1 { font-size: 26px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .f, .f.s3, .f.s4, .f.s8, .f.s2 { grid-column: span 12; }
  .lifecycle, .lifecycle.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moves { grid-template-columns: 1fr; padding: 12px; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figure { border-bottom: 1px solid var(--rule); }
  .figure .v { font-size: 23px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-scene { padding: 28px; }
  .auth-scene svg.scene { flex: none; width: calc(100% + 56px); height: 170px; min-height: 0; margin: 20px -28px -28px; }
  .auth-logo { height: 52px; } .auth-logo img { max-height: 36px; max-width: 150px; }
  .auth-panel { padding: 32px 20px; }
  .auth-scene h1 { margin-top: 24px; }
  .plate-head { flex-wrap: wrap; }
  .plate-head > .muted.small { flex-basis: 100%; order: 3; }
  [data-chart] { overflow-x: auto; }
  [data-chart] svg.chart { min-width: 540px; }
  .board.stack-sm thead { display: none; }
  .board.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid #ecede8; }
  .board.stack-sm td { border: 0; padding: 0; }
  .board.stack-sm td.hide-sm { display: none; }
  .gantt-row, .gantt-scale { grid-template-columns: 140px 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 50; background: var(--chrome);
    border-top: 1px solid var(--chrome-deep); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #cfd3d1; text-decoration: none; font: 600 11px var(--font); background: none; border: 0; padding: 4px 0; position: relative; }
  .tabbar a.on { color: #fff; }
  .tabbar a.on svg { color: #fff; }
  .tabbar .new { background: var(--go); color: #fff; border-radius: 6px; margin: 0 8px; }
  .tabbar .dot { position: absolute; top: 0; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 3px; background: var(--stop); color: #fff; font-size: 10px; display: grid; place-items: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Branch scope in the top bar: a switcher for all-branch users, a fixed label for branch staff. */
.branch-switch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--plate); color: var(--ink); font: 600 13px/1 var(--cond); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.branch-switch svg { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.branch-switch select { border: 0; height: 34px; padding: 0 22px 0 0; background-color: transparent; background-position: right 2px center; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; box-shadow: none; min-width: 0; }
.branch-switch select:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
@media (max-width: 991px) {
  .branch-switch { padding: 0 6px; }
  .branch-switch .branch-name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .branch-switch select { max-width: 108px; }
}

/* Document centre: folder tree beside the list. */
.f.s6 { grid-column: span 6; } .f.s9 { grid-column: span 9; }
.lib { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.tree { list-style: none; margin: 0; padding: 6px 0; font-size: 14px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--rule); margin-left: 17px; }
.tree a { display: flex; align-items: center; gap: 8px; padding: 6px 14px; color: var(--ink-2); text-decoration: none; border-left: 3px solid transparent; }
.tree ul a { padding-left: 8px; }
.tree a:hover { background: #f3f3ef; color: var(--ink); }
.tree a.on { background: var(--go-wash); color: var(--ink); font-weight: 600; border-left-color: var(--go); }
.tree a svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.tree a .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree .dept { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-ico { width: 34px; height: 34px; border-radius: 4px; display: grid; place-items: center; background: var(--neutral-plate); color: var(--ink-2); flex: none; }
.doc-ico svg { width: 18px; height: 18px; }
.answer { white-space: pre-wrap; line-height: 1.6; font-size: 15px; }
.fp { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
@media (max-width: 991px) {
  .lib { grid-template-columns: 1fr; }
  .lib > .tree-plate { order: 2; }
  .f.s6, .f.s9 { grid-column: span 12; }
}
.ico-sm { width: 14px !important; height: 14px !important; vertical-align: -2px; }
.mb-0 { margin-bottom: 0 !important; }

/* E-invoice: QR and chain facts */
.break-all { word-break: break-all; }
.einv-qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--rule); line-height: 0; }
.einv-qr svg { display: block; width: 132px; height: 132px; }
.einv-print { display: flex; gap: 16px; align-items: flex-start; margin-top: 18px; padding-top: 12px; border-top: 1px solid #ccc; break-inside: avoid; }
.einv-print .einv-qr svg { width: 104px; height: 104px; }
.einv-print .kv { flex: 1; margin: 0; }

/* Face check-in */
.btn.lg { height: 52px; font-size: 17px; padding: 0 22px; }
.grow { flex: 1 1 auto; }
.chip:has(input:focus-visible) { outline: 2px solid var(--go); outline-offset: 2px; }
.face-stage { overflow: hidden; }
.face-view { position: relative; background: #111; aspect-ratio: 4 / 3; max-height: 70vh; display: grid; place-items: center; }
.face-view video { width: 100%; height: 100%; object-fit: cover; }
.face-view video.mirror { transform: scaleX(-1); }
.face-guide { position: absolute; width: min(46%, 300px); aspect-ratio: 3 / 4; border: 3px dashed rgba(255,255,255,.75); border-radius: 50%; pointer-events: none; }
.face-prompt { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: var(--radius); background: rgba(20,22,24,.78); color: #fff; font-size: 16px; text-align: center; }
.face-prompt[hidden] { display: none; }
.face-result { position: absolute; inset: auto 12px 12px 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--plate); box-shadow: 0 8px 30px rgba(0,0,0,.35); border-left: 8px solid var(--rule-strong); display: grid; gap: 4px; }
.face-result.t-go { border-left-color: var(--go); }
.face-result.t-caution { border-left-color: var(--caution); }
.face-result.t-stop { border-left-color: var(--stop); }
.face-result-title { font-family: var(--cond); font-size: 26px; font-weight: 700; line-height: 1.1; }
.face-result-sub { color: var(--muted); font-size: 14px; }
.face-result-detail { font-size: 16px; }
.face-result .btn { justify-self: start; margin-top: 6px; }
.face-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.face-list li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--rule); }
.face-list li.muted { color: var(--muted); }
.face-list .time { font-variant-numeric: tabular-nums; color: var(--muted); }
.face-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--rule); display: block; }
@media (max-width: 991px) { .face-view { aspect-ratio: 3 / 4; max-height: 62vh; } }
.board tbody tr.r-caution { background: var(--caution-wash); }
.t-go-text { color: var(--go); font-weight: 600; } .t-stop-text { color: var(--stop); font-weight: 600; }

/* Site pin (Google Maps or the free map) */
.site-pin { display: grid; gap: 8px; }
.site-pin-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-map { height: 260px; border: 1px solid var(--rule-strong); border-radius: 5px; background: #e8eae4; }
.site-map.view { height: 220px; border: 0; border-top: 1px solid var(--rule); border-radius: 0; }
.site-pin-coords { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.site-pin-coords input { font-variant-numeric: tabular-nums; }
.site-pin-coords a { padding-bottom: 10px; white-space: nowrap; }
@media (max-width: 600px) { .site-pin-coords { grid-template-columns: 1fr 1fr; } .site-pin-coords a { grid-column: span 2; padding-bottom: 0; } }
.pac-container { z-index: 2000; font-family: inherit; }
