/* Glow Academy, Slick Rock Tanning & Spa.
   Palette from the official Slick Rock Style Guide (Essentials for Partners):
   BLACK #000000 · CHARCOAL #686868 · RED #FF0000 · WHITE #FFFFFF · GRAY #C8C8C8
   Typography per the guide: Montserrat for headings (all caps) and body; Brittany for
   script accents (stand-in stack used on the certificate until the font file is added).
   --red-deep is a derived shade of brand red used only where small text needs contrast.
   Gold appears ONLY on badge medallions and the certificate seal (award metallic, not
   palette). Swap or remove via the two --gold tokens if Dara prefers strict palette. */

/* Montserrat, self-hosted (assets/fonts) so no external font CDN is contacted at runtime
   and the strict content policy holds. Latin subset, the four weights the app uses. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/montserrat-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/montserrat-800.woff2") format("woff2"); }

:root {
  --ink: #0B0B0B;
  --charcoal: #686868;
  --paper: #F7F7F7;
  --card: #FFFFFF;
  --red: #FF0000;
  --red-2: #FF4D4D;
  --red-deep: #C40000;
  --red-faint: #FFEAEA;
  --gray: #C8C8C8;
  --line: #E9E9E9;
  --gold: #C98A2D;
  --gold-soft: #E8B45A;
  --ok: #3E7C4F;
  --ok-faint: #E6F0E8;
  --warn: #B3541E;
  --warn-faint: #FBEADF;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
  --radius: 18px;
  --sans: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --script: "Brittany", "Brush Script MT", "Segoe Script", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, #FBE3E3 0%, rgba(251, 227, 227, 0) 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--sans); font-weight: 800; text-transform: uppercase; }
h1 { font-size: 21px; letter-spacing: 0.8px; margin: 0 0 4px; }
h2 { font-size: 15.5px; letter-spacing: 0.8px; margin: 0 0 8px; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--red-deep); }
.muted { color: var(--charcoal); font-size: 13.5px; }
.small { font-size: 12.5px; }
.center { text-align: center; }
.num { font-weight: 800; font-variant-numeric: tabular-nums; }

.app { max-width: 1060px; margin: 0 auto; padding: 0 16px 96px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 2px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  background: linear-gradient(135deg, #000000 0%, #2B2B2B 100%);
  display: grid; place-items: center; color: var(--red);
  box-shadow: var(--shadow);
}
.brand-name { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 1.4px; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--charcoal); letter-spacing: 1px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.persona { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; max-width: 100%; }
.persona label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--charcoal); }
.persona select {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--gray); border-radius: 10px; padding: 6px 10px;
  background: var(--card); cursor: pointer;
}
.icon-btn {
  border: 1px solid var(--gray); background: var(--card); color: var(--charcoal);
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer; font-size: 16px;
  flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--red); color: var(--red-deep); }

/* ---------- Nav ---------- */
.mainnav {
  display: flex; gap: 6px; padding: 6px; margin: 4px 0 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.mainnav a {
  flex: 1; text-align: center; text-decoration: none; color: var(--charcoal);
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 9px 6px; border-radius: 12px;
}
.mainnav a .nav-ico { display: block; font-size: 17px; line-height: 1.2; }
.mainnav a.active { background: #000000; color: #FFFFFF; }
.mainnav a:hover:not(.active) { background: var(--red-faint); color: var(--ink); }

@media (max-width: 700px) {
  .app { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .mainnav {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
    margin: 0; box-shadow: var(--shadow);
  }
  .mainnav a { font-size: 10px; padding: 7px 2px; min-height: 44px; min-width: 0; }
  .brand-sub { display: none; }
  /* The persona picker must shrink on a phone, or its content width forces the whole
     layout viewport wider than the screen (clipping the header and nav). */
  .persona select { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Cards and layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card.flat { box-shadow: none; }
.card.gold { background: linear-gradient(135deg, #000000 0%, #2E2E2E 100%); color: #FFFFFF; border: 0; }
.card.gold .muted { color: var(--gray); }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .brand-name { font-size: 12px; letter-spacing: 1px; } /* keeps the header inside a phone width */
}
@media (max-width: 360px) {
  .brand-name { display: none; } /* smallest phones: logo mark only */
}
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  border-radius: 12px; padding: 12px 18px; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: #000000; color: #FFFFFF; }
.btn.primary:hover { background: #222222; }
/* Legacy class name: .gold is the brand action button, Slick Rock red. */
.btn.gold { background: var(--red); color: #FFF; }
.btn.gold:hover { background: var(--red-2); }
.btn.ghost { background: transparent; border-color: var(--gray); color: var(--ink); }
.btn.ghost:hover { border-color: var(--red); }
.btn.small { font-size: 11.5px; padding: 8px 12px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.block { width: 100%; }

/* ---------- Pills, chips, badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 4px 11px;
  background: var(--red-faint); color: var(--red-deep);
}
.pill.ok { background: var(--ok-faint); color: var(--ok); }
.pill.warn { background: var(--warn-faint); color: var(--warn); }
.pill.ink { background: #000000; color: #FFFFFF; }
.pill.line { background: transparent; border: 1px solid var(--gray); color: var(--charcoal); }
.pill.stage { background: #000000; color: #FFFFFF; letter-spacing: 1.2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- Progress ---------- */
.track { background: #EFEFEF; border-radius: 999px; height: 10px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--red-2)); }
.fill.ok { background: var(--ok); }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--charcoal); margin-bottom: 5px; }

/* ---------- Stat / KPI ---------- */
.kpi { padding: 14px 16px; }
.kpi .kpi-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi .kpi-cap { font-size: 12px; color: var(--charcoal); }
.kpi.alert .kpi-num { color: var(--red-deep); }

/* ---------- Module rows ---------- */
.mod-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; font-family: var(--sans);
}
.mod-row:hover { border-color: var(--red); }
.mod-row.locked { opacity: 0.55; cursor: default; }
.mod-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 18px;
  background: var(--red-faint);
}
.mod-ico.done { background: var(--ok-faint); }
.mod-ico.await { background: var(--warn-faint); }
.mod-main { flex: 1; min-width: 0; }
.mod-title { font-weight: 700; font-size: 14.5px; }
.mod-meta { font-size: 12px; color: var(--charcoal); }
.mod-end { font-size: 18px; color: var(--charcoal); }

/* ---------- Lesson player ---------- */
.lesson-stage { max-width: 640px; margin: 0 auto; }
.lesson-stage h1 { text-transform: none; font-size: 20px; letter-spacing: 0.2px; }
.lesson-body { font-size: 15.5px; }
.lesson-body p { margin: 0 0 12px; }
.lesson-tip {
  background: #F4F4F4; border-left: 3px solid var(--red); border-radius: 0 12px 12px 0;
  padding: 10px 14px; font-size: 14px; margin: 12px 0;
}
.dots { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.dot.on { background: var(--red); }
.dot.done { background: var(--ok); }

/* ---------- Video ---------- */
.video-frame {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #000000; margin: 0 0 6px; aspect-ratio: 16 / 9;
  display: grid; place-items: center;
}
.video-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* contain, never crop: vertical phone clips letterbox cleanly instead of showing a forehead */
.video-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }
.video-frame video[poster] { object-fit: contain; background: #000; }
.video-frame .play {
  position: absolute; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #FFF; font-size: 22px; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(255, 0, 0, 0.4);
}
.video-frame .play:hover { background: var(--red-2); }
.video-cap { font-size: 11.5px; color: var(--charcoal); margin: 0 0 12px; text-align: center; }
/* Embedded YouTube player (third-party SOP videos we cannot rehost). Same frame look as local clips. */
.video-embed {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #000000; margin: 0 0 6px; aspect-ratio: 16 / 9;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Quiz ---------- */
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.timer { font-variant-numeric: tabular-nums; }
.timer.low { background: var(--warn-faint); color: var(--warn); }
.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 12px 14px; margin-bottom: 9px; cursor: pointer; font-size: 14.5px; font-family: var(--sans);
}
.opt:hover { border-color: var(--red-2); }
.opt.sel { border-color: var(--red); background: #FFF7F7; }
.opt .key {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; background: var(--red-faint); color: var(--red-deep);
}
.opt.sel .key { background: var(--red); color: #FFF; }
.integrity {
  display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--charcoal);
  background: #FCFCFC; border: 1px dashed var(--gray); border-radius: 12px; padding: 10px 14px; margin: 12px 0;
}
.score-ring { font-size: 42px; font-weight: 800; }

/* ---------- Onboarding journey ---------- */
.ob-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; font-family: var(--sans); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; cursor: pointer; }
.ob-item:hover { border-color: var(--red-2); }
.ob-item .tick { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; border: 2px solid var(--gray); display: grid; place-items: center; font-size: 13px; color: #FFF; margin-top: 1px; }
.ob-item.on { border-color: var(--ok); background: #FBFFFA; }
.ob-item.on .tick { background: var(--ok); border-color: var(--ok); }
.ob-item.locked { background: var(--paper); border-style: dashed; cursor: not-allowed; }
.ob-item.locked .tick { border-color: var(--gray); background: transparent; font-size: 11px; }
.ob-item.locked .ob-title { color: var(--charcoal); }
.ob-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-title { font-weight: 700; font-size: 14px; }
.ob-note { font-size: 12px; color: var(--charcoal); }
.ob-link { font-size: 12px; font-weight: 700; color: var(--red-deep); text-decoration: none; margin-top: 2px; }
.ob-soon { font-size: 12px; font-style: italic; color: var(--charcoal); margin-top: 2px; }
.ob-auto { font-size: 11px; color: var(--charcoal); margin-top: 2px; }
.ob-item.auto .tick { border-style: dashed; }
.shelf-head { margin: 16px 0 8px; }
.shelf-head b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--red-deep); }
details.phase { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--paper); overflow: hidden; }
details.phase > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 14px; }
details.phase > summary::-webkit-details-marker { display: none; }
details.phase > summary::before { content: "\25B8"; opacity: 0.5; }
details.phase[open] > summary::before { content: "\25BE"; }
.phase-title { flex: 1; }
.phase-meta { font-size: 12px; font-weight: 600; color: var(--charcoal); }
.phase-track { margin: 0 14px 4px; }
.phase-mods { padding: 2px 8px 8px; }
.ob-detbox { margin: -4px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.ob-detbox summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; color: var(--red-deep); padding: 9px 13px; }
.ob-detbox summary::-webkit-details-marker { display: none; }
.ob-detbox summary::before { content: "\25B8  "; }
.ob-detbox[open] summary::before { content: "\25BE  "; }
.ob-det { padding: 0 14px 12px; }
.obd-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--charcoal); opacity: 0.65; margin: 8px 0 3px; }
.obd-sum { font-size: 13px; margin: 0 0 4px; color: var(--charcoal); }
.obd-list { margin: 0; padding-left: 18px; }
.obd-list li { font-size: 13px; margin: 3px 0; color: var(--charcoal); }
.obd-gloss .gl { font-size: 12.5px; margin: 3px 0; color: var(--charcoal); }
.obd-gloss .gl b { color: var(--red-deep); }
.handbook { line-height: 1.6; }
.handbook h2 { font-size: 18px; margin: 22px 0 6px; color: var(--red-deep); }
.handbook h3 { font-size: 16px; margin: 16px 0 5px; }
.handbook h4 { font-size: 14px; margin: 14px 0 4px; }
.handbook p { font-size: 13.5px; margin: 6px 0; color: var(--charcoal); }
.handbook ul { margin: 6px 0; padding-left: 20px; }
.handbook li { font-size: 13.5px; margin: 3px 0; color: var(--charcoal); }
.lesson-img { margin: 10px 0; }
.lesson-img img { width: 100%; max-width: 440px; border-radius: 10px; display: block; border: 1px solid var(--line); }
.lesson-img figcaption { font-size: 12px; color: var(--charcoal); margin-top: 4px; }
.cohort-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cohort-row:last-of-type { border-bottom: 0; }
.cohort-row.me { background: var(--red-faint); border-radius: 10px; padding: 8px; border-bottom: 0; }
.cohort-rank { width: 16px; text-align: center; font-weight: 800; font-size: 13px; color: var(--charcoal); flex: 0 0 auto; }
.cohort-main { flex: 1; min-width: 0; }
.cohort-name { font-weight: 700; font-size: 13.5px; }
.cohort-pct { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.hire-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-top: 10px; }
.hire-card:first-of-type { margin-top: 6px; }

/* ---------- Game rounds (match, order, sort) ---------- */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gbtn {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font-family: var(--sans);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 9px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink);
  transition: transform 0.05s ease, border-color 0.1s ease;
}
.gbtn:hover:not(:disabled) { border-color: var(--red-2); }
.gbtn.sel { border-color: var(--red); background: #FFF7F7; box-shadow: 0 0 0 3px var(--red-faint); }
.gbtn.locked { border-color: var(--ok); background: var(--ok-faint); color: var(--ok); cursor: default; opacity: 0.9; }
.gbtn.placed { cursor: default; border-color: var(--ok); background: var(--ok-faint); }
.gbtn.placed .key { background: var(--ok); }
.gbtn .key {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; font-size: 12px; font-weight: 800;
  display: grid; place-items: center; background: var(--red); color: #FFF;
}
.gbtn.shake { animation: shake 0.34s ease; border-color: var(--warn); background: var(--warn-faint); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}
.order-placed { min-height: 40px; border: 1px dashed var(--gray); border-radius: 12px; padding: 6px; background: #FCFCFC; }
.sort-card {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 22px 16px; text-align: center;
  font-size: 17px; font-weight: 700; background: linear-gradient(135deg, #FFFFFF, #FAFAFA); min-height: 84px;
  display: grid; place-items: center;
}

/* ---------- Badges (gold medallions by design, see header note) ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.badge-tile {
  text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.badge-tile .b-ico {
  width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 21px;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: #FFF;
}
.badge-tile.off { opacity: 0.45; }
.badge-tile.off .b-ico { background: #E2E2E2; color: #A9A9A9; }
.badge-tile .b-name { font-size: 11.5px; font-weight: 700; line-height: 1.25; }
.badge-tile .b-when { font-size: 10px; color: var(--charcoal); }

/* ---------- Tier ladder ---------- */
.tier { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tier:not(:last-child):before {
  content: ""; position: absolute; left: 17px; top: 38px; bottom: -2px; width: 2px; background: var(--line);
}
.tier-dot {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; z-index: 1;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
  background: #EFEFEF; color: var(--charcoal); border: 2px solid var(--gray);
}
.tier.now .tier-dot { background: var(--red); color: #FFF; border-color: var(--red); }
.tier.done .tier-dot { background: var(--ok); color: #FFF; border-color: var(--ok); }
.tier-name { font-weight: 700; }
.tier.now .tier-name { color: var(--red-deep); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--charcoal); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #F1F1F1; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Charts ---------- */
.bar-row { display: grid; grid-template-columns: 140px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-row .lbl { color: var(--charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
/* ---------- People: add-member form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--charcoal); }
.form-grid input, .form-grid select { font-family: var(--sans); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.form-grid input:focus-visible, .form-grid select:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
/* a11y: a single visible keyboard-focus ring for every interactive element (mouse clicks stay ring-free via :focus-visible) */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* a11y: honor the OS "reduce motion" setting (confetti is also skipped in JS) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Reporting: scorecards + attention ---------- */
.scorecard { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gray); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.scorecard.track { border-left-color: var(--ok); }
.scorecard.watch { border-left-color: var(--warn); }
.scorecard.need { border-left-color: var(--red); }
.sc-main { min-width: 0; }
.sc-action { color: var(--charcoal); margin-top: 7px; }
.pill.alert { background: var(--red-faint); color: var(--red-deep); }
.attn-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.attn-row:last-child { border-bottom: 0; }
.attn-ico { font-size: 16px; flex: 0 0 auto; }

.cup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; text-align: center; }
.cup .cup-num { font-size: 28px; font-weight: 800; }
.cup .vs { font-size: 11px; color: var(--charcoal); font-weight: 800; }

/* ---------- Leaderboard ---------- */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #F1F1F1; }
.lb-row:last-child { border-bottom: 0; }
.lb-row.me { background: var(--red-faint); border-radius: 12px; padding: 10px; }
.lb-rank { width: 30px; text-align: center; font-weight: 800; color: var(--charcoal); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #FFF;
  background: linear-gradient(135deg, #000000, var(--red));
}
.lb-name { flex: 1; min-width: 0; }
.lb-last { cursor: help; opacity: 1; }
.win-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #F1F1F1; font-size: 14px; }
.win-row:last-child { border-bottom: 0; }
.win-ico { font-size: 18px; flex: none; }
.lb-pts { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Check-off ---------- */
.rubric-step {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font-family: var(--sans);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 8px; cursor: pointer; font-size: 14px;
}
.rubric-step .tick {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; border: 2px solid var(--gray);
  display: grid; place-items: center; font-size: 13px; color: #FFF;
}
.rubric-step.on { border-color: var(--ok); background: #FBFFFA; }
.rubric-step.on .tick { background: var(--ok); border-color: var(--ok); }

/* ---------- Certificate ---------- */
.cert-sheet {
  background: #FFFFFF; border: 2px solid #000000; border-radius: 8px; padding: 8px; max-width: 720px; margin: 0 auto 14px;
}
.cert-inner { border: 1px solid var(--red); border-radius: 4px; padding: 36px 28px; text-align: center; }
.cert-brand { font-size: 10.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--red-deep); font-weight: 700; }
.cert-title { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; margin: 8px 0 2px; }
.cert-name { font-family: var(--script); font-size: 44px; color: #000000; margin: 10px 0 4px; }
.cert-line { width: 240px; border-top: 1px solid var(--charcoal); margin: 36px auto 6px; }
.cert-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--charcoal); margin-top: 8px; padding: 0 12px; }

@media print {
  body * { visibility: hidden; }
  .cert-sheet, .cert-sheet * { visibility: visible; }
  .cert-sheet { position: fixed; inset: 0; margin: 0; border-radius: 0; }
}

/* ---------- Modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.55); padding: 18px;
}
.modal {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  max-width: 480px; width: 100%; max-height: 86vh; overflow: auto; box-shadow: var(--shadow);
}

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 70; pointer-events: none; }
.toast {
  background: #000000; color: #FFFFFF; border-radius: 999px; padding: 11px 20px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti-piece { position: fixed; top: -14px; width: 9px; height: 14px; border-radius: 2px; z-index: 1300; pointer-events: none; opacity: 0.95; will-change: transform; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(900deg); } }
.ach-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--red-deep); }
.ach-badge { font-size: 76px; line-height: 1; margin: 10px 0 2px; display: inline-block; animation: badge-pop 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28) both; }
@keyframes badge-pop { 0% { transform: scale(0) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.18) rotate(8deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.ach-name { font-size: 22px; font-weight: 800; margin: 2px 0; }
.ach-how { color: var(--charcoal); font-size: 13px; }
.ach-more { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 2px; }
.badge-tile.got { cursor: pointer; }
.badge-share { font-size: 11px; color: var(--red-deep); font-weight: 700; margin-top: 3px; }

/* ---------- Misc ---------- */
.hero-points { display: flex; gap: 22px; margin-top: 10px; }
.hero-points .hp-num { font-size: 24px; font-weight: 800; color: #FFFFFF; }
.hero-points .hp-cap { font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--gray); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; gap: 10px; }
.empty { text-align: center; color: var(--charcoal); padding: 26px 10px; }
.footer-note { text-align: center; font-size: 11.5px; color: #6E6E6E; margin-top: 26px; }
.demo-flag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
  background: #EDEDED; color: #7A7A7A; border-radius: 6px; padding: 2px 7px; text-transform: uppercase;
}

/* Login and account forms (Supabase auth). */
.login-lbl { display: block; margin-top: 12px; font-weight: 600; font-size: 13px; color: var(--ink); }
.login-in {
  width: 100%; box-sizing: border-box; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: #FFF;
}
.login-in:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }

/* Search match highlight. */
.hl { background: var(--red-faint); color: var(--red-deep); border-radius: 3px; padding: 0 2px; }
