/* Tablet sign-in screen. One centered column of oversized fields; --brand comes from the client's settings. */
:root {
  color-scheme: light;
  --brand: #6e2345;
  --bg: #f7f6f5;
  --surface: #ffffff;
  --ink: #1d1b1c;
  /* Worked out from the colors above unless the client picks their own */
  --on-brand: #ffffff;
  --accent: var(--brand);
  --muted: color-mix(in srgb, var(--ink) 62%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 17%, var(--bg));
  --thanks-bg: var(--brand);
  --on-thanks: #ffffff;
  --brand-tint: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --brand-deep: color-mix(in srgb, var(--brand) 82%, black);
  --sky: #1d7fb8;
  --ok: #1f7a4d;
  --warn: #9a5b00; --warn-tint: #fbf0dc;
  --bad: #b3261e;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 18px/1.4 var(--font-body); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(36px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.inner { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 26px; }
.inner.narrow { max-width: 480px; margin-block: auto; }

.logo { display: grid; place-items: center; min-height: 72px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: default; }
.logo img { max-width: min(420px, 80%); max-height: 150px; width: auto; height: auto; pointer-events: none; }
.logo-text { font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--accent); text-align: center; }
.welcome { text-align: center; display: grid; gap: 6px; }
.welcome h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5vw, 44px); line-height: 1.05; text-wrap: balance; }
.welcome .event-line { margin: 14px 0 0; color: var(--accent); display: grid; gap: 2px; }
.ev-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3.6vw, 32px); line-height: 1.15; text-wrap: balance; }
.ev-date { font-weight: 600; font-size: 18px; opacity: .8; }

form.signin { display: flex; flex-direction: column; gap: 22px; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .name-row { grid-template-columns: 1fr; } }
.field { position: relative; display: grid; gap: 8px; min-width: 0; }
.field label, .pair-form label { font-weight: 600; font-size: 19px; }
.field input, .pair-form input {
  height: 76px; width: 100%; padding-inline: 20px; font-size: 28px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); transition: border-color .15s;
}
.field input:focus, .pair-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.field.invalid input { border-color: var(--bad); }
.err { color: var(--bad); font-size: 16px; font-weight: 600; }
.err:empty { display: none; }

.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); box-shadow: 0 12px 30px rgb(0 0 0 / .22); }
.suggest-head { padding: 6px 12px 4px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; min-height: 60px; padding-inline: 14px; border-radius: 10px; font-size: 24px; cursor: pointer; }
.suggest button:active, .suggest button:hover { background: var(--brand-tint); }
.suggest b { color: var(--accent); }

.domains { display: flex; flex-wrap: wrap; gap: 10px; }
.domains button { min-height: 56px; padding-inline: 18px; cursor: pointer; border: 2px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--accent); font-size: 21px; font-weight: 600; touch-action: manipulation; }
.domains button:active { background: var(--brand-tint); border-color: var(--brand); }

.fix { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--warn-tint); border: 2px solid var(--warn); }
.fix p { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.fix strong { color: var(--accent); }
.fix-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fix-btns button { min-height: 60px; border-radius: 12px; font-size: 21px; font-weight: 700; cursor: pointer; }
.fix-yes { background: var(--brand); color: var(--on-brand); border: 0; }
.fix-no { background: var(--surface); border: 2px solid var(--line); }

.optin { position: relative; display: flex; align-items: center; gap: 18px; cursor: pointer; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--line); user-select: none; -webkit-user-select: none; }
.optin input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { flex: none; width: 44px; height: 44px; border-radius: 10px; border: 3px solid var(--brand); display: grid; place-items: center; background: var(--surface); }
.box svg { stroke: var(--on-brand); width: 28px; height: 28px; opacity: 0; transform: scale(.6); transition: .15s; }
.optin input:checked + .box { background: var(--brand); }
.optin input:checked + .box svg { opacity: 1; transform: none; }
.optin input:focus-visible + .box { outline: 3px solid var(--sky); outline-offset: 3px; }
.optin:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.optin-text { display: grid; gap: 2px; }
.optin-text strong { font-size: 22px; }
.optin-text span { color: var(--muted); font-size: 16px; }
.optin-text span:empty { display: none; }

.submit { height: 84px; border: 0; border-radius: var(--radius); background: var(--brand); color: var(--on-brand);
  font-family: var(--font-display); font-weight: 800; font-size: 30px; cursor: pointer; width: 100%; }
.submit:active { background: var(--brand-deep); transform: translateY(1px); }
.submit:disabled { opacity: .6; }

.status { margin-top: auto; padding-top: 24px; display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.dot.wait { background: #d48a00; }
.dot.off { background: var(--bad); }

.pair-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 36px; text-align: center; color: var(--accent); }
.pair-lead { margin: 0; text-align: center; color: var(--muted); font-size: 19px; }
.pair-form { display: grid; gap: 12px; }
.pair-form input { text-align: center; letter-spacing: .2em; font-size: 40px; font-variant-numeric: tabular-nums; }

.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; text-align: center; }
.brand-bg { background: var(--thanks-bg); color: var(--on-thanks); }
.dim { background: rgb(29 27 28 / .55); }
.check { width: 112px; height: 112px; border-radius: 50%; background: color-mix(in srgb, var(--on-thanks) 16%, transparent); color: var(--on-thanks); display: grid; place-items: center; margin: 0 auto 24px; }
#thanks h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 7vw, 64px); }
#thanks p { margin: 0; font-size: 22px; opacity: .92; }
@media (prefers-reduced-motion: no-preference) {
  #thanks:not([hidden]) .check { animation: pop .4s ease-out; }
  @keyframes pop { from { transform: scale(.5); opacity: 0; } }
}

.sheet { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 28px; width: min(360px, 100%); display: grid; gap: 18px; }
.sheet.wide { width: min(520px, 100%); text-align: left; }
.sheet h2 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 20px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots i.on { background: var(--brand); }
.pin-msg { min-height: 22px; margin: 0; color: var(--bad); font-weight: 600; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-keys button { height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); font-size: 26px; font-weight: 600; cursor: pointer; }
.pin-keys button:active { background: var(--brand-tint); }
.pin-keys .ghost { border-color: transparent; background: none; font-size: 18px; color: var(--muted); }
.facts { margin: 0; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.org-msg { margin: 0; min-height: 22px; font-weight: 600; color: var(--ok); }
.org-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.obtn { min-height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 17px; cursor: pointer; }
.obtn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.obtn.danger { color: var(--bad); }
.obtn.arm { background: var(--bad); border-color: var(--bad); color: #fff; }

/* QR code for phone sign-in (tablet) and phone-only bits */
.qr-panel { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 8px; }
.qr-big { background: #fff; border-radius: 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-panel strong { display: block; font-size: 21px; }
.qr-panel span { color: var(--muted); font-size: 17px; }
.phone-note { margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; text-align: center; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) {
  .screen { padding-top: max(20px, env(safe-area-inset-top)); }
  .inner { gap: 20px; }
  .field input { height: 64px; font-size: 22px; }
  .submit { height: 72px; font-size: 26px; }
  .domains button { min-height: 48px; font-size: 18px; padding-inline: 14px; }
}
.qr-hero { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 28px 24px 24px; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; }
.qr-big { width: min(420px, 70vw); aspect-ratio: 1; }
.qr-big svg { width: 100%; height: 100%; display: block; }
.qr-hero h2 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 4.5vw, 40px); color: var(--accent); }
.qr-hero p { margin: 0; font-size: 21px; color: var(--muted); }
.nophone { margin-top: 10px; min-height: 56px; padding-inline: 24px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 19px; font-weight: 600; cursor: pointer; }
.nophone:active { background: var(--brand-tint); }
.org-assign { display: grid; gap: 6px; font-weight: 700; }
.org-assign span { color: var(--muted); font-weight: 500; }
.org-assign select { min-height: 56px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); }
.org-assign select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.sheet > * { min-width: 0; }
.org-assign select { width: 100%; max-width: 100%; text-overflow: ellipsis; }

.org-new { display: grid; gap: 6px; font-weight: 700; }
.org-new-row { display: flex; gap: 10px; flex-wrap: wrap; }
.org-new input { flex: 1 1 220px; min-width: 0; min-height: 56px; padding: 0 14px; border: 2px solid var(--brand); border-radius: 12px; font: inherit; font-size: 18px; }
.org-new input:focus { outline: none; box-shadow: 0 0 0 4px var(--brand-tint); }
.org-new .obtn { flex: 0 0 auto; }

/* "Skip" for guests who'd rather not give an email: findable, but quieter than the field above it */
.skip-email { justify-self: start; min-height: 48px; padding: 8px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 18px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.skip-email:active { color: var(--accent); }
.skip-email[hidden], .field[hidden] { display: none; }

/* Returning guest already on the mailing list: a friendly note in place of the email field */
.known { display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--radius); background: var(--brand-tint); border: 2px solid var(--brand); }
.known[hidden] { display: none; }
.known p { margin: 0; font-size: 21px; font-weight: 600; }
.known-undo { justify-self: start; min-height: 44px; padding: 6px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 17px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.not-dup { margin-top: 18px; min-height: 52px; padding: 10px 22px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--on-thanks) 70%, transparent); background: transparent; color: var(--on-thanks); font: inherit; font-size: 19px; font-weight: 700; cursor: pointer; }
.not-dup[hidden] { display: none; }

/* Organizer tools: the event first, everything else one tap away */
.org-sheet { max-height: calc(100dvh - 48px); overflow-y: auto; gap: 16px; overscroll-behavior: contain; }
.org-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.org-x { width: 48px; height: 48px; margin: -8px -10px -8px 0; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.org-x:active { background: var(--brand-tint); }
.org-now { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--brand-tint); }
.org-now .k { font-size: 14px; color: var(--muted); font-weight: 600; }
.org-now strong { font-family: var(--font-display); font-size: 22px; line-height: 1.2; color: var(--brand); }
.org-status { font-size: 14px; color: var(--ok); font-weight: 600; }
.org-status.warn { color: var(--warn, #9a5b00); }
.org-pick { display: grid; gap: 8px; }
.org-pick.busy { opacity: .55; pointer-events: none; }
.org-label { font-weight: 700; }
.org-group { margin: 8px 2px 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.org-list { display: grid; gap: 6px; }
.org-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.org-item .n { font-size: 17px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.org-item .s { font-size: 14px; color: var(--muted); white-space: nowrap; flex: none; }
.org-item.on { border-color: var(--brand); background: var(--brand-tint); }
.org-item.on .n::before { content: "✓ "; color: var(--brand); font-weight: 800; }
.org-item:active { background: var(--brand-tint); }
.org-more { justify-self: start; border: 0; background: none; padding: 8px 2px; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
.org-more::after { content: " ›"; }
.org-more[aria-expanded="true"]::after { content: " ⌄"; }
.org-add { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 2px dashed var(--brand); border-radius: 12px; background: none; color: var(--brand); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.org-tools { display: grid; gap: 14px; }
.org-msg:empty { display: none; }
.sheet.wide.org-sheet { width: min(680px, 100%); padding: 32px; }
.org-view { display: grid; gap: 16px; }
.org-view[hidden] { display: none; }
.org-switch { margin-top: 12px; width: 100%; min-height: 60px; font-size: 19px; }
.org-back { width: 48px; height: 48px; margin: -8px 0 -8px -10px; border: 0; border-radius: 50%; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.org-back:active { background: var(--bg); }
.org-search { min-height: 52px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; font-size: 18px; background: var(--surface); color: var(--ink); }
.org-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.org-empty { margin: 0; color: var(--muted); }
.org-item[hidden], .org-group[hidden] { display: none; }
.org-tonight { display: grid; gap: 8px; }
.org-tonight[hidden] { display: none; }
.org-tonight.busy { opacity: .55; pointer-events: none; }
.org-tonight .org-item { min-height: 64px; }
.org-tonight .org-item .n { font-size: 19px; }

/* Who's here: the count on the first organizer view, and the list behind it */
.org-people-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.org-people-btn:active { background: var(--brand-tint); }
.org-people-btn .num, .org-total .num { font-family: var(--font-display); font-size: 38px; font-weight: 800; line-height: 1; color: var(--brand); min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.org-people-btn .lbl, .org-total > span:last-child { display: grid; gap: 2px; min-width: 0; }
.org-people-btn .lbl strong { font-size: 18px; }
.org-people-btn .lbl span, .org-total #pSub { font-size: 14px; color: var(--muted); }
.org-people-btn::after { content: "›"; margin-left: auto; font-size: 28px; color: var(--muted); }
.org-total { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--brand-tint); }
.org-total strong { font-size: 18px; overflow-wrap: anywhere; }
.people { display: grid; gap: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.people:empty { display: none; }
.person { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.person:first-child { border-top: 0; }
.person[hidden] { display: none; }
.person .nm { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.person .em { grid-column: 1; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; user-select: text; }
.person .tm { grid-row: 1; grid-column: 2; font-size: 14px; color: var(--muted); white-space: nowrap; }
.person .tags { grid-column: 2; display: flex; gap: 4px; justify-content: end; }
.person .tag { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); white-space: nowrap; }
.person .tag.wait { background: #fbf0dc; color: #8a5300; }

/* Tickets in organizer tools: a ticket holder's row with its check-in button */
.person .tags .tk-in { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.person.tk-done .nm::after { content: " ✓"; color: var(--brand); }

/* The organization's disclaimer, just above or below the Sign In button */
.disclaimer { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted, #5f6b67); text-align: center; white-space: pre-line; overflow-wrap: anywhere; }
