:root {
  /* Always light, whatever the phone's setting. */
  color-scheme: light;
  /* Change these to re-theme everything, including the maps. */
  --brand: #00154c;
  --brand-strong: #000d33;
  --brand-tint: #e8ecf6;
  --on-brand: #ffffff;
  --bar: #00154c;
  --on-bar: #ffffff;
  --gold: #c9a24b;
  --gold-soft: #e9d6a6;
  --bg: #f3f4f8;
  --surface: #ffffff;
  --dock: rgb(255 255 255 / 82%);
  --ink: #101a33;
  --muted: #566078;
  --line: #e2e5ee;
  --field: #b9c0d0;
  --ok: #0b7a4b;
  --ok-tint: #e2f4ec;
  --warn: #8f5200;
  --warn-tint: #fdf0d3;
  --danger: #b02a1c;
  --danger-tint: #fbe7e2;
  --in: #067a46;
  --in-strong: #05613a;
  --out: #c0271a;
  --out-strong: #9c1e14;
  --led-bezel: #00154c;
  --shadow: 0 1px 2px rgb(0 21 76 / 5%), 0 8px 24px rgb(0 21 76 / 6%);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans Thai', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, p, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.rise { animation: rise .6s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .2s, box-shadow .25s, border-color .2s;
}
.btn:hover:not(:disabled) { background: var(--brand-strong); box-shadow: 0 6px 18px rgb(0 21 76 / 22%); }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.is-busy { opacity: 1; }
.btn.is-busy .icon { animation: spin .9s linear infinite; }
.btn-quiet { background: var(--brand-tint); color: var(--brand); }
.btn-quiet:hover:not(:disabled) { background: var(--brand-tint); border-color: var(--brand); box-shadow: none; }
.btn-small { min-height: 36px; padding: 4px 10px; font-size: 14px; font-weight: 500; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover:not(:disabled) { background: transparent; border-color: var(--brand); box-shadow: none; }
.btn-danger, .btn-danger:hover:not(:disabled) { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  transition: background-color .2s, transform .18s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: rgb(255 255 255 / 12%); }
.icon-btn:active:not(:disabled) { transform: scale(.9); }
.icon-btn-soft { background: var(--brand-tint); color: var(--brand); }
.icon-btn-soft:hover:not(:disabled) { background: var(--brand-tint); }
.icon-btn:disabled .icon { animation: spin 1.2s linear infinite; }

.tag { display: inline-flex; align-items: center; gap: 3px; padding: 0 8px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tag-ok { background: var(--ok-tint); color: var(--ok); }
.tag-warn { background: var(--warn-tint); color: var(--warn); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }

.field { display: grid; gap: 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--field);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(201 162 75 / 30%); }

/* Sign in */
.gate { position: relative; min-height: 100dvh; overflow-x: hidden; background: #00154c; color: #fff; }
.gate-glow { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.gate-glow::before, .gate-glow::after {
  content: '';
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.gate-glow::before { top: -35vmax; left: -20vmax; background: rgb(44 86 190 / 45%); animation: drift 18s ease-in-out infinite alternate; }
.gate-glow::after { right: -30vmax; bottom: -40vmax; background: rgb(201 162 75 / 16%); animation: drift 24s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
.gate-main { position: relative; display: grid; align-content: center; gap: 28px; width: min(100%, 420px); min-height: 100dvh; margin: 0 auto; padding: 32px 16px; }
.gate-brand { display: grid; justify-items: center; gap: 2px; text-align: center; }
.gate-brand h1 { margin-top: 14px; font-size: 28px; font-weight: 600; line-height: 1.3; }
.gate-brand p { font-size: 14px; color: rgb(255 255 255 / 72%); }
.orbit { position: relative; display: grid; place-items: center; width: 84px; height: 84px; font-size: 30px; color: var(--gold-soft); }
.orbit-ring { position: absolute; inset: 0; animation: spin 40s linear infinite; }
.orbit-ring circle { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 7; stroke-linecap: round; }
.signin { display: grid; gap: 16px; padding: 24px; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / 35%); }
.signin-error { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); font-size: 14px; animation: shake .42s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.input { position: relative; display: block; }
.input > .icon { position: absolute; top: 13px; left: 12px; color: var(--muted); pointer-events: none; }
.field .input input { padding-left: 40px; padding-right: 44px; }
.input-eye { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }

/* Staff page */
.top { position: sticky; top: 0; z-index: 1100; background: var(--bar); color: var(--on-bar); box-shadow: 0 1px 0 rgb(201 162 75 / 45%); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 460px; min-height: 60px; margin: 0 auto; padding: 4px 8px 4px 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; flex: none; font-size: 17px; font-weight: 600; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--gold); border-radius: 9px; color: var(--gold-soft); }
.top-user { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: 14px; }
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { display: grid; gap: 14px; max-width: 460px; margin: 0 auto; padding: 8px 16px 132px; }

.clock { display: grid; justify-items: center; padding: 18px 0 6px; text-align: center; }
.clock-date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
/* Seven-segment clock. One unit is a large digit's width; the row is 5.8 units wide. */
.led-clock {
  --u: min(calc((100vw - 76px) / 5.8), 42px);
  /* Green until the late minute. */
  --lit: #3df29a;
  --halo: 0 0 5px rgb(61 242 154 / 50%);
  --off: #0b1a3d;
  --panel: #00061a;
  --panel-hi: #030f30;
  --inset: rgb(0 0 0 / 70%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--u) * .07);
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--panel-hi), var(--panel));
  box-shadow:
    0 12px 26px rgb(0 21 76 / 26%),
    0 0 0 5px var(--led-bezel),
    0 0 0 6px rgb(201 162 75 / 30%),
    inset 0 1px 10px var(--inset);
}
/* Red once it is late and nobody has checked in. */
.led-clock[data-mode='late'] { --lit: #ff5a4d; --halo: 0 0 5px rgb(255 90 77 / 50%); }
/* Checked in: nothing left to warn about, so a calm LCD with no glow. */
.led-clock[data-mode='done'] {
  --lit: #141e1a;
  --halo: 1px 1px 0 rgb(30 40 30 / 22%);
  --off: rgb(30 40 30 / 7%);
  --panel: #bfc9b4;
  --panel-hi: #cdd6c2;
  --inset: rgb(40 50 30 / 35%);
}
.led { display: block; flex: none; width: var(--u); height: auto; transform: skewX(-4deg); overflow: visible; }
.led polygon { fill: var(--off); transition: fill .16s linear; }
/* Only lit segments glow, so the unlit ones stay crisp. */
.led polygon.on { fill: var(--lit); filter: drop-shadow(var(--halo)); }
.led-sec { display: flex; gap: calc(var(--u) * .05); margin-left: calc(var(--u) * .1); }
.led-sec .led { width: calc(var(--u) * .5); }
.led-colon { position: relative; flex: none; align-self: center; width: calc(var(--u) * .3); height: calc(var(--u) * .84); animation: led-blink 2s steps(1) infinite; }
.led-colon::before, .led-colon::after {
  content: '';
  position: absolute;
  left: 50%;
  width: calc(var(--u) * .17);
  height: calc(var(--u) * .17);
  background: var(--lit);
  box-shadow: var(--halo);
  transform: translateX(-50%) skewX(-4deg);
}
.led-colon::before { top: 0; }
.led-colon::after { bottom: 0; }
@keyframes led-blink { 50% { opacity: .18; } }
.admin-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; font-size: 14px; font-weight: 500; text-decoration: none; }
.admin-link:hover { text-decoration: underline; }

.place { overflow: hidden; }
.place-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.place-reveal[data-open=true] { grid-template-rows: 1fr; }
.place-clip { min-height: 0; overflow: hidden; }
.place-map { aspect-ratio: 1; border-bottom: 1px solid var(--line); background: var(--line); }
.place-body { display: flex; align-items: center; gap: 12px; padding: 14px; }
.place-text { flex: 1; min-width: 0; }
.place-text h2 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.place-text p { font-size: 14px; color: var(--muted); }
.place-icon { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 18px; transition: background-color .35s, color .35s; }
.place[data-state=inside] .place-icon { background: var(--ok-tint); color: var(--ok); }
.place[data-state=outside] .place-icon { background: var(--warn-tint); color: var(--warn); }
.place[data-state=error] .place-icon { background: var(--danger-tint); color: var(--danger); }
.ping { position: absolute; inset: 0; border: 1px solid var(--gold); border-radius: 50%; opacity: 0; }
.place[data-state=loading] .ping { animation: ping 1.8s var(--ease) infinite; }
.place[data-state=loading] .ping-2 { animation-delay: .6s; }
@keyframes ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2); } }

.me i { position: relative; display: block; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: var(--gold); box-shadow: 0 2px 6px rgb(0 21 76 / 40%); }
.me i::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--gold); animation: ping 2.2s ease-out infinite; }

.card:not(.place) { padding: 14px 16px; }
.signin.signin { padding: 24px; }
.today { margin-top: 8px; }
.stop { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.stop:last-child { padding-bottom: 0; }
.stop:not(:last-child)::before { content: ''; position: absolute; top: 36px; bottom: 0; left: 17px; width: 2px; background: var(--line); }
.stop.is-done:not(:last-child)::after { content: ''; position: absolute; top: 36px; bottom: 0; left: 17px; width: 2px; background: var(--gold); transform-origin: top; animation: grow .7s .35s var(--ease) backwards; }
@keyframes grow { from { transform: scaleY(0); } }
.stop-node { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 15px; }
.stop-node .icon { width: 22px; height: 22px; }
.stop.is-done .stop-node { color: #fff; animation: pop .5s .2s var(--spring) backwards; }
.stop-in.is-done .stop-node { border-color: var(--in); background: var(--in); }
.stop-out.is-done .stop-node { border-color: var(--out); background: var(--out); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.stop-body { display: grid; min-width: 0; }
.stop-label { font-size: 13px; color: var(--muted); }
.stop-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.today-time { font-size: 24px; font-weight: 500; line-height: 1.3; color: var(--brand); font-variant-numeric: tabular-nums; }
.today-place { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.today-empty { color: var(--muted); }

.history { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 15px; }
.history th { padding: 6px 0; font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; }
.history td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line); }
.history td:last-child, .history th:last-child { padding-right: 0; text-align: right; }
.history tbody tr { animation: rise .5s var(--ease) backwards; animation-delay: calc(240ms + var(--i, 0) * 50ms); }
.num { color: var(--brand); font-variant-numeric: tabular-nums; }

.action {
  position: fixed;
  inset: auto 0 0;
  z-index: 1000;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--dock);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  animation: dock .6s .25s var(--ease) backwards;
}
@keyframes dock { from { transform: translateY(100%); } }
.action > * { width: 100%; max-width: 428px; margin-inline: auto; }
/* Floats above the dock: the check button's disc rises over the dock's top
   edge and would cover a line inside it. */
.action-msg {
  position: absolute;
  inset: auto 16px calc(100% + 34px);
  width: auto;
  max-width: 396px;
  margin: 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
  font-size: 14px;
  line-height: 1.45;
  color: var(--danger);
  text-align: center;
  animation: fade .3s;
}
.action-msg[data-tone='info'] { color: var(--muted); }
.action-msg:empty { display: none; }
.dock-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr; align-items: end; }
.dock-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s;
}
.dock-item:hover { color: var(--brand); }
.dock-item .icon { width: 25px; height: 25px; }
/* The check-in press sits above the bar, so it reads as the page's one action. */
.go-disc {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-top: -36px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--go);
  color: #fff;
  box-shadow: 0 6px 16px var(--go-shadow);
  transition: transform .18s var(--ease), background-color .2s;
}
.go-disc .icon { width: 34px; height: 34px; }
.dock-go { color: var(--go-ink); font-weight: 600; }
.dock-go:hover:not(:disabled) { color: var(--go-ink); }
.dock-go:hover:not(:disabled) .go-disc { background: var(--go-strong); }
.dock-go:active:not(:disabled) .go-disc { transform: scale(.94); }
.dock-go:disabled { cursor: default; }
.dock-go.is-busy .icon { animation: spin .9s linear infinite; }
.go-in { --go: var(--in); --go-strong: var(--in-strong); --go-ink: var(--ok); --go-shadow: rgb(6 122 70 / 34%); }
.go-out { --go: var(--out); --go-strong: var(--out-strong); --go-ink: var(--danger); --go-shadow: rgb(192 39 26 / 32%); }
.go-again .go-disc { background: var(--danger-tint); color: var(--danger); box-shadow: none; }
.go-again:hover:not(:disabled) .go-disc { background: var(--danger-tint); }
.btn-main { position: relative; overflow: hidden; width: 100%; min-height: 56px; font-size: 18px; border-radius: var(--radius); }
.btn-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(233 214 166 / 28%) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: sheen 1.4s .9s var(--ease) backwards;
  pointer-events: none;
}
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.done {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 24px;
  background: var(--bar);
  color: #fff;
  text-align: center;
  animation: curtain .55s var(--ease);
}
@keyframes curtain { from { clip-path: circle(0 at 50% 92%); } to { clip-path: circle(150% at 50% 92%); } }
.done-mark { width: 104px; height: 104px; margin-bottom: 14px; fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.done-ring { stroke-dasharray: 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: center; animation: draw .7s .2s var(--ease) forwards; }
.done-tick { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 4; animation: draw .4s .75s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-title, .done-time, .done-note { animation: rise .5s var(--ease) backwards; }
.done-title { font-size: 18px; animation-delay: .7s; }
.done-time { font-size: 56px; font-weight: 300; line-height: 1.25; font-variant-numeric: tabular-nums; animation-delay: .8s; }
.done-note { color: var(--gold-soft); overflow-wrap: anywhere; animation-delay: .9s; }

/* Admin */
.admin { display: grid; grid-template-columns: 380px minmax(0, 1fr); height: 100dvh; }
.panel { position: relative; z-index: 1000; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); box-shadow: 4px 0 24px rgb(0 21 76 / 8%); animation: panel .6s var(--ease) backwards; }
@keyframes panel { from { opacity: 0; transform: translateX(-20px); } }
.panel-head { padding: 12px 20px 16px; background: var(--bar); color: var(--on-bar); box-shadow: inset 0 -1px 0 rgb(201 162 75 / 45%); }
.panel-head a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: inherit; font-size: 14px; text-decoration: none; }
.panel-head a:hover { text-decoration: underline; }
.panel-head h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.tabs { position: relative; display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; min-height: 46px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; transition: color .2s; }
.tab[aria-selected=true] { color: var(--brand); }
.tab-ink { position: absolute; bottom: -1px; left: 0; width: var(--w, 0); height: 2px; background: var(--gold); transform: translateX(var(--x, 0)); transition: transform .35s var(--ease), width .35s var(--ease); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; }
.stack { display: grid; gap: 14px; animation: swap .35s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.note { font-size: 14px; color: var(--muted); }
.form-title { font-size: 17px; font-weight: 600; }
.list { display: grid; margin: 0; padding: 0; list-style: none; }
.item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.item:last-child { border-bottom: 0; }
.item-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: 15px; }
.item-main { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; }
button.item-main { cursor: pointer; }
button.item-main:hover .item-name { color: var(--brand); text-decoration: underline; }
.item-name { display: block; font-weight: 500; }
.item-sub { display: block; font-size: 13px; color: var(--muted); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 24px 16px; border: 1px dashed var(--field); border-radius: var(--radius-sm); color: var(--muted); text-align: center; font-size: 14px; }
.empty .icon { font-size: 24px; color: var(--gold); }
.section-title { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.toast { min-height: 0; font-size: 14px; animation: fade .3s; }
.toast:empty { display: none; }
.toast.is-error { color: var(--danger); }
.toast.is-ok { color: var(--ok); }
#map { min-height: 0; background: var(--line); }
.panel-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }

/* Admin: clock someone in at a pinned point */
.proxy-today { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.proxy-today li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.proxy-today span { font-size: 13px; color: var(--muted); }
.proxy-today b { font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.spot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-tint); color: var(--brand); font-size: 14px; font-weight: 500; transition: background .25s, color .25s; }
.spot .icon { flex: none; font-size: 18px; }
.spot[data-state='inside'] { background: var(--ok-tint); color: var(--ok); }
.spot[data-state='outside'] { background: var(--warn-tint); color: var(--warn); }
.spot[data-state='error'] { background: var(--danger-tint); color: var(--danger); }
.spot[data-state='loading'] .icon { animation: spin .9s linear infinite; }
.btn.is-armed, .btn.is-armed:hover:not(:disabled) { background: var(--gold); color: var(--brand); }
.zone-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }

@media (max-width: 820px) {
  .admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52dvh auto; height: auto; }
  #map { grid-row: 1; }
  .panel { grid-row: 2; border-right: 0; border-top: 1px solid var(--line); box-shadow: none; }
  .panel-body { overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .btn.is-busy .icon, .dock-go.is-busy .icon, .icon-btn:disabled .icon { animation: none !important; }
  .led-colon { animation: none !important; }
}

/* Sites tab: place search and the pin an admin drops for a site. */
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.search-row .btn { min-height: 44px; padding-inline: 14px; }
#clearPin { justify-self: start; }
.site-pin i { display: block; width: 22px; height: 22px; border: 3px solid var(--gold); border-radius: 50% 50% 50% 0; background: var(--brand); transform: rotate(-45deg); box-shadow: 0 2px 6px rgb(0 21 76 / 40%); }
.site-pin.is-draft i { background: var(--gold); border-color: #fff; }

/* Admin reports: full-width pages without a map. */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.panel-links { justify-content: flex-start; }
.admin-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: inherit; font-size: 14px; text-decoration: none; opacity: .82; }
.admin-nav a:hover { opacity: 1; text-decoration: underline; }
.admin-nav a[aria-current=page] { opacity: 1; font-weight: 600; box-shadow: inset 0 -2px 0 var(--gold); }
.sheet { min-height: 100dvh; }
.sheet-inner { width: min(100%, 1180px); margin-inline: auto; padding-inline: 20px; }
.sheet-head { padding-block: 12px 18px; background: var(--bar); color: var(--on-bar); box-shadow: inset 0 -1px 0 rgb(201 162 75 / 45%); }
.sheet-head h1 { margin-top: 6px; font-size: 24px; font-weight: 600; line-height: 1.3; }
.sheet-body { display: grid; gap: 16px; padding-block: 20px 40px; animation: swap .35s var(--ease); }
.filters { display: grid; grid-template-columns: repeat(2, minmax(150px, 190px)) minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding: 16px; }
.filters .btn { min-width: 104px; }
.chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 34px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stats:empty { display: none; }
.stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; text-align: left; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
button.stat { cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s; }
button.stat:hover { border-color: var(--brand); }
.stat[aria-pressed=true] { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.stat b { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat-late b, .stat-outside b { color: var(--warn); }
.stat-onTime b { color: var(--ok); }
.stat-missing b { color: var(--danger); }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.table-count { margin-right: auto; font-size: 14px; color: var(--muted); }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline select { width: auto; min-width: 180px; min-height: 36px; padding: 4px 10px; font-size: 14px; }
a.btn { text-decoration: none; }
.table-wrap { overflow-x: auto; }
.report { width: 100%; border-collapse: collapse; font-size: 14px; }
.report th { position: sticky; top: 0; padding: 10px 12px; background: var(--brand-tint); color: var(--brand); font-weight: 600; text-align: left; white-space: nowrap; }
.report td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.report tbody tr:hover { background: rgb(232 236 246 / 45%); }
.report a { font-weight: 500; }
.cell-num { font-variant-numeric: tabular-nums; }
.cell-place { min-width: 140px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag-muted { background: var(--line); color: var(--muted); }
.tag-info { background: var(--brand-tint); color: var(--brand); }
.row-off { color: var(--muted); background: rgb(243 244 248 / 70%); }
.row-empty td:last-child { color: var(--muted); font-style: italic; }
.table-empty { margin: 16px; }
.person-pick { display: grid; gap: 12px; max-width: 640px; padding: 16px; }
.person-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 6px 16px; }
.person-who { flex: 1 1 280px; }
.month-step { display: flex; align-items: center; gap: 8px; }
.month-step input { min-height: 36px; padding: 4px 10px; }
.icon-flip .icon { transform: scaleX(-1); }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-grow { grid-column: 1 / -1; }
  .filters .btn { grid-column: 1 / -1; }
  .sheet-inner { padding-inline: 14px; }
}

/* Editing one record inline on the person page. */
.row-edit td { background: var(--brand-tint); white-space: normal; }
.edit-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 14px; align-items: end; }
.edit-form .toast { grid-column: 1 / -1; margin: 0; }
.edit-form .toast:empty { display: none; }
