/* =========================================================================
   Givewell Volunteer Platform — cohesive mobile-first stylesheet
   Aesthetic: vibrant, joyful, "civic sunrise". A high-energy palette of coral,
   tangerine, magenta and electric violet, balanced by a jade success tone, on
   a bright warm-white canvas lit by aurora gradient glows. Editorial display
   serif paired with a humanist sans. Generous tap targets, layered soft
   shadows, gentle grain. Built to feel alive and invite participation.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Mulish:wght@400;500;600;700&display=swap');

:root {
  /* --- Brand palette: vibrant + energetic --- */
  --paper:        #fdf6f1;   /* page background, bright warm white */
  --paper-deep:   #f7e8df;   /* sunk panels */
  --card:         #ffffff;   /* crisp card surface */
  --ink:          #241d2b;   /* primary text, deep plum near-black */
  --ink-soft:     #6f6577;   /* secondary text */
  --line:         #eddfd6;   /* hairlines / borders */

  /* Primary + warm accents (the brand carries warm dominance) */
  --terracotta:   #ff5a5f;   /* primary action — vivid coral */
  --terracotta-d: #e63e54;   /* pressed */
  --clay:         #ff8f3c;   /* warm accent — tangerine */
  --magenta:      #ff4d8d;   /* hot pink highlight */
  --violet:       #6d5efc;   /* electric accent */
  /* Status tones */
  --sage:         #12b886;   /* success / certified — jade */
  --sage-soft:    #d6f5ea;
  --gold:         #f5a623;   /* pending / highlight — amber */
  --gold-soft:    #fdeecb;
  --rust-soft:    #ffe1e3;   /* danger / rejected bg */
  --rust:         #e63946;

  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;

  --shadow-sm: 0 1px 2px rgba(40, 24, 52, .06), 0 2px 6px rgba(40, 24, 52, .05);
  --shadow-md: 0 4px 10px rgba(40, 24, 52, .08), 0 12px 28px rgba(40, 24, 52, .10);
  --shadow-lg: 0 18px 50px rgba(40, 24, 52, .20);

  --tap: 48px;            /* minimum tap target */
  --maxw: 1080px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Mulish', system-ui, -apple-system, sans-serif;
}

/* --- Reset-ish --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 560px at 100% -12%, rgba(255, 77, 141, .16), transparent 60%),
    radial-gradient(820px 520px at -8% 4%, rgba(109, 94, 252, .14), transparent 58%),
    radial-gradient(760px 520px at 60% 108%, rgba(18, 184, 134, .12), transparent 60%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* subtle grain overlay, fixed & non-interactive */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .4em;
  color: var(--ink);
}
h1 { font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--terracotta-d); }

/* =========================================================================
   Layout primitives
   ========================================================================= */
.app { position: relative; z-index: 1; }
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}
.section { padding: 28px 0; }
.stack > * + * { margin-top: 18px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================================
   Header / nav
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.4) blur(10px);
  background: rgba(253, 246, 241, .82);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 8px 18px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--terracotta), var(--clay));
  box-shadow: var(--shadow-sm);
  color: #fff;
  flex: 0 0 auto;
}
.brand__mark svg { width: 20px; height: 20px; }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions__who {
  font-size: .85rem;
  color: var(--ink-soft);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.nav-link:hover { color: var(--ink); background: var(--paper-deep); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  padding: 40px 0 18px;
}
.hero__eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--terracotta), var(--magenta));
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(255, 77, 141, .28);
}
.hero h1 {
  max-width: 18ch;
  background: linear-gradient(118deg, var(--terracotta-d) 0%, var(--magenta) 48%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 52ch;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --bg: linear-gradient(122deg, var(--terracotta), var(--magenta));
  --bgd: linear-gradient(122deg, var(--terracotta-d), #db3f7e);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--bgd); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.btn[disabled], .btn[aria-busy="true"] {
  opacity: .6; cursor: not-allowed; transform: none;
}
.btn--block { width: 100%; }
.btn--ghost {
  --bg: transparent; --bgd: var(--paper-deep); --fg: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn--sage  { --bg: var(--sage); --bgd: #0e9b72; }
.btn--danger{ --bg: var(--rust); --bgd: #c52030; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .85rem; border-radius: 9px; }
.btn--icon { padding: 0 12px; }

/* =========================================================================
   Cards & panels
   ========================================================================= */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.panel__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* =========================================================================
   Auth (login / register)
   ========================================================================= */
.auth {
  display: grid;
  gap: 22px;
  align-items: start;
}
@media (min-width: 820px) {
  .auth { grid-template-columns: 1.1fr .9fr; }
}
.auth__aside {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 143, 60, .55), transparent 55%),
    linear-gradient(160deg, #5b2bd6, #d6356f 62%, #ff6a4d);
  color: #fdeef6;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.auth__aside h2 { color: #fff; }
.auth__aside p { color: #f4dcee; }
.auth__aside ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.auth__aside li { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; color: #fbe7f3; }
.auth__aside li svg { flex: 0 0 auto; margin-top: 2px; color: #ffd9a8; }

.tabs {
  display: inline-flex;
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
}
.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 40px;
}
.tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* =========================================================================
   Forms
   ========================================================================= */
.field { display: block; margin-bottom: 14px; }
.field > label, .label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint { font-size: .76rem; color: var(--ink-soft); font-weight: 500; }
input, select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s;
}
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--clay);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(255, 90, 95, .18);
}
input::placeholder, textarea::placeholder { color: #a89c8c; }
.field-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .field-row--2 { grid-template-columns: 1fr 1fr; } .field-row--3 { grid-template-columns: 1fr 1fr 1fr; } }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
legend { font-family: var(--font-display); font-weight: 600; padding: 0 8px; font-size: 1.02rem; }

/* =========================================================================
   Filters bar
   ========================================================================= */
.filters {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) {
  .filters { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
}
.filters .field { margin: 0; }

/* =========================================================================
   Event cards (list-first discovery)
   ========================================================================= */
.event-list { display: grid; gap: 16px; }
@media (min-width: 760px) { .event-list { grid-template-columns: 1fr 1fr; } }

.event-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.event-card__banner {
  height: 84px;
  background:
    linear-gradient(135deg, rgba(255,90,95,.95), rgba(255,77,141,.90) 55%, rgba(109,94,252,.88)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 10px, transparent 10px 20px);
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  color: #fff;
}
.event-card__org {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .95;
}
.event-card__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.event-card__name { margin: 0; font-size: 1.22rem; }
.event-card__meta { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--ink-soft); }
.event-card__meta .row { display: flex; align-items: center; gap: 8px; }
.event-card__meta svg { flex: 0 0 auto; color: var(--terracotta); }
.event-card__desc { font-size: .9rem; color: var(--ink-soft); margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .72rem;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}

.slots { display: grid; gap: 8px; margin-top: 4px; }
.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.slot__time { font-size: .86rem; font-weight: 600; }
.slot__time small { display: block; font-weight: 500; color: var(--ink-soft); }
.slot__remain {
  font-size: .74rem;
  font-weight: 700;
  color: var(--sage);
}
.slot__remain.is-low { color: var(--gold); }
.slot__remain.is-full { color: var(--rust); }

/* =========================================================================
   Badges
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: capitalize;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--confirmed { color: var(--sage);   background: var(--sage-soft); }
.badge--completed { color: var(--terracotta-d); background: var(--rust-soft); }
.badge--cancelled { color: var(--ink-soft); background: var(--paper-deep); }
.badge--pending   { color: var(--gold);   background: var(--gold-soft); }
.badge--certified { color: var(--sage);   background: var(--sage-soft); }
.badge--rejected  { color: var(--rust);   background: var(--rust-soft); }
.badge--checked_in  { color: var(--gold); background: var(--gold-soft); }
.badge--checked_out { color: var(--sage); background: var(--sage-soft); }

/* =========================================================================
   My registrations
   ========================================================================= */
.reg-list { display: grid; gap: 14px; }
.reg-card { padding: 18px; }
.reg-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.reg-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* =========================================================================
   Tables (admin)
   ========================================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: 13px 16px; text-align: left; font-size: .9rem; vertical-align: middle; }
table.data thead th {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--paper-deep); border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
table.data tbody tr + tr td { border-top: 1px solid var(--line); }
table.data tbody tr:hover td { background: rgba(255,90,95,.045); }
table.data .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.row-actions { display: flex; gap: 8px; }

/* =========================================================================
   Slot configuration grid (admin event form)
   ========================================================================= */
.slot-grid { display: grid; gap: 10px; }
.slot-grid__row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  align-items: end;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}
@media (min-width: 640px) {
  .slot-grid__row { grid-template-columns: 1fr 1fr .7fr auto; }
}
.slot-grid__row .field { margin: 0; }

/* =========================================================================
   Events overview (admin) with fill bars
   ========================================================================= */
.fill { height: 8px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; margin-top: 4px; }
.fill__bar { height: 100%; background: linear-gradient(90deg, var(--sage), var(--clay), var(--magenta)); border-radius: 999px; transition: width .4s ease; }

/* =========================================================================
   States: loading / empty / error
   ========================================================================= */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--paper-deep);
  border-radius: var(--radius);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-card { height: 220px; }

.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink-soft);
}
.empty svg { color: var(--clay); margin-bottom: 10px; }
.empty h3 { color: var(--ink); }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert svg { flex: 0 0 auto; margin-top: 2px; }
.alert--error   { background: var(--rust-soft); color: #c52030; border-color: #f7c2c6; }
.alert--success { background: var(--sage-soft); color: #0c7a5a; border-color: #b6ead7; }
.alert--info    { background: var(--gold-soft); color: #9a6a10; border-color: #f3dca5; }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(36, 30, 24, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fade .18s ease;
}
@media (min-width: 620px) { .modal-backdrop { align-items: center; padding: 24px; } }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: slideup .24s cubic-bezier(.2,.8,.25,1);
}
@media (min-width: 620px) { .modal { border-radius: var(--radius-lg); } }
@keyframes slideup { from { transform: translateY(24px); opacity: 0; } }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.modal__close {
  appearance: none; border: 0; background: var(--paper-deep);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; color: var(--ink); flex: 0 0 auto;
}
.modal__close:hover { background: var(--line); }
.modal__sub { color: var(--ink-soft); font-size: .92rem; margin-top: -4px; }

.member-rows { display: grid; gap: 8px; }
.member-rows .member-row { display: flex; gap: 8px; align-items: center; }
.member-rows .member-row input { margin: 0; }

/* =========================================================================
   Toasts
   ========================================================================= */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(440px, calc(100% - 28px));
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fbf6ee;
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  font-weight: 600;
  animation: toastin .26s cubic-bezier(.2,.8,.25,1);
}
.toast--success { background: #0f9d75; }
.toast--error { background: #cf2c3b; }
.toast svg { flex: 0 0 auto; margin-top: 1px; }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--ink-soft);
  font-size: .85rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; align-items: center; }

/* =========================================================================
   Utilities
   ========================================================================= */
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.grow { flex: 1; }
.stat {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; background: var(--paper-deep);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.stat b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--terracotta-d); }
.stat span { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }

/* =========================================================================
   Help tooltips (in-context self-learning)
   A small "?" affordance next to labels, buttons and stats. Works on hover and
   on keyboard/touch focus, so guidance is reachable without a mouse.
   ========================================================================= */
.help-tip {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0 0 0 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  position: relative;
  vertical-align: middle;
  flex: 0 0 auto;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.help-tip:hover,
.help-tip:focus-visible {
  background: var(--clay);
  color: #fff;
  border-color: var(--clay);
  outline: none;
}
/* Slightly larger, brighter variant for placement on dark/banner surfaces. */
.help-tip--on-dark {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}
.help-tip__bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 9px 12px;
  background: var(--ink);
  color: #fbf6ee;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 90;
}
.help-tip__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.help-tip:hover .help-tip__bubble,
.help-tip:focus .help-tip__bubble,
.help-tip:focus-visible .help-tip__bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
/* Edge-safe variants: anchor the bubble to one side near viewport edges. */
.help-tip__bubble--start { left: 0; transform: translateX(-12px) translateY(4px); }
.help-tip__bubble--start::after { left: 16px; }
.help-tip:hover .help-tip__bubble--start,
.help-tip:focus .help-tip__bubble--start,
.help-tip:focus-visible .help-tip__bubble--start { transform: translateX(-12px) translateY(0); }
.help-tip__bubble--end { left: auto; right: 0; transform: translateX(12px) translateY(4px); }
.help-tip__bubble--end::after { left: auto; right: 16px; }
.help-tip:hover .help-tip__bubble--end,
.help-tip:focus .help-tip__bubble--end,
.help-tip:focus-visible .help-tip__bubble--end { transform: translateX(12px) translateY(0); }

/* A one-line "learn how this works" banner pointing volunteers/charities at the
   full guide, shown above the auth panels. */
.guide-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
  color: var(--ink-soft);
}
.guide-hint svg { color: var(--clay); flex: 0 0 auto; }
.guide-hint a { font-weight: 700; color: var(--terracotta-d); white-space: nowrap; }

/* =========================================================================
   User guide pages
   ========================================================================= */
.guide-hero {
  padding: 40px 0 8px;
}
.guide-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 900px) {
  .guide-layout { grid-template-columns: 240px 1fr; }
}
.guide-toc {
  position: static;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
@media (min-width: 900px) {
  .guide-toc { position: sticky; top: 84px; }
}
.guide-toc h2 {
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-weight: 700;
}
.guide-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; display: grid; gap: 2px; }
.guide-toc li { counter-increment: toc; }
.guide-toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 9px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
}
.guide-toc a::before {
  content: counter(toc);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--terracotta-d);
  min-width: 1.1em;
}
.guide-toc a:hover { background: var(--paper-deep); }

.guide-body { min-width: 0; }
.guide-section { scroll-margin-top: 84px; margin-bottom: 34px; }
.guide-section > h2 {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.guide-section p { color: var(--ink-soft); }
.guide-section p strong { color: var(--ink); }

.steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 16px 18px 16px 58px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), var(--magenta));
  color: #fff;
  font-weight: 800;
  font-size: .92rem;
  box-shadow: var(--shadow-sm);
}
.steps h3 { margin: 0 0 4px; font-size: 1.04rem; }
.steps p { margin: 0; font-size: .92rem; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: .92rem;
}
.callout svg { flex: 0 0 auto; margin-top: 2px; }
.callout p { margin: 0; color: var(--ink); }
.callout strong { display: block; margin-bottom: 2px; }
.callout--tip  { border-left-color: var(--sage);  background: var(--sage-soft); }
.callout--tip svg { color: var(--sage); }
.callout--info { border-left-color: var(--violet); background: #eceaff; }
.callout--info svg { color: var(--violet); }
.callout--warn { border-left-color: var(--gold);  background: var(--gold-soft); }
.callout--warn svg { color: #b07d10; }

.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--terracotta-d); line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0; padding: 0 16px 16px; color: var(--ink-soft); font-size: .92rem; }

.role-cards { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 680px) { .role-cards { grid-template-columns: 1fr 1fr; } }
.role-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .2s ease;
}
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.role-card__mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #fff; box-shadow: var(--shadow-sm); }
.role-card__mark--v { background: linear-gradient(150deg, var(--terracotta), var(--magenta)); }
.role-card__mark--c { background: linear-gradient(150deg, var(--violet), var(--magenta)); }
.role-card h3 { margin: 6px 0 0; }
.role-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.role-card span.role-card__go { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--terracotta-d); }

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

/* =========================================================================
   Help assistant chatbot widget (chat-widget.js)
   A floating launcher + slide-up panel that answers user-guide questions.
   ========================================================================= */
.gw-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--tap);
  padding: 0 18px 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--bg, linear-gradient(122deg, var(--terracotta), var(--magenta)));
  color: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform .15s ease, filter .15s ease;
}
.gw-chat-launcher:hover { transform: translateY(-2px); filter: saturate(1.05); }
.gw-chat-launcher:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.gw-chat-launcher svg { width: 22px; height: 22px; }
.gw-chat-launcher.is-hidden { display: none; }

.gw-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1001;
  width: min(380px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-origin: bottom right;
  animation: gw-chat-in .18s ease;
}
@keyframes gw-chat-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gw-chat-panel[hidden] { display: none; }

.gw-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  color: #fff;
  background: linear-gradient(122deg, var(--terracotta), var(--magenta));
}
.gw-chat-head__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  flex: none;
}
.gw-chat-head__mark svg { width: 20px; height: 20px; }
.gw-chat-head__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.gw-chat-head__sub { font-size: 12px; opacity: .9; }
.gw-chat-head__txt { flex: 1; min-width: 0; }
.gw-chat-close {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff; cursor: pointer;
}
.gw-chat-close:hover { background: rgba(255, 255, 255, .3); }
.gw-chat-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gw-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper);
}
.gw-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.gw-msg--bot {
  align-self: flex-start;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.gw-msg--user {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.gw-msg--error { border-color: var(--rust); color: var(--rust); background: var(--rust-soft); }
.gw-msg strong { font-weight: 800; }
.gw-msg a { color: var(--terracotta-d); }
.gw-msg--user a { color: #ffd9dd; }

.gw-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.gw-suggest button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.gw-suggest button:hover { border-color: var(--terracotta); color: var(--terracotta-d); }

.gw-typing { display: inline-flex; gap: 4px; align-items: center; }
.gw-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-soft);
  animation: gw-bounce 1.1s infinite ease-in-out;
}
.gw-typing span:nth-child(2) { animation-delay: .15s; }
.gw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gw-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.gw-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.gw-chat-form textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
}
.gw-chat-form textarea:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.gw-chat-send {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: none; border-radius: var(--radius-sm);
  background: var(--terracotta);
  color: #fff; cursor: pointer;
  align-self: flex-end;
}
.gw-chat-send:hover { background: var(--terracotta-d); }
.gw-chat-send:disabled { opacity: .5; cursor: not-allowed; }
.gw-chat-send svg { width: 20px; height: 20px; }

@media (max-width: 480px) {
  .gw-chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
  .gw-chat-launcher span.gw-chat-launcher__label { display: none; }
  .gw-chat-launcher { padding: 0; width: var(--tap); justify-content: center; }
}
