/* ==========================================================
   Pallet Town Watch Order — shared styles (every page)
   Loaded first on every page, before the page's own stylesheet.

   Holds what more than one page uses: colours and fonts (:root),
   page basics, header + nav, footer, buttons, cards, progress bars,
   the episode rows and season/region/type sections, the Up next band
   and sticky bar (Master List + Regions), back-to-top, form fields
   and messages (Log in + My account), log-in visibility rules.

   Styles used by only one page live in that page's file:
     css/landing.css     index.html
     css/masterlist.css  masterlist.html
     css/movies.css      movies.html
     css/regions.css     regions.html
     css/login.css       login.html
     css/account.css     account.html
   ========================================================== */

:root {
  /* ---- Palette: yellow + blue ----
     Change a value here and it updates everywhere on the site. */
  --yellow: #FFCB05;
  --yellow-dark: #C7A008;
  --blue: #3466AF;
  --navy: #21386E;
  --navy-deep: #1D2C5E;

  /* Page */
  --ground: #F5F7FC;          /* page background */
  --surface: #FFFFFF;         /* cards */
  --surface-alt: #FAFBFE;     /* season header strips */
  --ink: var(--navy-deep);    /* main text */
  --muted: #4F5B7A;           /* secondary text */
  --faint: #5C6886;           /* small labels */
  --line: #DCE2EF;
  --line-soft: #EBEFF7;
  --line-strong: #C3CCE0;
  --track: #E3E8F3;           /* empty part of progress bars */

  /* Header and dark cards */
  --header: var(--navy-deep);
  --header-hover: var(--navy);
  --on-dark: #FFFFFF;
  --on-dark-muted: #C9D2E8;

  /* Highlights */
  --accent: var(--yellow);              /* buttons, checkboxes */
  --accent-hover: #E6B700;
  --on-accent: var(--navy-deep);        /* text on yellow */
  --accent-text: #7A6200;               /* yellow-family text on white (plain yellow is unreadable on white) */
  --progress: var(--blue);              /* progress bar fill */
  --link: var(--blue);
  --link-hover: var(--navy);

  /* Entry types */
  --type-episode: var(--navy-deep);
  --type-movie: var(--blue);
  --type-special: #8A5100;
  --type-short: #6B3FA0;

  /* Rows */
  --row-watched: #FFFBEA;
  --row-feature: #F3F6FD;

  /* Badges */
  --badge-bg: #EEF1F7;
  --badge-text: #44506E;
  --badge-type-bg: #EAF0FA;
  --badge-alert-bg: #FCEBEA;
  --badge-alert-text: #9E231C;
  --badge-warn-bg: #FFF4D1;
  --badge-warn-text: #6E5800;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--link); }

a:hover { color: var(--link-hover); }

button { font: inherit; }

input[type="checkbox"] { accent-color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 10;
}

.skip-link:focus { top: 12px; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.muted { color: var(--muted); }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/* ---------- Header ---------- */
.site-header { background: var(--header); color: var(--on-dark); }

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--on-dark);
  text-decoration: none;
}

.brand:hover { color: var(--on-dark); }

/* Header logo (images/website/Logo-Home.png). Height is fixed and the
   width follows the image's own proportions. image-rendering keeps
   pixel-art edges crisp when scaled. */
.brand__logo {
  display: block;
  height: 44px;
  width: auto;
  flex: 0 0 auto;
  image-rendering: pixelated;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: var(--on-dark-muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover { color: var(--on-dark); background: var(--header-hover); }

.site-nav a[aria-current="page"] {
  color: var(--on-dark);
  background: var(--header-hover);
  font-weight: 700;
}

.site-nav a.site-nav__account {
  margin-left: 8px;
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 700;
}

.site-nav a.site-nav__account:hover { background: var(--accent-hover); color: var(--on-accent); }

/* Header on tablets: one row (smaller name, tighter links). */
@media (min-width: 641px) and (max-width: 900px) {
  .site-header__inner { gap: 12px; }
  .brand { gap: 10px; }
  .brand__logo { height: 38px; }
  .brand__name { font-size: 19px; }
  .site-nav a { padding: 10px 10px; font-size: 15px; }
  .site-nav a.site-nav__account { margin-left: 4px; }
}

/* Header on phones: two tidy rows.
   Row 1: logo + name on the left, Log in / My account on the right.
   Row 2: Master List · Movies · Regions, sharing the width evenly. */
@media (max-width: 640px) {
  .site-header__inner { gap: 0 8px; padding-top: 12px; padding-bottom: 10px; }
  .site-header__inner::after { content: ""; flex-basis: 100%; order: 1; }   /* line break before the links */
  .brand { flex: 1 1 0; min-width: 0; gap: 10px; }
  .brand__logo { height: 36px; }
  .brand__name { font-size: 18px; line-height: 1.15; }
  .site-nav { display: contents; }
  .site-nav a { order: 2; flex: 1 1 0; justify-content: center; text-align: center; padding: 8px 4px; margin-top: 8px; font-size: 15px; white-space: nowrap; }
  .site-nav a.site-nav__account { order: 0; flex: 0 0 auto; margin: 0; padding: 8px 12px; min-height: 40px; }
}
@media (max-width: 400px) {
  .site-nav__long { display: none; }   /* "Log in / Sign up" → "Log in" on small phones */
}
@media (max-width: 360px) {
  .site-nav a { font-size: 14px; }
  .brand__name { font-size: 17px; }
}

/* ---------- Page ---------- */
.page {
  padding-top: 32px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.next-band {
  background: var(--header);
  color: var(--on-dark);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
}

.next-band__main {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.next-band__kicker {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--on-dark-muted);
}

.next-band__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.next-band__meta {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--yellow);
}

.next-band__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.next-band__actions .btn { margin-top: 0; }

.next-band__season {
  flex: 0 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 32px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.next-band__season[hidden] { display: none; }

.next-band__season-name { font-weight: 700; font-size: 17px; }

.next-band__season .bar { height: 8px; background: rgba(255, 255, 255, 0.18); }

.next-band__season .bar__fill { background: var(--yellow); }

.next-band__season-count { font-family: var(--font-mono); font-size: 14px; color: var(--on-dark-muted); }

.bar {
  height: 6px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.bar--md { height: 8px; width: 120px; }

.bar__fill {
  height: 100%;
  width: 0;
  background: var(--progress);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.breakdown__dot { width: 10px; height: 10px; border-radius: 3px; }

.btn {
  min-height: 44px;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.btn--primary {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  align-self: flex-start;
  margin-top: auto;
}

.btn--primary:hover { background: var(--accent-hover); }

.btn--secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  padding: 8px 14px;
}

.btn--secondary:hover { background: var(--ground); }

.status { padding: 32px; color: var(--muted); }

.status[hidden] { display: none; }

/* ---------- Groups & rows ---------- */
.groups { display: flex; flex-direction: column; gap: 16px; }

.group { overflow: hidden; }

.group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.group__title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.group__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.group__progress { display: flex; align-items: center; gap: 10px; }

.group__count {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.entries { list-style: none; margin: 0; padding: 0; }

.entry { border-top: 1px solid var(--line-soft); background: var(--surface); }

.entry:first-child { border-top: 0; }

.entry--feature { background: var(--row-feature); }

.entry--watched { background: var(--row-watched); }

.entry__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 20px 10px 12px;
}

.entry__check {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.entry__check input { width: 22px; height: 22px; cursor: pointer; }

.entry__index {
  flex: 0 0 52px;
  height: 26px;                 /* divider length; raise or lower to taste */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
  border-right: 2px solid var(--line-strong);   /* divider between story number and S/E code */
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--faint);
}

.entry__code {
  flex: 0 0 84px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--type-episode);
}

.entry__code--movie { color: var(--type-movie); }

.entry__code--special { color: var(--type-special); }

.entry__code--short { color: var(--type-short); }

.entry__titles {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry__title { font-weight: 700; overflow-wrap: anywhere; }

.entry__title-ja { font-size: 13px; color: var(--faint); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--badge-bg);
  color: var(--badge-text);
}

.badge--movie { background: var(--badge-type-bg); color: var(--type-movie); }

.badge--special { background: var(--badge-type-bg); color: var(--type-special); }

.badge--short { background: var(--badge-type-bg); color: var(--type-short); }

.badge--alert { background: var(--badge-alert-bg); color: var(--badge-alert-text); }

.entry__date {
  flex: 0 0 104px;
  font-size: 14px;
  color: var(--muted);
}

.entry__toggle {
  min-height: 44px;
  min-width: 72px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--link);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.entry__toggle:hover { background: var(--ground); color: var(--link-hover); }

/* Details: "What happens" runs the full width of the row, starting
   under the story number (72px = row padding + checkbox column + gap). */
.entry__details {
  padding: 4px 24px 20px 72px;
}

.entry__details[hidden] { display: none; }

/* Open row: a blue outline around the row and its Details so it reads as
   one block, plus a thin line between the row and its Details.
   Drawn with an inset shadow so nothing shifts when it opens. */
.entry--open {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--blue), 0 4px 14px rgba(29, 44, 94, 0.12);
}

.entry--open + .entry { border-top-color: transparent; }

.entry--open .entry__details {
  margin: 0 20px 0 72px;
  padding: 16px 4px 20px 0;
  border-top: 1px solid var(--line-soft);
}

.details__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.details__block { display: flex; flex-direction: column; gap: 4px; }

.details__block p { margin: 0; font-size: 15px; line-height: 1.55; }

/* ---------- Small screens ---------- */
/* Up next band: once the season progress drops under the title (tablets
   and phones), separate it with a line above instead of a line on its left. */
@media (max-width: 900px) {
  .next-band__season { flex-basis: 100%; padding-left: 0; padding-top: 20px; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.16); }
}

@media (max-width: 640px) {
  .next-band__title { font-size: 28px; }
  .next-band { padding: 24px 20px; }
  .next-band__actions .btn { flex: 1 1 auto; }   /* buttons fill the row (and stack on small phones) */

  /* Episode rows on phones: two compact lines instead of four.
       [✓]  1 │ S1 · E01   Sep 8, 1998      [Details]
            Pokémon - I Choose You!
            ポケモン！きみにきめた！                          */
  .entry__row {
    display: grid;
    grid-template-columns: 44px auto auto 1fr auto;
    align-items: center;
    gap: 2px 10px;
    padding: 8px 8px 10px 4px;
  }
  .entry__check  { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .entry__index  { grid-column: 2; grid-row: 1; height: 18px; padding-right: 10px; font-size: 12px; justify-content: flex-start; }
  .entry__code   { grid-column: 3; grid-row: 1; font-size: 12px; }
  .entry__date   { grid-column: 4; grid-row: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .entry__titles { grid-column: 2 / 5; grid-row: 2; }
  .entry__toggle { grid-column: 5; grid-row: 1 / span 2; align-self: center; min-width: 64px; padding: 0 8px; }

  .entry__details { padding: 4px 16px 20px; }
  .entry--open .entry__details { margin: 0 16px; padding: 16px 0 20px; }

  /* Section header: progress bar and its button share one line; when an
     Undo button is showing, the bar gets its own line and the two buttons
     sit side by side under it. */
  .group__head { padding: 12px 16px; gap: 8px; }
  .group__meta { flex: 1 1 100%; margin-left: 0; gap: 10px; }
  .group__progress { flex: 1 1 120px; }
  .group__progress .bar { flex: 1 1 auto; width: auto; }
  .group__meta > .btn { flex: 0 0 auto; margin: 0; }
  .group__meta:has(.btn--undo) .group__progress { flex-basis: 100%; }
  .group__meta:has(.btn--undo) > .btn { flex: 1 1 0; }

  /* Back to top sits lower right on phones, away from the checkboxes. */
  .to-top { left: auto; right: 16px; width: 48px; height: 48px; }
}

/* Small phones (≤360px): a little more room for titles. */
@media (max-width: 360px) {
  .entry__row { grid-template-columns: 40px auto auto 1fr auto; gap: 2px 8px; padding-right: 4px; }
  .entry__date { display: none; }                      /* air date: Details still has the full info */
  .entry__toggle { min-width: 56px; padding: 0 6px; font-size: 13px; }
  .group__meta > .btn { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .bar__fill { transition: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  padding-bottom: 32px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer p { margin: 0; max-width: 72ch; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-bottom: 12px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}
.footer-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }

/* ==========================================================
   Links styled as buttons, and pieces shared by several pages
   ========================================================== */
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

a.btn--primary, a.btn--primary:hover { color: var(--on-accent); }

/* Outline button for dark backgrounds */
.btn--ghost {
  border: 2px solid var(--on-dark-muted);
  background: transparent;
  color: var(--on-dark);
}

a.btn--ghost:hover {
  border-color: var(--on-dark);
  background: var(--header-hover);
  color: var(--on-dark);
}

/* ==========================================================
   List pages: Master List, Movies, Regions (and My account)
   ========================================================== */
/* ---------- Shared page pieces ---------- */
.page-intro { display: flex; flex-direction: column; gap: 4px; }

.page-intro p { margin: 0; max-width: 70ch; }

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.5vw, 40px);
  letter-spacing: -0.02em;
}

.link-button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--link);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.link-button:hover { color: var(--link-hover); background: var(--line-soft); }

/* ---------- Collapsible groups ---------- */
/* Heading takes the free space and wraps its text; progress + buttons stay on the right */
.group__heading { flex: 1 1 240px; min-width: 0; }   /* small enough that progress + buttons stay beside the title on tablets */

.group__meta { margin-left: auto; }

.group__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: -6px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.group__toggle:hover { background: var(--line-soft); }

.group__chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.group__toggle[aria-expanded="true"] .group__chevron { transform: rotate(90deg); }

.group--closed .group__head { border-bottom: 0; }

.entries[hidden] { display: none; }

.entry__context {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.entry__context strong { font-weight: 700; color: var(--ink); }

.entry__titles .badges { margin-top: 6px; }

/* ---------- Logged-in vs logged-out ----------
   data-auth-show="member": only when logged in (My account).
   data-auth-show="guest":  only when logged out (Log in / Sign up).
   common.js sets <html data-auth="member"> once someone is logged in.
   Until then members-only items stay hidden, with no flash on load. */
html:not([data-auth="member"]) [data-auth-show="member"] { display: none !important; }

html[data-auth="member"] [data-auth-show="guest"] { display: none !important; }

/* ==========================================================
   Sticky header, slim Up next bar (Master List + Regions),
   jump highlight, back to top
   ========================================================== */
.page-masterlist .site-header,
.page-movies .site-header,
.page-regions .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

#main:focus { outline: none; }

/* Sections opened from a card link stop just below the sticky header. */
.page-movies .group,
.page-regions .group { scroll-margin-top: calc(var(--header-h, 76px) + 16px); }

/* Slim "Up next" bar, shown while scrolling the list */
.next-sticky {
  position: fixed;
  top: var(--header-h, 76px);
  left: 0;
  right: 0;
  z-index: 15;
  background: var(--blue);
  color: var(--on-dark);
  box-shadow: 0 6px 18px rgba(29, 44, 94, 0.22);
  transform: translateY(-110%);
  visibility: hidden;          /* hidden bars are skipped by Tab and screen readers */
  transition: transform 0.2s ease, visibility 0s linear 0.2s;
}

.next-sticky.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.2s ease, visibility 0s;
}

.next-sticky__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.next-sticky__tag {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}

.next-sticky__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-sticky__code { font-family: var(--font-mono); font-size: 13px; color: #E3E8F3; margin-right: 8px; }

.next-sticky__title { font-weight: 700; }

/* Smaller buttons for the slim bar (still 40px tall to tap) */
.btn--slim { min-height: 40px; padding: 6px 14px; font-size: 14px; flex: 0 0 auto; margin: 0; }

.next-sticky .btn--ghost { border-color: rgba(255, 255, 255, 0.7); color: var(--on-dark); }

.next-sticky .btn--ghost:hover { border-color: var(--on-dark); background: var(--navy); color: var(--on-dark); }

/* A row you jumped to glows briefly */
@keyframes entry-flash {
  0%, 35% { background: var(--accent); }
  100% { background: var(--surface); }
}

.entry--flash { animation: entry-flash 2s ease-out; }

/* Back to top, lower left */
.to-top {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 30;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--header);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(29, 44, 94, 0.3);
}

.to-top[hidden] { display: none; }

.to-top:hover { background: var(--header-hover); }

/* Phones: the header wraps to two rows, so it doesn't stick; the slim
   Up next bar sits at the very top and keeps just the code, title and Jump. */
@media (max-width: 640px) {
  .page-masterlist .site-header,
  .page-movies .site-header,
  .page-regions .site-header { position: static; }
  .page-movies .group, .page-regions .group { scroll-margin-top: 12px; }
  .next-sticky { top: 0; }
  .next-sticky__tag, .next-sticky__mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .entry--flash { animation: none; outline: 3px solid var(--accent); }
  .next-sticky, .next-sticky.is-visible { transition: none; }
}

.status .link-button { margin-left: 8px; }

/* ---------- Undo and "Mark watched up to here" ---------- */
.btn--undo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: var(--yellow-dark);
  background: var(--row-watched);
}

.btn--undo:hover { background: #FFF4D1; }

.details__actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.details__actions .btn--slim { border-color: var(--line-strong); }

.details__hint { font-size: 13px; color: var(--muted); }

/* Optional line under a section title (Movies page stops) */
.group__sub {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.group__sub strong { color: var(--ink); }

/* Movies page: extra Details lines (When to watch / Watch together) */
.details__more {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.details__more strong { color: var(--ink); font-weight: 700; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }

.field label { font-weight: 700; font-size: 14px; }

.field__hint { margin: 0; font-size: 13px; color: var(--muted); }

.field input,
.danger-confirm input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* 16px keeps phones from zooming in */
}

.field input:focus,
.danger-confirm input:focus { outline: 3px solid rgba(52, 102, 175, 0.35); border-color: var(--blue); }

.field__password { position: relative; }

.field__password input { padding-right: 68px; }

.field__show {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 38px;
  min-width: 52px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.field__show:hover { background: var(--line-soft); }

.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.auth-actions .btn { margin-top: 0; align-self: auto; }

.auth-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.auth-message[hidden] { display: none; }

.auth-message--error { background: var(--badge-alert-bg); color: var(--badge-alert-text); }

.auth-message--ok { background: #E7F4EA; color: #1F6B33; }

.auth-card code, .account code { font-family: var(--font-mono); font-size: 13px; background: var(--ground); padding: 1px 5px; border-radius: 4px; }

/* "Not saved to your account yet" note (cloud.js) */
.sync-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--header);
  color: var(--on-dark);
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(29, 44, 94, 0.25);
}

.sync-note[hidden] { display: none; }

@media (max-width: 640px) {
  .sync-note { left: 16px; right: 16px; max-width: none; bottom: 80px; }
}
