/* Bridgepartner — calm, high-legibility design for older club members. */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #16222e;
  --ink-2: #3c4a57;
  --muted: #5d6b78;
  --line: #e4dfd5;
  --line-strong: #cfc8ba;

  --brand: #0f5d5a;          /* card-table green */
  --brand-strong: #0b4644;
  --brand-deep: #0f3b3a;
  --brand-soft: #e5f0ee;
  --red: #b0263c;
  --red-soft: #fbecee;
  --gold: #a87a26;
  --gold-soft: #fbf3e1;
  --success: #24683f;
  --success-soft: #e7f3ea;
  --info: #2b5a8a;
  --info-soft: #e9f1f9;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(22 34 46 / .05), 0 4px 14px rgb(22 34 46 / .05);
  --shadow-lift: 0 2px 4px rgb(22 34 46 / .06), 0 10px 26px rgb(22 34 46 / .09);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #c58a1c;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --wrap: 1100px;
  --tabbar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 18px/1.55 var(--sans);
  padding-bottom: var(--tabbar-h);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; color: var(--ink); }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.2vw, 40px); letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
h1:focus, main:focus { box-shadow: none; }

.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }

/* ---------- demo bar ---------- */
.demobar { background: #2a2418; color: #f4ead6; font-size: 15px; }
.demobar-inner { max-width: var(--wrap); margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.demobar-tag { background: #e8b84a; color: #2a2418; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; }
.demobar-persona { display: flex; align-items: center; gap: 8px; }
.demobar select { background: #3a3222; color: #fff; border: 1px solid #6b5d40; border-radius: 8px; padding: 6px 30px 6px 10px; min-height: 40px; font-weight: 600; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4ead6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.demobar-hint { color: #cdbf9f; }
.demobar-reset { margin-left: auto; background: transparent; color: #f4ead6; border: 1px solid #6b5d40; border-radius: 8px; padding: 6px 14px; min-height: 40px; cursor: pointer; }
.demobar-reset:hover { background: #3a3222; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--brand-deep); color: #fff; display: grid; place-items: center; font-size: 26px; line-height: 1; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 24px; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 14px; }

.nav { display: flex; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 48px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 16px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav-item .short { display: none; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- layout ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 56px; min-height: 60vh; }
.lead { color: var(--ink-2); font-size: 19px; margin-top: 10px; max-width: 640px; }
.fine { color: var(--muted); font-size: 15px; line-height: 1.5; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.link { font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 40px 44px; color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgb(255 255 255 / .09) 0 120px, transparent 121px),
    radial-gradient(circle at 100% 100%, rgb(255 255 255 / .05) 0 220px, transparent 221px),
    linear-gradient(135deg, var(--brand-deep), var(--brand) 70%);
}
.hero::after { content: "♠ ♥ ♦ ♣"; position: absolute; right: 36px; top: 26px; font-size: 22px; letter-spacing: .3em; color: rgb(255 255 255 / .35); }
.hero-kicker { font-weight: 600; color: #bfe0da; font-size: 18px; }
.hero h1 { color: #fff; margin-top: 6px; }
.hero-lead { color: #dcece9; font-size: 19px; margin-top: 12px; max-width: 620px; }
.starts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; max-width: 820px; }
.start { display: flex; align-items: center; gap: 16px; padding: 18px 20px; min-height: 84px; background: #fff; color: var(--ink); border-radius: var(--radius); text-decoration: none; box-shadow: 0 6px 18px rgb(0 0 0 / .14); transition: transform .12s ease, box-shadow .12s ease; }
.start:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgb(0 0 0 / .2); }
.start > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.start strong { font-size: 19px; line-height: 1.25; }
.start small { color: var(--muted); font-size: 15px; margin-top: 2px; }
.start .icon { color: var(--brand); width: 22px; height: 22px; }
.start-suit { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 28px; color: var(--ink); }
.start-suit.red { color: var(--red); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 14px; }
.card { position: relative; display: flex; align-items: flex-start; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: box-shadow .12s ease, border-color .12s ease; }
.card:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.card:focus-within { box-shadow: var(--focus); }
.card-dim { background: var(--surface-2); box-shadow: none; }
.card-dim .datechip { background: #eeebe4; color: var(--muted); }
.card-body { flex: 1; min-width: 0; }
.card h3 { margin: 8px 0 4px; font-size: 21px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.stretched:focus-visible { box-shadow: none; }
.card-when { font-size: 17px; color: var(--ink); }
.card-when strong { color: var(--brand-strong); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 16px; margin-top: 4px; }
.card-meta .sep { color: var(--line-strong); }
.card-alert { margin-top: 12px; display: inline-flex; padding: 6px 12px; border-radius: 8px; background: var(--gold-soft); color: #6d4e12; font-weight: 700; font-size: 16px; }
.card-note { margin-top: 10px; color: var(--muted); font-size: 16px; }
.card-chevron { color: var(--line-strong); width: 24px; height: 24px; align-self: center; }
.card:hover .card-chevron { color: var(--brand); }

.datechip { flex: none; width: 64px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); text-align: center; padding: 8px 0; display: flex; flex-direction: column; line-height: 1.1; }
.datechip span { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.datechip strong { font-family: var(--serif); font-size: 28px; margin: 2px 0; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill .icon { width: 14px; height: 14px; stroke-width: 3; }
.pill-open { background: var(--brand-soft); color: var(--brand-strong); border-color: #c8dfdb; }
.pill-own { background: var(--gold-soft); color: #6d4e12; border-color: #ecd9ae; }
.pill-success { background: var(--success-soft); color: var(--success); border-color: #c4e0cb; }
.pill-info { background: var(--info-soft); color: var(--info); border-color: #cadcee; }
.pill-danger { background: var(--red-soft); color: var(--red); border-color: #efc9cf; }
.pill-muted { color: var(--muted); }

.seats { display: inline-flex; gap: 4px; margin-left: 4px; }
.seat { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); }
.seat.taken { background: var(--brand); }

.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; color: var(--ink-2); display: grid; gap: 8px; justify-items: start; }
.empty h1 { margin-bottom: 4px; }
.empty .btn { margin-top: 10px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 22px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .12s ease, border-color .12s ease; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); color: var(--brand-strong); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: rgb(0 0 0 / .04); }
.btn-ghost-danger { background: transparent; color: var(--red); border-color: #e6bcc3; }
.btn-ghost-danger:hover { background: var(--red-soft); }
.btn-small { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.btn-large { min-height: 56px; padding: 14px 28px; font-size: 18px; }
.btn-block { width: 100%; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; padding: 8px 10px 8px 4px; margin: -8px 0 16px; min-height: 44px; }
.back:hover { color: var(--brand); }
.detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.detail-main { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.detail-main h1 { margin: 12px 0 24px; }
.detail-side { position: sticky; top: 100px; }
.facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 28px 110px 1fr; align-items: start; gap: 4px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts .icon { color: var(--brand); margin-top: 4px; }
.facts dt { color: var(--muted); font-size: 16px; padding-top: 1px; }
.facts dd { margin: 0; }
.note { margin: 24px 0 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 20px; font-style: italic; color: var(--ink-2); }
.info-block { margin-top: 24px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.info-block h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ink-2); }
.info-block .fine { margin-top: 8px; }
.info-private { background: var(--success-soft); border-color: #c4e0cb; }
.info-private h3 { color: var(--success); }
.info-locked h3 { color: var(--ink-2); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.panel h2 { display: flex; align-items: center; gap: 10px; }
.panel > p { color: var(--ink-2); }
.panel .btn { justify-self: start; }
.panel .btn-block { justify-self: stretch; }
.panel-success { border-color: #b9dbc2; background: linear-gradient(var(--success-soft), #fff 140px); }
.panel-success h2 { color: var(--success); }
.panel-info { border-color: #cadcee; background: linear-gradient(var(--info-soft), #fff 120px); }
.panel-muted { background: var(--surface-2); box-shadow: none; }
.contact { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 4px; }
.contact-name { font-weight: 700; font-size: 19px; }
.contact-row { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; text-decoration: none; }
.contact-row:hover { text-decoration: underline; }

.progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--line); }
.progress .seat { width: 16px; height: 16px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; }
.person { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; flex: none; }
.person-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-text small { color: var(--muted); font-size: 15px; }
.empty-inline { color: var(--muted); padding: 6px 0; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.panel .owner-actions .btn { justify-self: auto; }
.admin-box { margin-bottom: 22px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel .admin-actions .btn { justify-self: auto; }

/* ---------- forms ---------- */
.form-wrap { max-width: 720px; }
.form-wrap > .lead { margin-bottom: 28px; }
.group { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 24px 26px 8px; margin: 0 0 18px; box-shadow: var(--shadow); }
.group legend { float: left; width: 100%; font-size: 20px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.group legend + * { clear: both; }
.field { margin-bottom: 20px; }
.field label, .field .label { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 15px; margin: -2px 0 8px; }
input[type=text], input[type=date], input[type=time], input[type=tel], input[type=email], textarea {
  display: block; width: 100%; min-height: 52px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 18px;
}
input:focus-visible, textarea:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(15 93 90 / .2); border-radius: var(--radius-sm); }
textarea { resize: vertical; min-height: 100px; }
.has-error input { border-color: var(--red); }
.field-error { color: var(--red); font-weight: 600; font-size: 16px; margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.choices { display: grid; gap: 10px; margin-bottom: 20px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice > span { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 14px 48px; min-height: 64px; justify-content: center; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; position: relative; transition: border-color .1s, background .1s; }
.choice > span::before { content: ""; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; }
.choice small { color: var(--muted); font-size: 15px; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:checked + span::before { border-color: var(--brand); background: radial-gradient(circle, var(--brand) 0 5px, #fff 6px); }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.choices.three .choice > span { padding-left: 46px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.error-summary { border: 2px solid var(--red); background: var(--red-soft); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 18px; }
.error-summary ul { margin: 6px 0 0; padding-left: 22px; }
.demo-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--gold-soft); color: #6d4e12; border: 1px solid #ecd9ae; padding: 2px 8px; border-radius: 6px; }

.toggle { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0 18px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.toggle-ui { flex: none; width: 52px; height: 30px; border-radius: 15px; background: var(--line-strong); position: relative; transition: background .15s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--brand); }
.toggle input:checked + .toggle-ui::after { transform: translateX(22px); }
.toggle input:focus-visible + .toggle-ui { box-shadow: var(--focus); }
.toggle > span:last-child { display: flex; flex-direction: column; }
.toggle small { color: var(--muted); font-size: 15px; }
.group > .fine { margin: 0 0 18px; }

/* ---------- inbox ---------- */
.demo-note { font-size: 15px; color: #6d4e12; background: var(--gold-soft); border: 1px solid #ecd9ae; border-radius: var(--radius-sm); padding: 12px 16px; margin: -8px 0 22px; }
.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inbox-item { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.inbox-item:hover { box-shadow: var(--shadow-lift); }
.inbox-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.inbox-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-text a { color: var(--ink); text-decoration: none; }
.inbox-text small { color: var(--muted); font-size: 15px; }
.tone-action { border-color: #ecd9ae; }
.tone-action .inbox-icon { background: var(--gold-soft); color: var(--gold); }
.tone-success .inbox-icon { background: var(--success-soft); color: var(--success); }
.tone-info .inbox-icon { background: var(--info-soft); color: var(--info); }
.tone-muted { background: var(--surface-2); box-shadow: none; }

/* ---------- footer, toast, dialog ---------- */
.footer { max-width: var(--wrap); margin: 0 auto; padding: 8px 24px 40px; }
.footer p { color: var(--muted); font-size: 14px; max-width: 720px; border-top: 1px solid var(--line); padding-top: 20px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .25); font-weight: 600; max-width: calc(100% - 32px); z-index: 40; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dialog { border: 0; border-radius: 18px; padding: 28px; max-width: min(460px, calc(100% - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .3); color: var(--ink); }
.dialog::backdrop { background: rgb(22 34 46 / .45); }
.dialog h2 { font-family: var(--serif); font-size: 26px; }
.dialog p { margin-top: 10px; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .nav-item .long { display: none; }
  .nav-item .short { display: inline; }
}

@media (max-width: 680px) {
  :root { --tabbar-h: calc(72px + env(safe-area-inset-bottom)); }
  body { font-size: 17px; }
  .demobar-inner { padding: 8px 16px; gap: 6px 10px; }
  .demobar-hint { display: none; }
  .demobar-inner { flex-wrap: nowrap; }
  .demobar-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .demobar-persona { min-width: 0; flex: 1; }
  .demobar select { width: 100%; }
  .demobar-reset { padding: 6px 12px; }
  .hero h1 { font-size: 28px; }
  .topbar { position: static; }
  .topbar-inner { min-height: 64px; padding: 0 16px; }
  .brand-mark { width: 38px; height: 38px; font-size: 22px; }
  .brand-text strong { font-size: 21px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 0;
    background: rgb(255 255 255 / .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
    padding: 6px 6px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
  }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 4px; min-height: 60px; font-size: 13px; justify-content: center; border-radius: 10px; }
  .nav-item .icon { width: 24px; height: 24px; }
  .nav-item[aria-current="page"] { background: transparent; color: var(--brand); }
  .nav-item[aria-current="page"] .icon { background: var(--brand-soft); border-radius: 12px; width: 52px; padding: 2px 14px; box-sizing: content-box; height: 24px; }
  .badge { position: absolute; top: 4px; left: calc(50% + 8px); }
  main { padding: 20px 16px 40px; }
  .hero { padding: 26px 22px; border-radius: 18px; }
  .hero::after { display: none; }
  .hero-lead { font-size: 17px; }
  .starts { grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
  .start { padding: 14px 16px; min-height: 76px; }
  .section { margin-top: 34px; }
  .card { padding: 16px; gap: 14px; }
  .card-chevron { display: none; }
  .datechip { width: 54px; }
  .datechip strong { font-size: 24px; }
  .card h3 { font-size: 19px; }
  .detail-main { padding: 22px 18px; border-radius: 16px; }
  .facts > div { grid-template-columns: 24px 1fr; }
  .facts .icon { grid-row: span 2; }
  .facts dt { grid-column: 2; font-size: 14px; }
  .facts dd { grid-column: 2; }
  .note { font-size: 18px; }
  .panel { padding: 20px 18px; border-radius: 16px; }
  .group { padding: 20px 18px 4px; border-radius: 16px; }
  .row { grid-template-columns: 1fr; }
  .choices.two { grid-template-columns: 1fr; }
  .choices.three .choice > span { padding: 12px 10px 12px 40px; }
  .choices.three .choice > span::before { left: 12px; }
  .form-actions .btn-large { width: 100%; }
  .page-head .btn { width: 100%; }
  .footer { padding: 0 16px 24px; }
}

/* Message with interest, calendar button, home-screen help */
.person-message { font-style: italic; color: var(--ink-2); font-size: 16px; overflow-wrap: anywhere; }
.my-message { overflow-wrap: anywhere; }
.panel .field textarea#interest-message { min-height: 64px; }
.calendar-add { margin-top: 20px; }
.calendar-add .btn { min-height: 48px; }
.calendar-add .fine { margin: 8px 0 0; }
.help-box { margin-top: 24px; }
.help-list { margin: 0; padding-left: 22px; line-height: 1.6; }
.help-list li + li { margin-top: 8px; }

/* Guided demo, getting started, who-sees-what */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demobar-tour { background: #e8b84a; color: #2a2418; border: 0; border-radius: 8px; padding: 6px 14px; min-height: 40px; font-weight: 800; cursor: pointer; }
.demobar-tour:hover { background: #f1c962; }
.demobar-tour .short { display: none; }
.demobar-tour + .demobar-reset { margin-left: 0; }
.demobar-hint { margin-right: auto; }

.tour { position: fixed; left: 0; right: 0; bottom: calc(16px + var(--tabbar-h)); z-index: 35; padding: 0 16px; pointer-events: none; }
.tour-inner { pointer-events: auto; max-width: 620px; margin: 0 auto; background: var(--brand-deep); color: #fff; border-radius: 18px; padding: 18px 20px 16px; box-shadow: 0 18px 50px rgb(0 0 0 / .35); }
.tour h2 { color: #fff; font-family: var(--serif); font-size: 24px; margin: 4px 0 6px; }
.tour h2:focus, .tour h2:focus-visible { box-shadow: none; } /* programmatic focus target only, like h1 */
.tour p { color: #e3efec; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-kicker { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #e8b84a !important; }
.tour-who { font-size: 15px; font-weight: 700; margin-top: 2px; }
.tour-close { background: transparent; color: #fff; border: 1px solid rgb(255 255 255 / .35); border-radius: 10px; min-width: 44px; min-height: 44px; font-size: 18px; cursor: pointer; }
.tour-close:hover { background: rgb(255 255 255 / .1); }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgb(255 255 255 / .3); }
.tour-dots .done { background: rgb(255 255 255 / .7); }
.tour-dots .current { background: #e8b84a; width: 22px; border-radius: 5px; }
.tour-buttons { display: flex; gap: 8px; margin-left: auto; }
.tour .btn-secondary { background: transparent; color: #fff; border-color: rgb(255 255 255 / .45); }
.tour .btn-secondary:hover { background: rgb(255 255 255 / .1); }
.tour .btn-secondary:disabled { opacity: .4; cursor: default; }
.tour .btn-primary { background: #e8b84a; color: #2a2418; }
.tour .btn-primary:hover { background: #f1c962; }
body.touring { padding-bottom: calc(var(--tabbar-h) + 300px); }
.tour-highlight { outline: 4px solid #e8b84a; outline-offset: 4px; border-radius: var(--radius); }

.getting-started { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.gs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gs-count { color: var(--muted); font-size: 16px; margin-top: 2px; }
.gs-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; margin: 12px 0 16px; overflow: hidden; }
.gs-bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.gs-bar .pct-0 { width: 0; } .gs-bar .pct-33 { width: 33%; } .gs-bar .pct-67 { width: 67%; } .gs-bar .pct-100 { width: 100%; }
.gs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gs-step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.gs-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 800; font-size: 15px; }
.gs-step.is-done .gs-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.gs-step.is-done strong { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.gs-step:not(.is-done):not(.is-next) strong { color: var(--ink-2); font-weight: 600; }
.gs-step.is-next .gs-num { border-color: var(--brand); color: var(--brand); }
.gs-text { padding-top: 3px; }
.gs-text p { color: var(--ink-2); margin-top: 4px; }
.gs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.visibility { margin: 24px 0; display: grid; gap: 10px; }
.visibility-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; }
.visibility dt { font-weight: 700; }
.visibility dd { margin: 4px 0 0; color: var(--ink-2); }
.profile-links { margin-top: 20px; }
.footer .footer-links { border-top: 0; padding-top: 0; margin-bottom: 8px; font-size: 16px; }

@media (max-width: 680px) {
  .demobar-tour { padding: 6px 10px; }
  .demobar-tour .long { display: none; }
  .demobar-tour .short { display: inline; }
  .tour { bottom: calc(8px + var(--tabbar-h)); padding: 0 8px; }
  .tour-inner { padding: 12px 14px 10px; max-height: 46vh; overflow-y: auto; }
  .tour p { font-size: 16px; line-height: 1.45; }
  .tour-foot { margin-top: 10px; }
  .tour h2 { font-size: 21px; }
  .tour-dots { display: none; }
  .tour-buttons { width: 100%; }
  .tour-buttons .btn { flex: 1; }
  .getting-started { padding: 18px 16px; }
}
@media (prefers-reduced-motion: no-preference) { .tour-inner { animation: tour-in .2s ease-out; } }
@keyframes tour-in { from { transform: translateY(12px); opacity: 0; } }

/* Club switcher (only rendered for members of two or more clubs) and club pages */
.clubswitch { margin-left: auto; }
.clubswitch:empty { display: none; }
.clubswitch select { min-height: 48px; font-size: 18px; font-weight: 600; padding: 8px 36px 8px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); max-width: 100%; }
.locked-venue { margin: 0 0 6px; font-size: 18px; }
.club-fields { margin-bottom: 20px; }
.admin-session { margin-bottom: 20px; }
.retention-note { margin-top: 24px; }
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .clubswitch { margin: 0 0 12px; flex: 1 1 100%; min-width: 0; }
  .clubswitch select { width: 100%; font-size: 17px; }
}
