/* PSP Fix Manual, standalone site. Colours are tokens with light and dark values. */

/* Page basics: this site runs on its own, so it carries its own reset. */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; min-height: 100vh; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: phone-first single column. Yellow stencil masthead (road-case label + hazard tape), sticky search band, inset list rows, fixed bottom action bar. */
:root {
  --bg: #ECEFF2;
  --surface: #FFFFFF;
  --sunken: #E1E5EA;
  --hover: #F4F6F8;
  --ink: #14171B;
  --muted: #56606B;
  --line: #D3D8DE;
  --line-strong: #B7BFC8;
  --accent: #FFC61A;
  --accent-ink: #14171B;
  --focus: #1D5FD6;
  --tally: #C9241B;
  --tally-bg: #FBE6E4;
  --tally-line: #EFB4AF;
  --on-tally: #FFFFFF;
  --ok: #19714A;
  --ok-bg: #DFF2E8;
  --warn: #8F5400;
  --warn-bg: #FBEFD7;
  --scrim: rgba(12, 14, 17, 0.5);
  --shadow: 0 1px 2px rgba(20, 23, 27, 0.06), 0 6px 18px rgba(20, 23, 27, 0.08);
  --sw-cam: #2F6FDE;
  --sw-cable: #E07B00;
  --sw-video: #7A4CD9;
  --sw-tx: #C2185B;
  --sw-audio: #1F9C8A;
  --sw-comms: #0E8FA8;
  --sw-rf: #D63CA0;
  --sw-net: #4A5ACB;
  --sw-other: #7C838C;
  --f-display: "Saira Stencil One", "Arial Black", Impact, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101317;
    --surface: #191D22;
    --sunken: #0B0D10;
    --hover: #20252B;
    --ink: #ECEFF2;
    --muted: #9AA3AE;
    --line: #2A3038;
    --line-strong: #3B434D;
    --focus: #86ABFF;
    --tally: #FF6A5F;
    --tally-bg: #3A1613;
    --tally-line: #6B2A24;
    --ok: #55CC90;
    --ok-bg: #11301F;
    --warn: #F3A945;
    --warn-bg: #36270E;
    --scrim: rgba(0, 0, 0, 0.62);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
    --sw-cam: #5B8EF0;
    --sw-cable: #F0922A;
    --sw-video: #9C77EC;
    --sw-tx: #EC4E86;
    --sw-audio: #3CBBA6;
    --sw-comms: #2DB3CC;
    --sw-rf: #EA6BBD;
    --sw-net: #7A88E4;
    --sw-other: #9AA3AE;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101317;
  --surface: #191D22;
  --sunken: #0B0D10;
  --hover: #20252B;
  --ink: #ECEFF2;
  --muted: #9AA3AE;
  --line: #2A3038;
  --line-strong: #3B434D;
  --focus: #86ABFF;
  --tally: #FF6A5F;
  --tally-bg: #3A1613;
  --tally-line: #6B2A24;
  --ok: #55CC90;
  --ok-bg: #11301F;
  --warn: #F3A945;
  --warn-bg: #36270E;
  --scrim: rgba(0, 0, 0, 0.62);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
  --sw-cam: #5B8EF0;
  --sw-cable: #F0922A;
  --sw-video: #9C77EC;
  --sw-tx: #EC4E86;
  --sw-audio: #3CBBA6;
  --sw-comms: #2DB3CC;
  --sw-rf: #EA6BBD;
  --sw-net: #7A88E4;
  --sw-other: #9AA3AE;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Masthead: the road-case stencil and hazard tape */
.masthead { background: var(--accent); color: var(--accent-ink); }
.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px 12px;
}
.mast-text { display: grid; gap: 4px; min-width: 0; }
.mast-kicker {
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mast-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.mast-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 2px solid var(--accent-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-ink);
  font: 700 14px/1 var(--f-body);
}
.mast-btn svg { width: 18px; height: 18px; }
.hazard {
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--accent-ink) 0 9px, var(--accent) 9px 18px);
}

/* Sticky search band */
.searchband {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.band-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-block: 12px 10px; }
.search {
  display: flex;
  align-items: center;
  min-height: 56px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.search:focus-within { box-shadow: 0 0 0 4px var(--accent); }
.search > svg { flex: none; width: 22px; height: 22px; margin-left: 14px; color: var(--muted); }
.search input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 18px/1.2 var(--f-body);
  padding: 14px 10px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 700 14px/1 var(--f-body);
  white-space: nowrap;
}
.chip .n { font: 500 12px/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: 0.75; }
.chip.toggle { border-style: dashed; }
.chip.toggle[aria-pressed="true"] { border-style: solid; }

/* Area swatches: the coloured heat-shrink band on a cable end */
.sw { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--sw-other); }
.sw-cam { background: var(--sw-cam); }
.sw-cable { background: var(--sw-cable); }
.sw-video { background: var(--sw-video); }
.sw-tx { background: var(--sw-tx); }
.sw-audio { background: var(--sw-audio); }
.sw-comms { background: var(--sw-comms); }
.sw-rf { background: var(--sw-rf); }
.sw-net { background: var(--sw-net); }
.sw-power { background: repeating-linear-gradient(-45deg, var(--accent-ink) 0 2.5px, var(--accent) 2.5px 5px); }
.sw-other { background: var(--sw-other); }

/* Main column */
main { padding-block: 16px calc(116px + env(safe-area-inset-bottom, 0px)); }
main:focus { outline: none; }
.stack { display: grid; gap: 22px; }
.block { display: grid; gap: 8px; }
.label {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1.25 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 15px;
}
.notice.warn { display: grid; justify-content: stretch; background: var(--warn-bg); border-color: transparent; }
.notice.quiet { background: transparent; border-style: dashed; color: var(--muted); }

.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.try .muted { font-size: 14px; }

/* List rows */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.list > li + li { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.row:hover { background: var(--hover); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 500 11.5px/1.2 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.row-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.row-preview { font-size: 14.5px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.chev { flex: none; width: 18px; height: 18px; color: var(--muted); }

.badge, .risk, .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 5px;
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge.draft { border: 1px dashed var(--line-strong); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.risk { background: var(--tally-bg); color: var(--tally); }
.tally { width: 8px; height: 8px; border-radius: 50%; background: var(--tally); }
.count { font: 500 12px/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.fixed { background: var(--ok-bg); color: var(--ok); }
.pill.workaround { background: var(--warn-bg); color: var(--warn); }
.pill.open { background: var(--tally-bg); color: var(--tally); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 700 16px/1.1 var(--f-body);
  text-align: center;
  text-decoration: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent-ink); color: var(--accent-ink); }
.btn.ghost { border-color: var(--line-strong); }
.btn.danger { border-color: var(--tally); color: var(--tally); background: transparent; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 auto; }
.mini {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: 700 13.5px/1 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
}
.mini.danger { color: var(--tally); border-color: var(--tally-line); }
.xref {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.linkish { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Results */
.result-count { font-size: 15px; color: var(--muted); }
.result-count b { color: var(--ink); }
.after { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.empty {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r);
}

/* Fix detail */
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -6px 0 6px -6px;
  padding: 0 8px 0 2px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: 700 15px/1 var(--f-body);
}
.back svg { width: 20px; height: 20px; }
.detail { display: grid; gap: 18px; }
.detail-head { display: grid; gap: 8px; }
.detail h1 { font-size: 25px; line-height: 1.2; }
.detail section { display: grid; gap: 8px; }
.safety {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--tally-line);
  border-radius: var(--r);
  background: var(--tally-bg);
}
.safety svg { flex: none; width: 22px; height: 22px; color: var(--tally); margin-top: 1px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
}
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ink); }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
}
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 15px/1 var(--f-mono);
}
.steps li > span { padding-top: 4px; }
.escalate {
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  background: var(--surface);
}
.call { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.call .who { font-weight: 700; }
.phone-num { font: 600 17px/1.2 var(--f-mono); letter-spacing: 0.02em; user-select: all; -webkit-user-select: all; }
.provenance { font-size: 14px; color: var(--muted); }

/* Fault log */
.view-head { display: grid; gap: 4px; }
.view-head h1 { font-size: 25px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entry {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.entry-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  font: 500 12.5px/1.3 var(--f-mono);
  color: var(--muted);
}
.entry-what { font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.entry-note { font-size: 15px; }
.entry-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14px; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.bars {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  grid-template-rows: auto 8px;
  column-gap: 12px;
  row-gap: 6px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.bar-row:hover { background: var(--hover); }
.bar-label { grid-column: 1; font-size: 15px; font-weight: 700; line-height: 1.3; }
.bar-track { grid-column: 1; grid-row: 2; overflow: hidden; border-radius: 4px; background: var(--sunken); }
.bar { display: block; height: 100%; min-width: 3px; border-radius: 4px; background: var(--ink); }
.bar-n {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  text-align: right;
  font: 600 17px/1 var(--f-mono);
  font-variant-numeric: tabular-nums;
}

/* Who to call */
#contacts { scroll-margin-top: 150px; }
.contacts { list-style: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.contact { display: grid; gap: 3px; padding: 12px 14px; }
.contact + .contact { border-top: 1px solid var(--line); }
.c-name { font-weight: 700; }
.c-role { font-size: 14px; color: var(--muted); }
.contact .call { margin-top: 4px; }

.foot { display: grid; gap: 6px; padding-top: 6px; font-size: 14px; color: var(--muted); }

/* Bottom bar */
.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.bb-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
}
.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font: 700 12.5px/1.1 var(--f-body);
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); background: var(--hover); }
.tab .dot {
  position: absolute;
  top: 3px;
  left: calc(50% + 6px);
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--tally);
  color: var(--on-tally);
  font: 600 11px/19px var(--f-mono);
  text-align: center;
}
.report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 10px;
  border: 2px solid var(--accent-ink);
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 16px/1.1 var(--f-body);
  white-space: nowrap;
}
@media (max-width: 360px) { .report-btn { font-size: 15px; gap: 6px; } }
.report-btn svg { width: 20px; height: 20px; flex: none; }

/* Sheets */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.sheet-head h2 { font-size: 19px; outline: none; }
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
  gap: 16px;
  padding-block: 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sheet-body form { display: grid; gap: 16px; }
.sheet-foot {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
@media (min-width: 640px) {
  .sheet {
    inset: auto;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    max-height: 90vh;
    padding-top: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
}

/* Forms */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, fieldset.field > legend { padding: 0; font-size: 15px; font-weight: 700; }
fieldset.field > legend { margin-bottom: 6px; }
.hint { font-size: 13.5px; color: var(--muted); }
input[type="text"], input[type="date"], input[type="tel"], select, textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.35 var(--f-body);
}
input[type="date"] { min-height: 48px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 380px) { .two { grid-template-columns: minmax(0, 1fr); } }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg-opt { position: relative; display: block; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 8px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.seg-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.tick { display: flex; align-items: flex-start; gap: 12px; font-weight: 700; cursor: pointer; }
.tick input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
.form-error { font-weight: 700; color: var(--tally); }
.form-error .mini { margin-top: 8px; }
.crow { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.crow .mini { justify-self: start; }
textarea.msg { font: 500 14.5px/1.45 var(--f-mono); background: var(--surface); }

/* Toast and saving */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.saving { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--scrim); }
.saving > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.spin { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
}


/* ---------- Added for the Supabase version ---------- */
.mast-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.mast-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--accent-ink);
  border-radius: 50%;
  background: transparent;
  color: var(--accent-ink);
}
.mast-icon svg { width: 20px; height: 20px; }
@media (max-width: 370px) {
  .mast-btn span { display: none; }
  .mast-btn { padding: 0 11px; }
}

.gate-wrap { padding-block: 24px 40px; }
.gate {
  display: grid;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.gate h1 { font-size: 24px; line-height: 1.2; }
.gate-wait { display: flex; align-items: center; gap: 12px; font-weight: 700; }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 15px;
}
.banner svg { flex: none; width: 20px; height: 20px; }
.banner p { flex: 1 1 200px; min-width: 0; }
.banner.offline { background: var(--warn-bg); color: var(--ink); }
.banner.offline svg { color: var(--warn); }
.banner.queue { border: 1px dashed var(--line-strong); background: var(--surface); }

.count { display: inline-flex; align-items: center; gap: 4px; }
.count svg { width: 14px; height: 14px; }
.pill svg { width: 12px; height: 12px; }
.pill.pending { background: var(--sunken); color: var(--muted); }
.small svg, .muted svg { width: 16px; height: 16px; vertical-align: -3px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunken);
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.broken img, .thumb.nosignal img { visibility: hidden; }
.thumb.broken::after, .thumb.nosignal::after {
  content: "Photo";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 11px/1 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.thumb.nosignal::after { content: "No signal"; }

.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.field-label { font-size: 15px; font-weight: 700; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; }
.picked:empty { display: none; }
.pick { position: relative; width: 76px; height: 76px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pick-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
}
.pick-x svg { width: 14px; height: 14px; }

.fault-head { display: grid; justify-items: start; gap: 6px; }
.fault-what { margin: 0; font-size: 20px; line-height: 1.3; text-wrap: balance; }
.sheet-body h3, .sheet-body h4 { margin: 0; }
.solution { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r); background: var(--ok-bg); }
.solution .label { color: var(--ok); }

.viewer { display: grid; gap: 8px; margin: 0; }
.viewer img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: var(--sunken); }
.viewer.broken img, .viewer.nosignal img { min-height: 160px; }

.inline-form { display: grid; gap: 10px; }
.inline-form .btn { justify-self: start; }
.codes { display: grid; gap: 10px; margin: 0; }
.codes div { display: grid; gap: 4px; }
.codes dt { font-size: 14px; font-weight: 700; color: var(--muted); }
.codes dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.code-val { font: 600 20px/1.2 var(--f-mono); letter-spacing: 0.06em; user-select: all; -webkit-user-select: all; }
.member.removed .c-name { color: var(--muted); text-decoration: line-through; }
.notice.warn.small { font-size: 14px; }
.search input:focus { border-color: transparent; box-shadow: none; }
