/* Call to Table — base styles. No framework, no build step. */

/* Felt & Walnut: a green baize table, a walnut rail, ivory cards dealt on top. */
:root {
  --felt: #1E4636;
  --felt-deep: #163428;
  --felt-line: #3E6B57;
  --on-felt: #F3E9D8;
  --on-felt-muted: #CFE3D6;
  --walnut: #4A2E1C;
  --walnut-deep: #3A2314;
  --on-walnut: #F3E9D8;
  --on-walnut-muted: #E3D3BA;

  --bg: #F1E8D8;          /* parchment: inputs, hovers, wells inside cards */
  --surface: #FBF6EC;     /* ivory card */
  --ink: #2A2119;
  --card-muted: #6E5F4E;
  --muted: var(--card-muted);
  --line: #E0D2BA;
  --accent: #B63E27;      /* brick */
  --accent-ink: #fff;
  --link: var(--accent);
  --ok: #2F7D4F;
  --ok-bg: #E3F0E6;
  --ok-ink: #22603C;
  --warn: #A8731A;
  --warn-bg: #F6E8C9;
  --err: #B63E27;
  --err-bg: #F8E1DA;
  --info: #3D5A80;
  --info-bg: #E3EAF2;
  --radius: 18px;
  --shadow: 0 8px 0 var(--felt-deep);
  --font-display: "Baloo 2", "Nunito Sans", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 0 0 1rem; }
a { color: var(--link); text-underline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.topbar-nav { display: flex; align-items: center; gap: 0.5rem; }
.topbar-nav form { margin: 0; }
.whoami { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 999px; }
.whoami:hover { background: var(--bg); }
.whoami-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.avatar {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.9rem;
}
@media (max-width: 520px) { .whoami-name { display: none; } }

/* ---------- layout ---------- */
.page { max-width: 760px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) 1rem 4rem; }
.stack { display: grid; gap: 1.25rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem); box-shadow: var(--shadow);
}
.card-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; border-color: var(--warn); }
.card-notice h2 { margin-bottom: 0.25rem; }
.card-notice p { margin: 0; }
.auth-card { max-width: 420px; margin: 0 auto; }
.muted { color: var(--muted); margin-top: 0; }
.h-tight { margin: 0; font-size: 1.6rem; }

/* ---------- hero ---------- */
.hero { padding-top: 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; color: var(--accent); margin: 0 0 0.75rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin: 0 0 2rem; }

/* ---------- signed-in / out status ---------- */
.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: var(--shadow);
}
.status > div:first-of-type { flex: 1 1 14rem; }
.status-flat { background: none; border: 0; box-shadow: none; padding: 0; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: none; background: var(--muted); }
.status-in .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 0.55rem 1rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.92rem; }
.optional { font-weight: 400; color: var(--muted); margin-left: 0.25rem; }
.field input {
  font: inherit; width: 100%; padding: 0.65rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.has-error input { border-color: var(--err); }
.field-error { margin: 0; color: var(--err); font-size: 0.88rem; }
.hint { color: var(--muted); font-size: 0.85rem; }
.hint ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

/* show/hide password toggle (added by app.js) */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-toggle {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: none; border: 0; padding: 0.3rem 0.5rem; border-radius: 6px; cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface); }

.form-inline { grid-template-columns: 1fr auto; align-items: end; margin-top: 0; }
@media (max-width: 520px) { .form-inline { grid-template-columns: 1fr; } }
.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ---------- messages ---------- */
.flash-stack { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.alert { margin: 0; padding: 0.65rem 0.85rem; border-radius: 10px; font-size: 0.92rem; transition: opacity 0.4s; }
.alert p { margin: 0; }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-info, .alert-debug { background: var(--info-bg); color: var(--info); }
.alert.is-fading { opacity: 0; }

/* ---------- account details ---------- */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .details { grid-template-columns: 1fr; } .details dd { margin-bottom: 0.5rem; } }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); margin-left: 0.25rem; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* =================== groups =================== */
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.small { font-size: 0.85rem; }
.prewrap { white-space: pre-line; }
.nav-link { color: var(--ink); text-decoration: none; font-weight: 600; padding: 0.4rem 0.6rem; border-radius: 8px; }
.nav-link:hover { background: var(--bg); }
.crumb { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.page-head, .card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.page-head h1 { margin: 0; }
.card-head h2 { margin: 0; }
.card-head + * { margin-top: 1rem; }
.stack-sm { display: grid; gap: 0.5rem; margin-top: 1.25rem; }
.count { font-family: var(--font-body); font-size: 0.95rem; font-weight: 400; }

.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.card-danger { border-color: var(--err); }

.badge-role { background: var(--info-bg); color: var(--info); margin-left: 0.35rem; }

.field textarea {
  font: inherit; width: 100%; padding: 0.65rem 0.8rem; border-radius: 10px; resize: vertical;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }

.invite-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.invite-row > div { display: grid; min-width: 0; overflow-wrap: anywhere; }
.invite-row form { margin: 0; }
.card-invites { border-color: var(--accent); }

.group-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.group-card { display: block; color: var(--ink); text-decoration: none; transition: transform 0.12s, border-color 0.12s; }
.group-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.group-card h2 { margin-bottom: 0.4rem; }
.group-card p { margin: 0 0 0.4rem; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty, .invite-card { text-align: center; }
.empty .btn, .invite-card .btn { justify-self: center; }
.empty-die { font-size: 2.6rem; line-height: 1; color: var(--accent); margin: 0 0 0.5rem; }

.share { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.share p { margin-top: 0; }
.share .row { margin-top: 0.6rem; }
.share form { margin: 0; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 0.45rem 0.65rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
}

.member-row { display: flex; align-items: center; gap: 0.75rem; }
.member-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* <details> dropdown menu — works without JS */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 0.3rem); z-index: 5; min-width: 12rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 0.3rem;
}
.menu-body form { margin: 0; }
.menu-item {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 0.9rem;
  padding: 0.5rem 0.65rem; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer;
}
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--err); }

/* =================== events =================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-card { max-width: 620px; margin: 0 auto; }
.badge-coord { background: var(--ok-bg); color: var(--ok); margin-left: 0.35rem; }
.badge-attn { background: var(--accent); color: var(--accent-ink); }
.badge-danger { background: var(--err-bg); color: var(--err); }
.text-danger { color: var(--err); }

/* event list */
.event-row { display: flex; align-items: center; gap: 0.9rem; }
.event-row.is-cancelled { opacity: 0.6; }
.event-row.is-cancelled .event-title { text-decoration: line-through; }
.event-date {
  flex: none; width: 3.1rem; text-align: center; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); padding: 0.25rem 0; line-height: 1.1;
}
.event-month { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.event-day { display: block; font-size: 1.25rem; font-weight: 700; }
.event-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.event-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.event-title:hover { color: var(--accent); }
.past { margin-top: 1rem; }
.past summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

/* event detail */
.event-facts { margin: 1rem 0; }
.event-actions { margin-top: 1rem; }
.event-actions form { margin: 0; }
.option { display: grid; gap: 0.55rem; }
.list > li.option { padding: 1rem 0.85rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.6rem; }
.list > li.option:first-child { padding-top: 1rem; }
.option.is-best { border-color: var(--accent); }
.option.is-chosen { border-color: var(--ok); background: var(--ok-bg); }
.option.is-past { opacity: 0.65; }
.option-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1rem; align-items: baseline; }
.option-head .badge { margin-left: 0.35rem; }
.tally { display: flex; gap: 0.75rem; }
.tally-yes { color: var(--ok); font-weight: 600; }
.tally-maybe { color: var(--warn); font-weight: 600; }
.tally-no { color: var(--muted); font-weight: 600; }
.who p { margin: 0.1rem 0; }
.who-label { display: inline-block; min-width: 3.4rem; }
.option-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* yes / maybe / no segmented control */
.answer { display: inline-flex; border: 0; padding: 0; margin: 0; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-block; padding: 0.4rem 0.9rem; font-size: 0.88rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.seg + .seg span { border-left: 0; }
.seg:first-of-type span { border-radius: 8px 0 0 8px; }
.seg:last-of-type span { border-radius: 0 8px 8px 0; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; position: relative; z-index: 1; }
.seg-yes input:checked + span { background: var(--ok); color: #fff; border-color: var(--ok); }
.seg-maybe input:checked + span { background: var(--warn); color: #fff; border-color: var(--warn); }
.seg-no input:checked + span { background: var(--muted); color: var(--surface); border-color: var(--muted); }
.respond-bar {
  position: sticky; bottom: 0; padding: 0.75rem 0 0.25rem; margin-top: 0.25rem;
  background: linear-gradient(to bottom, transparent, var(--surface) 35%);
}
.waiting { margin: 1rem 0 0; }
.games { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.3rem; }

/* =================== full-screen calendar =================== */
html.cal-locked, html.cal-locked body { overflow: hidden; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.windows-field .hint { margin: 0; }
.window-summary { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; display: grid; gap: 0.2rem; }
.window-summary li.muted { list-style: none; margin-left: -1.2rem; }
.prefill-note { margin: 0.75rem 0 0; }
.cal-launch { margin: 1rem 0 0.5rem; }
.subhead { margin: 1.4rem 0 0.5rem; font-size: 0.95rem; }
.my-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.92rem; }
.my-answers .badge { margin: 0 0.35rem 0 0; min-width: 3.4rem; text-align: center; }
.badge-ans-yes { background: var(--ok); color: #fff; }
.badge-ans-maybe { background: var(--warn); color: #fff; }
.badge-ans-no { background: var(--muted); color: var(--surface); }

/* quick answer panel on the event page */
.quick-answer {
  display: grid; gap: 0.75rem; padding: 1rem; margin: 1rem 0 0.5rem;
  border: 2px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.quick-answer p { margin: 0; }
.quick-answer form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.quick-answer-alt { font-size: 0.85rem; color: var(--muted); }

/* overlay shell */
.cal-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--ink); display: flex; }
.cal-shell { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.cal-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  padding: 0.75rem clamp(0.75rem, 3vw, 1.5rem);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.cal-titlebox { flex: 1 1 18rem; min-width: 0; }
.cal-title { margin: 0; font-size: 1.25rem; }
.cal-help { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; font-size: 0.8rem; color: var(--muted); }
.cal-key::before {
  content: ""; display: inline-block; width: 0.85rem; height: 0.85rem; border-radius: 3px;
  vertical-align: -0.12rem; margin-right: 0.3rem;
}
.cal-key-box::before { background: var(--surface); border: 2px solid var(--accent); }
.cal-key-yes::before { background: var(--ok); }
.cal-key-maybe::before { background: var(--warn); }
.cal-key-no::before { background: var(--muted); }
.cal-key-heat::before { background: linear-gradient(90deg, var(--surface), var(--ok)); border: 1px solid var(--line); }
.cal-actions { display: flex; gap: 0.4rem; margin-left: auto; }

.cal-tools {
  display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.5rem clamp(0.75rem, 3vw, 1.5rem);
  background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: thin;
}
.chip {
  flex: none; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
}
.chip:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chip-quiet { border-color: var(--line); color: var(--muted); }
.cal-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; position: relative; }
.cal-body.is-stacked { display: grid; gap: 1rem; align-content: start; padding-bottom: 1rem; }
.cal-foot {
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 0.6rem clamp(0.75rem, 3vw, 1.5rem); display: grid; gap: 0.5rem; font-size: 0.9rem; min-height: 3.2rem;
}
.cal-footrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.cal-footrow.muted { color: var(--muted); }
.cal-warn { color: var(--warn); font-weight: 600; }
.cal-answerbar-buttons { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.ans {
  font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer;
  padding: 0.45rem 0.85rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.ans-yes.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans-maybe.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }
.ans-no.is-on { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.ans-remove { color: var(--err); border-color: transparent; background: transparent; }
.cal-picktext { font-weight: 600; }

/* ---- the grid ---- */
.cal-grid {
  --cell-h: 1.6rem;
  --gutter: 3.6rem;
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--cols), minmax(2.5rem, 1fr));
  min-width: max-content; width: 100%;
  user-select: none; -webkit-user-select: none;
}
.cal-grid.has-rail { grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)) 2.75rem; min-width: 0; }
.cal-corner, .cal-dayhead {
  position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line);
}
.cal-corner { left: 0; z-index: 4; }
.cal-dayhead { display: grid; justify-items: center; padding: 0.4rem 0.1rem; line-height: 1.1; }
.cal-dow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cal-dnum { font-size: 1.15rem; font-weight: 700; }
.cal-mon { font-size: 0.7rem; color: var(--muted); }

.cal-gutter { position: sticky; left: 0; z-index: 2; background: var(--bg); touch-action: pan-y; }
.cal-gutter, .cal-col, .cal-rail { padding: 0.6rem 0; }
.cal-time {
  height: var(--cell-h); font-size: 0.7rem; color: var(--muted); text-align: right;
  padding-right: 0.45rem; transform: translateY(-0.45rem); white-space: nowrap;
}
.cal-col { padding-left: 4px; padding-right: 4px; }
.cal-paintable .cal-col { touch-action: none; }
.cal-rail {
  touch-action: pan-y; display: flex; justify-content: center; color: var(--line);
  border-left: 1px dashed var(--line); margin-left: 0.4rem;
}
.cal-rail span { position: sticky; top: 45%; height: max-content; font-size: 1.1rem; }

.cal-cell {
  height: var(--cell-h); position: relative;
  border-top: 1px dotted color-mix(in srgb, var(--line) 60%, transparent);
  display: flex; align-items: flex-start; justify-content: space-between;
  font-size: 0.72rem; line-height: 1;
}
.cal-cell.is-hour { border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.cal-paintable .cal-cell { cursor: crosshair; }

/* outside the options: plain and faded */
.cal-cell.outside { opacity: 0.45; cursor: default; }
.cal-paintable .cal-cell.outside { cursor: not-allowed; }

/* the outlined box around times you can pick (and coordinator's painted windows) */
.cal-cell.box {
  background: var(--surface);
  border-top-color: color-mix(in srgb, var(--line) 50%, transparent);
  box-shadow: inset 2px 0 var(--accent), inset -2px 0 var(--accent);
}
.cal-cell.box.box-top { border-top-color: transparent; border-top-left-radius: 8px; border-top-right-radius: 8px;
  box-shadow: inset 2px 0 var(--accent), inset -2px 0 var(--accent), inset 0 2px var(--accent); }
.cal-cell.box.box-bottom { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
  box-shadow: inset 2px 0 var(--accent), inset -2px 0 var(--accent), inset 0 -2px var(--accent); }
.cal-cell.box.box-top.box-bottom { box-shadow: inset 0 0 0 2px var(--accent); }

/* member blocks, drawn inside the box */
.cal-cell.blk::before {
  content: ""; position: absolute; inset: -1px 5px 0; z-index: 0;  /* -1px covers the row line */
}
.cal-cell.blk.blk-start::before { top: 3px; border-top-left-radius: 6px; border-top-right-radius: 6px; }
.cal-cell.blk.blk-end::before { bottom: 3px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
.cal-cell.blk-yes::before { background: var(--ok); }
.cal-cell.blk-maybe::before { background: var(--warn); }
.cal-cell.blk-no::before { background: var(--muted); }
.cal-cell.blk-unset::before {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-left: 2px dashed var(--accent); border-right: 2px dashed var(--accent);
}
.cal-cell.blk-unset.blk-start::before { border-top: 2px dashed var(--accent); }
.cal-cell.blk-unset.blk-end::before { border-bottom: 2px dashed var(--accent); }
.cal-cell.blk { cursor: pointer; color: #fff; }
.cal-cell.blk-no, .cal-cell.blk-unset { color: var(--ink); }
.cal-cell.blk-no { color: var(--surface); }
.cal-cell.blk-unset { color: var(--accent); }
.cal-cell.blk-selected::before { box-shadow: inset 3px 0 var(--ink), inset -3px 0 var(--ink); }
.cal-cell.blk-selected.blk-start::before { box-shadow: inset 3px 0 var(--ink), inset -3px 0 var(--ink), inset 0 3px var(--ink); }
.cal-cell.blk-selected.blk-end::before { box-shadow: inset 3px 0 var(--ink), inset -3px 0 var(--ink), inset 0 -3px var(--ink); }
.cal-cell.blk-selected.blk-start.blk-end::before { box-shadow: inset 0 0 0 3px var(--ink); }
.cal-tag, .cal-x { position: relative; z-index: 1; }
.cal-tag { font-weight: 700; padding: 0.35rem 0 0 0.6rem; white-space: nowrap; pointer-events: none; }
.cal-x {
  font: inherit; font-size: 0.85rem; font-weight: 700; line-height: 1; color: inherit;
  background: rgba(0, 0, 0, 0.16); border: 0; border-radius: 4px; width: 1.2rem; height: 1.2rem;
  margin: 0.25rem 0.45rem 0 0; padding: 0; cursor: pointer;
}
.cal-x:hover { background: rgba(0, 0, 0, 0.32); }

/* results heatmap */
.cal-cell.heat { background: color-mix(in srgb, var(--ok) calc(var(--heat) * 100%), var(--surface)); }
.cal-cell.picked::after {
  content: ""; position: absolute; inset: 0 3px; border-left: 3px solid var(--ink); border-right: 3px solid var(--ink);
}
.cal-cell.picked.pick-start::after { border-top: 3px solid var(--ink); }
.cal-cell.picked.pick-end::after { border-bottom: 3px solid var(--ink); }

/* live drag preview */
.cal-cell.preview::after {
  content: ""; position: absolute; inset: 0 3px; z-index: 2;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ---- phones ---- */
@media (max-width: 640px) {
  .cal-top { gap: 0.4rem 0.75rem; }
  .cal-help { font-size: 0.8rem; }
  .cal-actions { width: 100%; }
  .cal-actions .btn-primary { margin-left: auto; }
    .cal-grid { --cell-h: 2.25rem; --gutter: 3.2rem; }
  .cal-body.is-stacked .cal-dayhead { grid-auto-flow: column; gap: 0.4rem; align-items: baseline; justify-content: start; padding-left: 0.5rem; }
  .cal-time { font-size: 0.66rem; }
  .cal-tag { font-size: 0.8rem; }
}

/* =================== month view (coordinator setup) =================== */
.cal-monthnav { display: flex; align-items: center; gap: 0.5rem; }
.cal-monthlabel { min-width: 9.5rem; text-align: center; font-size: 1.05rem; }
.cal-timebar { flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; overflow-x: visible; }
.cal-times { display: flex; gap: 0.6rem; }
.tfield { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.tfield input {
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--ink); padding: 0.4rem 0.5rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.tfield input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.cal-setbar { display: flex; gap: 0.4rem; margin-left: auto; }
.cal-status { font-weight: 600; }
.cal-daytimes { justify-content: flex-start; }
.cal-daytime { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }

.cal-month {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--weeks), minmax(6.5rem, 1fr));
  gap: 4px; padding: 0.75rem clamp(0.5rem, 2vw, 1.25rem); min-height: 100%;
}
.cal-mhead { text-align: center; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-bottom: 0.25rem; }
.mday {
  position: relative; display: flex; flex-direction: column; gap: 0.25rem; min-width: 0;
  padding: 0.35rem; border-radius: 10px; cursor: pointer; user-select: none;
  background: var(--surface); border: 2px solid var(--line);
}
.mday:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.mday:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mday-num { font-weight: 700; font-size: 0.95rem; line-height: 1; }
.mday.is-today .mday-num {
  background: var(--ink); color: var(--surface); border-radius: 999px; padding: 0.15rem 0.45rem; align-self: flex-start;
}
.mday.is-other { opacity: 0.55; }
.mday.is-past { opacity: 0.35; cursor: not-allowed; background: transparent; }
.mday.is-past:hover { border-color: var(--line); }
.mday.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.mday-check {
  position: absolute; top: 0.3rem; right: 0.3rem; width: 1.15rem; height: 1.15rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 800;
  background: var(--accent); color: var(--accent-ink);
}
.cal-setup-month { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.cal-setup-month .mday { touch-action: manipulation; }
.cal-quicksel { display: flex; align-items: center; gap: 0.35rem; }
.cal-quicksel-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-right: 0.15rem; }
.cal-selrow { justify-content: flex-start; }
.cal-seltext { margin-right: auto; }
.mday-lines { display: grid; gap: 3px; min-width: 0; }
.mline {
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; min-width: 0;
  background: var(--accent); color: var(--accent-ink); border-radius: 6px;
  font-size: 0.74rem; font-weight: 600; padding: 0.15rem 0.2rem 0.15rem 0.4rem;
}
.mline-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mline-x {
  flex: none; font: inherit; font-size: 0.85rem; line-height: 1; width: 1.15rem; height: 1.15rem; padding: 0;
  border: 0; border-radius: 4px; background: rgba(0, 0, 0, 0.18); color: inherit; cursor: pointer;
}
.mline-x:hover { background: rgba(0, 0, 0, 0.35); }

@media (max-width: 640px) {
  .cal-mode-month .cal-help { display: none; }
  .cal-mode-month .cal-titlebox { flex: 1 1 auto; }
  .cal-mode-month .cal-top { padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .cal-mode-month .cal-actions { width: auto; margin-left: auto; }
  .cal-mode-month .cal-monthnav { order: 3; width: 100%; justify-content: center; }
  /* controls sit at the bottom, within thumb reach; hours appear once days are selected */
  .cal-mode-month .cal-body { order: 2; }
  .cal-mode-month .cal-foot { order: 3; min-height: 0; gap: 0.3rem; padding-top: 0.4rem; padding-bottom: 0.4rem; font-size: 0.85rem; }
  .cal-mode-month .cal-tools {
    order: 4; border-bottom: 0; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(20, 16, 12, 0.06);
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }
  .cal-mode-month:not(.has-selection) .cal-times,
  .cal-mode-month:not(.has-selection) .cal-presets,
  .cal-mode-month:not(.has-selection) .cal-setbar { display: none; }
  .cal-quicksel { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .cal-quicksel .chip { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
  .cal-times { width: 100%; }
  .cal-times .tfield { flex: 1; }
  .cal-times input { width: 100%; }
  .mday-check { top: 0.2rem; right: 0.2rem; width: 0.95rem; height: 0.95rem; font-size: 0.6rem; }
  .cal-timebar { gap: 0.45rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .cal-presets { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .cal-presets .chip { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
  .mline-x { display: none; }
  .mline { justify-content: center; }
  .mline-text { overflow: visible; text-overflow: clip; white-space: normal; text-align: center; line-height: 1.15; }
  .cal-month { grid-template-rows: auto repeat(var(--weeks), minmax(3.9rem, 1fr)); gap: 3px; padding: 0.5rem; min-height: 100%; }
  .mday { padding: 0.25rem; border-width: 1px; border-radius: 8px; }
  .mday-num { font-size: 0.8rem; }
  .mline { font-size: 0.62rem; padding: 0.1rem 0.15rem; border-radius: 4px; }
  .mline-x { width: 0.95rem; height: 0.95rem; font-size: 0.72rem; }
  .cal-setbar { margin-left: 0; width: 100%; }
  .cal-setbar .btn-primary { flex: 1; }
  .cal-monthlabel { min-width: 7.5rem; font-size: 0.95rem; }
  .tfield input { font-size: 0.95rem; }
}

/* =================== member month view =================== */
.cal-back { order: -1; }
.cal-key-some::before { background: linear-gradient(135deg, var(--ok) 50%, var(--warn) 50%); }
.cal-answer-month .mday { cursor: default; }
.cal-answer-month .mday.is-off { background: transparent; border-color: transparent; opacity: 0.4; }
.cal-answer-month .mday.is-off:hover { border-color: transparent; }
.cal-answer-month .mday.is-option { cursor: pointer; border-color: var(--accent); }
.cal-answer-month .mday.ans-yes { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); border-color: var(--ok); }
.cal-answer-month .mday.ans-no { background: color-mix(in srgb, var(--muted) 14%, var(--surface)); border-color: var(--muted); }
.cal-answer-month .mday.ans-some { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: var(--warn); }
.cal-answer-month .mday.is-focus { box-shadow: 0 0 0 3px var(--ink); }
.mday-head { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; }
.mday-state { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.ans-yes .mday-state { color: var(--ok); }
.ans-no .mday-state { color: var(--muted); }
.ans-some .mday-state { color: var(--warn); }
.mline-opt {
  background: transparent; color: var(--accent); border: 1.5px solid var(--accent);
  justify-content: center; padding: 0.1rem 0.3rem; font-size: 0.72rem;
}
.ans-yes .mline-opt { color: var(--ok); border-color: var(--ok); }
.ans-no .mline-opt { color: var(--muted); border-color: var(--muted); text-decoration: line-through; }
.ans-some .mline-opt { color: var(--warn); border-color: var(--warn); }
.mday-actions { display: flex; gap: 3px; margin-top: auto; }
.mact {
  flex: 1; min-width: 0; font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  padding: 0.3rem 0.1rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.mact:hover { border-color: var(--accent); }
.mact-yes.is-on { background: var(--ok); border-color: var(--ok); color: #fff; }
.mact-no.is-on { background: var(--muted); border-color: var(--muted); color: var(--surface); }
.mact-some.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }

/* bottom sheet: one day's Yes / No / Some times */
.cal-sheet { display: grid; gap: 0.6rem; padding: 0.25rem 0 0.15rem; }
.cal-sheet-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.cal-sheet-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: 0.5rem; }
.cal-sheet-buttons .ans { padding: 0.75rem 0.5rem; font-size: 1rem; }
.ans-some.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }
.ans-yes:not(.is-on) { border-color: var(--ok); color: var(--ok); }
.ans-no:not(.is-on) { border-color: var(--muted); }
.ans-some:not(.is-on) { border-color: var(--warn); color: var(--warn); }

@media (max-width: 640px) {
  .mday-actions { display: none; }
  .cal-answer-month .mday { min-height: 4.4rem; }
  .mday-state { font-size: 0.85rem; }
  .mline-opt { font-size: 0.6rem; padding: 0.05rem 0.1rem; border-width: 1px; }
  .cal-mode-availability .cal-help { display: none; }
  .cal-mode-availability .cal-legend { order: 3; width: 100%; }
  .cal-mode-availability .cal-actions { width: auto; margin-left: auto; }
  .cal-mode-availability .cal-monthnav { order: 4; width: 100%; justify-content: center; }
  .cal-sheet-buttons { grid-template-columns: 1fr 1fr; }
  .cal-sheet-buttons .ans-some { grid-column: span 2; }
  .cal-foot { padding-bottom: max(0.6rem, env(safe-area-inset-bottom)); }
}

/* No double-tap-to-zoom wait on calendar controls: taps register immediately. */
.cal-overlay button, .cal-overlay .mday, .cal-overlay input { touch-action: manipulation; }

.cal-overlay { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  .cal-mode-availability .cal-titlebox, .cal-mode-results .cal-titlebox { flex: 1 1 0; min-width: 0; }
  .cal-mode-availability .cal-title { font-size: 1.1rem; }
  .cal-mode-availability .cal-top { padding-top: 0.5rem; padding-bottom: 0.5rem; gap: 0.35rem 0.5rem; }
  .cal-mode-availability .cal-back { order: 0; }
  .cal-mode-availability .cal-legend { font-size: 0.72rem; gap: 0.2rem 0.6rem; }
  .cal-mode-availability .cal-key::before { width: 0.7rem; height: 0.7rem; }
}

/* member "some times" blocks: time label top-left, plain white × centred on the block */
.cal-cell .cal-x {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  width: 2rem; height: 2rem; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 50%;
  color: #fff; font-size: 1.5rem; font-weight: 400; line-height: 1; cursor: pointer;
}
.cal-cell .cal-x.cal-x-edge { top: 100%; }
.cal-cell .cal-x:hover, .cal-cell .cal-x:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; }
.cal-mode-availability .cal-tag { font-weight: 600; opacity: 0.95; }
.cal-mode-availability .cal-cell.blk { cursor: default; }
/* one day's grid doesn't need the full width of a big screen */
.cal-mode-availability .cal-grid { max-width: 40rem; margin: 0 auto; }

/* event lists: unscheduled events have no date tile, just a call to action */
.event-cta { flex: none; }
.event-date-tbd { border-style: dashed; background: transparent; }
.event-date-tbd .event-month { color: var(--muted); }
.event-date-tbd .event-day { color: var(--muted); }
@media (max-width: 520px) {
  .event-row.is-open { flex-wrap: wrap; }
  .event-row.is-open .event-cta { width: 100%; }
}

/* =================== popups =================== */
dialog.modal {
  width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
dialog.modal { overflow-y: auto; overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgba(20, 16, 12, 0.45); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem 0.5rem; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-close {
  font: inherit; font-size: 1.6rem; line-height: 1; width: 2.25rem; height: 2.25rem; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 0.5rem 1.25rem 1.25rem; }
.modal-body .share:first-of-type { margin-top: 1.25rem; }
.count-pill {
  display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px;
  font-size: 0.72rem; background: rgba(255, 255, 255, 0.25);
}
@media (max-width: 520px) {
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
}

/* header + profile */
.nav-link.is-current { background: var(--bg); }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-top: 0.25rem; }
.profile-head p { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.avatar-lg { width: 3.25rem; height: 3.25rem; font-size: 1.4rem; flex: none; }
@media (max-width: 520px) { .topbar-nav .nav-link { padding: 0.4rem 0.4rem; font-size: 0.9rem; } }
@media (max-width: 520px) { .topbar-nav > form { display: none; } }  /* Sign out lives on the profile page on phones */
@media (max-width: 520px) { .brand { white-space: nowrap; font-size: 1rem; } .topbar { gap: 0.5rem; } }

.event-group { color: var(--accent); }
.event-sep { color: var(--muted); font-weight: 400; }
.profile-form { margin-top: 0; max-width: 28rem; }
.profile-form input[type="number"], .notice-form input[type="number"] { max-width: 7rem; }

/* event page: your free times */
.free-time { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.free-time form { margin: 0; }
.free-time.is-too-soon > span:first-child { color: var(--muted); }
.free-x {
  flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font: inherit; font-size: 1.4rem; line-height: 1;
}
.free-x:hover, .free-x:focus-visible { color: var(--err); background: var(--err-bg); outline: none; }
.notice-form { grid-template-columns: 1fr; }
.notice-form .field { max-width: 30rem; }
#notice-dialog .notice-form { margin-top: 1rem; }

/* days' notice */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.radio-list { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.radio { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.radio input { width: auto; margin: 0; }
.notice-line { margin: 0.75rem 0 0; }
#notice-dialog p { margin: 0.75rem 0; }

/* results: who's free, written on each stretch */
.cal-who {
  position: absolute; z-index: 1; top: 2px; left: 6px; right: 6px;
  height: calc(var(--cell-h) * var(--rows) - 4px); overflow: hidden; pointer-events: none;
  display: block; padding: 0.15rem 0.3rem;
  font-size: 0.72rem; line-height: 1.25; color: var(--ink);
}
.cal-who-count { font-size: 0.68rem; font-weight: 800; opacity: 0.7; margin-right: 0.3rem; }
.cal-who-names { font-weight: 600; overflow-wrap: anywhere; }
.cal-who.is-dark { color: #fff; }
.cal-who.is-dark .cal-who-count { opacity: 0.9; }
.cal-mode-results .cal-cell.box { border-top-color: transparent; }
.cal-mode-results .cal-cell.box.who-start:not(.box-top) { border-top: 2px solid var(--bg); }
.cal-dayhead.is-filler { background: var(--bg); }
.cal-col.is-filler { opacity: 0.5; }
.cal-pagelabel { min-width: 11rem; }
.cal-mode-results .cal-grid { min-width: 0; grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)); }
.cal-mode-results .cal-grid.has-rail { grid-template-columns: var(--gutter) repeat(var(--cols), minmax(0, 1fr)) 2.75rem; }
.cal-setbar .btn:disabled { cursor: not-allowed; opacity: 0.5; }
@media (max-width: 640px) {
  .cal-who { font-size: 0.8rem; }
  .cal-mode-results .cal-legend { display: none; }
  .cal-mode-results .cal-titlebox { flex: 1 1 0; }
  .cal-mode-results .cal-actions { width: auto; }
  .cal-mode-results .cal-help { font-size: 0.78rem; }
}
#notice-dialog .notice-days { display: flex; align-items: center; gap: 0.75rem; }
#notice-dialog .notice-days input { max-width: 5.5rem; }
#notice-dialog .modal-body > p:first-child { margin-top: 1rem; }

/* setup calendar: weekday bubbles + your own quick times */
.cal-quicksel { flex-wrap: wrap; }
.cal-wdbubbles { display: flex; gap: 0.25rem; margin-right: 0.35rem; }
.wd-bubble {
  flex: none; width: 2rem; height: 2rem; border-radius: 999px; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.wd-bubble:hover { border-color: var(--accent); }
.wd-bubble.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wd-bubble:disabled { opacity: 0.35; cursor: not-allowed; }
.cal-presets { align-items: center; }
.chip-preset { display: inline-flex; align-items: center; gap: 0.35rem; border-color: var(--accent); color: var(--ink); }
.chip-preset .chip-label { font-weight: 700; color: var(--accent); }
.chip-preset .chip-range { font-weight: 600; }
.chip-preset.is-editing { border-style: dashed; border-color: var(--err); }
.chip-preset .chip-x { color: var(--err); font-weight: 800; margin-left: 0.1rem; }
.chip-add { border-style: dashed; border-color: var(--line); color: var(--muted); }
.chip-add:hover { color: var(--accent); border-color: var(--accent); }
.cal-presets-empty { font-size: 0.82rem; color: var(--muted); }
@media (max-width: 640px) {
  .cal-quicksel { flex-wrap: wrap; overflow: visible; gap: 0.4rem 0.35rem; }
  .cal-quicksel-label { display: none; }
  .cal-wdbubbles { width: 100%; justify-content: space-between; margin-right: 0; }
  .wd-bubble { width: 2.2rem; height: 2.2rem; font-size: 0.8rem; }
  .cal-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
}
.chip-wd.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---- "When you're free": a date tile per possible day; tap one to change it ---- */
.fc-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.fc-tile {
  font: inherit; color: var(--ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.fc-dow { display: block; font-size: 0.66rem; font-weight: 600; color: var(--muted); }
.fc-tile.fc-free { background: var(--ok); border-color: var(--ok); }
.fc-tile.fc-free .event-month, .fc-tile.fc-free .event-day, .fc-tile.fc-free .fc-dow { color: #fff; }
.fc-tile.fc-no { background: color-mix(in srgb, var(--muted) 25%, var(--surface)); border-color: transparent; }
.fc-tile.fc-no .event-month, .fc-tile.fc-no .event-day { color: var(--muted); }
.fc-tile.fc-none { background: var(--surface); border: 2px dashed var(--accent); }
.fc-tile:hover:not(:disabled) { filter: brightness(0.95); transform: translateY(-1px); }
.fc-tile:disabled { opacity: 0.45; cursor: default; }
.fc-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn {
  font: inherit; font-size: 1.05rem; line-height: 1; width: 2.1rem; height: 2.1rem; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }

/* =================== game library =================== */
.game-grid {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}
.game-card {
  width: 100%; display: grid; gap: 0.2rem; text-align: left; cursor: pointer; padding: 0;
  font: inherit; color: var(--ink); background: none; border: 0; -webkit-tap-highlight-color: transparent;
}
.game-card:hover .game-cover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20, 16, 12, 0.14); }
.game-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.game-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line); transition: transform 0.15s, box-shadow 0.15s;
}
.game-cover-blank {
  display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.game-name { font-weight: 700; margin-top: 0.35rem; overflow-wrap: anywhere; }
.game-meta { font-size: 0.8rem; color: var(--muted); }

.game-view { width: min(44rem, 100vw - 2rem); }
.game-view-body { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.game-view-body .game-cover { transition: none; }
.game-view-meta { margin: 0 0 0.75rem; font-weight: 600; }
.game-view-actions { margin-top: 1rem; }
.game-form-dialog { width: min(36rem, 100vw - 2rem); }
.game-form { margin-top: 1rem; }
.game-form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.image-field .label { font-weight: 600; }
.file-btn { position: relative; overflow: hidden; justify-self: start; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-current { display: flex; align-items: center; gap: 0.75rem; }
.image-current .game-cover { width: 5rem; }
.cropper { display: grid; gap: 0.5rem; justify-items: center; }
.crop-stage {
  position: relative; width: min(100%, 20rem); aspect-ratio: 1; overflow: hidden; border-radius: 12px;
  background: repeating-conic-gradient(var(--line) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 0.5rem; width: min(100%, 20rem); font-weight: 700; color: var(--muted); }
.crop-zoom input { flex: 1; }
.cropper .hint { margin: 0; text-align: center; }

@media (max-width: 520px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .game-view-body { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.9rem; }
  .game-form-row { grid-template-columns: 1fr 1fr; }
  .game-form-row .field:last-child { grid-column: 1 / -1; }
}

/* Phones: with Dashboard · Groups · Library in the header, the logo drops its wordmark. */
@media (max-width: 520px) { .topbar.has-nav .brand-name, .topbar .brand-name { display: none; } }
@media (min-width: 521px) { .brand-name { display: inline; } }
@media (max-width: 360px) { .topbar-nav .nav-link { padding: 0.35rem 0.3rem; font-size: 0.85rem; } .topbar-nav { gap: 0.15rem; } }

/* =================== event form: game picker =================== */
.games-field { position: relative; }
.picked-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.picked-game {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.35rem 0.4rem 0.35rem 0.35rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.picked-game.is-custom { border-style: dashed; }
.pg-cover, .gs-cover {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 7px; object-fit: cover;
  display: grid; place-items: center; font-weight: 800; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.gs-cover { width: 2rem; height: 2rem; border-radius: 6px; }
.pg-text, .gs-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.pg-name, .gs-name { font-weight: 700; overflow-wrap: anywhere; }
.pg-meta, .gs-meta { font-size: 0.78rem; color: var(--muted); }
.pg-x {
  flex: none; width: 2rem; height: 2rem; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font: inherit; font-size: 1.2rem; cursor: pointer;
}
.pg-x:hover { color: var(--err); background: var(--bg); }
.game-search { position: relative; }
.game-search input { width: 100%; }
.game-suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.3rem;
  list-style: none; max-height: 18rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px -12px rgba(20, 16, 12, 0.35);
}
.gs-option { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 8px; cursor: pointer; }
.gs-option.is-active, .gs-option:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.gs-plus {
  flex: none; width: 2rem; height: 2rem; border-radius: 6px; display: grid; place-items: center;
  border: 1px dashed var(--accent); color: var(--accent); font-weight: 800;
}
.gs-empty { padding: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.games-row { display: flex; gap: 0.5rem; align-items: center; }
.games-row .game-search { flex: 1; min-width: 0; }
.games-row .btn { flex: none; white-space: nowrap; }
@media (max-width: 520px) { .games-row { flex-wrap: wrap; } .games-row .game-search { flex-basis: 100%; } .games-row .btn { order: -1; } }

/* event page: games list with covers */
.games-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.games-list li { display: flex; align-items: center; gap: 0.7rem; }
.games-list .pg-cover { width: 2.75rem; height: 2.75rem; }
.games-list a { color: inherit; }

/* ======================================================================
   Felt & Walnut theme
   The page is the felt; the walnut rail holds navigation; content is dealt
   onto ivory cards. Anything light (cards, popups, the calendar) re-scopes
   --muted / --link so the same components read correctly on either.
   ====================================================================== */
body { background: var(--felt); color: var(--on-felt); }

.page {
  max-width: 1080px; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) 4rem;
  color: var(--on-felt); --muted: var(--on-felt-muted); --link: var(--on-felt);
}
.card, dialog.modal, .status, .cal-overlay, .menu-body, .game-suggest, .auth-card {
  color: var(--ink); --muted: var(--card-muted); --link: var(--accent);
}
.page h1 { font-weight: 800; font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.card h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-weight: 700; font-size: 1.35rem; }
h3 { font-family: var(--font-display); font-weight: 700; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.6rem) clamp(1.1rem, 3vw, 1.6rem);
}
.card-notice { box-shadow: var(--shadow), inset 4px 0 0 var(--warn); }
.card-danger { box-shadow: var(--shadow), inset 4px 0 0 var(--err); }
.card-invites { box-shadow: var(--shadow), inset 4px 0 0 var(--accent); }
.card-flush { padding: 0; overflow: hidden; }
.stack { gap: 1.75rem; }

/* section labels sitting on the felt */
.section { display: grid; gap: 0.75rem; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.25rem; }
.section-label {
  margin: 0; font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-felt-muted);
}
.section-label .count { letter-spacing: 0; text-transform: none; font-weight: 600; margin-left: 0.25rem; }
.split { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: flex-start; }
.split > .main { flex: 3 1 28rem; min-width: 0; display: grid; gap: 1.75rem; }
.split > .side { flex: 2 1 18rem; min-width: 0; display: grid; gap: 1.75rem; }

/* page header on the felt */
.page-title { display: grid; gap: 0.5rem; }
.page-title h1 { margin: 0; color: var(--on-felt); }
.page-title .crumb, .page-title .crumb a { color: var(--on-felt-muted); font-weight: 600; text-decoration: none; font-size: 0.95rem; margin: 0; }
.page-title .crumb a:hover { color: var(--on-felt); }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.title-row h1 { flex: 1 1 auto; }
.title-row h1.flex-none { flex: 0 1 auto; }
.title-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; color: var(--on-felt-muted); font-weight: 600; margin: 0; }
.title-meta svg { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 0.3rem; fill: none; stroke: currentColor; stroke-width: 2; }
.title-note { margin: 0.25rem 0 0; color: var(--on-felt); max-width: 46rem; }
.title-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.title-actions form { margin: 0; }
.page-title .badge, .page-head .badge { background: var(--on-felt); color: var(--walnut); font-size: 0.8rem; padding: 0.25rem 0.75rem; }
.page-title .badge-ok { background: var(--ok); color: #fff; }
.page-title .badge-danger { background: var(--err); color: #fff; }
.page-head h1 { color: var(--on-felt); }

/* ---------- buttons ---------- */
.btn { font-weight: 700; font-size: 0.98rem; padding: 0.7rem 1.15rem; border-radius: 12px; border-width: 0; }
.btn-small { padding: 0.5rem 0.9rem; font-size: 0.9rem; border-radius: 10px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #A2341F; filter: none; }
.btn-ghost {
  background: transparent; color: inherit; border: 1.5px solid color-mix(in srgb, currentColor 28%, transparent);
}
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-light { background: var(--on-felt); color: var(--walnut); }
.btn-light:hover { background: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #276B43; }
.text-danger { color: var(--err) !important; }
.page-title .text-danger { color: #F4B3A5 !important; }
.icon-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 10px; border: 1.5px solid var(--line);
  color: var(--muted); display: inline-grid; place-items: center; font-size: 1.15rem;
}
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink); background: var(--bg); }
.page-title .icon-btn { border-color: var(--felt-line); color: var(--on-felt); }
.page-title .icon-btn:hover { background: color-mix(in srgb, var(--on-felt) 10%, transparent); border-color: var(--on-felt); }
.icon-btn-label { display: none; }

/* ---------- forms ---------- */
.field label, .field-label { font-weight: 700; }
.field input, .field textarea, .field select, .copy-row input, .tfield input {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; color: var(--ink);
}
.field select { font: inherit; width: 100%; padding: 0.65rem 0.8rem; }
.field input:focus, .field textarea:focus, .field select:focus, .tfield input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent);
}
.has-error input, .has-error textarea { border-color: var(--err); }

/* ---------- badges + alerts ---------- */
.badge { font-weight: 700; padding: 0.15rem 0.6rem; background: var(--warn-bg); color: #7A5410; }
.badge-ok, .badge-coord { background: var(--ok-bg); color: var(--ok-ink); }
.badge-role { background: var(--info-bg); color: var(--info); }
.badge-attn { background: var(--accent); color: #fff; }
.alert { border-radius: 12px; font-weight: 600; box-shadow: 0 4px 0 var(--felt-deep); }
.alert-error { background: var(--err-bg); color: #8E2B18; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); }
.alert-warning { background: var(--warn-bg); color: #7A5410; }
.alert-info, .alert-debug { background: var(--surface); color: var(--ink); }

/* ---------- avatars ---------- */
.avatar { background: #C8452D; color: #fff; font-family: var(--font-body); }
.member-row:nth-child(5n+2) .avatar { background: var(--ok); }
.member-row:nth-child(5n+3) .avatar { background: #B8860B; }
.member-row:nth-child(5n+4) .avatar { background: var(--info); }
.member-row:nth-child(5n+5) .avatar { background: #8A2E3B; }

/* ---------- date tiles (event lists + "when you're free") ---------- */
.event-row { gap: 1.1rem; }
.list.events > li { padding: 1rem 0; }
.list.events > li:first-child { padding-top: 0; }
.list.events > li:last-child { padding-bottom: 0; }
.event-date {
  width: 3.6rem; height: 4rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: var(--ok); color: #fff; padding: 0; line-height: 1.05;
}
.event-month { color: inherit; font-size: 0.7rem; letter-spacing: 0.1em; }
.event-day { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }
.event-date-tbd { background: transparent; border: 2px dashed var(--accent); color: var(--accent); }
.event-date-tbd .event-month { display: none; }
.event-date-tbd .event-day { color: var(--accent); }
.event-row.is-cancelled .event-date { background: var(--bg); color: var(--card-muted); }
.event-title { font-family: var(--font-display); font-size: 1.15rem; }
.event-title:hover { color: var(--accent); }
.event-group { font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; display: block; color: var(--card-muted); }
.event-sep { display: none; }

.fc-tiles { gap: 0.6rem; margin-top: 1rem; }
.fc-tile { width: 4rem; height: 4.75rem; border-radius: 12px; transition: transform 0.12s; }
.fc-tile .event-day { font-size: 1.6rem; }
.fc-tile.fc-free { background: var(--ok); color: #fff; }
.fc-tile.fc-no { background: #E2D8C6; color: var(--card-muted); }
.fc-tile.fc-no .event-month, .fc-tile.fc-no .event-day, .fc-tile.fc-no .fc-dow { color: var(--card-muted); }
.fc-tile.fc-none { background: var(--surface); border: 2px dashed var(--accent); color: var(--ink); }
.fc-tile.fc-none .event-month { color: var(--accent); }
.fc-tile.fc-none .event-day { color: var(--ink); }
.fc-tile.fc-none .fc-dow { color: var(--card-muted); }
.fc-dow { font-size: 0.75rem; font-weight: 600; text-transform: none; color: inherit; opacity: 0.9; }
.fc-tile:hover:not(:disabled) { filter: none; transform: translateY(-2px); }

/* ---------- groups ---------- */
.group-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem; }
.group-card { display: flex; flex-direction: column; gap: 0.6rem; }
.group-card h2 { margin: 0; font-size: 1.25rem; }
.group-card p { margin: 0; }
.group-card:hover { transform: translateY(-3px); box-shadow: 0 11px 0 var(--felt-deep); }
.group-card .muted { color: var(--card-muted); }
.new-tile {
  display: grid; place-items: center; min-height: 6rem; padding: 1rem; border-radius: var(--radius);
  border: 2px dashed var(--felt-line); color: var(--on-felt); font-weight: 700; text-decoration: none;
}
.new-tile:hover { border-color: var(--on-felt); background: color-mix(in srgb, var(--on-felt) 6%, transparent); color: var(--on-felt); }
.empty-die { color: var(--accent); }
.list > li { border-top-color: #E6D9C2; }
.member-row { gap: 0.85rem; }
.member-row .avatar { width: 2.4rem; height: 2.4rem; }

/* ---------- best time + availability card ---------- */
.answered { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 1rem; }
.answered-big { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.answered-big small { font-size: 1.2rem; color: var(--card-muted); font-weight: 700; }
.answered-text { color: var(--card-muted); font-weight: 600; line-height: 1.3; }
.full-btn { width: 100%; }

/* ---------- popups ---------- */
dialog.modal { border: 0; border-radius: 20px; box-shadow: 0 10px 0 var(--walnut-deep), 0 30px 80px -20px rgba(0, 0, 0, 0.6); }
dialog.modal::backdrop { background: rgba(12, 30, 22, 0.6); }
.modal-head h2 { font-size: 1.35rem; }
@media (max-width: 520px) { dialog.modal { border-radius: 20px 20px 0 0; box-shadow: 0 -6px 0 var(--walnut-deep); } }

/* ---------- game library (covers sit on the felt) ---------- */
.game-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1.5rem; margin-top: 0; }
.game-card { gap: 0.3rem; color: var(--on-felt); }
.game-cover { border: 6px solid var(--surface); border-radius: 14px; box-shadow: var(--shadow); background: var(--surface); }
.game-card:hover .game-cover { transform: translateY(-3px); box-shadow: 0 11px 0 var(--felt-deep); }
.game-cover-blank { font-family: var(--font-display); font-size: 3.2rem; color: var(--surface); background: #5E8C6A; }
.game-grid li:nth-child(6n+2) .game-cover-blank { background: #3D6E8C; }
.game-grid li:nth-child(6n+3) .game-cover-blank { background: #9C4A1A; }
.game-grid li:nth-child(6n+4) .game-cover-blank { background: #A8731A; }
.game-grid li:nth-child(6n+5) .game-cover-blank { background: #2E3A59; }
.game-grid li:nth-child(6n+6) .game-cover-blank { background: #8A2E3B; }
.game-name { font-size: 1.05rem; margin-top: 0.5rem; }
.game-meta { color: var(--on-felt-muted); font-size: 0.88rem; }
.game-card:focus-visible { outline-color: var(--on-felt); }
.game-view .game-cover { border-width: 0; box-shadow: none; }
.game-view .game-cover-blank, .image-current .game-cover-blank { color: #fff; }
.image-current .game-cover { border: 0; box-shadow: none; }
.pg-cover, .gs-cover { font-family: var(--font-display); background: #5E8C6A; color: #fff; }
.pg-cover.is-blank { background: transparent; border: 2px dashed #C9B89C; color: var(--card-muted); }
.games-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.9rem 1.25rem; }
.games-list .pg-cover { width: 3rem; height: 3rem; border-radius: 10px; }
.games-list .pg-name { font-weight: 700; }
.games-list .pg-name a { text-decoration: none; color: var(--ink); }
.games-list .pg-name a:hover { color: var(--accent); }
.picked-game { border-color: var(--line); background: #fff; border-radius: 12px; }
.search-pill {
  display: flex; align-items: center; gap: 0.5rem; background: var(--surface); color: var(--card-muted);
  border-radius: 12px; padding: 0 0.9rem; flex: 0 1 18rem;
}
.search-pill svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.search-pill input { flex: 1; min-width: 0; font: inherit; border: 0; background: transparent; padding: 0.7rem 0; color: var(--ink); outline: none; }
.search-pill:focus-within { outline: 3px solid color-mix(in srgb, var(--on-felt) 45%, transparent); }
.library-empty { color: var(--on-felt-muted); }

/* ---------- the full-screen calendar: a walnut rail over parchment ---------- */
.cal-overlay { background: var(--bg); }
.cal-top {
  background: var(--walnut); color: var(--on-walnut); border-bottom: 0; box-shadow: inset 0 -5px 0 var(--walnut-deep);
  --muted: var(--on-walnut-muted); --link: var(--on-walnut);
}
.cal-title { font-weight: 800; }
.cal-top .btn-primary { background: var(--on-walnut); color: var(--walnut); }
.cal-top .btn-primary:hover { background: #fff; }
.cal-top .cal-key-box::before { background: transparent; border-color: var(--on-walnut); }
.cal-top .cal-key-no::before { background: var(--on-walnut-muted); }
.cal-tools, .cal-foot { background: var(--surface); border-color: var(--line); }
.cal-corner, .cal-dayhead, .cal-gutter { background: var(--bg); }
.cal-dnum { font-family: var(--font-display); font-weight: 800; }
.mday { border-radius: 12px; border-width: 1.5px; }
.mday-num { font-family: var(--font-display); font-weight: 800; }
.mday.is-sel { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.mline:not(.mline-opt) { background: var(--ok); color: #fff; }
.chip { border-width: 1.5px; font-weight: 700; }
.wd-bubble { border-width: 1.5px; }
.ans { border-radius: 10px; }

/* ======================================================================
   Navigation: walnut sidebar on desktop, top bar + tab bar on phones
   ====================================================================== */
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--on-walnut); text-decoration: none; }
.brand-mark { width: 2.25rem; height: 2.25rem; flex: none; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.nav-icon svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; display: block; }

/* signed out: a plain walnut bar */
.topbar {
  position: static; background: var(--walnut); border: 0; box-shadow: inset 0 -5px 0 var(--walnut-deep);
  color: var(--on-walnut); padding: 0.85rem clamp(1rem, 4vw, 2.5rem) 1.05rem;
}
.topbar .btn-ghost { color: var(--on-walnut); }
.topbar .brand-name { display: inline; }

.sidenav { background: var(--walnut); color: var(--on-walnut); }
.sidenav .nav-link {
  display: flex; align-items: center; gap: 0.75rem; color: var(--on-walnut); text-decoration: none;
  font-weight: 600; border-radius: 12px; padding: 0.75rem 0.9rem; background: none; border: 0; font: inherit; cursor: pointer;
}
.sidenav .nav-link:hover { background: color-mix(in srgb, var(--on-walnut) 10%, transparent); }
.sidenav .nav-link.is-current { background: var(--on-walnut); color: var(--walnut); font-weight: 700; }
.sidenav .whoami { color: var(--on-walnut); border-radius: 12px; padding: 0.55rem 0.9rem; }
.sidenav .whoami:hover, .sidenav .whoami.is-current { background: color-mix(in srgb, var(--on-walnut) 12%, transparent); }
.sidenav .whoami .avatar { width: 2.1rem; height: 2.1rem; }
.sidenav form { margin: 0; }
.nav-quiet { font-size: 0.92rem !important; color: var(--on-walnut-muted) !important; width: 100%; }
.mobilebar { display: none; }

@media (min-width: 900px) {
  body.has-nav { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
  .sidenav {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.3rem; padding: 1.75rem 1.1rem 1.25rem;
    box-shadow: inset -6px 0 0 var(--walnut-deep);
  }
  .sidenav-brand { padding: 0 0.7rem 1.6rem; }
  .sidenav-spacer { flex: 1; }
  .has-nav .page { margin: 0 auto; width: 100%; }
}

@media (max-width: 899px) {
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: var(--walnut); color: var(--on-walnut);
    padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.95rem; box-shadow: inset 0 -5px 0 var(--walnut-deep);
  }
  .mobilebar .brand-name { display: inline; font-size: 1.15rem; }
  .mobilebar-me { text-decoration: none; }
  .mobilebar-me .avatar { width: 2.25rem; height: 2.25rem; }
  .sidenav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.45rem 0.5rem max(0.6rem, env(safe-area-inset-bottom));
    box-shadow: inset 0 5px 0 var(--walnut-deep), 0 -10px 24px -14px rgba(0, 0, 0, 0.6);
  }
  .sidenav-brand, .sidenav-spacer, .sidenav .whoami, .sidenav-signout { display: none !important; }
  .sidenav .nav-link {
    flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.25rem 0.2rem; font-size: 0.78rem; font-weight: 700;
    color: var(--on-walnut-muted); border-radius: 0;
  }
  .sidenav .nav-link:hover { background: none; color: var(--on-walnut); }
  .sidenav .nav-link.is-current { background: none; color: var(--on-walnut); }
  .sidenav .nav-icon { display: grid; place-items: center; width: 3.25rem; height: 1.9rem; border-radius: 999px; }
  .sidenav .nav-link.is-current .nav-icon { background: var(--on-walnut); color: var(--walnut); }
  .has-nav .page { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .page { padding-left: 1rem; padding-right: 1rem; padding-top: 1.25rem; }
  .stack, .split, .split > .main, .split > .side { gap: 1.4rem; }
  .card { box-shadow: 0 6px 0 var(--felt-deep); }
  .btn { padding: 0.65rem 1rem; }
  .title-row .btn, .section-head .btn { padding: 0.5rem 0.85rem; }
  .game-grid { gap: 1rem; }
  .game-cover { border-width: 4px; }
  .event-row.is-open .event-cta { width: 100%; }
  .search-pill { flex: 1 1 100%; order: 3; }
}
.group-grid-tight { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 1rem; }
.group-grid-tight .group-card h2 { font-size: 1.1rem; }
.title-count { font-size: 0.55em; color: var(--on-felt-muted); margin-left: 0.25rem; vertical-align: 0.15em; }
.btn-light .count-pill { background: var(--walnut); color: var(--on-walnut); }
.stack-narrow { max-width: 46rem; }
.hero .eyebrow { color: #F2B8A8; }
.hero h1 { color: var(--on-felt); max-width: 40rem; }
.profile-head .avatar-lg { width: 3.75rem; height: 3.75rem; font-size: 1.6rem; }
.profile-head h1 { margin: 0; }
.past summary { color: var(--card-muted); }
.form-card, .auth-card { max-width: 640px; }
.auth-card { max-width: 440px; }
.split > .section { gap: 0.75rem; align-content: start; }
.section-head { min-height: 0; }
.section-head .btn { margin: -0.4rem 0; }
@media (max-width: 520px) { .fc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr)); } .fc-tile { width: auto; } }
@media (max-width: 520px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 0.9rem; } .game-cover-blank { font-size: 2.6rem; } }
.section-head { min-height: 2.6rem; }
.section-head .btn { margin: 0; }

/* =================== BGG import =================== */
.import-steps { margin: 0.5rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.4rem; color: var(--card-muted); }
.import-steps strong { color: var(--ink); }
.import-form { margin-top: 1.1rem; }
#import-dialog .alert { margin-top: 0.75rem; box-shadow: none; }
.file-drop {
  position: relative; display: grid; place-items: center; min-height: 5.5rem; padding: 1rem; cursor: pointer;
  border: 2px dashed #C9B89C; border-radius: 14px; background: var(--bg); text-align: center;
}
.file-drop:hover, .file-drop:focus-within { border-color: var(--accent); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-text { font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.file-drop.has-file { border-style: solid; border-color: var(--ok); }
.file-drop.has-file .file-drop-text { color: var(--ok-ink); }
.empty-actions { justify-content: center; }

.import-review { padding-bottom: 1rem; }
.select-all { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--on-felt); cursor: pointer; }
.select-all input, .import-pick input { width: 1.2rem; height: 1.2rem; accent-color: var(--ok); margin: 0; flex: none; }
.section-note { margin: 0; color: var(--on-felt-muted); font-size: 0.92rem; }
.import-list {
  list-style: none; margin: 0; padding: 0.35rem 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}
.import-row { display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem 0 0; border-bottom: 1px solid #EDE2CF; min-width: 0; }
.import-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0 0.7rem 1.1rem; cursor: pointer; }
.import-pick:has(input:not(:checked)) .import-text { opacity: 0.62; }
.import-text { display: grid; min-width: 0; line-height: 1.3; }
.import-name { font-weight: 700; overflow-wrap: anywhere; }
.import-year { font-weight: 400; color: var(--card-muted); font-size: 0.88rem; }
.import-meta { font-size: 0.88rem; color: var(--card-muted); }
.import-note { font-size: 0.82rem; color: #8A5A0E; font-weight: 600; }
.import-link { flex: none; font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--card-muted); padding: 0.4rem; border-radius: 8px; }
.import-link:hover { color: var(--accent); background: var(--bg); }
.import-more > summary { cursor: pointer; list-style-position: inside; padding: 0.25rem 0; }
.import-more[open] { gap: 0.75rem; }
.import-bar {
  position: sticky; bottom: 1rem; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  background: var(--walnut); color: var(--on-walnut); border-radius: 16px; padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  box-shadow: 0 6px 0 var(--walnut-deep), 0 16px 30px -12px rgba(0, 0, 0, 0.55);
}
.import-bar-text { flex: 1 1 auto; font-weight: 600; }
.import-bar-text strong { font-family: var(--font-display); font-size: 1.35rem; }
.import-bar .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 899px) { .import-bar { bottom: calc(5.4rem + env(safe-area-inset-bottom)); } }
@media (max-width: 520px) {
  .import-row { padding-right: 0.6rem; }
  .import-pick { padding-left: 0.9rem; gap: 0.7rem; }
  .import-bar { padding: 0.6rem 0.6rem 0.6rem 1rem; gap: 0.5rem; }
  .import-bar .btn { padding: 0.6rem 0.9rem; }
}
.import-list { padding: 0; overflow: hidden; }
.import-row { margin-bottom: -1px; }
@media (max-width: 520px) { .title-row h1 { flex-basis: 100%; } }

/* ======================================================================
   Felt & Walnut: full-screen calendars
   Walnut bar on top, the month laid out on the felt with ivory day squares,
   controls on ivory (a side panel on desktop, a bottom sheet on phones),
   and time grids dealt onto the felt as ivory cards.
   ====================================================================== */
.cal-overlay { background: var(--felt); }
.cal-top { gap: 0.75rem 1.25rem; padding-top: 0.9rem; padding-bottom: 1.1rem; }
.cal-top .btn-ghost { border-color: #7A5A42; }
.cal-top .btn-ghost:hover { background: color-mix(in srgb, var(--on-walnut) 10%, transparent); }
.cal-title { font-size: 1.45rem; color: var(--on-walnut); }
.cal-monthlabel { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.cal-body { background: var(--felt); }

/* ---- month grids (setup + member answers) ---- */
.cal-month { gap: 8px; padding: 1.25rem clamp(0.75rem, 2.5vw, 2rem); }
.cal-mhead { color: var(--on-felt-muted); letter-spacing: 0.1em; font-size: 0.8rem; }
.mday { background: var(--surface); border: 0; border-radius: 12px; padding: 0.55rem; box-shadow: 0 3px 0 var(--felt-deep); }
.mday:hover { box-shadow: 0 3px 0 var(--felt-deep), inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.mday-num { font-size: 1.05rem; }
/* Days you can't use (past, other month): empty outlined slots on the felt, not filled tiles. */
.mday.is-other, .mday.is-past {
  background: transparent; color: #6F9884; opacity: 1;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--felt-line) 60%, transparent);
}
.mday.is-other .mline, .mday.is-past .mline { opacity: 0.55; }
.mday.is-past:hover, .mday.is-other:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--felt-line) 60%, transparent); }
.mday.is-today .mday-num { background: var(--walnut); color: var(--on-walnut); }
.mday.is-sel {
  background: #F6DCD4; box-shadow: inset 0 0 0 3px var(--accent), 0 3px 0 var(--felt-deep); border: 0;
}
.mday-check { background: var(--accent); width: 1.4rem; height: 1.4rem; top: 0.45rem; right: 0.45rem; font-size: 0.8rem; }
.mline { border-radius: 6px; font-size: 0.8rem; padding: 0.2rem 0.25rem 0.2rem 0.45rem; }

/* member answers on the felt */
.cal-answer-month .mday.is-off {
  background: transparent; color: #6F9884; opacity: 1;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--felt-line) 60%, transparent);
}
.cal-answer-month .mday.is-option { border: 0; box-shadow: inset 0 0 0 2px var(--accent), 0 3px 0 var(--felt-deep); }
.cal-answer-month .mday.ans-yes { background: #E3F0E6; box-shadow: inset 0 0 0 2px var(--ok), 0 3px 0 var(--felt-deep); }
.cal-answer-month .mday.ans-no { background: #E2D8C6; box-shadow: 0 3px 0 var(--felt-deep); }
.cal-answer-month .mday.ans-some { background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--warn), 0 3px 0 var(--felt-deep); }
.cal-answer-month .mday.is-focus { box-shadow: inset 0 0 0 3px var(--ink), 0 3px 0 var(--felt-deep); }

/* ---- time grids (one day, everyone's times) as ivory cards on the felt ---- */
.cal-grid {
  width: auto; margin: 1rem clamp(0.5rem, 2vw, 1.5rem); background: var(--surface);
  border-radius: 16px; box-shadow: var(--shadow); overflow: clip;
}
.cal-corner, .cal-dayhead, .cal-gutter { background: var(--surface); }
.cal-dayhead.is-filler { background: var(--surface); }
.cal-body.is-stacked { padding: 0 0 1rem; }
.cal-body.is-stacked .cal-grid { margin-top: 0.75rem; margin-bottom: 0; }
.cal-mode-results .cal-cell.box.who-start:not(.box-top) { border-top-color: var(--surface); }

/* ---- controls + footer ---- */
.cal-tools, .cal-foot { background: var(--surface); border-color: var(--line); }
.cal-tools .chip-quiet { border-color: #D9CBB2; color: var(--ink); }
.wd-bubble { background: #fff; border-color: #D9CBB2; width: 2.4rem; height: 2.4rem; font-size: 0.9rem; }
.wd-bubble.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-preset { border: 2px solid var(--ok); border-radius: 10px; color: var(--ink); background: transparent; }
.chip-preset .chip-label { color: var(--ok-ink); }
.chip-preset:hover { background: var(--ok-bg); }
.chip-add { border-radius: 10px; border-width: 2px; border-color: #D9CBB2; }
.cal-foot .btn-ghost, .cal-tools .btn-ghost { color: var(--ink); }

/* desktop setup: the month on the felt, controls in an ivory side panel */
@media (min-width: 641px) {
  .cal-mode-month .cal-shell {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .cal-mode-month .cal-top { grid-column: 1 / -1; }
  .cal-mode-month .cal-body { grid-column: 1; grid-row: 2 / 4; }
  .cal-mode-month .cal-tools {
    grid-column: 2; grid-row: 2; overflow-y: auto; border: 0;
    display: flex; flex-direction: column; align-items: stretch; gap: 1.6rem; padding: 1.6rem 1.5rem;
    box-shadow: -6px 0 0 var(--felt-deep); position: relative; z-index: 1;
  }
  .cal-mode-month .cal-foot {
    grid-column: 2; grid-row: 3; border-top: 1px solid #E6D9C2; padding: 1rem 1.5rem 1.25rem;
    box-shadow: -6px 0 0 var(--felt-deep); position: relative; z-index: 1;
  }
  .cal-mode-month .cal-quicksel { order: 1; display: flex; flex-wrap: wrap; gap: 0.6rem 0.5rem; }
  .cal-mode-month .cal-presets { order: 2; }
  .cal-mode-month .cal-times { order: 3; }
  .cal-mode-month .cal-setbar { order: 4; margin: -0.6rem 0 0; display: grid; grid-template-columns: 1fr auto; }
  .cal-mode-month .cal-quicksel-label,
  .cal-mode-month .cal-presets::before,
  .cal-mode-month .cal-times::before {
    flex-basis: 100%; margin: 0 0 0.15rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--card-muted);
  }
  .cal-mode-month .cal-presets::before { content: "Quick times"; }
  .cal-mode-month .cal-times::before { content: "Or set hours"; }
  .cal-mode-month .cal-wdbubbles { width: 100%; justify-content: space-between; margin: 0; }
  .cal-mode-month .cal-presets { flex-wrap: wrap; gap: 0.5rem; }
  .cal-mode-month .cal-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .cal-mode-month .cal-times::before { grid-column: 1 / -1; }
  .cal-mode-month .tfield { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .cal-mode-month .tfield input { width: 100%; padding: 0.6rem; border-radius: 10px; }
  .cal-mode-month .cal-month { grid-template-rows: auto repeat(var(--weeks), minmax(6.5rem, 1fr)); }
  .cal-mode-month .cal-foot .cal-footrow { justify-content: space-between; }
}

/* phones: the month on the felt, controls in an ivory bottom sheet */
@media (max-width: 640px) {
  .cal-top { padding-bottom: 0.85rem; }
  .cal-month { gap: 4px; padding: 0.6rem 0.5rem; }
  .mday { border-radius: 9px; padding: 0.3rem; box-shadow: 0 2px 0 var(--felt-deep); }
  .mday-num { font-size: 0.85rem; }
  .cal-mhead { font-size: 0.68rem; }
  .cal-mode-month .cal-foot, .cal-mode-availability .cal-foot {
    border-radius: 18px 18px 0 0; border-top: 0; box-shadow: 0 -6px 0 var(--felt-deep); position: relative; z-index: 1;
  }
  .cal-mode-month .cal-tools { border-top: 1px solid #E6D9C2; box-shadow: none; }
  .cal-grid { margin: 0.6rem 0.4rem; border-radius: 12px; }
  .cal-mode-results .cal-foot { border-radius: 18px 18px 0 0; box-shadow: 0 -6px 0 var(--felt-deep); position: relative; }
}
@media (min-width: 641px) {
  .cal-mode-month .cal-help { display: none; }
  .cal-mode-month .mline-text { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
  .cal-mode-month .mline { align-items: flex-start; }
}
.cal-mode-availability .cal-grid { width: auto; max-width: 40rem; margin: 1rem auto; }
@media (max-width: 640px) { .cal-mode-availability .cal-grid { margin: 0.75rem 0.5rem; max-width: none; } }
.cal-mode-results .cal-grid { margin-bottom: 0.75rem; }

/* ======================================================================
   Logo: the gavel knocks when anything holding it is hovered or focused.
   Two drawn states in includes/logo.svg, swapped instantly (no animation).
   ====================================================================== */
.brand-mark .logo-knock { display: none; }
:is(a, button, .knock):is(:hover, :focus-visible) .brand-mark .logo-rest { display: none; }
:is(a, button, .knock):is(:hover, :focus-visible) .brand-mark .logo-knock { display: inline; }
.brand-mark .logo-cut { fill: var(--walnut); }
.brand-mark .logo-accent { stroke: #E08A6E; }
.sidenav-brand .brand-mark { width: 2.6rem; height: 2.6rem; }
@media (max-width: 899px) { .mobilebar .brand-mark { width: 2rem; height: 2rem; } }

/* ======================================================================
   Type: Baloo 2 (display) + Nunito Sans (body), tuned
   Baloo has tall ascenders and a loose default line height, so headings are
   set tight; Nunito's caps are light, so uppercase labels go to 800.
   ====================================================================== */
body { font-kerning: normal; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.08; }
.page-title h1 { line-height: 1.05; }
.section-label, .eyebrow, .best-times .best-label { font-weight: 800; letter-spacing: 0.1em; }
.event-day, .answered-big, .cal-dnum, .mday-num { font-variant-numeric: tabular-nums; }
.event-day { line-height: 1; }
.event-meta, .cal-time, time { font-variant-numeric: tabular-nums; }

/* ======================================================================
   Wordmark: custom lettering in includes/wordmark.svg. It swaps to the
   tossed state with the logo's knock (same hosts, same trigger).
   ====================================================================== */
.wordmark { display: block; height: 1.5rem; width: auto; aspect-ratio: 469.7 / 90.8; flex: none; }
.wordmark .wm-knock { display: none; }
:is(a, button, .knock):is(:hover, :focus-visible) .wordmark .wm-rest { display: none; }
:is(a, button, .knock):is(:hover, :focus-visible) .wordmark .wm-knock { display: inline; }
.wordmark .wm-cut { stroke: var(--walnut); }
.sidenav-brand .wordmark { height: 1.6rem; }
@media (max-width: 899px) { .mobilebar .wordmark { height: 1.35rem; } }

/* ======================================================================
   Event page: the "Schedule" panel (finding a time / scheduled / cancelled)
   ====================================================================== */
.sched { display: grid; gap: 0.9rem; align-content: start; }
.sched h2 { margin: 0; }
.sched p { margin: 0; }
.sched form { margin: 0; }
.sched-progress { color: var(--card-muted); font-weight: 600; line-height: 1.35; }
.sched-progress strong { color: var(--ink); }
.sched-best { border: 2px solid var(--ok); border-radius: 14px; padding: 1rem 1.05rem 1.05rem; display: grid; gap: 0.2rem; }
.sched-best form { margin-top: 0.8rem; }
.sched-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ok-ink); margin-bottom: 0.2rem; }
.sched-day { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; color: var(--ink); }
.sched-hours { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sched-who { color: var(--card-muted); font-size: 0.9rem; line-height: 1.4; }
.sched-note { color: var(--card-muted); line-height: 1.45; }
.sched-final { display: flex; align-items: center; gap: 0.9rem; }
.sched-final .event-date { width: 3.8rem; height: 4.2rem; }
.sched-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.sched-cancel { justify-self: center; margin-top: -0.3rem !important; }
.btn-quiet { background: none; border: 0; padding: 0.55rem 0.4rem; font-weight: 700; color: var(--card-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.btn-quiet:hover { text-decoration-thickness: 2px; }
.sched-link { justify-self: start; padding-left: 0; }
.sched.is-set { border-top: 6px solid var(--ok); }
.sched.is-cancelled { border-top: 6px solid var(--err); }
.sched.is-cancelled h2 { color: var(--card-muted); }

/* ======================================================================
   Event cards: each event is its own card and lifts on hover like the
   group cards. The title link's ::after covers the card, so the whole card
   is clickable; the action button sits above it.
   ====================================================================== */
.event-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.event-cards > .event-row { position: relative; padding: 1rem 1.25rem; transition: transform 0.12s, box-shadow 0.12s; }
.event-cards > .event-row:hover, .event-cards > .event-row:focus-within { transform: translateY(-3px); box-shadow: 0 11px 0 var(--felt-deep); }
.event-cards .event-title, .event-cards .event-title:hover { color: var(--ink); }
.event-cards .event-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.event-cards .event-title:focus-visible { outline: none; }
.event-cards .event-title:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.event-cards .event-cta { position: relative; z-index: 1; }
.event-cards > .event-row.is-cancelled { opacity: 0.7; }
.past > .event-cards { margin-top: 0.75rem; }
.past summary { color: var(--on-felt-muted); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .event-cards > .event-row { transition: none; } }

/* ======================================================================
   Game picker: your list (rate + drag) and the coordinator's selection panel
   ====================================================================== */
.games-hint { margin: 0 0 0.9rem; color: var(--card-muted); font-size: 0.9rem; line-height: 1.45; }
.my-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.mg-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem 0.5rem 0.5rem;
  border-radius: 12px; background: var(--surface); border: 1px solid transparent; position: relative;
}
.mg-row[data-rating="hate"] .pg-cover { filter: grayscale(0.6); opacity: 0.75; }
.mg-row .pg-cover { width: 3rem; height: 3rem; border-radius: 10px; flex: none; display: grid; place-items: center; object-fit: cover; }
.mg-row .pg-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; }
.mg-row .pg-name a { color: var(--ink); text-decoration: none; }
.mg-row .pg-name a:hover { text-decoration: underline; }
.mg-row .pg-meta { color: var(--card-muted); }
.mg-picked { font-size: 0.7rem; padding: 0.1rem 0.5rem; }

.mg-handle {
  flex: none; width: 1.75rem; height: 2.75rem; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: none; color: #B9A88C; cursor: grab; touch-action: none;
}
.mg-handle svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.mg-handle:hover, .mg-handle:focus-visible { color: var(--ink); background: var(--bg); }
.mg-handle:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.mg-row.is-dragging { z-index: 5; border-color: var(--line); box-shadow: 0 10px 24px rgba(20, 16, 12, 0.18); cursor: grabbing; }
.mg-row.is-dragging .mg-handle { cursor: grabbing; color: var(--ink); }
.my-games.is-sorting { user-select: none; }

/* rating: a segmented toggle group sharing one border */
.rate-group {
  flex: none; display: inline-flex; margin: 0 0 0 auto; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); overflow: hidden;
}
.rate {
  width: 2.25rem; height: 2.1rem; display: grid; place-items: center; padding: 0; border: 0; background: none;
  color: #9C8B73; cursor: pointer; transition: background 0.1s, color 0.1s;
}
.rate + .rate { border-left: 1.5px solid var(--line); }
.rate svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rate:hover { background: var(--bg); color: var(--ink); }
.rate:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.rate[aria-pressed="true"] { color: #fff; }
.rate[aria-pressed="true"] svg { fill: currentColor; fill-opacity: 0.25; }
.rate-love[aria-pressed="true"]    { background: var(--accent); }
.rate-like[aria-pressed="true"]    { background: var(--ok); }
.rate-dislike[aria-pressed="true"] { background: #8C7A62; }
.rate-hate[aria-pressed="true"]    { background: var(--ink); }
.rate-hate[aria-pressed="true"] svg { fill: none; }
@media (max-width: 560px) {
  /* handle | cover | name, with the rating group tucked under the name */
  .mg-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 0.6rem; row-gap: 0.45rem; align-items: center; }
  .mg-row .pg-cover { width: 2.6rem; height: 2.6rem; }
  .mg-row .rate-group { grid-column: 3; justify-self: start; margin: 0; }
  .rate { width: 2.5rem; height: 2.3rem; }
}

/* coordinator: game selection */
.picks { display: grid; gap: 0.75rem; align-content: start; }
.picks h2 { margin: 0; }
.picks p { margin: 0; }
.picks-sub { color: var(--card-muted); font-size: 0.9rem; line-height: 1.4; }
.tb { height: 0.9rem; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.tb-fill { height: 100%; width: 0; background: var(--ok); border-radius: 999px; transition: width 0.2s ease; }
.tb-fill.is-over { background: var(--accent); }
.tb-text { font-size: 0.92rem; color: var(--card-muted); font-variant-numeric: tabular-nums; }
.tb-text strong { color: var(--ink); }
.tb-over { color: var(--accent); font-weight: 800; }
.tb-unknown { font-size: 0.82rem; color: var(--card-muted); }
.pick-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.pick-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.4rem; }
.pick-row + .pick-row { border-top: 1px solid #E6D9C2; }
.pick-row.is-picked { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border-top-color: transparent; border-radius: 10px; }
.pick-row.is-picked + .pick-row { border-top-color: transparent; }
.pick-form { margin: 0; flex: none; }
.pick-toggle {
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 2px solid #C9B89C; border-radius: 8px; background: var(--surface); color: transparent;
}
.pick-toggle svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pick-toggle:hover { border-color: var(--ok); }
.pick-toggle[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pick-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pick-toggle:disabled { opacity: 0.5; cursor: default; }
.pick-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.pick-name { font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.pick-meta { font-size: 0.8rem; color: var(--card-muted); font-variant-numeric: tabular-nums; }
.pick-warn { color: var(--accent); font-weight: 700; }
.pick-hate { font-size: 0.78rem; color: var(--ink); font-weight: 700; }
.pick-votes { flex: none; display: flex; gap: 0.35rem; font-size: 0.8rem; font-weight: 800; color: var(--card-muted); font-variant-numeric: tabular-nums; }
.pv { display: inline-flex; align-items: center; gap: 0.1rem; }
.pv svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pv-love { color: var(--accent); }
.pv-like { color: var(--ok); }
.pv-dislike { color: #8C7A62; }
.pv-hate { color: var(--ink); }
.pv-none { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tb-fill { transition: none; } }

/* ======================================================================
   Game suggestions (players) and the coordinator's "Suggested" box
   ====================================================================== */
.my-suggestions { list-style: none; margin: 0.9rem 0 0; padding: 0.8rem 0 0; border-top: 1px dashed #DCCBAF; display: grid; gap: 0.4rem; }
.my-suggestions li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
.sug-name { font-weight: 800; color: var(--ink); }
.sug-status { font-size: 0.85rem; color: var(--card-muted); }
.sug-declined { font-style: italic; }
.sug-box { border: 2px dashed #D9C6A6; border-radius: 14px; padding: 0.8rem 0.9rem; display: grid; gap: 0.5rem; }
.sug-title { margin: 0; font-family: var(--font-body); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--card-muted); }
.sug-title .count { letter-spacing: 0; margin-left: 0.2rem; color: var(--accent); }
.sug-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.sug-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem; }
.sug-text { display: grid; min-width: 0; line-height: 1.25; }
.sug-meta { font-size: 0.8rem; color: var(--card-muted); }
.sug-actions { display: flex; align-items: center; gap: 0.25rem; margin: 0; }
.lock-form { display: grid; gap: 0.4rem; margin: 0.4rem 0 0; }
.lock-hint { font-size: 0.82rem; color: var(--card-muted); text-align: center; }
.picks.is-locked { border-top: 6px solid var(--ok); }

/* ======================================================================
   Locked-in "plan" view: big date, the details, and the games as full covers
   ====================================================================== */
.plan-hero { display: grid; gap: 1.1rem; }
.plan-hero p { margin: 0; }
.plan-when { display: flex; align-items: center; gap: 1.1rem; }
.plan-date { width: 5rem; height: 5.6rem; border-radius: 16px; }
.plan-date .event-month { font-size: 0.85rem; }
.plan-date .event-day { font-size: 2.4rem; }
.plan-day { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.05; color: var(--ink); }
.plan-hours { font-size: 1.2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 0.2rem !important; }
.plan-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.plan-facts li { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--ink); font-weight: 600; }
.plan-facts svg { width: 1.2rem; height: 1.2rem; flex: none; margin-top: 0.15rem; fill: none; stroke: var(--card-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plan-notes {
  font-size: 1.08rem; line-height: 1.6; color: var(--ink); background: var(--bg); border-radius: 12px;
  padding: 0.9rem 1.05rem; border-left: 4px solid var(--accent);
}
.plan-games { display: grid; gap: 0.9rem; }
.plan-games-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; }
.plan-games-head .section-label { margin: 0; }
.plan-games-time { margin: 0; color: var(--on-felt-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem; }
.plan-game { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.plan-cover { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #5E8C6A; }
.plan-cover-blank { display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 4rem; color: var(--surface); }
.plan-game-text { padding: 0.9rem 1rem 1rem; display: grid; gap: 0.15rem; }
.plan-game-text p { margin: 0; }
.plan-game-name { margin: 0; font-size: 1.2rem; line-height: 1.15; color: var(--ink); }
.plan-game-name a { color: var(--ink); text-decoration: none; }
.plan-game-name a:hover { text-decoration: underline; }
.plan-game-meta { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-game-owner { font-size: 0.85rem; color: var(--card-muted); }
.split.is-plan > .main { flex-basis: 100%; }
@media (max-width: 560px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
  .plan-game-text { padding: 0.65rem 0.75rem 0.8rem; }
  .plan-game-name { font-size: 1rem; }
  .plan-game-meta { font-size: 0.85rem; }
  .plan-cover-blank { font-size: 2.6rem; }
  .plan-date { width: 4.2rem; height: 4.7rem; }
  .plan-date .event-day { font-size: 2rem; }
}

/* ======================================================================
   Info buttons: a small (i) next to a heading that opens a short explanation
   ====================================================================== */
.with-info { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.with-info > h1, .with-info > h2, .with-info > h3, .with-info > label, .with-info > .section-label { margin: 0; }
.info { position: relative; display: inline-flex; flex: none; }
.info > summary { list-style: none; }
.info > summary::-webkit-details-marker { display: none; }
.info-btn {
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--card-muted); transition: color 0.1s, background 0.1s;
}
.info-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.info-btn .info-dot { fill: currentColor; stroke: none; }
.info-btn:hover, .info[open] > .info-btn { color: var(--ink); background: var(--bg); }
.info-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.page-title .info-btn, .section-label + .info .info-btn, .on-felt .info-btn { color: var(--on-felt-muted); }
.page-title .info-btn:hover, .section-label + .info .info-btn:hover, .page-title .info[open] > .info-btn,
.section-label + .info[open] > .info-btn { color: var(--on-felt); background: color-mix(in srgb, var(--on-felt) 12%, transparent); }
.info-pop {
  position: absolute; z-index: 40; top: calc(100% + 0.5rem); left: -0.6rem; width: max-content; max-width: min(19rem, calc(100vw - 1.5rem));
  padding: 0.75rem 0.9rem; border-radius: 12px; background: var(--walnut); color: var(--on-walnut, #F3E9D8);
  box-shadow: 0 10px 28px rgba(20, 16, 12, 0.28); font-family: var(--font-body); font-size: 0.9rem; font-weight: 500;
  line-height: 1.45; letter-spacing: normal; text-transform: none; text-align: left; white-space: normal;
}
.info-pop::before {
  content: ""; position: absolute; top: -0.4rem; left: var(--arrow-x, 1.1rem); width: 0.8rem; height: 0.8rem;
  background: inherit; transform: rotate(45deg); border-radius: 2px;
}
.info-pop.is-above::before { top: auto; bottom: -0.4rem; }
.info-pop a { color: inherit; text-decoration: underline; }
.info-pop strong { color: #fff; }
.info-pop p { margin: 0; }
.info-pop p + p { margin-top: 0.5rem; }

/* ---- Version + bug reports ------------------------------------------------------------ */
.app-foot {
  margin: 0; font-size: 0.72rem; color: var(--muted); opacity: 0.7; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.app-foot:hover, .app-foot:focus-within { opacity: 1; }
.foot-link {
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 2px;
}
.foot-link:hover, .foot-link:focus-visible { text-decoration-color: currentColor; }
.sidenav .app-foot { color: var(--on-walnut-muted); opacity: 0.55; text-align: left; padding: 0.35rem 0.9rem 0; }
.sidenav .app-foot:hover, .sidenav .app-foot:focus-within { opacity: 0.9; }
@media (max-width: 899px) { .sidenav .sidenav-extra { display: none !important; } }
.feedback-kind { display: flex; margin-bottom: 1rem; }
.feedback-kind .seg { flex: 1; }
.feedback-kind .seg span { display: block; text-align: center; }
.seg-pick input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.feedback-form textarea { width: 100%; resize: vertical; min-height: 7rem; }
.feedback-error { margin: 0 0 0.75rem; }
.feedback-thanks { padding: 0.75rem 0 0.25rem; }
.feedback-thanks-text { font-weight: 700; margin: 0 0 1rem; }
.feedback-shots input[type="file"] { font-size: 0.85rem; max-width: 100%; }
.shot-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.shot-list li { position: relative; }
.shot-list img {
  display: block; width: 6.5rem; height: 4.5rem; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
}
.shot-remove {
  position: absolute; top: -0.45rem; right: -0.45rem; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; border: 0; background: var(--walnut); color: var(--on-walnut);
  font: 700 1rem/1 var(--font-body); cursor: pointer; display: grid; place-items: center;
}
.shot-remove:hover, .shot-remove:focus-visible { background: var(--accent); }
.shot-hint { margin: 0.4rem 0 0; }
.feedback-shots.is-enhanced input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.feedback-shots .shot-add { margin-top: 0.5rem; width: fit-content; justify-self: start; align-self: flex-start; cursor: pointer; }
.feedback-shots.is-enhanced .shot-list:not([hidden]) + .shot-add { margin-top: 0.75rem; }
.feedback-shots:has(input:focus-visible) .shot-add { outline: 2px solid var(--accent); outline-offset: 2px; }
