/* Plant Shift: the Blockstep look (docs/design/blockstep-style.md), adapted from the sister games: white cards with a
   thin, even border all the way round and a soft shadow, pill buttons, deep navy words, one blue for the main action,
   Plus Jakarta Sans for headings and Inter for everything else. Green, amber and red mean the three levels of a
   reading and nothing else. Phone first: the plant above, the control panel below in reach of a thumb; on a wide
   screen the panel sits beside the plant. Never a coloured stripe down one side of anything. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --ink: #0e1b33;
  --ink-2: #45526e;
  --muted: #6b7690;
  --line: #e3e8f2;
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --brand-soft: #e8f0ff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --ok-line: #9fd9b4;
  --warn: #a16207;
  --warn-soft: #fef6e0;
  --warn-line: #f0d28a;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --bad-line: #f2b8b8;
  --zone-green: #bfe8cc;
  --zone-target: #86d3a0;
  --zone-amber: #fbe3a0;
  --zone-red: #f8c4c4;
  --water: #3b82f6;
  --shadow: 0 1px 2px rgba(14, 27, 51, 0.05), 0 10px 30px rgba(14, 27, 51, 0.09);
  --shadow-sm: 0 1px 2px rgba(14, 27, 51, 0.06), 0 4px 12px rgba(14, 27, 51, 0.07);
  --display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.ic {
  display: inline-grid;
  place-items: center;
}
.ic svg {
  width: 18px;
  height: 18px;
}

/* ---- Layout: the plant above, the panel below (phone); side by side (wide) ---- */
.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(240px, 40%) minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .app {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
  }
}
@media (min-width: 600px) and (max-width: 899px) {
  .app {
    grid-template-rows: minmax(280px, 46%) minmax(0, 1fr);
  }
}
.site {
  position: relative;
  overflow: hidden;
  background: #eaf1f9;
  min-height: 0;
  min-width: 0;
}
.site-canvas {
  position: absolute;
  inset: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}
.site-canvas:active {
  cursor: grabbing;
}
.snap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.site-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}
.site.jolt {
  animation: jolt 0.28s ease;
}
@keyframes jolt {
  20% {
    transform: translateY(3px);
  }
  45% {
    transform: translateY(-2px);
  }
  70% {
    transform: translateY(1px);
  }
}

/* ---- Pills and chips ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.pop {
  animation: pop 0.5s ease;
}
@keyframes pop {
  30% {
    transform: scale(1.12);
  }
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-2);
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.chip.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.blue {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.draft {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #f3e2b3;
}

/* ---- The HUD over the plant ---- */
.hud {
  position: absolute;
  inset: 8px 8px auto 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 6;
}
.hud > * {
  pointer-events: auto;
}
.hud-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mycard {
  cursor: pointer;
  padding: 3px 12px 3px 3px;
  text-align: left;
  line-height: 1.15;
  min-width: 0;
}
.mycard img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  background: var(--brand-soft);
  border: 1px solid var(--line);
}
.mycard span {
  display: grid;
  min-width: 0;
}
.mycard b {
  font-size: 12.5px;
}
.mycard small {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.clock {
  gap: 6px;
  padding-right: 4px;
}
.clock b {
  font-family: var(--display);
  font-size: 16px;
}
.clock .sun {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.clock.night .sun {
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}
.clock.soon {
  border-color: var(--warn-line);
}
.speed {
  width: 30px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  color: var(--ink-2);
}
.speed svg {
  width: 15px;
  height: 15px;
}
.speed[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.speed:disabled {
  opacity: 0.35;
  cursor: default;
}
.streak b {
  font-family: var(--display);
  font-size: 16px;
}
.streak.hot {
  border-color: #f3c16b;
  background: #fff8e8;
}
.icon-btn {
  width: 36px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.draft-tag {
  position: absolute;
  left: 8px;
  top: 52px;
  z-index: 5;
  font-size: 11px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 420px) {
  .mycard small {
    max-width: 78px;
  }
  .streak small {
    display: none;
  }
  .clock small {
    display: none;
  }
}

/* ---- Cards over the plant: the alarm, the radio, the coach, the feedback, the toast ---- */
.alarm {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  z-index: 7;
  width: min(460px, calc(100% - 16px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px 9px 12px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--bad);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.15), var(--shadow);
  font-size: 13.5px;
  animation: alarm-in 0.3s ease, alarm-pulse 1s ease-in-out infinite;
}
.alarm .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bad);
  animation: blink 0.5s steps(2) infinite;
}
.alarm b {
  display: block;
  font-family: var(--display);
  color: var(--bad);
  font-size: 14px;
}
.alarm .btn {
  min-height: 38px;
  font-size: 13px;
}
@keyframes alarm-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}
@keyframes alarm-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(185, 28, 28, 0.06), var(--shadow);
  }
}
@keyframes blink {
  50% {
    opacity: 0.2;
  }
}
.radio {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: min(440px, calc(100% - 16px));
  padding: 9px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  line-height: 1.4;
  animation: radio-in 0.3s ease;
}
.alarm:not([hidden]) ~ .radio {
  top: auto;
  bottom: 10px;
}
.radio svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--brand);
  margin-top: 1px;
}
.radio b {
  display: block;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes radio-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}
.stack {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 150px));
  display: grid;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
}
@media (max-width: 599px) {
  .stack {
    left: auto;
    right: 8px;
    transform: none;
    width: calc(100% - 130px);
  }
}
.stack > * {
  pointer-events: auto;
}
.coach {
  justify-self: center;
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(14, 27, 51, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: bubble-in 0.3s ease;
}
@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.feedback .fb {
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
  padding: 9px 14px 11px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.feedback.in .fb {
  animation: fb-in 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
@keyframes fb-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
}
.fb.good {
  border-color: var(--ok-line);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12), var(--shadow);
}
.fb.warn {
  border-color: var(--warn-line);
  box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.1), var(--shadow);
}
.fb.bad {
  border-color: var(--bad-line);
}
.fb-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.fb.good .fb-big {
  color: var(--ok);
}
.fb.warn .fb-big {
  color: var(--warn);
}
.fb.bad .fb-big {
  color: var(--bad);
}
.fb-line {
  color: var(--ink-2);
  font-size: 13px;
}
.fb-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.toast {
  position: fixed;
  left: 50%;
  top: 96px;
  transform: translateX(-50%) translateY(-6px);
  z-index: 40;
  max-width: calc(100% - 24px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
}
.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- The town (a small map over the plant, and big in its own sheet) ---- */
.town-mini {
  position: absolute;
  left: 8px;
  bottom: 8px;
  transform-origin: 0 100%;
  z-index: 5;
  width: 128px;
  padding: 6px 6px 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: grid;
  gap: 2px;
  text-align: left;
}
.town-mini svg {
  width: 100%;
  height: auto;
  display: block;
}
.town-mini .tm-line {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.town-mini .tm-line small {
  color: var(--muted);
  font-weight: 600;
}
.town-mini.risk {
  border-color: var(--warn-line);
  box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.15), var(--shadow-sm);
}
.town-mini.notice {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.18), var(--shadow-sm);
}
.town-big svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.town-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.town-stamp {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) rotate(-8deg);
  z-index: 8;
  padding: 10px 18px;
  border: 4px solid var(--bad);
  border-radius: 12px;
  color: var(--bad);
  background: rgba(255, 255, 255, 0.92);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(18px, 4vw, 28px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
  animation: stamp 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  pointer-events: none;
}
.town-stamp small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.cine-town {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: min(520px, 88%);
  max-height: 80%;
  padding: 8px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: fade 0.4s ease;
}
.cine-town svg {
  width: 100%;
  height: auto;
  max-height: calc(80vh - 40px);
  display: block;
  border-radius: 12px;
}
@keyframes stamp {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scale(1.8);
  }
}

/* ---- The dock: tabs and views ---- */
.dock {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: var(--bg-soft);
}
.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 44px;
  gap: 4px;
  padding: 6px 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0 6px;
}
.tab.on {
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-color: #c9d9fb;
}
.tab .badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  animation: pop 0.5s ease;
}
.tab .badge.urgent {
  background: var(--bad);
}
.tab.ring {
  animation: ring 0.5s ease-in-out infinite;
  color: var(--bad);
}
@keyframes ring {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}
.hint-btn {
  border: 1px solid var(--line);
  padding: 0;
}
.hint-btn:disabled {
  opacity: 0.35;
}
.view {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: 8px;
  overscroll-behavior: contain;
}

/* ---- The readings tiles ---- */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.tile {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 6px 7px 7px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: background 0.2s, border-color 0.2s;
}
.tile small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tile b {
  font-family: var(--display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile b i {
  font-style: normal;
  font-family: var(--body);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.tile .mini-band {
  height: 6px;
  margin-top: 3px;
}
.tile.sel {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.tile.amber {
  background: var(--warn-soft);
  border-color: #e9b949;
}
.tile.amber b {
  color: var(--warn);
}
.tile.red {
  background: var(--bad-soft);
  border-color: var(--bad);
  animation: tile-red 0.8s ease-in-out infinite;
}
.tile.red b {
  color: var(--bad);
}
@keyframes tile-red {
  50% {
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2);
  }
}
.tile .trend {
  position: absolute;
  right: 6px;
  top: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

/* The band bar: red, amber, green (and the darker target inside it), with the needle. */
.band {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--zone-green);
  border: 1px solid rgba(14, 27, 51, 0.08);
}
.band.plain {
  background: #e3e8f2;
}
.band i {
  position: absolute;
  top: 0;
  bottom: 0;
}
.band .z-red {
  background: var(--zone-red);
}
.band .z-amber {
  background: var(--zone-amber);
}
.band .z-target {
  background: var(--zone-target);
}
.band .needle {
  width: 4px;
  margin-left: -2px;
  background: var(--ink);
  border-radius: 2px;
  transition: left 0.25s linear;
  box-shadow: 0 0 0 1.5px #fff;
}
.band.mini-band {
  border: 0;
}
.band.mini-band .needle {
  width: 3px;
  margin-left: -1.5px;
  box-shadow: 0 0 0 1px #fff;
}

/* ---- The stage card ---- */
.card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-head h2 {
  font-size: 16.5px;
  font-weight: 800;
}
.card-head .chip {
  font-size: 11px;
}
.row-r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}
.row-r .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.row-r .val {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.row-r .val.amber {
  color: var(--warn);
}
.row-r .val.red {
  color: var(--bad);
}
.row-r .band,
.row-r .spark {
  grid-column: 1 / -1;
}
.row-r .lims {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: -2px;
}
.spark {
  width: 100%;
  height: 34px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.controls .side {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.controls .side .btn {
  min-height: 42px;
  font-size: 13.5px;
}
.unit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  flex: none;
}
.lamp.off {
  background: #94a3b8;
  box-shadow: none;
}
.lamp.fault {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.2);
  animation: blink 0.6s steps(2) infinite;
}

/* The dial: a knob with detents. */
.dial {
  position: relative;
  width: 122px;
  height: 122px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.dial:active {
  cursor: grabbing;
}
.dial svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.dial .readout {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.dial .readout b {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dial .readout small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}
.dial-btns {
  display: flex;
  gap: 6px;
}
.dial-btns .btn {
  flex: 1;
  min-height: 40px;
  font-size: 18px;
  padding: 0;
}
.dial.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* The filters. */
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.fcol {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}
.fcol.amber {
  background: var(--warn-soft);
  border-color: #e9b949;
}
.fcol.red {
  background: var(--bad-soft);
  border-color: var(--bad);
}
.fcol b {
  font-size: 12px;
}
.fcol .v {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.fcol small {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}
.vband {
  position: relative;
  width: 18px;
  height: 84px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--zone-green);
  border: 1px solid rgba(14, 27, 51, 0.08);
}
.vband i {
  position: absolute;
  left: 0;
  right: 0;
}
.vband .needle {
  height: 4px;
  margin-top: -2px;
  background: var(--ink);
  box-shadow: 0 0 0 1.5px #fff;
  border-radius: 2px;
  transition: top 0.25s linear;
}
.vband.washing {
  background: repeating-linear-gradient(45deg, #dbeafe 0 6px, #eff6ff 6px 12px);
}
.hold-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  touch-action: none;
}
.hold-btn .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand-soft);
  pointer-events: none;
}
.hold-btn span {
  position: relative;
}
.hold-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Supply. */
.supply-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.mode {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  line-height: 1.2;
}
.mode small {
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}
.mode.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
  background: var(--brand-soft);
}
.mode.divert.on {
  border-color: #d97706;
  box-shadow: 0 0 0 1px #d97706;
  background: var(--warn-soft);
}
.mode.off.on {
  border-color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad);
  background: var(--bad-soft);
}
.note {
  font-size: 12px;
  color: var(--muted);
}
.proj {
  font-family: var(--display);
  color: var(--ok);
}
.proj.amber {
  color: var(--warn);
}
.proj.red {
  color: var(--bad);
}

/* ---- The round ---- */
.stops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.stop {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
}
.stop small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
}
.stop .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: var(--display);
  font-size: 12px;
}
.stop.done .n {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.stop.here {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.stop:disabled {
  opacity: 0.55;
  cursor: default;
}
.items {
  display: grid;
  gap: 6px;
}
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  font-size: 13.5px;
}
.item.fine {
  background: var(--ok-soft);
  border-color: #bfe3cb;
  cursor: default;
}
.item.found {
  background: var(--warn-soft);
  border-color: var(--warn-line);
}
.item small {
  display: block;
  font-weight: 500;
  color: var(--ink-2);
  font-size: 12.5px;
}
.find {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--warn-line);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.08);
}
.find h3 {
  font-size: 15px;
}
.choices {
  display: grid;
  gap: 6px;
}
.choices .btn {
  justify-content: flex-start;
  text-align: left;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 600;
}
.drive {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
}
.drive .bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  border: 1px solid var(--line);
}
.drive .bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  width: 0;
}

/* ---- Jobs ---- */
.job {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.job .jic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.job .jic svg {
  width: 22px;
  height: 22px;
}
.job b {
  display: block;
  font-size: 14px;
}
.job small {
  color: var(--ink-2);
  font-size: 12.5px;
}
.job.urgent {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}
.job.urgent .jic {
  background: var(--bad-soft);
  color: var(--bad);
}
.job.done {
  opacity: 0.7;
}
.empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

/* ---- The bench: the jar test, the jobs, over the dock ---- */
.bench {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  animation: bench-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes bench-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
.bench-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.bench-head h2 {
  font-size: 16px;
  font-weight: 800;
}
.bench-head p {
  font-size: 12.5px;
  color: var(--ink-2);
}
.bench-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  overscroll-behavior: contain;
}
.bench-foot {
  display: flex;
  gap: 6px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.bench-foot .btn {
  flex: 1 1 140px;
  min-height: 46px;
}
.slowmo {
  font-size: 11px;
}
.paper {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e4dcc7;
  background: #fffdf6;
  box-shadow: 0 1px 2px rgba(14, 27, 51, 0.06);
  font-size: 13px;
}
.paper h4 {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.paper .kv {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 2px 8px;
}
.paper .kv span {
  color: var(--muted);
}
.paper .kv b {
  font-weight: 700;
}
.papers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.placard {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.diamond {
  width: 58px;
  height: 58px;
  margin: 6px;
  transform: rotate(45deg);
  border: 3px solid #111;
  border-radius: 4px;
  background: linear-gradient(#fff 50%, #111 50%);
  display: grid;
  place-items: center;
}
.diamond b {
  transform: rotate(-45deg);
  font-family: var(--display);
  color: #fff;
  font-size: 15px;
  margin: 18px 0 0 18px;
}
.unbox {
  display: inline-block;
  padding: 2px 8px;
  border: 2px solid #111;
  border-radius: 4px;
  background: #f97316;
  font-family: var(--display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}
.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.point {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  font-size: 12px;
}
.point .cap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(14, 27, 51, 0.3);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
}
.point.hose {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.point .tankbar {
  width: 70%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}
.point .tankbar i {
  display: block;
  height: 100%;
  background: #94a3b8;
}
.reasons {
  display: grid;
  gap: 6px;
}
.reason-chip {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0 14px;
  text-align: left;
}
.reason-chip.on {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}
.call-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.call-btn {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.call-btn.continue.on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.call-btn.pause.on {
  background: #fdf0c8;
  color: #7a4b05;
  border-color: #ecc766;
}
.call-btn.stop.on {
  background: #c42020;
  color: #fff;
  border-color: #c42020;
}
.signing {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.signing img {
  width: 54px;
  height: 66px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.sig {
  font-family: var(--hand);
  font-size: 26px;
  color: #1e3a8a;
  line-height: 1;
}
.ticks {
  display: grid;
  gap: 2px;
  font-size: 12.5px;
}
.ticks span {
  opacity: 0.3;
  transition: opacity 0.2s;
}
.ticks span.on {
  opacity: 1;
}

/* The jar test. */
.jars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.jar {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 6px 2px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}
.jar canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 5;
  display: block;
}
.jar b {
  font-family: var(--display);
  font-size: 13px;
}
.jar.pick {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}
.jar:disabled {
  cursor: default;
}
.jar-step {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.jar-step .chip.now {
  background: var(--brand);
  color: #fff;
}

/* The confined space: the well and the probe. */
.well-wrap {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.well {
  position: relative;
  height: 210px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(#dfe7f0, #c8d3df);
  overflow: hidden;
  touch-action: none;
  cursor: ns-resize;
  user-select: none;
}
.well .shaft {
  position: absolute;
  left: 30%;
  right: 30%;
  top: 12px;
  bottom: 0;
  background: #7d8a99;
  border: 1px solid rgba(14, 27, 51, 0.2);
}
.well .water {
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 0;
  height: 16px;
  background: #6b8fb3;
}
.well .lvl {
  position: absolute;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
}
.well .lvl.done {
  color: var(--ok);
}
.well .line {
  position: absolute;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  top: 0;
  background: #f59e0b;
}
.well .probe {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 6px;
  background: #f2c200;
  border: 2px solid #8a6d00;
}
.monitor {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: #10291a;
  color: #86efac;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  border: 1px solid #0b1d12;
}
.monitor .r {
  display: flex;
  justify-content: space-between;
}
.monitor .r.bad {
  color: #fca5a5;
}
.monitor.alarm-on {
  background: #7f1d1d;
  color: #fecaca;
}
.monitor .cal {
  background: #f59e0b;
  color: #1d1500;
  font-weight: 800;
  text-align: center;
  border-radius: 6px;
}
.facts {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
}
.facts div {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* The pump isolation schematic. */
.svg-wrap {
  display: block;
  min-width: 0;
}
.schem {
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 230;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  touch-action: manipulation;
}
.schem .hot {
  cursor: pointer;
}
.schem .hot:hover .ring {
  stroke: var(--brand);
}
.iso-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.iso-tools .btn {
  min-height: 44px;
  font-size: 13px;
}
.iso-tools .btn.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.iso-log {
  font-size: 12px;
  color: var(--ink-2);
  min-height: 18px;
}

/* The chlorine room plan. */
.plan {
  width: 100%;
  height: auto;
  aspect-ratio: 300 / 220;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #eef4ea;
}
.plan .muster {
  cursor: pointer;
}
.steps {
  display: grid;
  gap: 6px;
}
.steps .btn {
  justify-content: flex-start;
  min-height: 46px;
  font-size: 13.5px;
}
.steps .btn.done {
  background: var(--ok-soft);
  border-color: #bfe3cb;
  color: var(--ok);
}

/* The phone. */
.phone {
  display: grid;
  gap: 10px;
}
.contact {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.contact .av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 800;
  font-family: var(--display);
}
.contact.on {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.fact {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
}
.fact .box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: #fff;
}
.fact.on .box {
  background: var(--brand);
  border-color: var(--brand);
}
.fact .box svg {
  width: 14px;
  height: 14px;
}
.dialing {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
}
.dialing .ring-ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  animation: ring 0.5s ease-in-out infinite;
}
.dialing .ring-ic svg {
  width: 30px;
  height: 30px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--brand-ink);
}
.btn.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn.icon-only {
  width: 40px;
  min-height: 40px;
  padding: 0;
}
.btn.icon-only svg {
  width: 18px;
  height: 18px;
}
.btn.small {
  min-height: 34px;
  font-size: 13px;
  padding: 0 14px;
}
.btn .key {
  display: none;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}
.btn .ic svg {
  width: 17px;
  height: 17px;
}
@media (hover: hover) and (pointer: fine) {
  .btn .key {
    display: inline;
  }
}

/* ---- Rules ---- */
.rule {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.rule .plain {
  font-weight: 600;
  color: var(--ink);
}
.rule blockquote {
  margin: 0;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
}
.rule .cite {
  color: var(--muted);
  font-size: 12px;
}

/* ---- Modals ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
  background: rgba(14, 27, 51, 0.32);
  animation: fade 0.25s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.sheet {
  width: min(620px, 100%);
  justify-self: center;
  min-width: 0;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(14, 27, 51, 0.25);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  animation: sheet-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}
@media (max-width: 599px) {
  .modal {
    place-items: end stretch;
    padding: 0;
  }
  .sheet {
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  }
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet h1 {
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 800;
  line-height: 1.08;
}
.sheet h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}
.sheet h3 {
  font-size: 15px;
  font-weight: 700;
}
.lead {
  color: var(--ink-2);
  font-size: 15.5px;
}
.sheet .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sheet .chip {
  white-space: normal;
}
.sheet .buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sheet .buttons .btn {
  flex: 1 1 180px;
}
.sheet > .buttons {
  position: sticky;
  bottom: -20px;
  margin-bottom: -20px;
  padding: 10px 0 20px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 12px);
  z-index: 2;
}
@media (max-width: 599px) {
  .sheet > .buttons {
    bottom: calc(-16px - env(safe-area-inset-bottom));
    margin-bottom: calc(-16px - env(safe-area-inset-bottom));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.checks li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  font-size: 14.5px;
}
.checks li i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  margin-top: 1px;
}
.credit {
  color: var(--muted);
  font-size: 12px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  background: #fff;
}
.panel.soft {
  background: var(--bg-soft);
}
details.more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  font-size: 14px;
}
.verdict-head {
  display: grid;
  gap: 6px;
}
.levels3 {
  display: grid;
  gap: 6px;
}
.levels3 .band {
  height: 16px;
}
.levels3 .lv-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 13.5px;
}
.levels3 .sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  margin-top: 3px;
}

/* The player's own card and the ladder. */
.my {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
}
.my img {
  width: 76px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}
.my b {
  font-family: var(--display);
  font-size: 17px;
  display: block;
}
.my span {
  color: var(--ink-2);
  font-size: 13.5px;
}
.rungs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.rung {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.rung > span {
  min-width: 0;
}
.rung.held {
  background: var(--ok-soft);
  border-color: #bfe3cb;
}
.rung.next {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}
.rung.locked {
  opacity: 0.6;
}
.rung .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.rung.held .n {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.rung b {
  display: block;
  font-size: 14px;
}
.rung small {
  color: var(--muted);
  font-size: 12px;
}
.rung .go {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}
.rung.next .go {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.rung .stars {
  display: flex;
  margin-top: 2px;
}
.rung.levelup {
  animation: levelup 1.2s ease;
}
@keyframes levelup {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.5);
  }
  40% {
    transform: scale(1.03);
    box-shadow: 0 0 0 10px rgba(21, 128, 61, 0);
  }
}
.stars {
  display: inline-flex;
  gap: 2px;
}
.stars svg {
  width: 16px;
  height: 16px;
}
.stars.big svg {
  width: 38px;
  height: 38px;
}
.stars.big svg.got {
  animation: star 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}
.stars.big svg:nth-child(2) {
  animation-delay: 0.15s;
}
.stars.big svg:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes star {
  from {
    transform: scale(0) rotate(-40deg);
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 520px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 2px;
  background: #fff;
}
.stat b {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.inband {
  display: grid;
  gap: 6px;
}
.inband .ib {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.inband .ib .bar {
  height: 10px;
  border-radius: 999px;
  background: var(--zone-amber);
  overflow: hidden;
}
.inband .ib .bar i {
  display: block;
  height: 100%;
  background: #4ade80;
}
.inband .ib b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.verdicts {
  display: grid;
  gap: 6px;
}
.verdicts .vd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
}
.crewline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.cm {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}
.cm img {
  width: 54px;
  height: 66px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.cm b {
  display: block;
  font-size: 14px;
}
.cm span {
  font-size: 13px;
  color: var(--ink-2);
}

/* ---- The near miss: letterbox and a red edge; the rewind; the flash ---- */
.cine::before,
.cine::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  background: #0e1b33;
  z-index: 4;
  transition: height 0.45s ease;
}
.cine::before {
  top: 0;
}
.cine::after {
  bottom: 0;
}
.cine.on::before,
.cine.on::after {
  height: 9%;
}
.cine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 0 0 rgba(185, 28, 28, 0);
  transition: box-shadow 0.4s ease;
}
.cine.on {
  box-shadow: inset 0 0 120px 10px rgba(185, 28, 28, 0.35);
}
.cine.good {
  box-shadow: inset 0 0 120px 10px rgba(21, 128, 61, 0.22);
}
.rewind-fx {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, rgba(14, 27, 51, 0.06) 2px 4px);
  animation: fade 0.2s ease;
}
.rewind-fx span {
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}
.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}
.flash.on {
  animation: flash 0.5s ease-out;
}
.flash.red.on {
  background: #ef4444;
  animation: flash-red 0.6s ease-out;
}
@keyframes flash {
  0% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}
@keyframes flash-red {
  0% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
  }
}
.site-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.site-tag.say {
  border-radius: 12px;
  max-width: 220px;
  white-space: normal;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 10px;
}
.site-tag.amber {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--warn);
}
.site-tag.red {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
}
.site-tag.ring {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid #f59e0b;
  background: transparent;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
  transform-origin: center;
  animation: nudge 0.9s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    box-shadow: 0 0 0 9px rgba(245, 158, 11, 0.1);
  }
}

/* On a phone the town sits top right, small, under the sound button. */
@media (max-width: 599px) {
  .town-mini {
    left: auto;
    right: 8px;
    top: 52px;
    bottom: auto;
    width: 92px;
    padding: 4px 4px 3px;
  }
  .town-mini .tm-line {
    font-size: 10px;
  }
  .town-mini .tm-line small {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
