/*
 * Conference App: the programme as wayfinding signage.
 * Big Shoulders (Chicago's wayfinding face) for event names, times and headings; Schibsted Grotesk for everything else.
 * The app is a neutral stage; each event brings its own colour through --brand (set inline by brand_style()).
 * Light is :root, dark overrides under [data-theme="dark"].
 */
:root {
    --ink: #121829;
    --ink-2: #1B2338;
    --ink-text: #EEF1F7;
    --ink-muted: rgba(238, 241, 247, 0.62);
    --paper: #F3F5F8;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --line: #DFE3EA;
    --line-strong: #C8CEDA;
    --text: #151A26;
    --text-2: #3A4254;
    --muted: #5C6475;
    --faint: #8A92A3;
    --live: #E5484D;
    --ok: #12805C;
    --ok-soft: #E3F4EC;
    --warn-soft: #FFF3D6;
    --danger: #C4302B;
    --danger-soft: #FCE8E7;
    --brand: #2B3FD6;
    --brand-on: #FFFFFF;
    --brand-rgb: 43, 63, 214;
    --brand-soft: rgba(var(--brand-rgb), 0.10);
    --focus: 0 0 0 3px rgba(var(--brand-rgb), 0.35);
    --r-lg: 18px;
    --r: 12px;
    --r-sm: 8px;
    --shadow-1: 0 1px 2px rgba(18, 24, 41, 0.06);
    --shadow-2: 0 12px 32px -12px rgba(18, 24, 41, 0.22);
    --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    --tabbar-h: 0px;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --paper: #0F1422;
    --surface: #171D2E;
    --surface-2: #1C2336;
    --line: rgba(238, 241, 247, 0.10);
    --line-strong: rgba(238, 241, 247, 0.20);
    --text: #EEF1F7;
    --text-2: #C9CFDB;
    --muted: #9AA3B5;
    --faint: #6E778A;
    --ok: #4CC79A;
    --ok-soft: rgba(18, 128, 92, 0.22);
    --warn-soft: rgba(202, 138, 4, 0.18);
    --danger: #FF7A73;
    --danger-soft: rgba(196, 48, 43, 0.20);
    --brand-soft: rgba(var(--brand-rgb), 0.22);
    --shadow-1: none;
    --shadow-2: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 132px; }
body { margin: 0; font: 400 16px/1.55 var(--font); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; padding-bottom: var(--tabbar-h); }
h1, h2, h3 { margin: 0; color: var(--text); text-wrap: balance; }
h1, .display { font-family: var(--display); font-weight: 800; letter-spacing: 0.005em; line-height: 0.95; }
h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: 0.01em; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 12px; }
a { color: inherit; }
img { max-width: 100%; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.hint { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.main { max-width: var(--wrap); margin: 0 auto; padding: 32px var(--gutter) 80px; }
.main-wide { max-width: none; padding: 0 0 80px; }

/* ---------- App bar, account menu, tab bar ---------- */
.appbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: var(--ink-text); }
.appbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: 0.01em; }
.brand img { border-radius: 7px; }
.appnav { display: flex; gap: 4px; flex: 1; }
.appnav a { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-muted); transition: color .15s, background .15s; }
.appnav a:hover { color: var(--ink-text); background: rgba(255, 255, 255, 0.07); }
.appnav a[aria-current] { color: var(--ink-text); background: rgba(255, 255, 255, 0.12); }
.account { position: relative; margin-left: auto; }
.account summary { list-style: none; cursor: pointer; border-radius: 999px; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-text); color: var(--ink); font-weight: 700; font-size: 13.5px; letter-spacing: 0.02em; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 260px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 8px; }
.account-who { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 12px; margin: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.account-who span { color: var(--muted); overflow-wrap: anywhere; }
.account-who .role-pill { align-self: flex-start; margin-top: 6px; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-decoration: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); }
.role-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark"] .role-pill { color: var(--text); }
.tabbar { display: none; }

.toast { position: fixed; z-index: 60; left: 50%; top: 78px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--ink-text); padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-2); font-size: 15px; font-weight: 500; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2), toast-out .4s ease 4.6s forwards; }
:root[data-theme="dark"] .toast { background: var(--ink-text); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -12px); visibility: hidden; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; background: var(--text); color: var(--paper); font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .12s, background .15s, border-color .15s; }
.btn:hover { background: var(--text-2); }
.btn:active { transform: scale(0.98); }
.btn-brand { background: var(--brand); color: var(--brand-on); }
.btn-brand:hover { background: var(--brand); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.link { color: var(--brand); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
:root[data-theme="dark"] .link { color: color-mix(in srgb, var(--brand) 55%, white); }

/* ---------- Page heads, panels, notices ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { margin: 10px 0 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--text); }
.crumb .icon { transform: rotate(180deg); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 26px; }
.error { display: flex; gap: 10px; background: var(--danger-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); padding: 12px 16px; border-radius: var(--r); margin-bottom: 20px; font-weight: 500; }
.empty { text-align: center; padding: 56px 24px; }
.empty .display { font-size: 40px; margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.pill-public { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-private { background: var(--warn-soft); color: #8A5A00; border-color: transparent; }
:root[data-theme="dark"] .pill-private { color: #F5C451; }
.pill-live { background: var(--live); color: #fff; border-color: transparent; }
.pill-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---------- Forms: two-column settings sections ---------- */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.settings-section { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 16px 48px; padding: 28px; }
.settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-section > header h2 { font-family: var(--font); font-size: 17px; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.settings-section > header p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.settings-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); position: sticky; bottom: var(--tabbar-h); }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > legend, .field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; padding: 0; color: var(--text); }
.opt { font-weight: 400; color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=date], input[type=url], input[type=search], textarea, select {
    width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; margin: 10px 0 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choices > .choice { margin: 0; font-size: inherit; font-weight: 400; }
.choice, .choices > .choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 16px 48px; border: 1.5px solid var(--line-strong); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.choice input { position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.choice strong { font-size: 15.5px; }
.choice span { font-size: 14px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }

/* File picker as a drop zone, with a preview of the current picture */
.drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop:has(input:focus-visible) { box-shadow: var(--focus); }
.drop-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.drop strong { display: block; font-size: 15px; }
.drop span { font-size: 13.5px; color: var(--muted); }
.banner-preview { aspect-ratio: 16 / 5; border-radius: var(--r); background: center / cover no-repeat var(--surface-2); border: 1px solid var(--line); margin-bottom: 10px; }

/* Brand colour */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { position: relative; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span { position: absolute; inset: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); transition: transform .12s; }
.swatch:has(input:checked) span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.swatch:has(input:focus-visible) span { transform: scale(1.1); }
.swatch-custom { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-left: 4px; }
.swatch-custom input[type=color] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: none; cursor: pointer; }
.swatch-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 3px; }
.swatch-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.brand-preview { margin-top: 14px; height: 64px; border-radius: var(--r); background: var(--brand); color: var(--brand-on); display: flex; align-items: center; padding: 0 18px; font-family: var(--display); font-weight: 800; font-size: 26px; overflow: hidden; white-space: nowrap; }

/* Extra columns on a session */
.columns { display: grid; gap: 12px; margin-bottom: 12px; }
.column-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.column-row input { font-weight: 600; }
.column-row textarea { grid-column: 1 / -1; min-height: 80px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Auth (login, register) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr); }
.auth-side { position: relative; overflow: hidden; background: var(--ink); color: var(--ink-text); padding: 48px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-side::before { content: ''; position: absolute; inset: 0; opacity: 0.5;
    background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 30% 70%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 70%, #000 20%, transparent 75%); }
.auth-side > * { position: relative; }
.auth-side .brand { color: var(--ink-text); }
.auth-board { display: grid; gap: 10px; max-width: 460px; }
.auth-board-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.auth-board-row b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.auth-board-row span { display: flex; flex-direction: column; font-size: 15px; font-weight: 600; }
.auth-board-row small { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.auth-board-row.is-now { background: #2B3FD6; border-color: transparent; }
.auth-board-row.is-now small { color: rgba(255, 255, 255, 0.8); }
.auth-side h1 { color: var(--ink-text); font-size: clamp(48px, 6vw, 84px); max-width: 10ch; }
.auth-lead { color: var(--ink-muted); font-size: 18px; max-width: 38ch; margin-top: 16px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--surface); }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 44px; margin-bottom: 8px; }
.auth-form > p { color: var(--muted); margin-bottom: 28px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 22px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: 9px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(18, 24, 41, 0.15); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.auth-alt { margin-top: 24px; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- Admin: events table ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--muted); }
.subhead { font-size: 26px; margin: 36px 0 14px; }
.subhead:first-of-type { margin-top: 0; }
.ev-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.ev-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ev-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
.ev-table tr:last-child td { border-bottom: 0; }
.ev-table tbody tr { transition: background .12s; }
.ev-table tbody tr:hover { background: var(--surface-2); }
.ev-name { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.ev-thumb { width: 64px; height: 44px; border-radius: 8px; flex: none; background: var(--brand) center / cover no-repeat; }
.ev-name strong { display: block; font-size: 16px; }
.ev-name span { font-size: 14px; color: var(--muted); }
.ev-num { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }
.ev-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ev-status { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 14px; }
.ev-status small { color: var(--muted); }

/* ---------- Attendee: passes ---------- */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.pass { position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); transition: transform .18s, box-shadow .18s; }
a.pass:hover { transform: translateY(-3px); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.pass-top { position: relative; height: 150px; background: var(--brand) center / cover no-repeat; color: var(--brand-on); padding: 16px; display: flex; align-items: flex-start; justify-content: space-between; }
.pass-top::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--brand-rgb), 0) 30%, rgba(var(--brand-rgb), 0.85)); }
.pass-top > * { position: relative; z-index: 1; }
.pass-top .pill { background: rgba(255, 255, 255, 0.92); color: #151A26; border: 0; }
.pass-top .pill-live { background: var(--live); color: #fff; }
.pass-body { position: relative; padding: 20px 20px 22px; display: grid; gap: 10px; }
.pass-body::before, .pass-body::after { content: ''; position: absolute; top: -12px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); }
.pass-body::before { left: -12px; }
.pass-body::after { right: -12px; }
.pass-body h3 { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 0.95; }
.pass-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.pass-place { display: flex; gap: 6px; align-items: center; font-size: 14.5px; color: var(--muted); min-width: 0; }
.pass-date { text-align: right; flex: none; }
.pass-date b { display: block; font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 0.95; color: var(--brand); white-space: nowrap; }
:root[data-theme="dark"] .pass-date b { color: color-mix(in srgb, var(--brand) 55%, white); }
.pass-date span { font-size: 13px; font-weight: 600; color: var(--muted); }
.pass-grid.is-past .pass { filter: saturate(0.3); opacity: 0.8; }

/* ---------- Event: hero, section bar ---------- */
.hero { position: relative; color: #fff; background: var(--ink) center / cover no-repeat; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(100deg, rgba(var(--brand-rgb), 0.96) 0%, rgba(var(--brand-rgb), 0.82) 38%, rgba(var(--brand-rgb), 0.25) 75%, rgba(var(--brand-rgb), 0.1) 100%); }
.hero.no-banner { background: rgb(var(--brand-rgb)); }
.hero.no-banner::before { background: radial-gradient(120% 140% at 85% 0%, rgba(255, 255, 255, 0.16), transparent 50%), linear-gradient(110deg, transparent 40%, rgba(0, 0, 0, 0.28)); }
.hero-inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(32px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 40px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-tags .pill { background: rgba(255, 255, 255, 0.16); color: #fff; border: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero-tags .pill-live { background: var(--live); }
.hero h1 { color: #fff; font-size: clamp(52px, 9vw, 120px); max-width: 14ch; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.18); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px; font-size: 17px; font-weight: 500; }
.hero-meta span { display: flex; align-items: center; gap: 8px; }
@media (min-width: 761px) { .hero-when { display: none !important; } }
.hero-date { text-align: right; padding: 18px 22px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); }
.hero-date b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6vw, 72px); line-height: 0.9; white-space: nowrap; }
.hero-date span { font-size: 15px; font-weight: 600; opacity: 0.9; }

.secbar { position: sticky; top: 64px; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.secbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.secbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.secbar nav::-webkit-scrollbar { display: none; }
.secbar nav a { position: relative; padding: 18px 14px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--muted); white-space: nowrap; }
.secbar nav a:hover { color: var(--text); }
.secbar nav a.is-active { color: var(--text); }
.secbar nav a.is-active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.secbar-actions { display: flex; gap: 8px; flex: none; }
.admin-menu { position: relative; }
.admin-menu summary { list-style: none; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu-list { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 6px; z-index: 5; }
.admin-menu-list a, .admin-menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-decoration: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.admin-menu-list a:hover, .admin-menu-list button:hover { background: var(--surface-2); }
.admin-menu-list form { margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
.admin-menu-list .danger { color: var(--danger); }

.event-body { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.block { padding: 56px 0 0; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.block-head h2 { font-size: clamp(38px, 5vw, 56px); }
.about { font-size: 18px; line-height: 1.65; color: var(--text-2); max-width: 68ch; }
.about a { color: var(--brand); }

/* ---------- Programme: day tabs and the time rail ---------- */
.days { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; padding: 2px; }
.days::-webkit-scrollbar { display: none; }
.day-tab { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: var(--r); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-align: left; flex: none; transition: border-color .15s, background .15s; }
.day-tab b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; min-width: 1.4em; text-align: center; }
.day-tab span { display: flex; flex-direction: column; font-size: 13.5px; line-height: 1.25; color: var(--muted); }
.day-tab span strong { color: var(--text); font-size: 15px; }
.day-tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.day-tab[aria-selected="true"] span, .day-tab[aria-selected="true"] span strong { color: var(--brand-on); }
.day-tab:hover:not([aria-selected="true"]) { border-color: var(--faint); }

.rail { list-style: none; margin: 0; padding: 0; }
.slot { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 0 28px; }
.slot + .slot .slot-card { border-top: 1px solid var(--line); }
.slot-time { padding: 26px 0; text-align: right; font-variant-numeric: tabular-nums; }
.slot-time b { display: block; font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 0.85; letter-spacing: -0.005em; }
.slot-time small { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: normal; }
.slot-time small + small { margin-top: 2px; font-weight: 500; }
.slot-card { position: relative; display: block; padding: 24px 52px 24px 26px; text-decoration: none; border-left: 2px solid var(--line); transition: background .15s; }
.slot-card::before { content: ''; position: absolute; left: -7px; top: 34px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong); }
.slot-card::after { content: ''; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--faint); border-top: 2px solid var(--faint); transform: translateY(-50%) rotate(45deg); transition: transform .15s; }
.slot-card:hover { background: var(--surface); }
.slot-card:hover::after { transform: translate(3px, -50%) rotate(45deg); }
.slot-card h3 { font-size: 21px; font-weight: 700; line-height: 1.25; margin: 0 0 10px; }
.slot-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; color: var(--muted); }
.speaker-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.speaker-chip i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-style: normal; font-weight: 700; font-size: 11px; }
:root[data-theme="dark"] .speaker-chip i { color: var(--text); }
.room { display: inline-flex; align-items: center; gap: 7px; }
.room::before { content: ''; width: 9px; height: 9px; border-radius: 2px; background: var(--text-2); }
.labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.label { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.tone-0 { background: #E5EAFF; color: #2B3FB8; } .tone-1 { background: #DDF3E9; color: #0E6B4D; } .tone-2 { background: #FFF0CC; color: #7A5300; }
.tone-3 { background: #FDE4E3; color: #A3261F; } .tone-4 { background: #EFE5FF; color: #5B2DB8; } .tone-5 { background: #DDF2F6; color: #0B6273; }
:root[data-theme="dark"] .tone-0 { background: rgba(91, 112, 255, .22); color: #B9C3FF; } :root[data-theme="dark"] .tone-1 { background: rgba(18, 128, 92, .25); color: #8FE0BF; }
:root[data-theme="dark"] .tone-2 { background: rgba(202, 138, 4, .22); color: #F5CF74; } :root[data-theme="dark"] .tone-3 { background: rgba(229, 72, 77, .22); color: #FFADAA; }
:root[data-theme="dark"] .tone-4 { background: rgba(124, 77, 255, .24); color: #CDB8FF; } :root[data-theme="dark"] .tone-5 { background: rgba(14, 138, 160, .24); color: #94DDEA; }

/* Live and finished sessions (set by app.js from the browser's clock) */
.slot-live { display: none; }
.slot.is-live .slot-time b { color: var(--live); }
.slot.is-live .slot-card { border-left-color: var(--live); background: color-mix(in srgb, var(--live) 6%, var(--surface)); border-radius: 0 var(--r) var(--r) 0; }
.slot.is-live .slot-card::before { background: var(--live); border-color: var(--live); animation: beacon 2s ease-out infinite; }
.slot.is-live .slot-live { display: inline-flex; margin-bottom: 10px; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.slot.is-past { opacity: 0.55; }
.slot.is-past:hover { opacity: 1; }
.rail-empty { padding: 28px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); text-align: center; }

/* ---------- Venue ---------- */
.venue { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.venue-info { padding: 32px; display: flex; flex-direction: column; gap: 10px; }
.venue-info .display { font-size: 42px; }
.venue-info address { font-style: normal; color: var(--muted); font-size: 16.5px; }
.venue-info .btn { align-self: flex-start; margin-top: auto; }
.venue-map { min-height: 340px; background: var(--surface-2); }
.venue-map iframe { display: block; width: 100%; height: 100%; min-height: 340px; border: 0; }

/* ---------- Sponsors ---------- */
.tier + .tier { margin-top: 32px; }
.tier h3 { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.tier h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tier.is-lead .tier-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sponsor { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 20px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); text-decoration: none; color: #151A26; text-align: center; transition: border-color .15s, transform .15s; }
.tier.is-lead .sponsor { min-height: 170px; }
a.sponsor:hover { border-color: var(--brand); transform: translateY(-2px); }
.sponsor-logo { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; }
.tier.is-lead .sponsor-logo { height: 96px; }
.sponsor-logo img { max-width: 78%; max-height: 100%; object-fit: contain; }
.sponsor-name { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tier.is-lead .sponsor-name { font-size: 15.5px; }
.sponsor-mono { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: #EEF1F7; color: #3A4254; font-family: var(--display); font-weight: 800; font-size: 24px; }

/* ---------- Session page ---------- */
.session-hero { padding: 8px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.session-hero h1 { font-size: clamp(44px, 7vw, 80px); max-width: 18ch; }
.session-hero .labels { margin: 0 0 18px; }
.session-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.session-head .ev-actions form { margin: 0; }
.session-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 28px 0 0; }
.fact { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.fact .icon { color: var(--brand); margin-top: 2px; }
:root[data-theme="dark"] .fact .icon { color: color-mix(in srgb, var(--brand) 55%, white); }
.fact dt { font-size: 13.5px; color: var(--muted); }
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: 16px; }
.session-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.prose { font-size: 17.5px; line-height: 1.7; color: var(--text-2); max-width: 68ch; overflow-wrap: anywhere; }
.prose a { color: var(--brand); }
.extra + .extra, .prose + .extra { margin-top: 32px; }
.extra h2 { font-family: var(--font); font-size: 19px; font-weight: 700; letter-spacing: 0; margin-bottom: 8px; }
.side-title { font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-bottom: 12px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .15s; }
.file:hover { border-color: var(--brand); }
.file-kind { width: 42px; height: 48px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; flex: none; }
:root[data-theme="dark"] .file-kind { color: var(--text); }
.file-name { flex: 1; min-width: 0; }
.file-name strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name span { font-size: 13px; color: var(--muted); }
.file > .icon { color: var(--muted); }
.file-edit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: var(--surface); }
.file-edit .file-name a { font-weight: 600; text-decoration: none; }
.file-edit .check { margin: 0; font-size: 14px; color: var(--danger); }

/* ---------- Access: the QR poster ---------- */
.access-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.poster { background: var(--brand); color: var(--brand-on); border-radius: var(--r-lg); padding: 28px; text-align: center; box-shadow: var(--shadow-2); }
.poster h2 { font-size: 40px; line-height: 0.95; color: inherit; margin-bottom: 6px; }
.poster p { margin: 0 0 20px; opacity: 0.85; font-weight: 500; }
.poster .qr { background: #fff; border-radius: 16px; padding: 14px; width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 1; }
.poster .qr svg { width: 100%; height: 100%; display: block; }
.poster-foot { margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: 22px; }
.poster-off { padding: 40px 10px; font-weight: 600; }
.poster-tools { display: grid; gap: 10px; margin-top: 14px; }
.poster-tools .row { display: flex; gap: 8px; flex-wrap: wrap; }
.poster-tools .row > * { flex: 1; }
.poster-tools form { margin: 0; display: flex; }
.poster-tools form .btn { flex: 1; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 14.5px; background: var(--surface-2); }
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; }
.person .avatar { background: var(--brand-soft); color: var(--brand); flex: none; }
:root[data-theme="dark"] .person .avatar { color: var(--text); }
.person-main { flex: 1; min-width: 160px; }
.person-main strong { display: block; font-size: 15.5px; overflow-wrap: anywhere; }
.person-main span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.person form { margin: 0; }
.person-actions { display: flex; gap: 6px; }
.count { font-family: var(--display); font-weight: 800; color: var(--muted); margin-left: 4px; }
.invite-form { display: grid; gap: 10px; margin-bottom: 8px; }
.invite-form .btn { justify-self: start; }

/* Sponsors admin */
.sp-list { display: grid; gap: 10px; margin-bottom: 28px; }
.sp-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.sp-row summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; }
.sp-row summary::-webkit-details-marker { display: none; }
.sp-logo { width: 72px; height: 48px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.sp-logo img { max-width: 86%; max-height: 80%; object-fit: contain; }
.sp-logo b { font-family: var(--display); font-size: 20px; color: #3A4254; }
.sp-row-main { flex: 1; min-width: 0; }
.sp-row-main strong { display: block; }
.sp-row-main span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.sp-row[open] summary { border-bottom: 1px solid var(--line); }
.sp-row-edit { padding: 20px 16px; }
.sp-row-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.sp-row-foot form { margin: 0; }

/* ---------- Join (claim a pass) and scan ---------- */
.claim { max-width: 460px; margin: 16px auto 0; }
.claim-lead { text-align: center; color: var(--muted); margin-bottom: 16px; font-weight: 500; font-size: 17px; }
.claim .pass { box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
.claim .pass-top { height: 190px; }
.claim-cta { padding: 0 20px 22px; display: grid; gap: 10px; }
.claim-cta form { display: grid; gap: 10px; margin: 0; }
.scanner { max-width: 520px; margin: 0 auto; text-align: center; }
.scanner h1 { margin-bottom: 8px; }
.scanner > p { color: var(--muted); margin-bottom: 24px; }
.viewfinder { position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #222B44, #0B0F1A); display: grid; place-items: center; margin-bottom: 20px; box-shadow: var(--shadow-2); }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vf-frame { position: absolute; inset: 17%; border-radius: 22px; box-shadow: 0 0 0 999px rgba(8, 11, 20, 0.45);
    background: linear-gradient(#fff, #fff) top left / 34px 4px, linear-gradient(#fff, #fff) top left / 4px 34px,
        linear-gradient(#fff, #fff) top right / 34px 4px, linear-gradient(#fff, #fff) top right / 4px 34px,
        linear-gradient(#fff, #fff) bottom left / 34px 4px, linear-gradient(#fff, #fff) bottom left / 4px 34px,
        linear-gradient(#fff, #fff) bottom right / 34px 4px, linear-gradient(#fff, #fff) bottom right / 4px 34px;
    background-repeat: no-repeat; }
.viewfinder.is-on .vf-frame::after { content: ''; position: absolute; left: 8%; right: 8%; height: 2px; background: #fff; box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.7); animation: sweep 2.2s ease-in-out infinite alternate; }
@keyframes sweep { from { top: 10%; } to { top: 90%; } }
.vf-idle { position: relative; z-index: 1; color: var(--ink-text); display: grid; gap: 14px; justify-items: center; padding: 24px; }
.viewfinder.is-on .vf-idle { display: none; }
.scan-status { font-size: 16px; font-weight: 500; color: var(--text-2); min-height: 1.5em; margin-bottom: 18px; }
.scan-alt { margin-top: 28px; text-align: left; }
.scan-alt summary { cursor: pointer; font-weight: 600; color: var(--muted); text-align: center; }
.scan-alt form { margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .access-grid, .session-grid { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .venue { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    :root { --tabbar-h: 72px; }
    html { scroll-padding-top: 120px; }
    .appbar-inner { height: 56px; }
    .appnav { display: none; }
    .tabbar { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 8px 12px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
    .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
    .tabbar a[aria-current] { color: var(--text); }
    .tabbar a[aria-current] .icon { color: var(--brand); }
    .secbar { top: 56px; }
    .secbar-actions .btn span { display: none; }
    .toast { top: auto; bottom: calc(var(--tabbar-h) + 14px); }
    .main { padding-top: 24px; }
    .main.main-wide { padding-top: 0; }
    .hero-date { display: none; }
    .settings-section { grid-template-columns: 1fr; padding: 20px; gap: 14px; }
    .settings-actions { padding: 14px 20px; }
    .field-row, .choices { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { padding: 28px 24px 32px; gap: 28px; }
    .auth-side h1 { font-size: 52px; }
    .auth-board { display: none; }
    .hero-inner { grid-template-columns: 1fr; }
    .slot { grid-template-columns: 74px minmax(0, 1fr); gap: 0 14px; }
    .slot-time { padding: 22px 0; }
    .slot-time b { font-size: 34px; }
    .slot-card { padding: 20px 34px 20px 18px; }
    .slot-card h3 { font-size: 18px; }
    .slot-card::after { right: 12px; }
    .ev-table thead { display: none; }
    .ev-table, .ev-table tbody, .ev-table tr, .ev-table td { display: block; }
    .ev-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .ev-table tr:last-child { border-bottom: 0; }
    .ev-table td { padding: 4px 0; border: 0; }
    .ev-table td[data-label] { display: inline-block; margin-right: 18px; }
    .ev-table td[data-label]::before { content: attr(data-label) ' '; color: var(--muted); font-size: 13px; }
    .ev-table .ev-num { font-size: 18px; }
    .ev-actions { justify-content: flex-start; margin-top: 8px; }
    .pass-grid { grid-template-columns: 1fr; }
    .pass-date b { font-size: 26px; }
    .stat b { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
    .appbar, .tabbar, .page-head, .poster-tools, .access-side, .crumb, .toast { display: none !important; }
    .access-grid { display: block; }
    .poster { box-shadow: none; max-width: 520px; margin: 40px auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Photos: the account avatar, Settings → Photo and the crop window ---------- */
.avatar.has-photo { overflow: hidden; background: var(--surface-2); padding: 0; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.static-value { margin: 0; font-size: 16px; padding: 2px 0; overflow-wrap: anywhere; }
.section-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.hint-error { color: var(--danger); }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; min-width: 0; }
.inline-input .btn { height: auto; }

.photo-edit { display: flex; align-items: center; gap: 28px; }
.photo-big { flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--brand-soft); color: var(--brand); font-family: var(--display); font-weight: 800; font-size: 46px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
:root[data-theme="dark"] .photo-big { color: var(--text); }
.photo-big img { width: 100%; height: 100%; object-fit: cover; }
.photo-big.is-saving img { opacity: .55; transition: opacity .2s; }
.photo-controls { min-width: 0; flex: 1; }
.photo-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-pick { position: relative; overflow: hidden; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.photo-pick:has(input:focus-visible) { box-shadow: var(--focus); }
.photo-link { margin-top: 16px; }

html.crop-lock { overflow: hidden; }
.crop-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 14, 26, 0.66); backdrop-filter: blur(4px); }
.crop-overlay.open { display: flex; animation: crop-in .18s ease-out; }
@keyframes crop-in { from { opacity: 0; } }
.crop-modal { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.crop-head { padding: 20px 22px 14px; }
.crop-head h2 { font-size: 28px; }
.crop-head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.crop-stage { height: min(400px, 60dvh); background: #0B0F1A; }
.crop-stage img { display: block; max-width: 100%; }
.crop-overlay .cropper-view-box { outline: 2px solid rgba(255, 255, 255, 0.9); outline-offset: -1px; }
.crop-overlay.crop-round .cropper-view-box, .crop-overlay.crop-round .cropper-face { border-radius: 50%; }
.crop-overlay .cropper-modal { background: #0B0F1A; opacity: .62; }
.crop-tools { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.crop-tools .icon-btn { color: var(--text-2); }
.crop-tools .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.crop-zoom { flex: 1; min-width: 60px; accent-color: var(--brand); }
.crop-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.crop-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 16px; }

@media (max-width: 760px) {
    .photo-edit { flex-direction: column; align-items: flex-start; gap: 18px; }
    .photo-big { width: 104px; height: 104px; font-size: 38px; }
    .crop-overlay { padding: 0; align-items: flex-end; }
    .crop-modal { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 100dvh; }
    .crop-tools { gap: 2px; padding: 10px 12px; }
    .crop-sep { margin: 0 2px; }
    .crop-actions .btn { flex: 1; }
}
.env-key { margin-left: 6px; font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; vertical-align: 1px; }

/* ---------- App settings: tabs, People list, a person's page ---------- */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: -8px 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.seg-tabs a:hover { color: var(--text); }
.seg-tabs a[aria-current] { background: var(--text); color: var(--paper); }
.people-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip-tabs a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
.chip-tabs a span { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--faint); }
.chip-tabs a:hover { border-color: var(--faint); }
.chip-tabs a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.chip-tabs a[aria-current] span { color: var(--brand-on); opacity: .8; }
.people-search input { width: 260px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 15px; }
.user-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.user-list li + li { border-top: 1px solid var(--line); }
.user-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; color: var(--text); transition: background .12s; }
.user-row:hover { background: var(--surface-2); }
.user-row .avatar { flex: none; width: 40px; height: 40px; background: var(--brand-soft); color: var(--brand); }
.user-row > .icon { color: var(--faint); flex: none; }
.user-row.is-inactive .user-main, .user-row.is-inactive .avatar { opacity: .55; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-main strong { font-size: 15.5px; overflow-wrap: anywhere; }
.user-main > span { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.user-events { font-size: 13.5px; color: var(--muted); min-width: 64px; text-align: right; }
.you { font-weight: 500; color: var(--faint); }
.pill-admin { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
:root[data-theme="dark"] .pill-admin { color: var(--text); }
.pill.pill-super, :root[data-theme="dark"] .pill.pill-super { background: var(--text); color: var(--paper); border-color: transparent; }
.pill-off { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.btn.is-disabled { pointer-events: none; opacity: .45; }
.user-hero { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.user-hero h1 { font-size: clamp(40px, 6vw, 60px); }
.user-hero p { margin: 4px 0 10px; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.user-hero-pills { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.event-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
fieldset[disabled] .choice { cursor: not-allowed; opacity: .6; }

@media (max-width: 760px) {
    .people-search, .people-search input { width: 100%; }
    .people-tools .btn { width: 100%; }
    .user-row { padding: 12px 14px; gap: 12px; }
    .user-events, .user-row > .icon { display: none; }
    .user-meta { flex-direction: column; align-items: flex-end; gap: 4px; }
    .user-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ---------- Google sign-in button, API key steps ---------- */
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 52px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: #1F2430; font: 600 16px/1 var(--font); text-decoration: none; transition: background .15s, box-shadow .15s; }
.btn-google:hover { background: #F7F8FA; box-shadow: var(--shadow-1); }
.btn-google:focus-visible { outline: none; box-shadow: var(--focus); }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--faint); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.remove-key { margin-top: 12px; }
.howto { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.howto summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 15px; }
.howto ol { margin: 0; padding: 0 18px 4px 40px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.howto li { margin-bottom: 10px; }
.howto code { font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; overflow-wrap: anywhere; }
.howto .hint { margin: 0; padding: 0 18px 16px; }

/* ---------- Formatted text: what attendees read, and the editor toolbar ---------- */
.prose p, .about p { margin: 0 0 .9em; }
.prose > :last-child, .about > :last-child { margin-bottom: 0; }
.prose ul, .prose ol, .about ul, .about ol { margin: 0 0 .9em; padding-left: 1.4em; }
.prose li, .about li { margin-bottom: .3em; }
.prose h3, .about h3 { font: 700 1.05em/1.4 var(--font); letter-spacing: 0; color: var(--text); margin: 1.2em 0 .4em; }
.prose > h3:first-child, .about > h3:first-child { margin-top: 0; }
.prose strong, .about strong { color: var(--text); font-weight: 650; }
.rich { min-width: 0; }
.rich-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: var(--surface-2); }
.rich-bar button { display: inline-grid; place-items: center; min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; font: 600 13.5px/1 var(--font); }
.rich-bar button:hover:not(:disabled) { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.rich-bar button:focus-visible { outline: none; box-shadow: var(--focus); }
.rich-bar button:disabled { opacity: .35; cursor: default; }
.rich-gap { flex: 1; }
.rich-bar .rich-preview-btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-on); }
.rich textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.rich-preview { min-height: 112px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 0 0 var(--r-sm) var(--r-sm); background: var(--surface); }
.rich-preview[hidden] { display: none; }
.column-row .rich { grid-column: 1 / -1; }
:root[data-theme="dark"] .user-row .avatar, :root[data-theme="dark"] .person .avatar { color: var(--text); }

/* ---------- Attendees page ---------- */
.attendee-search { margin: -8px 0 16px; }
.attendee-search input { width: min(360px, 100%); }
.attendee-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.attendee-row .avatar { flex: none; width: 40px; height: 40px; background: var(--brand-soft); color: var(--brand); }
:root[data-theme="dark"] .attendee-row .avatar { color: var(--text); }
.attendee-row form { margin: 0; flex: none; }
.attendee-meta { display: flex; align-items: center; gap: 12px; flex: none; text-align: right; }
.attendee-how { display: flex; flex-direction: column; font-size: 13.5px; color: var(--text-2); }
.attendee-how small { color: var(--muted); font-size: 13px; }
.attendee-note { margin-top: 14px; }
.people-more { margin: 10px 0 0; font-size: 14px; }
@media (max-width: 760px) {
    .attendee-row { flex-wrap: wrap; padding: 12px 14px; }
    .attendee-meta { order: 3; flex: 1 0 100%; justify-content: space-between; text-align: left; padding-left: 54px; }
}
