:root {
  --brand: #0178a3;
  --brand-2: #015f82;
  --accent: #5cc3e8;
  /* Answers and selections are neutral; the brand colour is only for the frame. */
  --choice: #27323d;
  --choice-tint: #edf0f3;
  --choice-line: #8a96a3;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #14202e;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --ok: #178a4c;
  --ok-bg: #e7f6ee;
  --bad: #c62f2f;
  --bad-bg: #fdecec;
  --radius: 18px;
  --tap: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 20px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.bar {
  display: flex; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) 28px 14px;
  background: var(--brand); color: #fff;
}
.bar .brand { font-weight: 700; letter-spacing: .2px; font-size: 22px; }
.bar .site { opacity: .9; font-size: 18px; }
.bar .spacer { flex: 1; }
.bar .clock { font-variant-numeric: tabular-nums; font-size: 18px; opacity: .9; }
.bar button {
  background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 12px;
  padding: 10px 18px; font-size: 18px; min-height: 48px;
}
.bar button:active { background: rgba(255,255,255,.22); }

.progress { height: 6px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .25s; }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 32px 28px 140px; }
h1 { font-size: 36px; line-height: 1.15; margin: 8px 0 8px; letter-spacing: -.3px; }
h2 { font-size: 22px; margin: 32px 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.lead { color: var(--muted); margin: 0 0 24px; }

/* ---------- Home ---------- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; text-align: center; }
.home h1 { font-size: 48px; margin-bottom: 4px; }
.home .lead { font-size: 22px; }
.home .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 820px; margin-top: 32px; }
.big {
  border: 0; border-radius: 24px; padding: 48px 24px; min-height: 260px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  font-size: 34px; font-weight: 700; box-shadow: 0 8px 24px rgba(1,120,163,.12);
  transition: transform .08s;
}
.big:active { transform: scale(.98); }
.big svg { width: 72px; height: 72px; }
.big.in { background: var(--brand); color: #fff; }
.big.out { background: var(--card); color: var(--brand); border: 2px solid var(--line); }
.big small { font-size: 18px; font-weight: 500; opacity: .75; }
.home .foot { margin-top: 40px; color: var(--muted); font-size: 16px; }

/* ---------- Pass type tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; min-height: 96px; text-align: left; font-size: 21px; font-weight: 600;
  display: flex; align-items: center;
}
.tile:active, .tile.sel { border-color: var(--choice); background: var(--choice-tint); }

/* ---------- Form fields ---------- */
.field { margin: 0 0 26px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 10px; font-size: 21px; }
.field .opt { color: var(--muted); font-weight: 400; }
.field .help { color: var(--muted); font-size: 17px; margin: -4px 0 10px; }
.input, textarea.input {
  width: 100%; font: inherit; font-size: 22px; padding: 16px 18px; min-height: var(--tap);
  border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); outline: none;
}
textarea.input { min-height: 110px; resize: none; }
.input:focus { border-color: var(--choice-line); box-shadow: 0 0 0 4px rgba(39,50,61,.10); }
.field.err .input, .field.err .seg, .field.err .picker { border-color: var(--bad); }
.field .msg { color: var(--bad); font-size: 17px; margin-top: 8px; font-weight: 500; }
.welcome { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 12px 16px; margin: -10px 0 22px; font-weight: 600; font-size: 18px; }

.question { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.question .q { font-weight: 600; margin: 0 0 16px; font-size: 21px; }
.question .help { color: var(--muted); font-size: 17px; margin: -8px 0 16px; }
.question.err { border-color: var(--bad); background: var(--bad-bg); }
.question .msg { color: var(--bad); font-size: 17px; margin-top: 12px; font-weight: 500; }

.seg { display: flex; gap: 12px; flex-wrap: wrap; }
.seg button {
  flex: 1 1 140px; min-height: var(--tap); border-radius: 14px; border: 2px solid var(--line);
  background: #fff; font-size: 21px; font-weight: 600;
}
.seg button.sel { background: var(--choice); border-color: var(--choice); color: #fff; }
.seg button.sel::before { content: "\2713  "; }

.info { background: #fff8e8; border: 2px solid #f3dfae; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; font-size: 18px; }
.info.legal { background: #f7f8fa; border-color: var(--line); font-size: 16px; color: #394756; }
.info ol, .info ul { margin: 0; padding-left: 24px; }
.info li { margin: 8px 0; font-size: 20px; }
.rule-img { width: 100%; border-radius: var(--radius); margin-bottom: 16px; border: 2px solid var(--line); }

/* Picker (staff / lookup lists) */
.picker { border: 2px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.picker .input { border: 0; border-bottom: 2px solid var(--line); border-radius: 0; }
.picker .input:focus { box-shadow: none; }
.picker .list { max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.picker .item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff;
  padding: 16px 18px; min-height: 60px; font-size: 20px;
}
.picker .item:last-child { border-bottom: 0; }
.picker .item.sel { background: var(--choice-tint); font-weight: 600; }
.picker .item .tick { color: var(--choice); font-weight: 700; }
.picker .item small { color: var(--muted); font-size: 16px; margin-left: 10px; }
.picker .empty { padding: 18px; color: var(--muted); font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { background: var(--choice); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px 8px 16px; font-size: 18px; }
.chip::after { content: " \00d7"; opacity: .7; }

/* ---------- Footer actions ---------- */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 14px; justify-content: space-between;
  padding: 16px 28px calc(16px + env(safe-area-inset-bottom));
  background: rgba(244,246,249,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.actions .inner { width: 100%; max-width: 900px; margin: 0 auto; display: flex; gap: 14px; }
.btn {
  min-height: var(--tap); padding: 0 32px; border-radius: 16px; border: 2px solid var(--line);
  background: #fff; font-size: 22px; font-weight: 600;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; flex: 1; }
.btn.primary:disabled { opacity: .5; }
.btn:active { transform: scale(.99); }

/* ---------- Sign-out results ---------- */
.results { margin-top: 18px; display: grid; gap: 12px; }
.result {
  display: flex; align-items: center; gap: 18px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px 22px; min-height: 84px;
}
.result:active { border-color: var(--choice); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--choice-tint); color: var(--choice); display: grid; place-items: center; font-weight: 700; flex: none; }
.result .who { font-weight: 700; font-size: 22px; }
.result .meta { color: var(--muted); font-size: 17px; }

/* ---------- Done / messages ---------- */
.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.done .mark { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); margin-bottom: 24px; }
.done .mark svg { width: 64px; height: 64px; }
.done h1 { font-size: 44px; }
.done .lead { font-size: 22px; max-width: 620px; }
.done .note { background: #fff8e8; border: 2px solid #f3dfae; border-radius: 14px; padding: 14px 20px; margin: 8px 0 20px; font-size: 18px; max-width: 620px; }
.done .btn { margin-top: 20px; min-width: 240px; flex: none; }
.done.problem .mark { background: var(--bad-bg); color: var(--bad); }

.banner { background: var(--bad-bg); color: var(--bad); border: 2px solid #f3c3c3; border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; font-weight: 600; font-size: 18px; }

/* Idle overlay & confirm */
.overlay { position: fixed; inset: 0; background: rgba(10,30,40,.55); display: grid; place-items: center; z-index: 50; padding: 24px; }
.dialog { background: #fff; border-radius: 24px; padding: 36px; max-width: 560px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog h1 { font-size: 30px; }
.dialog .row { display: flex; gap: 14px; margin-top: 24px; }
.dialog .row .btn { flex: 1; }

.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  body { font-size: 18px; }
  main { padding: 24px 16px 130px; }
  .home .choices { grid-template-columns: 1fr; }
  .big { min-height: 160px; padding: 28px; font-size: 28px; }
  .home h1 { font-size: 36px; }
  .bar { padding-left: 16px; padding-right: 16px; }
  .bar .site, .bar .clock { display: none; }
  .actions { padding-left: 16px; padding-right: 16px; }
  .btn { padding: 0 20px; }
}

/* First / last name side by side */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { color: var(--muted); font-size: 17px; margin: -8px 0 26px; }
@media (max-width: 700px) { .name-row { grid-template-columns: 1fr; gap: 0; } }

/* =====================================================================
   Landscape iPad layout (primary). Sized for 1024×768, the smallest
   landscape iPad, and scales up to 1180×820, 1366×1024, etc.
   ===================================================================== */
main { max-width: 1180px; padding: 22px 40px 120px; }
.step-head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.step-head h1 { font-size: 32px; margin: 0; }
.step-head .lead { margin: 0; font-size: 19px; }
h2 { margin: 18px 0 10px; font-size: 18px; }

.bar { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px; }
.actions { padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.actions .inner { max-width: 1100px; }
.btn { min-height: 60px; }

/* Home */
.home { padding: 24px 40px; }
.home h1 { font-size: 44px; }
.home .choices { max-width: 980px; gap: 28px; margin-top: 28px; }
.big { min-height: 250px; }

/* Pass tiles: 3 across */
.tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { min-height: 84px; padding: 18px; font-size: 20px; }

/* Form fields: a little more compact */
.field { margin-bottom: 18px; }
.field > label, .field > .label { font-size: 19px; margin-bottom: 8px; }
.input, textarea.input { font-size: 21px; padding: 12px 16px; min-height: 58px; }
textarea.input { min-height: 96px; }
.hint { margin: -4px 0 0; font-size: 16px; }
.welcome-slot:empty { display: none; }
.welcome { margin: 0 0 16px; }

/* Details: contact fields left, host picker right */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.host-field .picker .list { max-height: 330px; }
.picker .list { max-height: 250px; }
.picker .item { min-height: 54px; padding: 12px 16px; font-size: 19px; }

/* Sections: two-column grid, wide items span */
.section-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
.section-grid > .span { grid-column: 1 / -1; }
.info { padding: 16px 20px; margin-bottom: 16px; }
.info li { margin: 4px 0; font-size: 19px; }
.info.legal { font-size: 15px; line-height: 1.45; }

/* Yes/No questions: question left, buttons right, one row each */
.question {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; column-gap: 24px;
  padding: 14px 18px 14px 22px; margin-bottom: 10px;
}
.question .q { margin: 0; font-size: 20px; }
.question .help { margin: 6px 0 0; }
.question .seg { flex-wrap: nowrap; }
.question .seg button { flex: 1; min-height: 56px; }
.question .seg { grid-column: 2; grid-row: 1 / span 2; }
.question .msg { grid-column: 1; grid-row: 2; margin-top: 4px; }

/* Sign out results: two across */
.results { grid-template-columns: 1fr 1fr; }

/* Done screens */
.done { padding: 24px 40px; }
.done .mark { width: 100px; height: 100px; margin-bottom: 18px; }
.done h1 { font-size: 40px; }

/* Portrait on a tablet: ask for landscape */
.rotate { display: none; }
@media (orientation: portrait) and (min-width: 600px) {
  .rotate {
    display: flex; position: fixed; inset: 0; z-index: 100; background: var(--brand); color: #fff;
    flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 40px;
  }
  .rotate svg { width: 120px; height: 120px; margin-bottom: 8px; }
  .rotate strong { font-size: 34px; }
  .rotate span { font-size: 20px; opacity: .9; }
}

/* Narrow screens (e.g. testing on a phone): stack everything */
@media (max-width: 700px) {
  main { padding: 18px 16px 120px; }
  .tiles, .pair, .two-col, .section-grid, .results { grid-template-columns: 1fr; }
  .question { grid-template-columns: 1fr; }
  .question .seg { margin-top: 12px; grid-column: 1; grid-row: auto; }
  .question .msg { grid-row: auto; }
}

/* ---------- Logo & white header ----------
   The logo's blue is the brand colour, so it sits on white. */
.bar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 8px rgba(0,0,0,.04); }
.bar .logo { height: 40px; width: auto; display: block; }
.bar .site { color: var(--muted); opacity: 1; padding-left: 16px; border-left: 1px solid var(--line); }
.bar .clock { color: var(--muted); opacity: 1; }
.bar button { background: var(--choice-tint); color: var(--ink); border: 1px solid var(--line); }
.bar button:active { background: #e1e5ea; }

.home { position: relative; background: #fff; }
.home-top { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 32px; right: 32px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 18px; }
.site-pill { background: var(--choice-tint); color: var(--ink); border-radius: 999px; padding: 6px 16px; font-weight: 600; font-size: 17px; }
.home-top .clock { font-variant-numeric: tabular-nums; }
.home-logo { width: 360px; max-width: 70vw; height: auto; margin-bottom: 26px; }
.home h1 { font-size: 40px; }
.big.out { background: var(--bg); }

/* ---------- Typography: Overpass for headings, Maven Pro for body ---------- */
:root {
  --font-body: "Maven Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Overpass", "Maven Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body, button, input, select, textarea { font-family: var(--font-body); }
h1, h2, h3, .font-head { font-family: var(--font-head); letter-spacing: -0.01em; }
.big span, .rotate strong, .dialog h1 { font-family: var(--font-head); }
h1 { font-weight: 800; }

/* ---------- Deliveries ---------- */
.delivery-strip {
  display: flex; align-items: center; gap: 18px; width: 100%; max-width: 980px; margin-top: 22px;
  background: var(--bg); border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px 18px; text-align: left;
}
.delivery-strip .ds-icon { width: 44px; height: 44px; color: var(--muted); flex: none; }
.delivery-strip .ds-icon svg { width: 100%; height: 100%; }
.delivery-strip .ds-text { flex: 1; display: flex; flex-direction: column; }
.delivery-strip .ds-text strong { font-family: var(--font-head); font-size: 21px; }
.delivery-strip .ds-text span { color: var(--muted); font-size: 16px; }
.delivery-strip .ds-btn { min-height: 56px; font-size: 19px; padding: 0 22px; }
.delivery-strip .qr { width: 92px; height: 92px; flex: none; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.delivery-strip .qr svg { width: 100%; height: 100%; display: block; }
.courier-tiles { grid-template-columns: repeat(3, 1fr); }
.courier-tiles .tile { justify-content: center; text-align: center; min-height: 76px; }
.other-wrap { margin-top: 18px; max-width: 520px; }
main > .msg { color: var(--bad); font-weight: 500; margin-top: 12px; }
/* Home screen with the delivery strip: tighten so everything fits on a 1024×768 iPad */
.home.with-deliveries { padding-top: 14px; padding-bottom: 14px; }
.home.with-deliveries .home-logo { width: 300px; margin-bottom: 14px; }
.home.with-deliveries h1 { font-size: 36px; }
.home.with-deliveries .choices { margin-top: 20px; }
.home.with-deliveries .big { min-height: 205px; padding: 24px; gap: 10px; }
.home.with-deliveries .big svg { width: 60px; height: 60px; }
.home.with-deliveries .delivery-strip { margin-top: 18px; }
.home.with-deliveries .foot { margin-top: 14px; }

/* Enrolment code screen */
.done.enrol { background: #fff; }
.done.enrol .home-logo { width: 280px; margin-bottom: 18px; }
.enrol-row { display: flex; gap: 14px; margin-top: 18px; align-items: center; }
.code-input { width: 300px; font-size: 34px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; font-family: var(--font-head); }
.enrol-row .btn { margin-top: 0; min-width: 220px; }
.done.enrol .msg { color: var(--bad); margin-top: 14px; font-weight: 600; min-height: 1.4em; }

/* ---------- Returning visitors ("Been here before?") ---------- */
.returning-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 980px; margin-top: 18px;
  min-height: 68px; padding: 12px 22px; text-align: left; font-size: 20px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.returning-btn:active { border-color: var(--choice-line); transform: scale(.99); }
.returning-btn strong { font-family: var(--font-head); color: var(--brand); }
.returning-btn .rb-icon { width: 32px; height: 32px; color: var(--brand); flex: none; }
.returning-btn .rb-icon svg { width: 100%; height: 100%; display: block; }
.returning-btn > span:nth-child(2) { flex: 1; }
.returning-btn .rb-go { font-size: 34px; line-height: 1; color: var(--muted); }
.home.with-deliveries .returning-btn { margin-top: 14px; min-height: 58px; }
.home.with-deliveries .big { min-height: 180px; }

.returning-field .input { font-size: 24px; }
.returning-result { margin-top: 20px; }
.returning-result .btn { margin-top: 4px; }
.returning-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 18px; justify-items: start; }
.returning-card .rc-who { display: flex; align-items: center; gap: 16px; }
.returning-card .who { font-weight: 700; font-size: 26px; font-family: var(--font-head); }
.returning-card .meta { color: var(--muted); font-size: 18px; }
.returning-card .lead { margin: 0; }
.rc-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.linkish { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; font-size: 17px; min-height: 44px; }
.returning-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--choice-tint); color: var(--ink); font-weight: 500; }
.returning-bar .linkish { padding: 0 4px; min-height: 0; }
