/* Amoras: one stylesheet, no build step. The colours below are the defaults:
   /admin/style can override them through /theme.css, so new rules take their
   colours from these variables (color-mix() for tints) instead of hex codes.
   Palette "complementary":
   #000080 navy (main), #00165a dark navy, #bfcfff light blue, #804d00 brown,
   #5a3600 dark brown. Navy carries the site; the light blue is the accent on
   navy surfaces (header, hero, footer, date tiles); brown is the small warm
   accent on white (link hover, focus ring, notices). Red stays for errors and
   delete buttons only. */

:root {
  --navy: #000080;
  --navy-700: #000a6e;
  --navy-900: #00165a;
  --accent: #bfcfff;
  --accent-600: #a6bbf7;
  --warm: #804d00;
  --warm-900: #5a3600;
  --warm-tint: #f8f0e3;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --text: #14162b;
  --muted: #5b5f7a;
  --border: #e3e5f0;
  --danger: #c62828;
  --success: #1b7f4c;
  --attention: #b45309;
  --test: #ffd43b;
  --test-ink: #1a1a1a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(10 12 40 / 6%), 0 8px 24px rgb(10 12 40 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
}

/* `hidden` always hides, even on elements whose rules set a display. */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--warm); }
img, svg { max-width: 100%; height: auto; }
code { background: #eef0f8; padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; word-break: break-all; }

:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible, .admin-sidebar :focus-visible { outline-color: var(--accent); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--navy-900); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 520px; }
.section { padding-block: clamp(2rem, 5vw, 4rem); }
.section + .section { padding-top: 0; }
.muted { color: var(--muted); }
.inline { display: inline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, color-mix(in srgb, var(--navy) 80%, #000) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  color: #fff;
}
.site-header .header-inner { width: auto; max-width: none; padding-inline: clamp(1rem, 3vw, 2.5rem); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; flex-wrap: wrap; }
.brand img { display: block; height: 44px; width: auto; }
.main-nav { display: flex; gap: 0.25rem; flex: 1; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--warm); }
.main-nav a, .header-actions .pill {
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
}
.header-actions .link-button.pill { text-decoration: none; line-height: inherit; }
.main-nav a:hover, .header-actions .pill:hover { background: rgb(255 255 255 / 12%); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* The cart: in the header whenever it holds something, also on a phone
   (outside the folded menu), after the account links on a wide screen. */
.cart-link {
  order: 1; position: relative; display: inline-flex; align-items: center; gap: 0.45rem;
  color: #fff; text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; background: rgb(255 255 255 / 12%);
}
.cart-link:hover { background: var(--accent); color: var(--navy-900); }
.cart-icon { width: 1.25rem; height: 1.25rem; background: currentColor; mask: url("/static/cart.svg") center / contain no-repeat; }
.cart-count {
  min-width: 1.4rem; height: 1.4rem; padding-inline: 0.35rem; border-radius: 999px;
  background: var(--accent); color: var(--navy-900); font-size: 0.8rem; font-weight: 700;
  display: inline-grid; place-items: center;
}
.cart-link:hover .cart-count { background: var(--navy-900); color: #fff; }
.search-link { display: inline-flex; align-items: center; }
.search-icon { width: 1.15rem; height: 1.15rem; background: currentColor; mask: url("/static/search.svg") center / contain no-repeat; }
.search-results { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; }
.search-results li { display: grid; gap: 0.15rem; }
.search-results a { font-weight: 600; font-size: 1.05rem; }
.search-results p { margin: 0; }
.lang-switch { color: var(--accent); font-size: 0.9rem; text-decoration: none; padding: 0.4rem 0.6rem; }
.lang-switch:hover { color: #fff; }
.nav-toggle { display: none; }
/* Menu groups: the dropdown opens on hover, with the arrow button (nav.js),
   or on keyboard focus when the script isn't running. */
.nav-group { position: relative; display: flex; align-items: center; }
.nav-sub-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 0; color: #fff; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  padding: 0.4rem 0.7rem 0.4rem 0.3rem; border-radius: 999px;
}
.nav-group-label { padding-left: 0.8rem; }
.nav-sub-toggle::after {
  content: ""; width: 0.38em; height: 0.38em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.nav-sub-toggle:hover { background: rgb(255 255 255 / 12%); }
.nav-sub {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60;
  flex-direction: column; gap: 0.1rem; min-width: 13rem; padding: 0.4rem;
  background: var(--navy-900); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 40 / 35%);
}
.main-nav .nav-sub a { border-radius: 8px; }
.nav-group:hover .nav-sub, .nav-group.open .nav-sub,
.site-header:not(.js-nav) .nav-group:focus-within .nav-sub { display: flex; }


/* Hero */
.hero {
  background:
    url("/static/pattern.svg") center top / 180px 180px,
    radial-gradient(900px 500px at 0% 120%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 3.75rem); max-width: 16ch; }
.hero .lead { font-size: 1.2rem; max-width: 52ch; color: rgb(255 255 255 / 85%); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:hover { background: var(--navy-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); }
.btn-accent { background: var(--accent); color: var(--navy-900); }
.btn-accent:hover { background: var(--accent-600); color: var(--navy-900); }
.btn-ghost { background: transparent; border-color: rgb(255 255 255 / 60%); }
.btn-ghost:hover { background: rgb(255 255 255 / 10%); }
.btn-ghost-dark { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost-dark:hover { background: #eef0f8; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a51f1f; }
.btn-danger-ghost { background: transparent; border-color: #f5c2c2; color: var(--danger); }
.btn-danger-ghost:hover { background: #fdecec; color: var(--danger); }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.9rem; }

/* Cards and grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.card.narrow { margin-inline: auto; }
.grid-2, .grid-3 { display: grid; gap: 1.25rem; }
.admin-main .grid-2 { align-items: start; }
.grants { margin-top: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Forms */
/* Grids pack their content at the top: a form next to a taller column must
   not spread the extra height over its fields. */
.stack { display: grid; gap: 1rem; align-content: start; }
/* Grid items grow to fit wide content (tables) unless allowed to shrink; .table-wrap then scrolls. */
.stack > *, .grid-2 > * { min-width: 0; }
.row-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; }
label { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
/* Fields side by side share their rows (text, input, hint), so the inputs
   line up even when one label wraps to two lines. */
.row-2 > label:not(.check) { grid-row: span 3; grid-template-rows: subgrid; row-gap: 0.35rem; }
/* Date and time pickers need more room than a half column of a card. */
.row-2:has(input[type="datetime-local"]) { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
label small, label .muted.small { font-weight: 400; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
label.check > input { flex-shrink: 0; }
label.check-top { align-items: flex-start; }
.settings-logo { background: var(--navy); border-radius: 6px; padding: 0.75rem 1rem; align-self: flex-start; }
.settings-logo img { display: block; height: 44px; width: auto; max-width: 100%; }
.settings-icon { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.kind-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.kind-row:first-of-type { border-top: 0; padding-top: 0; }
.kind-row > .cal-mark { align-self: center; }
.kind-row label { flex: 1 1 9rem; }
.kind-row input[type="color"] { width: 3rem; height: 2.4rem; padding: 0.15rem; }
.kind-meta { flex-basis: 100%; margin: 0; }
.module-row { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.module-row:first-of-type { border-top: 0; padding-top: 0; }
.module-addon strong { color: var(--muted); }
.module-screens { margin: 0.35rem 0 0 1.75rem; }
.notice-inline { color: var(--warm); font-weight: 600; }
label.check-top > input { margin-top: 0.35rem; }
input, select, textarea {
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid color-mix(in srgb, var(--navy) 15%, transparent); outline-offset: 0; }
.form-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; font-size: 0.95rem; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.flash, .notice, .error { border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin: 1rem 0; }
.flash { background: #e8f6ee; color: var(--success); border: 1px solid #bfe5cf; }
.notice { background: var(--warm-tint); border: 1px solid color-mix(in srgb, var(--warm) 35%, #fff); font-size: 0.95rem; }
.error { background: #fdecec; color: var(--danger); border: 1px solid #f5c2c2; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.details + .actions { margin-top: 1.25rem; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); font-size: 0.8rem; font-weight: 600; }

/* Footer */
.site-footer { background: url("/static/pattern.svg") center top / 180px 180px, var(--navy-900); color: rgb(255 255 255 / 80%); margin-top: 3rem; padding-block: 2.5rem; font-size: 0.95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.site-footer .muted { color: rgb(255 255 255 / 55%); }
.site-footer p { margin: 0; }
.site-footer img { display: block; margin-bottom: 0.5rem; width: auto; max-width: 100%; }

.error-page { padding-block: 4rem; text-align: center; }

/* Admin */
body.admin { flex-direction: row; background: #f2f3f8; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: #fff;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar nav { display: grid; gap: 0.15rem; }
.admin-sidebar a { color: rgb(255 255 255 / 85%); text-decoration: none; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.95rem; }
.admin-sidebar nav a:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.admin-sidebar .brand { padding: 0; }
.admin-search input {
  width: 100%; padding: 0.45rem 0.75rem; border-radius: var(--radius-sm);
  border: 1px solid rgb(255 255 255 / 25%); background: rgb(255 255 255 / 8%); color: #fff; font: inherit; font-size: 0.9rem;
}
.admin-search input::placeholder { color: rgb(255 255 255 / 60%); }
.admin-sidebar-foot { margin-top: auto; }
.admin-sidebar nav a[aria-current="page"] { background: rgb(255 255 255 / 14%); color: #fff; font-weight: 600; }
.admin-nav-group summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  color: rgb(255 255 255 / 85%); font-size: 0.95rem;
}
.admin-nav-group summary::-webkit-details-marker { display: none; }
.admin-nav-group summary::after { content: ""; width: 0.4rem; height: 0.4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.admin-nav-group[open] summary::after { transform: rotate(45deg); }
.admin-nav-group summary:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.admin-nav-group[open] summary { color: #fff; font-weight: 600; }
.admin-nav-group a { display: block; margin-top: 0.15rem; padding-left: 1.5rem; }
.admin-main { flex: 1; padding: clamp(1rem, 3vw, 2.5rem); min-width: 0; }
.admin-main > .card + .card { margin-top: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.search input { min-width: 280px; }
.search { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge-warn { background: #fdeceb; color: var(--danger); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.2rem 0; }
.stat { display: grid; gap: 0.25rem; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--navy); }
.totp-app { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.qr { background: #fff; display: inline-block; padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.check-row { display: flex; align-items: flex-start; gap: 0.65rem; }
.member-card-preview {
  width: min(100%, 360px);
  min-height: 210px;
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: 1rem;
  color: #fff;
  background: #000080;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 18%);
}
.member-card-preview p { margin: 1.1rem 0 0; }
.member-card-preview p span:first-child { font-size: 0.72rem; opacity: 0.75; text-transform: uppercase; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfe; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }

/* Folded menu: behind the Menu button. nav.js adds .nav-compact on a phone
   and whenever the menu doesn't fit on one line, so a long menu never
   breaks into ragged rows. A menu item never wraps onto two lines. */
.main-nav a, .nav-sub-toggle, .header-actions .pill, .header-actions .btn, .lang-switch, .cart-link { white-space: nowrap; }
.site-header:not(.nav-compact) .main-nav { flex-wrap: wrap; }
.nav-compact .header-inner { padding-block: 0.5rem; gap: 0.5rem; }
.nav-compact .main-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; }
.nav-compact .nav-toggle:not([hidden]) {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto;
  background: none; border: 1px solid rgb(255 255 255 / 40%); border-radius: 999px;
  color: #fff; font: inherit; font-size: 0.95rem; padding: 0.35rem 0.9rem; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-compact .main-nav, .nav-compact .header-actions { display: none; }
.nav-compact .cart-link { order: 0; margin-left: auto; }
.nav-compact .cart-link + .nav-toggle:not([hidden]) { margin-left: 0; }
.nav-compact .cart-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-compact.nav-open .main-nav { display: flex; flex-direction: column; }
/* The open menu scrolls on its own, so its bottom never falls off a short screen. */
.nav-compact.nav-open .header-inner { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
/* In the folded menu a group is a heading that folds its items open below it. */
.nav-compact .nav-group { flex-direction: column; align-items: stretch; }
.nav-compact .nav-group > a { padding-right: 3rem; }
.nav-compact .nav-group > a + .nav-sub-toggle { position: absolute; top: 0; right: 0; padding: 0.55rem 0.9rem; }
.nav-compact .nav-group-label { justify-content: space-between; padding: 0.4rem 0.8rem; text-align: left; }
.nav-compact .nav-group.open > .nav-sub-toggle::after { transform: translateY(0.1em) rotate(-135deg); }
.nav-compact .nav-sub { position: static; min-width: 0; padding: 0 0 0.3rem 1rem; background: none; box-shadow: none; border: 0; }
.nav-compact .nav-group:hover .nav-sub { display: none; }
.nav-compact .nav-group.open .nav-sub { display: flex; }
.nav-compact.nav-open .header-actions { display: flex; order: 4; flex-basis: 100%; padding-bottom: 0.5rem; }

@media (max-width: 760px) {
  /* Without nav.js the menu wraps below the logo, groups always open. */
  .header-inner { padding-block: 0.5rem; gap: 0.5rem; }
  .site-header:not(.js-nav) .main-nav { order: 3; flex-basis: 100%; }
  .site-header:not(.js-nav) .nav-group { flex-direction: column; align-items: stretch; }
  .site-header:not(.js-nav) .nav-sub { position: static; display: flex; min-width: 0; padding: 0 0 0.3rem 1rem; background: none; box-shadow: none; }
  .footer-inner { align-items: flex-start; }
  body.admin { flex-direction: column; }
  .admin-sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; }
  .admin-nav-group summary { gap: 0.5rem; }
  .admin-nav-group[open] { flex-basis: 100%; }
  .admin-nav-group a { display: inline-block; padding-left: 0.75rem; }
  .admin-sidebar-foot { margin-top: 0; }
  .search input { min-width: 0; }
}

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

/* Account */
.section-title { margin-top: 2.5rem; }
.membership + .membership { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.badge-ok { background: #e8f6ee; color: var(--success); }
.num { text-align: right; white-space: nowrap; }
.order-items { margin-top: 1.25rem; }
tfoot td, tfoot th { border-top: 1px solid var(--border); border-bottom: 0; }
tfoot th { background: none; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--text); }

/* Membership */
.lead { font-size: 1.1rem; max-width: 65ch; }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plans { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan { display: grid; gap: 0.35rem; cursor: pointer; position: relative; padding-left: 3rem; }
.plan input { position: absolute; left: 1.25rem; top: 1.6rem; accent-color: var(--navy); }
.plan:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.plan-name { font-weight: 700; font-size: 1.1rem; }
.plan-price { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.membership .actions { margin-top: 0.75rem; }

/* Events and tickets */
.event-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.event-card { display: grid; gap: 0.35rem; text-decoration: none; color: inherit; align-content: start; }
.event-card:hover { border-color: var(--navy); }
/* Posters are A4 portrait (about 2:3). Products are mostly too, but not
   always: show the whole picture on a plain background instead of cropping. */
.event-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg); }
.product-card img { object-fit: contain; }
.event-when { color: var(--navy); font-weight: 600; font-size: 0.95rem; }
.event-title { font-weight: 700; font-size: 1.15rem; }
.past-events li { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: baseline; }
.event-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.event-image { width: auto; max-width: 100%; max-height: 75vh; height: auto; margin-inline: auto; border-radius: var(--radius); display: block; }
.event-image-link { display: block; }
.event-side { display: grid; gap: 1rem; }
.prose { max-width: 70ch; line-height: 1.6; }
.prose img { max-width: 100%; height: auto; }
/* Layout from the editor (markdown.rs): `::: center` blocks and image
   options. Only these classes pass the sanitizer. */
.prose, .hero-text { display: flow-root; }
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
/* `::: box`, `::: intro`, `::: small`, `[text]{.main}`, `{.button}` links
   and `---`; newsletters.rs repeats these as inline styles. */
.box { background: var(--warm-tint); border-left: 4px solid var(--warm); border-radius: var(--radius-sm); padding: 0.25rem 1.25rem; margin: 1rem 0; display: flow-root; }
.text-intro { font-size: 1.2rem; line-height: 1.5; }
.text-small { font-size: 0.85rem; color: var(--muted); }
.text-main { color: var(--navy); }
.text-warm { color: var(--warm); }
a.button {
  display: inline-block; padding: 0.6rem 1.3rem; border-radius: 999px; background: var(--navy); color: #fff;
  font-weight: 600; text-decoration: none; line-height: 1.3;
}
a.button:hover { background: var(--navy-700); color: #fff; }
.prose hr { border: 0; border-top: 2px solid var(--border); margin: 1.75rem 0; }
img.img-left { float: left; max-width: 50%; margin: 0.3rem 1.25rem 0.75rem 0; }
img.img-right { float: right; max-width: 50%; margin: 0.3rem 0 0.75rem 1.25rem; }
img.img-center { display: block; margin: 1rem auto; }
img.img-full { display: block; width: 100%; margin: 1rem 0; }
img.img-small { width: 33%; }
img.img-medium { width: 50%; }
img.img-large { width: 75%; max-width: 100%; }
@media (max-width: 640px) {
  img.img-left, img.img-right, img.img-small, img.img-medium, img.img-large {
    float: none; display: block; width: 100%; max-width: 100%; margin: 1rem 0;
  }
}
.page-intro { margin-bottom: 1.5rem; }
.page-intro > :first-child { margin-top: 0; }
.page-outro { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); max-width: 70ch; }
.page-outro > :last-child { margin-bottom: 0; }
.ticket-type + .ticket-type { border-top: 1px solid var(--border); padding-top: 1rem; }
.ticket-type { display: grid; gap: 0.5rem; }
.ticket-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.ticket-price { color: var(--navy); white-space: nowrap; }
.ticket-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ticket { text-align: center; }
.ticket .qr svg { width: 200px; height: 200px; display: block; }
.ticket .code { word-break: break-all; }
.ticket-void { opacity: 0.6; }
@media (max-width: 860px) {
  .event-layout { grid-template-columns: 1fr; }
  .event-side { order: -1; }
  .event-image { max-height: 60vh; }
}

/* Shop and cart */
.search-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; max-width: 32rem; }
.search-form input { flex: 1 1 12rem; }
.category-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.category-links .pill { padding: 0.25rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; }
.category-links .pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.code-form { display: grid; gap: 0.35rem; margin-top: 1.25rem; max-width: 26rem; }
.code-applied { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; margin-top: 1.25rem; }
.input-group { display: flex; gap: 0.5rem; }
.input-group input { flex: 1; min-width: 0; }
.input-group .btn { padding-block: 0; white-space: nowrap; }
.checkout { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.checkout > div { flex: 1 1 16rem; }
.checkout p { margin: 0; }
.checkout p + p { margin-top: 0.4rem; }
.cart-items td:first-child { width: 100%; }
.code-applied p { margin: 0; }
.code-applied .error, .code-applied .muted { margin-left: 0.5rem; }

/* Admin: products */
.admin-thumb { max-width: 220px; border-radius: 6px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .25rem; }
.grid-2 + .variants { margin-top: 1.25rem; }
.variant-list { display: grid; gap: .5rem; }
/* One variant: ↑/↓, then its form. The form is a grid of short fields
   (name, name, price, stock, on sale, save) with the stock sharing folded
   underneath across the full width. */
.variant-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: start; }
.variant-item > .menu-move { padding-top: 2.1rem; }
.variant-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: .35rem .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8f9fc;
}
/* Every control takes two rows (column name, field), so the checkbox and
   the button sit on the line of the inputs. */
.variant-row > label { grid-row: span 2; grid-template-rows: subgrid; }
.variant-row > span { grid-row: span 2; }
.variant-row > .btn { grid-row: span 2; align-self: end; justify-self: start; white-space: nowrap; }
.vcheck input { align-self: center; justify-self: start; }
.variant-row .vl { hyphens: auto; overflow-wrap: break-word; }
.variant-more { grid-column: 1 / -1; font-size: 0.9rem; }
.variant-more > summary { cursor: pointer; color: var(--muted); }
.variant-pool { display: grid; gap: .75rem 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); padding-top: .75rem; }
/* Wide screens: one line per variant, like a table with the column names
   shown once. */
@media (min-width: 1200px) {
  .variant-row { grid-template-columns: repeat(2, minmax(0, 1.6fr)) repeat(2, minmax(0, 1fr)) 4.5rem 7rem; }
  .variant-list .variant-item + .variant-item .variant-row { row-gap: 0; }
  .variant-list .variant-item + .variant-item .vl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .variant-list .variant-item + .variant-item > .menu-move { padding-top: 0.6rem; }
}

/* Content: home slider, footer links, contact honeypot, page editor */
.slider { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-sm); }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; position: relative; }
/* Every photo fills its slide, so slides of other shapes leave no gaps. */
.slide img { width: 100%; height: 100%; max-height: 28rem; object-fit: cover; display: block; border-radius: var(--radius-sm); }
.slide figcaption { position: absolute; left: 1rem; bottom: 1rem; background: color-mix(in srgb, var(--navy-900) 75%, transparent); color: #fff; padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); }
.hero-text { max-width: 60ch; }
.hero-text h1, .hero-text h2 { margin-top: 0; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: inherit; }
.socials { display: flex; gap: 0.75rem; }
.social { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgb(255 255 255 / 10%); color: #fff; }
.social::before { content: ""; width: 1.4rem; height: 1.4rem; background: currentColor; mask: var(--icon) center / contain no-repeat; }
.social-instagram { --icon: url("/static/instagram.svg"); }
.social-tiktok { --icon: url("/static/tiktok.svg"); }
.social:hover { background: var(--accent); color: var(--navy-900); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.vacancy h2 { margin-top: 0.25rem; }
/* Admin: Markdown editor (templates/admin/editor.html). Text and preview sit
   side by side when the field itself is wide enough, so it works in a
   half-width column too. */
.md-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; min-width: 0; container-type: inline-size; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.md-btn { min-width: 2.25rem; padding: 0.3rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--navy); font: inherit; font-size: 0.9rem; cursor: pointer; }
.md-btn:hover { background: #eef0f6; }
.md-btn svg { display: block; width: 1rem; height: 1rem; margin: auto; }
.md-sep { width: 1px; align-self: stretch; margin: 0 0.15rem; background: var(--border); }
.md-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.md-toggle { margin-left: auto; }
.md-toggle[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.md-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; align-items: stretch; }
@container (min-width: 46rem) { .md-split .md-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.md-panes textarea { width: 100%; min-height: 8rem; resize: vertical; }
.md-swatch { font-weight: 700; }
.md-swatch-main { color: var(--navy); }
.md-swatch-warm { color: var(--warm); }
.md-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--navy) 12%, white); border-color: var(--navy); }
.md-modes { display: inline-flex; margin-left: auto; }
.md-toggle:not([hidden]) + .md-modes { margin-left: 0.25rem; }
.md-modes .md-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.md-modes .md-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.md-modes .md-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.md-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.4rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--navy) 4%, white); }
.md-bar-title { font-weight: 600; font-size: 0.9rem; margin-right: 0.25rem; }
label.md-bar-field { display: inline-flex; flex: 0 1 22rem; min-width: 0; align-items: center; gap: 0.4rem; font-weight: 500; font-size: 0.9rem; }
.md-bar-field input { flex: 1; min-width: 0; padding: 0.25rem 0.45rem; }
/* The visual editor: the text as the site shows it (ProseMirror's own rules
   from prosemirror-view/style/prosemirror.css and prosemirror-gapcursor). */
.md-visual-doc { position: relative; max-width: none; min-height: 8rem; max-height: 40rem; overflow-y: auto; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; font-variant-ligatures: none; }
.md-visual-doc:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.md-visual-doc > :first-child { margin-top: 0; }
.md-visual-doc pre { white-space: pre-wrap; }
/* A page block in Visual mode: a card with its options (editor.js BlockView). */
.md-page-block { display: grid; gap: 0.6rem; margin: 1rem 0; padding: 0.75rem 1rem; background: var(--bg); border: 2px dashed color-mix(in srgb, var(--navy) 30%, var(--border)); border-radius: var(--radius-sm); white-space: normal; cursor: grab; }
.md-page-block.ProseMirror-selectednode { border-style: solid; border-color: var(--navy); outline: none; }
.md-page-block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.md-page-block-head .md-btn { margin-left: auto; }
.md-page-block-hint { color: var(--muted); font-size: 0.9rem; }
.md-page-block-fields { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.md-page-block-fields label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.md-page-block-fields input[type="number"] { width: 5rem; }
.md-page-block-fields input[type="text"] { width: 12rem; }
.md-page-block-text { width: 100%; min-height: 5rem; font-family: ui-monospace, monospace; font-size: 0.9rem; cursor: text; resize: vertical; }
.md-add-block { width: auto; padding: 0.3rem 0.5rem; font-size: 0.9rem; }
.md-visual-doc li { position: relative; }
.md-visual-doc.md-empty::before { content: attr(data-placeholder); position: absolute; color: var(--muted); pointer-events: none; }
.md-drop .md-visual-doc { outline: 3px dashed var(--navy); outline-offset: 2px; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror [draggable][contenteditable=false] { user-select: text; }
.ProseMirror-selectednode { outline: 3px solid var(--navy); outline-offset: 2px; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-gapcursor::after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid currentColor; animation: pm-cursor-blink 1.1s steps(2, start) infinite; }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
@keyframes pm-cursor-blink { to { visibility: hidden; } }
.md-drop .md-panes textarea { outline: 3px dashed var(--navy); outline-offset: 2px; }
.md-preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; min-height: 8rem; max-height: 40rem; overflow-y: auto; }
.md-preview > :first-child { margin-top: 0; }
.md-fallback-note { margin: 0 0 0.75rem; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); background: var(--warm-tint); color: var(--muted); font-size: 0.85rem; }
.md-status { margin: 0; }
.md-status.error { padding: 0.4rem 0.6rem; }
.md-help summary { cursor: pointer; width: fit-content; color: var(--muted); font-size: 0.9rem; }
.md-help table { margin-top: 0.5rem; border-collapse: collapse; font-size: 0.9rem; }
.md-help td { padding: 0.25rem 1rem 0.25rem 0; vertical-align: top; }
.md-help p { margin: 0.5rem 0 0; }
.link-list { display: grid; gap: 0.25rem; max-height: 60vh; overflow-y: auto; }
.link-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.link-tile:hover, .link-tile:focus-visible { border-color: var(--navy); }
.link-tile .small { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-row { display: grid; grid-template-columns: 160px 1fr; gap: 1rem; align-items: start; border-top: 1px solid var(--border); padding-top: 1rem; }
.slide-row img { width: 160px; height: auto; border-radius: 6px; }
.slide-row form.inline { grid-column: 2; }
.tile-row { border-top: 1px solid var(--border); padding-top: 1rem; display: grid; gap: 0.5rem; }

/* Admin: one text in two languages (templates/admin/lang.html, admin.js
   "Languages"). Without the script both fields stand side by side; with it
   the form has one switch and shows one language. Red: Dutch missing,
   orange: not translated yet. */
.lang-pair { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.lang-switched .lang-pair { grid-template-columns: minmax(0, 1fr); }
.lang-switched .lang-pair > .lang-off { display: none; }
.lang-tag { display: inline-block; margin-left: 0.25rem; padding: 0 0.4rem; border-radius: 4px; background: color-mix(in srgb, var(--navy) 8%, #fff); color: var(--navy); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; vertical-align: 0.1em; }
.lang-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lang-bar-top { padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.lang-group > .section-head { padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.section-head > .lang-hint { margin-top: -0.25rem; }
.lang-tab { font: inherit; font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.85rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; }
.lang-tab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.lang-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: 999px; color: #fff; font-size: 0.75rem; font-weight: 700; }
.lang-tab-nl .lang-count { background: var(--danger); }
.lang-tab-en .lang-count { background: var(--attention); }
.lang-hint { flex-basis: 100%; }
.lang-missing :is(input, textarea), .lang-missing .md-visual-doc { border-color: var(--danger); outline: 2px solid color-mix(in srgb, var(--danger) 20%, transparent); }
.lang-todo :is(input, textarea), .lang-todo .md-visual-doc { border-color: var(--attention); outline: 2px solid color-mix(in srgb, var(--attention) 18%, transparent); }
.lang-todo :is(input, textarea)::placeholder { font-style: italic; }

/* "More options": what most people never need, folded away with a line per
   option saying what it does. */
.more-options { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem 1rem; }
.more-options > summary { cursor: pointer; font-weight: 600; }
.more-options[open] > summary { margin-bottom: 1rem; }
.more-options > .stack { gap: 1.25rem; }
.card.more-options { padding: 1rem clamp(1.25rem, 3vw, 2rem); }
.seo-texts > summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.seo-texts[open] > summary { margin-bottom: 0.75rem; }
.new-location { padding: 1rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--navy) 4%, #fff); }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.ticket-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.ticket-row { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.ticket-row:first-child { border-top: 0; }
.ticket-main { display: grid; gap: 0.15rem; min-width: 0; }
.ticket-discounts { border-top: 1px solid var(--border); padding-top: 1rem; }
.member-rights { margin-block: 1.25rem; }
.narrow-form { max-width: 46rem; }
/* Tabs over screens that share one sidebar link (templates/admin/tabs.html). */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: 0.5rem 0.9rem; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 600; text-decoration: none; }
.admin-tabs a:hover { color: var(--navy); }
.admin-tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }
.home-page-card { display: grid; gap: 0.25rem; margin-bottom: 1.25rem; text-decoration: none; color: inherit; border-left: 4px solid var(--navy); }
.home-page-card:hover strong { text-decoration: underline; }
.home-page-badge { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy); }
.grant-list { display: grid; gap: 0.6rem; }
.seat-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.seat-form > label { flex: 1 1 16rem; }
.option-hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }

/* Admin: media library and the image picker */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.stack-sm { display: grid; gap: 0.4rem; align-content: start; }
.stack-sm > h3, .stack-sm > p, .stack-sm > ul { margin: 0; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.media-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 22rem; grid-template-areas: "main edit"; align-items: start; }
.media-main { grid-area: main; gap: 1.25rem; }
.media-edit { grid-area: edit; position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; padding: 1.25rem; }
.media-edit h2 { margin: 0; }
.media-edit > p { margin: 0; }
.media-edit-preview img { display: block; width: 100%; max-height: 16rem; object-fit: contain; border-radius: var(--radius-sm); background: #eef0f6; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.media-tile { display: block; border-radius: var(--radius-sm); }
.media-tile img, .picker-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); background: #eef0f6; transition: opacity 0.15s; }
.media-tile:hover img, .picker-tile:hover img { opacity: 0.8; }
.media-tile[aria-current] img, .picker-tile:focus-visible img { outline: 3px solid var(--navy); outline-offset: 2px; }
.picker-tile:focus-visible { outline: none; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { font-family: monospace; font-size: 0.8rem; }
.qr-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
.qr-preview svg { display: block; width: 100%; height: auto; max-width: 16rem; margin: 0 auto; }
@media (max-width: 760px) { .qr-layout { grid-template-columns: 1fr; } }
@media (max-width: 1100px) {
  .media-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "edit" "main"; }
  .media-edit { position: static; max-height: none; }
  .media-edit-empty { display: none; }
}
.picker { width: min(56rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 1rem 3rem rgb(0 0 0 / 25%); }
.picker::backdrop { background: rgb(0 0 40 / 45%); }
.picker-body { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.picker-body > p { margin: 0; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.6rem; max-height: 60vh; overflow-y: auto; padding: 4px; }
.picker-tile { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); }
.picker-more, .picker-empty { grid-column: 1 / -1; justify-self: center; margin: 0.5rem 0; }
.upload-new summary { cursor: pointer; font-weight: 600; color: var(--navy); width: fit-content; }
.upload-new[open] summary { margin-bottom: 1rem; }

.audit-details { max-width: 32rem; }
.audit-summary { display: flex; align-items: center; gap: .5rem; }
.audit-first { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-summary .btn { flex: none; }
.audit-popover { width: min(40rem, calc(100vw - 2rem)); max-height: 80vh; overflow: auto; margin: auto; padding: 1.25rem 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.audit-popover::backdrop { background: rgb(0 0 0 / 0.35); }
.audit-popover h2 { font-size: 1.1rem; margin: 0; }
.audit-lines { margin: 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.audit-lines li + li { margin-top: .3rem; }

/* To-do list and message board on the dashboard */
.todo-board { align-items: start; margin-bottom: 1.5rem; }
.setup-card { margin-bottom: 1.5rem; }
.help-link { float: right; margin: 0 0 .75rem 1rem; display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.help-q { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; line-height: 1; }
.help-layout { display: grid; grid-template-columns: minmax(12rem, 16rem) 1fr; gap: 1.5rem; align-items: start; }
.help-index ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.help-index a[aria-current="page"] { font-weight: 700; }
.help-article { max-width: 70ch; }
@media (max-width: 760px) { .help-layout { grid-template-columns: 1fr; } .help-article { order: -1; } }
.setup-card .page-head { margin-bottom: 0; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.setup-steps li { display: flex; gap: .75rem; align-items: flex-start; }
.setup-mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; line-height: 1; }
.setup-skip { margin-left: auto; flex: none; }
.setup-done .setup-mark { background: var(--success); border-color: var(--success); color: var(--surface); }
.todo-list, .posts { list-style: none; margin: 0; padding: 0; }
.todo-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.todo-list li form { flex: none; }
.todo-list li:last-child, .posts li:last-child { border-bottom: 0; }
.posts li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.post-meta { margin: 0 0 .2rem; }
.post-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* Vacancies */
.vacancy-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 1rem 0 1.5rem; }
.vacancy-filter label { display: grid; gap: 0.25rem; }
.vacancy-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.25rem 0 0.75rem; }
.sponsor-logo { max-width: 12rem; max-height: 5rem; object-fit: contain; display: block; margin-bottom: 0.75rem; }
.vacancy .apply { margin-top: 2rem; }
.pre-wrap { white-space: pre-wrap; }

/* Admin menu editor: one line per item, a group's items indented under it,
   and a preview of the bar with the groups shown open. */
.menu-preview { margin-bottom: 1.5rem; }
.menu-preview h2 { font-size: 1.05rem; margin-top: 0; }
.menu-preview-bar { list-style: none; margin: 0 0 0.5rem; padding: 0.6rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: flex-start; background: var(--navy); border-radius: var(--radius-sm); color: #fff; }
.menu-preview-top { font-weight: 600; }
.menu-preview-heading { opacity: 0.85; font-style: italic; }
.menu-preview-sub { list-style: none; margin: 0.35rem 0 0; padding: 0.4rem 0.6rem; background: #fff; color: var(--text); border-radius: var(--radius-sm); font-size: 0.9rem; display: grid; gap: 0.2rem; }
.menu-rows { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.menu-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0.75rem; border-top: 1px solid var(--border); }
.menu-row:first-child { border-top: 0; }
.menu-row:target { background: color-mix(in srgb, var(--navy) 7%, #fff); }
.menu-child { padding-left: 2.5rem; }
.menu-child .menu-name::before { content: "└"; color: var(--muted); margin-right: 0.4rem; }
.menu-move { display: flex; gap: 0.25rem; }
.menu-move .btn { padding: 0.15rem 0.55rem; }
.menu-move .btn:disabled { opacity: 0.3; cursor: default; }
.menu-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.menu-actions { display: flex; gap: 0.4rem; }
.menu-add summary { cursor: pointer; }
.menu-add[open] summary { margin-bottom: 0.75rem; }
@media (max-width: 640px) {
  .menu-row { flex-wrap: wrap; }
  .menu-actions { width: 100%; justify-content: flex-end; }
}

/* Password box for hidden ticket types */
.unlock-tickets { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Upcoming events on the home page: two or three cards side by side */
.upcoming { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.upcoming:has(> :only-child) { max-width: 420px; }
.upcoming-card { position: relative; display: flex; flex-direction: row; padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.15s ease, border-color 0.15s ease; }
.upcoming-card:hover, .upcoming-card:focus-visible { border-color: var(--navy); transform: translateY(-2px); }
.upcoming-media { flex: 0 0 42%; aspect-ratio: 2 / 3; background: var(--navy); }
.upcoming-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.date-tile { position: absolute; top: 0.75rem; right: 0.75rem; display: grid; justify-items: center; min-width: 3.2rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); background: var(--navy); color: #fff; line-height: 1; }
.date-day { font-size: 1.4rem; font-weight: 800; }
.date-month { color: var(--accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.upcoming-body { display: grid; gap: 0.3rem; padding: 4.25rem 1.1rem 1.1rem; align-content: start; }
.upcoming-body .badge { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .upcoming-card { transition: none; } .upcoming-card:hover { transform: none; } }
@media (max-width: 640px) {
  .upcoming { gap: 0.75rem; }
  .upcoming-media { flex-basis: 34%; }
  .date-tile { top: 0.5rem; right: 0.5rem; min-width: 2.6rem; }
  .date-day { font-size: 1.15rem; }
  .upcoming-body { padding: 3.5rem 0.9rem 0.75rem; }
}
.home-events .page-head h2 { margin: 0; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin: 1rem 0; }

/* Returns on the order page */
.return-line { display: flex; align-items: center; gap: .5rem; }
.return-line input { width: 4.5rem; flex: none; }

/* Home tiles: link cards; with the gear decoration (`body.deco-gears`) a
   gear in the corner that turns on hover, over two big gears that turn
   while the section scrolls past (where the browser
   supports scroll-driven animations; elsewhere they stand still). */
/* Clipped only at the sides: below the section the gears run on over the
   plain page and go behind anything with its own background (z-index -1,
   and the section makes no stacking context). */
.tiles-section { position: relative; overflow-x: clip; overflow-y: visible; }
.gear-bg {
  position: absolute;
  z-index: -1;
  width: clamp(220px, 32vw, 440px);
  aspect-ratio: 1;
  background: var(--border);
  mask: url("/static/gear.svg") center / contain no-repeat;
  pointer-events: none;
}
.gear-bg-a { left: -10%; top: -8%; }
.gear-bg-b { right: -8%; bottom: -14%; }
.tiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}
.tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.deco-gears .tile { padding-right: 5rem; }
.deco-gears .tile::after {
  content: "";
  position: absolute;
  top: -1.4rem;
  right: -1.4rem;
  width: 5.5rem;
  height: 5.5rem;
  background: var(--border);
  mask: url("/static/gear.svg") center / contain no-repeat;
  transition: transform 0.8s ease, background-color 0.2s;
}
.tile:hover, .tile:focus-visible { border-color: var(--warm); transform: translateY(-2px); }
.deco-gears .tile:hover::after, .deco-gears .tile:focus-visible::after { transform: rotate(108deg); background-color: var(--accent); }
.tile-title { margin: 0; font-size: 1.4rem; color: var(--navy-900); }
.tile p { margin: 0; color: var(--muted); }
.tile-more { margin-top: auto; padding-top: 0.5rem; font-weight: 700; font-size: 0.95rem; color: var(--warm); }
@keyframes gear-turn { to { transform: rotate(180deg); } }
@keyframes gear-turn-back { to { transform: rotate(-180deg); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .gear-bg { animation: gear-turn linear both; animation-timeline: view(); animation-range: cover; }
    .gear-bg-b { animation-name: gear-turn-back; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile::after { transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
  .tile:hover::after, .tile:focus-visible::after { transform: none; }
}

/* Test site (SITE_ENV=staging): a striped banner on top and a watermark in
   the corner that stays on screen, like "Activate Windows". Clicks go
   through the watermark. */
.test-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.6rem 1rem;
  background: var(--test);
  color: var(--test-ink);
  text-align: center;
  border-bottom: 8px solid var(--test-ink);
  border-image: repeating-linear-gradient(-45deg, var(--test-ink) 0 12px, var(--test) 12px 24px) 8;
}
.test-banner strong { letter-spacing: 0.08em; }
.test-banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.admin-main .test-banner { margin-bottom: 1.25rem; }
.test-watermark {
  position: fixed;
  right: clamp(0.75rem, 2vw, 2rem);
  bottom: clamp(0.75rem, 2vw, 2rem);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  user-select: none;
  color: color-mix(in srgb, var(--danger) 55%, transparent);
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 0 3px rgb(255 255 255 / 70%);
}
.test-watermark-big { font-size: clamp(1.75rem, 5vw, 3.5rem); letter-spacing: 0.04em; }
@media print { .test-watermark { display: none; } }

/* Security and request log */
.log-table td { white-space: nowrap; }
.log-table td code { white-space: normal; word-break: break-all; }
.log-table tr.log-error td { background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* Agenda: a month grid with a mark for every event in the colour of its
   kind (`--kind`, set per `.kind-<id>` in /theme.css, crate::event_kinds);
   a gear with the gear decoration (`body.deco-gears`), else a dot. An event
   of several days is one bar on one line of its week (the lanes come from
   web/agenda.rs). */
.page-head-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cal-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.cal-head > :first-child { justify-self: start; }
.cal-head > :last-child { justify-self: end; }
.cal-month { margin: 0; text-align: center; text-transform: capitalize; }
.cal-today-link { text-align: center; margin: -0.25rem 0 0.75rem; }
.cal-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar th { padding: 0.5rem 0.25rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--border); }
.calendar td { vertical-align: top; height: 6.5rem; padding: 0.3rem 0 0.4rem; border: 1px solid var(--border); border-width: 0 1px 1px 0; }
.calendar td:last-child { border-right: 0; }
.calendar tr:last-child td { border-bottom: 0; }
.cal-out { background: var(--bg); }
.cal-out .cal-day { color: var(--muted); opacity: 0.6; }
.cal-day { display: block; padding: 0 0.45rem 0.2rem; font-size: 0.85rem; font-weight: 700; }
.cal-today .cal-day { color: var(--navy); }
.cal-today .cal-day::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.3rem; border-radius: 50%; background: var(--warm); vertical-align: middle; }
.cal-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-event { display: flex; align-items: center; gap: 0.25rem; height: 1.45rem; margin: 0 0 0.2rem; padding: 0 0.3rem; overflow: hidden; font-size: 0.78rem; line-height: 1.45rem; white-space: nowrap; text-decoration: none; color: var(--text); }
.cal-starts { margin-left: 0.25rem; border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal-ends { margin-right: 0.25rem; border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.cal-event:not(.cal-empty) { background: color-mix(in srgb, var(--kind, var(--warm)) 16%, var(--surface)); }
a.cal-event:hover, a.cal-event:focus-visible { color: var(--navy); text-decoration: underline; }
.cal-label { overflow: hidden; text-overflow: ellipsis; }
.cal-time { font-weight: 700; }
.cal-mark { flex: none; display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--kind, var(--warm)); }
.deco-gears .cal-mark { width: 1.05rem; height: 1.05rem; border-radius: 0; mask: url("/static/gear.svg") center / contain no-repeat; vertical-align: -0.15rem; }
.deco-gears a.cal-event:hover .cal-mark, .deco-gears a.cal-event:focus-visible .cal-mark { transform: rotate(60deg); transition: transform 0.4s ease; }
.cal-legend { display: flex; gap: 1.25rem; margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--muted); }
.cal-legend li { display: flex; align-items: center; gap: 0.35rem; }
.kind-chip { display: inline-flex; align-items: center; gap: 0.3rem; justify-self: start; font-size: 0.8rem; font-weight: 600; color: var(--kind, var(--warm)); }
.date-tile[class*="kind-"] { background: var(--kind); }
.date-tile[class*="kind-"] .date-month { color: color-mix(in srgb, var(--kind) 15%, white); }
@media (prefers-reduced-motion: reduce) { .deco-gears a.cal-event:hover .cal-mark, .deco-gears a.cal-event:focus-visible .cal-mark { transform: none; } }
/* Small screens: only the marks and the bars, the titles are in the cards. */
@media (max-width: 640px) {
  .cal-head { grid-template-columns: auto 1fr auto; gap: 0.5rem; }
  .cal-head .btn { font-size: 0; padding: 0.35rem 0.6rem; }
  .cal-head .btn::first-letter { font-size: 1rem; }
  .cal-month { font-size: 1.15rem; }
  .calendar td { height: 4.25rem; }
  .cal-day { padding: 0 0.2rem 0.15rem; font-size: 0.75rem; }
  .cal-event { height: 1.1rem; padding: 0 0.1rem; justify-content: center; }
  .cal-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .deco-gears .cal-mark { width: 0.95rem; height: 0.95rem; }
}

/* Request log labels (amoras_core::traffic): red scanners, orange odd
   requests and bursts, grey tools, blue crawlers. */
.flag { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.flag-scanner { background: #fdeceb; color: var(--danger); }
.flag-odd, .flag-burst { background: var(--warm-tint); color: var(--warm); }
.flag-tool { background: #eceef4; color: var(--muted); }
.flag-crawler { background: color-mix(in srgb, var(--navy) 7%, #fff); color: var(--navy); }
.log-table tr.log-flag-scanner td { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.log-table tr.log-flag-odd td, .log-table tr.log-flag-burst td, .log-table tr.log-warn td { background: color-mix(in srgb, var(--warm) 8%, transparent); }
.log-table tr.rights-strong td:first-child { box-shadow: inset 3px 0 0 var(--warm); }
.log-agent { display: inline-block; max-width: 36rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.log-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0 0 1rem; color: var(--muted); }
.log-suspects { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.log-suspects h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }

/* Colour editor (/admin/style): the form, and a small mock-up of the site
   whose variables admin.js sets while picking. */
.style-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.style-color { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding-block: 0.4rem; border-bottom: 1px solid var(--border); }
.style-color input[type="color"] { width: 3rem; height: 2.25rem; padding: 0.15rem; cursor: pointer; }
.style-color label { margin: 0; font-weight: 500; }
.style-hex { font-size: 0.85rem; }
#style-warnings { margin-block: 1rem; }
#style-warnings ul { margin: 0; padding-left: 1.2rem; }
.style-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); color: var(--text);
  --navy-700: color-mix(in srgb, var(--navy) 86%, #000);
  --accent-600: color-mix(in srgb, var(--accent) 88%, #000080);
  --warm-tint: color-mix(in srgb, var(--warm) 10%, #fff); }
.sp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 0.9rem; background: var(--navy); color: #fff; }
.sp-header img { height: 28px; width: auto; }
.sp-nav { font-weight: 500; font-size: 0.9rem; }
.sp-lang { color: var(--accent); font-size: 0.85rem; }
.sp-header .btn { margin-left: auto; }
.sp-body { padding: 1rem; }
.sp-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1rem 1.25rem; }
.sp-card h3 { margin-right: 4rem; }
.sp-card .btn { margin: 0.25rem 0.25rem 0 0; }
.sp-card a:hover { color: var(--warm); }
.sp-hero { padding-block: 1.25rem; }
#sp-hero > .hero-inner { padding: 1.25rem; margin: 0; max-width: none; }
.sp-hero-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 0.75rem; }
.sp-hero .btn { margin: 0 0.25rem 0.25rem 0; }
.layout-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.layout-choice legend { font-weight: 600; margin-bottom: 0.35rem; padding: 0; }
.sp-footer { padding: 0.75rem 0.9rem; background: var(--navy-900); color: #fff; font-size: 0.85rem; display: flex; justify-content: space-between; }
@media (max-width: 1000px) { .style-editor { grid-template-columns: 1fr; } }
/* Door scanner (/admin/scanner): one phone screen, never scrolls. Bar on top,
   the camera takes what is left, the typed-code row at the bottom. A result
   covers the camera image in full, then shrinks to a strip at its foot. */
body.scanner-page { display: block; height: 100dvh; overflow: hidden; background: #10122a; }
.scanner { display: flex; flex-direction: column; gap: 0.5rem; height: 100dvh; max-width: 40rem; margin-inline: auto; padding: 0.5rem; box-sizing: border-box; }
.scanner-page .test-banner { padding: 0.15rem 0.5rem; border-bottom-width: 4px; font-size: 0.8rem; }
.scanner-page .test-banner span, .scanner-page .test-banner a, .scanner-page .test-watermark { display: none; }
.scanner-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back title gear" "back count gear"; align-items: center; column-gap: 0.5rem; color: #fff; }
.scanner-bar a { color: #fff; text-decoration: none; font-size: 1.5rem; line-height: 1; padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); }
.scanner-bar a:hover { background: rgb(255 255 255 / 12%); }
.scanner-back { grid-area: back; }
.scanner-settings { grid-area: gear; }
.scanner-title { grid-area: title; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.5rem; line-height: 1.25; }
.scanner-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.scanner-title span { font-size: 0.85rem; opacity: 0.8; }
.scanner-count { grid-area: count; margin: 0; font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.scanner-view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #000; border-radius: var(--radius); overflow: hidden; }
.scanner-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-view .error { position: relative; margin: 1rem; }
.scanner-off { background: #fff; padding: 1rem; }
.scanner-start { position: relative; font-size: 1.15rem; padding: 0.9rem 1.5rem; }
/* .btn and .error set a display, which would beat the hidden attribute. */
.scanner-start[hidden], .scanner-view .error[hidden] { display: none; }
.scanner.scanning .scanner-view { outline: 4px solid var(--accent); outline-offset: -4px; }
.scan-result-slot { position: absolute; inset: 0; display: flex; z-index: 1; transition: top 0.2s; }
.scan-result-slot:empty { display: none; }
.scan-result { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.25rem; padding: 1rem; color: #fff; text-align: center; margin: 0; overflow: hidden; }
.scan-result p { margin: 0; overflow-wrap: anywhere; }
.scan-result form { margin-top: 0.75rem; }
.scan-result .btn { background: #fff; }
.scan-green { background: var(--success); }
.scan-orange { background: #b45309; }
.scan-red { background: var(--danger); }
.scan-neutral { background: var(--navy); }
.scan-headline { font-size: clamp(1.75rem, 9vw, 3rem); font-weight: 800; line-height: 1.1; }
.scan-name { font-size: clamp(1.25rem, 6vw, 2rem); font-weight: 700; }
.scan-detail, .scan-note { font-size: 1.05rem; }
/* After the pause: the last result stays readable at the bottom while the
   camera looks for the next code above it. */
.scanner.scan-old .scan-result-slot { top: auto; max-height: 45%; }
.scanner.scan-old .scan-result { padding: 0.5rem 0.75rem; opacity: 0.95; }
.scanner.scan-old .scan-headline { font-size: 1.4rem; }
.scanner.scan-old .scan-name { font-size: 1.1rem; }
.scanner.scan-old .scan-detail, .scanner.scan-old .scan-note { font-size: 0.9rem; }
.scanner.scan-old .scan-result form { margin-top: 0.35rem; }
.scanner-manual { display: flex; gap: 0.5rem; margin: 0; }
.scanner-manual input { flex: 1; min-width: 0; }
.scanner-manual .btn { background: #fff; }
.scan-big { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 0.25rem 0 1rem; }
.table-wrap progress { width: 100%; min-width: 5rem; accent-color: var(--navy); }

/* Page blocks (crate::page_blocks, templates/blocks.html): dynamic blocks in
   a content page. Text keeps its reading width; blocks use the full page. */
.prose.page-article { max-width: none; }
.page-article > * { max-width: 70ch; }
.page-article > :is(.page-block, .page-hero) { max-width: none; }
.page-block { margin-block: 1.75rem; }
.page-block-more { margin: 1rem 0 0; }
.page-hero { border-radius: var(--radius); margin-block: 1.75rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero .hero-inner { padding-inline: clamp(1.25rem, 4vw, 3rem); }
.page-hero :is(h1, h2, h3) { color: inherit; margin-top: 0; }
.page-hero .hero-text > h2:first-child { font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem); max-width: 18ch; }
.page-hero.hero-plain :is(h1, h2) { color: var(--navy); }
.page-hero.hero-plain { border: 1px solid var(--border); }
.page-hero:not(.hero-plain) a:not(.button) { color: inherit; }
.page-hero .hero-text > :last-child { margin-bottom: 0; }
.block-list { display: grid; gap: 0.5rem; }
.block-list a { font-weight: 600; }
.sponsor-wall { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; }
.sponsor-wall li { padding: 0; }
.sponsor-wall img { display: block; max-height: 64px; max-width: 180px; width: auto; }
.page-tiles .container { width: auto; padding: 0; }
.page-tiles .section { padding-block: 0; }
/* The gears belong to the home page's tile band; in a page they'd run over
   the text around the tiles. */
.page-tiles .gear-bg { display: none; }
/* ... except on the home page, where the gears were always behind the tiles. */
.home-article .page-tiles .gear-bg { display: block; }
/* The home page's blocks were sections of their own: more room between them. */
.home-article > .page-block { margin-block: clamp(2rem, 5vw, 3.5rem); }
.home-article > .page-block:first-child { margin-top: 0; }
.block-columns { display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.block-columns > div > :first-child { margin-top: 0; }
.block-signup .hero-actions { margin: 1rem 0 0; }
.md-block-problems ul { margin: 0; padding-left: 1.2rem; }

/* Layout picks (/admin/style, amoras_core::layout): each choice is a class
   on <body> (or on the style page's preview); the hero's sits on the hero.
   No class is the original look. Keep new layout rules under these classes,
   written for both the site (.site-header) and the preview (.sp-header). */

/* Header: light bar */
.header-light .site-header { background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--text); border-bottom: 1px solid var(--border); }
.header-light .sp-header { background: var(--surface); color: var(--navy); border-bottom: 1px solid var(--border); }
.header-light :is(.main-nav a, .header-actions .pill, .nav-sub-toggle, .cart-link, .nav-toggle) { color: var(--navy); }
.header-light :is(.main-nav a, .header-actions .pill, .nav-sub-toggle):hover { background: color-mix(in srgb, var(--navy) 8%, transparent); color: var(--navy); }
.header-light .cart-link { background: color-mix(in srgb, var(--navy) 8%, transparent); }
.header-light :is(.lang-switch, .sp-lang) { color: var(--warm); }
.header-light .lang-switch:hover { color: var(--navy); }
.header-light .nav-toggle:not([hidden]) { border-color: var(--border); }
.header-light .site-header :focus-visible { outline-color: var(--warm); }
/* The built-in logo is white: dark on a light bar. */
.header-light :is(.brand, .sp-header) img[src$="/logo-white.png"] { filter: brightness(0); }
@media (min-width: 761px) {
  .header-light .site-header:not(.nav-compact) .nav-sub { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
}

/* Header: logo centred above the menu (wide screens; a phone keeps the bar) */
@media (min-width: 761px) {
  .header-centered .site-header:not(.nav-compact) .header-inner { justify-content: center; row-gap: 0.25rem; padding-block: 0.75rem 0.5rem; }
  .header-centered .site-header:not(.nav-compact) .brand { flex-basis: 100%; display: flex; justify-content: center; }
  .header-centered .site-header:not(.nav-compact) .main-nav { flex: 0 1 auto; }
}
.header-centered .sp-header { justify-content: center; }
.header-centered .sp-header img { flex-basis: 100%; object-fit: contain; }
.header-centered .sp-header .btn { margin-left: 0; }

/* Hero: photo behind the text, text next to a photo, or plain. Without a
   photo the photo styles look like the band. */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-photo:has(> .hero-photo-img:not([hidden]))::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, color-mix(in srgb, var(--navy-900) 88%, transparent) 0%, color-mix(in srgb, var(--navy-900) 45%, transparent) 100%);
}
.hero-split:has(> .hero-photo-img:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-block: 0; }
.hero-split:has(> .hero-photo-img:not([hidden])) .hero-inner { width: auto; max-width: 38rem; margin: 0 0 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); align-self: center; }
.hero-split > .hero-photo-img { position: static; order: 2; z-index: auto; min-height: 18rem; height: 100%; }
@media (max-width: 760px) {
  .hero-split:has(> .hero-photo-img:not([hidden])) { grid-template-columns: 1fr; }
  .hero-split > .hero-photo-img { order: 0; min-height: 12rem; max-height: 16rem; }
}
.hero-plain { background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); }
.hero-plain h1 { color: var(--navy); }
.hero-plain .eyebrow { color: var(--warm); }
.hero-plain .lead { color: var(--muted); }
.hero-plain .btn-ghost { border-color: var(--border); color: var(--text); }
.hero-plain .btn-ghost:hover { background: color-mix(in srgb, var(--navy) 6%, transparent); color: var(--text); }
.hero.hero-plain :focus-visible { outline-color: var(--warm); }

/* Cards: thin outline, or flat */
.cards-outline { --shadow: none; }
.cards-outline :is(.card, .tile, .cal-wrap, .sp-card) { border-color: color-mix(in srgb, var(--navy) 22%, var(--border)); }
.cards-flat { --shadow: none; }
.cards-flat :is(.card, .tile, .cal-wrap, .sp-card) { border-color: transparent; }

/* Corners: sharp */
.corners-sharp { --radius: 3px; --radius-sm: 2px; }
.corners-sharp :is(.btn, .pill, .main-nav a, .cart-link, .cart-count, .nav-sub-toggle, .nav-sub, .badge, .nav-toggle, input, select, textarea, code) { border-radius: 2px; }
