/* Sitehorn — steel and safety orange.
   Layout: a steel band holds the company name and tabs; content sits on white below it.
   One column on phones; the owners' overview widens on a computer.
   Orange is the only brand color. Status colors stay clearly apart from it:
   green = good, yellow = heads-up, red = late or a problem. */
:root {
  --bg: #ffffff;          /* page */
  --panel: #f5f7fa;       /* quiet fills, inputs on panels */
  --ink: #111418;         /* text */
  --muted: #5b6472;       /* secondary text */
  --line: #e3e7ed;        /* dividers */
  --line-strong: #c9d0da; /* input borders */
  --band: #1f2a37;        /* top band: steel */
  --band-muted: #a7b1bd;  /* unselected tabs on the band */
  --brand: #c2410c;       /* safety orange, deepened so white text and links pass contrast */
  --brand-hover: #9a3412;
  --brand-mid: #ff7a1a;   /* bright orange: tab underline, bars, focus rings */
  --brand-soft: #fff1e6;  /* selected fills */
  --on-brand: #ffffff;
  --good: #067647; --good-soft: #dcfae6; --good-bar: #17b26a;
  --warn: #854d0e; --warn-soft: #fef9c3; --warn-bar: #eab308;
  --bad:  #b42318; --bad-soft:  #fee4e2; --bad-bar:  #f04438;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --radius: 8px;
  color-scheme: light;
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15.5px; line-height: 1.45 }
[hidden] { display: none !important }

/* ---------- Top band ---------- */
.band { background: var(--band); color: #fff; padding-top: env(safe-area-inset-top, 0px) }
.band-inner, .wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
body.wide .band-inner, body.wide .wrap { max-width: 1160px }
.wrap { padding-block: 16px calc(40px + env(safe-area-inset-bottom, 0px)) }
header.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 0 12px }
header.top > div { min-width: 0 }
h1 { font-size: 22px; line-height: 1.2; font-weight: 700; margin: 0; color: #fff; letter-spacing: -0.01em; overflow-wrap: anywhere }
h1 .co { color: #fff }
.band .date { color: var(--band-muted) }
.band .linkbtn { color: #cdd3db }
nav.tabs { display: flex; gap: 2px; margin: 0; overflow-x: auto; scrollbar-width: none }
nav.tabs::-webkit-scrollbar { display: none }
nav.tabs button { flex: 1 0 auto; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--band-muted); font: 600 15px var(--font); padding: 10px 10px 9px; cursor: pointer; white-space: nowrap }
nav.tabs button:hover { color: #fff }
nav.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--brand-mid) }
nav.tabs .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--bad-bar); color: #fff; font-size: 11.5px; line-height: 18px; font-weight: 700 }

h2 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 24px 0 8px; text-wrap: balance; letter-spacing: -0.01em }
.date, .sub, .hint { color: var(--muted) }
.date { font-size: 13.5px; font-variant-numeric: tabular-nums }
.sub { font-size: 13.5px }
.hint { font-size: 14px; margin: 0 0 10px }
.role { display: inline-block; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px }

/* ---------- Cards, chips, bars ---------- */
.stack { display: flex; flex-direction: column; gap: 10px }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px }
.card.alert { border-color: #f6c5c0; box-shadow: inset 4px 0 0 var(--bad-bar) }
.card + .card { margin-top: 10px }
.card.quiet { background: var(--panel) }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px }
.row > * { min-width: 0 }
.name { font-weight: 700; font-size: 16.5px; overflow-wrap: anywhere }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px }
.chip { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel); color: var(--muted); white-space: nowrap }
.chip.ok, .chip.green { background: var(--good-soft); color: var(--good) }
.chip.warn, .chip.yellow { background: var(--warn-soft); color: var(--warn) }
.chip.bad, .chip.red { background: var(--bad-soft); color: var(--bad) }
.chip.acc { background: var(--brand-soft); color: var(--brand) }

/* Progress bar with a tick for where the job should be today */
.bar { position: relative; height: 8px; background: #eef1f5; border-radius: 999px; margin-top: 10px }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--brand-mid); border-radius: 999px }
.bar.green > i { background: var(--good-bar) } .bar.yellow > i { background: var(--warn-bar) } .bar.red > i { background: var(--bad-bar) }
.bar > b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px }
.progress-line { margin-top: 6px; font-size: 13.5px; color: var(--muted) }
.progress-line strong { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums }

.log { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line) }
.log li { display: grid; grid-template-columns: 4.8em 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: start }
.log li:last-child { border-bottom: 0 }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.log .what { min-width: 0; overflow-wrap: anywhere }
.log .confirm-del { grid-column: 1 / -1 }
.issue, .delay { border-radius: var(--radius); padding: 10px 12px; margin-top: 8px; font-size: 14px }
.issue { background: var(--bad-soft); color: var(--bad) }
.delay { background: var(--warn-soft); color: var(--warn) }
.issue .row, .delay .row { align-items: center }
.issue .btn, .delay .btn { white-space: nowrap; flex-shrink: 0 }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px }
.thumbs .thumb { margin: 0; width: 72px; height: 72px; max-height: none }
.thumb { display: block; margin-top: 8px; max-width: 100%; max-height: 220px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--panel) }
.thumb-wrap { position: relative; display: inline-block }
.thumb-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font: 700 14px/22px var(--font); cursor: pointer; padding: 0 }

/* ---------- Forms and buttons ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px }
input, select, textarea { width: 100%; font: 16px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 11px }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand) }
textarea { min-height: 76px; resize: vertical }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); outline-offset: 0; border-color: var(--brand-mid) }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand-mid); outline-offset: 2px }
.form { display: grid; gap: 12px }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.two > * { min-width: 0 }
@media (max-width: 380px) { .two { grid-template-columns: 1fr } }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0 }

.btn { display: inline-block; text-align: center; text-decoration: none; border: 1px solid var(--brand); border-radius: 6px; background: var(--brand); color: var(--on-brand); font: 600 15px var(--font); padding: 10px 16px; cursor: pointer; transition: background .12s }
.btn:hover { background: var(--brand-hover) }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong) }
.btn.ghost:hover { background: var(--panel) }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff }
.btn.danger:hover { background: #912018 }
.btn.small { padding: 5px 11px; font-size: 13.5px }
.btn.full { width: 100% }
.btn:disabled { opacity: .45; cursor: not-allowed }
.linkbtn { background: none; border: 0; color: var(--brand); font: 600 13.5px var(--font); cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px }
.linkbtn.danger { color: var(--bad) }
.big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.big .btn { padding: 18px 8px; font-size: 17px }
.big .btn.span2 { grid-column: 1 / -1; padding: 14px 8px; font-size: 16px }
.big .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink) }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center }

.empty { text-align: center; padding: 24px 14px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius) }
.empty b { color: var(--ink); display: block; font-size: 16px; margin-bottom: 4px }
.loading { color: var(--muted); text-align: center; padding: 28px 0 }
.banner { border-radius: var(--radius); padding: 10px 12px; font-size: 14px; margin: 10px 0; background: var(--warn-soft); color: var(--warn) }
.banner.bad { background: var(--bad-soft); color: var(--bad) }
.banner.info { background: var(--brand-soft); color: var(--brand) }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); text-align: center; z-index: 20; box-shadow: 0 6px 24px rgba(17, 20, 24, .18) }

.listitem { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line) }
.listitem:last-child { border-bottom: 0 }
.listitem > div:first-child { min-width: 0; flex: 1 }
.listitem.open { border-bottom: 0 }
.edit-row { padding-bottom: 12px; border-bottom: 1px solid var(--line) }
.edit-row:last-child { border-bottom: 0 }
.edit-row .edit-panel { margin-top: 0 }
.edit-panel { margin-top: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius) }
.report { white-space: pre-wrap; font: 13.5px/1.55 var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; margin: 0 0 10px }
.done { text-align: center; padding: 26px 14px }
.done .check { font-size: 26px; font-weight: 700; color: var(--good); margin: 0 0 6px }
details.closed summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0 }

/* ---------- Owner overview ---------- */
/* The big number takes the status color; the card stays white with a status stripe. */
.hero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 24px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; margin-bottom: 4px; box-shadow: inset 6px 0 0 var(--line-strong) }
.hero.green  { box-shadow: inset 6px 0 0 var(--good-bar); border-color: #b7ebc9 }
.hero.yellow { box-shadow: inset 6px 0 0 var(--warn-bar); border-color: #f5e08a }
.hero.red    { box-shadow: inset 6px 0 0 var(--bad-bar);  border-color: #f6c5c0 }
.hero.green .hero-num, .hero.green .hero-label { color: var(--good) }
.hero.yellow .hero-num, .hero.yellow .hero-label { color: var(--warn) }
.hero.red .hero-num, .hero.red .hero-label { color: var(--bad) }
.hero-num { font-size: clamp(64px, 18vw, 112px); font-weight: 800; line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink) }
.hero-num span { font-size: .45em; letter-spacing: 0 }
.hero-label { font-size: 18px; font-weight: 700 }
.hero-sub { font-size: 14.5px; margin-top: 4px; color: var(--muted) }
@media (max-width: 420px) { .hero { grid-template-columns: 1fr } }

.legend { font-size: 13px; color: var(--muted); margin: 6px 0 0 }
.grid2 { display: grid; gap: 0 28px }
.grid2 > * { min-width: 0 }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1.35fr 1fr } }

/* Data tables: light header, thin dividers */
.sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius) }
table.sheet { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums }
table.sheet th { background: var(--panel); color: var(--muted); text-align: left; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; white-space: nowrap; border-bottom: 1px solid var(--line) }
table.sheet td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top }
table.sheet tbody tr:first-child td { border-top: 0 }
table.sheet td.num { text-align: right; white-space: nowrap }
table.sheet td .bar { margin-top: 6px; min-width: 90px }
table.sheet .jobname { font-weight: 700 }

.pm-row { padding: 11px 0; border-bottom: 1px solid var(--line) }
.pm-row:last-child { border-bottom: 0 }
.pm-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); margin-top: 2px }
.pm-stats b { color: var(--ink) }
.feed { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13.5px }
.feed li { padding: 3px 0; color: var(--muted) }
.feed li b { color: var(--ink); font-weight: 600 }

/* ---------- Job invites ---------- */
.invites { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line) }
.inv-head { font-weight: 700; font-size: 14px; color: var(--ink) }
.inv-row { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px }
.inv-row:last-of-type { border-bottom: 0 }
.inv-row .actions { margin-top: 6px }
.invite-card .name { font-size: 18px }
.invite-card.focus { border: 2px solid var(--brand-mid) }
.invite-when { font-weight: 700; font-size: 16px; margin: 6px 0 2px }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 }
.checkline input { width: 20px; height: 20px }

@media (prefers-reduced-motion: no-preference) { .toast { animation: up .2s ease-out } @keyframes up { from { opacity: 0; transform: translate(-50%, 8px) } } }

/* Phones: data tables become stacked rows with labels, so nothing scrolls sideways */
@media (max-width: 640px) {
  .sheet-wrap { overflow: visible }
  table.sheet thead { display: none }
  table.sheet, table.sheet tbody, table.sheet tr, table.sheet td { display: block; width: 100% }
  table.sheet tr { padding: 12px 14px; border-top: 1px solid var(--line) }
  table.sheet tbody tr:first-child { border-top: 0 }
  table.sheet td { border: 0; padding: 3px 0 }
  table.sheet td[data-label] { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: start }
  table.sheet td[data-label]::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 2px }
  table.sheet td.num { text-align: left }
  table.sheet td:empty { display: none }
}

/* Phones: five tabs share the width instead of scrolling; long status chips wrap under the title */
@media (max-width: 480px) {
  nav.tabs button { flex: 1 1 0; min-width: 0; padding: 10px 2px 9px; font-size: 13.5px }
  nav.tabs .badge { margin-left: 3px; min-width: 16px; padding: 0 4px; font-size: 11px; line-height: 16px }
}
.inv-row .row { flex-wrap: wrap }
.inv-row .row > .chip { flex-shrink: 0 }

/* ---------- Computers ---------- */
/* Sign-in and set-up cards stay a comfortable width on big screens. */
#login .card, #onboard .card { max-width: 480px; margin-left: auto; margin-right: auto }
.board-grid > .card + .card { margin-top: 0 }
@media (min-width: 1000px) {
  /* Today: job cards side by side, most urgent first, reading left to right. */
  .board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; align-items: start }
  /* Setup: jobs and subs side by side. */
  .setup-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start }
  .setup-cols > * { min-width: 0 }
  .setup-cols .subs-head { margin-top: 4px }
  /* Report: readable line length, not edge to edge. */
  #view-report > * { max-width: 900px }
}
.powered { text-align: center; color: var(--muted, #667085); font-size: 12px; margin: 28px 0 8px }
.powered b { color: var(--ink); font-weight: 700; letter-spacing: -0.01em }

/* ---------- Ranking: numbered, colored, most urgent first ---------- */
.rank { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 8px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--line-strong); vertical-align: 2px; font-variant-numeric: tabular-nums }
.rank.red { background: var(--bad-bar) } .rank.yellow { background: var(--warn-bar); color: #422006 } .rank.green { background: var(--good-bar) }
.rank.big { min-width: 40px; height: 40px; font-size: 19px; margin: 0; flex: none }
.rank.mini { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; margin: 0 4px 0 10px; vertical-align: 1px }
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px }
.route-item { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: inset 5px 0 0 var(--line-strong) }
.route-item.red { box-shadow: inset 5px 0 0 var(--bad-bar); border-color: #f6c5c0 }
.route-item.yellow { box-shadow: inset 5px 0 0 var(--warn-bar); border-color: #f5e08a }
.route-item.green { box-shadow: inset 5px 0 0 var(--good-bar) }
.route-body { flex: 1; min-width: 0 }
.route-body .row { flex-wrap: wrap; gap: 8px }
.route-progress { display: grid; gap: 4px; margin: 10px 0 2px; font-size: 13.5px }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 6px }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: inset 0 4px 0 var(--line-strong) }
.tile.red { box-shadow: inset 0 4px 0 var(--bad-bar) } .tile.red .tile-num { color: var(--bad) }
.tile.yellow { box-shadow: inset 0 4px 0 var(--warn-bar) } .tile.yellow .tile-num { color: var(--warn) }
.tile.green { box-shadow: inset 0 4px 0 var(--good-bar) } .tile.green .tile-num { color: var(--good) }
.tile.zero .tile-num { color: var(--muted) }
.tile-num { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums }
.tile-num span { font-size: .5em; color: var(--muted); font-weight: 700 }
.tile-label { font-size: 13px; color: var(--muted); margin-top: 6px }
@media (max-width: 700px) { .tiles { grid-template-columns: 1fr 1fr } }
.dash-pill { display: inline-block; margin-left: 10px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 3px; background: rgba(255,255,255,.12); color: #fff }
.dash-pill.pm { background: var(--brand) }
@media (max-width: 480px) { .dash-pill { display: block; width: max-content; margin: 4px 0 0 } }
.card.flash { outline: 3px solid var(--brand-mid); outline-offset: 2px; transition: outline-color .3s }
.report-photos { margin-bottom: 12px }
.report-photos .name { margin-bottom: 6px }
.rp-item { padding: 8px 0; border-top: 1px solid var(--line) }
.rp-item:first-of-type { border-top: 0 }
.hero-main { min-width: 0 }
.hero-label .rank { vertical-align: 3px }
.hero-pick { display: flex; gap: 6px; align-items: center; margin-top: 12px; max-width: 460px }
.hero-pick select { flex: 1; min-width: 0 }
.hero-pick .btn { min-width: 36px; font-size: 18px; line-height: 1; padding-left: 0; padding-right: 0 }
.hero-count { font-size: 13px }

/* ---------- Header links ---------- */
.top-links { display: flex; gap: 6px; align-items: center }
.top-links .linkbtn { color: #cfd6e2 }

/* ---------- Sign-in page ---------- */
.login-wrap { display: grid; gap: 8px; align-items: start }
.intro { padding: 18px 2px 0 }
.intro-kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand) }
.intro-head { margin: 6px 0 10px; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em }
.intro-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; display: grid; gap: 6px }
.intro-list b { color: var(--ink) }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px }
@media (max-width: 999px) { .intro-list { display: none } .intro { text-align: center; padding-top: 6px } .intro-head { font-size: 19px; margin-bottom: 0 } }
@media (min-width: 1000px) {
  .login-wrap { grid-template-columns: 1fr 480px; gap: 48px; max-width: 1040px; margin: 24px auto 0 }
  .intro { padding-top: 40px } .intro-head { font-size: 34px }
  #login .card { margin: 16px 0 0 }
}

/* ---------- Links that open a job ---------- */
.linkbtn.name, .linkbtn.jobname { color: var(--ink); text-decoration: none; padding: 0; text-align: left; font-size: inherit }
.linkbtn.name { font-weight: 700; font-size: 16.5px }
.linkbtn.jobname { font-weight: 700 }
.linkbtn.name:hover, .linkbtn.jobname:hover { text-decoration: underline; color: var(--brand) }
.linkbtn.back { padding: 0; margin: 0 0 10px; text-decoration: none; font-size: 14.5px }
.visit-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center }

/* ---------- Today / This week switch ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; margin: 2px 0 10px; background: #fff }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff }

/* ---------- Week schedule ---------- */
.sch-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px }
.sch-grid table { min-width: 860px }
.sch-grid td, .sch-grid th { vertical-align: top }
.sch-grid th.is-today, .sch-grid td.is-today { background: var(--brand-soft) }
.sch-grid td.crowded { box-shadow: inset 0 0 0 2px var(--warn-bar) }
.sch-chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; margin: 0 0 4px; background: #fff; font: 12.5px/1.3 var(--font); cursor: pointer; color: var(--ink) }
.sch-chip b, .sch-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.sch-chip span { color: var(--muted) }
.sch-chip.ok { border-left-color: var(--good-bar) } .sch-chip.acc { border-left-color: var(--brand-mid) } .sch-chip.warn { border-left-color: var(--warn-bar) } .sch-chip.bad { border-left-color: var(--bad-bar); background: var(--bad-soft) }
.crowd-note { font-size: 12px; font-weight: 700; color: var(--warn) }
.sch-days { display: none }
.sch-day.is-today { border-color: var(--brand-mid) }
.sch-job { padding: 8px 0 0; border-top: 1px solid var(--line); margin-top: 8px }
.sch-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; margin-top: 4px }
@media (max-width: 760px) { .sch-grid { display: none } .sch-days { display: grid; gap: 10px } }

/* ---------- Punch list ---------- */
.punch-sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px }
.punch-form { padding-bottom: 6px }
.punch-group { margin-top: 16px }
.punch-item { padding: 12px 0; border-top: 1px solid var(--line) }
.punch-group .punch-item:first-of-type { border-top: 0 }
.punch-item.fixed { background: var(--brand-soft); margin: 0 -12px; padding: 12px; border-radius: 8px; border-top: 0; margin-top: 6px }
.punch-item.closed > .row b { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted) }
.fixnote { margin-top: 8px; font-size: 14px }
.visit-note { margin-top: 8px; padding: 8px 10px; background: var(--panel); border-radius: 8px; font-size: 14px }

/* ---------- Pay ---------- */
.pay-line { margin-top: 4px }
.pay-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end }
.pay-form input { width: 190px; padding: 6px 8px; font-size: 14px }

/* ---------- Job page ---------- */
.job-head h2 { font-size: 22px }
.gallery .thumb { width: 96px; height: 96px }
.hist-day + .hist-day { margin-top: 12px }
.through-check { margin-top: 26px }
@media (max-width: 380px) { .through-check { margin-top: 0 } }

/* ---------- Report ---------- */
.report-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px }
.report-day { display: flex; gap: 8px; align-items: center }
.report-day label { margin: 0 }
.report-day select { width: auto }

/* ---------- Sub page ---------- */
.lang-btn { color: #cfd6e2; align-self: center }
.a2hs { margin-top: 12px; border-color: var(--brand-mid); background: var(--brand-soft) }
.job-info .btn { white-space: normal; text-align: left }
.punch-card.done-ish { background: var(--panel) }
.top-links { flex-shrink: 0 }
.top-links > * { white-space: nowrap }
header.top > div:first-child { flex: 1 1 auto; overflow-wrap: anywhere }
@media (max-width: 420px) { .top-links { gap: 2px } .top-links .linkbtn { padding-left: 4px; padding-right: 4px } }
/* Trial banner and getting-started checklist */
.trial-banner { margin: 12px 0 0 }
.getting-started { margin-top: 14px; border-color: var(--brand-mid) }
.gs-steps { list-style: none; margin: 0; padding: 0 }
.gs-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line) }
.gs-steps li > div { flex: 1; min-width: 0; display: flex; flex-direction: column }
.gs-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none }
.gs-steps li.done .gs-check { background: var(--good-bar); border-color: var(--good-bar); color: #fff }
.gs-steps li.done b { color: var(--muted) }
.save-acct { margin-top: 12px } .save-acct .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
/* Sub home (My Sitehorn) */
a.listitem.linkrow { color: inherit; text-decoration: none }
a.listitem.linkrow:hover b { color: var(--brand); text-decoration: underline }
fieldset.choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px }
fieldset.choice legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0 }
/* Sign-in page extras */
.intro-more { margin: 14px 0 0; font-size: 14.5px }
.legal-note { margin: 0; font-size: 13px }
.legal-foot { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0 }
.legal-foot a { color: var(--muted) }
@media (max-width: 999px) { .intro-more { display: none } }
.powered a { color: inherit }
/* Sitehorn staff admin */
.admin-tiles { grid-template-columns: repeat(5, 1fr); margin-top: 16px }
.admin-tools { display: flex; gap: 10px; margin: 14px 0 }
.admin-tools input { flex: 1; min-width: 0 }
.admin-tools select { width: auto }
.admin-co { margin-bottom: 12px }
.admin-name { font-size: 17px }
.admin-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13.5px; color: var(--muted) }
.admin-stats b { color: var(--ink) }
@media (max-width: 760px) { .admin-tiles { grid-template-columns: repeat(2, 1fr) } .admin-tools { flex-direction: column } .admin-tools select { width: 100% } }
.inv-more { display: block; margin: 8px 0 2px }
.record-tiles { margin-bottom: 4px } .record-more { margin: 6px 0 0 }
/* A sub's profile inside Setup */
.sub-profile { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel) }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px }
.pstat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column }
.pstat b { font-size: 20px; line-height: 1.1 }
.pstat span { font-size: 12.5px; color: var(--muted) }
.vouch-line { margin-top: 10px; align-items: flex-start }
@media (max-width: 520px) { .pstats { grid-template-columns: 1fr 1fr } }
.ref-link input { width: 100%; font-size: 14px; background: var(--panel) }
.share-link { width: 100%; font-size: 14px; background: var(--panel) }
.cta-card { margin-top: 20px; border-color: var(--brand-mid); background: var(--brand-soft) }

/* Accessibility and touch: screen-reader-only text; bigger tap areas on phones without changing the look */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
@media (max-width: 760px), (pointer: coarse) {
  .btn.small { min-height: 38px; padding-top: 8px; padding-bottom: 8px }
  .linkbtn, .top-links a, .top-links button, .lang-btn { position: relative }
  .linkbtn::after, .top-links a::after, .top-links button::after { content: ""; position: absolute; inset: -11px -4px }
  .seg button { min-height: 38px }
  .hero-pick button { min-width: 42px; min-height: 42px }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px }
}
.plan-line { margin: 0 } .field-hint { margin: 4px 0 0 }
@media (max-width: 480px) { nav.tabs button { flex: 1 1 auto; padding-left: 4px; padding-right: 4px } }   /* a tab with a badge takes the room it needs */

/* ---------- Sitehorn mark ---------- */
.brandrow { display: flex; align-items: center; gap: 12px; min-width: 0 }
.brandrow > div { min-width: 0 }
.brandmark { flex: none; width: 38px; height: 38px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.14) }
.intro-kicker img { border-radius: 10px }
.powered b img { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 2px }
#login a, .login-wrap a { color: var(--brand) }
@media (max-width: 480px) { .brandmark { width: 30px; height: 30px; border-radius: 7px } .brandrow { gap: 10px } }

/* ---------- Notifications (Account) ---------- */
.push-state { margin: 0 0 4px }
.push-state.on b { color: var(--good) }
.notify-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line) }
.notify-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px }
.notify-form legend { font-weight: 700; font-size: 14.5px; margin-bottom: 8px; padding: 0 }
.notify-form .checkline { align-items: flex-start; font-weight: 400 }
.notify-form .checkline input { margin-top: 1px; flex: none }
.notify-form .checkline .sub { display: block; font-size: 13px }
.push-card .row .btn { white-space: nowrap; flex: none }

/* ---------- Client portal ---------- */
.banner.good { background: var(--good-soft); color: var(--good) }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff }
a.client-job { display: block; color: inherit; text-decoration: none }
a.client-job:hover { border-color: var(--line-strong) }
.client-job .name { font-size: 17px }
.client-pct { margin-top: 10px; font-size: 15px } .client-pct b { font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums }
.client-stage { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; font-size: 15px }
.client-delay { color: var(--warn) } .client-delay b { color: var(--warn) }
.client-more { display: block; margin-top: 8px; font-weight: 600; color: var(--brand); font-size: 14px }
.log-day { font-size: 14px; color: var(--muted); font-weight: 700; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .04em }
.log-card { padding: 4px 16px }
.log-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line) } .log-item:last-child { border-bottom: 0 }
.log-icon { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--muted) }
.log-done .log-icon, .log-fixed .log-icon, .log-punch .log-icon { background: var(--good-soft); color: var(--good) }
.log-issue .log-icon { background: var(--bad-soft); color: var(--bad) } .log-delay .log-icon { background: var(--warn-soft); color: var(--warn) }
.log-phase .log-icon, .log-progress .log-icon { background: var(--brand-soft); color: var(--brand) }
.log-item .thumbs a.thumb { width: 88px; height: 88px; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 4px }
.log-item .thumbs a.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px }
.dir-card .name { font-size: 16.5px }
.req-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line) }
.find-form .seg { margin: 0; justify-self: start }
.dir-fields { border: 0; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px }
.dir-fields legend { font-weight: 700; font-size: 14.5px; padding: 0; margin-bottom: 4px }
.client-pick .checkline { margin: 6px 0 }

/* ---------- Licenses and certifications ---------- */
.creds { display: grid; gap: 8px; margin-top: 8px }
.cred { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff }
.cred.expired { background: var(--panel) } .cred.expired b { color: var(--muted) }
.cred-kind { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand) }
.cred .linkbtn { white-space: nowrap; flex: none }
.cred-note { font-size: 12.5px; margin: 6px 0 0 }
.cred-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line) }

/* ---------- Builder tools (upgrade 010) ---------- */
.summary-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px }
.sum-bit { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font-size: 14px }
.sum-bit b { font-size: 16px }
.sum-bit.acc { background: var(--brand-soft); border-color: #fed7aa; color: var(--brand) }
.sum-bit.bad { background: var(--bad-soft); border-color: #fecdca; color: var(--bad) }
.sum-bit.warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn) }
.sum-bit.zero { color: var(--muted) }
.sum-bit:hover { border-color: var(--line-strong) }
.banner.risk { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a }
.pushlater { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center }
.pushlater select { width: auto; min-width: 92px; padding: 6px 8px }
.paydocs { margin-top: 4px }
.paydocs .thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line) }
.finish-row input[type="date"] { width: auto; padding: 6px 8px }
.t-form { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line) }
.card > .t-form:first-child { margin-top: 0; padding-top: 0; border-top: 0 }
.sch-chip.insp { border-style: dashed; border-left-style: solid }
.sch-chip.del { background: var(--panel) }
.client-stages { margin: 0; padding-left: 22px }
.client-stages li { padding: 3px 0; color: var(--muted) }
.client-stages li.done { color: var(--ink) }
.client-stages li.now { color: var(--ink); font-weight: 700 }
#queue-note { margin-top: 0 }
@media (prefers-color-scheme: dark) {
  .sum-bit.acc, .sum-bit.bad, .sum-bit.warn, .banner.risk { border-color: transparent }
}
.waiver-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px }
.waiver-add select { width: auto; padding: 6px 8px }
.filebtn { cursor: pointer }
.filebtn.busy { opacity: .6; pointer-events: none }
