/* Self-hosted Geist Sans and Geist Mono. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
}

/* Design tokens. Surfaces stay neutral in both themes; orange is reserved for emphasis. */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --rail: #f1f1f3;
  --panel: #fff;
  --hover: #f0f0f2;
  --press: #e7e7ea;
  --line: #e3e4e8;
  --line-strong: #cfd2d8;
  --text: #17181c;
  --muted: #55585f;
  --quiet: #6f7278;
  --accent: #b04a00;
  --accent-soft: #fbeadd;
  --primary: #1d2025;
  --primary-hover: #33373e;
  --on-primary: #fff;
  --green: #157f4b;
  --green-soft: #e2f2e9;
  --green-soft-hover: #d5ecde;
  --danger: #b32530;
  --danger-soft: #fbeaea;
  --warn: #8a5a0b;
  --warn-soft: #fdf3df;
  --chart: #56698c;
  --overlay: #0c1116b3;
  --shadow-1: 0 1px 2px #17181c0d;
  --shadow-2: 0 6px 24px #17181c1a;
  --shadow-3: 0 24px 90px #17181c30;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355585f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E");
  --r-xs: 6px;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-pill: 999px;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: "Geist", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1013;
  --rail: #131418;
  --panel: #191b1f;
  --hover: #22252b;
  --press: #2b2f36;
  --line: #262930;
  --line-strong: #3a3e47;
  --text: #f2f3f5;
  --muted: #b3b8c0;
  --quiet: #979ca4;
  --accent: #ff9d61;
  --accent-soft: #2b231c;
  --primary: #e9eaee;
  --primary-hover: #d4d6dc;
  --on-primary: #16181b;
  --green: #7fd6a5;
  --green-soft: #17251c;
  --green-soft-hover: #1d2e24;
  --danger: #ff98a1;
  --danger-soft: #2a1d1f;
  --warn: #e8c16a;
  --warn-soft: #2b2517;
  --chart: #8aa6c8;
  --overlay: #05070bd9;
  --shadow-1: 0 1px 2px #00000066;
  --shadow-2: 0 8px 28px #000000b3;
  --shadow-3: 0 24px 90px #000000e6;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3b8c0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased }
h1, h2, p { margin: 0 }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; font-weight: 680; letter-spacing: -.05em }
h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -.025em }
button, input { font: inherit }
button { cursor: pointer }
button:disabled { opacity: .55; cursor: default }
a { color: inherit; text-decoration: none }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.muted { color: var(--muted) }
.error { color: var(--danger) }
.mono { font: .9rem/1.5 var(--mono); font-variant-numeric: tabular-nums }
main { max-width: 72rem; margin: auto; padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 4rem }
.stack { display: grid; gap: 1.25rem }
.heading p, .panel h2 + p { margin-top: .4rem }
.panel, dialog { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1) }
.panel { padding: clamp(1rem, 3vw, 1.5rem); min-width: 0 }
.compact { max-width: 32rem }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--r-s); font-weight: 620; white-space: nowrap }
.primary { color: var(--on-primary); background: var(--primary); border-color: var(--primary) }
.primary:hover { background: var(--primary-hover) }
.secondary { color: var(--text); background: var(--panel) }
.secondary:hover { background: var(--hover) }
input { min-height: 48px; width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-s); padding: .6rem .8rem }
label { display: block; font-weight: 600; margin-bottom: .32rem }
.search { max-width: 29rem }
.kiosk {
  --kiosk-bg: #d3d9e2;
  --tile-bg: #fff;
  --tile-border: #9ca8b9;
  --tile-hover: #f2f5fa;
  --tile-active: #e0e7f1;
  --tile-shadow: 0 2px 4px #1c2f4920;
  background: var(--kiosk-bg);
  align-content: start;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(2rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
[data-theme="dark"] .kiosk {
  --kiosk-bg: #101318;
  --tile-bg: #262e3a;
  --tile-border: #56647a;
  --tile-hover: #303b4c;
  --tile-active: #39485d;
  --tile-shadow: 0 2px 4px #0005;
}
.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  grid-auto-rows: minmax(6rem, auto);
  gap: .85rem;
  width: 100%;
  max-width: 49rem;
  margin-inline: auto;
}
.person {
  min-width: 0;
  padding: .75rem;
  color: var(--text);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: var(--r-m);
  box-shadow: var(--tile-shadow);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  font-weight: 650;
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .person:hover { background: var(--tile-hover) }
}
.person:active { background: var(--tile-active) }
dialog { color: var(--text); width: min(29rem, calc(100% - 2rem)); padding: 1.5rem; box-shadow: var(--shadow-3) }
dialog::backdrop { background: var(--overlay) }
dialog form, .form-stack { display: grid; gap: .75rem }
dialog h2 { font-size: 1.55rem; overflow-wrap: anywhere }
.visit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem }
.visit-actions .button { min-height: 56px }
.notice:not(:empty) { position: fixed; bottom: max(1rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 1; width: max-content; max-width: calc(100% - 2rem); background: var(--green-soft); border: 1px solid var(--green); color: var(--green); padding: .7rem 1rem; border-radius: var(--r-s); box-shadow: var(--shadow-2) }
.actions, .section-head { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem }
.section-head { justify-content: space-between }
.present-total { color: var(--green); background: var(--green-soft); padding: .22rem .65rem; border-radius: var(--r-pill) }
.rows { list-style: none; padding: 0; margin: .65rem 0 0 }
.rows li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; padding: .7rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere }
.table-scroll { overflow-x: auto }
table { width: 100%; text-align: left; border-collapse: collapse }
th, td { padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--line) }
th { color: var(--muted); font-size: .88rem }
td { overflow-wrap: anywhere }
.pagination { margin-top: .8rem }
.cancel { justify-self: center; background: transparent; color: var(--muted); border-color: transparent }
.cancel:hover { background: var(--hover) }
summary { cursor: pointer; min-height: 44px; align-content: center; font-size: 1.1rem; font-weight: 650 }
details.panel { padding-block: .35rem }
.details-body { padding-block: .35rem 1rem }
