/**
 * styles.css — the visual half of the design system. ui.js is the other half: every class
 * below is produced by a function there, and a page script never invents one.
 *
 *   COMPONENT          CLASS                       BUILT BY (ui.js)
 *   page frame         .wrap .hero .summary        the HTML itself — see the note in ui.js
 *   nav                .sitenav                    buildNav()          (store.js)
 *   stat row           .stats .stat .num .lbl      UI.summary()
 *   progress bar       .bar                        UI.summary()
 *   filter chips       .controls .chip-label       UI.summary()
 *   section heading    .day-head                   UI.sectionHead()
 *   card grid          .grid / .grid.wide / .egrid UI.grid()
 *   Pokemon card       .card .card.mon .super      UI.monCard()
 *   empty state        .empty                      UI.empty()
 *   source links       .srcs                       UI.sources()
 *   attention pulse    .flash                      UI.flash()
 *   reminders panel    .remindbox .rb-*            Remind.panel()      (remind.js)
 *   ntfy setup steps   .rb-steps .rb-sub           Remind.setup()      (remind.js)
 *   reminder list      .rlist .rrow .rstate        render()            (notifications.js)
 *   nav nudge           .nudge                      buildNav()          (store.js)
 *   promo code card     .pcard .pcode .pcode-text   promo-codes.js
 *
 * A page owns its domain-specific components and builds them from the primitives above —
 * the events page's .ecard/.erow/.ecaveat in events.js, and .remindbox/.rb-* in remind.js,
 * which owns the whole reminders feature because two pages render it.
 *
 * THE PILL FAMILY. Small labels share geometry but not size, on purpose — a raid pill has to
 * fit "LEGENDARY MEGA" on one line in a narrow card, so it runs smaller than a type badge:
 *
 *   .type      10px   species typing            .rank      18px box  combat-power grade
 *   .raid      9.5px  battle class + stars      .energy    11px      Mega Energy cost
 *   .tag-new / .tag-attack / .tag-weather / .tag-role      10px      card badges
 *   .etype / .gtag / .ctag                                 events page labels
 *
 * Add a component here only together with the function in ui.js that renders it.
 */

:root {
  /* colour */
  --bg: #0f1219;
  --surface: #171b25;
  --surface-2: #1e2331;
  --border: #2a3040;
  --border-bright: #3a4256;
  --text: #e8ecf4;
  --muted: #8b93a7;
  --accent: #5b8cff;
  --done: #34d399;
  --e100: #34d399;
  --e200: #fbbf24;
  --e300: #f472b6;
  --super: #a78bfa;

  /* spacing — the steps the layout actually uses, not a full scale for its own sake */
  --sp-1: 4px;
  --sp-2: 6px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 14px;
  --sp-6: 18px;
  --sp-7: 26px;
  --sp-8: 40px;

  /* radius */
  --r-xs: 4px;
  --r-sm: 5px;
  --r-md: 6px;
  --r-lg: 8px;
  --radius: 14px;
  --r-pill: 99px;

  /* the recurring text sizes, by role */
  --fs-pill: 10px;
  --fs-meta: 11px;
  --fs-sub: 12px;
  --fs-ui: 13px;
  --fs-name: 14px;

  --tag-pad: 2px 6px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* The UA's rule for [hidden] is `display: none` at the lowest possible specificity, so ANY
   class that sets display — `.remindbox { display: flex }` — silently beats it and the
   element stays on screen. Toggling `el.hidden` is the readable way to show and hide a
   panel; this is what makes it actually work. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------- header ---------- */

header.hero {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.eyebrow {
  font-size: var(--fs-sub); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 10px;
}
h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 62ch; }
.bonuses { display: flex; flex-wrap: wrap; gap: var(--sp-3); list-style: none; padding: 0; margin: 0; }
.bonuses li {
  font-size: var(--fs-ui); color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: var(--r-pill);
}

/* ---------- summary bar ---------- */

.summary {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,18,25,.86);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 28px;
}
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: flex-end; }
.stat { min-width: 96px; }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 15px; font-weight: 500; color: var(--muted); }
.stat .lbl { font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-top: 2px; }
.stat.hl .num { color: var(--accent); }
.stat.ok .num { color: var(--done); }

.bar { height: 6px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--done)); width: 0; transition: width .3s ease; }

.controls { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 14px; }
.controls button {
  font: inherit; font-size: var(--fs-ui);
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 6px 13px; cursor: pointer; transition: .15s;
}
.controls button:hover { color: var(--text); border-color: var(--accent); }
.controls button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b1020; font-weight: 600; }
.controls .spacer { flex: 1; }
.controls .danger:hover { border-color: #f87171; color: #f87171; }

/* ---------- day / habitat ---------- */

.day-head {
  display: flex; align-items: baseline; gap: var(--sp-4); flex-wrap: wrap;
  margin: 40px 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.day-head h2 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.day-head .date { color: var(--muted); font-size: var(--fs-name); }
.day-head .count { margin-left: auto; font-size: var(--fs-ui); color: var(--muted); font-variant-numeric: tabular-nums; }

.habitat { margin-top: 26px; }
.habitat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.habitat-head h3 { font-size: 15px; margin: 0; font-weight: 600; }
.times { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.time {
  font-size: var(--fs-sub); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); padding: 3px 9px; border-radius: var(--r-md);
}
.time.live { background: rgba(52,211,153,.14); border-color: var(--done); color: var(--done); font-weight: 600; }
/* A window that has been and gone. Every window is past once the event ends, which is what
   makes a finished tracker read as finished rather than as one that stopped updating.
   De-emphasised by LOSING ITS PLATE, not by opacity: at .45 this measured 2.03:1 and the
   time was unreadable. Struck through and unfilled it still clears 6:1 and reads as past. */
.time.past {
  background: transparent; border-color: var(--border);
  text-decoration: line-through; text-decoration-color: var(--border-bright);
}
/* An upcoming window is a button: tapping it arms a reminder. Same green "set" and amber
   dashed "armed" language as the Remind me buttons on the events page. */
button.time { font: inherit; font-size: var(--fs-sub); cursor: pointer; transition: .15s; }
button.time:hover { border-color: var(--accent); color: var(--text); }
button.time[disabled] { opacity: .5; cursor: default; }
button.time.on { color: var(--done); border-color: var(--done); font-weight: 600; }
button.time.on.armed { color: var(--e200); border-color: var(--e200); border-style: dashed; }
.live-tag {
  font-size: var(--fs-meta); font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--done); display: inline-flex; align-items: center; gap: 5px;
}
.live-tag::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--done);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- cards ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: var(--sp-4); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; gap: var(--sp-4); align-items: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.caught { background: var(--surface-2); border-color: rgba(52,211,153,.4); }
.card.caught .name, .card.caught .meta { opacity: .5; }
.card.caught .name { text-decoration: line-through; }

.card img {
  width: 62px; height: 62px; flex: 0 0 62px;
  object-fit: contain; image-rendering: auto;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5));
}
.card .body { min-width: 0; flex: 1; }
.name { font-size: var(--fs-name); font-weight: 600; line-height: 1.3; margin-bottom: 6px; padding-right: 20px; }
.meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

.energy {
  font-size: var(--fs-meta); font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: var(--r-sm);
}
.energy[data-e="100"] { background: rgba(52,211,153,.16); color: var(--e100); }
.energy[data-e="200"] { background: rgba(251,191,36,.16); color: var(--e200); }
.energy[data-e="300"] { background: rgba(244,114,182,.16); color: var(--e300); }
.energy[data-e="?"]   { background: rgba(167,139,250,.16); color: var(--super); }

.tag-new {
  font-size: var(--fs-pill); font-weight: 700; letter-spacing: .05em;
  color: var(--super); border: 1px solid rgba(167,139,250,.45);
  padding: 1px 5px; border-radius: var(--r-xs);
}

.check {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: transparent;
  display: grid; place-items: center; pointer-events: none;
  transition: .15s;
}
.card.caught .check,
.super.caught .check { background: var(--done); border-color: var(--done); }
.check svg { width: 12px; height: 12px; stroke: #0b1020; stroke-width: 3.5; fill: none; opacity: 0; }
.card.caught .check svg,
.super.caught .check svg { opacity: 1; }

/* ---------- super raid ---------- */

.super {
  background: linear-gradient(135deg, rgba(167,139,250,.11), rgba(91,140,255,.06));
  border: 1px solid rgba(167,139,250,.36);
  border-radius: var(--radius);
  padding: 16px; margin-top: 22px;
  display: flex; gap: 16px; align-items: center; cursor: pointer;
  position: relative; transition: border-color .15s, transform .12s;
}
.super:hover { border-color: var(--super); transform: translateY(-1px); }
.super.caught { border-color: rgba(52,211,153,.4); }
.super.caught .tier,
.super.caught .name,
.super.caught .meta,
.super.caught .note { opacity: .5; }
.super.caught img { opacity: .45; }
.super.caught .name { text-decoration: line-through; }
.super img { width: 84px; height: 84px; flex: 0 0 84px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(167,139,250,.35)); }
.super .tier { font-size: var(--fs-meta); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--super); margin-bottom: 4px; }
.super .name { font-size: 18px; padding-right: 26px; }
.note { font-size: var(--fs-sub); color: var(--muted); margin-top: 5px; }

.empty { color: var(--muted); font-size: var(--fs-name); padding: 18px 0; }

footer {
  margin-top: 56px; padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; line-height: 1.7;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .srcs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .card { flex-direction: column; text-align: center; padding: 12px 10px; }
  .card .meta { justify-content: center; }
  .stat { min-width: 76px; }
  .stat .num { font-size: 21px; }
}

/* ---------- site nav ---------- */

.sitenav {
  display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: relative; z-index: 30;
}
.sitenav .brand {
  font-weight: 800; letter-spacing: -.02em; margin-right: 12px;
  color: var(--accent); font-size: 15px;
}
.sitenav a {
  color: var(--muted); text-decoration: none; font-size: var(--fs-name);
  padding: 6px 12px; border-radius: var(--r-lg); transition: .15s;
}
.sitenav a:hover { color: var(--text); background: var(--surface-2); }
.sitenav a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }

/* The Promo Codes nav link's "you haven't seen this one yet" dot — see Promos.unseenCount()
   in web/promos.js. A count, not a bare dot, because "something changed" is less useful than
   "how many" when the answer might be four. */
.nudge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 6px;
  border-radius: var(--r-pill); background: var(--e200); color: #0b1020;
  font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px;
}

/* ---------- search + chip rows ---------- */

.search {
  font: inherit; font-size: var(--fs-name);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 7px 12px; min-width: 220px; flex: 1;
}
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent); }
.chip-label {
  font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); align-self: center; margin-right: 4px; min-width: 42px;
}

/* ---------- collection cards ---------- */

.grid.wide { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card.mon { align-items: flex-start; }
.card.mon img { width: 68px; height: 68px; flex: 0 0 68px; }
.form { font-size: 11.5px; color: var(--muted); margin: -3px 0 5px; }

.types { display: flex; gap: var(--sp-1); flex-wrap: wrap; margin-bottom: 5px; }
.type {
  font-size: var(--fs-pill); font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 6px; border-radius: var(--r-xs); color: #0b1020;
}
.type[data-t="normal"]{background:#9fa19f} .type[data-t="fire"]{background:#e8756c}
.type[data-t="water"]{background:#6f9fe8} .type[data-t="electric"]{background:#e8ce4e}
.type[data-t="grass"]{background:#77c465} .type[data-t="ice"]{background:#7ed4d4}
.type[data-t="fighting"]{background:#d4685f} .type[data-t="poison"]{background:#b06fc4}
.type[data-t="ground"]{background:#d8b558} .type[data-t="flying"]{background:#9ab3e8}
.type[data-t="psychic"]{background:#f07f9e} .type[data-t="bug"]{background:#a9c04a}
.type[data-t="rock"]{background:#c5b782} .type[data-t="ghost"]{background:#9c8fc4}
.type[data-t="dragon"]{background:#8b7ee0} .type[data-t="dark"]{background:#9a857a}
.type[data-t="steel"]{background:#b3b3c4} .type[data-t="fairy"]{background:#eaa2c8}

.tag-attack, .tag-weather, .tag-role {
  font-size: var(--fs-pill); font-weight: 700; letter-spacing: .03em;
  padding: 2px 6px; border-radius: var(--r-xs);
}
.tag-attack { color: var(--e300); border: 1px solid rgba(244,114,182,.45); }
.tag-weather { color: #7dd3fc; border: 1px solid rgba(125,211,252,.45); }
.tag-role { color: #7dd3fc; border: 1px solid rgba(125,211,252,.45); }

/* Raid class pill. Colour tracks the star rating, so the ladder is readable at a glance. */
.raid {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 6px; border-radius: var(--r-xs); margin-bottom: 6px;
  border: 1px solid currentColor;
  /* One line: wrapped to "LEGENDARY / MEGA RAID" the pill reads as two separate badges. */
  white-space: nowrap; max-width: 100%; overflow: hidden;
}
.raid .stars { letter-spacing: -1.5px; font-size: 8.5px; }
.raid[data-stars="4"] { color: #9ab3e8; }
.raid[data-stars="5"] { color: #fbbf24; }
.raid[data-stars="6"] { color: var(--super); }
.card.caught .raid { opacity: .45; }

/* Combat power, S down to D. Every grade is a FILLED chip: the earlier build left B, C and D
   translucent or hollow, and on a collected card — which also dims the whole body — they went
   from low-contrast to unreadable. The rank is a fact about the species, not about your
   progress, so it barely dims at all when a card is ticked. */
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: var(--r-sm);
  font-size: var(--fs-meta); font-weight: 800; line-height: 1;
  vertical-align: 1px;
  /* inline-flex also stops .card.caught's line-through from striking the letter. */
  text-decoration: none;
}
.rank[data-rank="S"] { background: #fbbf24; color: #0b1020; }
.rank[data-rank="A"] { background: #34d399; color: #0b1020; }
.rank[data-rank="B"] { background: #5b8cff; color: #0b1020; }
.rank[data-rank="C"] { background: #8b93a7; color: #0b1020; }
.rank[data-rank="D"] { background: #333b4d; color: #c3cad9; }
.rank[data-rank="?"] { background: transparent; color: var(--muted); border: 1px dashed var(--border-bright); }
.card.caught .rank { opacity: .85; }

/* The number behind the letter, and the moveset it assumes. */
.power {
  font-size: var(--fs-meta); color: var(--muted); line-height: 1.4;
  margin-bottom: 5px; display: flex; align-items: baseline; gap: var(--sp-1); flex-wrap: wrap;
}
.power b { color: var(--text); font-size: var(--fs-sub); font-variant-numeric: tabular-nums; }
.power .mv { color: var(--muted); opacity: .85; }
.power .mv::before { content: '· '; }
.power .lg { color: var(--e200); cursor: help; }
.card.caught .power { opacity: .45; }

.card.mon .meta { margin-top: 2px; }
.card.mon .note { font-size: var(--fs-meta); color: var(--muted); margin-top: 5px; }
.card.caught .types, .card.caught .form, .card.caught .note { opacity: .45; }

@media (max-width: 560px) {
  .card.mon { flex-direction: row; text-align: left; }
  .card.mon .meta, .card.mon .types { justify-content: flex-start; }
  .chip-label { min-width: auto; }
  .grid.wide { grid-template-columns: 1fr; }
}

/* ---------- sign-in ---------- */

.sitenav .spacer { flex: 1; }

.authbox { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-ui); }
.authbox .authnote { color: var(--muted); font-size: var(--fs-sub); }
.authbox .avatar { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-bright); }
.authbox .who { color: var(--text); font-weight: 600; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authbox .linkbtn {
  font: inherit; font-size: var(--fs-sub); background: none; color: var(--muted);
  border: 0; padding: 4px 6px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.authbox .linkbtn:hover { color: var(--text); }

.signin {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font: inherit; font-size: var(--fs-ui); font-weight: 600;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-bright); border-radius: var(--r-lg);
  padding: 6px 13px; cursor: pointer; transition: .15s;
}
.signin:hover { border-color: var(--accent); }
.signin .g { width: 15px; height: 15px; flex: 0 0 15px; }
.signin.big { font-size: var(--fs-name); padding: 10px 18px; }
.signin.big .g { width: 17px; height: 17px; flex: 0 0 17px; }

/* Gate banner — sits above the sticky summary bar on every tracker page. */
.authgate {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.authgate .gate-body { flex: 1; min-width: 260px; }
.authgate strong { display: block; font-size: 15px; margin-bottom: 4px; }
.authgate p { margin: 0; color: var(--muted); font-size: var(--fs-ui); max-width: 68ch; }
.authgate.bad { border-color: #f87171; }
.authgate.bad strong { color: #f87171; }

/* UI.flash() — "the answer to what you just clicked is here". The sign-in gate when a locked
   card is ticked, the reminders panel when a signed-out Remind me is pressed. Generic
   because it is an interaction, not an auth thing. */
@keyframes flash {
  0%, 100% { border-color: var(--border-bright); }
  30%      { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91,140,255,.18); }
}
.flash { animation: flash .9s ease 2; }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }

/* Signed out the lists still read fine, but nothing looks tickable. */
body.signed-out .card,
body.signed-out .super { cursor: default; }
body.signed-out .card:hover,
body.signed-out .super:hover { border-color: var(--border); transform: none; }
body.signed-out .check { opacity: .25; }
body.signed-out #reset { opacity: .4; }

/* While the SDK loads the gate is present but muted — never hidden. A hidden gate means a
   rendered, inert, unexplained tracker for as long as the download takes. */
.authgate.checking { border-color: var(--border); }
.authgate.checking strong { color: var(--muted); font-weight: 600; }

/* ---------- sticky summary on phones ---------- */
/* The full panel is stats + progress bar + up to three filter rows — around 300px, close to
   half a phone viewport, and it is pinned there the whole way down a 160-card list. So past
   the top of the page it collapses to a one-line strip. Tapping the strip, or focusing
   anything inside it (keyboard and screen-reader users never get a tap), brings it back;
   scrolling to the top restores it too. Desktop is untouched — there is room there. */
@media (max-width: 560px) {
  .summary { padding: 12px 14px; margin-bottom: 20px; }
  .summary .stats { gap: 8px 18px; }
  .summary .controls { margin-top: 10px; }

  body.scrolled .summary:not(.open):not(:focus-within) {
    padding: 7px 12px 8px; padding-right: 78px; cursor: pointer;
    /* Nearly opaque: at 50px tall, card titles reading through the blur look like a glitch. */
    background: rgba(15,18,25,.97);
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
  }
  /* Stat blocks go inline, and the third one drops — two numbers is what you glance at. */
  body.scrolled .summary:not(.open):not(:focus-within) .stat {
    min-width: 0; display: flex; align-items: baseline; gap: 5px;
  }
  body.scrolled .summary:not(.open):not(:focus-within) .stat .num { font-size: 15px; }
  body.scrolled .summary:not(.open):not(:focus-within) .stat .num small { font-size: var(--fs-meta); }
  body.scrolled .summary:not(.open):not(:focus-within) .stat .lbl { margin-top: 0; font-size: 9.5px; }
  body.scrolled .summary:not(.open):not(:focus-within) .stat:nth-child(3) { display: none; }
  body.scrolled .summary:not(.open):not(:focus-within) .bar { height: 3px; margin-top: 7px; }
  body.scrolled .summary:not(.open):not(:focus-within) .controls { display: none; }
  /* Without this the strip looks like a header rather than something you can open. */
  body.scrolled .summary:not(.open):not(:focus-within)::after {
    content: 'Filters ▾';
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: var(--fs-pill); font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
  }
}

/* ---------- events page ---------- */

/* Season and GO Pass run for months. They belong on the page but not in the same list as a
   three-hour Community Day, so they sit in the header as a strip. */
.bgstrip { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 16px; }
.bgchip {
  display: inline-flex; align-items: baseline; gap: var(--sp-3); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 6px 14px; font-size: 12.5px; color: var(--muted);
}
.bgchip:hover { border-color: var(--accent); }
.bgchip.soon { opacity: .72; border-style: dashed; }
.bgchip strong { color: var(--text); font-weight: 600; }

.etype {
  font-size: var(--fs-pill); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap;
  border: 1px solid currentColor;
}
.etype[data-k="fest"]    { color: var(--super); }
.etype[data-k="cday"]    { color: var(--done); }
.etype[data-k="raidday"] { color: var(--e300); }
.etype[data-k="max"]     { color: #7dd3fc; }
.etype[data-k="hour"]    { color: var(--e200); }
.etype[data-k="raid"]    { color: #9ab3e8; }
.etype[data-k="gbl"]     { color: var(--muted); }
.etype[data-k="bg"]      { color: var(--muted); }
.etype[data-k="event"]   { color: var(--accent); }

/* A UTC-published time lands at a different clock time depending on where you are, and that
   catches people out — so it is called out rather than silently converted. */
.gtag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--border-bright);
  border-radius: var(--r-xs); padding: 1px 5px; margin-left: 8px; cursor: help;
}

/* Happening now */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-4); }
.ecard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.ecard.live { border-left: 3px solid var(--done); }
.ehead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.eleft { margin-left: auto; font-size: var(--fs-sub); color: var(--muted); font-variant-numeric: tabular-nums; }
.eleft.urgent { color: var(--e200); font-weight: 700; }
.ecard h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.ewhen { margin: 0; font-size: var(--fs-ui); color: var(--text); font-variant-numeric: tabular-nums; }
.edetail { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.elinks { display: flex; gap: var(--sp-3); margin-top: 10px; flex-wrap: wrap; }
.elink {
  font-size: var(--fs-sub); text-decoration: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 10px;
}
.elink:hover { color: var(--text); border-color: var(--accent); }
.elink.track { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* Upcoming rows */
.dayrow {
  font-size: var(--fs-sub); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 8px;
}
.erows { display: flex; flex-direction: column; gap: var(--sp-2); }
.erow {
  display: flex; align-items: flex-start; gap: var(--sp-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.erow:hover { border-color: var(--border-bright); }
.etime {
  flex: 0 0 auto; min-width: 58px; font-size: var(--fs-ui); font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--text); padding-top: 1px;
}
.ebody { flex: 1; min-width: 0; }
.eline { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.ename { font-size: var(--fs-name); }
.esub { font-size: var(--fs-sub); color: var(--muted); margin-top: 3px; }
.erow .elinks { margin-top: 0; flex: 0 0 auto; }

/* Archive page — a page-owned row, same recipe as .erow but its own classes since it is
   archive.js's domain, not events.js's (see the design-system skill). */
.arows { display: flex; flex-direction: column; gap: var(--sp-2); }
.arow {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.arow:hover { border-color: var(--border-bright); }
.aname { font-size: var(--fs-name); }
.asub { font-size: var(--fs-sub); color: var(--muted); margin-top: 3px; }

/* Weekly rhythm */
.rhythmbox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 28px;
}
.rhythmbox h2 { margin: 0 0 4px; font-size: 15px; }
.rhythmbox p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.rhythm { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.rh { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-ui); color: var(--muted); }

/* Which of the two lists you are looking at — live feed or the copy shipped with the site. */
.freshness { display: block; font-size: 12.5px; margin-bottom: 6px; }
.freshness.live { color: var(--done); }
.freshness.snapshot { color: var(--muted); }
.freshness.stale { color: var(--e200); }

@media (max-width: 560px) {
  .egrid { grid-template-columns: 1fr; }
  .erow { flex-wrap: wrap; gap: 6px 12px; }
  .etime { min-width: 0; }
  .erow .elinks { width: 100%; }
  .rhythm { flex-direction: column; gap: var(--sp-3); }
}

/* What an event actually is. "Mega Squads" is a name, not a description — these lines are. */
.eabout { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ekind { margin: 0; font-size: var(--fs-sub); color: var(--muted); }
.eblurb { margin: 6px 0 0; font-size: var(--fs-ui); color: var(--text); line-height: 1.5; }
.ehas {
  margin: 8px 0 0; font-size: var(--fs-meta); color: var(--muted);
  letter-spacing: .02em;
}
.erow .ehas { margin-top: 4px; }
/* The blurb and Includes list, collapsed by default — see aboutBlock() in events.js for why
   caveats are never put behind this. [hidden] on .emore-panel is what actually hides it. */
.emore {
  margin-top: 10px; font-size: var(--fs-sub); color: var(--accent);
  background: none; border: none; padding: 0; cursor: pointer; font-weight: 600;
}
.emore:hover { text-decoration: underline; }
.emore-panel { margin-top: 6px; }
.emore-panel .eblurb { margin-top: 0; }
/* On a compact row it gets one or two lines, with the full text in the tooltip. */
.eabout-row {
  margin-top: 4px; font-size: 12.5px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.eabout-row.kind { color: var(--muted); font-size: var(--fs-sub); }

/* Heads-up notes: the exclusive-move deadline, a regional split, a bonus window that isn't
   the event window. Quoted from the source, never composed here. */
.ecaveats { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.ecaveat {
  margin: 0; font-size: var(--fs-sub); line-height: 1.45; color: var(--text);
  background: rgba(251,191,36,.07); border-left: 2px solid var(--e200);
  border-radius: 0 6px 6px 0; padding: 6px 9px;
}
.ecaveat .ctag {
  display: inline; font-weight: 700; font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--e200); margin-right: 7px; white-space: nowrap;
}
/* A debut or a shiny boost is good news, not a warning — same shape, calmer colour. */
.ecaveat[data-k="debut"], .ecaveat[data-k="costume"], .ecaveat[data-k="shiny"] {
  background: rgba(167,139,250,.07); border-left-color: var(--super);
}
.ecaveat[data-k="debut"] .ctag,
.ecaveat[data-k="costume"] .ctag,
.ecaveat[data-k="shiny"] .ctag { color: var(--super); }
.erow .ecaveat { font-size: 11.5px; }

/* ---------- a finished event ---------- */
/* The Mega Finale tracker outlives its event. Rather than quietly showing a list nobody can
   act on, it says so — and keeps the ticks, because past the event the page is the record of
   what you caught. Shares .rb-body/.rb-note/.rb-acts with the reminders panel: same shape,
   same job, one set of rules. */

.overbanner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) 20px;
  background: var(--surface); border: 1px solid var(--border-bright);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius); padding: var(--sp-4) var(--sp-6); margin-bottom: var(--sp-7);
}
/* The cards stay readable but stop looking like something to go and do. */
body.event-over .habitat-head h3 { color: var(--muted); }

/* ---------- reminders (events and Mega Finale) ---------- */
/* Deliberately a strip, not a banner. The events page has no sign-in gate and must not grow
   one — browsing is the whole point of it — so signed out this panel is not rendered at all
   until a Remind me button is pressed, and then it is the thing UI.flash() points at. */

/* flex-start, not center: with the setup guide open the body runs several times the height
   of the actions column, and centring strands those buttons halfway down an empty gutter. */
.remindbox {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-4) 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4) var(--sp-6); margin-bottom: 28px;
}
.remindbox .rb-body { flex: 1; min-width: 260px; }
.remindbox strong { display: block; font-size: var(--fs-name); margin-bottom: var(--sp-1); }
.rb-note { margin: 0; font-size: var(--fs-ui); color: var(--muted); max-width: 72ch; }
.rb-note + .rb-note { margin-top: var(--sp-2); }

/* The topic is a credential, so it gets a labelled row of its own and a monospace box that
   reads as one — not a phrase woven into a sentence. It is also the single thing someone has
   to carry into the ntfy app, so Copy sits next to it rather than in the actions row. */
.rb-topicrow {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3);
}
.rb-label {
  font-size: var(--fs-sub); color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.rb-topic {
  display: inline-block; padding: 3px var(--sp-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sub); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-bright);
  border-radius: var(--r-md); user-select: all; word-break: break-all;
}

/* The setup steps, on notifications.html. Setting a reminder and receiving one are different
   things — ntfy delivers to a subscription, not to a person — so the how-to gets a page, and
   a page with reminder buttons gets the strip above and a link to it. */
.rb-steps {
  margin: var(--sp-4) 0 0; padding-left: 1.4em;
  font-size: var(--fs-ui); color: var(--muted); max-width: 72ch;
}
.rb-steps li { margin-bottom: var(--sp-3); line-height: 1.6; }
.rb-steps li:last-child { margin-bottom: 0; }
/* Beats `.remindbox strong`, which is the panel's heading and would turn each step number
   into a block-level title. Same specificity, later in the file. */
.rb-steps strong { display: inline; font-size: inherit; margin: 0; color: var(--text); }
.rb-sub { display: block; margin-top: 3px; font-size: var(--fs-sub); color: var(--muted); }
.rb-link { color: var(--accent); text-decoration: none; }
.rb-link:hover { text-decoration: underline; }
/* No opacity here, deliberately: a dimmed aside on this surface measured 2:1 last time. */
.rb-warn {
  margin-top: var(--sp-4); padding-left: var(--sp-3);
  border-left: 2px solid var(--border-bright);
}
.rb-acts { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.rb-status { font-size: var(--fs-sub); color: var(--muted); width: 100%; margin: 0; }
.rb-status.bad { color: #f87171; }
.rb-status.ok { color: var(--done); }

/* Remind me, on an upcoming event's row. Sits in .elinks beside Details, so it takes the
   .elink shape — button, not link, because it performs an action. */
button.elink {
  font: inherit; font-size: var(--fs-sub); background: none; cursor: pointer;
  line-height: 1.55;
}
button.elink[disabled] { opacity: .5; cursor: default; }
.elink.on { color: var(--done); border-color: var(--done); font-weight: 600; }
/* Recorded, but the event is still further out than ntfy accepts a schedule for. Dashed
   because it is a weaker promise than the solid one, and the tooltip says why. */
.elink.on.armed { color: var(--e200); border-color: var(--e200); border-style: dashed; }

/* ---------- the reminder list (notifications.js) ---------- */
/* A reminder is otherwise only cancellable from the page that set it, and the events feed
   rotates — so this is the one place that lists what is actually on the account. */

.rlist { display: flex; flex-direction: column; gap: var(--sp-2); }
.rrow {
  display: flex; align-items: center; gap: var(--sp-2) var(--sp-4); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
}
.rmain { flex: 1; min-width: 200px; }
.rname { display: block; color: var(--text); font-size: var(--fs-name); font-weight: 600;
         text-decoration: none; }
a.rname:hover { color: var(--accent); }
.rmeta { font-size: var(--fs-sub); color: var(--muted); margin-top: 2px; }
/* Same two states as the buttons, same colours, same dashed-vs-solid distinction — a state
   that reads one way on an event row and another way in this list is worse than no list. */
.rstate {
  font-size: var(--fs-sub); font-weight: 600; color: var(--done);
  border: 1px solid var(--done); border-radius: var(--r-lg); padding: 2px var(--sp-3);
}
.rstate.armed { color: var(--e200); border-color: var(--e200); border-style: dashed; }

/* ---------- promo codes page (promo-codes.js) ---------- */
/* Same "shorter than the official one" instinct as the events page: one card, one code, one
   Copy and one Redeem, and nothing tracked — a code is either spent at Niantic's store or it
   isn't, and this site has no way to know which. */

.pcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
/* Dimmed and struck through, not hidden — a code that expired since the last snapshot refresh
   still has to be seen as dead, not silently omitted. Same reasoning as .card.caught's dim,
   opposite direction: there, dimming means "done"; here it means "can't be used any more". */
.pcard.expired { opacity: .55; }
.pcard.expired h3, .pcard.expired .pcode-text { text-decoration: line-through; }

.phead { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 6px; }
.phead h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.pdesc { margin: 0 0 8px; font-size: var(--fs-ui); color: var(--text); line-height: 1.5; }
.prewards { margin: 0 0 10px; font-size: var(--fs-sub); color: var(--muted); }

/* Same "credential in a monospace box, Copy beside it" recipe as .rb-topicrow/.rb-topic —
   a promo code and an ntfy topic are both "one string you have to carry somewhere else". */
.pcode { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: 8px; }
.pcode-text {
  display: inline-block; padding: 3px var(--sp-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-sub); font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-bright);
  border-radius: var(--r-md); user-select: all; word-break: break-all;
}
.pcard.expired .pcode-text { color: var(--muted); }

.pfoot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.pexpiry { font-size: var(--fs-sub); color: var(--muted); font-variant-numeric: tabular-nums; }
.pexpiry.urgent { color: var(--e200); font-weight: 700; }

@media (max-width: 560px) {
  .remindbox { padding: var(--sp-4); }
  .rb-acts { width: 100%; }
  /* The label takes its own line so the topic and its Copy button stay on one — the topic is
     25 monospace characters and the pair does not fit beside a label on a phone. */
  .rb-label { flex-basis: 100%; }
}
