:root {
  --green: #14532d;
  --green-2: #166534;
  --cream: #fef9c3;
  --ink: #1c2421;
  --muted: #5b6660;
  --line: #dfe3dc;
  --bg: #f6f7f4;
  --card: #fff;
  --err: #b42318;
  --ok: #157f3b;
  --radius: 14px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green-2); }
h1 { font-size: 1.5rem; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--green); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.who { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; min-width: 0; }
.who .school { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; opacity: 0.9; }
.who form { margin: 0; }
.who .link { color: #fff; }

.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; display: grid; gap: 14px; align-content: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.narrow { max-width: 420px; width: 100%; margin: 24px auto 0; }
.hero { padding: 4px 2px; }
.eyebrow { margin: 0 0 2px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--err); font-weight: 600; margin: 0; }
.ok { color: var(--ok); font-weight: 600; margin: 0; }

.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
input, select {
  font: inherit; font-weight: 400; font-size: 16px; /* 16px stops iOS zooming on focus */
  padding: 12px; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus { outline: 3px solid #86efac; border-color: var(--green-2); }
button { font: inherit; cursor: pointer; }
button.primary { min-height: 48px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-weight: 700; padding: 0 18px; }
button.primary:disabled { opacity: 0.5; }
button.link { background: none; border: 0; padding: 0; color: var(--green-2); text-decoration: underline; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.right { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.right form { margin: 0; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef1ec; font-size: 0.78rem; font-weight: 600; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.wait { background: #fef3c7; color: #92400e; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: inherit; text-decoration: none; min-height: 110px; }
.tile h2 { font-size: 1rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.tile.soon { opacity: 0.6; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 4px; color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 600; }
.tabbar a span { font-size: 1.3rem; line-height: 1; }
.tabbar a.on { color: var(--green); }
.tabbar a.scan { background: var(--green); color: #fff; border-radius: 50%; width: 64px; height: 64px; align-content: center; margin-top: -26px; box-shadow: 0 4px 14px rgba(20, 83, 45, 0.35); }
.foot { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 0 0 calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .page { padding-top: 28px; } }
