:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #6b6560;
  --card: #ffffff;
  --line: #e7e1da;
  --flame: #e23b16;
  --ember: #f08a1a;
  --green-ink: #fff8f4;
  --red: #9d2b22;
  --amber: #8a4b12;
  --shadow: 0 16px 40px rgba(20, 12, 8, 0.06);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #2a120c, var(--flame) 42%, var(--ember) 68%, #2a120c);
}
a { color: var(--flame); }
header, nav, main { width: min(920px, calc(100% - 32px)); margin: 0 auto; }
main.wide { width: min(1100px, calc(100% - 32px)); }
header { display: flex; justify-content: space-between; align-items: center; padding: 18px 0 6px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 54px; width: auto; display: block; }
.who { margin: 0; color: var(--muted); font-size: 0.92rem; }
nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 8px 0 16px; }
nav a, button.link { color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; letter-spacing: 0.01em; }
nav a:hover, button.link:hover { color: var(--flame); }
main { padding-bottom: 56px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -0.03em; }
h1 { font-size: 2rem; margin: 0 0 12px; }
h2 { margin: 0 0 8px; font-size: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.hero { padding: 22px 22px 20px; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: var(--flame); margin: 0 0 6px; font-weight: 650; }
.muted { color: var(--muted); }
label { display: block; margin: 0 0 12px; font-size: 0.92rem; }
input, select { width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; }
input:focus, select:focus { outline: 2px solid rgba(226, 59, 22, 0.28); border-color: #e7b5a6; }
button { appearance: none; border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 14px 18px; font: inherit; font-weight: 650; cursor: pointer; }
button[data-kind="in"], .login button[type="submit"] {
  background: linear-gradient(180deg, #f25a22, #d43212);
}
button.out, button[data-kind="out"] { background: var(--ink); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: 0.6; }
#punch { width: 100%; font-size: 1.15rem; margin-top: 8px; min-height: 56px; letter-spacing: 0.02em; }
.alert { background: #fdecec; color: var(--red); padding: 10px 12px; border-radius: 12px; }
.ok { color: #0e6b52; }
.kind.in { color: var(--flame); }
.kind.out { color: var(--ink); }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 0.78rem; border-radius: 999px; padding: 4px 8px; background: #f3f0ec; }
.badge.bad { background: #fdecec; color: var(--red); }
.badge.warn { background: #fff4df; color: var(--amber); }
.badge.ok { background: #e7f6ef; color: #0e6b52; }
.map iframe, .leaflet { width: 100%; height: 240px; border: 0; border-radius: 14px; background: #efeae4; }
.leaflet.tall { height: 380px; margin: 8px 0 16px; }
.leaflet.check { height: 320px; margin: 14px 0 8px; }
.zone-form { margin-top: 8px; }
.note { background: #fbf7f4; }
.people { list-style: none; padding: 0; margin: 0; }
.people li { padding: 8px 0; border-top: 1px solid var(--line); }
.alerts { margin: 0; padding-left: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.table-wrap { overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.inline { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.inline input { margin: 0; }
.break { overflow-wrap: anywhere; font-size: 0.8rem; }
.code { font-family: ui-monospace, "Cascadia Code", monospace; letter-spacing: 0.04em; color: var(--ink); }
form.inline button, td form { margin-top: 0; }

body.gate { display: grid; place-items: center; min-height: 100vh; }
body.gate::before { position: fixed; top: 0; left: 0; right: 0; }
body.gate main { width: min(440px, calc(100% - 32px)); margin: 0; padding: 32px 0; }
.login { text-align: left; padding: 28px 26px 24px; }
.login .logo { width: min(280px, 100%); height: auto; display: block; margin: 0 auto 8px; }
.login h1 { text-align: center; font-size: 1.7rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; margin-bottom: 8px; }
.login .muted { text-align: center; margin-top: 0; }
.login button { width: 100%; min-height: 52px; }
