/* Southern Car Wash Services: near-black #0f0f0f and red #e12f2f with neutral grays, from southerncarwashservices.com. */
:root {
  --bg: #f5f5f5; --fg: #1a1a1a; --surface: #f0f0f0; --surface-soft: #ebebeb; --card: #ffffff; --muted: #5c5c5c;
  --line: #e3e3e3; --line-strong: #cfcfcf; --primary: #e12f2f; --primary-strong: #e12f2f; --primary-warm: #f2a3a3; --focus: #e12f2f;
  --primary-ink: #b81d1d; --on-primary: #ffffff; --button: #e12f2f; --button-hover: #c41f1f; --ink: #0f0f0f;
  /* Score lines are charcoal, not red, so a normal month never looks like an alarm. */
  --series: #0f0f0f;
  --good: #016630; --good-bg: #dcfce7; --warn: #874b00; --warn-bg: #fef9c2; --danger: #a3121a; --danger-bg: #fde3e3;
  --neutral-bg: #f0f0f0; --neutral-fg: #333333; --info-bg: #dbeafe; --info-fg: #1447e6;
  --heat: 225, 47, 47;
  --shadow: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --dialog: 0 20px 25px rgba(0,0,0,.10), 0 8px 10px rgba(0,0,0,.04);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f0f0f; --fg: #f5f5f5; --surface: #1a1a1a; --surface-soft: #242424; --card: #1a1a1a; --muted: #a8a8a8;
  --line: #2e2e2e; --line-strong: #404040; --primary-ink: #ff8a8a; --button: #e12f2f; --button-hover: #f04848; --series: #e8e8e8;
  --good: #86efac; --good-bg: #1f4a31; --warn: #fde68a; --warn-bg: #57451a; --danger: #fecaca; --danger-bg: #6b2424;
  --neutral-bg: #262626; --neutral-fg: #f5f5f5; --info-bg: #27406f; --info-fg: #bfdbfe;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --dialog: 0 20px 25px rgba(0,0,0,.6);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0f0f0f; --fg: #f5f5f5; --surface: #1a1a1a; --surface-soft: #242424; --card: #1a1a1a; --muted: #a8a8a8;
  --line: #2e2e2e; --line-strong: #404040; --primary-ink: #ff8a8a; --button: #e12f2f; --button-hover: #f04848; --series: #e8e8e8;
  --good: #86efac; --good-bg: #1f4a31; --warn: #fde68a; --warn-bg: #57451a; --danger: #fecaca; --danger-bg: #6b2424;
  --neutral-bg: #262626; --neutral-fg: #f5f5f5; --info-bg: #27406f; --info-fg: #bfdbfe;
  --shadow: 0 1px 3px rgba(0,0,0,.5); --dialog: 0 20px 25px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 400 14px/20px var(--sans); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; line-height: 2rem; font-weight: 700; text-wrap: balance; }
h2 { font-size: 1.125rem; line-height: 1.75rem; font-weight: 700; text-wrap: balance; }
h3 { font-size: .875rem; line-height: 1.25rem; font-weight: 700; }
a { color: var(--primary-ink); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 18px; }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: .75rem; line-height: 1rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* Shell */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.shell.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 20px 16px 16px; color: #fff; overflow: hidden; isolation: isolate;
  background: #0f0f0f; border-right: 1px solid rgba(255,255,255,.08); }
.side::before { content: ""; position: absolute; inset: auto -40% -18% -40%; height: 45%; background: radial-gradient(closest-side, rgba(225,47,47,.30), transparent); z-index: -1; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { display: block; width: 100%; max-width: 200px; height: auto; }
.brand-mark { display: none; width: 32px; height: auto; }
.side > .brand { position: relative; padding: 0 4px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side > .brand::after { content: ""; position: absolute; left: 4px; bottom: -1px; width: 32px; height: 2px; background: var(--primary); }
.side .brand-name { letter-spacing: .06em; white-space: nowrap; }
.side .brand-name::before { display: none; }
.brand-name { display: flex; align-items: center; gap: 8px; font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.brand-name::before { content: ""; flex: none; width: 16px; height: 2px; border-radius: 1px; background: var(--primary); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.75); font-size: 13px; line-height: 16px; font-weight: 700; text-align: left; cursor: pointer; transition: background 150ms, color 150ms; white-space: nowrap; }
.nav button svg { flex: none; }
.nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav button[aria-current="page"] { background: var(--button); color: #fff; }
.nav button[aria-current="page"] .count { background: #fff; color: #b81d1d; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.side-user { padding: 8px 12px; font-size: 12px; line-height: 16px; color: rgba(255,255,255,.75); overflow-wrap: anywhere; }
.side-user strong { display: block; color: #fff; }
.collapsed .brand-logo, .collapsed .brand-name, .collapsed .nav button span, .collapsed .side-user { display: none; }
.collapsed .brand { align-items: center; padding-inline: 0; }
.collapsed .side > .brand::after { left: calc(50% - 16px); }
.collapsed .brand-mark { display: block; }
.collapsed .nav button { justify-content: center; padding: 8px; }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 64px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); color: #fff;
  background: #0f0f0f; border-bottom: 1px solid rgba(255,255,255,.08); }
.ghost { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.75); cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.75); }
.topbar select { height: 36px; max-width: 220px; padding: 0 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; }
.topbar select option { color: #0f0f0f; background: #fff; }
.topbar .as-of { margin-left: auto; font-size: 12px; color: rgba(255,255,255,.75); }

.main { min-width: 0; }
.page { max-width: 1400px; margin: 0 auto; padding-block: 32px 64px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head > div { min-width: 0; }

/* Surfaces */
.card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head > div { min-width: 0; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; line-height: 18px; }
.banner.info { background: var(--neutral-bg); color: var(--neutral-fg); }
.banner.bad { background: var(--danger-bg); color: var(--danger); }

/* KPIs */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .value { font-size: 2rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; line-height: 18px; color: var(--muted); }

/* Badges */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.watch, .pill.elevated, .pill.mock { background: var(--warn-bg); color: var(--warn); }
.pill.risk, .pill.high { background: var(--danger-bg); color: var(--danger); }
.pill.neutral, .pill.clear { background: var(--neutral-bg); color: var(--neutral-fg); }
.pill.lvl-watch, .pill.draft { background: var(--info-bg); color: var(--info-fg); }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 9999px; background: var(--button); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 150ms; }
.btn:hover { background: var(--button-hover); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.quiet { background: transparent; color: var(--fg); border: 1px solid var(--line-strong); }
.btn.quiet:hover { background: var(--surface-soft); }
.link { padding: 0; border: 0; background: none; color: var(--primary-ink); font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, label.field { font-size: 14px; font-weight: 500; }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--card); color: var(--fg); }
input[type="file"].input { padding: 8px 12px; height: auto; }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.err { color: var(--danger); font-size: 13px; line-height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9999px; background: var(--card); color: var(--fg); font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--surface-soft); }
.chip[aria-pressed="true"] { background: var(--button); border-color: var(--button); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th { height: 44px; padding: 0 12px; text-align: left; white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-soft); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.item-text { min-width: 240px; max-width: 460px; }
.note { color: var(--muted); font-size: 13px; line-height: 18px; min-width: 200px; }

/* Charts */
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart text.val { fill: var(--fg); font-weight: 700; font-size: 12px; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--series); stroke: var(--card); stroke-width: 2; }
.chart .dot.sim { fill: var(--card); stroke: var(--series); stroke-width: 1.5; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; line-height: 16px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--series); background: var(--series); }
.key-dot.sim { background: var(--card); }
#tip { position: fixed; z-index: 30; max-width: 260px; padding: 8px 10px; border-radius: 6px; background: #1d1a17; color: #fff; font-size: 12px; line-height: 16px; pointer-events: none; box-shadow: var(--dialog); white-space: pre-line; }

.heat th { height: 32px; padding: 0 4px; text-align: center; font-size: 11px; letter-spacing: 0; text-transform: none; }
.heat th:first-child, .heat td:first-child { text-align: left; padding-left: 0; white-space: nowrap; font-size: 13px; font-weight: 500; position: sticky; left: 0; background: var(--card); text-transform: none; }
.heat td { padding: 1px; border: 0; }
.heat .cell { display: block; min-width: 40px; padding: 7px 2px; border-radius: 4px; text-align: center; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; color: var(--fg); }
.heat .cell.none { color: var(--muted); }
.strip { display: inline-flex; gap: 3px; vertical-align: middle; }
.strip i { display: block; width: 14px; height: 18px; border-radius: 3px; border: 1px solid var(--line-strong); }
.scale { display: inline-flex; gap: 2px; vertical-align: middle; }
.scale i { display: block; width: 18px; height: 10px; border-radius: 2px; border: 1px solid var(--line); }

.bar-row { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 72px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; line-height: 18px; }
.bar-track { height: 10px; border-radius: 4px; background: var(--surface-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: rgba(var(--heat), .6); }

.area-row { grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 250px; }
.area-stats { font-size: 13px; line-height: 18px; }
/* On-site inspection entry */
.entry-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.entry-setup [hidden] { display: none; }
.entry-reason { grid-column: 1 / -1; }
.entry-tabs { position: sticky; top: 64px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; background: var(--bg); }
.entry-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--fg); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.entry-tab:hover { background: var(--surface-soft); }
.entry-tab[aria-selected="true"] { background: var(--button); border-color: var(--button); color: #fff; }
.tab-prog { font-weight: 500; opacity: .85; }
.entry-panel[hidden] { display: none; }
.item-edit summary, .item-add summary { color: var(--muted); cursor: pointer; padding: 4px 0; }
.item-add { padding-top: 16px; border-top: 1px solid var(--line); }
.item-edit-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.tab-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 16px; }
.btn.danger { background: var(--danger); color: var(--card); }
.btn.danger:hover { background: var(--danger); opacity: .9; }
.delete-box { display: flex; flex-direction: column; gap: 12px; }
.entry-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.entry-item:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-q { font-weight: 500; overflow-wrap: anywhere; }
.pts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt { min-width: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.pt:hover { background: var(--surface-soft); }
.pt[aria-pressed="true"] { background: var(--button); border-color: var(--button); color: #fff; }
.pt-input { width: 88px; height: 44px; }
.entry-item textarea.input { min-height: 40px; }
.entry-hint { color: var(--warn); }
.entry-hint[hidden] { display: none; }
.entry-bar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--dialog); }
.entry-bar-text { min-width: 0; font-variant-numeric: tabular-nums; }
.entry-bar .btn { flex: none; }

.locations { display: flex; flex-direction: column; gap: 8px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.loc-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.loc-card:hover { border-color: var(--primary); }
.loc-card[aria-current="true"] { border-color: var(--button); box-shadow: inset 0 0 0 1px var(--button); }

.risk-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.risk-row:last-child { border-bottom: 0; padding-bottom: 0; }
.risk-row:first-child { padding-top: 0; }
.risk-row .top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

details.how { border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
details.how summary { padding: 12px 16px; font-weight: 600; cursor: pointer; }
details.how .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; max-width: 78ch; color: var(--muted); }
details.how code { font-family: var(--mono); font-size: 13px; color: var(--fg); }

.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.facts dt { font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dl, dl.facts { margin: 0; }
.secret { display: block; padding: 8px 10px; border-radius: 6px; background: var(--surface-soft); font-family: var(--mono); overflow-wrap: anywhere; user-select: all; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* Summary, recommendations and call to action */
.plan { padding: 0; overflow: hidden; }
.plan-body { padding: 24px; }
.plan-summary { display: flex; flex-direction: column; gap: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 32px; }
.summary-grid > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.summary-grid p { text-wrap: pretty; }
.recs { margin: 0; padding: 0; list-style: none; }
.recs li { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4px 32px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rec-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-advice { align-self: center; }
.recs li:first-child { padding-top: 0; }
.recs .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-text { font-weight: 600; }
.rec-close { padding-top: 12px; font-weight: 600; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 24px; background: #0f0f0f; color: #fff; border-top: 3px solid var(--primary); }
.cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.cta-text strong { font-size: 1rem; line-height: 1.5rem; }
.btn.on-accent { background: var(--primary); color: #fff; font-weight: 600; }
.btn.on-accent:hover { background: #f04848; }
.cta.quiet { padding: 12px 24px; background: var(--surface-soft); color: var(--fg); font-size: 13px; line-height: 18px; }
.cta-form { display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 16px; border-radius: 8px; background: var(--card); color: var(--fg); }
.checks { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.checks legend { padding: 0 0 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--button); }
.check span { min-width: 0; overflow-wrap: anywhere; }
.req-items { margin: 4px 0; padding-left: 18px; font-size: 13px; line-height: 18px; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9999px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* Photos */
.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; }
.photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-add { min-height: 36px; padding: 0 14px; font-size: 13px; cursor: pointer; }
.photo-add:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.thumb-wrap { position: relative; display: inline-block; }
.thumb { display: block; width: 72px; height: 72px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border: 2px solid var(--card); border-radius: 50%; background: #0f0f0f; color: #fff; font-size: 15px; line-height: 18px; cursor: pointer; }
.photo-row .thumbs { margin-top: 0; }
td.note .thumbs { margin-top: 6px; }
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.86); }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: var(--dialog); }
.lightbox-x { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; cursor: pointer; }

/* Repairs */
.banner.action { align-items: center; flex-wrap: wrap; background: #0f0f0f; color: #fff; border-left: 4px solid var(--primary); }
.banner.action span { flex: 1 1 240px; color: rgba(255,255,255,.8); }
.rec-job { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.job { display: flex; flex-direction: column; gap: 10px; }
.job-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.job-title { font-size: 1rem; line-height: 1.4rem; }
.job-details { white-space: pre-line; }
.job-finding { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 6px; background: var(--surface); }
.job-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 8px; }
.job-form-card { display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--primary); }
.job-history summary, .closed-jobs summary { cursor: pointer; }
.job-history ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 18px; display: flex; flex-direction: column; gap: 4px; }
.closed-jobs > .job { margin-top: 12px; box-shadow: none; border: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 4px 0; padding: 0; list-style: none; }
.steps li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: 18px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.steps li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line-strong); }
.steps li:first-child::before { left: 6px; }
.steps li:last-child::before { right: auto; width: 6px; }
.steps .dot { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--card); }
.steps li.done { color: var(--fg); }
.steps li.done::before { background: var(--fg); }
.steps li.done .dot { background: var(--fg); border-color: var(--fg); }
.steps li.next .dot { border-color: var(--primary); }
.steps li.skipped { color: var(--muted); font-weight: 500; }
.steps li.skipped::before { background: var(--fg); }

/* SuiteDash */
.sd-card { display: flex; flex-direction: column; gap: 12px; }
.sd-card h3 { margin-top: 8px; }
.sd-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-row p { flex: 1 1 320px; }
.sd-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: end; }
.sd-card td select.input { min-width: 200px; }
.sd-loose { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-radius: 8px; background: var(--warn-bg); color: var(--fg); }
.sd-loose-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }

/* Sign-in */
.login { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-art { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px; background: #fff; color: #0f0f0f; min-width: 0; }
.login-art .brand { gap: 12px; }
.login-art .brand-logo { max-width: 300px; }
.login-art .brand-name { color: #0f0f0f; font-size: 12px; }
.login-art h1 { font-size: clamp(2.25rem, 4.4vw, 4.5rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 800; max-width: 12ch; }
.login-art h1 em { font-style: normal; color: #e12f2f; }
.login-lede { color: #5c5c5c; max-width: 52ch; }
.login-art svg.tunnel { width: 100%; height: auto; display: block; }
.login-art svg.tunnel text { font: 600 11px var(--sans); fill: #5c5c5c; }
.login-panel { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 32px; background: #0f0f0f; min-width: 0; }
.login-panel::before { content: ""; position: absolute; inset: -20% -30% auto auto; width: 80%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(225,47,47,.35), transparent); z-index: -1; }
.login-card { width: 100%; max-width: 400px; padding: 32px; border-radius: 8px; border-top: 4px solid #e12f2f; background: #fff; color: #0f0f0f; box-shadow: var(--dialog); display: flex; flex-direction: column; gap: 16px; }
.login-card .input { background: #fff; color: #0f0f0f; border-color: #cfcfcf; }
.login-card .muted { color: #5c5c5c; }
.login-card .err { color: #a3121a; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3, .g-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell, .shell.collapsed { display: block; }
  .side { position: static; height: auto; flex-direction: column; gap: 8px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: #0f0f0f; border-right: 0; }
  .side .brand { flex-direction: row; align-items: center; gap: 12px; padding: 0; border: 0; }
  .side > .brand::after { display: none; }
  .side .brand-logo { width: auto; height: 36px; max-width: none; }
  .collapsed .brand-logo, .collapsed .brand-name { display: block; }
  .collapsed .brand-name { display: flex; }
  .collapsed .brand-mark { display: none; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { width: auto; }
  .side-foot { display: none; }
  .collapsed .nav button span { display: inline; }
  .ghost.collapse { display: none; }
  .page { padding-block: 16px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .card { padding: 16px; }
  .side::before { display: none; }
  .entry-tabs { top: 0; flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
  .entry-tab { flex: none; }
  .plan { padding: 0; }
  .area-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 0; }
  .plan-body { padding: 16px; }
  .recs li { grid-template-columns: minmax(0, 1fr); }
  .rec-advice { align-self: start; }
  .cta, .cta.quiet { padding: 16px; }
  .cta .btn.on-accent { width: 100%; }
  .nav button { padding: 8px; }
  .topbar { position: static; min-height: 0; gap: 8px; flex-wrap: nowrap; align-items: flex-end; padding-top: 8px; padding-bottom: 8px; background: #0f0f0f; border-top: 1px solid rgba(255,255,255,.08); }
  .topbar .as-of { display: none; }
  .topbar label { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: stretch; gap: 2px; }
  .topbar select { min-width: 0; width: 100%; max-width: none; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .steps li { padding: 0 0 0 22px; }
  .steps li::before { top: 12px; bottom: -10px; left: 5px; right: auto; width: 2px; height: auto; }
  .steps li:first-child::before { left: 5px; }
  .steps li:last-child::before { display: none; }
  .steps .dot { top: 2px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art svg.tunnel { display: none; }
  .login-panel { padding: 24px 16px; align-items: flex-start; }
  .login-art { padding: 24px 16px; gap: 20px; }
  .login-art .brand-logo { max-width: 240px; }
}
@media (max-width: 560px) { .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); } .g-4.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
