/*
 * 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;
  background: hsla(271, 25%, 18%, 0.9);
  -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;
}
.aoh-dropdown-item:hover { background: var(--color-surface); }

/* 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: hsla(271, 25%, 18%, 0.95);
  -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;
}
.aod-dropdown-item:hover { background: var(--color-surface); }

@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; }
}
