/* UtiliLinQ design system
   Palette: UtiliLinQ black + white with signal orange (from the logo). Dark by default.
   Motif: the APWA uniform color code used to mark underground utilities. */
/* Theme: DARK is the default; html[data-theme="light"] switches to the light palette (toggle in the header).
   --navy-* = the always-dark chrome (header, hero, footer), the same in both themes. */
:root {
  color-scheme: dark;
  --navy-900: #0b0b0b;
  --navy-800: #000000;
  --navy-700: #1f1f1f;
  --navy-600: #3a3a3a;
  --gold: #f5681c;
  --gold-600: #d9530b;
  --on-accent: #0b0b0b;          /* text on orange */

  --canvas: #0f0f0f;
  --surface: #181818;
  --surface-2: #202020;           /* table heads, sticky columns */
  --hover: #232323;
  --input-bg: #121212;
  --ink: #e6e6e3;
  --heading: #fafafa;
  --muted: #a6a6a2;
  --faint: #7c7c78;
  --border: #2d2d2b;
  --border-strong: #42423f;
  --link: #ff8b4d;
  --link-hover: #ffffff;
  --strong-bg: #2c2c2a;           /* "dark" buttons, current page in pager */
  --strong-fg: #ffffff;
  --gold-50: rgba(245, 104, 28, .13);
  --accent-soft: rgba(245, 104, 28, .10);
  --accent-border: rgba(245, 104, 28, .45);
  --demo-ink: #ffb088;

  --success: #46c17f; --success-bg: rgba(70, 193, 127, .13); --success-ink: #9be3bc;
  --info: #69a6f2;    --info-bg: rgba(105, 166, 242, .13);   --info-ink: #b4d2f8;   --info-border: rgba(105, 166, 242, .35);
  --warning: #e6a93a; --warning-bg: rgba(230, 169, 58, .13); --warning-ink: #f3d397;
  --danger: #f27265;  --danger-bg: rgba(242, 114, 101, .13); --danger-ink: #f8b6ae; --danger-border: rgba(242, 114, 101, .4);
  --neutral: #b4b4b0; --neutral-bg: #252524;

  /* APWA utility colors */
  --u-telecom: #f37021;
  --u-electric: #d7262b;
  --u-water: #1f6fd1;
  --u-gas: #f2c200;
  --u-sewer: #2e9b4f;
  --u-survey: #e46aa6;

  --font-display: "Bahnschrift", "DIN Alternate", "DIN 2014", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  --wrap: 1200px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f4f4f3;
  --surface: #ffffff;
  --surface-2: #f7f7f6;
  --hover: #fafaf9;
  --input-bg: #ffffff;
  --ink: #141414;
  --heading: #0b0b0b;
  --muted: #5c5c5c;
  --faint: #8a8a8a;
  --border: #e0e0de;
  --border-strong: #c8c8c5;
  --link: #b93f07;                /* orange dark enough for text on white (AA) */
  --link-hover: #000000;
  --strong-bg: #1f1f1f;
  --strong-fg: #ffffff;
  --gold-50: #fff1e8;
  --accent-soft: #fff4ec;
  --accent-border: #f8c29e;
  --demo-ink: #9a3b06;
  --success: #1f7a4a; --success-bg: #e5f4ec; --success-ink: #0f4d2d;
  --info: #24589c;    --info-bg: #e7eef9;    --info-ink: #173c6b; --info-border: #c9d8ef;
  --warning: #8a5a00; --warning-bg: #fdf1d6; --warning-ink: #5c3c00;
  --danger: #b42318;  --danger-bg: #fdecea;  --danger-ink: #7a160f; --danger-border: #f2c1bb;
  --neutral: #4b5565; --neutral-bg: #eef1f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--font-body); }
img { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--heading); letter-spacing: -.005em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono-num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 2px; }
.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(--gold); color: var(--on-accent); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (max-width: 560px) { .wrap { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---- demo banner ---- */
.demo-banner { background: repeating-linear-gradient(-45deg, var(--gold) 0 14px, #ff8b4d 14px 28px); color: var(--navy-900); font-size: .85rem; }
.demo-banner .wrap { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; flex-wrap: wrap; }
.demo-banner strong { font-family: var(--font-display); }
.demo-banner a { color: var(--navy-900); font-weight: 600; }
.demo-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demo-switch-label { font-weight: 600; font-size: .8rem; white-space: nowrap; }
.demo-switch > *, .seg-group { flex-shrink: 0; }
.seg-group { display: inline-flex; gap: 0; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,.35); }
.seg { font: 600 .78rem/1 var(--font-body); padding: 6px 10px; border: 0; background: rgba(255,255,255,.55); color: var(--navy-900); cursor: pointer; white-space: nowrap; }
.seg-group .seg + .seg { border-left: 1px solid rgba(0,0,0,.25); }
.seg-admin, .demo-switch > .seg { border: 1px solid rgba(0,0,0,.35); border-radius: 6px; }
.seg:hover { background: #fff; }
.seg[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
@media (max-width: 760px) {
  .demo-note { display: none; }
  .demo-switch { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
}

/* ---- header ---- */
.site-header { background: var(--navy-800); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 3px solid var(--gold); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand svg { flex-shrink: 0; }
.nav { display: flex; gap: 2px; flex: 1; align-items: center; }
.nav a { color: #d4d4d4; text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); font-size: .9rem; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
.header-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--r-md); color: #e6e6e6; background: transparent; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.badge-dot { position: absolute; top: 3px; right: 2px; background: var(--gold); color: var(--on-accent); font-size: .68rem; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.menu-toggle { display: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: #fff; padding: 5px 8px; border-radius: var(--r-md); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(255,255,255,.08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; font-family: var(--font-display); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: 0 12px 34px rgba(0,0,0,.22); min-width: 250px; padding: 6px; z-index: 60; border: 1px solid var(--border); }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--hover); }
.menu-panel .menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

@media (max-width: 1440px) { .header-actions .btn-join-text { display: none; } }
@media (max-width: 1180px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy-900); flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 3px solid var(--gold); gap: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
  .header-actions .btn-join-text { display: none; }
}

/* ---- buttons & forms ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-md); border: 1px solid transparent; font: 600 .92rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn-primary { background: var(--gold); color: var(--on-accent); border-color: var(--gold-600); }
.btn-primary:hover { background: #ff7d36; color: var(--on-accent); }
.btn-navy { background: var(--strong-bg); color: var(--strong-fg); border-color: var(--border-strong); }
.btn-navy:hover { background: var(--gold); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--heading); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--gold); color: var(--heading); }
.btn-ghost { background: transparent; color: var(--heading); }
.btn-ghost:hover { background: var(--neutral-bg); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--heading); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field .error { font-size: .84rem; color: var(--danger); margin-top: 4px; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; color: var(--ink); background: var(--input-bg);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,104,28,.28); }
input[type=file] { font: inherit; font-size: .88rem; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; font-size: .92rem !important; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--heading); margin-bottom: 10px; }
.form-section { padding: 22px 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 8px; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px 8px; }
.trade-group { margin-bottom: 14px; }
.trade-group summary { cursor: pointer; font-weight: 600; padding: 6px 0; display: flex; align-items: center; gap: 8px; }

/* ---- layout primitives ---- */
main { min-height: 60vh; }
.page { padding-top: 28px; padding-bottom: 56px; }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 22px 0; }
.layout-side { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.layout-main { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .layout-side, .layout-main { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.prose { max-width: 75ch; }
.prose p:last-child { margin-bottom: 0; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-brand { background: var(--strong-bg); color: var(--strong-fg); }
.badge-outline { background: var(--surface); border-color: var(--border-strong); color: var(--muted); }
.badge-demo { background: var(--gold-50); color: var(--demo-ink); border: 1px dashed #f59a62; font-size: .7rem; }
.badge-match { background: var(--accent-soft); color: var(--link); border: 1px solid var(--accent-border); }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); background: var(--neutral-bg); color: var(--neutral); font-size: .78rem; margin: 0 4px 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* utility color markers */
.u-mark { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.u-signal { background: var(--u-telecom); } .u-drill { background: var(--u-survey); } .u-bolt { background: var(--u-electric); }
.u-droplet { background: var(--u-water); } .u-cone { background: var(--u-gas); }
.sector-line { height: 4px; border-radius: 2px; }

/* ---- flash ---- */
.flashes { margin-top: 16px; }
.flash { padding: 11px 14px; border-radius: var(--r-md); margin-bottom: 8px; border-left: 4px solid; font-size: .92rem; }
.flash-success { background: var(--success-bg); border-color: var(--success); color: var(--success-ink); }
.flash-info { background: var(--info-bg); border-color: var(--info); color: var(--info-ink); }
.flash-warning { background: var(--warning-bg); border-color: var(--gold-600); color: var(--warning-ink); }
.flash-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-ink); }

/* ---- notices ---- */
.notice { padding: 13px 15px; border-radius: var(--r-md); background: var(--neutral-bg); font-size: .9rem; border: 1px solid var(--border); }
.notice strong { color: var(--heading); }
.notice-gold { background: var(--gold-50); border-color: var(--accent-border); }
.notice-info { background: var(--info-bg); border-color: var(--info-border); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.lock-note { display: flex; gap: 10px; align-items: flex-start; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--hover); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.compare th[scope=row] { background: var(--surface-2); color: var(--heading); font-size: .84rem; width: 180px; position: sticky; left: 0; z-index: 1; }
table.compare td { min-width: 220px; }
table.compare .low { box-shadow: inset 0 3px 0 var(--u-sewer); }

/* ---- empty state ---- */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty h3 { color: var(--heading); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }

/* ---- hero ---- */
.hero { background: var(--navy-900); color: #fff; position: relative; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; padding-top: 44px; padding-bottom: 40px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 40px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); line-height: 1.02; font-weight: 700; font-stretch: condensed; margin-bottom: 18px; max-width: 15ch; }
.hero .lede { color: #cfcfcf; font-size: 1.12rem; max-width: 52ch; margin-bottom: 26px; }
.hero-search { background: var(--surface); border-radius: var(--r-lg); padding: 8px; display: grid; grid-template-columns: 1.3fr 1.3fr 1fr auto; gap: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.hero-search input, .hero-search select { border: 0; background: var(--canvas); }
.hero-search-label { color: #a6a6a6; font-size: .82rem; margin: 0 0 8px 2px; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-side { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-lg); padding: 20px; }
.hero-side h2 { color: #fff; font-size: 1.05rem; margin-bottom: 12px; }
.hero-side .op { display: block; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.hero-side .op:hover .op-title { color: var(--gold); }
.op-title { font-weight: 600; display: block; }
.op-meta { color: #a6a6a6; font-size: .84rem; }
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-search { grid-template-columns: 1fr; }
}
/* underground cross-section */
.ground { position: relative; z-index: 1; height: 120px; background: linear-gradient(#3a2e22, #2a2119); border-top: 6px solid #4f6b3a;
  width: min(100% - 32px, var(--wrap) + 120px); margin: 0 auto 10px;
  /* Ends fade gradually into the page; glinting glass shards (shards-*.svg) sit over the fade. */
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.25) 90px, #000 240px, #000 calc(100% - 240px), rgba(0,0,0,.25) calc(100% - 90px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.25) 90px, #000 240px, #000 calc(100% - 240px), rgba(0,0,0,.25) calc(100% - 90px), transparent 100%); }
.ground-wrap { position: relative; }
.shards { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.shards { --gw: min(100vw - 32px, 1320px); }
.ground-wrap .shards { top: 0; height: 132px; }
.shards { z-index: 2; }
.shards img { position: absolute; top: 0; width: 240px; height: 132px; }
.shards .sh-l { left: calc(50% - var(--gw) / 2); }
.shards .sh-r { left: calc(50% + var(--gw) / 2 - 240px); }
@media (max-width: 700px) { .shards img { width: 150px; height: 82px; } .shards .sh-r { left: calc(50% + var(--gw) / 2 - 150px); } }
.crew-scene { position: relative; z-index: 2; width: min(100% - 32px, var(--wrap)); margin: 26px auto -4px; }
.crew-scene img { display: block; width: 100%; height: auto; }
.step-art { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 0 6px -8px; }
.audience-art { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 0 12px; }
.ground svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ground-legend { position: absolute; right: 250px; bottom: 10px; display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: #d6ccbf; z-index: 2; }
.ground-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 600px) { .ground-legend { display: none; } .ground { height: 70px; } }
@media (prefers-reduced-motion: no-preference) {
  .ground .pulse { stroke-dasharray: 6 18; animation: flow 6s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -240; } }
}

/* ---- home sections ---- */
.section { padding-top: 56px; padding-bottom: 56px; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); margin: 0; }
.section-head p { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.trade-index { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.trade-col { padding: 20px; border-right: 1px solid var(--border); position: relative; }
.trade-col:last-child { border-right: 0; }
.trade-col::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.trade-col h3 { font-size: 1.02rem; margin: 6px 0 10px; }
.trade-col ul { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.trade-col li { padding: 3px 0; }
.trade-col li a { color: var(--ink); text-decoration: none; }
.trade-col li a:hover { color: var(--link); text-decoration: underline; }
.trade-col .count { font-size: .8rem; color: var(--muted); }
@media (max-width: 1000px) { .trade-index { grid-template-columns: repeat(2, 1fr); } .trade-col { border-bottom: 1px solid var(--border); } }
@media (max-width: 560px) { .trade-index { grid-template-columns: 1fr; } .trade-col { border-right: 0; } }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border-top: 2px solid var(--heading); }
.step { padding: 20px 20px 4px 0; position: relative; display: flex; flex-direction: column; }
.step .step-art { order: -1; }
.step::before { counter-increment: step; content: counter(step); font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; color: var(--gold); display: block; line-height: 1; margin-bottom: 8px; }
.step h3 { font-size: 1.05rem; }
.step p { color: var(--muted); font-size: .92rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } }
.evidence-scale { list-style: none; padding: 0; margin: 0; }
.evidence-scale li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.evidence-scale li:first-child { border-top: 0; }
.ev-dot { width: 18px; height: 18px; border-radius: 50%; margin-top: 2px; }
.ev-independent { background: var(--success); }
.ev-reviewed { background: var(--surface); border: 5px solid var(--info); }
.ev-self_reported { background: var(--surface); border: 2px dashed var(--faint); }
.audience { display: grid; grid-template-columns: 1fr 1fr; }
.audience > div { padding: 40px; }
.audience > div:first-child { background: var(--navy-800); color: #fff; }
.audience > div:first-child h2 { color: #fff; }
.audience > div:first-child p { color: #cfcfcf; }
.audience > div:last-child { background: var(--gold); color: var(--on-accent); }
.audience > div:last-child h2 { color: var(--on-accent); }
.audience ul { padding-left: 18px; margin: 0 0 22px; }
@media (max-width: 760px) { .audience { grid-template-columns: 1fr; } .audience > div { padding: 28px 20px; } }

/* ---- project & company rows ---- */
.result-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.result { display: grid; grid-template-columns: 6px 1fr auto; gap: 0 18px; border-top: 1px solid var(--border); }
.result:first-child { border-top: 0; }
.result-bar { background: var(--c, var(--border)); }
.result-body { padding: 16px 0; min-width: 0; }
.result-aside { padding: 16px 18px 16px 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 150px; }
.result-title { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; color: var(--heading); text-decoration: none; }
.result-title:hover { color: var(--link); text-decoration: underline; }
.result-meta { color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 3px 0 7px; }
.result-meta span { display: inline-flex; align-items: center; gap: 5px; }
.result-summary { font-size: .92rem; margin: 0 0 8px; max-width: 80ch; }
.deadline { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--heading); }
.deadline-soon { color: var(--danger); }
.budget { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 680px) {
  .result { grid-template-columns: 5px 1fr; }
  .result-aside { grid-column: 2; text-align: left; align-items: flex-start; padding: 0 14px 14px 0; flex-direction: row; flex-wrap: wrap; min-width: 0; }
}
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.filters .field { margin-bottom: 12px; }
.filters h2 { font-size: 1rem; margin-bottom: 12px; }
@media (max-width: 960px) { .filters { position: static; max-height: none; } .filters-collapsible:not([open]) .filter-body { display: none; } }
.filters-collapsible summary { cursor: pointer; font-weight: 600; list-style: none; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.toolbar select { width: auto; padding: 6px 10px; }

.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.org-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.org-head { display: flex; gap: 12px; align-items: flex-start; }
.org-logo { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--navy-800); color: var(--gold); font-family: var(--font-display); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.org-logo.lg { width: 72px; height: 72px; font-size: 1.6rem; border-radius: var(--r-lg); }
.org-name { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--heading); text-decoration: none; }
.org-name:hover { text-decoration: underline; }
.vline { font-size: .84rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meter { display: inline-flex; gap: 2px; }
.meter i { width: 9px; height: 9px; border-radius: 2px; background: var(--border); display: block; }
.meter i.on { background: var(--success); }
.meter i.pend { background: #b5b5b5; }
.meter i.bad { background: #e8a39d; }
.org-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ---- verification checklist ---- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border); align-items: start; }
.checklist li:first-child { border-top: 0; }
.check-title { font-weight: 600; color: var(--heading); }
.check-meta { font-size: .83rem; color: var(--muted); }
.check-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.ci-verified { background: var(--success); color: #fff; }
.ci-pending { background: var(--info-bg); color: var(--info); border: 2px solid var(--info); }
.ci-not_started { border: 2px dashed var(--border-strong); }
.ci-needs_update, .ci-expired, .ci-rejected { background: var(--danger-bg); color: var(--danger); border: 2px solid var(--danger); }

/* ---- stat strip ---- */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px; }
.stat { padding: 16px 18px; border-right: 1px solid var(--border); text-decoration: none; color: inherit; }
.stat:last-child { border-right: 0; }
.stat-n { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--heading); line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .84rem; }
a.stat:hover { background: var(--hover); }
.stat.alert .stat-n { color: var(--danger); }

/* ---- timeline / activity ---- */
.activity { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.activity li { padding: 9px 0 9px 18px; border-left: 2px solid var(--border); position: relative; }
.activity li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.activity .when { color: var(--faint); font-size: .8rem; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a[aria-current="page"], .tabs a:hover { color: var(--heading); border-color: var(--gold); }

/* ---- Q&A ---- */
.qa { border-top: 1px solid var(--border); padding: 14px 0; }
.qa:first-child { border-top: 0; padding-top: 0; }
.qa-q { font-weight: 600; color: var(--heading); }
.qa-a { margin-top: 8px; padding: 10px 12px; background: var(--canvas); border-radius: var(--r-md); border-left: 3px solid var(--gold); font-size: .92rem; }
.addendum { border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .9rem; }
.files li:first-child { border-top: 0; }
.file-link { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }

/* ---- footer ---- */
.site-footer { background: var(--navy-900); color: #a6a6a6; padding: 42px 0 26px; margin-top: 0; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 3px 0; }
.site-footer a { color: #cfcfcf; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; }
.utility-rule { display: flex; height: 4px; }
.utility-rule i { flex: 1; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---- auth ---- */
.auth-wrap { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } }
.demo-accounts { display: grid; gap: 6px; }
.demo-accounts button { text-align: left; width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; cursor: pointer; font: inherit; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.demo-accounts button:hover { border-color: var(--gold); background: var(--hover); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.role-pick input { margin-top: 4px; accent-color: var(--gold); }
.role-pick label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,104,28,.25); background: var(--accent-soft); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-size: .88rem; }
.pager .current { background: var(--strong-bg); color: var(--strong-fg); border-color: var(--strong-bg); }

.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-family: var(--font-display); font-size: 4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.line-items input { min-width: 80px; }
.progress { height: 8px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 7px 0; border-top: 1px solid var(--border); }
.list-plain li:first-child { border-top: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; }
.w-auto { width: auto !important; }
@media print { .site-header, .site-footer, .demo-banner, .btn { display: none !important; } body { background: #fff; color: #000; } .panel { border: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* UtiliLinQ logo (white + orange artwork on a transparent background, for dark surfaces) */
.brand img { display: block; height: 38px; width: auto; }
.site-footer .brand img { height: 34px; }
@media (max-width: 560px) { .brand img { height: 30px; } }

/* Dark/light switch: small and quiet, far right of the header */
.theme-form { margin: 0; display: inline-flex; }
.icon-btn.theme-toggle { width: 30px; height: 30px; color: #8c8c88; margin-left: 2px; }
.icon-btn.theme-toggle:hover { color: #fff; }
.theme-toggle .ti-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: block; }

/* Home page: the big logo on first visit */
.hero-brand { position: relative; z-index: 2; text-align: center; padding-top: 48px; padding-bottom: 0; }
.hero-brand::before { content: ""; position: absolute; left: 50%; top: 52%; width: min(900px, 90vw); height: 340px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(245,104,28,.16), rgba(245,104,28,0)); pointer-events: none; z-index: -1; }
.hero-brand img { display: block; width: clamp(260px, 56vw, 760px); height: auto; margin: 0 auto; }
.hero-tagline { margin: 18px 0 0; color: #bdbdb9; font-family: var(--font-display); font-size: clamp(.95rem, .8rem + .6vw, 1.25rem);
  letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 560px) { .hero-brand { padding-top: 32px; } .hero-tagline { letter-spacing: .08em; } }

/* LIVE DEMO: the View-as button, and the tiny exit x (only visible to someone who knows it's there) */
.seg-live { margin-left: 6px; border: 1px solid rgba(0,0,0,.35); border-radius: 6px; letter-spacing: .04em; }
.live-off { margin: 0 0 0 2px; display: inline-flex; }
.live-off button { width: 12px; height: 12px; padding: 0; border: 0; background: none; color: var(--gold); opacity: .55;
  font: 700 11px/12px var(--font-body); cursor: pointer; }
.live-off button:hover, .live-off button:focus-visible { opacity: 1; }

/* Admin: site stats + access QR */
.chart { margin: 18px 0 0; }
.chart svg { display: block; width: 100%; height: 160px; background: var(--surface-2); border-radius: var(--r-md); }
.qr svg { display: block; width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 6px; }
.break { word-break: break-all; }
@media print { .qr-panel { border: 0; } .tabs, h1 { display: none !important; } }
.grid-2 > .panel { margin-top: 0; }

/* Bid-deadline urgency: the left bar on project rows (and the "days left" text). Orange = closing, yellow = soon, green = fresh. */
.result { --c: var(--border); }
.result.urg-closing { --c: #f5681c; } .result.urg-soon { --c: #f2c200; } .result.urg-fresh { --c: #46c17f; }
.result.urg-closing .until, .result.urg-soon .until, .result.urg-fresh .until { color: var(--c); font-weight: 600; }
.urg-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin: 0 0 10px; }
.urg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.urg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.urg-dot.urg-closing { background: #f5681c; } .urg-dot.urg-soon { background: #f2c200; } .urg-dot.urg-fresh { background: #46c17f; }
.result .deadline-soon { color: var(--c); }
