/*
   * Gym with Jerald — Navy & Gold theme.
   * A deliberate, single fixed look (not a light/dark toggle): near-black
   * navy surfaces with a metallic-gold accent. Palette validated for
   * categorical distinguishability (gold / good-green / danger-red) against
   * this surface with the dataviz color validator.
   */
  :root {
    --page: #0a0e17;
    --surface: #131a29;
    --surface-raised: #182036;
    --surface-sunken: #0d1220;
    --line: #232b3d;
    --line-soft: #1a2032;
    --ink: #eef1f6;
    --ink-soft: #b9c2d6;
    --muted: #7c869c;

    --gold: #b58c29;
    --gold-bright: #d9b54f;
    --gold-ink: #12141c;
    --gold-soft: rgba(181, 140, 41, 0.16);

    --good: #0f8a6b;
    --good-soft: rgba(15, 138, 107, 0.16);
    --danger: #d9463d;
    --danger-soft: rgba(217, 70, 61, 0.16);

    --radius-s: 8px;
    --radius-m: 14px;
    --radius-l: 20px;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.25);
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--page);
    background-image: radial-gradient(ellipse 900px 500px at 50% -10%, rgba(181, 140, 41, 0.08), transparent);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 {
    font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em;
    text-transform: uppercase; text-wrap: balance; margin: 0;
  }
  .num, .tabular { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  button { font-family: inherit; }
  a { color: var(--gold-bright); }

  .boot { padding: 48px 20px; text-align: center; color: var(--muted); }

  /* ---------- Layout ---------- */
  .shell { display: flex; flex-direction: column; min-height: 100vh; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
    min-width: 0; /* let children (brand/who) shrink below their content width instead of forcing this row wider than the viewport */
  }
  .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
  .brand-mark { width: 30px; height: 30px; flex: none; display: flex; }
  .brand-mark svg { width: 100%; height: 100%; }
  .brand-word { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.01em; white-space: nowrap; }
  .brand-word strong { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
  .brand-word em { font-style: normal; font-weight: 400; text-transform: uppercase; color: var(--ink); letter-spacing: 0.03em; margin-left: 3px; }
  /* "with Jerald" always stays visible (Joe wants the full wordmark on mobile too) — it just
     shrinks along with everything else in .who below, rather than being hidden outright. */
  .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
  /* Truncate rather than let a long name silently overflow the screen edge — the buttons after it stay fully visible either way. */
  .who-name { font-size: 13px; color: var(--ink-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .role-pill {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-bright);
    flex: none; white-space: nowrap;
  }
  .btn-logout {
    border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
    border-radius: var(--radius-s); padding: 7px 12px; font-size: 13px; cursor: pointer;
    flex: none; white-space: nowrap;
  }
  .btn-logout:hover { background: var(--surface-raised); border-color: var(--gold); }
  /* Each Password/Log out button carries both a full and a short label; only one shows at
     a time (toggled below by width) so the button itself never has to grow or shrink text
     mid-word — it just swaps which span is visible. */
  .btn-logout .lbl-short { display: none; }
  /* Portrait phones (roughly 9:16, ~360-430px wide): shrink the brand wordmark and the
     who-name/role-pill/button sizing first, then drop the client/trainer name, then switch
     the two buttons to their short labels — in that order — so "GYM WITH JERALD" and both
     buttons stay fully visible and legible at every width down to ~360px, and nothing ever
     runs off the edge of the screen unreadably. */
  @media (max-width: 480px) {
    .topbar { padding: 10px 12px; gap: 6px; }
    .brand { gap: 6px; }
    .brand-mark { width: 24px; height: 24px; }
    .brand-word { font-size: 13.5px; }
    .who { gap: 5px; }
    .who-name { max-width: 70px; }
    .role-pill { padding: 2px 5px; font-size: 9px; }
    .btn-logout { padding: 6px 7px; font-size: 11.5px; }
  }
  @media (max-width: 400px) {
    .who-name { display: none; }
  }
  @media (max-width: 360px) {
    .btn-logout .lbl-full { display: none; }
    .btn-logout .lbl-short { display: inline; }
  }

  .tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
  .tab {
    border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: 0.03em;
    padding: 12px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
  }
  .tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
  .tab:hover:not(.active) { color: var(--ink-soft); }
  .tab-icon { display: none; }
  .tab-icon svg { display: block; }

  main { flex: 1; padding: 20px; max-width: 1080px; width: 100%; margin: 0 auto; }
  @media (max-width: 600px) { main { padding: 14px; } .topbar { padding: 12px 14px; } }

  /* ---------- Mobile bottom tab bar + floating log button ---------- */
  @media (max-width: 640px) {
    main { padding-bottom: 90px; }
    .tabs-primary {
      position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30;
      border-bottom: none; border-top: 1px solid var(--line); justify-content: space-around; overflow-x: visible;
      padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    }
    .tabs-primary .tab { flex-direction: column; gap: 2px; flex: 1; padding: 6px 2px; font-size: 9.5px; border-bottom: none; letter-spacing: 0; }
    .tabs-primary .tab-icon { display: block; }
  }
  .fab { display: none; }
  @media (max-width: 640px) {
    .fab {
      display: flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: 92px;
      width: 54px; height: 54px; border-radius: 50%; background: var(--gold-bright); color: var(--gold-ink);
      border: none; box-shadow: 0 6px 18px rgba(0,0,0,.45); z-index: 28; cursor: pointer;
      font-family: var(--font-display); font-size: 28px; line-height: 1; font-weight: 600;
    }
    .fab:active { background: var(--gold); }
  }

  /* ---------- Fade-in on navigate ---------- */
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  .section, .login-wrap { animation: fadeUp .22s ease; }

  /* ---------- Loading spinner (in-button) ---------- */
  @keyframes spin { to { transform: rotate(360deg); } }
  .spin { animation: spin .7s linear infinite; display: inline-block; }

  .section { display: flex; flex-direction: column; gap: 16px; }
  .row { display: flex; gap: 16px; flex-wrap: wrap; }
  .row > * { flex: 1 1 260px; }

  /* ---------- Cards & tiles ---------- */
  .card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
    box-shadow: var(--shadow-card); padding: 18px;
  }
  .card-title { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px; }

  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; box-shadow: var(--shadow-card); }
  .stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; line-height: 1.1; color: var(--gold-bright); }
  .stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }

  /* ---------- Roster ---------- */
  .roster-list { display: flex; flex-direction: column; gap: 10px; }
  .roster-row {
    display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line);
    border-left: 3px solid transparent; border-radius: var(--radius-m); padding: 12px 16px; cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
  }
  /* Only the top/right/bottom edges highlight on hover — the left edge stays whatever status color roster-fresh/roster-stale gave it. */
  .roster-row:hover { border-top-color: var(--gold); border-right-color: var(--gold); border-bottom-color: var(--gold); background: var(--surface-raised); }
  .roster-row.roster-fresh { border-left-color: var(--gold); }
  .roster-row.roster-stale { border-left-color: var(--line-soft); }
  .avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--surface-sunken); color: var(--gold-bright);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; flex: none; font-size: 14px;
    border: 1px solid var(--line);
  }
  .roster-name { font-weight: 700; }
  .roster-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
  .roster-stats { display: flex; gap: 18px; margin-left: auto; text-align: right; }
  .roster-stat-num { font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
  .roster-stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
  .chevron { color: var(--muted); flex: none; }
  @media (max-width: 480px) { .roster-stats { display: none; } }

  /* ---------- Badges / pills ---------- */
  .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; }
  .badge-pr { background: var(--gold-soft); color: var(--gold-bright); }
  .badge-good { background: var(--good-soft); color: var(--good); }
  .badge-muted { background: var(--surface-sunken); color: var(--muted); border: 1px solid var(--line); }
  .badge-danger { background: var(--danger-soft); color: var(--danger); }

  /* ---------- Forms ---------- */
  .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
  .field label { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; }
  input, select, textarea {
    font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-s);
    background: var(--surface-sunken); color: var(--ink); width: 100%;
  }
  input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
  textarea { resize: vertical; min-height: 60px; }
  .checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
  .checkbox-row input { width: auto; accent-color: var(--gold); }
  .checkbox-row label { font-size: 13px; color: var(--ink-soft); font-weight: 600; text-transform: none; }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; border-radius: var(--radius-s); padding: 10px 16px; font-weight: 700; font-size: 13.5px;
    text-transform: uppercase; letter-spacing: 0.02em;
    cursor: pointer; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line);
  }
  .btn:hover { border-color: var(--gold); }
  .btn-primary { background: var(--gold-bright); color: var(--gold-ink); border: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
  .btn-primary:hover { background: var(--gold); }
  .btn-primary:active { box-shadow: inset 0 1px 3px rgba(0,0,0,0.25); }
  .btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
  .btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; }
  .btn-block { width: 100%; }
  .btn-sm { padding: 6px 11px; font-size: 12px; }
  .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

  .set-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
  /* On mobile the row drops to a 2-column grid — without this, the exercise field (the row's
     first .field) got squeezed into just one of those two columns, the same width as the weight
     field next to it, cramming/truncating exercise names badly. Spanning it across both columns
     gives it the full row width on its own line, with weight/reps/unit wrapping below it. */
  @media (max-width: 560px) {
    .set-row { grid-template-columns: 1fr 1fr; }
    .set-row > .field:first-child { grid-column: 1 / -1; }
  }
  /* Program builder rows: exercise + target sets + target reps only (no weight — that's recorded live). */
  .set-row.prog-ex-row { grid-template-columns: 64px 2fr 1fr 1fr auto; }
  @media (max-width: 560px) {
    .set-row.prog-ex-row { grid-template-columns: 1fr 1fr; }
    /* Here the exercise field is the row's 2nd child (Label comes first) — same fix, same reason. */
    .set-row.prog-ex-row > .field:nth-child(2) { grid-column: 1 / -1; }
  }

  /* Sets sharing a superset group tag (1A/1B/…) render as one card — exercise + unit picked once
     up top, then a compact row of Set-1/Set-2/Set-3 columns underneath — instead of each set
     being its own full-height block. This is what actually saves the scrolling: all of a given
     exercise's sets sit next to each other instead of being scattered between the other exercise
     in the superset. */
  .set-group { margin-bottom: 14px; }
  .set-group-cols { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .set-col {
    flex: 0 0 auto; min-width: 82px; background: var(--surface-sunken); border: 1px solid var(--line);
    border-radius: var(--radius-s); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  }
  .set-col-label { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
  .set-col-inputs { display: flex; align-items: center; gap: 4px; }
  .set-col-inputs input { width: 42px; padding: 6px 3px; text-align: center; }
  /* Number-input spinner arrows would otherwise eat a big chunk of these already-narrow boxes. */
  .set-col-inputs input[type=number]::-webkit-inner-spin-button,
  .set-col-inputs input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .set-col-inputs input[type=number] { -moz-appearance: textfield; }
  .set-col-x { color: var(--ink-soft); font-size: 12px; }
  .set-col-foot { display: flex; align-items: center; gap: 6px; }
  .set-col-foot .btn { padding: 4px 7px; font-size: 11px; }
  /* The "+" tile at the end of a group's set row — adds another set to that specific exercise,
     the counterpart to each set's own ✕. Styled as a dashed placeholder so it reads as "add
     another" rather than as a fifth set. */
  .set-col.add-set-tile {
    justify-content: center; border-style: dashed; background: transparent; color: var(--ink-soft);
    cursor: pointer; min-height: 74px;
  }
  .set-col.add-set-tile:hover { border-color: var(--gold); color: var(--gold-bright); }
  .set-col-add-plus { font-size: 20px; font-weight: 700; line-height: 1; }

  /* ---------- Login ---------- */
  .login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
  .login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 30px; box-shadow: var(--shadow-card); }
  .login-mark { width: 52px; height: 52px; margin-bottom: 14px; }
  .login-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 22px; margin-bottom: 4px; }
  .login-title .lt-with { font-weight: 400; text-transform: uppercase; color: var(--ink); letter-spacing: 0.03em; margin-left: 6px; }
  .login-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-s); padding: 9px 11px; font-size: 13px; margin-bottom: 14px; text-transform: none; }

  /* ---------- Tables ---------- */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
  tr:last-child td { border-bottom: none; }

  /* ---------- Charts ---------- */
  .chart-box { position: relative; height: 240px; }
  .chart-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 40px 0; }
  .exercise-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .chip {
    border: 1px solid var(--line); background: var(--surface-sunken); color: var(--ink-soft); font-size: 12px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  }
  .chip.active { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

  /* ---------- Consistency heatmap ---------- */
  .heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
  .heat-cell { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-sunken); border: 1px solid var(--line-soft); }
  .heat-cell.on { background: var(--gold); border-color: var(--gold); }
  .heat-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.02em; }

  /* ---------- Exercise library ---------- */
  /* Cards are narrower (was 260px min) and .lib-video is portrait (9/16, was landscape 16/9) —
     the gym's demo videos are filmed vertically on a phone, so a wide 16:9 box let YouTube's
     player letterbox them with dead black bars down both sides. A portrait box lets the video
     fill it edge-to-edge instead, and narrower columns keep the cards themselves proportioned
     for that shape rather than having a tall narrow video floating in an oddly wide card. */
  .lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .lib-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; display: flex; flex-direction: column; }
  .lib-video { position: relative; width: 100%; aspect-ratio: 9/16; background: var(--surface-sunken); }
  .lib-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
  .lib-video-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 12.5px; flex-direction: column; gap: 8px; }
  .lib-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
  .lib-name { font-weight: 700; font-size: 14px; }
  .lib-cat { font-size: 11px; color: var(--gold-bright); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
  .lib-desc { font-size: 12.5px; color: var(--ink-soft); flex: 1; }
  .lib-actions { display: flex; gap: 6px; padding: 0 14px 12px; }
  .lib-link-btn { display: inline-flex; align-items: center; gap: 6px; }
  .lib-search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
  .lib-search-row input { max-width: 240px; }

  /* ---------- Empty state ---------- */
  .empty { text-align: center; padding: 32px 16px; color: var(--muted); }
  .empty svg { display: block; margin: 0 auto 10px; opacity: .7; }
  .empty-title { font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.02em; font-size: 13px; }

  /* ---------- Toast ---------- */
  .toast {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--surface-raised); border: 1px solid var(--gold); color: var(--ink); padding: 10px 16px; border-radius: var(--radius-s);
    font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .18s ease; z-index: 100;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .toast.error { border-color: var(--danger); color: var(--danger); }

  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(6, 8, 13, 0.7); display: flex; align-items: center;
    justify-content: center; padding: 20px; z-index: 50;
  }
  .modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
  .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
  .modal-close:hover { color: var(--gold-bright); }

  /* ---------- Post-workout celebration modal (replaces the old session-logged email) ---------- */
  .celebrate { position: relative; text-align: center; padding-top: 6px; overflow: hidden; }
  .celebrate-burst { position: absolute; top: -8px; left: 0; right: 0; height: 0; overflow: visible; pointer-events: none; }
  .celebrate-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-bright); margin: 0 auto; }
  .confetti-piece {
    position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.95;
    animation-name: confettiFall; animation-timing-function: ease-in; animation-fill-mode: forwards;
  }
  /* A small tumbling dumbbell instead of a plain square — the bar is the span itself (drawn with
     `background: currentColor` so it follows whatever `color` the inline style sets), and the
     two weight plates are round pseudo-elements on either end, also `currentColor` so all three
     pieces of one dumbbell always match. */
  .confetti-piece.confetti-dumbbell {
    top: -12px; width: 16px; height: 4px; border-radius: 2px; background: currentColor;
  }
  .confetti-piece.confetti-dumbbell::before,
  .confetti-piece.confetti-dumbbell::after {
    content: ''; position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; transform: translateY(-50%);
  }
  .confetti-piece.confetti-dumbbell::before { left: -3px; }
  .confetti-piece.confetti-dumbbell::after { right: -3px; }
  @keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    /* Stays fully visible until near the end, then fades fast in the last stretch, so a piece
       reads as a clean drop rather than a slow linear fade-out the whole way down. */
    80% { opacity: 1; }
    100% { transform: translateY(220px) rotate(720deg); opacity: 0; }
  }

  /* Firework-style burst: a small dot that shoots outward from its origin point (per-piece
     --dx/--dy set inline) and falls/fades on the way, like a spark under gravity. */
  .firework-particle {
    position: absolute; width: 5px; height: 5px; border-radius: 50%; opacity: 0;
    animation-name: fireworkPop; animation-timing-function: ease-out; animation-fill-mode: forwards;
  }
  @keyframes fireworkPop {
    0% { transform: translate(0, 0) scale(0.6); opacity: 1; }
    30% { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.35); opacity: 0; }
  }

  .goal-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .goal-item:last-child { border-bottom: none; }
  .goal-desc { flex: 1; font-size: 13.5px; }
  .goal-desc small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.02em; }
  @keyframes goalPulse { 0% { background: var(--gold-soft); } 100% { background: transparent; } }
  .goal-item.celebrate { animation: goalPulse .9s ease; border-radius: var(--radius-s); }

  .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

  [hidden] { display: none !important; }
