@font-face {
  font-family: "Neuton";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/neuton-bold-700.ttf") format("truetype");
}

@font-face {
  font-family: "Sentient";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/sentient-regular-400.woff2") format("woff2");
}

@font-face {
  font-family: "Sentient";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/sentient-medium-500.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --page: #f7f4ec;
  --surface: #fffdfa;
  --ink: #1f352e;
  --muted: #52645b;
  --primary: #235445;
  --primary-hover: #183e32;
  --sage: #e5eee3;
  --sage-strong: #cddfcf;
  --peach: #f9e1cf;
  --peach-strong: #edbc9e;
  --border: #dedfd3;
  --danger: #873d38;
  --danger-background: #fae9e6;
  --shadow: 0 14px 40px rgb(50 61 47 / 8%), 0 3px 9px rgb(50 61 47 / 5%);
  --round: 1.25rem;
  --font-body: "Sentient", Georgia, "Times New Roman", serif;
  --font-heading: "Neuton", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% -10rem, #e9eee0 0, transparent 43rem), var(--page);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  font-synthesis: style;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }

a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #89613d;
  outline-offset: 3px;
}

img, canvas { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.2rem, 8vw, 3.7rem);
  letter-spacing: -.026em;
}

h2 {
  font-size: clamp(1.28rem, 4.7vw, 1.65rem);
  letter-spacing: -.015em;
}

h3 {
  font-size: 1.06rem;
  letter-spacing: -.01em;
}

p { margin: 0; }

strong, b, label, legend, summary, nav a { font-weight: 500; }

.site-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(1.2rem, 5vw, 2.2rem) 1rem .85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: .72rem;
  background: var(--primary);
  color: #fffdf6;
  box-shadow: 0 3px 8px rgb(25 62 49 / 16%);
  font: 700 1.53rem/1 var(--font-heading);
  letter-spacing: -.035em;
  padding: 0 .12rem .09rem 0;
}

.brand-logo {
  width: 10rem;
  object-fit: contain;
  object-position: left center;
}

.app {
  width: min(100% - 2rem, 36rem);
  margin: clamp(1.45rem, 5vw, 2.6rem) auto 3.5rem;
}

.app-wide, .app:has(.display-board) { width: min(100% - 2rem, 64rem); }

.hero {
  display: grid;
  gap: .55rem;
  margin: 0 0 1.35rem;
}

.hero > h1, .hero > p { max-width: 33rem; }

.eyebrow {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .095em;
  line-height: 1.4;
  text-transform: uppercase;
}

.lead { font-size: clamp(.97rem, 2.5vw, 1.12rem); }
.lead, .muted, .subtle { color: var(--muted); }
.small, small { font-size: .86rem; }
.code, .ticket-number, .ticket-count, .display-number, .stat strong { font-variant-numeric: tabular-nums; }
.code { font-weight: 500; letter-spacing: .03em; }

.panel, .card, .qr-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--round);
  background: var(--surface);
  padding: clamp(1rem, 4.5vw, 1.65rem);
  box-shadow: var(--shadow);
}

.app > .panel + .panel, .app > .card + .card,
.app > .panel + .card, .app > .card + .panel { margin-top: 1rem; }

.panel > h2 + *, .panel > .stats + *, .panel > .button-row + *,
.app > .ticket + .button-row, .app > .panel + .button-row, .app > .button-row + .panel,
.app > .panel + .split, .app > .split + .panel, .app > [data-message]:not(:empty) {
  margin-top: .85rem;
}

.app > [data-message]:not(:empty) { margin-bottom: .85rem; }
.checkbox-line { display: flex; gap: .5rem; align-items: center; }
.checkbox-line input { flex: 0 0 auto; margin: 0; }
.entry-row + .entry-row { margin-top: .55rem; }

.stack, .form-stack, .grid {
  display: grid;
  gap: 1rem;
}

.split {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.section-head, .toolbar, .button-row, .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}

.section-head, .toolbar { justify-content: space-between; }

.field {
  display: grid;
  align-content: start;
  gap: .38rem;
  min-width: 0;
}

.field label, label.field, legend {
  font-size: .94rem;
  font-weight: 500;
  color: var(--ink);
}

.field small { font-weight: 400; }

fieldset {
  min-width: 0;
  margin: 0;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: .85rem;
}

legend { padding: 0 .35rem; }

input, select, textarea, button { font: inherit; }

input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  margin: 0;
  border: 1px solid #becabf;
  border-radius: .75rem;
  padding: .66rem .8rem;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

select { font-weight: 500; }

input[type="date"], input[type="time"], input[type="datetime-local"] { min-width: 0; }
textarea { min-height: 5.5rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: #647368; opacity: 1; }
input[type="radio"], input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--primary); }

button, .button, .action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .42rem;
  min-height: 2.95rem;
  border: 1px solid transparent;
  border-radius: .78rem;
  background: var(--primary);
  padding: .66rem .92rem;
  color: #fff;
  font-weight: 500;
  line-height: 1.34;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease;
}

button:hover, .button:hover, .action:hover { background: var(--primary-hover); }

button:disabled, .button[aria-disabled="true"] {
  cursor: default;
  opacity: .6;
}

.button-primary { background: var(--primary); color: #fff; }
.button-secondary { background: var(--sage); color: var(--ink); border-color: #d5e1d5; }
.button-secondary:hover { background: var(--sage-strong); color: var(--ink); }
.button-quiet { background: transparent; color: var(--primary); border-color: var(--border); }
.button-quiet:hover { background: var(--sage); color: var(--primary); }
.button-danger { background: var(--danger-background); color: var(--danger); border-color: #edc9c4; }
.button-danger:hover { background: #f3d6d1; color: #733731; }
.button-full, .full-width { width: 100%; }

.choice-list {
  display: grid;
  gap: .65rem;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 4.15rem;
  border: 1px solid #d1ddcf;
  border-radius: .92rem;
  padding: .8rem .95rem;
  background: #f4f8ef;
  color: var(--ink);
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
}

.choice-card:hover, .choice-card[aria-pressed="true"] { background: var(--sage); border-color: #a8c2ad; }
.choice-card > span { min-width: 0; overflow-wrap: anywhere; }
.choice-card small, .choice-card strong { display: block; }
.choice-card small { margin-top: .25rem; color: var(--muted); font-weight: 400; }

.ticket {
  display: grid;
  justify-items: center;
  gap: .78rem;
  min-width: 0;
  border: 1px solid #cadacc;
  border-radius: 1.5rem;
  background: radial-gradient(ellipse at 50% -25%, #fff9ed 0, transparent 28rem), var(--sage);
  padding: clamp(1.55rem, 7vw, 2.85rem) 1rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.ticket.is-called, .ticket-called {
  border-color: #e2a777;
  background: var(--peach);
}

.ticket-number {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: clamp(2.65rem, 12vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .96;
  overflow-wrap: anywhere;
}

.ticket:not(.is-called) .ticket-number {
  border-radius: 99rem;
  background: rgb(255 255 255 / 68%);
  padding: .37rem .72rem;
  font-size: 1.13rem;
  letter-spacing: .01em;
}

.ticket-count {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.14;
}

.ticket-count:not(.ticket-destination) {
  font-size: clamp(2.85rem, 12vw, 5.3rem);
  letter-spacing: -.03em;
  line-height: 1;
}

.ticket-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .34rem .7rem;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
}

.ticket-estimate {
  width: fit-content;
  max-width: 100%;
  margin: .4rem auto 0;
  border: 1px solid #afc5b4;
  border-radius: .7rem;
  padding: .38rem .72rem;
  background: #f7fbf5;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 500;
}

.announcements {
  display: grid;
  gap: .65rem;
  margin-block: 1rem;
}

.announcement {
  display: grid;
  gap: .72rem;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e7d7c8;
  border-radius: 1rem;
  background: #fff9f2;
  padding: .95rem 1rem;
  overflow-wrap: anywhere;
}

.announcement p, .announcement-text { white-space: pre-wrap; }
.announcement .button { justify-self: start; }

.announcement img, .announcement-image {
  width: 100%;
  max-height: 18.75rem;
  border-radius: .65rem;
  object-fit: contain;
  background: #f6f0e8;
}

.status, .chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .35rem;
  border-radius: 99rem;
  background: var(--sage);
  padding: .28rem .63rem;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.35;
}

.ticket .status, .ticket .chip { background: rgb(255 255 255 / 66%); }
.status-called, .chip-called { background: var(--peach); color: #693916; }
.live-dot, .loading-dot { display: inline-block; flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: #538365; }
.loading { display: flex; align-items: center; justify-content: center; gap: .55rem; color: var(--muted); }
.loading-dot { animation: loading-pulse 1.2s ease-in-out infinite alternate; }

@keyframes loading-pulse { to { opacity: .4; transform: scale(.84); } }

.notice, .error, .empty {
  border: 1px solid #d3e0d2;
  border-radius: .75rem;
  background: #edf4eb;
  padding: .72rem .85rem;
  color: #345346;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.notice-error, .error, .notice.error { border-color: #ebc7c2; background: var(--danger-background); color: var(--danger); }
.empty { border-style: dashed; background: transparent; color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
  gap: .6rem;
}

.stat {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: .83rem;
  background: #f2f5ee;
  padding: .7rem .78rem;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.37;
}

.stat strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
}

.list, .queue-list {
  display: grid;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list > li, .queue-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .6rem;
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding: .48rem 0;
  overflow-wrap: anywhere;
}

.list > li:last-child, .queue-list > li:last-child { border-bottom: 0; }

.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
td, th { border-bottom: 1px solid var(--border); padding: .55rem .6rem; text-align: left; vertical-align: top; }
th { color: var(--primary); font-weight: 500; }
table:not(.attendance-table) tbody tr:last-child td { border-bottom: 0; }

.attendance-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.attendance-table {
  min-width: 32rem;
  font-variant-numeric: tabular-nums;
}

.attendance-table :is(th, td) { border: 1px solid #859687; }
.attendance-table thead { background: var(--sage); }
.attendance-table tbody tr:nth-child(even) { background: #f5f7f1; }

.qr-card {
  display: grid;
  justify-items: center;
  gap: .65rem;
  text-align: center;
}

.qr-card img, .qr-card canvas {
  width: min(100%, 15rem);
  margin-inline: auto;
  image-rendering: pixelated;
}

.qr-card .qr-logo {
  width: 9.5rem;
  max-height: 3.6rem;
  object-fit: contain;
  image-rendering: auto;
}

.qr-address { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }

.display-board { display: grid; gap: 1rem; }
.display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: .85rem;
}

.display-card {
  display: grid;
  gap: .35rem;
  min-width: 0;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--surface);
}

.display-card.is-called { background: var(--peach); border-color: var(--peach-strong); }
.display-number {
  color: var(--primary);
  font: 700 clamp(2rem, 7vw, 4rem)/1 var(--font-heading);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .button-row > button, .button-row > .button, .actions > button, .actions > .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@page { size: A4; margin: 15mm; }

@media print {
  body { background: white; color: black; }
  body:has(.qr-card) :not(:has(.qr-card), .qr-card, .qr-card *) { display: none !important; }
  body:has(.qr-card) :has(.qr-card) { width: auto; max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .qr-card {
    width: 100%;
    margin: 16mm auto 0;
    padding: 10mm;
    border: 0;
    background: #fff;
    box-shadow: none;
    color: #000;
    break-inside: avoid;
  }
  .qr-card h1, .qr-card h2 { font-size: 27pt; }
  .qr-address { font-size: 11pt; }
  .qr-card img, .qr-card canvas { width: 88mm; }
  .qr-card .qr-logo { width: 48mm; max-height: 25mm; }
  .qr-card button, .qr-card .button, .qr-card input, .qr-card .no-print { display: none !important; }
}
