/* St John's Anglican Wishart — meeting poll.
   Tokens follow stjohnswishart.com.au: dark slate blue, lemon chiffon, khaki, Inter/Arial,
   translucent black nav, uppercase letter-spaced labels, 5px radius, soft card shadows. */
:root {
  --slate: #3d3c7d;          /* site --dark-slate-blue */
  --slate-ink: #2c2b5e;
  --chiffon: #f6f5c4;        /* site --lemon-chiffon */
  --khaki: #adb42e;          /* site --dark-khaki */
  --bg: #f6f9fa;             /* site apps background */
  --card: #ffffff;
  --fg: #333333;             /* site --black */
  --muted: #6b6a78;
  --line: #e3e3ea;
  --soft: #eef0fb;           /* site secondary, lightened */
  --yes: #3c7d4f;
  --yes-bg: #e3f1e6;
  --maybe: #8a7a12;
  --maybe-bg: #f6f5c4;
  --danger: #c23f3a;
  --nav: rgba(0,0,0,.82);
  --shadow: 5px 9px 8px rgba(0,0,0,.12);
  --radius: 5px;
  --font: "Inter", Arial, "Helvetica Neue", Helvetica, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --slate: #7b7ec5; --slate-ink: #abafe4; --chiffon: #3a3920; --khaki: #c9cf5a;
    --bg: #0e0e14; --card: #181820; --fg: #f1f1f4; --muted: #a2a1b0; --line: #2c2c38;
    --soft: #1d1d33; --yes: #7ccf92; --yes-bg: #1c3324; --maybe: #e2d36a; --maybe-bg: #39361c;
    --danger: #ec6e68; --nav: rgba(0,0,0,.9); --shadow: 0 6px 14px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--slate); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Nav bar — matches the site's black translucent bar */
.nav { background: var(--nav); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.nav .wrap { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav img { height: 44px; width: auto; display: block; }
.nav-label { color: #e9e8e8; text-transform: uppercase; letter-spacing: 1.3px; font-size: 12px; text-decoration: none; }
.nav-label:hover { color: #fff; }

/* Hero band */
.hero { background: #3d3c7d; color: #fff; padding-block: 40px 56px; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(28px, 4.5vw, 38px); line-height: 1.15; font-weight: 700; text-wrap: balance; }
.hero p { margin: 0; max-width: 65ch; color: rgba(255,255,255,.88); white-space: pre-line; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.3px; font-size: 12px; font-weight: 600; }
.hero .eyebrow { color: #f6f5c4; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.9); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 16px; height: 16px; opacity: .8; }

main { padding-block: 0 64px; }
.lift { margin-top: -32px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 24px; }
.card h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.25; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }

/* Buttons — site style: uppercase, letter-spaced, small */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 4px; padding: 11px 18px; font-size: 12px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; }
.btn-primary { background: var(--slate); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0c0c16; } }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--slate); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { padding: 7px 11px; font-size: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Form fields */
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.field-hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-weight: 400;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px color-mix(in srgb, var(--slate) 20%, transparent); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > * { flex: 1 1 180px; min-width: 0; }
.stack { display: grid; gap: 16px; }

/* Slot picker */
.day { margin-top: 28px; }
.day-title { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--slate); font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--fg); text-wrap: balance; }
.day:first-child { margin-top: 0; }
.day-head { text-transform: uppercase; letter-spacing: 1.3px; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.slot { position: relative; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; transition: border-color .15s, background .15s; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.pick-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; line-height: 1; opacity: .55; }
.pick-yes:hover { border-color: var(--yes); color: var(--yes); }
.pick-maybe:hover { border-color: var(--maybe); color: var(--maybe); }
.pick-yes[aria-pressed=true] { background: var(--yes); border-color: var(--yes); color: var(--card); }
.pick-maybe[aria-pressed=true] { background: var(--maybe); border-color: var(--maybe); color: var(--card); }
.pick[aria-pressed=true] .pick-mark { opacity: 1; background: var(--card); border-color: var(--card); }
.pick-yes[aria-pressed=true] .pick-mark { color: var(--yes); }
.pick-maybe[aria-pressed=true] .pick-mark { color: var(--maybe); }
.slot-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.slot-time { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.slot-end { color: var(--muted); font-weight: 400; font-size: 13px; }
.state { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.slot[data-choice=yes] { border-color: var(--yes); background: var(--yes-bg); }
.slot[data-choice=yes] .state { background: var(--yes); color: var(--card); }
.slot[data-choice=maybe] { border-color: var(--maybe); background: var(--maybe-bg); }
.slot[data-choice=maybe] .state { background: var(--maybe); color: var(--card); }
.slot.final { box-shadow: 0 0 0 2px var(--khaki); }
.who { font-size: 13px; color: var(--muted); line-height: 1.4; }
.who b { color: var(--fg); font-weight: 600; }
.count { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--yes); }
.bar i.m { background: var(--maybe); }
.best-tag { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--slate); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.y { background: var(--yes); } .dot.m { background: var(--maybe); } .dot.n { background: var(--line); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

/* Results grid */
.grid-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.grid thead th { background: var(--soft); font-weight: 600; vertical-align: bottom; }
.grid th.name, .grid td.name { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.grid thead th.name { background: var(--soft); }
.grid .th-date { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.grid .th-time { font-variant-numeric: tabular-nums; }
.grid td.y { background: var(--yes-bg); color: var(--yes); font-weight: 700; }
.grid td.m { background: var(--maybe-bg); color: var(--maybe); font-weight: 700; }
.grid tr.me td.name { font-weight: 700; }
.grid tfoot td { font-weight: 700; background: var(--soft); font-variant-numeric: tabular-nums; }
.grid tfoot td.name { background: var(--soft); }
.grid .best { box-shadow: inset 0 -3px 0 var(--slate); }
.comment { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: normal; }

/* Notices */
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice-info { background: var(--soft); }
.notice-final { background: var(--chiffon); color: var(--fg); }
.notice-error { background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #333; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; max-width: calc(100% - 32px); }

footer.foot { padding-block: 28px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 560px) {
  .card { padding: 18px; }
  .hero { padding-block: 28px 48px; }
  .nav img { height: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
