/* Pass the Pad dashboard. Layout: top bar + left nav on wide screens, nav row on narrow. */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --ink: #1c2321;
  --muted: #5f6b67;
  --line: #d8dedb;
  --brand: #0d6e63;
  --brand-deep: #0a554c;
  --brand-tint: #e3f1ee;
  --marigold: #e5a33a;
  --ok: #1f7a4d; --ok-tint: #e5f3ec;
  --warn: #9a5b00; --warn-tint: #fbf0dc;
  --bad: #b3261e; --bad-tint: #fbe9e7;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body); }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--marigold); display: grid; place-items: center; color: var(--ink); font-size: 15px; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #cfd8d5; }
.topbar form button { background: none; border: 1px solid #4b5753; color: #fff; border-radius: 8px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 14px; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 54px); }
.side { padding: 24px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.side .org { padding: 0 12px 16px; font-weight: 700; font-size: 15px; }
.side .org-logo { display: block; max-width: 100%; max-height: 72px; width: auto; margin-bottom: 12px; }
.side .org span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.side .org-switch { padding: 0 0 16px; }
.side .org-switch summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); position: relative; }
.side .org-switch summary::-webkit-details-marker { display: none; }
.side .org-switch summary::after { content: "▾"; position: absolute; right: 10px; top: 8px; color: var(--muted); }
.side .org-switch[open] summary::after { content: "▴"; }
.side .org-switch .org-name { display: block; padding-right: 16px; font-weight: 700; color: var(--ink); font-size: 15px; }
.side .org-switch .org-name span { margin-top: 1px; }
.side .org-menu { display: grid; gap: 2px; margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 6px 18px rgb(0 0 0 / .08); }
.side .org-menu button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 15px; }
.side .org-menu button:hover, .side .org-menu button:focus-visible { background: var(--bg); }
.side .org-menu a { padding: 8px 10px; font-weight: 500; font-size: 14px; text-decoration: none; border-top: 1px solid var(--line); margin-top: 4px; }
.side nav { display: grid; gap: 2px; }
.side nav a { padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--brand-tint); color: var(--brand-deep); font-weight: 700; }
.side .sec summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-weight: 700; font-size: 15px; }
.side .sec summary::-webkit-details-marker { display: none; }
.side .sec summary::before { content: "▸"; color: var(--muted); font-size: 12px; width: 10px; }
.side .sec[open] summary::before { content: "▾"; }
.side .sec summary:hover { background: var(--bg); }
.side .sec-items { display: grid; gap: 2px; padding: 2px 0 8px 18px; }
.side .sec-badge { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 99px; background: var(--brand-tint); color: var(--brand-deep); }
.side .upsell { display: grid; gap: 8px; margin: 4px 4px 4px -6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; }
.side .upsell p { color: var(--muted); }
.side .upsell .btn { justify-self: start; padding: 0 10px; font-size: 13px; min-height: 30px; }
.side nav .shared { display: grid; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
/* The fold-up menu button only shows on phones */
.side .menu > summary { display: none; }
.side .menu-btn { list-style: none; cursor: pointer; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.side .menu-btn::-webkit-details-marker { display: none; }
.side .menu-icon { font-size: 18px; line-height: 1; color: var(--muted); }
.side .menu-here { display: grid; min-width: 0; flex: 1; }
.side .menu-here strong, .side .menu-here span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .menu-here span { color: var(--muted); font-size: 13px; }
.side .menu-word { font-size: 13px; font-weight: 600; color: var(--muted); }
.side .menu[open] > .menu-btn { margin-bottom: 12px; }
.side .kiosk-link { margin-top: 20px; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.main { padding: 32px clamp(16px, 4vw, 40px) 64px; min-width: 0; }
.page { max-width: 1060px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.page-head p { color: var(--muted); margin-top: 4px; }
/* A club name can be 120 characters without a space; it wraps instead of pushing the page sideways */
.page-head > div, .side .org, .side .org-name, .acting-bar span { min-width: 0; overflow-wrap: anywhere; }
:where(.main) :where(h1, h2, h3, p, li, .flash) { overflow-wrap: break-word; } /* no specificity: the anywhere rules win */
.plan-lines { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

@media (max-width: 800px) {
  /* The menu row takes only its own height; a short page's spare height goes to the page, not under the menu */
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { min-width: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .topbar .who span { display: none; }
  .side .menu > summary { display: flex; }
  .side .org:not(.org-switch), .side .kiosk-link { display: none; }
  .side .org-switch { padding-bottom: 10px; }
  .side .org-switch .org-logo { display: none; }
  .side nav { display: grid; gap: 4px; min-width: 0; }
  .side .sec { min-width: 0; }
  .side .sec summary { padding: 6px 8px; }
  /* Items wrap onto more rows rather than scroll sideways, so the current page and Your account are never hidden */
  .side .sec-items, .side nav .shared { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 4px; }
  .side nav .shared { margin-top: 2px; padding-top: 6px; }
  .side nav a { white-space: nowrap; padding: 7px 10px; }
  .side .upsell { margin: 0; flex: 1; }
  .topbar { padding: 10px 16px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; }
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-family: var(--font-display); font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat.lead .v { color: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; min-height: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

label.f { display: grid; gap: 6px; align-content: start; font-weight: 600; font-size: 14px; min-width: 0; }
label.f small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], input[type=search], select, textarea {
  font: inherit; width: 100%; min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input[type=color] { width: 64px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 4px; background: var(--surface); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.toggle strong { display: block; }
.toggle span { color: var(--muted); font-size: 14px; }

.flash { padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.flash.ok { background: var(--ok-tint); color: var(--ok); }
.flash.error { background: var(--bad-tint); color: var(--bad); }
.note { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
td.wrap { white-space: normal; min-width: 200px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--ok-tint); color: var(--ok); }
.chip.warn { background: var(--warn-tint); color: var(--warn); }
.chip.bad { background: var(--bad-tint); color: var(--bad); }
.chip.info { background: var(--brand-tint); color: var(--brand-deep); }
.chip.off { background: var(--bg); color: var(--muted); }

.pair-code { font-family: var(--font-display); font-size: 56px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--brand); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.steps li::marker { font-weight: 800; color: var(--brand); }

/* Auth + public pages */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: min(420px, 100%); display: grid; gap: 20px; }
.auth .brand { color: var(--ink); justify-content: center; font-size: 24px; }

/* Event schedule form */
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin: 0; background: var(--bg); justify-self: start; }
.seg label { cursor: pointer; }
.seg input, .daypick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 8px 18px; border-radius: 9px; font-weight: 600; }
.seg input:checked + span { background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 3px rgb(28 35 33 / .15); }
.seg input:focus-visible + span, .daypick input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 1px; }
.sched { display: grid; gap: 16px; }
.f > span { font-weight: 600; font-size: 14px; }
.daypick { display: flex; flex-wrap: wrap; gap: 8px; }
.daypick label { cursor: pointer; }
.daypick span { display: block; min-width: 64px; text-align: center; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; background: var(--surface); }
.daypick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.preview { padding: 12px 14px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.preview:empty { display: none; }
[hidden] { display: none !important; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }

/* Platform admin */
.topbar .admin-link { color: #fff; font-weight: 700; text-decoration: none; border: 1px solid #4b5753; border-radius: 8px; padding: 4px 10px; }
.topbar.admin { background: #2a1f3d; }
.topbar.admin .brand small { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: #d9cdf0; margin-left: 4px; }
.acting-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 24px; background: var(--warn-tint); color: var(--warn); border-bottom: 1px solid #ecd3a6; font-size: 15px; }
.acting-bar button { font: inherit; font-weight: 700; background: var(--warn); color: #fff; border: 0; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.secret { border: 2px solid var(--brand); }
.secret code { display: inline-block; font-size: 20px; font-weight: 700; background: var(--brand-tint); padding: 4px 10px; border-radius: 8px; user-select: all; }
.danger-zone { border-color: #efc4bf; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; font-weight: 600; }
td .sub { display: block; color: var(--muted); font-size: 13px; }

.stack { display: grid; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
label.f.narrow { max-width: 360px; }
.topbar .account-link { color: #cfd8d5; text-decoration: none; }
.topbar .account-link:hover { color: #fff; text-decoration: underline; }
@media (max-width: 820px) { .topbar .account-link { display: none; } }
.auth-alt { text-align: center; font-size: 14px; }

/* Switch event: big tap targets for a phone */
.switch-list { display: grid; gap: 10px; }
.switch-tablet { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.switch-tablet > span:first-child { display: grid; gap: 2px; min-width: 0; }
.switch-tablet strong { font-size: 18px; }
.switch-tablet.all { border-color: var(--brand); }
.switch-tablet .go { font-size: 28px; line-height: 1; color: var(--brand); }
.switch-pick { display: grid; gap: 12px; }
.switch-new { border: 1.5px dashed var(--brand); border-radius: 14px; padding: 14px 16px; }
.switch-new summary { cursor: pointer; font-weight: 700; color: var(--brand); list-style: none; }
.switch-new summary::-webkit-details-marker { display: none; }
.switch-choices { display: grid; gap: 8px; }
.switch-group { margin: 10px 2px 0; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.switch-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.switch-choice .n { font-size: 17px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.switch-choice .s { font-size: 14px; color: var(--muted); white-space: nowrap; }
.switch-choice.on { border: 2px solid var(--brand); background: var(--brand-tint); }
.switch-choice:active { background: var(--brand-tint); }
.switch-choice[hidden], .switch-group[hidden] { display: none; }
.move-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }

/* Sign-in screen colors */
.theme-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 24px; align-items: start; }
@media (max-width: 900px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } }
.theme-controls { display: grid; gap: 10px; min-width: 0; }
.theme-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.theme-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.theme-row input[type=color] { flex: none; width: 52px; height: 40px; }
.theme-name { display: grid; gap: 1px; flex: 1; min-width: 0; }
.theme-name .note { font-size: 13.5px; }
.theme-state { flex: none; }
.theme-row .theme-auto { display: none; }
.theme-row.auto .theme-auto { display: inline-block; }
.theme-row.auto .theme-reset { display: none; }
.theme-more summary { cursor: pointer; font-weight: 700; padding: 10px 0 4px; color: var(--brand); }
.theme-warn { margin: 6px 0 0; padding: 12px 14px 12px 32px; border-radius: 12px; background: var(--warn-tint); color: var(--warn); font-weight: 600; font-size: 14.5px; display: grid; gap: 4px; }
.theme-preview { position: sticky; top: 16px; display: grid; gap: 10px; }
.theme-frame { position: relative; overflow: hidden; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; }
.theme-frame iframe { position: absolute; top: 0; left: 0; width: 820px; height: 1100px; border: 0; transform-origin: 0 0; pointer-events: none; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--brand); color: #fff; }

/* Email section */
.campaign-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
@media (max-width: 960px) { .campaign-grid { grid-template-columns: minmax(0, 1fr); } }
.mini-preview { position: relative; height: 420px; overflow: hidden; border: 1.5px solid var(--line); border-radius: 12px; background: #f4f2f0; }
.mini-preview iframe { width: 166%; height: 166%; border: 0; transform: scale(.6); transform-origin: 0 0; pointer-events: none; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { line-height: 1.45; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.seg-rule { gap: 8px; }
.seg-count { margin: 0; font-size: 18px; }
.schedule summary { cursor: pointer; font-weight: 700; color: var(--brand); margin-top: 12px; }
.admin-tabs { gap: 6px; margin-bottom: 4px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
pre.code { background: var(--bg); padding: 12px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; }

/* Campaign "Send to": everyone or several segments, with segments to leave out */
.aud { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.aud legend { font-weight: 600; padding: 0 4px; }
.aud .radio, .aud .check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.aud .aud-pick { display: grid; gap: 6px; padding: 4px 0 4px 26px; }
.aud .aud-pick[hidden] { display: none; }
.aud .check:has(input:disabled) { opacity: .45; cursor: default; }
.aud .aud-ex summary { cursor: pointer; color: var(--brand); font-size: 15px; }
.aud .aud-count { margin-top: 4px; color: var(--muted); font-size: 14px; }
.aud .aud-count strong { color: var(--ink); font-size: 16px; }

/* Rename a tablet in place on the Tablets page */
.rename summary { list-style: none; cursor: pointer; }
.rename summary::-webkit-details-marker { display: none; }
.rename .rename-link { font-size: 13px; font-weight: 600; color: var(--brand); margin-left: 6px; text-decoration: underline; }
.rename[open] .rename-link { display: none; }
.rename-form { display: flex; gap: 6px; margin: 6px 0 4px; }
.rename-form input { min-width: 0; flex: 1; width: 12em; }

/* Sign-ins page */
.signin-filters { grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) minmax(180px, 2fr) auto; align-items: end; gap: 12px; }
.signin-filters .row { align-self: end; }
@media (max-width: 1100px) { .signin-filters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .signin-filters .ev-pick, .signin-filters .grow { grid-column: 1 / -1; } }
th a.sort { color: inherit; text-decoration: none; }
th a.sort:hover { text-decoration: underline; }
tr.day-row td { background: var(--bg); font-weight: 700; font-size: 14px; color: var(--muted); padding-top: 10px; padding-bottom: 6px; }
td.nowrap { white-space: nowrap; }
.del-bar { gap: 12px; align-items: center; margin-bottom: 8px; }
.btn[disabled] { opacity: .45; cursor: default; }
th.pick, td.pick { width: 1%; padding-right: 0; }
.pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
#delForm { min-width: 0; }
td.ev-name { min-width: 160px; max-width: 280px; white-space: normal; }
th a.sort { white-space: nowrap; }
th a.sort.on { color: var(--ink, inherit); }
th a.sort .idle { opacity: .35; }
.page.wide { max-width: 1440px; }
td.ev-name { min-width: 190px; max-width: 340px; }
#delForm th, #delForm td { padding-left: 12px; padding-right: 12px; }
.del-bar .sorted-by { margin-left: auto; color: var(--muted); font-size: 14px; }
td.nowrap .sub { font-size: 12.5px; }

/* Reports */
.report-filters { grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(120px, 1fr)) auto; align-items: end; gap: 12px; }
@media (max-width: 1300px) { .report-filters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .report-filters .ev-pick { grid-column: 1 / -1; } }
.report { display: grid; gap: 16px; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.report-head h2 { font-size: 26px; }
.report-head p { color: var(--muted); margin-top: 2px; }
.report-head .note { text-align: right; }
.report-head > * { min-width: 0; overflow-wrap: anywhere; }
.report h3 { font-size: 18px; margin-top: 8px; }
.stat .note { font-size: 12.5px; }
.rep-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--bg); }
.rep-table th.num { text-align: right; }
.ledger-head { justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.ledger-head .chip { text-decoration: none; }
.ledger td.events-cell { white-space: normal; min-width: 220px; font-size: 14px; line-height: 1.45; }
@media print {
  .topbar, .side, .acting-bar, .no-print, .flash { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .page, .page.wide { max-width: none; }
  body { background: #fff; }
  .table-wrap { overflow: visible; border: 0; }
  th, td { white-space: normal; padding: 5px 8px; font-size: 11px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 8px 10px; }
  .stat .v { font-size: 22px; }
  .chip { padding: 0; background: none !important; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
.ledger th, .ledger td { padding-left: 10px; padding-right: 10px; }
@media print {
  .ledger td.events-cell, td .note, .rep-table td, .rep-table th { font-size: 10.5px; }
  .ledger td.events-cell { min-width: 0; }
}

/* Membership add-on */
.upgrade-card { max-width: 720px; }
.price-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-line strong { font-family: var(--font-display); font-size: 40px; font-weight: 800; }
.price-line span { color: var(--muted); }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 99px; background: var(--brand-tint); color: var(--brand-deep); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 2px; }
.setup-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }

/* Plan and billing */
.confirm { border: 2px solid var(--brand); }
.plan-choice { gap: 10px; }
.billing-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 24px; font-size: 15px; border-bottom: 1px solid var(--line); }
.billing-bar span { min-width: 0; overflow-wrap: anywhere; }
.billing-bar a { font-weight: 700; color: inherit; white-space: nowrap; }
.billing-bar.info { background: var(--brand-tint); color: var(--brand-deep); }
.billing-bar.warn { background: var(--warn-tint); color: var(--warn); }
.billing-bar.bad { background: var(--bad-tint); color: var(--bad); }
.receipt { max-width: 640px; }
.receipt-head { justify-content: space-between; font-size: 18px; }
.receipt .brand-ink { font-family: var(--font-display); font-size: 22px; }
.receipt code { overflow-wrap: anywhere; }
.side .upsell .upsell-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.side .upsell .upsell-links a:not(.btn) { font-size: 13px; }
.admin-plan { display: grid; gap: 4px; }
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.admin-actions form { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.key-status { font-size: 13px; font-weight: 400; color: var(--muted); }
.missing { margin: 0; padding-left: 20px; color: var(--warn); }
@media (max-width: 800px) { .billing-bar { padding: 10px 16px; } }
@media print { .billing-bar { display: none !important; } .receipt { border: 0; } }
/* Long ids, keys and webhook addresses wrap instead of widening the page */
.facts-list { grid-template-columns: max-content minmax(0, 1fr); }
.facts-list dd, .facts-list code, .card code { overflow-wrap: anywhere; min-width: 0; }

/* Membership: Stripe and PayPal activity, long emails and ids wrap on phones */
.plain-list.activity li { overflow-wrap: anywhere; }

/* Tables that turn into one card per row on a phone, each value under its column's name (data-label), so nothing
   important sits off-screen in a sideways scroll */
@media (max-width: 640px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td, table.stack-sm td.num, table.stack-sm td.wrap { padding: 3px 0; border: 0; text-align: left; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
  table.stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  table.stack-sm td:empty { display: none; }
}
@media (min-width: 641px) {
  details.filters-sm > summary { display: none; }
}
details.filters-sm > summary { cursor: pointer; margin-bottom: 8px; }

/* A secondary step tucked under a card (replacing a PayPal app's Secret) */
details.more { margin-top: 14px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--brand); }
details.more[open] > summary { margin-bottom: 8px; }

/* Membership: members list, member record, levels, API (Phase 3) */
.member-filters { grid-template-columns: minmax(200px, 2fr) repeat(6, minmax(110px, 1fr)) auto; align-items: end; gap: 12px; }
@media (max-width: 1300px) { .member-filters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .member-filters .grow { grid-column: 1 / -1; } }
.saved-filters a.chip { text-decoration: none; }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--brand); }
.card h3 { font-size: 16px; margin-top: 4px; }
.plan-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.plan-actions > details { min-width: 0; }
.plan-actions > details[open] { flex-basis: 100%; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.plan-actions > details > summary { list-style: none; display: inline-block; }
.plan-actions > details > summary::-webkit-details-marker { display: none; }
.copy-link { display: block; font-size: 14px; background: var(--brand-tint); padding: 8px 10px; border-radius: 8px; user-select: all; overflow-wrap: anywhere; }
.tag-chip { display: inline; }
.chip-x { all: unset; cursor: pointer; margin-left: 4px; font-weight: 800; }
.chip-x:hover, .chip-x:focus-visible { color: var(--bad); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--muted); }
.timeline .tl-when { font-size: 13px; color: var(--muted); }
.timeline .tl-text { overflow-wrap: anywhere; }
.timeline .tl-next .tl-icon { background: var(--brand-tint); color: var(--brand-deep); }
.timeline .tl-next { background: linear-gradient(90deg, var(--brand-tint), transparent 60%); border-radius: 8px; padding-left: 6px; }
.timeline .tl-payment .tl-icon, .timeline .tl-renewed .tl-icon { background: var(--ok-tint); color: var(--ok); }
.timeline .tl-payment_failed .tl-icon, .timeline .tl-payment_refused .tl-icon, .timeline .tl-lapsed .tl-icon, .timeline .tl-cancelled .tl-icon { background: var(--bad-tint); color: var(--bad); }
.timeline .tl-note .tl-icon { background: #fff4d6; color: var(--warn); }
.timeline .tl-note .tl-text { white-space: pre-line; }
fieldset.scopes { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 8px; margin: 0; min-width: 0; }
fieldset.scopes legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
fieldset.scopes .check { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.wrap-any { overflow-wrap: anywhere; min-width: 0; }
.match-flag { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.match-flag .chip { white-space: normal; }
/* Long level and tag names (up to 120 and 60 characters, maybe without a space) wrap instead of widening the page */
.plan-box > .row > strong, .plan-box li, .plain-list li { overflow-wrap: anywhere; min-width: 0; }
.tag-chip .chip, #tags .chip { white-space: normal; overflow-wrap: anywhere; }
/* Sign-ins: the "Member?" flag stays narrow so the table's last columns fit beside the sidebar at 1280px */
.match-flag .chip { overflow-wrap: anywhere; max-width: 24ch; }
.match-flag .chip .sub-email { display: block; font-weight: 500; }
td.name-col { min-width: 170px; }
td.email-col { white-space: normal; overflow-wrap: anywhere; min-width: 150px; max-width: 260px; }

/* Profile fields (member portal and member record): several choices, a required mark, a field's own error */
.field-set { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.field-set legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.field-set > small { color: var(--muted); }
.field-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.field-checks .check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.field-checks input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.field-error { color: var(--bad) !important; font-weight: 600; }
.req { color: var(--bad); }
/* Membership → Forms (Phase 5): the builder's question rows and the embed snippet */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.form-kinds { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; min-width: 0; }
.q-list { display: grid; gap: 12px; }
.q-row { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.q-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .q-main { grid-template-columns: minmax(0, 1fr); } }
.q-tools { font-size: 14px; }
.q-tools label.row { gap: 6px; }
.embed-code { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--brand-tint); overflow-wrap: anywhere; resize: vertical; }
.slug-field { display: flex; align-items: center; gap: 6px; min-width: 0; }
.slug-field .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 50%; flex: none; }
.slug-field input { min-width: 0; }
.facts-list.answers dt { max-width: 40ch; overflow-wrap: anywhere; }
/* ---------- Event tickets: the public pages (/e/) ---------- */
.tix-body { background: var(--bg); }
.tix { width: min(680px, 100%); margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 16px; }
.tix-club { display: flex; justify-content: center; padding: 4px 0 8px; }
.tix-club img { max-height: 72px; max-width: 70%; }
.tix-club strong { font-family: var(--font-display); font-size: 22px; color: var(--brand); text-align: center; overflow-wrap: anywhere; }
.tix h1 { overflow-wrap: anywhere; }
.tix-when { margin: 0; }
.tix-about { white-space: normal; overflow-wrap: anywhere; }
.tix-type { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.tix-type:first-of-type { border-top: 0; }
.tix-type-info { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tix-price { font-weight: 700; }
.tix-state { font-weight: 600; }
.tix-qty select { min-height: 44px; min-width: 72px; font: inherit; font-size: 17px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); }
.tix-guest { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; min-width: 0; }
.tix-guest legend, .tix-pay legend { font-weight: 700; padding: 0 4px; }
.tix-pay { border: 0; padding: 0; margin: 0; min-width: 0; }
.tix-total { font-weight: 700; font-size: 18px; margin: 0; }
.tix-ticket { grid-template-columns: auto 1fr; align-items: center; }
.tix-ticket > div { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.tix-qr { display: block; width: 132px; aspect-ratio: 1; }
.tix-qr svg { width: 100%; height: 100%; display: block; }
.tix-one { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.tix-qr.big { width: min(300px, 80vw); }
.tix-event-link { text-decoration: none; color: inherit; gap: 4px; }
.tix-event-link strong { font-size: 18px; color: var(--brand); overflow-wrap: anywhere; }
.tix-foot { text-align: center; }
.tix .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 520px) {
  .tix-ticket { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tix-qr { width: min(240px, 70vw); }
}
/* Import (Phase 8): one box per level found in the file, with its billing variants */
fieldset.import-level { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; margin: 0 0 12px; min-width: 0; }
fieldset.import-level legend { padding: 0 4px; overflow-wrap: anywhere; }
fieldset.import-level .price-in { width: 8em; max-width: 100%; }

/* Sign-in screen settings: the form, with a live preview that stays in view beside it */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; align-items: start; }
.settings-preview { position: sticky; top: 16px; display: grid; gap: 8px; }
.settings-preview .theme-preview { position: static; }
.theme-grid.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-preview { position: static; order: -1; max-width: 340px; width: 100%; justify-self: center; }
}
/* Save bar: stays on screen at the bottom; turns amber while there are unsaved changes */
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px -18px rgb(28 35 33 / .45); }
.save-bar .state { color: var(--muted); font-size: 14px; }
.save-bar.dirty { border-color: var(--marigold); background: var(--warn-tint); }
.save-bar.dirty .state { color: var(--warn); font-weight: 600; }

/* Form builder: the design controls beside a live preview */
.fd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 24px; align-items: start; }
.fd-controls { display: grid; gap: 16px; min-width: 0; }
.fd-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.fd-color { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; }
.fd-color input[type=color] { flex: none; width: 48px; height: 40px; }
.fd-color > span { display: grid; min-width: 0; }
.fd-color .note { font-size: 12.5px; line-height: 1.35; }
.fd-choices { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fd-choices legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.fd-preview { position: sticky; top: 16px; display: grid; gap: 8px; background: var(--bg); border: 1px dashed var(--line); border-radius: 14px; padding: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.fd-preview iframe { width: 100%; min-height: 420px; border: 0; background: transparent; }
.fd-css { margin-top: 8px; }
.fd-css summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.fd-css textarea { width: 100%; font: 13px/1.5 ui-monospace, Menlo, monospace; margin: 10px 0; }
@media (max-width: 1000px) { .fd-grid { grid-template-columns: minmax(0, 1fr); } .fd-preview { position: static; max-height: none; } }

/* Reports: the filter bar wraps instead of squeezing (date fields can't shrink below their own width) */
.report-filters { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.report-filters .ev-pick { grid-column: span 2; }
.report-filters > *, .signin-filters > * { min-width: 0; }
.report-filters input, .report-filters select, .signin-filters input, .signin-filters select { width: 100%; min-width: 0; }
@media (max-width: 1300px) { .report-filters { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); } .report-filters .ev-pick { grid-column: 1 / -1; } }

/* Reports: headcount over time */
.trend { display: grid; gap: 14px; margin: 8px 0 20px; }
.trend.loading .trend-canvas { opacity: .55; }
.trend-head h3 { margin: 0; }
.trend-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.trend-controls .f { margin: 0; min-width: 0; }
.trend-range select { min-width: 160px; }
.trend-date input { width: 165px; }
.trend-seg { align-self: flex-end; }
.trend-pick { position: relative; }
.trend-pick summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.trend-pick summary::-webkit-details-marker { display: none; }
.trend-pick summary::after { content: "▾"; color: var(--muted); }
.trend-pick summary strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(380px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgb(28 35 33 / .4); padding: 12px; display: grid; gap: 10px; }
.trend-list { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.trend-opt { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.trend-opt:hover { background: var(--brand-tint); }
.trend-opt small { color: var(--muted); font-weight: 400; }
.trend-name { min-width: 0; overflow-wrap: anywhere; }
.trend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1.5px solid var(--line); vertical-align: -1px; }
.trend-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.trend-chips:empty { display: none; }
.trend-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13.5px; font-weight: 600; }
.trend-chip i { width: 10px; height: 10px; border-radius: 50%; }
.trend-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; }
.trend-canvas { position: relative; height: 340px; transition: opacity .2s; }
.trend-canvas .empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.trend-table td:first-child { white-space: normal; }
@media (max-width: 640px) { .trend-canvas { height: 260px; } .trend-date input { width: 100%; } }
@media print { .trend-canvas { height: 300px; } }
