/* Harris & Hart Project Control
   Built on the harris-hart.com "Field" theme: navy ink, cool paper, one hi-vis yellow used sparingly,
   wide uppercase Archivo display type, IBM Plex Mono "title block" labels, square corners, hairline rules. */

:root {
  --ink: #0d1520;
  --ink-2: #394350;
  --ink-3: #66707d;
  --paper: #f3f4f5;
  --paper-2: #e5e8ec;
  --white: #ffffff;
  --steel: #8e99a6;
  --on-dark: #c4cbd4;
  --rule: rgba(13, 21, 32, 0.13);
  --rule-strong: rgba(13, 21, 32, 0.45);
  --rule-dark: rgba(255, 255, 255, 0.14);
  --hivis: #ffc400;

  /* Lifecycle stages: one hue, light -> dark, because the stages are ordered (detailed ... installed) */
  --stage-0: #b8c0c9;
  --stage-1: #86b6ef;
  --stage-2: #5598e7;
  --stage-3: #2a78d6;
  --stage-4: #1c5cab;
  --stage-5: #104281;
  --stage-6: #0b2e5c;
  --track: #dfe6ef;

  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Archivo", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 3.4vw, 40px);
  --max: 1440px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-variation-settings: "wdth" 100;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; }
p { margin: 0 0 1em; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--hivis); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 800;
  line-height: 0.98;
  margin: 0;
}
h1, h2 { font-variation-settings: "wdth" 118; text-transform: uppercase; letter-spacing: 0; }
h3, h4 { font-variation-settings: "wdth" 100; font-weight: 700; letter-spacing: -0.005em; }
h2 { font-size: clamp(22px, 2.2vw, 30px); }
h3 { font-size: 19px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.mono, .label {
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.label b { color: var(--ink); font-weight: 500; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--hivis); color: var(--ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { width: 42px; height: 42px; }
.brand span {
  font-family: var(--f-display); font-variation-settings: "wdth" 80; font-weight: 700;
  font-size: 20px; letter-spacing: 0.01em; line-height: 1;
}
.brand small {
  display: block; font-family: var(--f-mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); margin-top: 4px;
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.nav a, .nav .nav-top {
  position: relative; text-decoration: none; font-size: 15px; padding: 8px 12px; color: #fff;
  background: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.nav a::after, .nav .nav-top::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--hivis);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav a:hover::after, .nav a.active::after, .nav-item:hover > .nav-top::after { transform: scaleX(1); }
.nav .soon { color: var(--steel); }
.nav .soon em {
  font-style: normal; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.25); padding: 1px 4px; margin-left: 6px; vertical-align: 2px;
}
.nav-item { position: relative; display: flex; }
.nav-item > .nav-top { padding-right: 26px; }
.caret {
  position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.subnav {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 240px; padding: 6px 0;
  background: var(--ink); border: 1px solid rgba(255,255,255,.12); border-top: 1.5px solid var(--hivis);
  flex-direction: column;
}
.nav-item:hover .subnav, .nav-item:focus-within .subnav { display: flex; }
.subnav a { padding: 10px 16px; }
.subnav a::after { display: none; }
.subnav a:hover { background: rgba(255,255,255,.07); }
.subnav .sub-label { padding: 10px 16px 4px; color: var(--steel); }
.nav-item.right .subnav { left: auto; right: 0; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px 4px;
}
.avatar {
  width: 34px; height: 34px; display: grid; place-items: center; background: var(--hivis); color: var(--ink);
  font-family: var(--f-mono); font-size: 13px; font-weight: 500;
}
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who small { display: block; color: var(--steel); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.subnav form { margin: 0; }
.subnav button.linklike {
  width: 100%; text-align: left; background: none; border: 0; color: #fff; padding: 10px 16px; font: inherit; font-size: 15px; cursor: pointer;
}
.subnav button.linklike:hover { background: rgba(255,255,255,.07); }

.nav-toggle-input { display: none; }
.nav-toggle {
  display: none; margin-left: auto; color: #fff; border: 1px solid rgba(255,255,255,.45);
  font: 500 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 9px 12px; cursor: pointer;
}
@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav, .header-right { display: none; }
  .nav-toggle-input:checked ~ .nav, .nav-toggle-input:checked ~ .header-right {
    display: flex; position: absolute; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--ink); padding: 8px var(--gutter) 16px; margin: 0; border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .nav-toggle-input:checked ~ .nav { top: var(--header-h); }
  .nav-toggle-input:checked ~ .header-right { top: calc(var(--header-h) + var(--nav-h, 330px)); }
  .nav a, .nav .nav-top { font-size: 18px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav a::after, .nav .nav-top::after, .caret { display: none; }
  .nav-item { display: block; }
  .subnav { position: static; display: flex; border: 0; padding: 0 0 0 16px; }
}

/* ---------------------------------------------------------------- page head (dark band) */
.page-head { background: var(--ink); color: #fff; }
.page-head .wrap { padding-top: clamp(28px, 4vw, 52px); padding-bottom: clamp(24px, 3vw, 36px); }
.page-head .label { color: var(--steel); }
.page-head .label b { color: #fff; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 66px); margin: 14px 0 0; }
.page-head p.lede { color: var(--on-dark); max-width: 60em; margin: 14px 0 0; }
.page-head .head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Title block: facts in drawing-sheet cells */
.titleblock { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.titleblock > div { padding: 16px 20px 18px; border-right: 1px solid var(--rule); min-width: 0; }
.titleblock > div:first-child { padding-left: 0; }
.titleblock > div:last-child { border-right: 0; }
.titleblock strong {
  display: block; font-family: var(--f-display); font-variation-settings: "wdth" 72; font-weight: 700;
  font-size: clamp(26px, 2.8vw, 38px); line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums;
}
.titleblock .sub { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
.band-dark .titleblock, .page-head .titleblock { border-top-color: var(--rule-dark); margin-top: 28px; }
.band-dark .titleblock > div, .page-head .titleblock > div { border-color: var(--rule-dark); }
.page-head .titleblock .sub { color: var(--on-dark); }
@media (max-width: 760px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:nth-child(2n) { border-right: 0; }
  .titleblock > div:nth-child(2n+1) { padding-left: 0; }
  .titleblock > div { border-bottom: 1px solid var(--rule); }
  .page-head .titleblock > div { border-bottom-color: var(--rule-dark); }
}

/* ---------------------------------------------------------------- content */
main { flex: 1; }
.section { padding-top: clamp(24px, 3vw, 40px); padding-bottom: clamp(24px, 3vw, 40px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.panel { background: var(--white); border: 1px solid var(--rule); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.panel-body { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 20px; }

/* ---------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font-family: var(--f-body); font-size: 15px; font-weight: 600; text-decoration: none; line-height: 1.2;
  padding: 12px 18px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--white);
  cursor: pointer; border-radius: 0; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn--sm { padding: 7px 12px; font-size: 13.5px; }
.btn--hivis { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.btn--hivis:hover { background: #fff; border-color: #fff; }
.btn--danger { background: transparent; color: var(--critical); border-color: var(--critical); }
.btn--danger:hover { background: var(--critical); color: #fff; border-color: var(--critical); }
.on-dark .btn--ghost, .page-head .btn--ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.on-dark .btn--ghost:hover, .page-head .btn--ghost:hover { background: #fff; color: var(--ink); }
.btn .arrow { font-family: var(--f-mono); font-weight: 400; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.input, .field input, .field select, .field textarea, .toolbar input, .toolbar select, select.input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--white);
  border: 1px solid var(--rule-strong); border-radius: 0; padding: 10px 12px; width: 100%;
}
.input:focus, .field input:focus, .field select:focus, .toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--hivis); outline-offset: 0; border-color: var(--ink); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); }
.seg button {
  font: 500 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 9px 12px;
  background: var(--white); color: var(--ink); border: 0; border-right: 1px solid var(--rule); cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.alert { padding: 12px 16px; border-left: 4px solid var(--ink); background: var(--white); margin-bottom: 16px; }
.alert--error { border-left-color: var(--critical); }
.alert--ok { border-left-color: var(--good); }
.alert--warn { border-left-color: var(--warning); }
.secret {
  font-family: var(--f-mono); font-size: 18px; background: var(--paper-2); padding: 10px 14px; display: inline-block;
  letter-spacing: .04em; user-select: all; border: 1px dashed var(--rule-strong);
}

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding: 10px 12px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; background: var(--white);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tr:hover td { background: #fafbfc; }
table.data td.r, table.data th.r { text-align: right; }
table.data .sub { color: var(--ink-3); font-size: 13px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 7px; border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap; background: var(--white);
}
.tag--dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag--hivis { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.tag--muted { color: var(--ink-3); border-color: var(--rule); }
.swatch { width: 10px; height: 10px; display: inline-block; flex: none; }
.dot-ok::before, .dot-fail::before, .dot-run::before { content: ""; width: 8px; height: 8px; display: inline-block; margin-right: 6px; }
.dot-ok::before { background: var(--good); }
.dot-fail::before { background: var(--critical); }
.dot-run::before { background: var(--warning); }

/* ---------------------------------------------------------------- stage visuals */
.s0 { --c: var(--stage-0); } .s1 { --c: var(--stage-1); } .s2 { --c: var(--stage-2); } .s3 { --c: var(--stage-3); }
.s4 { --c: var(--stage-4); } .s5 { --c: var(--stage-5); } .s6 { --c: var(--stage-6); }

.meter { height: 8px; background: var(--track); position: relative; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--stage-3)); border-radius: 0 4px 4px 0; }

/* Job board rows */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-row {
  display: grid; grid-template-columns: minmax(210px, 2.2fr) minmax(0, 6fr) minmax(130px, 1.1fr);
  background: var(--white); border: 1px solid var(--rule); text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.job-row:hover { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--hivis); }
.job-id { padding: 16px 18px; border-right: 1px solid var(--rule); min-width: 0; }
.job-id .num { font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; color: var(--ink-3); }
.job-id h3 { margin: 6px 0 4px; font-size: 20px; line-height: 1.15; }
.job-stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.job-stages > div { padding: 14px 14px 16px; border-right: 1px solid var(--rule); min-width: 0; }
.job-stages .pct { font-family: var(--f-display); font-variation-settings: "wdth" 72; font-weight: 700; font-size: 26px; line-height: 1; margin: 6px 0 8px; }
.job-stages .label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.job-stages .cnt { font-size: 12px; color: var(--ink-3); margin-top: 6px; white-space: nowrap; }
.job-meta { padding: 14px 16px; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.job-meta b { font-weight: 600; color: var(--ink); }
@media (max-width: 1100px) {
  .job-row { grid-template-columns: 1fr; }
  .job-id { border-right: 0; border-bottom: 1px solid var(--rule); }
  .job-meta { border-top: 1px solid var(--rule); flex-direction: row; flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 640px) {
  .job-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .job-stages > div:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
}

/* Job detail pipeline */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--rule); }
.pipeline > div { padding: 18px 18px 20px; border-right: 1px solid var(--rule); position: relative; min-width: 0; }
.pipeline > div:last-child { border-right: 0; }
.pipeline > div::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.pipeline .step { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.pipeline h3 { font-variation-settings: "wdth" 118; text-transform: uppercase; font-size: 15px; font-weight: 800; margin: 4px 0 12px; }
.pipeline .big { font-family: var(--f-display); font-variation-settings: "wdth" 72; font-weight: 700; font-size: clamp(34px, 3.6vw, 52px); line-height: 1; font-variant-numeric: tabular-nums; }
.pipeline .of { font-size: 13px; color: var(--ink-3); margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.pipeline .delta { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
@media (max-width: 1000px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline > div:nth-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .pipeline > div:nth-child(3) { border-right: 0; }
}
@media (max-width: 560px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1.5px solid var(--ink); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; }
.tabs button {
  background: none; border: 0; padding: 12px 18px; font: 600 15px var(--f-body); color: var(--ink-3); cursor: pointer; position: relative; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--hivis); }
.tabs .count { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-left: 6px; }

/* Activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 120px 14px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.feed time { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); padding-top: 2px; }
.feed .swatch { margin-top: 6px; }

/* Financial figures */
.fig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.fig-grid > div { padding: 16px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--white); }
.fig-grid strong { display: block; font-family: var(--f-display); font-variation-settings: "wdth" 72; font-weight: 700; font-size: 28px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.locked {
  display: flex; gap: 12px; align-items: center; padding: 16px 18px; background: repeating-linear-gradient(135deg, var(--paper) 0 8px, var(--paper-2) 8px 9px);
  border: 1px dashed var(--rule-strong); color: var(--ink-2); font-size: 14px;
}
.locked svg { flex: none; }

/* Chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { font-family: var(--f-mono); font-size: 11px; fill: var(--ink-3); }
.chart .series path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .endlabel { font-family: var(--f-body); font-size: 12.5px; fill: var(--ink-2); }
.chart .xhair { stroke: var(--ink); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart.hovering .xhair { opacity: .35; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 12px; font-size: 13px;
  min-width: 190px; opacity: 0; transform: translate(12px, -50%); transition: opacity .1s; z-index: 5;
}
.chart.hovering .tip { opacity: 1; }
.chart .tip .d { font-family: var(--f-mono); font-size: 11px; color: var(--steel); letter-spacing: .06em; margin-bottom: 6px; }
.chart .tip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart .tip .row span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 16px; height: 2px; background: var(--c); display: inline-block; }

/* Empty states */
.empty { padding: 36px 18px; text-align: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }

/* Permission matrix */
table.matrix th.role { writing-mode: initial; text-align: center; min-width: 96px; }
table.matrix td.c { text-align: center; }
table.matrix tr.group td { background: var(--paper-2); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 8px 12px; }

/* Modal */
.dlg-backdrop { position: fixed; inset: 0; background: rgba(9, 14, 22, .6); z-index: 90; display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--paper); width: min(720px, 100%); max-height: 92vh; overflow: auto; border-top: 4px solid var(--hivis); }
.dlg-head { background: var(--ink); color: #fff; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; }
.dlg-head h2 { font-size: 22px; }
.dlg-head button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
.dlg-body { padding: 22px; }
.dlg-foot { padding: 0 22px 22px; display: flex; gap: 10px; justify-content: flex-end; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.checklist.tall { max-height: 260px; overflow: auto; border: 1px solid var(--rule); padding: 10px; background: var(--white); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--ink); color: var(--on-dark); margin-top: 48px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.site-footer .label { color: var(--steel); }

/* ---------------------------------------------------------------- sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 7fr) minmax(380px, 5fr); background: var(--ink); }
.auth-hero { position: relative; overflow: hidden; color: #fff; display: flex; align-items: flex-end; }
.auth-hero img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: hh-kenburns 18s ease-out forwards; }
.auth-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,14,22,.35) 0%, rgba(9,14,22,.82) 100%); }
.auth-hero .copy { position: relative; z-index: 2; padding: clamp(28px, 5vw, 72px); max-width: 860px; }
.auth-hero .label { color: var(--on-dark); }
.auth-hero h1 { font-size: clamp(40px, 5.8vw, 92px); margin: 16px 0 20px; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--hivis) 62%, var(--hivis) 92%, transparent 92%); color: #fff; }
.auth-hero p { color: var(--on-dark); max-width: 36em; font-size: 17px; }
.auth-hero .titleblock { border-top-color: var(--rule-dark); margin-top: 28px; --cols: 3; }
.auth-hero .titleblock > div { border-color: var(--rule-dark); }
.auth-hero .titleblock strong { color: #fff; }
@keyframes hh-kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
.auth-panel { background: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 64px); }
.auth-panel .brand { color: var(--ink); margin-bottom: 40px; }
.auth-panel .brand small { color: var(--ink-3); }
.auth-panel h2 { font-size: clamp(28px, 2.6vw, 40px); margin-bottom: 8px; }
.auth-panel .help { font-size: 14px; color: var(--ink-3); margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 16px; }
.auth-panel .btn { width: 100%; padding: 15px 22px; font-size: 16px; }
.auth-panel .validation-message, .validation-errors { color: var(--critical); font-size: 13.5px; }
.validation-errors { padding-left: 18px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; }
  .auth-hero .titleblock { display: none; }
}
@media (prefers-reduced-motion: reduce) { .auth-hero img.photo { animation: none; } }

/* ---------------------------------------------------------------- account pages (template markup) */
.account-page { padding: 32px 0; }
.account-page .subnav-list { display: flex; flex-direction: column; border: 1px solid var(--rule); background: var(--white); }
.account-page .subnav-list a { padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--rule); }
.account-page .subnav-list a.active { box-shadow: inset 4px 0 0 var(--hivis); font-weight: 600; }
.account-page .form-control { border-radius: 0; border-color: var(--rule-strong); }
.account-page .btn-primary, .account-page .btn-danger, .account-page .btn-secondary {
  border-radius: 0; background: var(--ink); border: 1.5px solid var(--ink); font-weight: 600; color: #fff;
}
.account-page .btn-primary:hover { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.account-page h3, .account-page h4 { margin: 0 0 14px; }

/* Reconnect + error UI from the Blazor template */
#blazor-error-ui { background: var(--hivis); color: var(--ink); bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Blazor moves focus to the page title after navigation; keep that invisible to mouse users. */
h1:focus { outline: none; }
/* Dark stage swatches need a light ring to read on the navy tooltip. */
.chart .tip .swatch { box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }

/* Fab database browser: table list */
.tablebtn {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 16px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.tablebtn:hover { background: var(--paper); }
.tablebtn.on { box-shadow: inset 4px 0 0 var(--hivis); font-weight: 600; background: var(--paper); }
.tablebtn:disabled { color: var(--ink-3); cursor: not-allowed; }
@media (max-width: 900px) { .wrap.section > div[style*="grid-template-columns: 300px"] { grid-template-columns: 1fr !important; } }

/* Fab database health findings */
.finding { border-left: 4px solid var(--rule-strong); }
.finding.sev-high { border-left-color: var(--critical); }
.finding.sev-medium { border-left-color: var(--warning); }
.finding .panel-head { flex-wrap: wrap; }

/* Snapshot comparison: field-level changes */
.diffline { font-size: 13.5px; line-height: 1.5; }
.diffline .label { display: inline-block; min-width: 140px; }
.diffline .old { color: var(--critical); text-decoration-thickness: 1px; }
.diffline .new { color: var(--ink); }
.diffline .arrow { color: var(--ink-3); font-family: var(--f-mono); margin: 0 4px; }

/* Coil forecast */
table.coil td.cell { background: rgba(28, 92, 171, var(--fill, 0)); }
table.coil td.cell.overdue { box-shadow: inset 3px 0 0 var(--critical); }
table.coil tr.coil-row:hover td { background-color: #fafbfc; }
table.coil tr.coil-row:hover td.cell { background: rgba(28, 92, 171, var(--fill, 0)); }
table.coil tr.coil-jobs > td { background: var(--paper); padding: 12px 18px 16px; }
table.coil tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 0; }
table.coil tr.group th { border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
table.coil tr.group th.grp { text-align: center; color: var(--ink-2); border-bottom: 2px solid var(--stage-3); }

/* ---------------------------------------------------------------- feedback widget (Components/Shared/FeedbackWidget.razor, js/feedback.js) */
.fb-root { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: var(--f-body); }
.fb-launch {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font: 600 14px var(--f-body); cursor: pointer; box-shadow: 0 6px 18px rgba(13, 21, 32, .25);
}
.fb-launch:hover, .fb-launch[aria-expanded="true"] { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.fb-count { background: var(--hivis); color: var(--ink); font: 500 11px var(--f-mono); padding: 1px 6px; }
.fb-launch:hover .fb-count, .fb-launch[aria-expanded="true"] .fb-count { background: var(--ink); color: #fff; }
.fb-panel {
  width: min(380px, calc(100vw - 32px)); max-height: min(72vh, 640px); display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--rule-strong); box-shadow: 0 12px 32px rgba(13, 21, 32, .22);
}
.fb-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 1.5px solid var(--ink); }
.fb-panel-head strong { display: block; font-size: 15px; line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.fb-panel-head button { background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--ink-3); padding: 2px 4px; }
.fb-panel-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.fb-panel-foot { border-top: 1px solid var(--rule); padding: 8px 14px; font-size: 13.5px; text-align: right; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-small { font-size: 13px; color: var(--ink-2); margin: 0; }
.fb-where { font-size: 13.5px; background: var(--paper); padding: 8px 10px; overflow-wrap: anywhere; }
.fb-where .label { margin-right: 6px; }
.fb-kinds { align-self: flex-start; }
.fb-panel textarea { resize: vertical; min-height: 96px; font-size: 14.5px; }
.fb-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fb-note { border: 1px solid var(--rule); padding: 9px 10px; cursor: pointer; }
.fb-note:hover { border-color: var(--rule-strong); }
.fb-note.is-selected { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--hivis); }
.fb-note.is-closed { opacity: .7; }
.fb-note-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-note-where { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; overflow-wrap: anywhere; }
.fb-note-text { margin: 4px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fb-note.is-selected .fb-note-text { display: block; }
.fb-note-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.fb-reply { display: block; font-size: 13px; color: var(--ink-2); border-left: 3px solid var(--good); padding-left: 8px; margin: 6px 0 0; }
.fb-mini { background: none; border: 1px solid var(--rule-strong); padding: 2px 8px; font: 12.5px var(--f-body); color: var(--ink); cursor: pointer; }
.fb-mini:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.fb-mini[aria-pressed="true"] { background: var(--hivis); border-color: var(--hivis); color: var(--ink); }
.fb-toast { width: min(380px, calc(100vw - 32px)); background: var(--white); border: 1px solid var(--rule-strong); border-left: 4px solid var(--good); padding: 12px 14px; box-shadow: 0 8px 24px rgba(13, 21, 32, .18); font-size: 14px; }
.fb-toast p { margin: 0 0 8px; }
.fb-hint { background: var(--ink); color: #fff; padding: 10px 14px; font-size: 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 18px rgba(13, 21, 32, .25); }
.fb-hint .fb-mini { color: #fff; border-color: rgba(255, 255, 255, .5); }
.fb-hint .mono { color: var(--on-dark); }

/* pick mode and pins (drawn by js/feedback.js on top of the page) */
.fb-picking, .fb-picking * { cursor: crosshair !important; }
.fb-pickbox { position: fixed; z-index: 890; pointer-events: none; outline: 2px solid var(--hivis); background: rgba(255, 196, 0, .14); }
.fb-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 880; }
.fb-pin {
  position: absolute; transform: translate(-50%, -100%); min-width: 26px; height: 26px; padding: 0 6px;
  border: 2px solid #fff; border-radius: 13px 13px 13px 0; background: var(--ink); color: #fff;
  font: 500 11.5px var(--f-mono); cursor: pointer; box-shadow: 0 3px 8px rgba(13, 21, 32, .35);
}
.fb-pin--mine { background: var(--stage-3); }
.fb-pin--planned { background: var(--stage-5); }
.fb-pin--fixed, .fb-pin--wontdo { background: var(--steel); }
.fb-pin:hover, .fb-pin--focus { background: var(--hivis); color: var(--ink); z-index: 1; }
.fb-pin--focus { animation: fb-bounce .7s ease 3; }
@keyframes fb-bounce { 50% { transform: translate(-50%, -130%); } }
@media (prefers-reduced-motion: reduce) { .fb-pin--focus { animation: none; } }
@media print { .fb-root, .fb-layer { display: none; } }

/* Admin → Feedback */
.fb-admin-group { margin-bottom: 18px; }
.fb-admin-page { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.fb-admin-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-admin-pic { display: inline-block; margin-top: 8px; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; line-height: 0; }
.fb-admin-pic img { display: block; max-width: 320px; max-height: 200px; width: auto; height: auto; }
.fb-admin-pic:hover { border-color: var(--ink-3); }
.fb-admin-page .sub, .dlg-body .sub, .dlg-foot .sub { color: var(--ink-3); font-size: 13px; }

/* ---------------------------------------------------------------- Tools gallery (Components/Pages/Tools) */
.h-sm { font-family: var(--f-display); font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.h-sm a { color: inherit; text-decoration: none; }
.h-sm a:hover { text-decoration: underline; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; background: var(--white); border: 1px solid var(--rule);
  border-top: 4px solid var(--ink); color: var(--ink); text-decoration: none; min-height: 190px; transition: border-color .15s, box-shadow .15s;
}
.tool-card:hover { border-top-color: var(--hivis); box-shadow: 0 6px 18px rgba(13, 21, 32, .12); }
.tool-card h3 { font-family: var(--f-display); font-size: 21px; font-weight: 700; margin: 0; line-height: 1.15; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-3); }
.tool-card-foot .mono { font-size: 11px; }
.ok-tick { color: var(--good); font-weight: 700; }

.tool-bar { background: var(--ink); color: #fff; padding: 12px 0; }
.tool-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.tool-bar-title { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; min-width: 0; }
.tool-bar-title .label { color: var(--on-dark); text-decoration: none; }
.tool-bar-title .label:hover { color: var(--hivis); }
.tool-bar h1 { font-family: var(--f-display); font-size: 22px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.tool-bar .sub { color: var(--on-dark); font-size: 13.5px; }
.tool-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-bar .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.tool-bar .btn--ghost:hover, .tool-bar .btn--ghost[aria-expanded="true"] { background: #fff; color: var(--ink); border-color: #fff; }
.tool-about .sub, .tool-review .sub, .tool-scan .sub, .role-picker .sub { color: var(--ink-3); font-size: 13px; }
.tool-frame { display: block; width: 100%; height: calc(100vh - var(--header-h) - 64px); min-height: 480px; border: 0; background: #fff; }
.tool-frame--preview { height: 70vh; border: 1px solid var(--rule-strong); }
.tool-review { margin-bottom: 20px; }
.tool-scan { margin: 12px 0; }
.tool-scan .alert ul { margin: 6px 0 0; padding-left: 18px; }
.tool-scan table.data { margin: 8px 0; }
.role-picker { display: flex; flex-direction: column; gap: 6px; }
.role-picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; padding: 4px 0 0 26px; }
a.fb-mini { text-decoration: none; display: inline-block; }

/* ---------------------------------------------------------------- Revit tools (Components/Pages/Tools/RevitTools.razor) */
.rt-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.rt-steps > div { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--white); border: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; }
.rt-steps b { color: var(--ink); font-family: var(--f-display); font-size: 16px; }
.rt-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 6px;
  background: var(--ink); color: var(--hivis); font-family: var(--f-display); font-weight: 700; }
.rt-card { min-height: 170px; }
.rt-card p { -webkit-line-clamp: 5; }
.rt-feed { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.rt-feed li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0 12px 18px; position: relative; }
.rt-feed li::before { content: ""; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; background: var(--hivis); border: 2px solid var(--ink); }
.rt-when { color: var(--ink-3); font-size: 13px; padding-top: 2px; }
.rt-what b { font-family: var(--f-display); font-size: 16px; margin-right: 6px; }
.rt-notes { white-space: pre-line; color: var(--ink-2); font-size: 14px; margin-top: 4px; max-width: 760px; }
@media (max-width: 600px) { .rt-feed li { grid-template-columns: 1fr; gap: 2px; } }
