/* ==========================================================================
   Rowmates: design system
   Open-air cinema: deep navy, pale projection light, oxblood seating.
   ========================================================================== */

@font-face {
  font-family: 'Raleway';
  src: url('/vendor/fonts/raleway-var.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: dark;

  /* Surfaces */
  --ink:        #04070d;
  --surface:    #080e18;
  --surface-2:  #0d1624;
  --surface-3:  #142238;
  --edge:       rgba(207, 220, 236, 0.09);
  --edge-2:     rgba(207, 220, 236, 0.17);

  /* Type */
  --text:       #edf2f7;
  --dim:        #a0adbd;
  --faint:      #68778c;

  /* Brass accent: the house lights */
  --brass:      #6385b0;
  --brass-hi:   #8ca8ca;
  --brass-lo:   #405f86;
  --on-brass:   #050a11;
  --house-warm: #c59a61;
  --oxblood:    #521b2b;

  /* Seat states */
  --open-bg:    #10352a;
  --open-edge:  #2b7f5b;
  --open-text:  #74e6b0;
  --open-glow:  rgba(52, 211, 153, 0.35);
  --taken-bg:   #262b38;
  --taken-edge: #3b4254;
  --taken-text: #aeb5c8;

  --green:  #34d399;
  --amber:  #fbbf24;
  --red:    #f87171;

  --sans:  'Raleway', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Raleway', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'Raleway', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --shadow:    0 2px 8px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.5), 0 28px 70px rgba(0,0,0,.5);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05' 1, 'cv08' 1, 'ss03' 1;
  min-height: 100vh;
}

/* Atmosphere: a soft house-light spill from above, plus fine grain. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(99, 133, 176, .14), transparent 62%),
    radial-gradient(760px 420px at 88% 4%, rgba(197, 154, 97, .04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
.container, header.site, .modal-backdrop, .toast-wrap { position: relative; z-index: 1; }

/* --------------------------------------------------------------- layout -- */

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 6rem; }
.container.narrow { max-width: 640px; }

header.site {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--sans);
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .24em;
}
.logo:hover { text-decoration: none; }

nav.site { display: flex; align-items: center; gap: 1.5rem; }
nav.site a {
  color: var(--dim);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .18s;
}
nav.site a:hover { color: var(--text); }

/* ----------------------------------------------------------- typography -- */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.022em; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.04;
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--brass); }

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.12; }
h2 { font-size: 1.16rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.dim   { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: .845rem; line-height: 1.5; }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* Section eyebrow: small caps label above a heading. */
.eyebrow {
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: .5rem;
}
.eyebrow.plain { color: var(--faint); }

a { color: var(--brass-hi); text-decoration-color: rgba(255, 212, 137, .35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

/* ---------------------------------------------------------------- cards -- */

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
/* Flow spacing only: never inside a grid/flex track, which spaces itself. */
.card + .card { margin-top: 1.25rem; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .stack > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.tint { border-color: rgba(255, 194, 87, .3); background: linear-gradient(180deg, rgba(255,194,87,.09), rgba(255,194,87,.02)); }
.card.bad  { border-color: rgba(248, 113, 113, .38); background: linear-gradient(180deg, rgba(248,113,113,.09), rgba(248,113,113,.02)); }

.card-head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--edge); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.stack   { display: grid; gap: 1.25rem; }
.stack-sm { display: grid; gap: .6rem; }
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

hr.rule { border: 0; border-top: 1px solid var(--edge); margin: 1.75rem 0; }

/* ---------------------------------------------------------------- forms -- */

label, .label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .45rem;
}
label .hint, .label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }

.field { margin-bottom: 1.15rem; }
.field:last-child { margin-bottom: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="date"], input[type="time"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-sm);
  padding: .7rem .85rem;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: #4d5265; }
input:hover, textarea:hover, select:hover { border-color: rgba(255,255,255,.22); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brass);
  background: rgba(0, 0, 0, .5);
  box-shadow: 0 0 0 3px rgba(255, 194, 87, .16);
}
textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23949aab' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.4rem;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.65); cursor: pointer; }

.input-prefix { position: relative; }
.input-prefix span {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: .95rem; pointer-events: none;
}
.input-prefix input { padding-left: 2rem; }

/* Segmented radio group: used for payment mode & access. */
.choices { display: grid; gap: .6rem; }
.choice {
  /* .choice is itself a <label>, so undo the uppercase field-label styling. */
  font-size: .95rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  margin-bottom: 0;
  display: flex; align-items: flex-start; gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--edge-2);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.choice:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.02); }
.choice input { margin: .3rem 0 0; accent-color: var(--brass); flex: none; }
.choice:has(input:checked) { border-color: var(--brass); background: rgba(255, 194, 87, .07); }
.choice strong { display: block; font-weight: 600; font-size: .93rem; }
.choice span { display: block; color: var(--dim); font-size: .84rem; line-height: 1.45; }

/* -------------------------------------------------------------- buttons -- */

.btn {
  --btn-bg: var(--brass);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--on-brass);
  background: var(--btn-bg);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: .68rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .2s, filter .18s, background .18s;
  box-shadow: 0 8px 24px rgba(22, 45, 75, .28);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.09); box-shadow: 0 12px 30px rgba(22, 45, 75, .38); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

.btn.ghost {
  background: rgba(255,255,255,.045);
  color: var(--text);
  border-color: var(--edge-2);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.24); filter: none; }

.btn.quiet { background: none; color: var(--dim); box-shadow: none; padding-left: .6rem; padding-right: .6rem; }
.btn.quiet:hover { color: var(--text); background: rgba(255,255,255,.05); filter: none; }

.btn.danger { background: rgba(248,113,113,.1); color: var(--red); border-color: rgba(248,113,113,.3); box-shadow: none; }
.btn.danger:hover { background: rgba(248,113,113,.18); filter: none; }

.btn.sm { font-size: .82rem; padding: .4rem .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

.btn-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Input plus its action, on one line and staying there. */
.input-go { display: flex; gap: .5rem; align-items: stretch; }
.input-go input { flex: 1 1 auto; min-width: 0; }
.input-go .btn { flex: 0 0 auto; }

/* -------------------------------------------------------- theater / map -- */

.theater {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 214, 140, .09), transparent 58%),
    linear-gradient(180deg, #0b0d13, #070809);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  padding: 2.5rem 1.25rem 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), var(--shadow);
}

/* The screen: a lit curved panel throwing light down the house. */
.screen {
  width: min(76%, 620px);
  height: 46px;
  margin: 0 auto .35rem;
  border-radius: 50% / 100% 100% 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(190, 205, 255, .3) 42%, transparent 78%);
  filter: blur(.4px);
  box-shadow: 0 26px 60px -12px rgba(180, 200, 255, .38);
  clip-path: inset(0 0 52% 0);
}
.screen-label {
  font-size: .62rem;
  font-weight: 650;
  letter-spacing: .55em;
  text-indent: .55em;
  color: rgba(255,255,255,.42);
  margin-bottom: 2.25rem;
}

/* Seat size is a variable so a wide house can shrink to fit rather than
   scrolling: an organizer confirming a pre-selection has to be able to see the
   whole row, and a 21-across grid overflowed a laptop. `renderTheater` sets
   --seat-w from the row length. */
.theater { --seat-w: 36px; --seat-gap: 9px; }
.seat-rows { display: inline-flex; flex-direction: column; gap: var(--seat-gap); }
.seat-row  { display: flex; align-items: center; gap: var(--seat-gap); }

.row-label {
  width: 1.5rem;
  flex: none;
  align-self: center;
  font-size: .7rem;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.row-label.right { opacity: .55; }

/* Slot carries the arc offset so the seat's own transform stays free. */
.seat-slot { transform: translateY(var(--arc, 0px)); flex: none; line-height: 0; }
.seat-slot.gap { margin-left: calc(var(--seat-w, 36px) * 0.72); }

.seat {
  position: relative;
  width: var(--seat-w, 36px);
  height: calc(var(--seat-w, 36px) * 0.94);
  padding: 0;
  font: inherit;
  font-size: .64rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  border-radius: 10px 10px 4px 4px;
  border: 1px solid var(--edge);
  background: #171b25;
  color: #454b5c;
  cursor: default;
  transition: transform .16s var(--ease), box-shadow .2s, border-color .2s, background .2s;
  /* the seat back lip */
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.35);
}

.seat.outside { opacity: .3; }

/* No seat at this coordinate: an aisle, a wheelchair bay, a wall. A real
   auditorium is full of them, and drawing them as dimmed seats says "taken"
   when the truth is "there is nothing here". */
.seat.empty {
  background: none;
  border-color: transparent;
  box-shadow: none;
  color: transparent;
  pointer-events: none;
}
.seat.empty:hover { transform: none; border-color: transparent; }

.seat.open {
  background: linear-gradient(180deg, #16412f, var(--open-bg));
  border-color: var(--open-edge);
  color: var(--open-text);
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.32), 0 0 0 0 var(--open-glow);
}
.seat.open:hover {
  transform: translateY(-3px) scale(1.1);
  border-color: var(--green);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.3), 0 8px 22px -4px var(--open-glow), 0 0 0 1px var(--green);
  z-index: 4;
}
.seat.open:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.seat.taken {
  background: linear-gradient(180deg, var(--surface-3), var(--taken-bg));
  border-color: var(--taken-edge);
  color: var(--taken-text);
  letter-spacing: .01em;
}
.seat.held {
  background: linear-gradient(180deg, #4a3717, #33260f);
  border-color: #8a6a2c;
  color: #f0cf8a;
}
.seat.mine {
  background: linear-gradient(180deg, var(--brass-hi), var(--brass-lo));
  border-color: var(--brass-hi);
  color: var(--on-brass);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 22px -4px rgba(255,194,87,.7);
}
.seat.selected {
  background: linear-gradient(180deg, #1d5a41, #12402e);
  border-color: var(--green);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.3), 0 0 0 2px rgba(52,211,153,.5), 0 8px 20px -6px var(--open-glow);
}

.theater.builder .seat { cursor: pointer; }
.theater.builder .seat:hover { transform: translateY(-3px) scale(1.1); border-color: rgba(255,255,255,.35); z-index: 4; }

/* Tooltip */
.seat .tip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #f4f5f8;
  color: #0b0d13;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.005em;
  white-space: nowrap;
  padding: .35rem .6rem;
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s, transform .16s var(--ease);
  z-index: 20;
  box-shadow: 0 6px 20px rgba(0,0,0,.55);
}
.seat .tip::after {
  content: '';
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #f4f5f8;
}
.seat:hover .tip, .seat:focus-visible .tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.legend {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  justify-content: center; margin-top: 1.75rem;
}
.legend span { display: inline-flex; align-items: center; gap: .5rem; color: var(--dim); font-size: .8rem; font-weight: 500; }
.legend i { width: 15px; height: 14px; border-radius: 5px 5px 2px 2px; border: 1px solid; flex: none; }
.l-open    { background: var(--open-bg);  border-color: var(--open-edge); }
.l-taken   { background: var(--taken-bg); border-color: var(--taken-edge); }
.l-held    { background: #33260f;         border-color: #8a6a2c; }
.l-outside { background: #171b25;         border-color: var(--edge); opacity: .45; }

/* ---------------------------------------------------------------- stats -- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--surface); padding: 1.1rem 1.25rem; }
.stat .k { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.stat .v { font-size: 1.7rem; font-weight: 650; letter-spacing: -.03em; margin-top: .15rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .v.brass { color: var(--brass); }
.stat .v.red   { color: var(--red); }
.stat .sub { font-size: .78rem; color: var(--faint); }

/* --------------------------------------------------------------- tables -- */

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.list th {
  text-align: left; font-size: .7rem; font-weight: 650; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
  padding: .75rem 1rem; border-bottom: 1px solid var(--edge); white-space: nowrap;
}
table.list td { padding: .8rem 1rem; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .15s; }
table.list tbody tr:hover { background: rgba(255,255,255,.026); }
.seat-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.6rem; padding: .2rem .5rem;
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid var(--edge-2); border-radius: 6px;
}

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  border-radius: 999px; padding: .18rem .6rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.green { background: rgba(52,211,153,.13);  color: var(--green); }
.pill.amber { background: rgba(251,191,36,.13);  color: var(--amber); }
.pill.red   { background: rgba(248,113,113,.13); color: var(--red); }
.pill.grey  { background: rgba(148,154,171,.12); color: var(--dim); }
.pill.bare::before { display: none; }

/* -------------------------------------------------------------- ticket -- */

.ticket {
  position: relative;
  max-width: 25rem;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ticket-top { padding: 1.9rem 1.75rem 1.5rem; text-align: center; }
.ticket-title { font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; letter-spacing: -.01em; }
.ticket-seat {
  font-family: var(--serif);
  font-size: 4.2rem;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--brass);
  margin: .5rem 0 .1rem;
}
.ticket-meta { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.1rem; }
.ticket-meta div { text-align: center; }
.ticket-meta .k { font-size: .64rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.ticket-meta .v { font-size: .88rem; font-weight: 600; margin-top: .1rem; }

/* Perforated tear line with punched notches on both edges. */
.perf { position: relative; height: 26px; }
.perf::before, .perf::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink);
  border: 1px solid var(--edge-2);
}
.perf::before { left: -14px; }
.perf::after  { right: -14px; }
.perf hr {
  position: absolute; top: 50%; left: 18px; right: 18px; margin: 0;
  border: 0; border-top: 2px dashed rgba(255,255,255,.16);
}

.ticket-bottom { padding: .5rem 1.75rem 1.9rem; text-align: center; }
.qr-frame {
  display: inline-block;
  background: #fff;
  padding: .85rem;
  border-radius: var(--r);
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  line-height: 0;
}
.qr-frame img { display: block; width: 216px; height: 216px; }

/* Signed-out organizers stay on /new and get a clear first step instead of
   being silently bounced back to the home page. */
.auth-gate-shell { padding-top: clamp(2rem, 8vh, 5.5rem); }
.auth-gate-card { position: relative; overflow: hidden; padding: clamp(1.5rem, 5vw, 2.5rem); }
.auth-gate-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--brass), #ffe0a8 58%, transparent);
}
.auth-gate-card h1 { margin-bottom: .65rem; }
.auth-gate-card > p { max-width: 34rem; margin-bottom: 1.65rem; }
.auth-gate-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .35rem; }
.auth-gate-toggle { border: 0; background: none; color: var(--brass-hi); font: inherit;
  font-size: .86rem; cursor: pointer; padding: .55rem 0; }
.auth-gate-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-gate-progress { display: flex; gap: .45rem; margin: 0 auto 1rem; max-width: 11rem; }
.auth-gate-progress span { flex: 1; height: 2px; background: var(--edge-2); }
.auth-gate-progress span.active { background: var(--brass); }
.auth-gate-note { text-align: center; margin-top: 1rem; }
.auth-google-wrap { margin-top: 1.4rem; }
.auth-google-mount { min-height: 44px; display: flex; justify-content: center; }
.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem;
  color: var(--faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--edge); flex: 1; }
.auth-legal { margin: 1rem 0 0; }

.legal-page { padding-top: 1rem; }
.legal-page .card { padding: clamp(1.5rem, 5vw, 2.5rem); }
.legal-page h1 { margin-bottom: .6rem; }
.legal-page h2 { margin: 2rem 0 .55rem; }
.legal-page ul { margin: .5rem 0 1rem; padding-left: 1.25rem; color: var(--dim); }
.legal-page li + li { margin-top: .35rem; }

/* ----------------------------------------------------- dashboard --- */

/* Three groups, each with its own heading, because "organizing" and "invited"
   are different kinds of thing to a person rather than one list with a flag. */
.dash-section + .dash-section { margin-top: 2.25rem; }
.dash-head { margin-bottom: .9rem; }
.dash-head h2 { margin: .3rem 0 0; font-size: 1.25rem; }

.row-link { font-weight: 600; color: var(--text); text-decoration: none; }
.row-link:hover { color: var(--brass); }

/* An invitation is a card, not a table row: it is the one thing on this page
   with something to do rather than something to read. */
.invite-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.invite {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--edge-2); border-radius: var(--r-sm);
  background: var(--surface-2); text-decoration: none; color: var(--text);
  transition: transform .18s var(--ease), border-color .18s, background .18s;
}
.invite:hover {
  transform: translateY(-2px);
  border-color: var(--brass);
  background: var(--surface-3);
}
.invite strong { font-size: 1rem; line-height: 1.3; }

.pill-tag {
  align-self: flex-start; margin-top: .5rem;
  padding: .28rem .7rem; border-radius: 999px;
  font-size: .74rem; font-weight: 650; letter-spacing: .02em;
  background: rgba(255, 194, 87, .14); color: var(--brass);
  border: 1px solid rgba(255, 194, 87, .32);
}
.pill-tag.quiet {
  background: none; color: var(--faint); border-color: var(--edge);
}

/* An inset card: a panel inside a panel, one step lighter. */
.card.inset {
  background: var(--surface-2); padding: .85rem 1rem; margin-top: 1rem;
  border-radius: var(--r-sm);
}
.bad-text { color: #ffb0a8; }

/* A checkbox that reads as a row, not as a stray control. The global
   `label { text-transform: uppercase }` would shout at it, so it opts out the
   way `.choice` does. */
.check {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .6rem .75rem; margin-bottom: 1rem;
  border: 1px solid var(--edge); border-radius: var(--r-sm);
  background: var(--surface-2);
  text-transform: none; letter-spacing: normal; font-size: .9rem;
  color: var(--text); font-weight: 500;
}
.check:hover { border-color: var(--edge-2); }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--brass); flex: 0 0 auto; }

/* -------------------------------------------------------------- modal --- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 5, 8, .78);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 25rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  animation: pop .28s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- toasts -- */

.toast-wrap { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast {
  background: #f4f5f8; color: #0b0d13;
  font-size: .88rem; font-weight: 600;
  padding: .6rem 1.1rem; border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  animation: pop .25s var(--ease);
}
.toast.bad { background: var(--red); color: #2b0808; }

/* -------------------------------------------------------------- states -- */

.msg { font-size: .87rem; margin-top: .75rem; min-height: 1.1rem; }
.msg.err { color: var(--red); }
.msg.ok  { color: var(--green); }

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty .icon { font-size: 2rem; opacity: .4; }
.empty h3 { margin: .5rem 0 .35rem; }

.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.copy-row { display: flex; gap: .6rem; }
.copy-row input { font-family: var(--mono); font-size: .86rem; }

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

/* ==========================================================================
   Cross-device hardening
   ========================================================================== */

/* Respect notches and home-bar insets. */
header.site { padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(1.5rem, env(safe-area-inset-right)); }
.container  { padding-left: max(1.5rem, env(safe-area-inset-left)); padding-right: max(1.5rem, env(safe-area-inset-right)); }
body { padding-bottom: env(safe-area-inset-bottom); }

/* Tooltips are hover-only affordances; on touch they stick and cover seats.
   The same text is on every seat's aria-label, so screen readers keep it. */
.seat .tip { display: none; }
@media (hover: hover) and (pointer: fine) {
  .seat .tip { display: block; }
}

/* The map scrolls sideways on narrow screens: say so, and fade the edge. */
.theater {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.theater.scrollable { position: relative; }
.theater.scrollable::after {
  content: 'scroll';
  position: sticky;
  right: 0;
  bottom: 0;
  float: right;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(7, 8, 11, .85);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: .15rem .5rem;
  pointer-events: none;
}

/* Row letters double as "select the whole row" in the builder. */
.row-label.tappable {
  font: inherit;
  font-size: .7rem;
  font-weight: 600;
  color: var(--faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: .2rem 0;
  transition: color .15s, background .15s, border-color .15s;
}
.row-label.tappable:hover { color: var(--brass); background: rgba(255,194,87,.1); border-color: rgba(255,194,87,.3); }
.row-label.tappable:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

/* "or" between the Google button and the development form. */
.or-rule {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1rem 0 .85rem;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.or-rule::before, .or-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--edge);
}

/* Fallback for browsers without :has(): JS mirrors the state onto a class. */
.choice.checked { border-color: var(--brass); background: rgba(255, 194, 87, .07); }
.choice.disabled { opacity: .5; cursor: not-allowed; }
.choice.disabled:hover { border-color: var(--edge-2); background: none; }

/* Kill the blue flash on tap, but keep real focus rings. */
a, button, .seat { -webkit-tap-highlight-color: transparent; }
button, .seat { touch-action: manipulation; }

/* Long words (emails, codes) must never widen the page. */
.copy-row input, td, p { overflow-wrap: break-word; }
table.list td { word-break: break-word; }

/* ---------------------------------------------------------------- phones -- */
@media (max-width: 820px) {
  /* iOS zooms the viewport when focusing any control under 16px. */
  input[type="text"], input[type="email"], input[type="password"], input[type="number"],
  input[type="datetime-local"], input[type="date"], input[type="time"],
  textarea, select { font-size: 16px; }

  /* Comfortable touch targets. */
  .btn { min-height: 44px; padding-top: .6rem; padding-bottom: .6rem; }
  .btn.sm { min-height: 36px; }

  body { font-size: 15px; }
  .container { padding-bottom: 4rem; }
  header.site { padding-top: 1rem; padding-bottom: 1rem; }

  h1 { font-size: 1.6rem; }
  .display { font-size: clamp(2rem, 9vw, 2.9rem); }

  .card { padding: 1.25rem; border-radius: 16px; }
  .card-head { padding: 1rem 1.15rem; }

  .theater { padding: 1.75rem .75rem 1.5rem; border-radius: 16px; }
  .screen { height: 34px; }
  .screen-label { margin-bottom: 1.5rem; letter-spacing: .4em; }
  .seat { width: 34px; height: 32px; }
  .seat-slot.gap { margin-left: 16px; }
  .seat-row, .seat-rows { gap: 7px; }

  .legend { gap: .9rem; }
  .stat { padding: .9rem 1rem; }
  .stat .v { font-size: 1.4rem; }

  .ticket-seat { font-size: 3.4rem; }
  .qr-frame img { width: min(62vw, 216px); height: auto; }

  /* Compact shared grids on phone screens. */
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .override-grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
}

@media (max-width: 460px) {
  .grid-3 { grid-template-columns: 1fr; }
  .modal { padding: 1.25rem; }
  .btn-row .btn { flex: 1 1 auto; }
  .ticket-meta { gap: 1rem; }
}

/* Very short landscape windows (phone on its side): don't center-lock modals. */
@media (max-height: 520px) {
  .modal-backdrop { align-items: flex-start; overflow-y: auto; }
}

/* ----------------------------------------------------------------- print -- */
@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  header.site nav, .btn, .toast-wrap { display: none !important; }
  .ticket { border: 1px solid #999; box-shadow: none; background: #fff; }
  .ticket-title, .ticket-meta .v { color: #000; }
  .ticket-seat { color: #000; }
  .ticket-meta .k, .eyebrow, .dim, .faint, .small { color: #444 !important; }
  .qr-frame { box-shadow: none; border: 1px solid #ddd; }
  .perf::before, .perf::after { background: #fff; }
}

/* Windows high-contrast / forced-colors mode. */
@media (forced-colors: active) {
  .seat { border: 1px solid ButtonBorder; }
  .seat.open { border: 2px solid Highlight; }
  .btn { border: 1px solid ButtonBorder; }
}
