:root {
  --wine-950: #2a0a16;
  --wine-900: #3d0f20;
  --wine-800: #5a1229;
  --wine-700: #7b1e3a;
  --wine-600: #9b2c4c;
  --wine-100: #f6e7ec;
  --wine-50: #fbf3f5;
  --gold: #c9a45c;

  --bg: #faf7f4;
  --surface: #ffffff;
  --surface-2: #f6f2ee;
  --text: #1d1418;
  --text-2: #5d5257;
  --muted: #968a8f;
  --line: #ece5e1;
  --line-strong: #ddd3ce;

  --yes: #1f9d5b;
  --yes-soft: #e4f6ec;
  --maybe: #e0a100;
  --maybe-soft: #fdf3d6;
  --no: #dc3e46;
  --no-soft: #fde7e8;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(42, 10, 22, .05), 0 1px 1px rgba(42, 10, 22, .03);
  --shadow: 0 1px 2px rgba(42, 10, 22, .04), 0 8px 24px -8px rgba(42, 10, 22, .12);
  --shadow-lg: 0 2px 4px rgba(42, 10, 22, .04), 0 24px 48px -12px rgba(42, 10, 22, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(155, 44, 76, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(201, 164, 92, .10), transparent 60%);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.1; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

a { color: var(--wine-700); }

::selection { background: var(--wine-100); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2rem);
  background: rgba(250, 247, 244, .75);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(236, 229, 225, .8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--wine-600), var(--wine-900));
  box-shadow: 0 4px 12px -4px rgba(123, 30, 58, .6), inset 0 1px 0 rgba(255,255,255,.2);
}

.session { display: flex; align-items: center; gap: .5rem; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .35rem .25rem .25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
}
.user-chip .who { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .logout {
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: .3rem .7rem;
  font-size: .8rem;
  font-weight: 500;
}
.user-chip .logout:hover { background: var(--wine-100); color: var(--wine-700); }

.avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .02em;
  background: var(--wine-700);
}
.avatar.lg { width: 36px; height: 36px; font-size: .85rem; }

/* ---------- Layout ---------- */

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 5rem;
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wine-600);
  margin-bottom: .5rem;
}
.lead { color: var(--text-2); font-size: 1.02rem; margin-top: .5rem; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; }
.section-title .count { font-size: .85rem; color: var(--muted); font-family: var(--sans); font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Forms ---------- */

.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: .4rem;
}
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .35rem; }

input[type=text], input[type=email], input[type=date] {
  width: 100%;
  height: 44px;
  padding: 0 .9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #b8adb2; }
input:hover { border-color: #cbbfba; }
input:focus { outline: none; border-color: var(--wine-600); box-shadow: 0 0 0 4px rgba(155, 44, 76, .12); }

/* ---------- Buttons ---------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 42px;
  padding: 0 1.1rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button svg, .btn svg { width: 16px; height: 16px; }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--wine-600), var(--wine-700));
  border-color: var(--wine-800);
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -6px rgba(123, 30, 58, .6);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--wine-700), var(--wine-800)); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(42, 10, 22, .05); color: var(--text); }

.btn-danger { background: transparent; color: var(--no); border-color: #f3c5c8; }
.btn-danger:hover { background: var(--no-soft); }

.btn-block { width: 100%; height: 48px; font-size: .95rem; }
.btn-sm { height: 34px; padding: 0 .8rem; font-size: .82rem; }

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Login ---------- */

.auth {
  max-width: 440px;
  margin: clamp(1rem, 6vh, 4rem) auto;
  text-align: center;
}
.auth-hero {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  border-radius: 22px;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, var(--wine-600), var(--wine-950));
  box-shadow: 0 18px 40px -14px rgba(123, 30, 58, .7), inset 0 1px 0 rgba(255,255,255,.2);
}
.auth-hero svg { width: 34px; height: 34px; }
.auth h1 { margin-bottom: .6rem; }
.auth .card { margin-top: 2rem; text-align: left; box-shadow: var(--shadow-lg); }
.auth .fine { font-size: .8rem; color: var(--muted); margin-top: 1.25rem; text-align: center; }

.sent-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: var(--yes);
  background: var(--yes-soft);
}
.sent-icon svg { width: 26px; height: 26px; }

/* ---------- Event list ---------- */

.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }

.event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.event-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wine-600), var(--gold));
  opacity: 0;
  transition: opacity .2s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.event-card:hover::before { opacity: 1; }
.event-card.closed { opacity: .72; }
.event-card h3 { font-size: 1.2rem; line-height: 1.25; }

.meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .85rem; color: var(--text-2); }
.meta span { display: inline-flex; align-items: center; gap: .35rem; }
.meta svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }

.date-strip { display: flex; gap: .35rem; flex-wrap: wrap; }
.date-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: .3rem .4rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: .7rem;
  line-height: 1.15;
  color: var(--text-2);
}
.date-pill b { font-size: .95rem; color: var(--text); font-weight: 600; }
.date-pill.more { justify-content: center; font-weight: 600; font-size: .78rem; }

.event-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: .9rem; border-top: 1px dashed var(--line); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open { background: var(--yes-soft); color: var(--yes); }
.badge.closed { background: var(--surface-2); color: var(--muted); }
.badge.voted { background: var(--wine-50); color: var(--wine-700); }
.badge.voted::before { display: none; }
.badge:empty { display: none; }

.empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--muted);
  background: rgba(255,255,255,.5);
}
.empty .big { font-size: 2.2rem; margin-bottom: .5rem; }
.empty h3 { color: var(--text); margin-bottom: .25rem; }

/* ---------- Calendar picker ---------- */

.calendar { user-select: none; -webkit-user-select: none; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cal-nav .title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; text-transform: capitalize; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 2rem; }
.cal-month-title { font-weight: 600; font-size: .9rem; text-transform: capitalize; margin-bottom: .6rem; color: var(--text-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-bottom: .35rem; }
.cal-day {
  position: relative;
  height: auto;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--wine-50); color: var(--wine-700); }
.cal-day.blank { visibility: hidden; }
.cal-day.past { color: #c9c0c3; }
.cal-day.weekend:not(.selected):not(.past) { color: var(--wine-600); }
.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--wine-600);
}
.cal-day.selected {
  color: #fff;
  background: linear-gradient(160deg, var(--wine-600), var(--wine-800));
  box-shadow: 0 6px 14px -6px rgba(123, 30, 58, .7);
}
.cal-day.selected.today::after { background: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 30px;
  padding: 0 .35rem 0 .7rem;
  border-radius: 999px;
  background: var(--wine-50);
  border: 1px solid var(--wine-100);
  color: var(--wine-800);
  font-size: .8rem;
  font-weight: 500;
}
.chip button { height: 22px; width: 22px; padding: 0; border-radius: 50%; background: transparent; color: var(--wine-600); font-size: 1rem; line-height: 1; }
.chip button:hover { background: var(--wine-100); }

.form-actions {
  position: sticky;
  bottom: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1.5rem;
  padding: .75rem;
  border-radius: var(--r);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

/* ---------- Event detail ---------- */

.event-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--r-lg);
  color: #fff;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(201, 164, 92, .35), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(155, 44, 76, .6), transparent 60%),
    linear-gradient(135deg, var(--wine-800), var(--wine-950));
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}
.event-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 30px rgba(255,255,255,.03), 0 0 0 60px rgba(255,255,255,.02);
}
.event-hero h1 { color: #fff; margin: .25rem 0 .85rem; }
.event-hero .eyebrow { color: var(--gold); }
.event-hero .meta { color: rgba(255,255,255,.85); font-size: .92rem; }
.event-hero .meta svg { color: var(--gold); }
.event-hero .actions { position: relative; z-index: 1; display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.event-hero .btn-glass {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
}
.event-hero .btn-glass:hover { background: rgba(255,255,255,.2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stats .card { margin-top: 0; }
.stat { padding: 1rem 1.2rem; }
.stat .label { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin-top: .2rem; letter-spacing: -.02em; }
.stat .value small { font-family: var(--sans); font-size: .8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }

/* Vote rows (one per date) */

.vote-list { display: flex; flex-direction: column; gap: .6rem; }

.vote-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.vote-row:hover { border-color: var(--line-strong); }
.vote-row.best { border-color: rgba(31, 157, 91, .45); box-shadow: 0 0 0 3px rgba(31, 157, 91, .08), var(--shadow-sm); }
.vote-row.past { opacity: .55; }

.cal-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}
.cal-tile .m { width: 100%; padding: .15rem 0; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--wine-700); }
.cal-tile .d { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.15; padding-top: .15rem; }
.cal-tile .w { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-bottom: .3rem; }

.vote-info { min-width: 0; }
.vote-info .top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.best-tag {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--yes);
  background: var(--yes-soft);
  padding: .15rem .5rem;
  border-radius: 999px;
}

.bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: .5rem 0 .55rem; max-width: 360px; }
.bar i { display: block; height: 100%; transition: width .4s var(--ease); }
.bar .y { background: var(--yes); }
.bar .m { background: var(--maybe); }
.bar .n { background: var(--no); }

.tally { display: inline-flex; gap: .75rem; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tally .y { color: var(--yes); }
.tally .m { color: var(--maybe); }
.tally .n { color: var(--no); }

.voters { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }
.voter {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .55rem .15rem .2rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.voter .dot { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: .65rem; font-weight: 800; }
.voter.yes { background: var(--yes-soft); color: #156b3e; }
.voter.yes .dot { background: var(--yes); }
.voter.maybe { background: var(--maybe-soft); color: #8a6300; }
.voter.maybe .dot { background: var(--maybe); }
.voter.no { background: var(--no-soft); color: #a32a31; }
.voter.no .dot { background: var(--no); }

/* Segmented yes / maybe / no */

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg {
  width: 44px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: #b3a8ad;
}
.seg svg { width: 20px; height: 20px; stroke-width: 2.6; }
.seg:hover:not(:disabled) { background: var(--surface); }
.seg.yes:hover:not(:disabled) { color: var(--yes); }
.seg.maybe:hover:not(:disabled) { color: var(--maybe); }
.seg.no:hover:not(:disabled) { color: var(--no); }
.seg.active { color: #fff; }
.seg.pop { animation: pop .28s var(--ease); }
.seg.yes.active { background: var(--yes); box-shadow: 0 4px 12px -4px rgba(31, 157, 91, .7); }
.seg.maybe.active { background: var(--maybe); box-shadow: 0 4px 12px -4px rgba(224, 161, 0, .7); }
.seg.no.active { background: var(--no); box-shadow: 0 4px 12px -4px rgba(220, 62, 70, .7); }

@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: #fff; }
.mark svg { width: 14px; height: 14px; stroke-width: 3; }
.mark.yes { background: var(--yes); }
.mark.maybe { background: var(--maybe); }
.mark.no { background: var(--no); }

/* Matrix (everyone x every date) */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .85rem; }
table.matrix th, table.matrix td { padding: .6rem .7rem; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.matrix thead th { font-size: .72rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); vertical-align: bottom; }
table.matrix thead th .dd { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--text); }
table.matrix th.sticky, table.matrix td.sticky { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface); border-right: 1px solid var(--line); }
table.matrix thead th.sticky { background: var(--surface-2); }
table.matrix tr.me td { background: var(--wine-50); }
table.matrix tr.me td.sticky { background: var(--wine-50); }
table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix tfoot td { font-weight: 600; background: var(--surface-2); border-bottom: none; border-top: 1px solid var(--line-strong); }
table.matrix .person { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
table.matrix .person .avatar { width: 24px; height: 24px; font-size: .62rem; }
table.matrix .none { color: #d6cdd0; }
table.matrix col.best-col { background: rgba(31, 157, 91, .06); }

.tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.tab { height: 32px; padding: 0 .9rem; border-radius: 9px; background: transparent; color: var(--text-2); font-size: .82rem; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.notice {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1rem;
  border-radius: var(--r-sm);
  font-size: .88rem;
  background: var(--surface-2);
  color: var(--text-2);
  margin-bottom: 1rem;
}
.notice svg { width: 18px; height: 18px; flex-shrink: 0; }
.notice.warn { background: var(--maybe-soft); color: #7a5800; }

/* ---------- Members admin ---------- */

.member-list { display: flex; flex-direction: column; }
.member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: .9rem;
  align-items: center;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: none; }
.member-row .email { font-size: .85rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row .email b { display: block; color: var(--text); font-weight: 600; font-size: .92rem; }
.member-row input { height: 38px; }

/* ---------- Misc ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.15rem;
  border-radius: 999px;
  background: var(--wine-950);
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--no); }

.loader { display: flex; justify-content: center; gap: 6px; padding: 5rem 0; }
.loader span { width: 8px; height: 8px; border-radius: 50%; background: var(--wine-600); animation: bounce 1s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .15s; }
.loader span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.back { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 500; color: var(--text-2); text-decoration: none; margin-bottom: 1rem; }
.back:hover { color: var(--wine-700); }
.back svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: span 2; }
  .vote-row { grid-template-columns: 60px minmax(0, 1fr); gap: .8rem; }
  .vote-row .segmented { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .seg { width: auto; }
  .cal-tile .d { font-size: 1.3rem; }
  .member-row { grid-template-columns: auto minmax(0, 1fr); }
  .member-row input, .member-row .actions { grid-column: 1 / -1; }
  .user-chip .who { display: none; }
  .section-title .legend { display: none; }
  .form-actions { bottom: .5rem; }
  .form-actions button { flex: 1; }
}

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