/* =====================================================================
   Christ Fellowship - Port St. Lucie  ·  Volunteer Dashboard
   Refined, warm, premium aesthetic · Fraunces + Hanken Grotesk
   ===================================================================== */

:root {
  --brand:           #0092BC;
  --brand-dark:      #006C8E;
  --brand-deep:      #00536E;
  --brand-tint:      #E8F5FA;
  --brand-glow:      rgba(0,146,188,0.16);

  --navy:            #0B2545;
  --navy-soft:       #13315C;

  --ink:             #16233A;
  --ink-muted:       #5A6B82;
  --ink-soft:        #93A1B5;
  --line:            #E6EBF1;
  --line-soft:       #F0F3F7;

  --bg:              #F4F6FA;
  --bg-warm:         #FBFAF7;
  --card:            #FFFFFF;

  --good:            #15803D;
  --good-bg:         #DCFAE6;
  --warn:            #B45309;
  --warn-bg:         #FEF3C7;
  --bad:             #C2334D;
  --bad-bg:          #FCE7EC;

  --shadow-sm:       0 1px 2px rgba(11,37,69,0.05), 0 1px 3px rgba(11,37,69,0.07);
  --shadow:          0 2px 4px rgba(11,37,69,0.05), 0 6px 16px rgba(11,37,69,0.06);
  --shadow-lg:       0 12px 28px rgba(11,37,69,0.12), 0 6px 14px rgba(11,37,69,0.06);
  --shadow-glow:     0 0 0 4px var(--brand-glow);

  --radius:          14px;
  --radius-lg:       18px;
  --radius-sm:       9px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, var(--brand-tint) 0%, transparent 55%),
    radial-gradient(900px 450px at -5% 5%, #EEF4FB 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand-deep); }

/* ---------- Layout ---------- */
.shell { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.topbar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  border-bottom: 3px solid var(--brand);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 20px rgba(11,37,69,0.18);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-row { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text { line-height: 1.15; }
.brand-text .church {
  font-family: var(--font-display);
  font-weight: 600; color: white; font-size: 17px; letter-spacing: -0.01em;
}
.brand-text .campus { font-size: 11px; color: #9DB2CC; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; }
.topbar-nav { display: flex; align-items: center; gap: 26px; }
.topbar-nav a {
  color: #C2D0E2; font-weight: 600; font-size: 14px;
  transition: color 0.18s var(--ease); position: relative; padding: 4px 0;
}
.topbar-nav a:hover { color: white; }
.topbar-nav a.active { color: #fff; }
.topbar-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--brand); border-radius: 2px;
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 6px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: #C2D0E2;
  border-radius: 2px; transition: all 0.25s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Warning banner */
.warn-banner {
  background: var(--warn-bg); border-bottom: 1px solid #FCD980;
  padding: 9px 0; font-size: 13px; color: #7A4A0A;
}
.warn-banner code {
  background: rgba(122,74,10,0.12); padding: 1px 6px; border-radius: 4px;
  font-size: 12px; font-family: ui-monospace, monospace;
}

main { padding: 32px 0 64px; animation: page-enter 0.5s var(--ease); }
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--navy); line-height: 1.1;
}
.page-header .sub { color: var(--ink-muted); font-size: 14px; margin-top: 6px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 17px; border-radius: var(--radius-sm); border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white; box-shadow: 0 2px 8px rgba(0,146,188,0.3);
}
.btn-primary:hover { color: white; box-shadow: 0 4px 14px rgba(0,146,188,0.42); transform: translateY(-1px); }
.btn-ghost {
  background: white; color: var(--ink); border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--ink-soft); }
.btn-danger {
  background: white; color: var(--bad); border: 1px solid #FECACA;
}
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat {
  position: relative; overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand); opacity: 0.0; transition: opacity 0.2s;
}
.stat:hover::after { opacity: 1; }
.stat .label {
  font-size: 11px; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 38px; font-weight: 600; color: var(--navy); letter-spacing: -0.02em;
  margin-top: 4px; font-variant-numeric: tabular-nums;
}
.stat.warn .value { color: var(--bad); }
.stat.good .value { color: var(--good); }

/* ---------- Group cards (overview page) ---------- */
.group-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}
.group-card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 22px; transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: inherit; position: relative; overflow: hidden;
}
.group-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--brand);
}
.group-card .group-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600; color: var(--navy); letter-spacing: -0.01em;
}
.group-card .group-command { font-size: 13px; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.group-card .group-meta { display: flex; align-items: center; justify-content: space-between; }
.group-card .progress { height: 9px; background: var(--line); border-radius: 99px; overflow: hidden; }
.group-card .progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); border-radius: 99px; transition: width 0.6s var(--ease); }
.group-card.empty .progress-bar { background: var(--bad); }
.group-card.full .progress-bar { background: linear-gradient(90deg, #1fa350, var(--good)); }
.group-card .group-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.group-card .group-status.full { background: var(--good-bg); color: var(--good); }
.group-card .group-status.short { background: var(--bad-bg); color: var(--bad); }
.group-card .group-status.partial { background: var(--warn-bg); color: var(--warn); }
.group-card .group-status.empty { background: var(--bad-bg); color: var(--bad); }
.group-card .empty-note { color: var(--ink-soft); font-size: 13px; font-style: italic; }

/* Staggered entrance for grids of cards */
.group-grid .group-card {
  animation: card-rise 0.5s var(--ease) both;
}
.group-grid .group-card:nth-child(1) { animation-delay: 0.02s; }
.group-grid .group-card:nth-child(2) { animation-delay: 0.06s; }
.group-grid .group-card:nth-child(3) { animation-delay: 0.10s; }
.group-grid .group-card:nth-child(4) { animation-delay: 0.14s; }
.group-grid .group-card:nth-child(5) { animation-delay: 0.18s; }
.group-grid .group-card:nth-child(6) { animation-delay: 0.22s; }
.group-grid .group-card:nth-child(7) { animation-delay: 0.26s; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Group detail page ---------- */
.section { margin-bottom: 32px; }
.section h2 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.section h3 {
  font-size: 15px; font-weight: 600; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

.timeslot {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 14px; overflow: hidden;
}

/* Use native <details> for collapse — no JS needed */
.timeslot summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  transition: background 0.15s;
}
.timeslot summary::-webkit-details-marker { display: none; }
.timeslot summary:hover { background: #FBFCFD; }

.timeslot .chevron {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.timeslot .chevron::before {
  content: ""; display: block;
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-top: -3px;
}
.timeslot[open] .chevron::before { transform: rotate(45deg); margin-top: -1px; }

.timeslot-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: var(--navy);
  letter-spacing: -0.01em;
  flex: 1;
}

.timeslot-summary {
  font-size: 13px; color: var(--ink-muted); font-weight: 500;
  white-space: nowrap;
}

.timeslot-body {
  padding: 4px 0 10px;
  border-top: 1px solid var(--line);
  background: #FBFCFD;
}

/* ---------- Spot rows (cleaner) ---------- */
.spot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #F1F5F9;
  background: var(--card);
  margin: 0 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.spot:last-child { margin-bottom: 8px; }
.spot:hover { background: #FAFBFC; }

.spot-main { min-width: 0; }
.spot-label {
  font-weight: 600; color: var(--ink); font-size: 14px;
  margin-bottom: 4px;
}
.spot-volunteers {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 10px; background: var(--good-bg); color: var(--good);
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.chip .x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: transparent; color: var(--good);
  cursor: pointer; font-size: 14px; line-height: 1; border: none; padding: 0;
}
.chip .x:hover { background: var(--bad); color: white; }
.empty-pill {
  display: inline-flex; padding: 3px 10px;
  background: var(--bad-bg); color: var(--bad);
  border-radius: 999px; font-size: 12px; font-weight: 600;
}

.spot-actions {
  display: flex; gap: 4px; align-items: center; position: relative;
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: transparent; color: var(--ink-muted);
  border: 1px solid transparent; cursor: pointer;
  font-size: 16px; font-weight: 600;
  transition: all 0.15s;
  padding: 0;
}
.icon-btn:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.icon-btn.icon-add:hover { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand); }

/* Expand panels (add-person form / manage menu) hidden by default; JS toggles .hidden */
.row-expand {
  grid-column: 1 / -1;
}
.row-expand.hidden { display: none; }
.hidden { display: none; }

.add-form {
  grid-column: 1 / -1;
  margin-top: 6px; padding: 8px 0 4px;
  display: flex; gap: 6px; align-items: center;
}
.add-form input[type="text"] {
  flex: 1; max-width: 280px;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 13px;
}
.add-form input[type="text"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,146,188,0.15);
}

.menu-form {
  grid-column: 1 / -1;
  margin-top: 6px; padding: 8px 12px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  background: var(--bg); border-radius: 6px;
  font-size: 13px;
}
.menu-form .menu-group {
  display: inline-flex; align-items: center; gap: 6px;
}
.menu-form .label { color: var(--ink-muted); font-weight: 500; }
.menu-form input[type="number"] {
  width: 56px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 13px; text-align: center;
}
.menu-form .divider { width: 1px; height: 22px; background: var(--line); }

/* ---------- Schedule manager (new) ---------- */
.schedule-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 20px 22px; margin-bottom: 20px;
}
.schedule-card h2 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; color: var(--navy);
  letter-spacing: -0.01em; margin-bottom: 4px;
}
.schedule-card .desc {
  font-size: 13px; color: var(--ink-muted); margin-bottom: 14px;
}
.schedule-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.schedule-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; background: var(--brand-tint);
  border-radius: 8px; font-size: 14px; color: var(--brand-dark);
  font-weight: 600;
}
.schedule-item-empty {
  padding: 14px; background: #FAFBFC; border: 1px dashed var(--line);
  border-radius: 8px; text-align: center;
  color: var(--ink-soft); font-size: 13px; font-style: italic;
}
.schedule-add-form {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.schedule-add-form select, .schedule-add-form input[type="time"] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; font-size: 14px; background: white;
}
.schedule-add-form select:focus, .schedule-add-form input[type="time"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,146,188,0.15);
}

/* ---------- Auto-post toggle ---------- */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.toggle-row .info .title { font-weight: 700; color: var(--ink); font-size: 15px; }
.toggle-row .info .desc { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.switch {
  position: relative; display: inline-block; width: 50px; height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--ink-soft); border-radius: 99px; transition: 0.2s;
}
.slider:before {
  position: absolute; content: ""; height: 22px; width: 22px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
input:checked + .slider { background: var(--brand); }
input:checked + .slider:before { transform: translateX(22px); }

/* ---------- Add-role form ---------- */
.add-role-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px dashed var(--line); padding: 20px;
}
.add-role-card form {
  display: grid;
  grid-template-columns: 2fr 2fr auto auto;
  gap: 10px; align-items: end;
}
.add-role-card label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.add-role-card input, .add-role-card select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 14px;
  background: white;
}
.add-role-card input:focus, .add-role-card select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,146,188,0.15);
}

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #F8FAFC 0%, #E6F4F9 100%);
}
.login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-header {
  background: #0F172A;
  padding: 32px 36px 28px;
  text-align: center;
  border-bottom: 3px solid var(--brand);
}
.login-header .logo { height: 56px; }
.login-body {
  padding: 28px 36px 36px;
  text-align: center;
}
.login-card h1 {
  font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.login-card .sub { color: var(--ink-muted); font-size: 14px; margin-bottom: 24px; }
.login-card input[type="password"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 15px; margin-bottom: 16px;
}
.login-card input[type="password"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,146,188,0.15);
}
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-error {
  background: var(--bad-bg); color: var(--bad);
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  margin-bottom: 16px; text-align: left;
}

/* ---------- Flash messages ---------- */
.flashes { margin-bottom: 20px; }
.flash {
  padding: 12px 16px; border-radius: 8px; font-size: 14px;
  margin-bottom: 8px;
}
.flash.success { background: var(--good-bg); color: var(--good); }
.flash.error   { background: var(--bad-bg);  color: var(--bad);  }
.flash.info    { background: var(--brand-tint); color: var(--brand-dark); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ---------- Print styles ---------- */
@media print {
  .topbar, .toggle-row, .add-role-card, .page-header .actions,
  .spot-actions, .chip .x, .inline-add { display: none !important; }
  body { background: white; }
  .card, .timeslot { box-shadow: none; border: 1px solid #ddd; }
  .spot { break-inside: avoid; }
  .timeslot { break-inside: avoid; page-break-inside: avoid; }
  main { padding: 0; }
}

/* ---------- Report tables ---------- */
.report-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; color: var(--ink);
}
.report-table thead th {
  background: var(--ink);
  color: white;
  text-align: center;
  font-weight: 600;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-table thead th:first-child { border-top-left-radius: 8px; }
.report-table thead th:last-child { border-top-right-radius: 8px; }
.report-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.report-table tbody tr:nth-child(even) { background: #FBFCFD; }
.report-table tbody tr:hover { background: var(--brand-tint); }
.report-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.report-table td.num.cancel { color: var(--bad); }

/* ---------- Help page ---------- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.help-card { padding: 22px 24px; }
.help-card h2 { margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .page-header h1 { font-size: 24px; }
  .stat .value { font-size: 26px; }
  .spot { grid-template-columns: 1fr; }
  .add-role-card form { grid-template-columns: 1fr; }
  .report-table { font-size: 12.5px; }
  .report-table thead th, .report-table tbody td { padding: 8px 8px; }
}

/* =====================================================================
   NEXT-LEVEL UI — rings, toasts, celebration, smooth motion
   ===================================================================== */

/* ---------- Progress rings (replace flat percent badges) ---------- */
.ring {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.ring svg { transform: rotate(-90deg); display: block; }
.ring .ring-track { stroke: var(--line); }
.ring .ring-fill {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s var(--ease), stroke 0.5s var(--ease);
}
.ring .ring-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
/* Slot header ring — larger */
.ring.ring-lg { width: 50px; height: 50px; }
.ring.ring-lg .ring-label { font-size: 12px; }
/* Spot row ring — smaller */
.ring.ring-sm { width: 40px; height: 40px; }
.ring.ring-sm .ring-label { font-size: 10.5px; }

/* When fully filled, add a soft glow + checkmark flourish */
.ring.is-full .ring-label { color: var(--good); }
.ring.is-full::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(21,128,61,0.14);
  animation: ring-pop 0.45s var(--ease-bounce);
}
@keyframes ring-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* The spot count number flips briefly when it changes */
.count-flash { animation: count-flash 0.5s var(--ease); }
@keyframes count-flash {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: var(--brand); }
  100% { transform: scale(1); }
}

/* Chips fade/slide in and out on live update */
.chip {
  animation: chip-in 0.32s var(--ease-bounce) both;
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.6) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.chip.chip-leaving {
  animation: chip-out 0.28s var(--ease) forwards;
}
@keyframes chip-out {
  to { opacity: 0; transform: scale(0.6) translateY(-4px); }
}

/* ---------- Smooth collapse for <details> time slots ---------- */
.timeslot .timeslot-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.32s var(--ease);
}
.timeslot:not([open]) .timeslot-body { grid-template-rows: 0fr; }
/* The wrapper needs overflow hidden for the grid trick */
.timeslot .timeslot-body > .timeslot-body-inner { overflow: hidden; min-height: 0; }
/* Keep <details> able to animate: show body always, animate rows */
.timeslot[open] > summary ~ .timeslot-body { }

/* Chevron rotation already handled; add a subtle hover scale */
.timeslot summary:hover .timeslot-title { color: var(--brand-dark); }

/* ---------- Toast notifications ---------- */
#toast-container {
  position: fixed; bottom: 22px; right: 22px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  min-width: 240px; max-width: 360px;
  padding: 13px 16px; border-radius: 12px;
  background: white; color: var(--ink);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
  transform: translateX(420px); opacity: 0;
  transition: transform 0.4s var(--ease-bounce), opacity 0.3s var(--ease);
  pointer-events: auto;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: white;
}
.toast-success { border-left: 4px solid var(--good); }
.toast-success .toast-icon { background: var(--good); }
.toast-error { border-left: 4px solid var(--bad); }
.toast-error .toast-icon { background: var(--bad); }
.toast-info { border-left: 4px solid var(--brand); }
.toast-info .toast-icon { background: var(--brand); }
.toast-msg { line-height: 1.35; }

/* ---------- Celebration confetti ---------- */
#confetti-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1500;
}

/* ---------- Reduced motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Mobile nav ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .topbar-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy-soft);
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s var(--ease);
    box-shadow: 0 8px 20px rgba(11,37,69,0.25);
  }
  .topbar-nav.open { max-height: 320px; }
  .topbar-nav a {
    padding: 14px 24px; border-top: 1px solid rgba(255,255,255,0.08);
  }
  .topbar-nav a.active::after { display: none; }
  .topbar { position: relative; }
}
