:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #1c2330; --muted: #5d6675; --line: #dfe3ea;
  --accent: #1f5fbf; --ok: #1d7a46; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fff1d6;
  --bad: #b3261e; --bad-bg: #fde7e5; --tie: #6b4fbb; --tie-bg: #efeafb; --band: #fff3c4; --band-ink: #6b4e00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151c; --panel: #1a2029; --ink: #e6e9ef; --muted: #9aa3b2; --line: #2c3440;
    --accent: #7aa8ff; --ok: #6fd39b; --ok-bg: #173325; --warn: #f2bb5c; --warn-bg: #3a2c10;
    --bad: #ff8a80; --bad-bg: #3d1a18; --tie: #b9a4ff; --tie-bg: #2a2340; --band: #3a3110; --band-ink: #f2d77a;
  }
}
:root[data-theme="dark"] {
  --bg: #11151c; --panel: #1a2029; --ink: #e6e9ef; --muted: #9aa3b2; --line: #2c3440;
  --accent: #7aa8ff; --ok: #6fd39b; --ok-bg: #173325; --warn: #f2bb5c; --warn-bg: #3a2c10;
  --bad: #ff8a80; --bad-bg: #3d1a18; --tie: #b9a4ff; --tie-bg: #2a2340; --band: #3a3110; --band-ink: #f2d77a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
code { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.band { background: var(--band); color: var(--band-ink); text-align: center; font-weight: 600; font-size: 12px; letter-spacing: .04em; padding: 4px 16px; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand .proj { font-weight: 700; color: var(--accent); margin-right: 8px; }
.brand .pname { font-weight: 600; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
nav a.on, nav a:hover { background: var(--bg); color: var(--ink); }
/* Many trade boards: one Boards menu in the bar instead of a link each */
.nav-boards { position: relative; }
.nav-boards summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
.nav-boards summary::-webkit-details-marker { display: none; }
.nav-boards summary::after { content: " \25BE"; }
.nav-boards[open] summary::after { content: " \25B4"; }
.nav-boards summary small { color: var(--muted); }
.nav-boards.on summary, .nav-boards summary:hover, .nav-boards[open] summary { background: var(--bg); color: var(--ink); }
.nav-boards summary:focus-visible, nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-menu { position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 4px; min-width: 220px; max-height: 70vh; overflow-y: auto;
            display: grid; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.nav-menu a { display: block; white-space: nowrap; }
/* Seven or more boards: two columns, so fifteen boards open as eight short rows, not a list that scrolls. */
.nav-menu:has(> a:nth-child(7)) { grid-template-columns: repeat(2, max-content); column-gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
.boardhead h1 { margin: 4px 0; font-size: 22px; }
.boardhead p { margin: 0 0 12px; color: var(--muted); }
h2 { font-size: 15px; margin: 0 0 10px; }
.fresh { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.fresh.warn { border-left-color: var(--warn); }
.fresh .verdict { font-weight: 500; color: var(--muted); margin-left: 6px; }
.feeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.feed { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px; border-radius: 6px; background: var(--bg); }
.feed small { grid-column: 1 / -1; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.pill.ok, .pill.st-current, .pill.v-agree { background: var(--ok-bg); color: var(--ok); }
.pill.stale, .pill.never, .pill.st-newer-rev, .pill.v-hold { background: var(--warn-bg); color: var(--warn); }
.pill.failed, .pill.st-not-held, .pill.st-unreadable, .pill.v-disagree { background: var(--bad-bg); color: var(--bad); }
.measures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.tile .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.tile .num { font-size: 28px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.tile.is-missing .num { color: var(--warn); font-size: 20px; letter-spacing: .04em; }
.calc { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--tie); background: var(--tie-bg); padding: 1px 6px; border-radius: 4px; }
.note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.src { color: var(--muted); font-size: 11px; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; min-width: 0; }
.card.wide { grid-column: span 2; }
section.card.wide:first-of-type { }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .card.wide { grid-column: auto; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px; }
td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.late td { background: var(--warn-bg); }
tr.tied td, p.tied { background: var(--tie-bg); }
td.bad { color: var(--bad); font-weight: 700; }
span.bad, div.bad, small.bad { color: var(--bad); font-weight: 700; }
.tag { font-size: 10px; font-weight: 700; color: var(--tie); border: 1px solid var(--tie); border-radius: 4px; padding: 0 4px; margin-left: 4px; white-space: nowrap; }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.tag.dec { color: var(--warn); border-color: var(--warn); }
.side { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--bg); }
.side.unowned { color: var(--bad); }
.profile { display: flex; gap: 8px; }
.side-box { flex: 1; text-align: center; background: var(--bg); border-radius: 8px; padding: 10px 4px; }
.side-box b { display: block; font-size: 26px; }
.side-box span { font-size: 11px; font-weight: 700; color: var(--muted); }
.side-box.unowned b { color: var(--bad); }
.missing { color: var(--warn); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
.missing-block { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); }
.turn { padding: 6px 0; border-bottom: 1px solid var(--line); }
.entry { padding: 6px; border-radius: 6px; margin: 4px 0; }
.pick:hover { border-color: var(--accent); }
.pick p { color: var(--muted); margin: 0; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px; }
.notice { margin-bottom: 16px; }
.ok-notice { border-left: 4px solid var(--ok); }
.bad-notice { border-left: 4px solid var(--bad); }
.upform { display: grid; gap: 8px; }
.upform label { font-size: 12px; font-weight: 600; color: var(--muted); }
.upform select, .upform input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-width: 100%; }
.upform button { font: inherit; font-weight: 600; color: var(--panel); background: var(--accent); border: 0; border-radius: 6px; padding: 10px; cursor: pointer; }
.upform button:focus-visible, .upform select:focus-visible, .upform input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.brand .home { font-weight: 700; color: var(--ink); margin-right: 8px; }
.boardhead.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.btn { display: inline-block; font: inherit; font-weight: 600; color: var(--panel); background: var(--accent); border: 0; border-radius: 6px; padding: 9px 14px; cursor: pointer; }
.btn.big { padding: 12px 22px; font-size: 15px; }
.btn:focus-visible, .tick:focus-visible, .setup input:focus-visible, .setup textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll { overflow-x: auto; }
.setup { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.setup label { display: grid; align-content: start; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.setup input, .setup textarea, .setup select, .inline-form select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; width: 100%; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 12px; }
.setup label.check { display: flex; gap: 8px; align-items: flex-start; background: var(--bg); border-radius: 6px; padding: 8px; color: var(--ink); font-weight: 400; font-size: 14px; }
.setup label.check input { width: auto; margin-top: 3px; }
.check small { display: block; color: var(--muted); font-size: 11px; }
.phases-mini { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin-bottom: 16px; }
@media (max-width: 900px) { .phases { grid-template-columns: 1fr; } }
.phase { display: grid; gap: 2px; padding: 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-top: 4px solid var(--line); }
.phase.complete { border-top-color: var(--ok); }
.phase.current { border-top-color: var(--accent); background: var(--bg); }
.phase.late { border-top-color: var(--bad); }
.phase .pname { font-weight: 700; }
.phase .pdates, .phase .pgate { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.ph-complete { background: var(--ok-bg); color: var(--ok); }
.pill.ph-current { background: var(--tie-bg); color: var(--accent); }
.pill.ph-upcoming { background: var(--bg); color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.inline-form select { width: auto; }
.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gates li { display: flex; gap: 8px; align-items: flex-start; }
.gates li form { display: flex; gap: 6px; align-items: center; }
.gates li input { width: 110px; font: inherit; font-size: 12px; padding: 4px 6px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.gates li small { display: block; color: var(--muted); font-size: 11px; }
.gates li.done > span { color: var(--muted); }
.tick { width: 22px; height: 22px; flex: none; border-radius: 4px; border: 2px solid var(--line); background: var(--panel); color: var(--ok); font-weight: 700; cursor: pointer; padding: 0; line-height: 1; }
.gates li.done .tick { border-color: var(--ok); background: var(--ok-bg); }
.gatecard.current { border-color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { color: var(--accent); background: transparent; border: 1px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tile.is-warn .num { color: var(--warn); }
.pill.k-decision { background: var(--tie-bg); color: var(--tie); }
.pill.k-action { background: var(--warn-bg); color: var(--warn); }
.pill.k-date { background: var(--ok-bg); color: var(--ok); }
.mitem { border-top: 1px solid var(--line); padding: 10px 0; scroll-margin-top: 16px; }
.mitem.st-rejected .mtext { color: var(--muted); text-decoration: line-through; }
.mhead { display: flex; gap: 6px; align-items: center; }
.mtext { margin: 6px 0; }
.review { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.review label { display: grid; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.review input, .review select, .slipform input, .slipform select, .editgates input { font: inherit; font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; max-width: 100%; }
.transcript { margin: 0; padding-left: 44px; font: 12px/1.6 ui-monospace, Menlo, Consolas, monospace; word-break: break-word; }
.transcript li { white-space: pre-wrap; }
.transcript li { scroll-margin-top: 16px; color: var(--muted); }
.transcript li.cited { color: var(--ink); background: var(--warn-bg); }
.transcript li:target { outline: 2px solid var(--accent); }
.slipform { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.slipform input { width: 110px; }
details.delay { border-top: 1px solid var(--line); padding: 8px 0; scroll-margin-top: 16px; }
details.delay summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.delay summary .days { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
details.delay:target { background: var(--bg); }
.dbody { padding: 8px 0 4px 12px; }
.dbody h3 { font-size: 13px; margin: 10px 0 4px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; }
.evidence { margin: 0; padding-left: 18px; }
.evidence small { color: var(--muted); }
.twoforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.upform textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.pill.rp-client { background: var(--bad-bg); color: var(--bad); }
.pill.rp-contractor, .pill.rp-subcontractor { background: var(--warn-bg); color: var(--warn); }
.pill.rp-none, .pill.rp-third_party, .pill.rp-shared, .pill.rp-unknown { background: var(--bg); color: var(--muted); }
.pill.dst-open { background: var(--warn-bg); color: var(--warn); }
.pill.dst-submitted { background: var(--tie-bg); color: var(--tie); }
.pill.dst-agreed, .pill.dst-closed { background: var(--ok-bg); color: var(--ok); }
.pill.dst-disputed { background: var(--bad-bg); color: var(--bad); }
h2.sect { margin: 20px 0 10px; }
.editgates li form { flex-wrap: wrap; }
.editgates li input[type=text] { width: 220px; max-width: 100%; }
details.todelay { margin-top: 6px; }
details.todelay summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 600; }
.ask { border-top: 1px solid var(--line); padding: 10px 0; scroll-margin-top: 16px; }
.ask .setup { gap: 10px; margin-top: 8px; }
.query { background: var(--bad-bg); color: var(--ink); padding: 6px 8px; border-radius: 6px; }
.explain { background: var(--bg); border-radius: 6px; padding: 6px 8px; margin: 4px 0; }
#enter details, .card details { border-top: 1px solid var(--line); padding: 8px 0; }
#enter details summary, .card > details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
#enter details .setup, .card > details .setup { margin-top: 10px; }
.setup select { min-width: 0; }
.frow { padding: 8px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.frow.late { background: var(--warn-bg); padding-left: 6px; }
.turn .slipform { margin-top: 4px; }
p.bad { color: var(--bad); font-weight: 600; }
.narrow { max-width: 460px; margin: 24px auto; }
.narrow h1 { font-size: 20px; margin: 0 0 12px; }
form.inline { display: inline; }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.group { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }

/* management board tabs */
.tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line, #d9dde3); flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: inherit; border-bottom: 2px solid transparent; }
.tabs a.on { border-bottom-color: currentColor; font-weight: 600; }
td.nw { white-space: nowrap; }
td.good { color: var(--ok); font-weight: 600; }

/* Safety */
.safety-banner { background: var(--warn-bg); color: var(--ink); border-bottom: 1px solid var(--warn); padding: 8px 16px; font-size: 14px; }
.safety-banner.over { background: var(--bad-bg); border-bottom-color: var(--bad); }
.tile.is-bad .num { color: var(--bad); }
.tile.is-good .num { color: var(--ok); }
.tag.good { color: var(--ok); border-color: var(--ok); }
.state { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.state.DONE, .state.COMPLETE, .state.VERIFIED, .state.CLOSED, .state.PASS { color: var(--ok); }
.state.PENDING, .state.DUE, .state.ISSUED { color: var(--warn); }
.state.MISSING, .state.OVERDUE, .state.EXPIRED, .state.REJECTED, .state.FAIL { color: var(--bad); }
.q { border-top: 1px solid var(--line); padding: 12px 0; }
.q h3 { font-size: 15px; margin: 0 0 8px; }
.q label.opt { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.q label.opt:hover { background: var(--bg); }
.q .right { color: var(--ok); font-weight: 600; }
.q .wrong { color: var(--bad); text-decoration: line-through; }
.cert { border: 3px double var(--ink); border-radius: 8px; padding: 24px; text-align: center; max-width: 640px; margin: 16px auto; }
.cert h2 { font-size: 22px; margin: 4px 0 12px; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.stopwork { border-left: 4px solid var(--bad); }
@media print {
  header.top, .band, footer, .safety-banner, .noprint, .tabs { display: none !important; }
  body { background: #fff; color: #000; }
  .cert { border-color: #000; }
}

/* Schedule / Gantt */

/* live connectors */
.conn-list { display: grid; gap: 16px; margin-bottom: 24px; }
.conn-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 6px 0; }
.conn-facts b { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin-right: 4px; }

/* single sign-on */
.sso { display: grid; gap: 10px; margin: 14px 0 6px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-weight: 600; text-decoration: none; padding: 10px 14px; }
.sso-btn:hover { background: var(--bg); }
.sso-mark { display: inline-flex; }
.sso-or { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0 6px; border-top: 1px solid var(--line); line-height: 0; }
.sso-or span { background: var(--panel); padding: 0 8px; }
.sso-admin { margin-top: 14px; }
.sso-admin summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* Gantt: bright, P6-style colors */
:root { --g-crit: #e8112d; --g-crit-bg: #ffe3e6; --g-float: #1570ff; --g-float-bg: #e2edff; --g-done: #0fa958; --g-done-bg: #dcf7e8;
  --g-prog: #7c3aed; --g-base: #ffaa00; --g-base-edge: #b36b00; --g-sum: #1c2330; --g-dd: #d4007a; --g-grid: rgba(28,35,48,.07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-crit: #ff4d61; --g-crit-bg: #4a1219; --g-float: #4d94ff;
  --g-float-bg: #132a52; --g-done: #2fe286; --g-done-bg: #0f3a24; --g-prog: #b38cff; --g-base: #ffc233; --g-base-edge: #ffe08a;
  --g-sum: #e6e9ef; --g-dd: #ff4fb0; --g-grid: rgba(230,233,239,.07); } }
:root[data-theme="dark"] { --g-crit: #ff4d61; --g-crit-bg: #4a1219; --g-float: #4d94ff; --g-float-bg: #132a52; --g-done: #2fe286;
  --g-done-bg: #0f3a24; --g-prog: #b38cff; --g-base: #ffc233; --g-base-edge: #ffe08a; --g-sum: #e6e9ef; --g-dd: #ff4fb0; --g-grid: rgba(230,233,239,.07); }
.gantt { border-collapse: collapse; font-size: 12.5px; }
.gantt thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; font-size: 11px; white-space: nowrap; }
.gantt td { vertical-align: middle; }
.gantt th.chart, .gantt td.chart { min-width: 420px; position: relative; padding: 0; }
.gantt .months { position: relative; height: 20px; }
.gantt .months span { position: absolute; top: 3px; font-size: 10.5px; font-weight: 600; color: var(--ink); white-space: nowrap; border-left: 1px solid var(--line); padding-left: 3px; }
.gantt .lane { position: relative; height: 32px; background-image: repeating-linear-gradient(to right, var(--g-grid) 0 1px, transparent 1px var(--wk, 2%)); }
.gantt .bar { position: absolute; top: 6px; height: 15px; background: var(--g-float); border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.18) inset; }
.gantt .bar.crit { background: var(--g-crit); box-shadow: 0 0 0 1px rgba(0,0,0,.2) inset, 0 0 6px color-mix(in srgb, var(--g-crit) 55%, transparent); }
.gantt .bar.prog { background: var(--g-float); }
.gantt .bar.done { background: var(--g-done); }
.gantt .bar i { display: block; height: 100%; background: repeating-linear-gradient(135deg, rgba(0,0,0,.38) 0 4px, rgba(0,0,0,.22) 4px 8px); }
.gantt .fbar { position: absolute; top: 12px; height: 3px; background: var(--g-float); opacity: .55; border-right: 2px solid var(--g-float); }
.gantt .fbar::after { content: ""; position: absolute; right: -2px; top: -4px; height: 11px; border-right: 2px solid var(--g-float); }
.gantt .bbar { position: absolute; top: 23px; height: 6px; background: var(--g-base); border: 1px solid var(--g-base-edge); border-radius: 2px; }
.gantt .sbar { position: absolute; top: 9px; height: 8px; background: var(--g-sum); border-radius: 1px; overflow: visible; }
.gantt .sbar.crit { background: var(--g-crit); }
.gantt .sbar i { display: block; height: 100%; background: var(--g-done); }
.gantt .sbar::before, .gantt .sbar::after { content: ""; position: absolute; bottom: -5px; border-top: 6px solid var(--g-sum); border-left: 4px solid transparent; border-right: 4px solid transparent; }
.gantt .sbar::before { left: -4px; } .gantt .sbar::after { right: -4px; }
.gantt .sbar.crit::before, .gantt .sbar.crit::after { border-top-color: var(--g-crit); }
.gantt .ms { position: absolute; top: 6px; width: 14px; height: 14px; background: var(--g-float); transform: translateX(-7px) rotate(45deg); box-shadow: 0 0 0 1.5px var(--panel); }
.gantt .ms.crit { background: var(--g-crit); }
.gantt .ms.done { background: var(--g-done); }
.gantt .mslabel { position: absolute; top: 7px; margin-left: 12px; font-size: 10.5px; font-weight: 700; white-space: nowrap; color: var(--ink); pointer-events: none; }
.gantt .ddline { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--g-dd); z-index: 1; }
.gantt tr.wbs td { background: var(--bg); border-top: 1px solid var(--line); }
.gantt tr.wbs.lvl0 td { background: color-mix(in srgb, var(--g-sum) 10%, var(--panel)); font-size: 13px; }
.gantt tr.wbs.lvl0 td:first-child { border-left: 5px solid var(--g-sum); }
.gantt tr.act td:first-child { border-left: 5px solid var(--g-float); }
.gantt tr.act.crit td { background: var(--g-crit-bg); }
.gantt tr.act.crit td:first-child { border-left-color: var(--g-crit); }
.gantt tr.act.crit .aid { color: var(--g-crit); }
.gantt tr.act.done td { background: var(--g-done-bg); }
.gantt tr.act.done td:first-child { border-left-color: var(--g-done); }
.gantt tr.act.prog td:first-child { border-left-color: var(--g-prog); }
.gantt td.bl { color: var(--g-base-edge); font-weight: 600; }
.gantt .st { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; color: #fff; vertical-align: 1px; }
.gantt .st-crit { background: var(--g-crit); } .gantt .st-done { background: var(--g-done); } .gantt .st-prog { background: var(--g-prog); }
.gantt .critn { color: var(--g-crit); font-weight: 700; }
.gantt .okc, .gantt .act-a { color: var(--g-done); }
.fl { display: inline-block; min-width: 26px; text-align: center; font-weight: 800; padding: 1px 6px; border-radius: 10px; }
.fl-crit { background: var(--g-crit); color: #fff; } .fl-ok { background: var(--g-float-bg); color: var(--g-float); } .fl-done { background: var(--g-done-bg); color: var(--g-done); font-weight: 700; }
.gantt tr.detail td { padding-top: 0; border-top: 0; }
.gantt tr.detail summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.gantt details.act summary { font-size: 11px; color: var(--muted); cursor: pointer; margin-top: 4px; }
.gantt details.act[open] { background: var(--bg); padding: 8px; border-radius: 6px; min-width: 320px; }
.gantt details.act .grid { grid-template-columns: 1fr; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.legend .key small { color: var(--muted); }
.legend .lg { display: inline-block; width: 26px; height: 12px; border-radius: 3px; }
.lg.crit { background: var(--g-crit); } .lg.norm { background: var(--g-float); } .lg.done { background: var(--g-done); }
.lg.prog { background: linear-gradient(to right, rgba(0,0,0,.38) 0 50%, transparent 50%) var(--g-float); }
.lg.base { background: var(--g-base); border: 1px solid var(--g-base-edge); height: 6px; } .lg.flt { background: var(--g-float); opacity: .55; height: 3px; width: 22px; margin-left: 6px; }
.lg.sum { background: var(--g-sum); height: 7px; } .lg.dd { border-left: 2px dashed var(--g-dd); width: 2px; height: 16px; border-radius: 0; }
.legend .k-crit { border-color: var(--g-crit); } .legend .k-done { border-color: var(--g-done); } .legend .k-base { border-color: var(--g-base); } .legend .k-float { border-color: var(--g-float); }
.gantt td, .gantt th { padding: 4px 6px; }
.gantt td:nth-child(1), .gantt th:nth-child(1) { position: sticky; left: 0; z-index: 1; min-width: 290px; max-width: 290px; box-shadow: 2px 0 0 var(--line); background: var(--panel); }
.gantt thead th:nth-child(1) { z-index: 3; }
.gantt tr.wbs td:nth-child(1) { background: var(--bg); }
.gantt tr.wbs.lvl0 td:nth-child(1) { background: color-mix(in srgb, var(--g-sum) 10%, var(--panel)); }
.gantt tr.act.crit td:nth-child(1) { background: var(--g-crit-bg); }
.gantt tr.act.done td:nth-child(1) { background: var(--g-done-bg); }
.gantt .aid { margin-right: 2px; } .gantt .wcode { color: var(--muted); margin-right: 4px; }
.gantt details.act { display: inline; }
.gantt details.act summary { display: inline; margin-left: 4px; }
.gantt details.act[open] { display: block; }
.views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.views a { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 600; font-size: 13px; }
.views a.on { background: var(--g-crit); border-color: var(--g-crit); color: #fff; }
.views a:first-child.on { background: var(--g-float); border-color: var(--g-float); }
.gantt small.sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1700px) { .gantt .opt { display: none; } }
/* Lift plans */
.itag { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--ink); color: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 12px; letter-spacing: .02em; }
.itag.big { font-size: 20px; padding: 2px 8px; vertical-align: 2px; }
.lstat { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.ls-draft { background: var(--warn-bg); color: var(--warn); } .ls-approved { background: var(--g-float); color: #fff; }
.ls-done { background: var(--g-done); color: #fff; } .ls-cancelled { background: var(--line); color: var(--muted); }
.ls-critical { background: var(--g-crit); color: #fff; } .ls-fail { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.capbar { position: relative; display: inline-block; width: 110px; height: 18px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; vertical-align: middle; }
.capbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--g-done); }
.capbar.mid i { background: var(--g-float); } .capbar.crit i { background: var(--g-base); } .capbar.over i { background: var(--g-crit); }
.capbar b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; color: var(--ink); }
.tile .capbar { width: 100%; height: 26px; } .tile .capbar b { font-size: 15px; line-height: 26px; }
table.lifts tr.crit td { background: var(--g-crit-bg); } table.lifts tr.crit td:first-child { border-left: 4px solid var(--g-crit); }
table.lifts tr.muted td { opacity: .5; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; } dl.facts dt { color: var(--muted); font-weight: 600; } dl.facts dd { margin: 0; }
.liftform { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.liftform fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0; display: grid; gap: 6px; }
.liftform legend { font-weight: 700; padding: 0 4px; }
.crane { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; } .crane h3 { margin: 4px 0; }
.liftlink { font-weight: 700; color: var(--g-base-edge); }
.ndatext { white-space: pre-wrap; font: 13px/1.55 ui-serif, Georgia, serif; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 14px; max-height: 520px; overflow: auto; }
.grid.nda { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .grid.nda { grid-template-columns: 1fr; } }

/* Trade leads and live updates */
.lead-line { font-size: 1.02rem; }
.lead-form { border-bottom: 1px solid var(--line, #d8dde3); padding-bottom: .8rem; margin-bottom: .8rem; }
.lead-form h3 { margin: .2rem 0 .4rem; font-size: 1rem; }
.live-dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: #0a7d3b; margin-left: auto; padding: 0 .6rem; }
.live-dot i { width: .55rem; height: .55rem; border-radius: 50%; background: #18b85a; box-shadow: 0 0 0 0 rgba(24,184,90,.6); animation: livepulse 2s infinite; }
.live-dot.off { color: #8a6d00; } .live-dot.off i { background: #d9a400; animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(24,184,90,.55); } 70% { box-shadow: 0 0 0 .5rem rgba(24,184,90,0); } 100% { box-shadow: 0 0 0 0 rgba(24,184,90,0); } }
.live-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: 26rem; background: #10233a; color: #fff; padding: .7rem .9rem; border-radius: .5rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: .9rem; }
.live-list { list-style: none; margin: 0; padding: 0; max-height: 16rem; overflow: auto; font-size: .88rem; }
.live-list li { padding: .3rem 0; border-bottom: 1px solid var(--line, #e3e7ec); }
.live-list li.fresh { background: rgba(24,184,90,.12); animation: livefade 6s forwards; }
@keyframes livefade { to { background: transparent; } }
@media (prefers-color-scheme: dark) { .live-dot { color: #4fdc8a; } .live-toast { background: #e8eef5; color: #0d1b2a; } }
@media (max-width: 700px) { .live-dot { display: none; } }
.live-dot[hidden], .live-toast[hidden] { display: none; }
table.prove tr.p-different td { background: rgba(214, 48, 49, .08); }
table.prove tr.p-match td:nth-child(5) .pill { font-weight: 700; }
/* Search box in every header, results and each person's search history */
.searchbox { display: flex; gap: 6px; align-items: center; }
.searchbox input, .searchbox select, .search-form input, .search-form select { font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; min-width: 0; }
.searchbox input { width: 14rem; }
.searchbox select { max-width: 11rem; }
.searchbox a { font-size: 12px; font-weight: 600; white-space: nowrap; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.search-form label { display: grid; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.search-form input { width: 22rem; max-width: 100%; }
table.results td.snip { color: var(--muted); max-width: 32rem; }
mark { background: var(--warn-bg); color: var(--ink); font-weight: 700; padding: 0 1px; border-radius: 2px; }
form.inline, details.inline { display: inline-block; margin: 0; }
.card details.inline { border-top: 0; padding: 0; }
details.inline summary { list-style: none; } details.inline summary::-webkit-details-marker { display: none; }
details.inline[open] summary { display: none; }
ul.opened { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.opened li { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
@media (max-width: 700px) {
  .searchbox { width: 100%; flex-wrap: wrap; }
  .searchbox input { flex: 1 1 10rem; width: auto; }
  .search-form input { width: 100%; }
}
@media print { .searchbox { display: none; } }

/* Phones: one scrolling row of tabs instead of a wall of links, inputs large enough
   not to zoom, and a thumb bar on the foreman view. */
.fm-bar { display: none; }
@media (max-width: 700px) {
  .band { font-size: .7rem; padding: 3px 8px; }
  header.top { padding: 8px 12px; }
  header.top nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
                   margin: 4px -12px 0; padding: 0 12px 4px; }
  header.top nav::-webkit-scrollbar { display: none; }
  header.top nav a { white-space: nowrap; flex: none; }
  header.top nav .nav-boards { flex: none; position: static; }
  /* The tab strip scrolls sideways, which would clip a dropdown: the menu opens across the screen instead. */
  header.top nav .nav-menu { position: fixed; top: auto; left: 12px; right: 12px; min-width: 0; max-height: 60vh; width: auto; max-width: none;
                             grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  header.top nav .nav-menu a { padding: 10px; white-space: normal; }
  main { padding-bottom: 72px; }
  input, select, textarea, button { font-size: 16px; }
  .btn { min-height: 44px; }
  .fm-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0; margin: 0;
            background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
  .fm-bar a { flex: 1; text-align: center; padding: 12px 2px; font-size: .82rem; font-weight: 600; color: var(--ink); border-radius: 0; }
  .fm-bar a.stop { background: #c0262d; color: #fff; }
  .frow { padding: 8px 0; }
}
.brand .home b { color: var(--accent); }
.mfa-key code { font-size: 1.15rem; letter-spacing: .08em; color: var(--ink); } ul.recovery { columns: 2; font-size: 1.05rem; }

/* Help */
.helpq { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px;
         border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--accent);
         font-size: 13px; font-weight: 700; text-decoration: none; vertical-align: middle; }
a.helpq:hover { background: var(--tie-bg); }
ol.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ol.checklist li { display: flex; gap: 10px; align-items: baseline; }
ol.checklist li small { display: block; color: var(--muted); }
ol.checklist .ck { width: 18px; flex: none; text-align: center; font-weight: 700; color: var(--muted); }
ol.checklist li.done .ck { color: var(--ok); }
.help-section .steps li { line-height: 1.45; }
.help-note { background: var(--warn-bg); padding: 6px 8px; border-radius: 4px; color: var(--ink); }
.tour-offer { background: var(--tie-bg); border-bottom: 1px solid var(--line); padding: 8px 16px; font-size: 14px;
              display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tour-offer small { color: var(--muted); }
ol.tour-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
ol.tour-steps li.here { font-weight: 600; }
.guide-answer p { margin: 0 0 8px; }

/* Guided project setup: five steps, one at a time, with big buttons on a phone */
.wizard-progress { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0; margin-bottom: 8px; }
.wizard-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0; }
.wizard-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.wizard-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; }
.wizard-steps button { width: 100%; font: inherit; text-align: left; background: var(--panel); color: var(--muted); border: 1px solid var(--line);
                       border-radius: 6px; padding: 8px; cursor: pointer; min-height: 44px; }
.wizard-steps li.on button { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.wizard-steps li.done button { color: var(--ok); }
.wizard-steps li.done b::after { content: " ✓"; }
.wizard-steps .skip-word { display: none; font-style: normal; font-size: 12px; font-weight: 400; }
.wizard-steps li.skipped .skip-word { display: inline; }
.wizard-steps li.skipped button { color: var(--muted); border-style: dashed; }
.wizard .wizard-step { margin-bottom: 16px; }
.wizard.js .wizard-step { display: none; }
.wizard.js .wizard-step.on { display: block; }
.wizard-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.wizard-nav .btn { min-height: 48px; min-width: 120px; }
.field-error { color: var(--bad); font-weight: 600; font-size: 13px; margin: 2px 0 0; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.setup label.tpl-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: 8px;
                        background: var(--bg); color: var(--ink); font-weight: 400; font-size: 14px; cursor: pointer; }
.setup label.tpl-card.flagship { border-color: var(--accent); }
.setup label.tpl-card.on { background: var(--tie-bg); border-color: var(--accent); }
.setup label.tpl-card input { width: auto; margin-top: 4px; }
.tpl-card b { display: block; font-size: 15px; }
.tpl-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tpl-card .tpl-adds { color: var(--accent); font-weight: 600; }
.tpl-detail h4, .tpl-trades h4 { margin: 10px 0 6px; font-size: 13px; }
.checks.one { grid-template-columns: 1fr; }
.phase-pick { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; }
.phase-pick summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 4px 0; }
.trade-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; margin-bottom: 8px; }
.trade-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }
ul.tight { margin: 4px 0; padding-left: 18px; }
.p6-map select { min-width: 200px; }
.setup-review-list h3 { margin: 0 0 4px; }
.setup-review-list p { margin: 0 0 8px; }
.ok-line { color: var(--ok); font-weight: 600; }
ol.checklist.finish li { align-items: center; }
ol.checklist.finish .btn { margin-left: auto; }
@media (max-width: 700px) {
  .wizard-steps span { display: none; }
  .wizard-steps li.skipped .skip-word { display: block; }
  .wizard-steps button { text-align: center; }
  .wizard-nav .btn { flex: 1; }
  .trade-row { grid-template-columns: 1fr; }
  .trade-list { grid-template-columns: 1fr; }
}

.setup-video { margin: 8px 0; }
.setup-video summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.setup-video video { display: block; width: 100%; max-width: 720px; height: auto; margin-top: 8px; border-radius: 8px; background: #000; }
.setup-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 1100px; }
.setup-videos figure { margin: 8px 0 0; min-width: 0; }
.setup-videos figcaption small { display: block; }

/* Camera button and photo grid on trade boards */
.camera-form .camera-button { display: inline-block; padding: 14px 20px; font-size: 1.1em; font-weight: 600;
  background: var(--accent, #1f6feb); color: #fff; border-radius: 8px; cursor: pointer; text-align: center; }
.camera-form input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.camera-form .camera-picked { display: block; margin: 6px 0 10px; font-size: .9em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.photo-grid figcaption { font-size: .85em; margin-top: 4px; }
