/*
 * Site chrome — header + footer ported 1:1 from animeoshi-web
 * (src/components/Layout/SiteFooter, /Header). Module class names are flattened
 * to global prefixes: `aof-` (footer), `aoh-` (header). Loaded on every page
 * via Layout. Token-mapping block covers the few tokens this SSG names
 * differently or lacks.
 */

@font-face {
  font-family: 'Montra';
  src: url('Montra.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --font-montra: 'Montra', var(--font-heading);
}

/* Match animeoshi-web: clip horizontal overflow site-wide. The footer is a
   content-box whose horizontal padding sits OUTSIDE its 100% width (so its
   content area is the full viewport — this is what lets all 5 footer columns
   fit on one row at ~1450px instead of wrapping "Partners"). The padding then
   overflows the viewport; live hides it here. The fixed header is unaffected
   (overflow-x:hidden only breaks position:sticky, not position:fixed). */
html, body { overflow-x: hidden; }

/* Hide the scrollbar sitewide — the page still scrolls up/down, there's just no
   visible bar (mirrors AO's global `::-webkit-scrollbar { width: 0 }`).
   Components that WANT a visible bar (Weekly Verdict list, rate modal) re-enable
   it with a higher-specificity `.x::-webkit-scrollbar` rule, so they're
   unaffected. */
::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
html { scrollbar-width: none; -ms-overflow-style: none; }

/* ── token map (scoped to the ported chrome) ─────────────── */
.aof-footer {
  /* animeoshi's footer type is a FIXED scale (group title 16px, links/copyright
     14px); the SSG's tokens map these to fluid clamps that shrink on narrower
     desktops and widen the groups. Pin to the live fixed sizes. */
  --font-size-base: 1rem;      /* group title — live is a fixed 16px */
  --font-size-sm: 0.875rem;    /* links + copyright — live is a fixed 14px */
  --font-size-xs: 0.75rem;     /* mobile links/copyright — live is a fixed 12px
                                  (the global clamp collapses to 10px on phones) */
  --spacing-4xl: 3.5rem;
  /* Live secondary text is pebble-80 (warm translucent white); the global
     token is a flat grey (hsl 0 0% 65%). Match the live value. */
  --color-text-secondary: rgba(237, 237, 237, 0.8);
}

/* ── Footer (SiteFooter) ─────────────────────────────────── */
.aof-footer {
  width: 100%;
  background: var(--color-surface);
  border-top: var(--border-normal) solid var(--color-border);
  padding: var(--spacing-3xl);
  /* content-box (padding outside the 100% width) mirrors live — the content
     area stays the full viewport so all 5 columns fit on one row ~1450px. The
     overflowing padding is clipped by the html/body overflow-x:hidden above. */
  box-sizing: content-box;
}

.aof-container {
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-4xl);
}

.aof-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-lg);
  min-width: 300px;
}

.aof-logo-link { display: flex; align-items: center; text-decoration: none; }
.aof-logo { height: auto; width: auto; }

.aof-socials { display: flex; gap: var(--spacing-sm); }

.aof-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--ivory);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.aof-social-btn:hover { background: var(--charcoal-80); transform: scale(1.05); }
.aof-social-badge { display: block; width: 20px; height: 20px; }

.aof-copyright {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.aof-right {
  display: flex;
  gap: var(--spacing-4xl);
  flex-wrap: wrap;
  width: 100%;
}

.aof-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-width: 160px;
}

.aof-group-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2; /* live is 19.2px (16 × 1.2), not the default 1.5 */
  color: var(--color-text-primary);
  margin: 0;
}

.aof-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.aof-link {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.aof-link:hover { color: var(--color-text-primary); }

@media (max-width: 1024px) {
  .aof-container { gap: var(--spacing-2xl); }
  .aof-right { gap: var(--spacing-2xl); }
  .aof-group { min-width: 140px; }
}

@media (max-width: 768px) {
  /* Bottom padding clears the fixed mobile dock (present at every mobile width). */
  .aof-footer { padding: var(--spacing-2xl) 0 120px; margin-top: var(--spacing-4xl); }
  .aof-container { flex-direction: column; gap: var(--spacing-2xl); padding: 0 var(--spacing-md); }
  .aof-left { align-items: flex-start; text-align: left; }
  /* AO mobile footer: CSS multi-column (not a flex row) so the groups flow DOWN
     column 1 (Browse, Contribute) then column 2 (Careers, About, Partners). A
     flex row would key every row's height off the 8-link Browse group and
     reorder the short groups; multi-column packs them tight in source order. */
  .aof-right { display: block; columns: 2; column-gap: var(--spacing-xl); }
  .aof-group { min-width: 0; align-items: flex-start; text-align: left; break-inside: avoid; margin-bottom: var(--spacing-lg); }
  .aof-group:last-child { margin-bottom: 0; }
  /* Size the LIST (not just the link) to xs so each <li>'s line-box strut is
     12px·1.6 = 19.2px, giving AO's 27px row pitch. Leaving the list at the
     inherited 16px makes the li strut 25.6px → rows ~6px too loose vs AO. */
  .aof-link-list { align-items: flex-start; font-size: var(--font-size-xs); }
  /* Long labels ("How Episode Ratings Work") must wrap inside a half-width column. */
  .aof-link { font-size: var(--font-size-xs); white-space: normal; }
  .aof-copyright { font-size: var(--font-size-xs); }
  .aof-logo { max-height: 32px; }
}

@media (max-width: 480px) {
  .aof-right { column-gap: var(--spacing-lg); }
}

/* ── Header (ported from animeoshi-web Layout/Header) ─────── */
.aoh-header {
  --color-ghost: var(--ivory);
  --color-ghost-subtle: var(--pebble-15);
  --blur-md: 12px;
  --color-surface-hover: var(--color-surface-overlay);
  --spacing-2xs: 0.125rem;
  /* animeoshi's --spacing-xs is 5px; the vendored tokens.css uses 4px. Pin it
     here so header gaps/padding (container, nav, right, search) match exactly. */
  --spacing-xs: 5px;
  /* Nav / username text — animeoshi renders these at a FIXED 14px (font-size-sm),
     semibold. (Earlier this was fluid; the live measures 14px, so pin it.) */
  --aoh-text: 14px;

  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding-block: var(--spacing-sm);
  padding-inline: var(--spacing-md);
  background: transparent;
  box-sizing: border-box;
}
/* Side space grows with the viewport, exactly like animeoshi-web's header. */
@media (min-width: 768px)  { .aoh-header { padding-inline: var(--spacing-xl); } }
@media (min-width: 1200px) { .aoh-header { padding-inline: var(--spacing-2xl); } }

.aoh-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--charcoal);
  border-radius: var(--radius-full);
  padding: var(--spacing-xs) var(--spacing-md);
  gap: var(--spacing-md);
  min-width: 280px;
  /* Query container so nav/search adapt to the pill's width, not the viewport —
     exactly like animeoshi-web's header (container-name: header). */
  container-type: inline-size;
  container-name: header;
}

.aoh-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.aoh-logo img { height: clamp(36px, 9vw, 56px); width: auto; display: block; }
@media (max-width: 768px) { .aoh-logo img { height: 50px; } }

.aoh-left { display: flex; align-items: center; gap: var(--spacing-md); flex: 1; min-width: 0; }
.aoh-nav { display: none; gap: var(--spacing-sm); align-items: center; }
@container header (min-width: 1000px) { .aoh-nav { display: flex; } }

.aoh-nav-button {
  font-family: var(--font-body);
  font-size: var(--aoh-text);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: transparent;
  color: var(--color-ghost);
  text-decoration: none;
  gap: var(--spacing-xs);
}
.aoh-nav-button:hover { opacity: 0.8; }
.aoh-nav-icon { display: inline-flex; width: 20px; height: auto; flex-shrink: 0; }
.aoh-nav-icon svg { width: 20px; height: 20px; display: block; }

.aoh-dropdown-container { position: relative; }
.aoh-dropdown {
  position: absolute;
  top: calc(100% + var(--spacing-md));
  left: 0;
  /* AO's .dropdown bg = hsl(from --color-surface-overlay h s l / 0.9); on the live
     site --color-surface-overlay = --charcoal-70, so it resolves to charcoal @ 0.9
     (measured rgb(23,13,33)/0.9) — a dark translucent menu, not the lighter
     271/25/18 this had. */
  background: var(--charcoal-90);
  -webkit-backdrop-filter: blur(var(--blur-md));
  backdrop-filter: blur(var(--blur-md));
  border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xs);
  width: max-content;
  box-shadow: var(--shadow-lg);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xs);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.aoh-dropdown-container.aoh-open .aoh-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.aoh-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
/* AO's .dropdownItem:hover uses --color-surface = --pebble-5 (a faint LIGHT tint);
   this repo's --color-surface is opaque dark purple, which darkens the item
   instead of lightening it (reversed). Use --pebble-5 to match AO. */
.aoh-dropdown-item:hover { background: var(--pebble-5); }

/* Search */
.aoh-search { display: flex; align-items: center; flex: 1; min-width: 0; }
/* Search narrows as the pill tightens, then collapses to its own width — the
   same container-query steps animeoshi-web uses on .searchContainer. */
@container header (min-width: 1000px) and (max-width: 1230px) { .aoh-search { max-width: 100px; } }
@container header (min-width: 1000px) and (max-width: 1100px) { .aoh-search { flex: none; max-width: none; } }
/* SearchBar .container — transparent w/ subtle border + radius-3xl, 14px (matches app). */
.aoh-search-form {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  width: 100%;
  /* animeoshi.com's live header caps the search pill to a compact width (~240px
     at desktop) — it does NOT flex-fill; a large empty gap follows it. */
  max-width: 240px;
  /* Fixed 40px-tall pill; horizontal-only padding so it doesn't grow taller. */
  height: 40px;
  box-sizing: border-box;
  padding: 0 var(--spacing-md);
  border: var(--border-normal) solid var(--color-ghost-subtle);
  background: transparent;
  border-radius: 24px;
  color: var(--color-ghost);
  font-size: 14px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.aoh-search-form:hover { border-color: var(--color-ghost); }
.aoh-search-form:focus-within { background: var(--color-ghost-subtle); }
.aoh-search-icon { flex-shrink: 0; color: var(--color-ghost); opacity: 1; }
.aoh-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-ghost);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}
.aoh-search-input::placeholder { color: var(--color-ghost); opacity: 0.95; font-weight: var(--font-weight-medium); }

/* Right / auth */
.aoh-right { display: flex; align-items: center; gap: var(--spacing-md); flex-shrink: 0; }
@media (max-width: 768px) { .aoh-right { gap: var(--spacing-xs); } }
.aoh-user-actions { display: flex; align-items: center; gap: var(--spacing-xs); }
/* Sign In — shared Button variant="primary" (pebble bg, dark text). */
.aoh-signin {
  /* animeoshi .signInButton: fixed 40px tall, 14px, 0 16px padding (padding-block 0). */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  padding: 0 var(--spacing-md);
  border-radius: var(--radius-full);
  border: none;
  color: var(--charcoal);
  background: var(--pebble);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}
.aoh-signin:hover { opacity: 0.8; }
/* Signed-in pill = animeoshi's profileButton (Button variant="secondary"):
   transparent bordered pill, 40px tall, 14px, avatar + username. */
.aoh-profile {
  display: inline-flex; align-items: center; gap: var(--spacing-xs);
  height: 40px; padding: 0 var(--spacing-md);
  border-radius: var(--radius-full);
  border: var(--border-normal) solid var(--color-ghost-subtle);
  background: transparent;
  color: var(--color-ghost);
  font-family: var(--font-body);
  font-size: var(--aoh-text);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}
.aoh-profile:hover { background: var(--color-ghost-subtle); }
.aoh-profile img {
  width: 24px; height: 24px; border-radius: var(--radius-full);
  object-fit: cover; background: #f3f4f6; flex-shrink: 0;
  /* .avatarContainer margin-right:8px + the 4px pill gap = 12px, per animeoshi. */
  margin-right: var(--spacing-sm);
}
/* Mobile: avatar only (no username, no border) — like animeoshi ≤480px. */
@media (max-width: 480px) {
  .aoh-profile { border: none; padding: 0; }
  .aoh-profile span { display: none; }
}

/* Chat + settings gear + inbox bell — 40px circular icon buttons (signed-in only). */
.aoh-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: none; background: transparent;
  border-radius: var(--radius-full);
  color: var(--color-ghost); cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.aoh-iconbtn:hover { background: var(--color-ghost-subtle); }
.aoh-iconbtn svg { width: 22px; height: 22px; display: block; }
@media (max-width: 768px) { .aoh-iconbtn { width: 36px; } }

/* Inbox unread badge (mirrors animeoshi's InboxBell .badge). */
.aoh-bell { position: relative; }
.aoh-bell-icon { display: inline-flex; }
.aoh-bell-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 9999px;
  background: var(--color-accent);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  pointer-events: none;
}

/* Below 1220px the top nav/search hide and the bottom dock takes over. */
/* Search hides on mobile only; animeoshi renders it for tablet + desktop.
   (The nav is governed by the pill's container query above, not the viewport.) */
@media (max-width: 767px) { .aoh-search { display: none; } }

/* ── Mobile bottom dock (ported from Layout/Footer + Layout/Dock) ── */
.aod-container {
  position: fixed;
  bottom: 20px;
  left: 0; right: 0;
  z-index: 50;
  display: none;
  justify-content: center;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.aod-container.aod-hidden { transform: translateY(120px); opacity: 0; pointer-events: none; }
.aod-panel {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-sm);
  border-radius: var(--radius-2xl);
  background: hsla(271, 45%, 9%, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: var(--border-normal) solid var(--color-border);
  padding: var(--spacing-sm);
  box-shadow: var(--shadow-lg);
}
.aod-slot { position: relative; }
.aod-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: var(--border-normal) solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.aod-item:hover { background: var(--color-surface); }
.aod-icon { width: 20px; height: auto; display: block; }
.aod-dropdown {
  position: absolute;
  bottom: calc(100% + var(--spacing-sm));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--charcoal-90);   /* AO dropdown = charcoal @ 0.9 (see .aoh-dropdown) */
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xs);
  width: max-content;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.aod-slot.aod-open .aod-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.aod-dropdown-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--p-font-size);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  transition: background 0.2s ease;
}
/* Same AO nav dropdown as the header — hover lightens (pebble-5), not the opaque
   dark --color-surface. See .aoh-dropdown-item:hover above. */
.aod-dropdown-item:hover { background: var(--pebble-5); }

@media (max-width: 1219.98px) { .aod-container { display: flex; } }

/* ── Breadcrumb (ported from animeoshi-web Commons/Navigation/Breadcrumb) ──
 * Just the trail styling — pages position the .bc-nav wrapper themselves. */
.bc-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.bc-item { display: flex; align-items: center; gap: var(--spacing-xs); }
.bc-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.bc-link:hover { color: var(--color-text-primary); text-decoration: underline; }
.bc-separator { width: 12px; height: 12px; color: var(--color-text-tertiary); flex-shrink: 0; }
.bc-current { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }

@media (max-width: 768px) {
  .bc-list { font-size: 12px; }
  .bc-separator { width: 10px; height: 10px; }
  .bc-link, .bc-current { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Toasts: anchor top-right (match the live site) ──────────────
   The vendored tokens.css snapshot positions #ao-toasts bottom-right;
   override to top-right, just below the fixed header. */
#ao-toasts {
  top: calc(var(--header-height) + var(--spacing-sm));
  bottom: auto;
  right: var(--spacing-xl);
  left: auto;
}
@media (max-width: 480px) {
  #ao-toasts {
    top: calc(var(--header-height) + var(--spacing-sm));
    bottom: auto;
    left: var(--spacing-md);
    right: var(--spacing-md);
  }
}

/* ── Toast: left accent bar + circled icon (match the live toast) ── */
.ao-toast {
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: var(--color-border);
}
.ao-toast-success { border-left-color: var(--color-success); }
.ao-toast-error   { border-left-color: var(--color-danger); }
.ao-toast-warning { border-left-color: var(--color-warning); }
.ao-toast-info    { border-left-color: var(--cotton-sky); }
/* Circle-check style: wrap the glyph in a colored ring instead of a bare mark. */
.ao-toast-icon {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
}

/* ── Auth modal — 1:1 mirror of animeoshi-web Modal/Auth ───────────────────
   Measured against AO source (BaseModal base.module.css, auth.module.css,
   Commons/Form/Input, Commons/Base/Button, globals tokens):
     overlay  .overlay        → bg black/0.8 + blur-sm(5px)
     box      .modal.auth      → width min(437px,90vw), auto height,
                                 radius-4xl(32px), padding spacing-md, no border
     headings                  → --font-display (= Montra); h1 20px, h2 24px
     input    Input .wrapper    → transparent, radius-3xl(24px),
                                 border color-border-subtle(pebble-15), padding md
     Continue Button primary    → bg --pebble, text --charcoal (NOT --color-button,
                                 which is --sundrop in this repo's tokens)
     oauth    Button oauth       → transparent, border color-border, text ivory
   The markup (Layout.tsx) is driven by vendored ao.js; these override the base
   in tokens.css (site-chrome.css loads after it), ID-scoped so overrides win.
   --font-display is NOT defined globally here, so headings reference --font-montra
   (site-chrome :root) directly. Mascots live flat in _assets/<ver>/. */
#ao-auth-modal {
  background: rgba(0, 0, 0, 0.8);            /* --color-overlay-dark-80 */
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
}
#ao-auth-modal .ao-modal-box {
  box-sizing: content-box;                   /* AO: width is the CONTENT width; padding adds 32px → 469px total */
  width: min(437px, 90vw);
  max-width: min(437px, 90vw);
  height: auto;
  background: var(--color-bg);
  border: none;
  border-radius: 32px;                       /* --radius-4xl */
  padding: var(--spacing-md);
  box-shadow: none;
  overflow: visible;
  text-align: center;
}
#ao-auth-modal #ao-modal-form-view,
#ao-auth-modal #ao-modal-sent-view {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Close button — AO BaseModal .closeWrapper/.closeButton (Icon-Close-Dark.svg).
   32px circle, inset 12px, subtle --color-surface tint; the icon (vendored from
   AO) is the dark glass disc + #EDEDED X. Overrides the vendored tokens.css
   text-✕ styling. */
#ao-auth-modal .ao-modal-close {
  top: var(--spacing-smd, 12px);
  right: var(--spacing-smd, 12px);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(237, 237, 237, 0.05);   /* AO --color-surface (translucent); this repo's --color-surface is opaque */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
#ao-auth-modal .ao-modal-close:hover { background: rgba(237, 237, 237, 0.05); }
#ao-auth-modal .ao-modal-close-icon { width: 20px; height: 20px; display: block; }

/* Mascot + FREE pill (logoSection + mascot + freePill) */
#ao-auth-modal .ao-auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: var(--spacing-md);
  margin-top: -60px;                         /* mascot pops out the top edge */
  position: relative;
}
#ao-auth-modal .ao-auth-mascot { width: 200px; height: 200px; object-fit: contain; position: relative; z-index: 10; }
#ao-auth-modal .ao-auth-mascot-sent { width: 160px; height: 200px; object-fit: contain; }
#ao-auth-modal .ao-auth-free {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(20px, 60px);
  background: linear-gradient(135deg, var(--color-danger) 0%, #ee5a6f 100%);
  color: var(--ivory);
  font-family: var(--font-montra);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  padding: 6px var(--spacing-md);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  z-index: 11;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  animation: aoAuthPulse 2s ease-in-out infinite;
}
@keyframes aoAuthPulse {
  0%, 100% { transform: translate(20px, 60px) scale(1); }
  50%      { transform: translate(20px, 60px) scale(1.05); }
}

/* Headings (mainHeading 20px, subHeading 24px, highlight = sundrop) */
#ao-auth-modal .ao-auth-headings { text-align: center; padding: 0 var(--spacing-mlg, 20px); margin-bottom: var(--spacing-lg); }
#ao-auth-modal .ao-auth-h1 { font-family: var(--font-montra); font-size: 20px; color: var(--color-text-primary); margin: 0 0 var(--spacing-xs); line-height: 1.3; letter-spacing: 0.02em; }
#ao-auth-modal .ao-auth-hl { color: var(--sundrop); font-size: 20px; }
#ao-auth-modal .ao-auth-h2 { font-family: var(--font-montra); font-size: 24px; color: var(--color-text-primary); margin: 0; line-height: 1.3; letter-spacing: 0.02em; }

/* Body groups (formBody) */
#ao-auth-modal .ao-auth-body { display: flex; flex-direction: column; gap: var(--spacing-sm); padding: 0 var(--spacing-mlg, 20px); }

/* Email input — Input .wrapper (bordered rounded box, icon + field inside) */
#ao-auth-modal .ao-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;                     /* AO leaves ~10px between the 16px envelope and the text (text starts ~43px in) */
  padding: var(--spacing-md);
  border: var(--border-normal) solid var(--pebble-15);   /* --color-border-subtle */
  background: transparent;
  border-radius: 24px;                                    /* --radius-3xl */
  transition: all 0.3s ease;
}
#ao-auth-modal .ao-input-wrap:focus-within { border-color: var(--color-accent); background: var(--pebble-10); }
#ao-auth-modal .ao-input-icon { width: 18px; height: 18px; color: var(--color-text-primary); flex-shrink: 0; }
#ao-auth-modal .ao-form-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-primary);
  padding: 0;
}
#ao-auth-modal .ao-form-input::placeholder { color: var(--color-text-tertiary); }

/* Continue — Button primary (pebble bg / charcoal text) */
#ao-auth-modal .ao-btn-email {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--pebble);
  color: var(--charcoal);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  font-size: 16px;
  line-height: 1.6;                 /* AO: 25.6px line box → 42px tall button */
  cursor: pointer;
  transition: opacity 0.3s ease;
}
#ao-auth-modal .ao-btn-email:hover { opacity: 0.8; }

/* OR divider */
#ao-auth-modal .ao-modal-or {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-md) var(--spacing-mlg, 20px);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}
#ao-auth-modal .ao-modal-or::before,
#ao-auth-modal .ao-modal-or::after { content: ''; flex: 1; height: 1px; background: var(--pebble-20); }

/* OAuth buttons (Google + Discord) — Button variant="oauth" */
#ao-auth-modal .ao-btn-google,
#ao-auth-modal .ao-btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  color: var(--ivory);
  border: var(--border-normal) solid var(--pebble-20);   /* AO --color-border = rgba(pebble,0.2), not this repo's opaque global */
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  font-size: 16px;
  line-height: 1.6;                 /* AO: 25.6px line box → 44px tall (with 1px border) */
  cursor: pointer;
  transition: background 0.3s ease;
}
#ao-auth-modal .ao-btn-google:hover,
#ao-auth-modal .ao-btn-oauth:hover { background: var(--pebble-10); }

/* Marketing opt-in checkbox (marketingCheckbox) */
#ao-auth-modal .ao-marketing {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
}
#ao-auth-modal .ao-marketing input[type="checkbox"] {
  width: 12px;
  height: 12px;
  cursor: pointer;
  accent-color: var(--color-primary);   /* undefined like AO → browser-default accent (measured: auto) */
}
#ao-auth-modal .ao-marketing-text { font-size: 12px; color: var(--color-text-secondary); }

/* Email-sent view (renderEmailSentForm) */
#ao-auth-modal .ao-auth-sent { text-align: center; align-items: center; padding: 0 var(--spacing-mlg, 20px) var(--spacing-md); }
#ao-auth-modal .ao-auth-sent-msg { text-transform: uppercase; font-family: var(--font-montra); font-size: 36px; line-height: 30px; margin: var(--spacing-md) 0 var(--spacing-sm); }
#ao-auth-modal .ao-auth-sent-hint { color: var(--color-text-secondary); margin: 0; }

/* Mobile: full-width bottom sheet, rounded top only (AO base.module.css @media 640) */
@media (max-width: 640px) {
  #ao-auth-modal { align-items: flex-end; padding: 0; }
  #ao-auth-modal .ao-modal-box {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    border-radius: 32px 32px 0 0;
    padding-bottom: var(--spacing-xl);
  }
}

/* ── Search modal (pop) — 1:1 port of animeoshi-web SearchModal + Search/* ───
   Full-screen sheet on mobile, centered 720×min(900,92vh) card on desktop.
   Opened by the header search (site-chrome), built client-side by searchModal.ts.
   Scoped token pins mirror AO where the SSG tokens diverge (button=pebble not
   sundrop; radius-4xl/blur-md/border-light not global). */
#ao-search-modal {
  --aos-border-light: rgba(237, 237, 237, 0.1);
  --aos-surface-t: var(--pebble-10);
  /* --font-size-* aren't defined globally (only in page-scoped maps like
     .aof-footer / .aep-page). The modal is appended to <body>, so without these
     pins var(--font-size-sm)/xs are undefined and every text element falls back
     to the inherited ~16px body size — making the recent-search heading (sm) and
     chips (xs) render bigger than AO. Pin AO's fixed scale (xs12/sm14/md16/xl20). */
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  align-items: stretch;
  justify-content: center;
  background: var(--color-bg);
}
#ao-search-modal.open { display: flex; animation: ao-modal-fade 0.2s ease; }
.aos-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: var(--color-bg);
  overflow: hidden;
  isolation: isolate;
  animation: ao-modal-rise-sm 0.4s cubic-bezier(0.16, 1, 0.3, 1);   /* AO SearchModal 24px rise */
}

/* Header (SearchHeader) */
.aos-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  box-sizing: border-box;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(180deg, hsl(271 45% 22%) 0%, hsl(271 45% 16%) 70%, hsl(271 45% 12%) 100%);
}
.aos-header-inner { display: flex; align-items: center; gap: var(--spacing-md); width: 100%; max-width: 960px; margin: 0 auto; }
.aos-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: transparent; border: none; color: var(--color-text-primary); cursor: pointer; flex-shrink: 0; }
.aos-back svg { width: 24px; height: 24px; }
.aos-form { display: flex; align-items: center; gap: var(--spacing-sm); flex: 1; min-width: 0; }
.aos-input-wrap {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 0; height: 44px;
  padding: 0 var(--spacing-md); background: var(--pebble-15); border-radius: var(--radius-full);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.aos-search-icon { width: 18px; height: 18px; color: var(--pebble-50); flex-shrink: 0; margin-right: var(--spacing-sm); }
.aos-input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-sm); outline: none; }
.aos-input::placeholder { color: var(--pebble-50); }
.aos-input::-webkit-search-cancel-button { display: none; }
.aos-clear { display: none; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: var(--spacing-sm); padding: 0; background: var(--pebble-20); border: none; border-radius: var(--radius-full); color: var(--charcoal); cursor: pointer; flex-shrink: 0; }
.aos-clear svg { width: 14px; height: 14px; }
.aos-clear.show { display: inline-flex; }
.aos-submit { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 var(--spacing-lg); background: var(--pebble); color: var(--charcoal); border: none; border-radius: var(--radius-full); font-family: var(--font-body); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); cursor: pointer; flex-shrink: 0; transition: opacity 0.2s ease; }
.aos-submit:hover { opacity: 0.85; }

/* Tabs (SearchTabs) */
.aos-tabs-row { width: 100%; max-width: 960px; margin: 0 auto; background: var(--color-bg); }
.aos-tabs-row[hidden] { display: none; }
.aos-tabs { display: flex; flex-wrap: nowrap; gap: var(--spacing-sm); width: 100%; padding: var(--spacing-sm); overflow-x: auto; scrollbar-width: none; box-sizing: border-box; }
.aos-tabs::-webkit-scrollbar { display: none; }
.aos-tab { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--spacing-md); background: var(--color-surface); color: var(--color-text-primary); border: var(--border-normal) solid var(--color-border); border-radius: var(--radius-full); font-family: var(--font-body); font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.aos-tab:hover { background: var(--aos-surface-t); }
.aos-tab.active { background: var(--pebble); color: var(--charcoal); border-color: var(--pebble); }

/* Body */
.aos-body { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: var(--spacing-md); display: flex; flex-direction: column; gap: var(--spacing-lg); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
.aos-body::-webkit-scrollbar { display: none; }

/* Results (SearchResultsList) */
.aos-results { display: flex; flex-direction: column; gap: var(--spacing-md); width: 100%; }
.aos-section { width: 100%; }
.aos-section-title { margin: 0 0 var(--spacing-sm); color: var(--color-text-primary); font-family: var(--font-montra), sans-serif; font-size: var(--font-size-md); font-weight: var(--font-weight-normal); text-transform: uppercase; }
.aos-section-list { display: flex; flex-direction: column; }
.aos-row { display: flex; align-items: center; gap: var(--spacing-md); width: 100%; padding: var(--spacing-md) 0; background: transparent; border: none; border-top: var(--border-normal) solid var(--aos-border-light); color: var(--color-text-primary); font-family: var(--font-body); text-align: left; cursor: pointer; transition: background 0.15s ease; }
.aos-row:first-child { border-top: 0; }
.aos-row:hover { background: var(--aos-surface-t); }
.aos-cover, .aos-cover-tile, .aos-avatar { flex-shrink: 0; position: relative; overflow: hidden; }
.aos-cover { width: 64px; height: 84px; border-radius: var(--radius-md); }
.aos-cover img, .aos-cover-tile img, .aos-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aos-cover-group { display: flex; align-items: center; gap: var(--spacing-xs); flex-shrink: 0; }
.aos-cover-tile { width: 48px; height: 66px; border-radius: var(--radius-md); background: var(--pebble-10); }
.aos-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--pebble-10); }
.aos-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--spacing-sm); }
.aos-row-title { margin: 0; color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aos-meta-pills { display: flex; flex-wrap: wrap; gap: var(--spacing-xs); }
.aos-meta-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--spacing-sm); background: var(--aos-surface-t); border-radius: var(--radius-full); color: var(--color-text-secondary); font-size: var(--font-size-xs); white-space: nowrap; }
.aos-score { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; flex-shrink: 0; gap: 2px; }
.aos-score-val { color: var(--color-accent); font-family: var(--font-montra), sans-serif; font-size: var(--font-size-xl); font-weight: var(--font-weight-medium); line-height: 1; }
.aos-fans { color: var(--color-text-secondary); font-size: var(--font-size-xs); }
.aos-creator { display: inline-flex; align-items: center; gap: var(--spacing-xs); color: var(--color-text-secondary); font-size: var(--font-size-xs); min-width: 0; }
.aos-creator-avatar { display: inline-flex; width: 16px; height: 16px; border-radius: var(--radius-full); overflow: hidden; flex-shrink: 0; }
.aos-creator-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aos-creator-name { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aos-user-meta { display: flex; align-items: center; gap: var(--spacing-sm); flex-shrink: 0; }
.aos-vibe { display: inline-flex; align-items: center; padding: 2px var(--spacing-sm); background: var(--pebble-10); color: var(--kawaii-core, var(--color-accent)); border-radius: var(--radius-full); font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); }
.aos-reviews { padding: 2px var(--spacing-sm); background: var(--aos-surface-t); color: var(--color-text-secondary); border-radius: var(--radius-full); font-size: var(--font-size-xs); }
.aos-viewall { display: inline-flex; align-items: center; justify-content: center; gap: var(--spacing-xs); width: 100%; margin-top: var(--spacing-sm); padding: var(--spacing-md); background: transparent; border: none; border-top: var(--border-normal) solid var(--aos-border-light); color: var(--color-accent); font-family: var(--font-body); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); cursor: pointer; }
.aos-viewall:hover { opacity: 0.85; }
.aos-viewall svg { width: 16px; height: 16px; }
.aos-loading { width: 100%; padding: var(--spacing-3xl); text-align: center; color: var(--color-text-secondary); font-size: var(--font-size-sm); box-sizing: border-box; }

/* Trending (TrendingSearches) */
.aos-trending { width: 100%; padding: var(--spacing-lg) var(--spacing-md); background: var(--color-surface); border-radius: var(--radius-lg); border: var(--border-normal) solid var(--aos-border-light); box-sizing: border-box; }
.aos-trending-title { margin: 0 0 var(--spacing-sm); padding: 0 var(--spacing-sm); color: var(--color-text-primary); font-family: var(--font-montra), sans-serif; font-size: var(--font-size-md); font-weight: var(--font-weight-normal); text-transform: uppercase; }
.aos-trend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.aos-trend-row { width: 100%; border-top: var(--border-normal) solid var(--aos-border-light); }
.aos-trend-row:first-child { border-top: 0; }
.aos-trend-btn { display: flex; align-items: center; gap: var(--spacing-md); width: 100%; padding: var(--spacing-md) var(--spacing-sm); background: transparent; border: none; color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-md); text-align: left; cursor: pointer; transition: background 0.15s ease; }
.aos-trend-btn:hover { background: var(--aos-surface-t); }
.aos-trend-rank { flex-shrink: 0; width: 28px; font-weight: var(--font-weight-bold); }
.aos-trend-query { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aos-trend-boost { display: inline-flex; align-items: center; gap: var(--spacing-xs); padding: 2px var(--spacing-sm); background: hsl(23 100% 50% / 0.15); color: var(--peach-spark); border-radius: var(--radius-full); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); white-space: nowrap; }

/* Recent (RecentSearches) */
.aos-recent { width: 100%; padding: 0 var(--spacing-sm); }
.aos-recent-head { display: flex; align-items: center; justify-content: space-between; padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-md); }
.aos-recent-heading { display: inline-flex; align-items: center; gap: var(--spacing-sm); color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-sm); }
.aos-recent-heading svg { width: 16px; height: 16px; color: var(--color-text-secondary); }
.aos-recent-clear { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: transparent; border: none; color: var(--color-text-secondary); cursor: pointer; transition: color 0.15s ease; }
.aos-recent-clear:hover { color: var(--color-text-primary); }
.aos-recent-clear svg { width: 18px; height: 18px; }
.aos-recent-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--spacing-sm); }
.aos-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--spacing-md); background: transparent; color: var(--color-text-primary); border: var(--border-normal) solid var(--color-border); border-radius: var(--radius-full); font-family: var(--font-body); font-size: var(--font-size-xs); cursor: pointer; transition: background 0.15s ease; }
.aos-chip:hover { background: var(--color-surface); }

/* No results */
.aos-noresults { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--spacing-lg); width: 100%; padding: 72px var(--spacing-md); text-align: center; box-sizing: border-box; }
.aos-noresults svg { width: 72px; height: 72px; opacity: 0.6; color: var(--color-text-secondary); }
.aos-noresults p { margin: 0; color: var(--color-text-secondary); font-family: var(--font-body); font-size: var(--font-size-md); }

@media (min-width: 768px) {
  #ao-search-modal { align-items: flex-start; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .aos-sheet { max-width: 720px; height: min(900px, 92vh); margin: var(--spacing-xl) auto; border-radius: 32px; border: var(--border-normal) solid rgba(237, 237, 237, 0.2); }
  .aos-header { padding: var(--spacing-lg) var(--spacing-xl); }
  .aos-input { font-size: var(--font-size-md); }
  .aos-input-wrap, .aos-submit { height: 48px; }
  .aos-submit { padding: 0 var(--spacing-xl); }
  .aos-tabs-row { padding: 0 var(--spacing-xl); }
  .aos-body { padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-3xl); gap: var(--spacing-xl); }
  .aos-results { gap: var(--spacing-lg); }
  .aos-cover { width: 80px; height: 110px; }
  .aos-cover-tile { width: 56px; height: 78px; }
  .aos-avatar { width: 48px; height: 48px; }
}

/* ────────────────────────────────────────────────────────────────────────
   Settings (UserProfile) modal — 1:1 port of animeoshi-web's SettingsGear →
   UserProfile modal (Modal/UserProfile + BaseModal `userProfile` variant).
   Sitewide (rendered in Layout, opened by the header gear #aoh-gear), so it
   lives OUTSIDE any page token-map: page-scoped/absent tokens are resolved to
   their AO values here (--font-display → --font-montra; --radius-4xl 32px;
   --modal-header-padding 16px 20px; --modal-padding 20px; --color-surface-15
   → pebble-15; header bg hsl(271 45% 34%) from --charcoal-h/s). Prefix aost-.
   This pass: shell + default "Settings" list view; sub-views open a stub. */
/* ── Modal open animation (mirrors animeoshi-web BaseModal / SearchModal) ──────
   Overlay fades in; the box slides up. BaseModal modals (settings, rate) slide a
   full height up from the bottom (AO `y:"100%"→0`, spring 300/30); the search
   modal does a subtle 24px rise (AO SearchModal `y:24→0`). Keyframes, not
   transitions, because these modals toggle `display:none↔flex` via `.open`.
   Shared by episode.css (#ao-rate-modal). */
@keyframes ao-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ao-modal-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ao-modal-rise-sm { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  /* !important so this wins over the per-modal rules below AND episode.css's
     .ao-rate-box (which loads after this file). */
  #ao-settings-modal.open, #ao-search-modal.open, #ao-rate-modal.open,
  .aost-modal, .aos-sheet, .ao-rate-box { animation: none !important; }
}
#ao-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;                              /* BaseModal .overlay */
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);             /* --color-overlay-dark-80 */
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
}
#ao-settings-modal.open { display: flex; animation: ao-modal-fade 0.2s ease; }
.aost-modal {
  position: relative;
  background: var(--color-bg);
  border: none;
  border-radius: 32px;                        /* --radius-4xl */
  padding: 0;
  overflow: hidden;                           /* clip children to the 32px radius */
  max-height: 90dvh;                          /* never exceed the viewport */
  display: flex;
  animation: ao-modal-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);   /* AO BaseModal slide-up */
}
.aost-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  text-align: center;
  width: min(450px, 92vw);
  max-height: 90dvh;
}
.aost-view { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.aost-view::-webkit-scrollbar { display: none; }

/* Header (modalHeader + backButton + headerTitle) */
.aost-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 16px 20px;                         /* --modal-header-padding: spacing-md spacing-mlg */
  background: hsl(271 45% 34%);               /* hsl(--charcoal-h --charcoal-s 34%) */
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  flex-shrink: 0;
}
.aost-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text-primary);
  cursor: pointer;
}
.aost-title {
  margin: 0;
  font-size: 16px;                            /* --font-size-base */
  font-family: var(--font-montra), sans-serif; /* --font-display (absent here) */
  font-weight: 400;
  text-align: left;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* View container + default content (profileContent) */
.aost-view { width: 100%; min-height: 0; flex: 1 1 auto; }
.aost-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: 20px;                              /* --modal-padding */
}
/* [hidden] alone loses to .aost-content{display:flex} (author > UA); this wins. */
.aost-content[hidden], #ao-settings-subview[hidden] { display: none; }

/* Settings list */
.aost-list { display: flex; flex-direction: column; gap: var(--spacing-sm); width: 100%; }
.aost-item {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);            /* 8px */
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  gap: var(--spacing-sm);
  color: var(--color-text-primary);
}
.aost-item:hover { transform: translateY(-1px); }
.aost-item-icon { width: 30px; height: 30px; margin-right: var(--spacing-sm); flex-shrink: 0; }
.aost-item-title { font-size: clamp(16px, 13px + 0.1786vw, 18px); font-weight: 600; color: var(--color-text-primary); } /* --p-large-font-size */
.aost-item-chevron { margin-left: auto; flex-shrink: 0; color: var(--color-text-secondary); display: inline-flex; }

/* Referral + policy cards (referralCard/referralBlock/referralHeader/...) */
.aost-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  box-sizing: border-box;
}
#ao-settings-referral:empty { display: none; } /* no referral (signed out) → don't occupy a flex gap */
.aost-card-referral { margin-top: calc(var(--spacing-sm) - var(--spacing-lg)); } /* AO pulls the referral card up */
.aost-refblock { display: flex; flex-direction: column; gap: var(--spacing-xs); }
.aost-refhead { display: flex; align-items: center; gap: var(--spacing-xs); color: var(--color-text-primary); text-decoration: none; }
.aost-refhead img, .aost-refhead svg { flex-shrink: 0; }
.aost-reflabel { font-size: clamp(12px, 11px + 0.1786vw, 16px); font-weight: 600; color: var(--color-text-primary); } /* --p-font-size */
.aost-refrow {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 var(--spacing-md);
  background: var(--color-bg);
  border: none;
  border-radius: var(--radius-max);           /* 100px */
  box-sizing: border-box;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.aost-refval { flex: 1 1 0; min-width: 0; font-family: var(--font-body); font-size: 16px; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aost-refcopy { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; color: var(--color-text-secondary); transition: color 0.15s ease; }
.aost-refrow:hover .aost-refcopy { color: var(--color-text-primary); }

/* Logo + version (logoSection/logo/toggleDescription) */
.aost-logo-sec { display: flex; justify-content: center; align-items: center; padding: var(--spacing-sm) 0; margin-top: var(--spacing-sm); }
.aost-logo { width: 80px; height: 32px; opacity: 0.6; transition: opacity 0.2s ease; }
.aost-logo:hover { opacity: 0.8; }
.aost-version { margin: 0; font-size: var(--font-size-sm); color: var(--color-text-secondary); }

/* Close button (X) — shown only on the account view (AO BaseModal close) */
.aost-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: var(--color-surface); border: none; border-radius: var(--radius-full);
  color: var(--color-text-primary); cursor: pointer;
}
.aost-close:hover { background: rgba(237, 237, 237, 0.12); }

/* ── shared form primitives (userProfile.module.css) ── */
.aost-vc { display: flex; flex-direction: column; padding: 20px; }
.aost-fg { display: flex; flex-direction: column; gap: var(--spacing-xs); margin-bottom: var(--spacing-md); }
.aost-labelrow { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); }
.aost-label { font-size: clamp(12px, 11px + 0.1786vw, 16px); font-weight: 600; color: var(--color-text-primary); text-align: left; }
.aost-charcount { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.aost-input {
  width: 100%; box-sizing: border-box;
  padding: var(--spacing-sm) var(--spacing-md);
  border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface); color: var(--color-text-primary);
  font-size: clamp(12px, 11px + 0.1786vw, 16px); font-family: var(--font-body);
  transition: border-color 0.2s ease;
}
.aost-input:focus { outline: none; border-color: var(--pebble); }
.aost-input-ok { border-color: var(--color-success); }
.aost-input-err { border-color: var(--color-danger); }
.aost-textarea { resize: none; overflow: hidden; line-height: 1.4; border-radius: var(--radius-lg); }
.aost-input-iconwrap { position: relative; width: 100%; }
.aost-input-icon { position: absolute; right: var(--spacing-md); top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.aost-input-icon .aost-input-ok, .aost-input-ok ~ .aost-input-icon { color: var(--color-success); }
.aost-input-iconwrap .aost-input { padding-right: calc(var(--spacing-md) + 20px + var(--spacing-md)); }
.aost-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--color-border); border-top-color: var(--pebble); border-radius: 50%; animation: aost-spin 1s linear infinite; }
.aost-spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes aost-spin { to { transform: rotate(360deg); } }

/* save / primary button (AO Button primary = pebble bg, charcoal text) */
.aost-save { width: 100%; border-radius: var(--radius-full); padding: var(--spacing-sm) var(--spacing-lg); background: var(--pebble); color: var(--charcoal); border: none; font-family: var(--font-body); font-size: clamp(16px, 13px + 0.1786vw, 18px); font-weight: 600; cursor: pointer; transition: opacity 0.2s ease; }
.aost-save:hover:not(:disabled) { opacity: 0.88; }
.aost-save:disabled { opacity: 0.5; cursor: not-allowed; }
.aost-actions { padding-top: var(--spacing-md); margin-top: var(--spacing-md); }

/* avatar (shared) */
.aost-avatar { position: relative; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--pebble-10, rgba(237,237,237,0.1)); display: inline-flex; align-items: center; justify-content: center; }
.aost-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aost-avatar-fallback { color: var(--color-text-primary); font-family: var(--font-montra), sans-serif; font-size: 2rem; }

/* ── ACCOUNT view ── */
.aost-account-avatar { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-md) var(--spacing-lg) 0; }
.aost-edit-avatar { display: inline-flex; align-items: center; gap: var(--spacing-xs); padding: 6px 14px; border-radius: var(--radius-full); border: none; background: var(--color-surface); color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; }
.aost-edit-avatar:hover { background: rgba(237, 237, 237, 0.05); }
.aost-edit-avatar:active { transform: scale(0.97); }
.aost-edit-avatar-ic { display: inline-flex; align-items: center; }
.aost-social-list { display: flex; flex-direction: column; gap: var(--spacing-sm); margin-top: var(--spacing-xs); }
.aost-social-row { display: flex; align-items: stretch; gap: var(--spacing-sm); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-sm); }
.aost-social-pill { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: var(--radius-full); background: var(--pebble-15); color: var(--color-text-primary); font-size: var(--font-size-sm); font-weight: 600; flex-shrink: 0; }
.aost-social-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--color-text-primary); font-size: clamp(12px, 11px + 0.1786vw, 16px); font-family: var(--font-body); padding: 0 var(--spacing-xs); }
.aost-social-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); border: none; background: transparent; color: var(--color-text-secondary); cursor: pointer; flex-shrink: 0; transition: background 0.2s ease, color 0.2s ease; }
.aost-social-remove:hover { background: hsl(0 70% 60% / 0.08); color: var(--color-danger); }
.aost-social-chiprow { display: flex; flex-wrap: wrap; gap: var(--spacing-xs); margin-top: var(--spacing-sm); }
.aost-social-chip { display: inline-flex; align-items: center; gap: var(--spacing-xs); padding: var(--spacing-xs) 10px; border-radius: var(--radius-full); border: 1px solid var(--color-border); background: var(--pebble-15); color: var(--color-text-primary); font-family: var(--font-body); font-size: var(--font-size-sm); font-weight: 600; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; }
.aost-social-chip:hover { background: rgba(237, 237, 237, 0.05); }
.aost-social-chip:active { transform: scale(0.97); }
.aost-social-plus { font-size: 16px; line-height: 1; font-weight: 700; }

/* ── NOTIFICATIONS view (toggle switches) ── */
.aost-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-md); padding: var(--spacing-md); background: var(--color-surface); border: var(--border-normal) solid var(--color-border); border-radius: var(--radius-md); margin-bottom: var(--spacing-sm); }
.aost-toggle-info { display: flex; flex-direction: column; gap: var(--spacing-xs); text-align: left; }
.aost-toggle-label { font-size: 16px; font-weight: 600; color: var(--color-text-primary); }
.aost-toggle-desc { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.aost-toggle-switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.aost-toggle-switch input { opacity: 0; width: 0; height: 0; }
.aost-toggle-slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--color-border); transition: 0.3s; border-radius: 24px; }
.aost-toggle-slider::before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: var(--ivory); transition: 0.3s; border-radius: 50%; }
.aost-toggle-switch input:checked + .aost-toggle-slider { background-color: var(--color-accent); border: var(--border-normal) solid var(--color-bg); }
.aost-toggle-switch input:checked + .aost-toggle-slider::before { transform: translateX(22px); }
.aost-toggle-switch input:disabled + .aost-toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ── WATCHLIST / ADVANCED (danger zone) ── */
.aost-item-icon-x { display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-primary); }
.aost-danger { margin-top: var(--spacing-lg); padding: var(--spacing-lg); border: var(--border-normal) solid var(--color-danger); border-radius: var(--radius-md); background: hsl(0 70% 60% / 0.05); }
.aost-danger-title { margin: 0 0 var(--spacing-md); font-size: var(--font-size-lg); font-weight: 600; color: var(--color-danger); }
.aost-danger-btn .aost-item-title { color: var(--color-danger); }
.aost-danger-btn .aost-item-icon-x { color: var(--color-danger); }
.aost-confirm { text-align: center; padding: var(--spacing-md); }
.aost-confirm-msg { margin: 0 0 var(--spacing-lg); color: var(--color-text-primary); font-size: clamp(16px, 13px + 0.1786vw, 18px); line-height: 1.6; }
.aost-confirm-actions { display: flex; gap: var(--spacing-sm); justify-content: center; }
.aost-confirm-actions .aost-item { width: auto; padding: var(--spacing-sm) var(--spacing-lg); }

/* ── PFP SELECTOR view ── */
.aost-pfp { display: flex; flex-direction: column; gap: var(--spacing-lg); padding: var(--spacing-lg); }
.aost-pfp-loading { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.aost-pfp-avatar { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-md); padding-bottom: var(--spacing-lg); border-bottom: var(--border-normal) solid var(--color-border); }
.aost-pfp-actions { display: flex; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: var(--spacing-sm); }
.aost-pfp-actionbtn { display: inline-flex; align-items: center; gap: var(--spacing-xs); padding: 6px 14px; border-radius: var(--radius-full); border: none; background: var(--color-surface); color: var(--color-text-primary); font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; }
.aost-pfp-actionbtn:hover { background: rgba(237, 237, 237, 0.05); }
.aost-pfp-actionbtn:active { transform: scale(0.97); }
.aost-pfp-actionic { display: inline-flex; align-items: center; }
.aost-pfp-section { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-sm); }
.aost-pfp-sechead { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); width: 100%; max-width: calc(85px * 4 + var(--spacing-sm) * 3); }
.aost-pfp-sectitle { margin: 0; font-size: clamp(16px, 13px + 0.1786vw, 18px); font-weight: 600; color: var(--color-text-primary); }
.aost-pfp-seccount { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.aost-pfp-grid { display: grid; grid-template-columns: repeat(4, 85px); gap: var(--spacing-sm); justify-content: center; }
.aost-pfp-item { position: relative; width: 85px; height: 85px; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; border: var(--border-thick) solid transparent; padding: 0; background: none; transition: border-color 0.2s ease, opacity 0.2s ease; }
.aost-pfp-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aost-pfp-item:hover:not(.aost-pfp-locked) { border-color: var(--pebble); }
.aost-pfp-selected { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.aost-pfp-locked { cursor: not-allowed; opacity: 0.5; }
.aost-pfp-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); color: var(--ivory); }
.aost-pfp-empty { text-align: center; padding: var(--spacing-md); color: var(--color-text-secondary); font-size: var(--font-size-sm); }
.aost-pfp-confirm { margin-top: var(--spacing-sm); }

@media (max-width: 640px) {
  #ao-settings-modal { align-items: flex-end; }
  .aost-modal { width: 100%; max-height: 92dvh; border-radius: 32px 32px 0 0; }  /* base ao-modal-rise already slides up from the bottom edge here */
  .aost-container { width: 100vw; max-height: 92dvh; }
  .aost-header { border-top-left-radius: 32px; border-top-right-radius: 32px; }
}

/* ── Act-As / Official Accounts (header switcher, badge, banner, settings) ──
   Mirrors animeoshi-web's OfficialBadge / ActingAsBanner / SwitchAccountView. */
.aoh-official { color: var(--color-accent); flex-shrink: 0; vertical-align: -2px; margin-left: 3px; }

/* Header switcher: caret sits INSIDE the profile pill + dropdown below it. */
.aoh-actas { position: relative; display: inline-flex; align-items: center; }
.aoh-actas-caret {
  flex-shrink: 0; margin-left: 2px; color: var(--color-text-secondary);
  transition: transform 0.15s ease;
}
.aoh-actas-caret-open { transform: rotate(180deg); }
.aoh-actas-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 240px; max-width: 300px; padding: var(--spacing-xs);
  display: flex; flex-direction: column; gap: 2px;
  background: var(--charcoal); border: var(--border-normal) solid var(--pebble-15);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.aoh-actas-menu[hidden] { display: none; }
/* View profile item (mirrors AO dropdownItem). */
.aoh-actas-item {
  display: flex; align-items: center; gap: var(--spacing-sm);
  box-sizing: border-box; width: 100%; padding: var(--spacing-sm) var(--spacing-md);
  border: 0; border-radius: var(--radius-md); background: transparent;
  color: var(--color-text-primary); text-decoration: none; cursor: pointer;
  font-family: var(--font-body); transition: background 0.15s ease;
}
.aoh-actas-item:hover { background: var(--color-surface); }
.aoh-actas-item-icon { flex-shrink: 0; color: var(--color-text-primary); }
.aoh-actas-item-label { font-size: 0.875rem; font-weight: var(--font-weight-medium); color: var(--color-text-primary); white-space: nowrap; }
.aoh-actas-sep { height: 1px; margin: var(--spacing-2xs) var(--spacing-sm); background: var(--color-border); }
.aoh-actas-heading {
  margin: 0; padding: var(--spacing-2xs) var(--spacing-md);
  font-size: var(--p-small-font-size); color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.aoh-actas-row {
  display: flex; align-items: center; gap: var(--spacing-sm);
  box-sizing: border-box; width: 100%; padding: var(--spacing-sm) var(--spacing-md); border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--color-text-primary); text-align: left; cursor: pointer;
  font-family: var(--font-body); transition: background 0.15s ease;
}
.aoh-actas-row:hover { background: var(--color-surface); }
.aoh-actas-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--pebble-10); }
.aoh-actas-meta { display: flex; flex-direction: column; gap: var(--spacing-2xs); min-width: 0; flex: 1; }
.aoh-actas-name { display: inline-flex; align-items: center; gap: var(--spacing-xs); font-size: 0.875rem; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aoh-actas-handle { font-size: var(--p-small-font-size); color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aoh-actas-check { margin-left: auto; color: var(--color-accent); flex-shrink: 0; }
.aoh-actas-row-active { background: transparent; }
/* Acting: accent border on the nav pill (mirrors profileButtonActing). */
.aoh-profile-acting { border-color: var(--color-accent); }

/* "Posting as X" banner — compact pill centered below the header (mirrors
   animeoshi's ActingAsBanner: charcoal fill, accent hairline, fully rounded). */
.ao-actas-banner {
  position: fixed; top: calc(var(--header-height) + var(--spacing-xs)); left: 50%; transform: translateX(-50%);
  z-index: 45; box-sizing: border-box;
  display: flex; align-items: center; gap: var(--spacing-sm);
  width: max-content; max-width: calc(100vw - 2 * var(--spacing-md));
  padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) var(--spacing-xs);
  background: var(--charcoal); border: 1px solid var(--color-accent);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
}
.ao-actas-banner-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--pebble-10); }
.ao-actas-banner-text {
  font-size: 0.8125rem; color: var(--color-text-primary);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ao-actas-banner-text strong { font-size: inherit; font-weight: var(--font-weight-semibold); color: inherit; }
.ao-actas-banner-official { color: var(--color-accent); flex-shrink: 0; }
.ao-actas-banner-exit {
  display: inline-flex; align-items: center; gap: var(--spacing-xs);
  padding: 3px var(--spacing-sm); border: 1px solid var(--pebble-20); border-radius: var(--radius-full);
  background: transparent; color: var(--color-text-primary);
  font-family: inherit; font-size: 0.8125rem; font-weight: var(--font-weight-semibold);
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
  transition: background 0.2s ease;
}
.ao-actas-banner-exit:hover { background: var(--pebble-10); }

/* Settings → Switch Account view. */
.aost-item-icon-svg { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: var(--color-text-primary); }

.aost-item-actingtag {
  margin-left: auto; flex-shrink: 0;
  padding: 2px 8px; border-radius: 9999px;
  background: hsla(68, 100%, 50%, 0.3); color: var(--color-text-primary);
  font-size: clamp(10px, 9px + 0.1786vw, 12px); font-weight: 600;
  white-space: nowrap;
}
.aost-switchacct { display: flex; flex-direction: column; gap: var(--spacing-md); }
.aost-switchacct-hint { margin: 0; font-size: var(--font-size-sm, 0.875rem); color: var(--color-text-secondary); line-height: 1.4; }
.aost-switchacct-list { display: flex; flex-direction: column; gap: var(--spacing-xs); }
.aost-switchacct-row {
  display: flex; align-items: center; gap: var(--spacing-md);
  width: 100%; padding: var(--spacing-md); border: var(--border-normal) solid transparent;
  border-radius: var(--radius-lg); background: var(--color-surface);
  color: var(--color-text-primary); text-align: left; cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.aost-switchacct-row:hover { background: var(--pebble-10); }
.aost-switchacct-row-active { border-color: var(--color-accent); }
.aost-switchacct-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.aost-switchacct-name { display: inline-flex; align-items: center; font-size: 1rem; font-weight: var(--font-weight-semibold); color: var(--color-text-primary); }
.aost-switchacct-official { color: var(--color-accent); margin-left: 4px; flex-shrink: 0; vertical-align: -2px; }
.aost-switchacct-handle { font-size: var(--font-size-sm, 0.875rem); color: var(--color-text-secondary); }
.aost-switchacct-check { color: var(--color-accent); flex-shrink: 0; margin-left: auto; }

/* ── Reusable Share sheet (AO ShareProfile) — src/lib/shareModal.ts ──────────
   Sitewide so any page can open it via window.AOShareModal.open(). */
.aoshare { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.6); }
.aoshare[hidden] { display: none; }
.aoshare-box { display: flex; flex-direction: column; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; background: #170d21; border-radius: 16px 16px 0 0; box-sizing: border-box; }
.aoshare-header { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px 20px; border-bottom: 1px solid rgba(237, 237, 237, 0.2); }
.aoshare-title { margin: 0; font-family: var(--font-montra), var(--font-body); font-size: 18px; line-height: 22px; text-transform: uppercase; color: rgb(237, 237, 237); text-align: center; }
.aoshare-close { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); padding: 4px; border: 0; background: none; color: rgba(237, 237, 237, 0.7); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s ease; }
.aoshare-close:hover { color: rgb(237, 237, 237); }
.aoshare-body { padding: 20px; }
.aoshare-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; justify-items: center; }
.aoshare-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 65px; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; }
.aoshare-cell:hover .aoshare-icon { transform: translateY(-1px); }
.aoshare-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; transition: transform 0.15s ease; }
.aoshare-icon svg { display: block; width: 40px; height: 40px; }
.aoshare-icon-copy { background: var(--color-accent, #ddff00); color: #170d21; }
.aoshare-icon-copy svg { width: 22px; height: 22px; }
.aoshare-label { font-family: var(--font-body); font-size: 14px; font-weight: 500; line-height: 18px; color: rgba(237, 237, 237, 0.7); text-align: center; }
@media (min-width: 768px) {
  .aoshare { align-items: center; }
  .aoshare-box { border-radius: 16px; max-height: 80vh; }
}

/* ================================================================
   OSHIRANK ONBOARDING MODAL  (aoob-)
   1:1 port of animeoshi-web Modal/OshiRankOnboarding + the reused
   Modal/OshiRank ResultStep/Podium + Commons HalfStarRow/SelectedPickTray.
   Built in JS by src/lib/onboardingModal.ts, appended to <body>, opened
   via window.AOOnboarding. Sitewide (ships on every page); auto-open is
   armed only on episode + rating pages.

   `.aoob-overlay` carries a SCOPED TOKEN MAP: this repo's vendored
   tokens.css omits many AO tokens (--font-display, --color-modal-bg,
   --font-size-*, --spacing-2xs/smd/mlg, --pebble-40, --surface-5/10,
   --sundrop-h/s/l, overlay tints). Values mirror AO's fixed scale
   (xs12/sm14/md16/base16/xl20/2xl24) and this repo's real token values.
   ================================================================ */
.aoob-overlay {
  --font-display: var(--font-montra);
  /* AO: --color-modal-bg = --charcoal (hsl 271 45% 9%). Do NOT map to
     --color-surface (lighter 271 35% 13%) — the panel must read darker. */
  --color-modal-bg: var(--charcoal);
  /* AO text colors are pebble-at-alpha (bright off-white), but this repo's
     tokens.css defines them as opaque flat greys (65%/42%) that read duller.
     Override to AO's --pebble-80 / --pebble-50 (primary already = --pebble). */
  --color-text-secondary: hsla(0, 0%, 93%, 0.80);
  --color-text-tertiary: var(--pebble-50);
  --color-surface-5: var(--pebble-5);
  --color-surface-10: var(--pebble-10);
  --pebble-40: hsla(0, 0%, 93%, 0.40);
  --color-overlay-dark-80: rgba(0, 0, 0, 0.80);
  --color-overlay-light-5: hsla(0, 0%, 93%, 0.05);
  --sundrop-h: 68;
  --sundrop-s: 100%;
  --sundrop-l: 50%;
  --spacing-2xs: 2px;
  --spacing-smd: 12px;
  --spacing-mlg: 20px;
  --font-size-2xs: 10px;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-md: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --tab-hover-bg: var(--pebble-10);

  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay-dark-80);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
}
.aoob-overlay[hidden] { display: none; }

/* shared: images that AO renders with next/image `fill` (abs-positioned cover) */
.aoob-fill-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── modal container + variants (base.module.css) ─────────────────── */
.aoob-modal {
  position: relative;
  width: min(400px, 95vw);
  height: clamp(508px, 82dvh, 760px);
  max-height: 96dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-modal-bg);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.aoob-modal > * { flex: 1 1 auto; min-height: 0; }

.aoob-modal.aoob-modal--wide {
  width: min(800px, 95vw);
  height: 400px;
}
.aoob-modal.aoob-modal--duel {
  width: min(900px, 92vw);
  max-height: 96dvh;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.aoob-modal.aoob-modal--reveal {
  width: min(400px, 95vw);
  height: auto;
  max-height: 96dvh;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: var(--color-modal-bg);
}

/* close button (base .closeWrapper/.closeButton) */
.aoob-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  z-index: 5;
}
.aoob-modal--reveal .aoob-close,
.aoob-modal--duel .aoob-close {
  background: var(--color-surface-5);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
}
.aoob-close svg { width: 18px; height: 18px; display: block; }

/* ── shell scaffold (oshiRankOnboarding.module.css) ───────────────── */
.aoob-shell {
  --step-inset: var(--spacing-mlg);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--color-modal-bg);
  text-align: left;
}
.aoob-shell-splash .aoob-chrome {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}
.aoob-chrome {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-smd);
  padding: var(--spacing-smd) var(--step-inset) 0;
  flex: 0 0 auto;
}
.aoob-skip {
  align-self: flex-end;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 20px;
  color: var(--color-text-tertiary);
}
.aoob-skip:hover { color: var(--color-text-primary); }

.aoob-progress { display: flex; gap: 2px; height: 5px; }
.aoob-progress-seg {
  flex: 1 0 0;
  min-width: 1px;
  height: 100%;
  border-radius: 2px;
  background: var(--pebble-20);
}
.aoob-progress-seg.is-done { background: var(--color-text-primary); }
.aoob-progress-seg.is-current { background: var(--color-text-tertiary); }

.aoob-step {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-mlg);
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--spacing-mlg) 0 0;
}
.aoob-step-header {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding-inline: var(--step-inset);
  text-align: center;
}
.aoob-step-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 23px;
  text-transform: uppercase;
  color: var(--color-text-primary);
}
.aoob-step-subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--color-text-secondary);
}
.aoob-step-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-inline: var(--step-inset);
  padding-bottom: var(--footer-height, 0px);
  scrollbar-width: none;
}
.aoob-step-scroll::-webkit-scrollbar { display: none; }
.aoob-list-end { height: 1px; }
.aoob-empty {
  margin: var(--spacing-lg) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  text-align: center;
}
.aoob-error {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-danger);
  text-align: center;
}
.aoob-footer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-smd);
  flex: 0 0 auto;
  padding: var(--spacing-smd) var(--step-inset) var(--spacing-mlg);
  background: var(--color-modal-bg);
}
.aoob-footer-glass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--charcoal-70);
  -webkit-backdrop-filter: blur(var(--blur-xl));
  backdrop-filter: blur(var(--blur-xl));
  border-top: var(--border-normal) solid var(--color-border-light);
}
.aoob-cap-note {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  text-align: center;
}
.aoob-cta {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  padding-inline: var(--spacing-lg);
  border: 0;
  border-radius: var(--radius-max);
  background: var(--color-text-primary);
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 20px;
  color: var(--color-bg);
}
.aoob-cta:disabled { opacity: 0.2; cursor: default; }

/* ── splash ───────────────────────────────────────────────────────── */
.aoob-splash {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "logo" "art" "copy" "cta";
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.aoob-splash-art {
  --wall-width: 138%;
  grid-area: art;
  position: relative;
  min-height: 0;
  max-height: 560px;
  overflow: hidden;
}
.aoob-wall-stack {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(var(--wall-width), 542px);
  transform: translateX(-50%);
}
.aoob-wall {
  --marquee-duration: 42s;
  container-type: inline-size;
  overflow: hidden;
}
.aoob-wall:last-child { --marquee-duration: 56s; }
.aoob-wall-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: aoob-marquee var(--marquee-duration) linear infinite;
}
.aoob-wall:last-child .aoob-wall-track { animation-direction: reverse; }
@keyframes aoob-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 5px)); }
}
@media (prefers-reduced-motion: reduce) {
  .aoob-wall-track { animation: none; }
}
.aoob-wall-slot {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: calc((100cqw - 30px) / 4);
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.aoob-mascot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 52%;
  max-width: 205px;
  height: auto;
  transform: translateX(-50%);
}
.aoob-splash-logo {
  grid-area: logo;
  justify-self: center;
  width: 100px;
  height: auto;
  margin-block: var(--spacing-lg) var(--spacing-smd);
}
.aoob-splash-copy {
  grid-area: copy;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding-inline: var(--step-inset);
  text-align: center;
}
.aoob-splash-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 30px;
  text-transform: uppercase;
  color: var(--color-text-primary);
}
.aoob-splash-subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--color-text-secondary);
}
.aoob-splash-footer {
  grid-area: cta;
  box-sizing: border-box;
  padding: var(--spacing-smd) var(--spacing-lg) var(--spacing-lg);
}

/* ── era grid ─────────────────────────────────────────────────────── */
.aoob-search {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex: 0 0 auto;
  height: 30px;
  margin-inline: var(--step-inset);
  padding-inline: var(--spacing-smd);
  border-radius: var(--radius-max);
  background: var(--pebble-15);
  -webkit-backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
}
.aoob-search-icon { flex-shrink: 0; color: var(--color-text-tertiary); display: flex; }
.aoob-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 20px;
  color: var(--color-text-primary);
}
.aoob-search-input::placeholder { color: var(--color-text-tertiary); font-weight: 600; }
.aoob-search-input:focus { outline: none; }
.aoob-search-input::-webkit-search-cancel-button { display: none; }
.aoob-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-max);
  background: var(--pebble-20);
  cursor: pointer;
  color: var(--color-text-primary);
}
.aoob-era {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-smd);
  margin-bottom: var(--spacing-lg);
}
.aoob-era-header { display: flex; align-items: center; }
.aoob-era-label {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 50px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--pebble-10);
  font-size: var(--font-size-xs);
  line-height: 16px;
  color: var(--color-text-secondary);
  text-align: center;
}
.aoob-era-rule { flex: 1 1 auto; height: 1px; background: var(--color-border-light); }
.aoob-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 5px;
  row-gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.aoob-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.aoob-card:disabled { opacity: 0.35; cursor: default; }
.aoob-card-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 90 / 128;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.aoob-card.is-selected .aoob-card-poster { box-shadow: 0 0 0 2px var(--pebble); }
.aoob-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--font-size-2xs);
  line-height: 14px;
  color: var(--color-text-primary);
}

/* ── rate ─────────────────────────────────────────────────────────── */
.aoob-rate-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-smd);
  list-style: none;
  margin: 0;
  padding: 0;
}
.aoob-rate-row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--spacing-smd);
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.aoob-rate-thumb {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 45px;
  height: 71px;
  background: var(--pebble-10);
}
.aoob-rate-title {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--font-size-xs);
  line-height: 16px;
  color: var(--color-text-primary);
}
.aoob-rate-stars { flex: 0 0 auto; padding-right: var(--spacing-smd); }

/* ── half-star row (Commons/HalfStarRow) ──────────────────────────── */
.aoob-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--star-gap, 10px);
  color: var(--pebble-40);
}
.aoob-star-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--star-size, 44px);
  height: var(--star-size, 44px);
  flex-shrink: 0;
}
.aoob-star-outline,
.aoob-star-solid {
  width: var(--star-size, 44px);
  height: var(--star-size, 44px);
  flex-shrink: 0;
  stroke-width: 1.5;
}
.aoob-star-outline { color: var(--pebble-40); }
.aoob-star-solid { color: var(--pebble); min-width: var(--star-size, 44px); }
.aoob-star-fillwrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}
.aoob-half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 2;
}
.aoob-half-left { left: 0; }
.aoob-half-right { left: 50%; }
@keyframes aoob-star-blink {
  0% { opacity: 1; }
  20% { opacity: 0.3; }
  40% { opacity: 1; }
  60% { opacity: 0.3; }
  100% { opacity: 1; }
}
.aoob-star-fillwrap.blink { animation: aoob-star-blink 500ms ease-in-out; }

/* ── selected pick tray (Commons/SelectedPickTray) ────────────────── */
.aoob-tray { position: relative; }
.aoob-tray-list {
  display: flex;
  gap: var(--spacing-sm);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.aoob-tray-list::-webkit-scrollbar { display: none; }
.aoob-tray-slot {
  flex: 0 0 calc((100% - (var(--tray-slots) - 1) * var(--spacing-sm)) / var(--tray-slots));
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
}
.aoob-tray-pick {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.aoob-tray-remove {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--charcoal-70);
  color: var(--color-text-primary);
}
.aoob-tray-empty { display: block; width: 100%; height: 100%; background: var(--pebble-15); }
.aoob-tray-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--charcoal-70);
  color: var(--color-text-primary);
  cursor: pointer;
}
.aoob-tray-nav:hover { background: var(--charcoal-90); }
.aoob-tray-nav svg { width: 16px; height: 16px; }
.aoob-tray-prev { left: var(--spacing-xs); }
.aoob-tray-next { right: var(--spacing-xs); }

/* ── duel loading ─────────────────────────────────────────────────── */
.aoob-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
}
.aoob-spinner {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-max);
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  animation: aoob-spin 0.8s linear infinite;
}
@keyframes aoob-spin { to { transform: rotate(360deg); } }

/* ── duel ─────────────────────────────────────────────────────────── */
.aoob-duel {
  --duel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: "head" "cards" "same" "range";
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--spacing-mlg) var(--step-inset);
  text-align: center;
}
.aoob-duel-head {
  grid-area: head;
  align-self: start;
  padding-top: var(--spacing-3xl);
  position: relative;
  z-index: 2;
}
.aoob-duel-title {
  margin: 0;
  animation: aoob-duel-rise 0.45s var(--duel-ease) both;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 23px;
  text-transform: uppercase;
  color: var(--color-text-primary);
}
.aoob-duel-cards {
  --duel-poster-height: min(250px, 34dvh);
  grid-area: cards;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 0;
}
.aoob-duel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-smd);
  flex: 0 0 auto;
  width: calc(var(--duel-poster-height) * 169 / 250);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 260ms var(--duel-ease);
}
.aoob-duel-card-left {
  transform: rotate(-2deg);
  animation: aoob-duel-in-left 0.55s var(--duel-ease) 0.18s backwards;
}
.aoob-duel-card-right {
  transform: rotate(2deg);
  animation: aoob-duel-in-right 0.55s var(--duel-ease) 0.28s backwards;
}
.aoob-duel-card-left:hover { transform: rotate(-2deg) translateY(-10px) scale(1.03); }
.aoob-duel-card-right:hover { transform: rotate(2deg) translateY(-10px) scale(1.03); }
.aoob-duel-card-left:active { transform: rotate(-2deg) translateY(-4px) scale(0.99); }
.aoob-duel-card-right:active { transform: rotate(2deg) translateY(-4px) scale(0.99); }
.aoob-duel-card:hover .aoob-duel-glow {
  opacity: 0.95;
  transform: translate(-50%, -50%) scale(1.12);
}
.aoob-duel-card:hover .aoob-duel-card-title { color: var(--color-text-primary); }
.aoob-duel-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  z-index: 0;
  width: 165%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(70px) saturate(1.6);
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 260ms var(--duel-ease), transform 260ms var(--duel-ease);
}
.aoob-duel-poster {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: var(--duel-poster-height);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.aoob-duel-card-title {
  position: relative;
  z-index: 1;
  transition: color 260ms var(--duel-ease);
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--color-text-secondary);
}
.aoob-duel-same {
  grid-area: same;
  position: relative;
  z-index: 2;
  justify-self: center;
  animation: aoob-duel-rise 0.45s var(--duel-ease) 0.42s both;
  margin-block: var(--spacing-lg);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: var(--font-size-xs);
  line-height: 16px;
  color: var(--color-text-tertiary);
  text-decoration: underline;
}
.aoob-duel-same:hover { color: var(--color-text-primary); }
.aoob-duel-range {
  grid-area: range;
  position: relative;
  z-index: 2;
  margin: 0;
  animation: aoob-duel-rise 0.45s var(--duel-ease) 0.08s both;
  font-size: var(--font-size-sm);
  line-height: 18px;
  color: var(--color-text-secondary);
}
@keyframes aoob-duel-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes aoob-duel-in-left {
  from { opacity: 0; transform: rotate(-2deg) translateY(22px) scale(0.94); }
  to { opacity: 1; transform: rotate(-2deg) translateY(0) scale(1); }
}
@keyframes aoob-duel-in-right {
  from { opacity: 0; transform: rotate(2deg) translateY(22px) scale(0.94); }
  to { opacity: 1; transform: rotate(2deg) translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .aoob-duel-title, .aoob-duel-range, .aoob-duel-same,
  .aoob-duel-card-left, .aoob-duel-card-right { animation: none; }
  .aoob-duel-card, .aoob-duel-glow, .aoob-duel-card-title { transition: none; }
  .aoob-duel-card-left:hover, .aoob-duel-card-left:active { transform: rotate(-2deg); }
  .aoob-duel-card-right:hover, .aoob-duel-card-right:active { transform: rotate(2deg); }
}

/* ── reveal (Modal/OshiRank ResultStep) ───────────────────────────── */
.aoob-result {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 96dvh;
  box-sizing: border-box;
  background: var(--black);
}
.aoob-result-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.aoob-capture { position: relative; padding: var(--spacing-mlg); overflow: hidden; background: var(--black); }
.aoob-grid-bg {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background-image:
    repeating-linear-gradient(0deg, var(--color-overlay-light-5) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, var(--color-overlay-light-5) 0 1px, transparent 1px 42px);
  transform: rotate(-4deg);
  pointer-events: none;
}
.aoob-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    120% 78% at 12% -2%,
    hsl(var(--sundrop-h) var(--sundrop-s) var(--sundrop-l) / 0.6) 0%,
    hsl(var(--sundrop-h) var(--sundrop-s) var(--sundrop-l) / 0.18) 26%,
    transparent 55%
  );
  pointer-events: none;
}
.aoob-sunburst {
  position: absolute;
  top: -52px;
  right: -70px;
  z-index: 0;
  width: 238px;
  height: 249px;
  color: var(--color-accent);
  opacity: 0.18;
  pointer-events: none;
}
.aoob-result-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0 var(--spacing-xl);
  text-align: center;
}
.aoob-avatar {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-max);
  overflow: hidden;
  background: var(--color-surface-10);
  box-shadow: 0 0 0 3px var(--color-accent);
}
.aoob-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--font-weight-medium);
  font-size: 28px;
  line-height: 25px;
  text-transform: uppercase;
  text-align: center;
}
.aoob-wordmark-name { font-size: inherit; line-height: inherit; color: var(--color-accent); }
.aoob-wordmark-label { font-size: inherit; line-height: inherit; color: var(--color-text-primary); }
.aoob-result-footer {
  display: flex;
  align-items: center;
  gap: var(--spacing-smd);
  flex-shrink: 0;
  padding: var(--spacing-smd) var(--spacing-mlg) var(--spacing-mlg);
}
.aoob-done {
  flex-shrink: 0;
  height: 50px;
  padding: 0 var(--spacing-mlg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-max);
  background: none;
  cursor: pointer;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}
.aoob-done:hover { background: var(--tab-hover-bg); }
.aoob-share {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  height: 50px;
  padding: 0 var(--spacing-mlg);
  border: none;
  border-radius: var(--radius-max);
  /* AO --color-button = --pebble (off-white); this repo's is bright yellow,
     so pin to pebble/charcoal (see CLAUDE.md token trap). */
  background: var(--pebble);
  cursor: pointer;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--charcoal);
}
.aoob-share:hover { opacity: 0.88; }
.aoob-share:disabled { opacity: 0.6; cursor: default; }
.aoob-share svg { width: 20px; height: 20px; }

/* ── podium (Modal/OshiRank OshiRankPodium) ───────────────────────── */
.aoob-podium {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}
.aoob-podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}
a.aoob-podium-item:hover { opacity: 0.85; }
.aoob-podium-1 { flex: 0 1 134px; }
.aoob-podium-2 { flex: 0 1 102px; }
.aoob-podium-3 { flex: 0 1 97px; }
.aoob-rank-badge { display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.aoob-bracket { display: block; width: auto; height: 18px; }
.aoob-bracket-right { transform: scaleX(-1); }
.aoob-podium-1 .aoob-bracket { height: 24px; }
.aoob-rank-num {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bolder);
  font-size: 30px;
  line-height: 1;
}
.aoob-podium-1 .aoob-rank-num { font-size: 40px; }
.aoob-podium-poster {
  position: relative;
  display: block;
  width: 100%;
  border-style: solid;
  border-color: var(--color-border-light);
  overflow: hidden;
  background: var(--color-surface-10);
}
.aoob-podium-1 .aoob-podium-poster { aspect-ratio: 134 / 191; border-width: 2px; border-radius: 4px; }
.aoob-podium-2 .aoob-podium-poster { aspect-ratio: 90 / 128; border-width: 2px; border-radius: 4px; }
.aoob-podium-3 .aoob-podium-poster { aspect-ratio: 97 / 138; border-width: 4px; border-radius: 8px; }
.aoob-podium-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  text-align: center;
  line-height: var(--line-height-sm);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.aoob-podium-1 .aoob-podium-title { font-size: var(--font-size-sm); }
.aoob-podium-score {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bolder);
  font-size: var(--font-size-xl);
  line-height: 1;
}
.aoob-podium-1 .aoob-podium-score { font-size: var(--font-size-2xl); }
.aoob-medal-gold {
  background: linear-gradient(155deg, #fffb00 57%, #ffc300 93%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.aoob-medal-silver {
  background: linear-gradient(165deg, #ffffff 57%, #a9a9a9 93%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.aoob-medal-bronze {
  background: linear-gradient(165deg, #ffd5af 57%, #ffa375 93%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.aoob-list { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; }
.aoob-list-capped { max-height: 150px; overflow-y: auto; }
.aoob-list-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-smd);
  padding: var(--spacing-sm) 0;
  min-height: 60px;
  border-top: 1px solid var(--color-border-light);
}
.aoob-list-row a.aoob-row-link { display: contents; color: inherit; }
.aoob-list-rank {
  width: 24px;
  flex-shrink: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-align: center;
}
.aoob-list-thumb {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-10);
}
.aoob-list-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  text-align: left;
  line-height: var(--line-height-sm);
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.aoob-list-score {
  flex-shrink: 0;
  min-width: 48px;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bolder);
  color: var(--color-accent);
  text-align: right;
}
.aoob-podium-empty {
  position: relative;
  z-index: 1;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* ── desktop (≥641px): wide splash, 3-col grid, row header/reveal ──── */
@media (min-width: 641px) {
  .aoob-shell { --step-inset: 23.5px; }
  .aoob-splash {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas: "art ." "art logo" "art copy" "art cta" "art .";
  }
  .aoob-splash-art { --wall-width: 122%; background: var(--black); }
  .aoob-wall-stack { top: 6.75%; width: min(var(--wall-width), 489px); }
  .aoob-mascot { top: 50%; bottom: auto; width: 35%; max-width: 170px; transform: translate(-50%, -50%); }
  .aoob-splash-logo { width: 71px; margin-block: 0 var(--spacing-smd); }
  .aoob-splash-title { font-size: 26px; line-height: 26px; }
  .aoob-splash-footer { padding: var(--spacing-smd) var(--spacing-lg) 0; }
  .aoob-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* desktop duel uses the modal close button, not Skip + progress */
  .aoob-shell-duel .aoob-chrome { display: none; }
  .aoob-shell-duel { background: transparent; }
  .aoob-duel {
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "head" "range" "cards" "same";
    padding-block: var(--spacing-2xl);
  }
  .aoob-duel-head { padding-top: 0; }
  .aoob-duel-range { align-self: start; margin-top: var(--spacing-xs); }
  .aoob-duel-cards { --duel-poster-height: min(375px, 46dvh); gap: 93px; margin-top: var(--spacing-2xl); }
  .aoob-duel-same { margin-bottom: 0; }

  /* reveal header goes to a left-aligned row */
  .aoob-result-header {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-xs) 0 var(--spacing-lg);
    text-align: left;
  }
  .aoob-avatar { width: 72px; height: 72px; }
  .aoob-wordmark { align-items: flex-start; text-align: left; }
}

/* ── mobile (≤640px): full-screen at every step ───────────────────── */
@media (max-width: 640px) {
  .aoob-modal,
  .aoob-modal.aoob-modal--wide,
  .aoob-modal.aoob-modal--reveal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    align-self: stretch;
    border: none;
    border-radius: 0;
  }
  .aoob-modal.aoob-modal--duel {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    align-self: stretch;
    background: var(--color-modal-bg);
  }
  .aoob-modal--duel .aoob-close { display: none; }
}
