  :root {
    color-scheme: light;
    --bg: #ece6d4;
    --bg-grad: radial-gradient(1200px 560px at 14% -10%, rgba(168,124,43,0.10), transparent 60%), radial-gradient(900px 480px at 100% 0%, rgba(47,107,82,0.08), transparent 55%);
    --surface: #faf7ec;
    --surface-2: #f1ead6;
    --ink: #231f17;
    --ink-soft: #564e3c;
    --muted: #6a624d;
    --gold: #9c7527;
    --gold-soft: #f0e2bb;
    --gold-text: #80601d;
    --jade: #2f6b52;
    --jade-soft: #dbe9df;
    --you: #8a382b;
    --you-soft: #f1ddd4;
    --line: #ddd1ac;
    --danger: #a93a2c;
    --rank-gold: #9c7527;
    --rank-gold-soft: #f0e2bb;
    --rank-silver: #74786a;
    --rank-silver-soft: #e6e4d7;
    --rank-bronze: #8a5a34;
    --rank-bronze-soft: #ead9c0;
    --tier-emerald: #2f7d58;
    --tier-emerald-soft: #dbebe0;
    --tier-diamond: #2d7f94;
    --tier-diamond-soft: #d7ecf0;
    --tier-amethyst: #6a4f8f;
    --tier-amethyst-soft: #e5ddef;
    --tier-platinum: #5c7a78;
    --tier-platinum-soft: #dce7e5;
    --tag-blue: #3f5f8a;
    --dc-show: #17805a; --dc-movie: #7350a8; --dc-manga: #a8741c; /* Deep cuts series, validated on --surface */
    --tag-blue-soft: #dde6f0;
    --shadow: 0 1px 0 rgba(40,30,12,0.08);
    --shadow-lift: 0 16px 32px rgba(40,28,10,0.16);
    --radius-s: 5px;
    --radius-m: 10px;
    --radius-l: 16px;
    --transition: 180ms cubic-bezier(.2,.7,.3,1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);   /* arrivals: fast start, long settle */
    --ease-exit: cubic-bezier(.5, 0, .75, 0);  /* departures: quick and out of the way */
    --font-display: 'Cinzel', 'Georgia', serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0c0d10;
      --bg-grad: radial-gradient(1200px 560px at 14% -10%, rgba(212,175,90,0.09), transparent 60%), radial-gradient(900px 480px at 100% 0%, rgba(63,174,132,0.08), transparent 55%);
      --surface: #16181d;
      --surface-2: #1c1f26;
      --ink: #ece7d6;
      --ink-soft: #bcb6a2;
      --muted: #958e79;
      --gold: #d4af5a;
      --gold-soft: #2e2410;
      --gold-text: #d4af5a;
      --jade: #3fae84;
      --jade-soft: #11291f;
      --you: #d1685a;
      --you-soft: #2c1613;
      --line: #28271f;
      --danger: #e0705f;
      --rank-gold: #d4af5a;
      --rank-gold-soft: #332912;
      --rank-silver: #a9ad9c;
      --rank-silver-soft: #2a2b26;
      --rank-bronze: #c98a56;
      --rank-bronze-soft: #3a2a1a;
      --tier-emerald: #4fcf9c;
      --tier-emerald-soft: #153228;
      --tier-diamond: #58b8cf;
      --tier-diamond-soft: #103139;
      --tier-amethyst: #a98bd8;
      --tier-amethyst-soft: #251f38;
      --tier-platinum: #8fb3b3;
      --tier-platinum-soft: #1a2a2a;
      --tag-blue: #7e9bc9;
      --dc-show: #2a9a6e; --dc-movie: #9070d0; --dc-manga: #b5892a;
      --tag-blue-soft: #1c2536;
      --shadow: 0 1px 0 rgba(0,0,0,0.4);
      --shadow-lift: 0 18px 38px rgba(0,0,0,0.55);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c0d10;
    --bg-grad: radial-gradient(1200px 560px at 14% -10%, rgba(212,175,90,0.09), transparent 60%), radial-gradient(900px 480px at 100% 0%, rgba(63,174,132,0.08), transparent 55%);
    --surface: #16181d;
    --surface-2: #1c1f26;
    --ink: #ece7d6;
    --ink-soft: #bcb6a2;
    --muted: #958e79;
    --gold: #d4af5a;
    --gold-soft: #2e2410;
    --gold-text: #d4af5a;
    --jade: #3fae84;
    --jade-soft: #11291f;
    --you: #d1685a;
    --you-soft: #2c1613;
    --line: #28271f;
    --danger: #e0705f;
    --rank-gold: #d4af5a;
    --rank-gold-soft: #332912;
    --rank-silver: #a9ad9c;
    --rank-silver-soft: #2a2b26;
    --rank-bronze: #c98a56;
    --rank-bronze-soft: #3a2a1a;
    --tier-emerald: #4fcf9c;
    --tier-emerald-soft: #153228;
    --tier-diamond: #58b8cf;
    --tier-diamond-soft: #103139;
    --tier-amethyst: #a98bd8;
    --tier-amethyst-soft: #251f38;
    --tier-platinum: #8fb3b3;
    --tier-platinum-soft: #1a2a2a;
    --tag-blue: #7e9bc9;
    --dc-show: #2a9a6e; --dc-movie: #9070d0; --dc-manga: #b5892a;
    --tag-blue-soft: #1c2536;
    --shadow: 0 1px 0 rgba(0,0,0,0.4);
    --shadow-lift: 0 18px 38px rgba(0,0,0,0.55);
  }

  /* primary-button fill: deep enough for light text in both themes */
  :root { --btn-primary-a: color-mix(in srgb, var(--jade) 88%, #000); --btn-primary-b: color-mix(in srgb, var(--gold) 72%, #000); }

  * { box-sizing: border-box; }
  html, body { height: 100%; }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); }
  /* Feel like an app on phones: no grey tap flash (every control has its own :active
     or hover state), no landscape font inflation, taps fire without the double-tap
     wait, and long-pressing a control doesn't select its label. Content stays selectable. */
  html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  button, a, [role="button"], [role="tab"], summary, label { touch-action: manipulation; }
  button, [role="button"], [role="tab"], summary, .tab-bar-item { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  body {
    margin: 0;
    background: var(--bg-grad), var(--bg);
    background-attachment: fixed, fixed;
    color: var(--ink);
    font-family: var(--font-body);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    transition: background .2s ease, color .2s ease;
    position: relative;
  }
  h1, h2, h3 { text-wrap: balance; }
  p { text-wrap: pretty; }
  /* Card-stock grain — breaks the flat digital background without being loud. */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  :root[data-theme="dark"] body::before { opacity: 0.07; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body::before { opacity: 0.07; }
  }
  #app, .wrap { position: relative; z-index: 1; }
  ::selection { background: var(--gold-soft); }

  a { color: inherit; }

  .wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 64px;
  }

  /* ---------- header ---------- */
  header.top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--gold);
    box-shadow: 0 1px 0 var(--line);
    margin-bottom: 28px;
    flex-wrap: wrap;
  }
  .brand {
    text-align: left;
    max-width: 640px;
  }
  .brand h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 4.6vw, 2.75rem);
    margin: 0;
    letter-spacing: 0.01em;
    line-height: 1.08;
    color: var(--ink);
  }
  .brand p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
  }
  .top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
    max-width: 100%; /* lets the buttons wrap instead of pushing the page sideways on phones */
  }
  .stat-pill {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 16px;
    white-space: nowrap;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .stat-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); } }

  button {
    font-family: var(--font-body);
    cursor: pointer;
  }
  .btn {
    appearance: none;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    padding: 9px 16px;
    border-radius: var(--radius-s);
    font-size: 0.88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); box-shadow: var(--shadow-lift); } }
  .btn:active { transform: translateY(0px); }
  .btn-primary {
    background: linear-gradient(120deg, var(--btn-primary-a) 0%, var(--btn-primary-a) 60%, var(--btn-primary-b) 100%);
    border-color: transparent;
    color: #fbf8ef;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), var(--shadow);
  }
  @media (hover: hover) and (pointer: fine) { .btn-primary:hover { opacity: .94; background: linear-gradient(120deg, var(--btn-primary-a) 0%, var(--btn-primary-a) 60%, var(--btn-primary-b) 100%); transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), var(--shadow-lift); } }
  .btn-ghost {
    border-color: var(--line);
    color: var(--muted);
  }
  @media (hover: hover) and (pointer: fine) { .btn-ghost:hover { background: var(--surface-2); color: var(--ink); } }
  .submit-show-cta { border-color: var(--jade); color: var(--jade); font-weight: 700; white-space: nowrap; }
  @media (hover: hover) and (pointer: fine) { .submit-show-cta:hover { background: var(--jade-soft); color: var(--jade); } }
  .btn-icon {
    border: 1px solid var(--line);
    background: var(--surface);
    width: 38px; height: 38px;
    border-radius: var(--radius-s);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink);
    transition: transform var(--transition), background var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .btn-icon:hover { background: var(--surface-2); transform: translateY(-2px); } }
  .btn-danger { border-color: var(--danger); color: var(--danger); }
  @media (hover: hover) and (pointer: fine) { .btn-danger:hover { background: var(--danger); color: var(--bg); border-color: var(--danger); } }

  /* ---------- sync status ---------- */
  .sync-note {
    font-size: 0.78rem;
    color: var(--muted);
    margin: -14px 0 24px;
    display: none;
  }
  .sync-note.show { display: block; }

  /* ---------- type tabs ---------- */
  .type-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 26px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  .type-tab {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 0 12px;
    margin-bottom: -1px;
    flex: 0 0 auto;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
  }
  @media (hover: hover) and (pointer: fine) { .type-tab:hover { color: var(--ink); } }
  .type-tab.active { color: var(--ink); border-bottom-color: var(--gold); }
  .type-tab-count {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
  }

  /* ---------- app nav ---------- */
  .app-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-bottom: 1px solid var(--gold);
    box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px rgba(0,0,0,0.5);
    flex-wrap: nowrap;
  }
  .nav-left { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
  .nav-menu { display: flex; align-items: center; gap: 4px; }
  .nav-logo {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: linear-gradient(155deg, var(--jade) 0%, var(--jade) 55%, var(--gold) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fbf8ef;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), var(--shadow);
  }
  .nav-link {
    appearance: none;
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 8px 12px;
    border-radius: var(--radius-s);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    transition: color var(--transition), background var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .nav-link:hover { color: var(--ink); background: var(--surface-2); } }
  .nav-link.active { color: var(--ink); background: var(--surface-2); }
  .nav-link.active::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--jade), var(--gold));
  }
  .nav-dropdown.active-group .nav-dropdown-trigger { color: var(--ink); background: var(--surface-2); }
  .nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

  .nav-dropdown { position: relative; }
  .nav-dropdown-trigger { display: inline-flex; align-items: center; gap: 4px; }
  .nav-dropdown-trigger .icon { width: 12px; height: 12px; transition: transform .15s ease; }
  .nav-dropdown.open .nav-dropdown-trigger .icon { transform: rotate(180deg); }
  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 190px;
    z-index: 50;
    overflow: hidden;
    display: none;
    flex-direction: column;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-dropdown-item {
    appearance: none;
    border: none;
    background: none;
    text-align: left;
    padding: 11px 16px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
  }
  @media (hover: hover) and (pointer: fine) { .nav-dropdown-item:hover { background: var(--surface-2); color: var(--ink); } }
  .nav-dropdown-item.active { color: var(--ink); font-weight: 700; }
  .nav-profile-name { font-size: 0.94rem; font-weight: 800; color: var(--ink); }

  .nav-notif-btn { position: relative; }
  .nav-notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }
  .nav-notif-menu {
    left: auto;
    right: 0;
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
  }
  .nav-notif-header-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; gap: 10px; }
  .nav-notif-header { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); }
  .nav-notif-mark-all { appearance: none; background: none; border: none; color: var(--jade); font-size: 0.74rem; font-weight: 600; cursor: pointer; padding: 2px; }
  @media (hover: hover) and (pointer: fine) { .nav-notif-mark-all:hover { text-decoration: underline; } }
  .nav-notif-empty { padding: 18px 16px; font-size: 0.82rem; color: var(--muted); text-align: center; }
  .nav-notif-section-label { padding: 10px 16px 2px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .nav-notif-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
  .nav-notif-row img { width: 34px; height: 34px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
  .nav-notif-row .n-name { flex: 1; min-width: 0; font-size: 0.84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-notif-row .n-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .nav-notif-row .n-actions button { padding: 5px 10px; font-size: 0.76rem; }
  .nav-notif-row.generic {
    align-items: flex-start;
    cursor: pointer;
    border-radius: var(--radius-s);
    margin: 2px 8px;
    padding: 10px 8px;
  }
  @media (hover: hover) and (pointer: fine) { .nav-notif-row.generic:hover { background: var(--surface-2); } }
  .nav-notif-row.generic.unread { background: var(--jade-soft); }
  .nav-notif-row.generic .n-icon {
    width: 34px; height: 34px;
    border-radius: 999px;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
  }
  .nav-notif-row.generic .n-body { flex: 1; min-width: 0; }
  .nav-notif-row.generic .n-title { font-size: 0.84rem; font-weight: 700; margin-bottom: 2px; white-space: normal; }
  .nav-notif-row.generic .n-text { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.4; }
  .nav-notif-row.generic .n-time { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
  .nav-notif-row.generic .n-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--jade); flex-shrink: 0; margin-top: 6px; }

  .nav-hamburger {
    display: none;
    appearance: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-s);
    color: var(--ink);
    padding: 0;
    flex-shrink: 0;
  }
  .nav-hamburger .icon { width: 18px; height: 18px; }
  @media (hover: hover) and (pointer: fine) { .nav-hamburger:hover { background: var(--surface-2); } }

  /* ---------- mobile nav ---------- */
  @media (max-width: 700px) {
    .app-nav { padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); gap: 8px; flex-wrap: nowrap; }
    .nav-left { flex-wrap: nowrap; gap: 2px; position: relative; }
    .nav-logo { width: 30px; height: 30px; font-size: 0.9rem; margin-right: 6px; }
    .nav-hamburger { display: inline-flex; }
    .nav-menu {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      left: -14px;
      right: auto;
      width: max-content;
      min-width: 200px;
      max-width: calc(100vw - 28px);
      flex-direction: column;
      align-items: stretch;
      gap: 2px;
      padding: 8px;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius-m);
      box-shadow: 0 10px 28px rgba(0,0,0,0.18);
      z-index: 55;
    }
    .nav-menu.open { display: flex; }
    .nav-menu .nav-link,
    .nav-menu .nav-dropdown-trigger { width: 100%; justify-content: space-between; }
    .nav-menu .nav-dropdown { width: 100%; }
    .nav-menu .nav-dropdown-menu {
      position: static;
      display: none;
      box-shadow: none;
      border: none;
      margin-top: 0;
      padding-left: 14px;
      min-width: 0;
      width: 100%;
    }
    .nav-menu .nav-dropdown.open .nav-dropdown-menu { display: flex; }
    .nav-right { gap: 4px; }
    .nav-right .btn-ghost { padding: 8px 12px; font-size: 0.8rem; }
  }
  @media (max-width: 380px) {
    .nav-right #loginBtn { padding: 7px 10px; font-size: 0.76rem; }
  }

  /* ---------- pages ---------- */
  .page { display: none; }
  .page.active { display: block; }

  .hero-home {
    min-height: 30vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
      radial-gradient(800px 320px at 20% 20%, color-mix(in srgb, var(--jade) 14%, transparent), transparent 65%),
      radial-gradient(700px 300px at 85% 80%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 65%),
      var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .hero-home::before {
    content: 'SIMODEX';
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3.5rem, 13vw, 8rem);
    letter-spacing: 0.12em;
    color: color-mix(in srgb, var(--ink) 10%, transparent);
    -webkit-text-stroke: 1.5px color-mix(in srgb, var(--gold) 60%, var(--ink) 40%);
    text-shadow: 0 6px 24px rgba(20, 14, 4, .18);
    white-space: nowrap;
  }
  .spotlight-banner {
    position: relative;
    min-height: 78vh;
    min-height: 78svh; /* stays put while the phone's URL bar shows and hides */
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    overflow: hidden;
  }
  .spotlight-banner::before,
  .spotlight-banner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
  }
  .spotlight-banner::before { width: 440px; height: 440px; background: var(--jade); top: -140px; left: -120px; }
  .spotlight-banner::after { width: 400px; height: 400px; background: var(--gold); bottom: -160px; right: -100px; }
  .spotlight-sparkle {
    position: absolute;
    border-radius: 999px;
    background: var(--gold);
    pointer-events: none;
    z-index: 0;
    animation: sparkleFloat 6s ease-in-out infinite;
  }
  .spotlight-sparkle-1 { width: 7px; height: 7px; top: 16%; left: 12%; animation-delay: 0s; }
  .spotlight-sparkle-2 { width: 5px; height: 5px; top: 30%; left: 85%; background: var(--jade); animation-delay: 1.2s; }
  .spotlight-sparkle-3 { width: 9px; height: 9px; top: 72%; left: 8%; animation-delay: 2.4s; }
  .spotlight-sparkle-4 { width: 6px; height: 6px; top: 80%; left: 90%; background: var(--jade); animation-delay: 3.2s; }
  .spotlight-sparkle-5 { width: 4px; height: 4px; top: 8%; left: 60%; animation-delay: 4.4s; }
  @keyframes sparkleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.45; }
    50% { transform: translateY(-16px) scale(1.4); opacity: 0.9; }
  }
  .spotlight-statrow {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 3;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .spotlight-statrow .rankers-stat {
    position: static;
    background: linear-gradient(135deg, var(--btn-primary-a), var(--btn-primary-b));
    color: #fbf8ef;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 20px;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--jade) 35%, transparent);
    animation: rankersPulse 3.2s ease-in-out infinite;
  }
  .titles-stat {
    position: static;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    white-space: nowrap;
    align-self: center;
  }
  @keyframes rankersPulse {
    0%, 100% { box-shadow: 0 6px 18px color-mix(in srgb, var(--jade) 35%, transparent); }
    50% { box-shadow: 0 8px 26px color-mix(in srgb, var(--gold) 45%, transparent); }
  }
  .spotlight-rotator {
    width: 100%;
    max-width: 1040px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .spotlight-card {
    display: flex;
    align-items: center;
    gap: 44px;
    width: 100%;
    cursor: pointer;
    animation: spotlightFade .5s ease;
    flex-wrap: wrap;
  }
  .spotlight-cover-wrap {
    flex-shrink: 0;
    width: min(320px, 42vw);
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    background: linear-gradient(135deg, var(--jade), var(--gold));
    display: flex; align-items: center; justify-content: center;
  }
  .spotlight-cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .spotlight-cover-wrap .cover-fallback { font-size: 3.6rem; color: #fff; font-family: var(--font-display); font-weight: 700; }
  @keyframes spotlightFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .spotlight-content { max-width: 460px; }
  .spotlight-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.1rem;
    color: var(--ink);
    margin-bottom: 8px;
  }
  .spotlight-score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--jade);
    margin-bottom: 18px;
  }
  .spotlight-score span { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
  .spotlight-empty { color: var(--muted); font-style: italic; }
  .section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 320px;
    margin: 0 auto;
    padding: 36px 20px 0;
  }
  .section-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
  }
  .section-divider-mark {
    color: var(--gold-text);
    font-size: 0.9rem;
    line-height: 1;
  }
  .home-below {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 28px 80px;
  }
  .home-below h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 6px;
  }
  .home-below .home-sub { color: var(--muted); margin-bottom: 28px; }
  /* flex so a short last row stretches instead of leaving one orphan card */
  .quicklink-grid { display: flex; flex-wrap: wrap; gap: 16px; }
  .quicklink-grid > .quicklink-card { flex: 1 1 190px; display: flex; flex-direction: column; align-items: flex-start; }
  .quicklink-card {
    appearance: none;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  }
  @media (hover: hover) and (pointer: fine) { .quicklink-card:hover {
    transform: translateY(-3px);
    border-color: var(--jade);
    box-shadow: var(--shadow-lift);
  } }
  .quicklink-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--jade-soft), var(--gold-soft));
    margin-bottom: 14px;
    transition: background .15s ease;
  }
  @media (hover: hover) and (pointer: fine) { .quicklink-card:hover .quicklink-icon { background: linear-gradient(135deg, var(--jade), var(--gold)); } }
  .quicklink-icon .icon { width: 22px; height: 22px; color: var(--jade); margin: 0; transition: color .15s ease; }
  @media (hover: hover) and (pointer: fine) { .quicklink-card:hover .quicklink-icon .icon { color: #fff; } }
  .quicklink-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 4px; }
  .quicklink-card p { color: var(--muted); font-size: 0.85rem; }
  @media (max-width: 560px) {
    /* phone: compact rows, icon beside the text */
    .quicklink-grid { gap: 10px; }
    .quicklink-grid > .quicklink-card { flex-basis: 100%; padding: 14px 16px; }
  }

  /* ---------- home ranking hero (competitive centerpiece) ---------- */
  .home-ranking-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 32px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
  }
  .home-ranking-col {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 22px 24px;
    box-shadow: var(--shadow-lift);
  }
  .home-ranking-col h2, .home-ranking-col h3 { font-family: var(--font-display); font-size: 1.1rem; margin: 1em 0 14px; }
  .home-lb-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
  .home-lb-row {
    display: grid;
    grid-template-columns: 24px 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 4px;
    border-radius: var(--radius-s);
    cursor: pointer;
    transition: background var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .home-lb-row:hover { background: var(--surface-2); } }
  .home-lb-row .row-rank { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; text-align: center; color: var(--muted); }
  .home-lb-cover { width: 28px; height: 38px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
  .home-lb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .home-lb-name { font-size: 0.84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-lb-score { font-family: var(--font-display); font-weight: 700; color: var(--jade); font-size: 0.9rem; }
  .home-ranking-stats { font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
  .home-ranking-stats strong { color: var(--ink); }
  .home-ranking-cta { width: 100%; text-align: center; }
  @media (max-width: 720px) {
    .home-ranking-hero { margin-top: 24px; margin-bottom: 0; }
    /* the leaderboards → "Jump in" gap was ~186px of stacked padding on phones */
    .wrap:has(> #homeRankingHero) { padding-bottom: 20px; }
    .wrap:has(> #homeRankingHero) + .section-divider { padding-top: 14px; }
    .section-divider + .home-below { padding-top: 22px; }
  }

  /* ---------- suggestion box ---------- */
  .suggestion-box {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    margin-top: 44px;
    padding: 24px 26px;
    border-radius: var(--radius-l);
    background: linear-gradient(135deg, var(--jade-soft), var(--gold-soft));
    border: 1px solid var(--line);
  }
  .suggestion-icon {
    width: 46px; height: 46px; flex-shrink: 0;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .suggestion-icon .icon { width: 22px; height: 22px; color: var(--jade); margin: 0; }
  .suggestion-box h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 3px; }
  .suggestion-box p { color: var(--ink-soft); font-size: 0.85rem; }
  .suggestion-box .btn { margin-left: auto; flex-shrink: 0; }
  @media (max-width: 560px) { .suggestion-box .btn { margin-left: 0; width: 100%; text-align: center; } }
  .detail-back-btn { background: var(--surface); }
  .anime-detail { display: flex; gap: 40px; padding: 0 0 60px; flex-wrap: wrap; }
  .anime-detail-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: 0 16px 44px rgba(0,0,0,0.28);
    border: 3px solid var(--surface);
    background: linear-gradient(135deg, var(--jade), var(--gold));
    display: flex; align-items: center; justify-content: center;
  }
  .anime-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .anime-detail-cover .cover-fallback { font-size: 4rem; color: #fff; font-family: var(--font-display); font-weight: 700; }
  .anime-detail-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
  .anime-detail-recommended h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 12px; }

  /* ---------- browse page ---------- */
  .browse-header { padding-bottom: 0; margin-bottom: 6px; border-bottom: none; }
  .browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
    margin-top: 8px;
  }
  .browse-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  @media (hover: hover) and (pointer: fine) { .browse-card:hover { transform: translateY(-4px) scale(1.01); border-color: var(--jade); box-shadow: var(--shadow-lift); } }
  .browse-card-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
  }
  .browse-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .browse-card-cover .cover-fallback { font-size: 2rem; }
  .browse-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .browse-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .browse-card-type {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .browse-card-score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
  }
  .browse-card-score.tier-gold { color: var(--gold-text); }
  .browse-card-score.tier-jade { color: var(--jade); }
  .browse-card-mine {
    font-size: 0.72rem;
    color: var(--you);
    background: var(--you-soft);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    align-self: flex-start;
    font-weight: 700;
  }
  .community-unrated-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 24px 0 14px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .community-unrated-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }

  .watchlist-toggle-btn {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--radius-s);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }
  @media (hover: hover) and (pointer: fine) { .watchlist-toggle-btn:hover { border-color: var(--jade); color: var(--jade); } }
  .watchlist-toggle-btn.on { background: var(--jade-soft); border-color: var(--jade); color: var(--jade); }
  .browse-card { position: relative; }
  .browse-card .watchlist-toggle-btn { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--surface); }

  .profile-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
    align-items: start;
  }
  .profile-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 20px 22px;
  }
  .profile-panel h2, .profile-panel h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
  .genre-chart { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
  .genre-chart-row { display: flex; align-items: center; gap: 10px; }
  .genre-chart-row .g-name { flex: 0 0 108px; font-size: 0.82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .genre-chart-row .g-bar-wrap { flex: 1; background: var(--surface-2); border-radius: 999px; height: 12px; overflow: hidden; }
  .genre-chart-row .g-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--jade), var(--gold)); transition: width .5s ease; }
  .genre-chart-row .g-val { flex: 0 0 34px; text-align: right; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); }
  .profile-highlights { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
  .profile-highlight-row { display: flex; align-items: center; gap: 12px; }
  .profile-highlight-row .h-cover { width: 42px; height: 56px; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
  .profile-highlight-row .h-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .profile-highlight-row .h-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .profile-highlight-row .h-name { font-weight: 600; font-size: 0.88rem; }
  .profile-highlight-row .h-score { font-family: var(--font-display); font-weight: 700; color: var(--jade); margin-left: auto; }

  /* ---------- anime identity card + tier badges ---------- */
  .tier-badge {
    display: inline-flex; align-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: var(--radius-s);
    color: var(--tier-color, var(--muted));
    background: var(--tier-soft, var(--surface-2));
    border: 1px solid var(--tier-color, var(--line));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier-color, var(--line)) 25%, transparent);
    white-space: nowrap;
    vertical-align: middle;
  }
  .tier-badge.prismatic {
    color: #fff;
    background: linear-gradient(120deg, var(--tier-amethyst), var(--gold), var(--tier-diamond), var(--tier-amethyst));
    background-size: 300% 300%;
    border: none;
    animation: tierShimmer 4s ease infinite;
  }
  @keyframes tierShimmer { 0%{background-position:0% 50%;} 50%{background-position:100% 50%;} 100%{background-position:0% 50%;} }
  .controversial-row { display: flex; align-items: center; gap: 12px; }
  .controversial-row .h-cover { width: 42px; height: 56px; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
  .controversial-row .h-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .controversial-row .h-name { font-weight: 600; font-size: 0.88rem; }
  .controversial-row .h-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .controversial-row .h-diff { font-family: var(--font-display); font-weight: 700; margin-left: auto; text-align: right; font-size: 0.85rem; }
  .controversial-row .h-diff { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
  .controversial-row .h-diff .icon { width: 14px; height: 14px; }
  .controversial-row .h-diff.over { color: color-mix(in srgb, var(--jade) 80%, var(--ink)); }
  .controversial-row .h-diff.under { color: var(--gold-text); }
  .friends-section-title { font-family: var(--font-display); font-size: 1.15rem; margin: 30px 0 12px; }

  .friend-popover-menu {
    position: absolute;
    z-index: 500;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-lift);
    padding: 6px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .friend-popover-menu button {
    background: none; border: none; text-align: left; padding: 9px 10px; border-radius: var(--radius-s);
    font-size: 0.86rem; font-weight: 600; color: var(--ink); cursor: pointer; font-family: var(--font-body);
  }
  @media (hover: hover) and (pointer: fine) { .friend-popover-menu button:hover { background: var(--surface-2); color: var(--jade); } }

  /* ---------- friend view dialog (read-only profile/ranking of a friend) ---------- */
  .friend-view-head { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
  .friend-view-head img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; border: 2px solid var(--line); flex-shrink: 0; }
  .friend-view-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
  .friend-view-tab {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 16px; font-size: 0.82rem; font-weight: 700; cursor: pointer; color: var(--ink-soft);
    font-family: var(--font-body);
  }
  .friend-view-tab.active { background: var(--jade); border-color: var(--jade); color: #fff; }
  .friend-view-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: var(--surface-2); border-radius: var(--radius-m); margin-bottom: 8px; cursor: pointer;
    transition: background var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .friend-view-row:hover { background: var(--line); } }
  .friend-view-row .fv-rank { width: 26px; flex-shrink: 0; text-align: center; font-weight: 700; color: var(--muted); font-size: 0.8rem; }
  .friend-view-row .fv-cover { width: 36px; height: 48px; border-radius: 5px; overflow: hidden; flex-shrink: 0; background: var(--surface); }
  .friend-view-row .fv-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .friend-view-row .fv-main { flex: 1; min-width: 0; }
  .friend-view-row .fv-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .friend-view-row .fv-sub { font-size: 0.74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
  .fv-type-tabs { margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .fv-type-tabs::-webkit-scrollbar { display: none; }
  .fv-type-tabs .type-tab { flex: 0 0 auto; white-space: nowrap; font-size: 0.92rem; padding: 8px 12px; }
  .friend-view-row .fv-score { font-family: var(--font-display); font-weight: 700; flex-shrink: 0; }
  .friend-rank-row { border-radius: var(--radius-s); overflow: hidden; margin-bottom: 8px; border: 1px solid var(--line); }
  .friend-rank-row-head {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer;
    background: var(--surface-2);
  }
  .friend-rank-row-head img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
  .friend-rank-row-head .fr-name { flex: 1; min-width: 0; font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .friend-rank-row-head .fr-score { font-family: var(--font-display); font-weight: 700; font-size: 0.92rem; }
  .friend-rank-row-detail { display: none; padding: 10px 12px; }
  .friend-rank-row.expanded .friend-rank-row-detail { display: block; }
  .friend-rank-row.expanded .friend-rank-row-head { background: var(--line); }
  .friend-rank-cat-row { display: flex; justify-content: space-between; font-size: 0.78rem; padding: 3px 0; }
  .friend-rank-cat-row .frc-name { color: var(--muted); }
  .friend-rank-cat-row .frc-val { font-weight: 700; }

  /* ---------- compare page ---------- */
  .compare-layout { display: grid; grid-template-columns: 230px 1fr; gap: 26px; margin-top: 22px; align-items: start; }
  .compare-sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 16px;
    position: sticky;
    top: 84px;
  }
  /* Must come AFTER the base .compare-sidebar rule above — equal-specificity
     declarations are resolved by source order, not by which media query
     matches, so this has to be last to actually win on narrow viewports. */
  @media (max-width: 820px) { .compare-layout { grid-template-columns: 1fr; } .compare-sidebar { position: static; top: auto; } }
  .compare-sidebar h3 { font-family: var(--font-display); font-size: 0.92rem; margin-bottom: 12px; }
  .compare-friend-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 9px;
    border-radius: var(--radius-s);
    cursor: pointer;
    margin-bottom: 3px;
    border: 1px solid transparent;
    background: transparent;
  }
  @media (hover: hover) and (pointer: fine) { .compare-friend-chip:hover { background: var(--surface-2); } }
  .compare-friend-chip.selected { background: var(--jade-soft); border-color: var(--jade); }
  .compare-friend-chip img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
  .compare-friend-chip .name { font-size: 0.85rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-friend-chip .dot { width: 15px; height: 15px; border-radius: 999px; border: 2px solid var(--line); flex-shrink: 0; }
  .compare-friend-chip.selected .dot { background: var(--jade); border-color: var(--jade); }
  .compare-empty-hero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 64px 24px;
    border-radius: var(--radius-m);
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
  }
  .compare-empty-hero h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 8px; }
  .compare-empty-hero p { color: var(--muted); }
  .compare-ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 22px; }
  .compare-ad-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; }
  .compare-ad-col h3 { font-family: var(--font-display); font-size: 0.98rem; margin-bottom: 12px; }
  .compare-ad-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .compare-ad-row:last-child { margin-bottom: 0; }
  .compare-ad-cover { width: 32px; height: 44px; border-radius: 4px; border: 1px solid var(--line); flex-shrink: 0; overflow: hidden; background: var(--surface-2); }
  .compare-ad-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .compare-faceoff { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px; margin-bottom: 22px; }
  .compare-faceoff h3 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 14px; }
  .faceoff-row { margin-bottom: 14px; }
  .faceoff-row:last-child { margin-bottom: 0; }
  .faceoff-label { font-weight: 600; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
  .faceoff-track { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
  .faceoff-vals { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; flex: 0 0 72px; justify-content: center; }
  .faceoff-vals .you-val { color: var(--you); }
  .compare-ad-name { flex: 1; font-size: 0.84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-ad-scores { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
  .compare-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 4px 0; overflow-x: auto; }
  .compare-table-wrap h3 { font-family: var(--font-display); font-size: 1rem; padding: 16px 16px 4px; }
  .compare-table-row {
    display: grid;
    gap: 8px;
    align-items: center;
    padding: 9px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line);
    min-width: 360px;
  }
  .compare-table-row:last-child { border-bottom: none; }
  .compare-table-row.head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding-top: 4px; }
  .compare-table-row .name { font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-table-row .score { font-family: var(--font-display); font-weight: 700; text-align: center; }
  .compare-table-row .score.blank { color: var(--muted); font-weight: 400; font-family: var(--font-body); }

  /* ---------- controls bar ---------- */
  .controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px;
  }
  .search-box {
    flex: 1 1 220px;
    position: relative;
  }
  .search-box input {
    width: 100%;
  }
  input, select, textarea {
    font-family: var(--font-body);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius-s);
    padding: 9px 12px;
    font-size: 0.9rem;
  }
  /* iOS zooms into any field under 16px and never zooms back out */
  @media (pointer: coarse) { input, select, textarea { font-size: 16px; } }
  input:focus, select:focus, textarea:focus, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--jade);
    outline-offset: 1px;
  }
  select { cursor: pointer; }

  /* ---------- podium ---------- */
  .podium-section { margin-bottom: 44px; }
  .section-label {
    font-family: var(--font-display);
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 12px;
    letter-spacing: 0.02em;
  }
  .podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 14px;
    align-items: end;
  }
  @media (max-width: 640px) {
    .podium { grid-template-columns: 1fr; }
    .podium-card.rank-1 { order: -1; }
  }
  .podium-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .12s ease;
  }
  @media (hover: hover) and (pointer: fine) { .podium-card:hover { transform: translateY(-3px); border-color: var(--ink-soft); } }
  .podium-card.rank-1 { padding-top: 22px; padding-bottom: 22px; border-color: var(--rank-gold); background: linear-gradient(180deg, var(--rank-gold-soft), var(--surface) 70%); }
  .podium-card.rank-2 { border-color: var(--rank-silver); background: linear-gradient(180deg, var(--rank-silver-soft), var(--surface) 70%); }
  .podium-card.rank-3 { border-color: var(--rank-bronze); background: linear-gradient(180deg, var(--rank-bronze-soft), var(--surface) 70%); }
  .podium-cover {
    width: 84px; height: 118px;
    margin: 10px auto 12px;
    border-radius: var(--radius-s);
    overflow: hidden;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
  }
  .podium-card.rank-1 .podium-cover { width: 104px; height: 146px; }
  .podium-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cover-fallback {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--muted);
  }
  .podium-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.2;
    margin: 0 0 6px;
  }

  /* ---------- ledger ---------- */
  .ledger { display: flex; flex-direction: column; gap: 10px; }
  .row {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    display: grid;
    grid-template-columns: 44px 44px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 13px 16px;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  @media (hover: hover) and (pointer: fine) { .row:hover { background: var(--surface-2); border-color: var(--ink-soft); } }
  .row-rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--muted);
    text-align: center;
  }
  .row-rank.rank-1 { color: var(--rank-gold); }
  .row-rank.rank-2 { color: var(--rank-silver); }
  .row-rank.rank-3 { color: var(--rank-bronze); }
  .tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--tag-blue);
    background: var(--tag-blue-soft);
    padding: 1px 7px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .tag-muted {
    background: var(--surface-2);
    color: var(--muted);
  }
  .row-actions-inline { display: flex; gap: 4px; }
  .row-actions-inline .btn-icon { width: 30px; height: 30px; }
  @media (max-width: 560px) {
    .row { grid-template-columns: 30px 34px 1fr auto auto; padding: 12px; gap: 8px; }
  }

  .cat-bars { display: flex; flex-direction: column; gap: 7px; }

  .notes-block h4 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    text-transform: none;
    color: var(--muted);
    margin: 0 0 6px;
    font-weight: 600;
  }
  .notes-block p {
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 16px;
    color: var(--ink-soft);
    white-space: pre-wrap;
  }

  .row-actions { display: flex; gap: 8px; margin-top: 10px; }

  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
  }
  .empty-state h3 { font-family: var(--font-display); color: var(--ink); font-size: 1.3rem; margin-bottom: 8px; }

  /* ---------- modal (dialog) ---------- */
  dialog {
    border: none;
    border-radius: var(--radius-m);
    padding: 0;
    background: var(--surface);
    color: var(--ink);
    width: min(640px, 92vw);
    max-height: 88vh;
    max-height: min(88vh, 88dvh);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    overflow: hidden;
  }
  dialog:not([open]) { display: none; }
  dialog[open] {
    display: flex;
    flex-direction: column;
  }
  dialog form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  dialog::backdrop { background: rgba(20,18,10,0.5); backdrop-filter: blur(1px); }
  .modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    flex-shrink: 0;
  }
  .modal-head h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0; }
  .modal-body { padding: 20px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
  .modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
    background: var(--surface);
    flex-shrink: 0;
  }
  @media (max-width: 640px) {
    dialog {
      width: min(560px, 94vw);
      max-height: 92vh;
      max-height: min(92vh, 92dvh);
    }
    .modal-head { padding: 14px 16px; }
    .modal-body { padding: 16px; }
    .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  }
  .field { margin-bottom: 16px; }
  .field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
  .field-hint { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }
  .cover-input-row { display: flex; gap: 12px; align-items: flex-start; }
  .cover-preview {
    width: 64px; height: 90px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  .cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cover-preview span { font-family: var(--font-display); color: var(--muted); font-size: 1.6rem; }
  .rate-header {
    display: flex; gap: 14px; align-items: center;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
  }
  .rate-header .cover-preview { width: 54px; height: 76px; }
  .rate-header-meta h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
  .rate-header-meta .field-hint { margin: 0; }
  .avatar-preview {
    width: 72px; height: 72px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    overflow: hidden;
  }
  .avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* profile icon picker (sign-up, setup step, edit profile) */
  .avatar-field legend { font-family: var(--font-body); font-size: 0.84rem; font-weight: 700; padding: 0 0 8px; }
  .avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, 52px); justify-content: space-between; gap: 8px; }
  @media (max-width: 480px) { .avatar-picker { grid-template-columns: repeat(auto-fill, 46px); gap: 7px; } }
  .avatar-opt {
    position: relative; aspect-ratio: 1; padding: 3px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
    display: grid; place-items: center; color: var(--ink-soft);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  }
  .avatar-opt img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; display: block; }
  .avatar-opt:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .avatar-opt.is-on { border-color: var(--gold, var(--jade)); box-shadow: 0 0 0 2px var(--jade); transform: scale(1.04); }
  .avatar-opt.is-on::after {
    content: ''; position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 999px;
    background: var(--jade) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
    border: 2px solid var(--surface);
  }
  .avatar-opt-upload { border-style: dashed; gap: 0; align-content: center; }
  .avatar-opt-upload .icon { width: 20px; height: 20px; }
  .avatar-opt-upload span { font-size: 0.72rem; font-weight: 700; line-height: 1.1; text-align: center; }
  .avatar-opt-upload img + span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  @media (hover: hover) { .avatar-opt:hover { transform: translateY(-1px); border-color: var(--jade); } }
  @media (prefers-reduced-motion: reduce) { .avatar-opt, .avatar-opt.is-on { transition: none; transform: none; } }
  .field input, .field textarea, .field select { width: 100%; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  @media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

  .slider-row {
    display: grid;
    grid-template-columns: 150px 1fr 30px;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
  }
  .slider-row label { margin: 0; font-size: 0.85rem; font-weight: 500; color: var(--ink-soft); }
  /* Not scored yet: thumb parked mid-track, hollow and quiet until it's moved */
  .slider-row.is-unset .slider-val { color: var(--muted); }
  .slider-row.is-unset input[type="range"]::-webkit-slider-thumb { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); box-shadow: none; }
  .slider-row.is-unset input[type="range"]::-moz-range-thumb { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); box-shadow: none; }
  .slider-row.is-unset.is-missing label { color: var(--you); }
  .slider-row.is-unset.is-missing .slider-val { color: var(--you); }
  /* Rating sliders: chunky custom track + thumb so they are easy to grab on a phone. */
  input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 28px; margin: 0; padding: 0;
    background: transparent; border: none; cursor: pointer;
    touch-action: pan-y; /* vertical swipes still scroll the dialog */
    --fill: 0%;
  }
  input[type="range"]:focus { outline: none; }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 8px; border-radius: 999px;
    background: linear-gradient(to right, var(--jade) var(--fill), color-mix(in srgb, var(--line) 85%, var(--ink) 15%) var(--fill));
  }
  input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--line) 85%, var(--ink) 15%); }
  input[type="range"]::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--jade); }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; margin-top: -7px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--jade);
    box-shadow: 0 1px 4px rgb(0 0 0 / .25);
    transition: transform .15s ease;
  }
  input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--jade); box-shadow: 0 1px 4px rgb(0 0 0 / .25);
  }
  input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
  input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--jade) 35%, transparent); }
  input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--jade) 35%, transparent); }
  @media (pointer: coarse), (max-width: 640px) {
    /* phone: same one-line layout as desktop, but a narrower label column,
       a taller touch area, a bigger thumb and breathing room between rows */
    .slider-row { grid-template-columns: minmax(84px, 34%) 1fr 34px; gap: 10px; margin-bottom: 0; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
    .slider-row:last-child { border-bottom: none; }
    .slider-row label { font-size: 0.82rem; line-height: 1.25; }
    .slider-row input[type="range"] { height: 44px; }
    .slider-row .slider-val { font-size: 1rem; }
    input[type="range"]::-webkit-slider-runnable-track { height: 10px; }
    input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -9px; }
    input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
  }
  @media (max-width: 480px) {
    /* small phones: label above, so the track gets the full width (≈ 30px per step) */
    .slider-row { grid-template-columns: 1fr 34px; row-gap: 0; }
    .slider-row label { grid-column: 1 / -1; }
  }
  .slider-val { font-family: var(--font-display); font-weight: 700; text-align: right; }

  .score-preview {
    background: var(--surface-2);
    border-radius: var(--radius-s);
    padding: 12px 16px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
  }
  .score-preview .num { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
  .score-preview .lbl { font-size: 0.78rem; color: var(--muted); }

  fieldset { border: none; padding: 0; margin: 0 0 4px; }
  legend { font-family: var(--font-display); font-size: 0.95rem; padding: 0 0 10px; }

  .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .settings-row:last-child { border-bottom: none; }
  .settings-row-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 2px; }

  .cat-manage-row {
    display: flex; gap: 8px; align-items: center; margin-bottom: 8px;
  }
  .cat-manage-row input { flex: 1; }

  .toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--ink);
    color: var(--bg);
    padding: 10px 20px;
    border-radius: var(--radius-s);
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 50;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  .icon { width: 16px; height: 16px; flex-shrink: 0; }

  /* =====================================================================
     Published-site layer: auth, settings, footer, legal pages, profile
     license, friends, compare. Everything reads from the theme tokens.
     ===================================================================== */

  /* ---------- browser surfaces ---------- */
  html { scrollbar-color: color-mix(in srgb, var(--gold) 45%, var(--line)) transparent; }
  ::selection { background: var(--gold-soft); color: var(--ink); }
  input, textarea { caret-color: var(--jade); }
  a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
  :focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  [hidden] { display: none !important; }

  .btn-sm { padding: 6px 12px; font-size: 0.8rem; }
  .btn-block { width: 100%; justify-content: center; }
  .btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
  .link-btn {
    appearance: none; background: none; border: 0; padding: 0;
    font: inherit; font-weight: 700; color: var(--jade); cursor: pointer;
    text-decoration: underline; text-underline-offset: 0.18em;
  }
  @media (hover: hover) and (pointer: fine) { .link-btn:hover { color: var(--ink); } }

  /* ---------- nav ---------- */
  a.nav-logo { text-decoration: none; }
  .nav-logo svg { width: 20px; height: 20px; color: var(--gold-soft); }
  :root[data-theme="dark"] .nav-logo svg { color: #f0e2bb; }
  .nav-signin-btn { padding: 8px 16px; }

  /* ---------- members-only gate ---------- */
  .page.gated .wrap > :not(header):not(.gate-state) { display: none !important; }
  .page:not(.gated) .gate-state { display: none; }
  .gate-state {
    max-width: 520px; margin: 32px auto 0; padding: 36px 32px; text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: 0 10px 30px rgba(40,28,10,0.08);
  }
  .gate-state h2 { font-family: var(--font-display); font-size: 1.45rem; margin: 0 0 8px; }
  .gate-state p { color: var(--ink-soft); margin: 0 0 22px; line-height: 1.55; }
  .gate-state .settings-actions { justify-content: center; }

  /* ---------- forms shared ---------- */
  .form-status { min-height: 0; margin: 0 0 12px; font-size: 0.84rem; line-height: 1.45; color: var(--danger); }
  .form-status:empty { display: none; }
  .form-status[data-kind="info"] { color: var(--jade); }
  .field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .field-label-row label { margin-bottom: 6px; }
  .field-label-row .link-btn { font-size: 0.78rem; }
  .password-field { position: relative; display: flex; }
  .password-field input { width: 100%; padding-right: 64px; }
  .password-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    appearance: none; border: 0; background: transparent; cursor: pointer;
    font: 700 0.74rem var(--font-body); color: var(--muted); padding: 6px 8px; border-radius: var(--radius-s);
  }
  @media (hover: hover) and (pointer: fine) { .password-toggle:hover { color: var(--ink); background: var(--surface-2); } }
  .check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84rem; line-height: 1.45; color: var(--ink-soft); margin: 4px 0 16px; cursor: pointer; }
  .check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--jade); flex-shrink: 0; }
  .check-row a { color: var(--jade); font-weight: 700; }
  .dialog-copy { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; }

  /* ---------- auth dialog ---------- */
  .auth-dialog { width: min(440px, calc(100vw - 24px)); }
  .auth-dialog .modal-body { padding: 22px 24px 24px; }
  .auth-lede { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.55; font-size: 0.93rem; }
  .auth-switch { margin: 16px 0 0; text-align: center; font-size: 0.85rem; color: var(--ink-soft); }
  .auth-notice { text-align: center; }
  .auth-notice p { margin: 0 0 10px; line-height: 1.55; color: var(--ink-soft); }
  .auth-notice-icon { width: 44px; height: 44px; color: var(--gold-text); margin: 4px auto 12px; display: block; }
  .auth-notice-actions { justify-content: center; margin-top: 16px; }

  /* ---------- settings page ---------- */
  .settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 8px; }
  .settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
  .settings-nav a {
    text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.88rem;
    padding: 8px 12px; border-radius: var(--radius-s);
  }
  @media (hover: hover) and (pointer: fine) { .settings-nav a:hover { background: var(--surface-2); color: var(--ink); } }
  .settings-nav .settings-nav-danger { color: var(--danger); }
  .settings-sections { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
  .settings-section {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    padding: 6px 24px 10px; scroll-margin-top: 84px;
  }
  .settings-section h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 18px 0 4px; }
  .settings-section-lede { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.55; margin: 6px 0 16px; max-width: 62ch; }
  .settings-section .settings-row { padding: 16px 0; gap: 20px; }
  .settings-section .settings-row > div:first-child { min-width: 0; }
  .settings-section .field-hint { font-size: 0.8rem; line-height: 1.5; max-width: 60ch; }
  .settings-section .field-hint a { color: var(--jade); font-weight: 700; }
  .settings-row-stack { flex-direction: column; align-items: stretch !important; }
  .settings-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .settings-signin .settings-actions { margin: 4px 0 16px; }
  .settings-profile-preview { display: flex; align-items: center; gap: 14px; }
  .settings-profile-preview img { width: 52px; height: 52px; border-radius: 999px; object-fit: cover; border: 2px solid var(--line); }
  .settings-inline-form { padding: 4px 0 18px; border-bottom: 1px solid var(--line); max-width: 420px; }
  .settings-danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
  .settings-danger h2 { color: var(--danger); }
  .settings-danger .settings-actions { margin-bottom: 16px; }
  .segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; }
  .segmented label { position: relative; cursor: pointer; }
  .segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .segmented span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); transition: background var(--transition), color var(--transition); }
  .segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(40,28,10,0.18); }
  .segmented input:focus-visible + span { outline: 2px solid var(--jade); outline-offset: 1px; }
  @media (max-width: 760px) {
    .settings-layout { grid-template-columns: 1fr; gap: 16px; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 4px; }
    .settings-nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; }
    .settings-section { padding: 4px 18px 8px; }
    .settings-section .settings-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .settings-section .settings-row .btn, .segmented { align-self: flex-start; }
  }

  /* ---------- reading pages (about / privacy / terms) ---------- */
  .prose-page { max-width: 720px; }
  .prose-head { padding-bottom: 22px; margin-bottom: 8px; border-bottom: 1px solid var(--gold); }
  .prose-head h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); margin: 6px 0 10px; letter-spacing: 0.01em; }
  .prose-lede { font-size: 1.08rem; line-height: 1.6; color: var(--ink-soft); margin: 0; max-width: 62ch; }
  .prose-meta { font-size: 0.82rem; color: var(--muted); margin: 0 0 12px; }
  .prose-page h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 36px 0 10px; }
  .prose-page p, .prose-page li { line-height: 1.7; color: var(--ink-soft); max-width: 68ch; }
  .prose-page ul { padding-left: 1.2em; }
  .prose-page li { margin-bottom: 8px; }
  .prose-page li::marker { color: var(--gold-text); }
  .prose-page strong { color: var(--ink); }
  .prose-page a { color: var(--jade); font-weight: 600; }
  .prose-page .prose-meta:last-child { margin-top: 36px; }
  .tier-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
  .tier-list li {
    display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
    padding: 10px 12px; border-radius: var(--radius-m); margin: 0;
    background: var(--tier-soft); border: 1px solid color-mix(in srgb, var(--tier-color) 40%, transparent);
  }
  .tier-list-emblem { grid-row: span 2; width: 30px; height: 30px; color: var(--tier-color); }
  .tier-list-emblem svg { width: 100%; height: 100%; display: block; }
  .tier-list-name { font-family: var(--font-display); font-weight: 700; color: var(--tier-color); line-height: 1.2; }
  .tier-list-range { font-size: 0.78rem; color: var(--ink-soft); }
  .not-found { padding-top: 90px; }
  .not-found h1 { font-family: var(--font-display); color: var(--ink); margin-bottom: 8px; }
  .not-found p { margin-bottom: 22px; }

  /* ---------- footer ---------- */
  .site-footer { position: relative; z-index: 1; margin-top: 48px; border-top: 1px solid var(--gold); background: color-mix(in srgb, var(--surface) 70%, transparent); }
  .site-footer .wrap { padding-top: 0; padding-bottom: 0; }
  .footer-inner { display: grid; grid-template-columns: minmax(200px, 1.2fr) 2fr; gap: 40px; padding: 40px 20px 28px !important; }
  .footer-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: 0.04em; text-decoration: none; color: var(--ink); }
  .footer-brand p { color: var(--ink-soft); font-size: 0.88rem; margin: 8px 0 0; max-width: 30ch; line-height: 1.5; }
  .footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .footer-cols h2 { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-text); margin: 0 0 12px; }
  .footer-cols a { display: block; text-decoration: none; color: var(--ink-soft); font-size: 0.88rem; padding: 4px 0; }
  @media (hover: hover) and (pointer: fine) { .footer-cols a:hover { color: var(--ink); text-decoration: underline; } }
  .footer-base {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted);
  }
  .footer-base a { color: var(--ink-soft); }
  @media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* comfortable thumb targets */
    .footer-cols a { padding: 10px 0; }
  }

  /* ---------- profile: license + ledger ---------- */
  .profile-license-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: stretch; margin-bottom: 26px; }
  .license {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column;
    border-radius: 18px;
    background:
      radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--tier-color) 16%, transparent), transparent 60%),
      linear-gradient(160deg, var(--surface) 0%, color-mix(in srgb, var(--tier-soft) 70%, var(--surface)) 100%);
    border: 1px solid color-mix(in srgb, var(--tier-color) 55%, var(--line));
    box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 18px 40px rgba(40,28,10,0.16), 0 2px 6px rgba(40,28,10,0.08);
    max-width: 560px; width: 100%;
  }
  /* guilloché-style engraved lines, like security printing on a real card */
  .license::before {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
    background: repeating-radial-gradient(circle at 115% 120%, transparent 0 9px, color-mix(in srgb, var(--tier-color) 10%, transparent) 9px 10px);
  }
  .license.prismatic::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
    background: linear-gradient(115deg, #f5d36b, #f08bd1 25%, #8bc6f0 50%, #9cf0b8 75%, #f5d36b);
    background-size: 220% 100%;
    animation: license-sheen 9s ease-in-out infinite alternate;
  }
  @keyframes license-sheen { to { background-position: 100% 0; } }
  .license-band {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; color: #fbf8ef;
    background: linear-gradient(90deg, color-mix(in srgb, var(--tier-color) 88%, #000), var(--tier-color));
    font-family: var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; font-weight: 700;
  }
  .license-org { font-size: 0.86rem; letter-spacing: 0.08em; font-weight: 800; }
  .license-body { position: relative; display: flex; gap: 20px; padding: 20px 20px 12px; }
  .license-watermark { position: absolute; right: -14px; bottom: -26px; width: 170px; height: 170px; color: var(--tier-color); opacity: .09; pointer-events: none; }
  .license-watermark svg { width: 100%; height: 100%; display: block; }
  .license-photo {
    width: 96px; height: 120px; object-fit: cover; border-radius: 10px; flex-shrink: 0;
    border: 1px solid color-mix(in srgb, var(--tier-color) 45%, var(--line));
    box-shadow: 0 6px 14px rgba(40,28,10,0.18);
    background: var(--surface-2);
  }
  .license-main { min-width: 0; flex: 1; position: relative; }
  .license-name { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; overflow-wrap: anywhere; }
  .license-tier { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; color: var(--tier-color); font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
  .license-range { font-family: var(--font-body); font-weight: 600; font-size: 0.74rem; color: var(--ink-soft); margin-left: 2px; }
  .license-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
  .license-fields div { min-width: 0; }
  .license-field-wide { grid-column: 1 / -1; }
  .license-fields dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
  .license-fields dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .license-progress { padding: 4px 20px 14px; }
  .license-progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 6px; }
  .license-progress-next { font-family: var(--font-display); font-weight: 700; color: var(--tier-color); }
  .license-foot {
    display: flex; justify-content: space-between; gap: 12px; margin-top: auto;
    padding: 9px 20px; border-top: 1px dashed color-mix(in srgb, var(--tier-color) 40%, var(--line));
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .profile-ledger {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    padding: 18px 22px; display: flex; flex-direction: column;
  }
  .profile-ledger h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 6px; }
  .ledger-list { margin: 0; }
  .ledger-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .ledger-list div:last-child { border-bottom: 0; }
  .ledger-list dt { color: var(--ink-soft); font-size: 0.88rem; }
  .ledger-list dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-align: right; }
  .ledger-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }
  .h-cover-icon { display: flex; align-items: center; justify-content: center; color: var(--gold-text); background: var(--gold-soft); }
  .h-cover-icon .icon { width: 20px; height: 20px; }
  @media (max-width: 820px) { .profile-license-row { grid-template-columns: 1fr; } .license { max-width: none; } }
  @media (max-width: 420px) {
    .license-body { gap: 14px; padding: 16px 16px 10px; }
    .license-photo { width: 76px; height: 96px; }
    .license-name { font-size: 1.3rem; }
    .license-band, .license-progress, .license-foot { padding-left: 16px; padding-right: 16px; }
  }
  .friend-view-license { margin-bottom: 18px; }
  .friend-view-license .license { max-width: none; }

  /* ---------- friends ---------- */
  .friend-search { position: relative; margin: 6px 0 26px; max-width: 560px; }
  .friend-search input { width: 100%; }
  .friend-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
    box-shadow: var(--shadow-lift); padding: 6px; max-height: 360px; overflow-y: auto;
  }
  .friend-result { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-s); }
  @media (hover: hover) and (pointer: fine) { .friend-result:hover { background: var(--surface-2); } }
  .friend-result img { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; }
  .friend-result-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .friend-result-state { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
  .friend-results-empty { margin: 0; padding: 12px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }
  .request-group { margin-bottom: 22px; }
  .request-group h2, .friends-section-title { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
  .friends-count { font-family: var(--font-body); font-size: 0.74rem; font-weight: 800; color: var(--gold-text); background: var(--gold-soft); border-radius: 999px; padding: 2px 8px; }
  .friends-count:empty { display: none; }
  .request-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  }
  .request-group:not(.request-group-quiet) .request-row { border-color: color-mix(in srgb, var(--jade) 45%, var(--line)); background: color-mix(in srgb, var(--jade-soft) 55%, var(--surface)); }
  .request-row img { width: 40px; height: 40px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
  .request-who { flex: 1; min-width: 0; }
  .request-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .request-meta { font-size: 0.78rem; color: var(--muted); }
  .request-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .request-group-quiet .request-row { background: transparent; border-style: dashed; }
  .friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  .friend-card {
    display: flex; flex-direction: column; gap: 14px; padding: 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .friend-card:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); box-shadow: 0 12px 26px rgba(40,28,10,0.1); } }
  .friend-card-who {
    appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-align: left;
    display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px; align-items: center;
  }
  .friend-card-who img { grid-row: span 2; width: 56px; height: 56px; border-radius: 999px; object-fit: cover; border: 2px solid var(--line); }
  .friend-card-who .tier-badge { justify-self: start; }
  .friend-card-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: end; }
  @media (hover: hover) and (pointer: fine) { .friend-card-who:hover .friend-card-name { text-decoration: underline; } }
  .friend-card-match { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; row-gap: 6px; }
  .friend-card-pct { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--jade); line-height: 1; }
  .friend-card-label { font-size: 0.78rem; color: var(--ink-soft); }
  .friend-card-match .match-meter { grid-column: 1 / -1; }
  .friend-card-actions { display: flex; gap: 8px; margin-top: auto; }
  .friend-card-actions .btn-primary { flex: 1; justify-content: center; }
  .match-meter { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
  .match-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--series, var(--jade)); }

  /* ---------- compare ---------- */
  .compare-sidebar { padding: 16px; }
  .compare-friend-chip { appearance: none; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
  .compare-empty-hero .btn { margin-top: 16px; }
  .duel {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
    padding: 30px 28px; margin-bottom: 20px; border-radius: var(--radius-l);
    background: var(--surface); border: 1px solid var(--line);
  }
  .duel::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background:
      radial-gradient(60% 120% at 0% 50%, color-mix(in srgb, var(--you) 13%, transparent), transparent 70%),
      radial-gradient(60% 120% at 100% 50%, color-mix(in srgb, var(--series) 16%, transparent), transparent 70%);
  }
  .duel-side { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
  .duel-them { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
  @media (hover: hover) and (pointer: fine) { .duel-them:hover .duel-name { text-decoration: underline; } }
  .duel-side img { width: 88px; height: 88px; border-radius: 999px; object-fit: cover; border: 3px solid var(--you); box-shadow: 0 8px 18px rgba(40,28,10,0.18); }
  .duel-them img { border-color: var(--series); }
  .duel-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .duel-score { text-align: center; padding: 0 8px; }
  .duel-pct { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.8rem, 7vw, 4.2rem); line-height: 1; color: var(--ink); }
  .duel-pct span { font-size: 0.5em; color: var(--muted); margin-left: 2px; }
  .duel-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 800; margin-top: 4px; }
  .duel-verdict { font-family: var(--font-display); font-weight: 700; color: var(--gold-text); margin-top: 10px; }
  .duel-meta { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; }
  @media (max-width: 560px) {
    .duel { grid-template-columns: 1fr 1fr; padding: 22px 16px; }
    .duel-score { grid-column: 1 / -1; order: -1; }
    .duel-side img { width: 64px; height: 64px; }
  }
  .compare-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; margin-bottom: 20px; }
  .compare-board h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 12px; }
  .compare-board-list { list-style: none; margin: 0; padding: 0; }
  .compare-board-list li { display: grid; grid-template-columns: 22px minmax(0, 190px) 1fr 52px auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .compare-board-list li:last-child { border-bottom: 0; }
  .cb-rank { font-family: var(--font-display); font-weight: 800; color: var(--muted); text-align: center; }
  .cb-who { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; min-width: 0; }
  .cb-who img { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; border: 2px solid var(--series); flex-shrink: 0; }
  .cb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (hover: hover) and (pointer: fine) { .cb-who:hover .cb-name { text-decoration: underline; } }
  .cb-meter { height: 8px; }
  .cb-pct { font-family: var(--font-display); font-weight: 800; text-align: right; }
  .cb-meta { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
  @media (max-width: 560px) {
    .compare-board-list li { grid-template-columns: 22px minmax(0, 1fr) 52px; }
    .cb-meter, .cb-meta { display: none; }
  }
  .compare-ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
  .compare-ad-col { padding: 16px 16px 10px; }
  .compare-ad-col h3 { margin-bottom: 10px; }
  .compare-ad-argue h3 { color: var(--you); }
  a.compare-ad-row { text-decoration: none; color: inherit; padding: 6px; margin: 0 -6px 4px; border-radius: var(--radius-s); }
  @media (hover: hover) and (pointer: fine) { a.compare-ad-row:hover { background: var(--surface-2); } }
  .compare-ad-scores .you-val { color: var(--you); font-weight: 800; }
  .compare-ad-scores .them-val { color: var(--series); font-weight: 800; }
  .compare-ad-scores .vs { font-family: var(--font-body); font-size: 0.7rem; color: var(--muted); }
  .compare-faceoff { padding: 18px 20px; margin-bottom: 20px; }
  .faceoff-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
  .faceoff-head h3 { margin: 0; }
  .faceoff-head .field-hint { margin: 0; flex: 1 1 260px; }
  .faceoff-legend { display: flex; gap: 14px; font-size: 0.78rem; font-weight: 700; }
  .faceoff-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
  .lg-you::before { background: var(--you); }
  .lg-them::before { background: var(--series); }
  .compare-faceoff .faceoff-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 74px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
  .compare-faceoff .faceoff-label { margin: 0; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-faceoff .faceoff-track { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
  .compare-faceoff .faceoff-track.you { justify-content: flex-end; }
  .compare-faceoff .faceoff-track > span { display: block; height: 100%; border-radius: inherit; }
  .compare-faceoff .faceoff-track.you > span { background: var(--you); }
  .compare-faceoff .faceoff-track.them > span { background: var(--series); }
  .compare-faceoff .faceoff-vals { display: flex; justify-content: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 0.84rem; }
  .compare-faceoff .faceoff-vals .you-val { color: var(--you); }
  .compare-faceoff .faceoff-vals .them-val { color: var(--series); }
  @media (max-width: 560px) {
    .compare-faceoff .faceoff-row { grid-template-columns: 1fr 64px 1fr; row-gap: 4px; }
    .compare-faceoff .faceoff-label { grid-column: 1 / -1; }
  }
  .compare-table-wrap { padding: 0; }
  .compare-table-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 16px 18px 10px; }
  .compare-table-head h3 { padding: 0; margin: 0; }
  .compare-table-head .field-hint { margin: 0; }
  .compare-table { overflow-x: auto; }
  .compare-table .compare-table-row {
    display: grid; grid-template-columns: minmax(180px, 2.2fr) repeat(calc(var(--cols) + 1), minmax(64px, 1fr));
    min-width: calc(260px + (var(--cols) + 1) * 72px); text-decoration: none; color: inherit;
  }
  @media (hover: hover) and (pointer: fine) { .compare-table a.compare-table-row:hover { background: var(--surface-2); } }
  .compare-table .compare-table-row .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .ct-cover { width: 26px; height: 36px; border-radius: 4px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--line); }
  .ct-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .ct-cover .cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; }
  .ct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-table .score.you-col { color: var(--you); }
  .compare-table .head .score { color: var(--series, var(--muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-table .head .score.you-col { color: var(--you); }
  .compare-table-empty { padding: 14px 18px 18px; margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
  @media (max-width: 820px) {
    .compare-sidebar { padding: 12px; }
    #compareFriendPicker { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
    #compareFriendPicker .compare-friend-chip { width: auto; flex-shrink: 0; margin: 0; }
    #compareFriendPicker .compare-friend-chip .name { max-width: 140px; }
  }

  @media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  }

  /* short pages still put the footer at the bottom of the screen */
  body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; height: auto; }
  body > .page.active { flex: 1 0 auto; }
  .compare-layout > * { min-width: 0; }
  .license-band { background: linear-gradient(90deg, color-mix(in srgb, var(--tier-color) 50%, #000), color-mix(in srgb, var(--tier-color) 62%, #000)); }
  @media (max-width: 820px) { #compareFriendPicker .compare-friend-chip:not(.selected) { background: var(--surface-2); } }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --btn-primary-a: color-mix(in srgb, var(--jade) 62%, #000); --btn-primary-b: color-mix(in srgb, var(--gold) 58%, #000); }
  }
  :root[data-theme="dark"] { --btn-primary-a: color-mix(in srgb, var(--jade) 62%, #000); --btn-primary-b: color-mix(in srgb, var(--gold) 58%, #000); }

  /* =====================================================================
     v3: tier medals, grades, rank rows, podiums, title page, account pill
     ===================================================================== */
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  /* ---------- grade palette (S → F) ---------- */
  .grade-s { --g: var(--gold);          --g-soft: var(--gold-soft); }
  .grade-a { --g: var(--jade);          --g-soft: var(--jade-soft); }
  .grade-b { --g: var(--tag-blue);      --g-soft: var(--tag-blue-soft); }
  .grade-c { --g: var(--tier-platinum); --g-soft: var(--tier-platinum-soft); }
  .grade-d { --g: var(--rank-bronze);   --g-soft: var(--rank-bronze-soft); }
  .grade-f { --g: var(--you);           --g-soft: var(--you-soft); }
  .grade {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 1.55em; height: 1.55em; border-radius: 6px;
    font: 900 0.78rem/1 var(--font-display);
    color: var(--g); background: var(--g-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 55%, transparent);
  }
  .grade.grade-s { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 26%, var(--gold-soft)), var(--gold-soft)); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 2px color-mix(in srgb, var(--gold) 18%, transparent); }

  /* ---------- tier medals ---------- */
  .tier-medal {
    --surface: var(--tier-soft);
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: var(--medal); height: var(--medal); border-radius: 50%;
    color: var(--tier-color);
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tier-soft) 70%, #fff) 0%, var(--tier-soft) 60%);
    box-shadow: inset 0 0 0 max(1.5px, calc(var(--medal) * 0.05)) var(--tier-color), inset 0 0 0 calc(var(--medal) * 0.1) color-mix(in srgb, var(--tier-color) 16%, transparent), 0 2px 6px rgba(40,28,10,0.18);
  }
  .tier-medal svg { width: 58%; height: 58%; display: block; }
  .tier-medal.prismatic { box-shadow: inset 0 0 0 max(1.5px, calc(var(--medal) * 0.05)) var(--tier-color), 0 0 calc(var(--medal) * 0.35) color-mix(in srgb, var(--tier-color) 45%, transparent); }
  .tier-badge { gap: 5px; }
  .tier-badge-emblem { display: inline-flex; width: 12px; height: 12px; --surface: var(--tier-soft); }
  .tier-badge-emblem svg { width: 100%; height: 100%; }

  /* ---------- license: medal, level, motto, XP ---------- */
  .license-body { padding-right: 104px; }
  .license-medal { position: absolute; top: 16px; right: 18px; }
  .license-watermark { opacity: .06; }
  .license-level {
    display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; margin-right: 4px;
    font: 900 0.72rem/1.2 var(--font-display); letter-spacing: .04em;
    color: var(--surface); background: color-mix(in srgb, var(--tier-color) 85%, #000);
  }
  .license-motto { font-size: 0.82rem; font-style: italic; color: var(--ink-soft); margin: -8px 0 14px; }
  .xp-bar { position: relative; display: block; height: 10px; border-radius: 999px; overflow: hidden;
    background: color-mix(in srgb, var(--tier-color) 14%, var(--surface-2));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.18); }
  .xp-bar > span { position: absolute; inset: 0 auto 0 0; width: var(--xp, 0%); border-radius: inherit;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 6px, transparent 6px 12px), linear-gradient(90deg, color-mix(in srgb, var(--tier-color) 70%, var(--gold)), var(--tier-color));
    box-shadow: 0 0 8px color-mix(in srgb, var(--tier-color) 55%, transparent);
    animation: xp-fill .9s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes xp-fill { from { width: 0; } }
  /* phones: the medal is stamped on the photo corner instead of over the fields */
  @media (max-width: 420px) { .license-body { padding-right: 16px; } .license-medal { top: 86px; left: 54px; right: auto; bottom: auto; z-index: 1; } .license-medal .tier-medal { --medal: 40px !important; } }

  /* ---------- rank path ---------- */
  .rank-path-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 22px 22px; margin-bottom: 26px; }
  .rank-path-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 18px; }
  .rank-path-head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
  .rank-path-head .field-hint { margin: 0; }
  .rank-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; }
  .rank-path::before { content: ''; position: absolute; left: 7%; right: 7%; top: 28px; height: 3px; background: var(--line); border-radius: 3px; }
  .rank-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
  .rank-step .tier-medal { margin-top: calc((58px - var(--medal)) / 2); }
  .rank-step-name { font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--tier-color); }
  .rank-step-req { font-size: 0.72rem; color: var(--muted); }
  .rank-step.locked .tier-medal { filter: grayscale(1); opacity: .45; }
  .rank-step.locked .rank-step-name { color: var(--muted); }
  .rank-step.current .tier-medal { animation: medal-pulse 2.6s ease-in-out infinite; }
  .rank-step.current .rank-step-req { color: color-mix(in srgb, var(--tier-color) 75%, var(--ink)); font-weight: 800; }
  @keyframes medal-pulse { 50% { transform: scale(1.06); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--tier-color) 55%, transparent)); } }
  @media (max-width: 720px) {
    .rank-path { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 92px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
    .rank-path::before { left: 46px; right: auto; width: calc(92px * 6); }
  }

  /* ---------- level-up celebration ---------- */
  .level-up { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(12,13,16,0.55); backdrop-filter: blur(3px); }
  .level-up-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
    padding: 30px 40px 26px; border-radius: 22px; background: var(--surface);
    border: 1px solid var(--tier-color); box-shadow: 0 30px 60px rgba(0,0,0,0.35), 0 12px 40px -8px color-mix(in srgb, var(--tier-color) 30%, transparent);
    animation: level-in .6s cubic-bezier(.16,1,.3,1) both;
  }
  .level-up-card .tier-medal { animation: medal-pulse 2.2s ease-in-out .6s infinite; }
  .level-up-title { font: 900 1.6rem/1.15 var(--font-display); color: var(--tier-color); margin-top: 6px; }
  .level-up-motto { color: var(--ink-soft); font-style: italic; margin-bottom: 10px; }
  @keyframes level-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }

  /* ---------- account pill (nav) ---------- */
  .nav-account { position: relative; }
  .nav-account-btn {
    appearance: none; cursor: pointer; font: inherit; color: var(--ink);
    display: flex; align-items: center; gap: 10px; min-width: 210px;
    padding: 5px 12px 5px 5px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .nav-account.open .nav-account-btn { border-color: color-mix(in srgb, var(--tier-color) 60%, var(--line)); box-shadow: 0 6px 16px rgba(40,28,10,0.12); }
  @media (hover: hover) and (pointer: fine) { .nav-account-btn:hover { border-color: color-mix(in srgb, var(--tier-color) 60%, var(--line)); box-shadow: 0 6px 16px rgba(40,28,10,0.12); } }
  .nav-account-avatar { position: relative; flex-shrink: 0; }
  .nav-account-avatar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--tier-color); }
  .nav-account-medal { position: absolute; right: -6px; bottom: -5px; line-height: 0; }
  .nav-account-medal .tier-medal { box-shadow: inset 0 0 0 1.5px var(--tier-color), 0 0 0 2px var(--surface); }
  .nav-account-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; margin-left: 4px; }
  .nav-account-text .nav-profile-name { font-weight: 800; font-size: 0.9rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-account-tier { display: flex; align-items: center; gap: 7px; width: 100%; font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--tier-color); white-space: nowrap; }
  .xp-bar-mini { flex: 1; min-width: 34px; height: 5px; box-shadow: none; }
  .xp-bar-mini > span { box-shadow: none; background: var(--tier-color); animation: none; }
  .nav-account-chevron { color: var(--muted); transition: transform var(--transition); }
  .nav-account.open .nav-account-chevron { transform: rotate(180deg); }
  .nav-account-menu { right: 0; left: auto; min-width: 210px; }
  .nav-account-menu a.nav-dropdown-item { text-decoration: none; display: block; }
  .nav-account-signout { border-top: 1px solid var(--line) !important; margin-top: 4px; color: var(--danger) !important; }
  @media (max-width: 640px) {
    .nav-account-btn { min-width: 0; padding-right: 8px; }
    .nav-account-text { display: none; }
  }

  /* ---------- ranking summary ---------- */
  .ranking-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 22px; }
  .ranking-summary:empty { display: none; }
  .summary-stat { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 16px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); min-width: 120px; }
  .summary-num { font: 800 1.45rem/1.1 var(--font-display); }
  .summary-num-text { font-size: 1.05rem; }
  .summary-label { font-size: 0.74rem; color: var(--muted); }
  .summary-grades { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .grade-count { display: inline-flex; align-items: center; gap: 5px; font: 700 0.9rem var(--font-display); }

  /* ---------- score block ---------- */
  .score-block { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 150px; }
  .score-line { display: flex; align-items: center; gap: 8px; }
  .score-num { font: 800 1.6rem/1 var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
  .score-of { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-left: -4px; align-self: flex-end; }
  .score-bar { display: block; width: 150px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
  .score-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--g) 55%, var(--surface-2)), var(--g)); }
  .score-sub { font-size: 0.74rem; color: var(--muted); }
  .score-block.is-empty .score-num { color: var(--muted); }
  .score-block.grade-s .score-num { color: var(--gold-text); }

  /* ---------- rank rows (personal, community, watchlist) ---------- */
  .rank-row {
    display: grid; grid-template-columns: 64px 56px minmax(0, 1fr) auto auto; align-items: center; gap: 16px;
    padding: 12px 16px 12px 10px; border-radius: var(--radius-m);
    background: var(--surface); border: 1px solid var(--line); cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  }
  #watchlistLedger .rank-row { grid-template-columns: 56px minmax(0, 1fr) auto auto; padding-left: 12px; }
  @media (hover: hover) and (pointer: fine) { .rank-row:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 10px 24px rgba(40,28,10,0.10); transform: translateY(-1px); } }
  .rank-row:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .rank-row.top-1 { border-color: color-mix(in srgb, var(--rank-gold) 60%, var(--line)); background: linear-gradient(90deg, color-mix(in srgb, var(--rank-gold-soft) 70%, var(--surface)), var(--surface) 45%); }
  .rank-row.top-2 { background: linear-gradient(90deg, color-mix(in srgb, var(--rank-silver-soft) 70%, var(--surface)), var(--surface) 45%); }
  .rank-row.top-3 { background: linear-gradient(90deg, color-mix(in srgb, var(--rank-bronze-soft) 70%, var(--surface)), var(--surface) 45%); }
  .rank-num { font: 900 1.55rem/1 var(--font-display); text-align: center; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .rank-hash { font-size: 0.6em; vertical-align: 0.35em; margin-right: 1px; opacity: .55; }
  .rank-num.rank-1 { color: var(--rank-gold); font-size: 1.9rem; }
  .rank-num.rank-2 { color: var(--rank-silver); font-size: 1.75rem; }
  .rank-num.rank-3 { color: var(--rank-bronze); font-size: 1.7rem; }
  .rank-num.rank-none { color: var(--muted); font-size: 1rem; }
  .rank-cover { width: 56px; height: 80px; border-radius: 7px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 4px 10px rgba(40,28,10,0.14); }
  .rank-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .rank-cover .cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font: 700 1.2rem var(--font-display); color: var(--muted); }
  .rank-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
  .rank-title { font-weight: 800; font-size: 1.02rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .rank-meta { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .mine-chip { font-size: 0.72rem; font-weight: 800; color: var(--you); background: var(--you-soft); border-radius: 999px; padding: 2px 9px; margin-top: 2px; }
  .mine-chip.is-empty { color: var(--muted); background: transparent; border: 1px dashed var(--line); font-weight: 600; }
  .rank-row .row-actions-inline { display: flex; align-items: center; gap: 6px; }
  .rank-row .row-actions-inline .btn-icon { opacity: .55; transition: opacity var(--transition); }
  .rank-row:focus-within .row-actions-inline .btn-icon { opacity: 1; }
  @media (hover: hover) and (pointer: fine) { .rank-row:hover .row-actions-inline .btn-icon { opacity: 1; } }
  .ledger { gap: 8px; }
  @media (max-width: 640px) {
    .rank-row { grid-template-columns: 34px 46px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
    #watchlistLedger .rank-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
    .rank-row .row-actions-inline { grid-column: 1 / -1; justify-content: flex-end; margin-top: -4px; }
    #pageCommunity .rank-row .row-actions-inline { grid-column: auto; grid-row: 1; position: absolute; }
    .rank-num { font-size: 1.15rem !important; }
    .rank-cover { width: 46px; height: 66px; }
    .score-block { min-width: 0; }
    .score-num { font-size: 1.25rem; }
    .score-bar { width: 78px; }
    .rank-title { font-size: 0.92rem; }
  }
  #pageCommunity .rank-row { position: relative; }
  @media (max-width: 640px) { #pageCommunity .rank-row .row-actions-inline { top: 6px; right: 6px; margin: 0; } #pageCommunity .rank-row .watchlist-toggle-btn { width: 28px; height: 28px; } }

  /* ---------- podium ---------- */
  .podium { gap: 16px; align-items: end; }
  .podium-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: inherit;
    padding: 18px 16px 16px; border-radius: var(--radius-l); position: relative; overflow: hidden;
  }
  .podium-card .score-block { align-items: center; min-width: 0; }
  .podium-card .score-bar { width: 120px; }
  .podium-cover { position: relative; width: 112px; height: 160px; border-radius: 10px; overflow: visible; border: 0; }
  .podium-cover > img, .podium-cover > .cover-fallback { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; box-shadow: 0 12px 24px rgba(40,28,10,0.25); }
  .podium-card.rank-1 .podium-cover { width: 140px; height: 200px; }
  .podium-medal {
    position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    font: 900 1rem var(--font-display); color: #fbf8ef;
    box-shadow: 0 0 0 3px var(--surface), 0 4px 10px rgba(0,0,0,0.25);
  }
  .podium-card.rank-1 .podium-medal { background: linear-gradient(135deg, #e7c66f, #9c7527); width: 40px; height: 40px; font-size: 1.15rem; }
  .podium-card.rank-2 .podium-medal { background: linear-gradient(135deg, #c9ccc0, #74786a); }
  .podium-card.rank-3 .podium-medal { background: linear-gradient(135deg, #e6b892, #a8754c); }
  .podium-name { margin-top: 12px; font: 700 1rem/1.25 var(--font-display); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  /* ---------- home + browse grade chips ---------- */
  .home-lb-score { display: flex; align-items: center; gap: 6px; }
  .home-lb-score .grade { font-size: 0.72rem; }
  .browse-card-score { display: inline-flex; align-items: center; gap: 5px; }
  .browse-card-score .grade { font-size: 0.72rem; }

  /* ---------- title (anime) page ---------- */
  .detail-hero { position: relative; height: 260px; overflow: hidden; }
  .detail-hero-art { position: absolute; inset: -30px; background-size: cover; background-position: center 30%; filter: blur(22px) saturate(1.2); opacity: .55; transform: scale(1.1); }
  .detail-hero-art.has-banner { inset: 0; filter: none; opacity: .9; transform: none; }
  .detail-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 20%, transparent) 0%, transparent 40%, var(--bg) 100%); }
  .detail-hero-inner { position: relative; z-index: 2; padding-top: 18px; }
  .title-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; margin-top: -150px; position: relative; z-index: 3; padding-bottom: 20px; }
  .title-side { display: flex; flex-direction: column; gap: 16px; }
  .title-side .anime-detail-cover { border-width: 4px; }
  .title-actions { display: flex; gap: 8px; align-items: center; }
  .title-actions .btn-block { flex: 1; }
  .title-main { min-width: 0; padding-top: 70px; }
  .title-main h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; margin: 6px 0 4px; }
  .title-alt { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; min-height: 1em; }
  .title-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; margin-bottom: 18px; }
  .title-panel h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 12px; }
  .title-side .title-panel { margin-bottom: 0; }
  .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  .panel-head h2 { margin: 0; }
  .title-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
  .title-grid .title-panel { margin-bottom: 18px; }
  .stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
  .stat-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px 10px; text-align: center; border-right: 1px solid var(--line); }
  .stat-cell:last-child { border-right: 0; }
  .stat-num { font: 900 1.7rem/1 var(--font-display); color: var(--ink); }
  .stat-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .stat-score { background: linear-gradient(180deg, color-mix(in srgb, var(--g, var(--gold)) 14%, var(--surface)), var(--surface)); }
  .stat-score .stat-num { font-size: 2.3rem; color: var(--g, var(--ink)); }
  .stat-you .stat-num { color: var(--you); }
  .info-list { margin: 0; display: flex; flex-direction: column; }
  .info-list div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.84rem; }
  .info-list div:last-of-type { border-bottom: 0; }
  .info-list dt { color: var(--muted); }
  .info-list dd { margin: 0; font-weight: 600; }
  .info-list .anilist-link { display: inline-block; margin-top: 10px; color: var(--jade); font-weight: 700; font-size: 0.84rem; }
  .breakdown { display: flex; flex-direction: column; gap: 9px; }
  .bd-summary { margin: 0 0 14px; font-size: 0.86rem; color: var(--ink-soft); }
  .bd-summary strong { color: var(--ink); }
  .bd-row { display: grid; grid-template-columns: minmax(80px, 36%) 1fr 66px; align-items: center; gap: 12px; font-size: 0.84rem; min-height: 26px; }
  .bd-label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bd-track { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }
  .bd-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 45%, var(--surface-2)), var(--gold)); }
  /* your score: a thin upright line that sits across the gold bar, with a light halo so it reads on gold */
  .bd-you { position: absolute; top: 50%; width: 3px; height: 20px; margin-left: -1.5px; transform: translateY(-50%); border-radius: 2px; background: var(--you); box-shadow: 0 0 0 1.5px var(--surface); }
  .bd-vals { display: flex; justify-content: flex-end; gap: 10px; font: 700 0.88rem var(--font-display); color: var(--gold-text); font-variant-numeric: tabular-nums; }
  .bd-you-val { color: var(--you); }
  @media (max-width: 520px) {
    .bd-row { grid-template-columns: minmax(70px, 34%) 1fr 70px; gap: 8px; }
    .bd-label { white-space: normal; line-height: 1.25; font-size: 0.8rem; }
  }
  .breakdown-legend { display: flex; gap: 12px; font-size: 0.74rem; font-weight: 700; color: var(--ink-soft); }
  .breakdown-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
  .lg-community::before { background: var(--gold); }
  .breakdown-legend .lg-you::before { background: var(--you); width: 3px; height: 13px; border-radius: 2px; vertical-align: -2px; }
  .dist { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; align-items: end; height: 150px; }
  .dist-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
  .dist-count { font: 700 0.7rem var(--font-display); color: var(--muted); min-height: 1em; }
  .dist-bar { width: 100%; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--g), color-mix(in srgb, var(--g) 55%, var(--surface-2))); }
  .dist-col.is-you .dist-bar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--you); }
  .dist-axis { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; margin-top: 6px; font-size: 0.72rem; color: var(--muted); text-align: center; }
  .dist-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 0.74rem; color: var(--muted); }
  .dist-you-key { width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 2px var(--you); }
  .synopsis-panel p { line-height: 1.7; color: var(--ink-soft); max-width: 70ch; margin: 0; }
  .synopsis-panel .notes-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
  .synopsis-panel .notes-block h3 { font: 700 0.9rem var(--font-display); margin: 0 0 6px; }
  .anime-detail-recommended h2 { font-family: var(--font-display); font-size: 1.1rem; margin: 8px 0 12px; }
  .owner-tools { border-style: dashed; }
  .owner-form { display: flex; gap: 6px; margin-top: 10px; }
  .owner-form input { flex: 1; min-width: 0; }
  .owner-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 300px; overflow-y: auto; }
  .owner-result { appearance: none; display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px; border-radius: var(--radius-s); border: 1px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
  @media (hover: hover) and (pointer: fine) { .owner-result:hover { background: var(--surface-2); border-color: var(--line); } }
  .owner-result img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
  .owner-result span { display: flex; flex-direction: column; font-size: 0.82rem; }
  @media (max-width: 860px) {
    .title-layout { grid-template-columns: 1fr; margin-top: -120px; gap: 18px; }
    .title-side { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: end; }
    .title-side .anime-detail-cover { grid-row: span 2; }
    .title-side .info-panel, .title-side .owner-tools { grid-column: 1 / -1; }
    .title-main { padding-top: 0; }
    .title-grid { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-cell:nth-child(2) { border-right: 0; }
    .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  }
  @media (prefers-reduced-motion: reduce) {
    .rank-step.current .tier-medal, .level-up-card .tier-medal, .license.prismatic::after { animation: none !important; }
  }
  .avatar-medal-wrap { position: relative; display: inline-block; line-height: 0; }
  .avatar-medal-wrap > .tier-medal { position: absolute; right: -4px; bottom: -2px; box-shadow: inset 0 0 0 1.5px var(--tier-color), 0 0 0 2px var(--surface); }
  .friend-card-who .avatar-medal-wrap { grid-row: span 2; }
  @media (max-width: 640px) {
    #pageCommunity .rank-row .row-actions-inline { position: static; grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; margin-top: -6px; }
    .score-of { display: none; }
    .mine-chip { white-space: nowrap; font-size: 0.72rem; }
  }
  @media (max-width: 860px) {
    .title-layout { display: flex; flex-direction: column; gap: 16px; }
    .title-side { display: contents; }
    .title-side .anime-detail-cover { order: 1; width: 160px; }
    .title-actions { order: 2; }
    .title-main { order: 3; }
    .info-panel { order: 4; }
    .owner-tools { order: 5; }
  }
  @media (max-width: 640px) {
    #pageCommunity .rank-row { grid-template-rows: auto auto; row-gap: 6px; }
    #pageCommunity .rank-row > .rank-num { grid-column: 1; grid-row: 1; align-self: end; }
    #pageCommunity .rank-row > .rank-cover { grid-column: 2; grid-row: 1 / span 2; }
    #pageCommunity .rank-row > .rank-main { grid-column: 3; grid-row: 1 / span 2; }
    #pageCommunity .rank-row > .score-block { grid-column: 4; grid-row: 1 / span 2; }
    #pageCommunity .rank-row .row-actions-inline { grid-column: 1; grid-row: 2; justify-content: center; align-self: start; margin: 0; }
  }
  .empty-state .empty-title { font-family: var(--font-display); color: var(--ink); font-size: 1.3rem; margin: 0 0 8px; }
  .compare-sidebar-title { font-family: var(--font-display); font-size: 0.92rem; margin: 0 0 10px; }
  .field-hint { font-size: 0.78rem; }
  .level-up-card { animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
  .nav-notif-badge { color: var(--bg); }

  /* =====================================================================
     v4: phone tab bar, section switch, nav search, seasonal, characters,
     XP feedback, submissions, phone polish
     ===================================================================== */

  /* ---------- section switch (Yours | Community, Friends | Compare | Watchlist) ---------- */
  /* page sections (Community / Mine / Deep cuts …): one segmented control with a lit marker */
  .section-switch { display: inline-flex; gap: 2px; padding: 4px; margin: -6px 0 24px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .section-switch a { white-space: nowrap; text-decoration: none; padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; color: var(--muted); transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
  @media (hover: hover) and (pointer: fine) { .section-switch a:not(.active):hover { color: var(--ink); } }
  .section-switch a.active { color: var(--ink); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent), 0 2px 10px rgb(0 0 0 / .12); }
  .section-switch a:active { transform: scale(.97); }
  .section-switch a:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .page.gated .wrap > .section-switch { display: inline-flex !important; }

  /* ---------- nav search ---------- */
  .nav-search { position: relative; display: flex; align-items: center; }
  .nav-search-open { display: none; }
  .nav-search-panel { position: relative; display: flex; align-items: center; }
  .nav-search-icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
  .nav-search-panel input { width: 230px; padding: 8px 34px 8px 34px; border-radius: 999px; background: var(--surface); transition: width var(--transition), border-color var(--transition); }
  .nav-search-panel input:focus { width: 300px; }
  .nav-search-close { display: none; }
  .nav-search-results {
    position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, 92vw); z-index: 60;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
    box-shadow: 0 18px 40px rgba(20,16,8,0.22); padding: 6px; max-height: 70vh; overflow-y: auto;
  }
  .search-hit { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--radius-s); text-decoration: none; color: inherit; }
  .search-hit.active { background: var(--surface-2); }
  @media (hover: hover) and (pointer: fine) { .search-hit:hover { background: var(--surface-2); } }
  .search-hit-cover { width: 34px; height: 48px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
  .search-hit-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .search-hit-cover .cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font: 700 0.8rem var(--font-display); }
  .search-hit-text { display: flex; flex-direction: column; min-width: 0; }
  .search-hit-name { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-hit-meta { font-size: 0.74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-hit-score { display: inline-flex; align-items: center; gap: 5px; font: 700 0.86rem var(--font-display); }
  .search-hit-score .grade { font-size: 0.72rem; }
  .search-foot { border-top: 1px solid var(--line); margin-top: 4px; padding: 10px 8px 6px; }
  .search-foot p { margin: 0 0 8px; font-size: 0.84rem; color: var(--ink-soft); }
  .search-hit:only-child + .search-foot, .nav-search-results > .search-foot:first-child { border-top: 0; margin-top: 0; }

  /* ---------- phone: tab bar + compact top bar ---------- */
  .tab-bar { display: none; }
  @media (max-width: 760px) {
    .tab-bar {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
      display: grid; grid-template-columns: repeat(6, 1fr);
      padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
      background: color-mix(in srgb, var(--surface) 94%, transparent);
      backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
      border-top: 1px solid var(--line);
      box-shadow: 0 -6px 20px rgba(20,16,8,0.08);
    }
    .tab-bar-item {
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
      min-height: 50px; border-radius: 12px; text-decoration: none; color: var(--muted);
      font-size: 0.72rem; font-weight: 800; letter-spacing: .01em; -webkit-tap-highlight-color: transparent;
    }
    .tab-bar-item svg { width: 22px; height: 22px; transition: transform var(--transition); }
    .tab-bar-item.active { color: var(--jade); }
    .tab-bar-item.active svg { transform: translateY(-1px); }
    .tab-bar-item.active::after { content: ''; width: 18px; height: 3px; border-radius: 3px; background: currentColor; margin-top: 1px; }
    .tab-bar-item:active { background: var(--surface-2); }
    body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
    .toast, .xp-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }

    /* top bar: logo · search · bell · account. Page links live in the tab bar. */
    .nav-hamburger, .nav-menu, .app-nav .nav-link[data-page="home"] { display: none !important; }
    .nav-search-open { display: inline-flex; }
    .nav-search-panel { display: none; }
    .nav-search.open .nav-search-panel {
      display: flex; position: fixed; left: 0; right: 0; top: 0; z-index: 70; gap: 8px;
      padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .nav-search.open .nav-search-panel input, .nav-search.open .nav-search-panel input:focus { width: auto; flex: 1; font-size: 16px; }
    .nav-search.open .nav-search-icon { left: 23px; top: calc(21px + env(safe-area-inset-top, 0px)); }
    .nav-search.open .nav-search-close { display: inline-flex; appearance: none; border: 0; background: none; font: 700 0.9rem var(--font-body); color: var(--jade); padding: 0 4px; cursor: pointer; }
    .nav-search-results { position: fixed; top: calc(60px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; width: auto; max-height: calc(100vh - 160px); }
  }

  /* ---------- phone: rankings ---------- */
  @media (max-width: 640px) {
    .type-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; gap: 20px; margin-left: -20px; margin-right: -20px; padding: 0 20px; }
    .type-tabs::-webkit-scrollbar { display: none; }
    .type-tab { flex: 0 0 auto; white-space: nowrap; padding: 10px 0 12px; font-size: 0.9rem; }
    .controls { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
    .controls .search-box { grid-column: 1 / -1; }
    .controls select, .controls .btn { width: 100%; min-width: 0; font-size: 0.84rem; }
    .controls select { font-size: 16px; }
    .controls .submit-show-cta { grid-column: 1 / -1; }
    /* top 3 side by side, compact — no tall stacked boxes */
    .podium { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px; align-items: end; }
    .podium-card.rank-1 { order: 0 !important; }
    .podium-card { padding: 10px 6px 10px; gap: 6px; border-radius: var(--radius-m); }
    .podium-cover, .podium-card.rank-1 .podium-cover { width: 100%; height: auto; aspect-ratio: 2 / 3; }
    .podium-card.rank-1 .podium-cover { transform: scale(1.04); }
    .podium-medal, .podium-card.rank-1 .podium-medal { width: 26px; height: 26px; font-size: 0.82rem; bottom: -11px; }
    .podium-name { font-size: 0.78rem; margin-top: 10px; -webkit-line-clamp: 2; }
    .podium-card .score-line { gap: 4px; }
    .podium-card .score-num { font-size: 1.05rem; }
    .podium-card .grade { font-size: 0.72rem; }
    .podium-card .score-bar { width: 100%; }
    .podium-card .score-sub { display: none; }
    .podium-section { margin-bottom: 22px; }
    .ranking-summary { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -20px; margin-right: -20px; padding: 0 20px; }
    .summary-stat { min-width: max-content; padding: 8px 12px; }
    .summary-num { font-size: 1.15rem; }
    header.top { margin-bottom: 18px; }
  }

  /* ---------- tags ---------- */
  .tag-link { text-decoration: none; color: var(--jade); background: var(--jade-soft); }
  @media (hover: hover) and (pointer: fine) { .tag-link:hover { text-decoration: underline; } }
  .tag-season { text-decoration: none; font-weight: 800; color: #fbf8ef; background: var(--btn-primary-a); }
  .tag-season.status-upcoming { background: color-mix(in srgb, var(--gold) 80%, #000); }
  .info-link { color: var(--jade); font-weight: 700; }

  /* ---------- seasonal ---------- */
  .season-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-bottom: 14px; }
  .season-bar::-webkit-scrollbar { display: none; }
  .season-chip {
    appearance: none; cursor: pointer; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 10px 16px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: inherit;
  }
  .season-chip-name { font: 700 0.95rem var(--font-display); white-space: nowrap; }
  .season-chip-when { font-size: 0.7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-text); }
  .season-chip.is-now .season-chip-when { color: var(--jade); }
  .season-chip.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 6px 16px rgba(40,28,10,0.12); background: color-mix(in srgb, var(--gold-soft) 45%, var(--surface)); }
  .season-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
  .season-filter { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
  .season-filter label { position: relative; cursor: pointer; }
  .season-filter input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
  .season-filter span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
  .season-filter input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(40,28,10,0.18); }
  .season-filter input:focus-visible + span { outline: 2px solid var(--jade); outline-offset: 1px; }
  .season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .season-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
  @media (hover: hover) and (pointer: fine) { .season-card:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 14px 30px rgba(40,28,10,0.14); transform: translateY(-2px); } }
  .season-cover { position: relative; display: block; aspect-ratio: 2 / 3; background: var(--surface-2); overflow: hidden; }
  .season-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
  @media (hover: hover) and (pointer: fine) { .season-card:hover .season-cover img { transform: scale(1.04); } }
  .season-label { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 6px; font: 800 0.72rem/1.2 var(--font-body); letter-spacing: .03em; color: #fbf8ef; background: rgba(12,13,16,0.78); backdrop-filter: blur(4px); border: 1px solid rgba(212,175,90,0.55); }
  .season-label.is-new { background: color-mix(in srgb, var(--jade) 62%, #000); border-color: transparent; }
  .season-status { position: absolute; bottom: 10px; left: 10px; padding: 3px 8px; border-radius: 999px; font: 800 0.72rem/1.3 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: #fbf8ef; background: rgba(12,13,16,0.72); }
  .season-status.status-airing::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #4fcf9c; margin-right: 6px; vertical-align: 1px; }
  .season-status.status-upcoming { background: color-mix(in srgb, var(--gold) 52%, #000); }
  .season-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
  .season-title { font: 700 0.98rem/1.25 var(--font-display); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .season-meta, .season-when { margin: 0; font-size: 0.78rem; color: var(--muted); }
  .season-when { color: var(--ink-soft); font-weight: 600; }
  .season-rank { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
  .season-rank-score { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.2rem; }
  .season-rank-of { font-size: 0.8rem; color: var(--muted); }
  .season-note { margin: 24px 0 0; font-size: 0.78rem; color: var(--muted); text-align: center; }
  @media (max-width: 640px) {
    .season-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .season-body { padding: 10px 10px 12px; }
    .season-title { font-size: 0.86rem; }
    .season-rank-score { font-size: 1rem; }
    .season-tools select { flex: 1; }
  }

  /* ---------- characters on title pages ---------- */
  .char-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .char-card { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: inherit; }
  .char-portrait { display: block; width: 104px; height: 140px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
  .char-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
  .char-portrait .cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font: 700 1.4rem var(--font-display); }
  @media (hover: hover) and (pointer: fine) { .char-card:hover .char-portrait img { transform: scale(1.05); } }
  .char-name { font-weight: 700; font-size: 0.8rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .char-score { display: inline-flex; align-items: center; gap: 5px; font: 700 0.8rem var(--font-display); }
  .char-score .grade { font-size: 0.72rem; }

  /* ---------- XP feedback ---------- */
  .xp-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 55; transform: translate(-50%, 16px); opacity: 0;
    display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; min-width: 260px;
    background: var(--surface); border: 1px solid var(--tier-color); border-radius: 16px;
    box-shadow: 0 16px 34px rgba(20,16,8,0.25), 0 0 24px color-mix(in srgb, var(--tier-color) 25%, transparent);
    transition: opacity .25s ease, transform .35s cubic-bezier(.16,1,.3,1);
  }
  .xp-toast.show { opacity: 1; transform: translate(-50%, 0); }
  .xp-toast-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
  .xp-toast-line { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--ink-soft); }
  .xp-toast-line strong { font-family: var(--font-display); color: var(--tier-color); }
  .xp-toast .xp-bar > span { animation: none; transition: width 1.1s cubic-bezier(.16,1,.3,1) .15s; }
  .confetti { position: absolute; left: 50%; top: 38%; width: 0; height: 0; pointer-events: none; z-index: 2; }
  .confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: confetti-fly 1.4s cubic-bezier(.16,1,.3,1) var(--delay) forwards; }
  @keyframes confetti-fly {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rot)); }
  }
  .level-up-card { position: relative; }

  /* ---------- owner: submissions ---------- */
  .owner-submissions { display: flex; flex-direction: column; gap: 10px; }
  .submission { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface-2); }
  .submission-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .submission-score { display: inline-flex; align-items: center; gap: 5px; font: 700 0.86rem var(--font-display); }
  .submission-note { margin: 6px 0 10px; font-size: 0.86rem; color: var(--ink-soft); }
  .home-intro { max-width: 62ch; margin: 18px auto 0; text-align: center; font-size: 1.02rem; line-height: 1.6; color: var(--ink-soft); }
  @media (max-width: 640px) {
    /* edit/remove live in the rating dialog; keep phone rows to one line */
    #ledger .rank-row .row-actions-inline { display: none; }
    #ledger .rank-row { grid-template-columns: 34px 46px minmax(0, 1fr) auto; }
  }

  /* ---------- v5: character collection (separate from rank) ---------- */
  .char-collection { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
  .cc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .cc-title { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: .04em; color: var(--ink); }
  .cc-stars { display: inline-flex; gap: 3px; }
  .cc-star svg { width: 16px; height: 16px; display: block; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; opacity: .55; }
  .cc-star.on svg { fill: var(--gold); stroke: var(--gold); opacity: 1; }
  .cc-bar { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
  .cc-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
  .cc-foot { font-size: 0.8rem; color: var(--muted); }
  .char-collection.compact { margin-top: 10px; padding: 10px 12px; }
  .xp-toast-star { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); }
  .xp-toast-star svg { width: 20px; height: 20px; fill: var(--gold); }
  .xp-toast-star.new { animation: cc-pop .5s cubic-bezier(.16,1,.3,1) both; }
  @keyframes cc-pop { from { transform: scale(.4) rotate(-30deg); } to { transform: none; } }
  @media (prefers-reduced-motion: reduce) { .xp-toast-star.new { animation: none; } }

  /* ---------- v6 home polish ---------- */
  .hero-home { flex-direction: column; gap: 6px; padding: 36px 20px 40px; min-height: 0; }
  .hero-home::before { line-height: 1; }
  .hero-home .home-intro { margin: 0 auto; }
  .home-below .home-sub strong { color: var(--ink); font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
  .spotlight-content { max-width: 520px; }
  .spotlight-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
  .spotlight-rank { font-family: var(--font-display); font-weight: 700; color: var(--gold-text); letter-spacing: .04em; }
  .spotlight-score { display: flex; align-items: center; gap: 10px; }
  .spotlight-synopsis { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; margin-bottom: 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .spotlight-rail { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
  .spotlight-thumb { appearance: none; padding: 0; width: 36px; height: 52px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); cursor: pointer; opacity: .55; transition: opacity .2s ease, transform .2s ease, border-color .2s ease; }
  .spotlight-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .spotlight-thumb .cover-fallback { font-size: .9rem; }
  .spotlight-thumb:focus-visible { opacity: .9; transform: translateY(-2px); }
  @media (hover: hover) and (pointer: fine) { .spotlight-thumb:hover { opacity: .9; transform: translateY(-2px); } }
  .spotlight-thumb.active { opacity: 1; border-color: var(--gold); }
  @media (max-width: 640px) {
    .spotlight-banner { min-height: 0; padding-top: 32px; padding-bottom: 32px; }
    .spotlight-card { gap: 22px; justify-content: center; text-align: center; }
    .spotlight-content { margin: 0 auto; }
    .spotlight-meta, .spotlight-score, .spotlight-rail { justify-content: center; }
    .spotlight-synopsis { display: none; }
    .spotlight-thumb { width: 28px; height: 40px; }
  }
  @media (prefers-reduced-motion: reduce) { .spotlight-statrow .rankers-stat { animation: none; } }
  .spotlight-rotator { flex-direction: column; align-items: stretch; }
  @media (min-width: 641px) {
    .spotlight-card { flex-wrap: nowrap; }
    .spotlight-rail { margin-left: calc(min(320px, 42vw) + 44px); }
  }
  @media (max-width: 640px) {
    .spotlight-rail { flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; justify-content: safe center; }
    .spotlight-rail::-webkit-scrollbar { display: none; }
    .spotlight-thumb { flex: none; width: 26px; height: 38px; }
  }
  @media (max-width: 640px) {
    .spotlight-name { font-size: 1.45rem; line-height: 1.25; text-wrap: balance; }
    .spotlight-content { min-height: 9.5rem; }
  }

  /* quicklinks: icon sits beside the title (a row of destinations, not icon-over-heading tiles) */
  .quicklink-grid > .quicklink-card { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 4px; align-items: center; align-content: start; }
  .quicklink-card .quicklink-icon { width: 36px; height: 36px; border-radius: 10px; margin: 0; }
  .quicklink-card .quicklink-icon .icon { width: 19px; height: 19px; }
  .quicklink-card h3 { margin: 0; line-height: 1.2; }
  .quicklink-card p { grid-column: 1 / -1; margin: 6px 0 0; }
  @media (max-width: 560px) { .quicklink-card p { grid-column: 2; margin-top: 0; } }

  /* ---------- badge case (gym-badge collectibles) ---------- */
  .badge-case-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 22px 22px; margin-bottom: 26px; }
  .badge-case-panel:empty { display: none; }
  .badge-case-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; }
  .badge-case-head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
  .badge-case-count { font-family: var(--font-display); font-weight: 700; color: var(--gold-text); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
  .badge-case-panel > .field-hint { margin: 4px 0 18px; }
  /* flex, not grid, so a short last row sits centred (14 badges) */
  .badge-case { list-style: none; margin: 0; padding: 18px 12px 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 10px; --bc-cols: 7; --bc-gap: 10px;
    border-radius: var(--radius-m);
    /* velvet-lined case */
    background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--you) 16%, var(--surface-2)), var(--surface-2));
    box-shadow: inset 0 2px 10px rgba(0,0,0,.12); }
  .badge-slot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-width: 0; flex: 0 0 calc((100% - (var(--bc-cols) - 1) * var(--bc-gap)) / var(--bc-cols)); }
  .badge-art { width: 64px; height: 64px; display: block; }
  .badge-art .badge-svg { width: 100%; height: 100%; display: block; overflow: visible; }
  .badge-slot.earned .badge-art .badge-svg { filter: drop-shadow(0 4px 6px rgba(40,28,10,.35)); transition: transform .25s cubic-bezier(.16,1,.3,1); }
  @media (hover: hover) and (pointer: fine) { .badge-slot.earned:hover .badge-art .badge-svg { transform: translateY(-3px) rotate(-4deg); } }
  .badge-name { font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; line-height: 1.2; color: var(--ink); }
  .badge-slot:not(.earned) .badge-name { color: var(--muted); }
  .badge-how { font-size: 0.72rem; line-height: 1.3; color: var(--muted); }
  .badge-slot.earned .badge-how { color: var(--jade); font-weight: 600; }
  .badge-progress { width: 70%; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
  .badge-progress > span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
  @media (max-width: 860px) { .badge-case { --bc-cols: 4; } }
  @media (max-width: 520px) {
    .badge-case { --bc-cols: 3; --bc-gap: 6px; gap: 18px 6px; padding: 14px 6px 6px; }
    .badge-art { width: 54px; height: 54px; }
    .badge-case-panel { padding: 16px 14px 18px; }
  }

  .license-badges { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 20px 8px; }
  .license-badge { width: 22px; height: 22px; display: block; }
  .license-badge .badge-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.3)); }

  .badge-up-card { --tier-color: var(--gold); border-color: var(--gold); }
  .badge-up-row { display: flex; justify-content: center; gap: 8px; }
  .badge-up-art { width: 92px; height: 92px; display: block; animation: badge-press .7s cubic-bezier(.16,1,.3,1) both; }
  .badge-up-row .badge-up-art:not(:only-child) { width: 64px; height: 64px; }
  .badge-up-art .badge-svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
  .badge-up-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
  @keyframes badge-press { from { opacity: 0; transform: scale(1.6) rotate(-12deg); } 60% { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { .badge-up-art { animation: none; } }

  /* ---------- export studio ---------- */
  .export-dialog { width: min(980px, 94vw); }
  .export-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; overflow: auto; }
  .export-stage {
    display: flex; align-items: center; justify-content: center; padding: 22px;
    background: repeating-conic-gradient(color-mix(in srgb, var(--line) 35%, transparent) 0 25%, transparent 0 50%) 0 0 / 22px 22px, var(--surface-2);
    min-height: 0;
  }
  .export-stage canvas { display: block; max-width: 100%; max-height: min(66vh, 640px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.28); transition: opacity .2s ease, filter .2s ease; }
  .export-stage.rendering canvas { opacity: .55; filter: saturate(.6); }
  .export-stage { flex-direction: column; gap: 12px; }

  /* ---------- ranking pages: one toolbar (search, Sort & filter, Share) ---------- */
  .page.has-switch .wrap > header.top { border-bottom: 0; box-shadow: none; padding-bottom: 0; margin-bottom: 20px; }
  .rank-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; position: relative; z-index: 20; }
  .rank-toolbar .search-box { flex: 1 1 auto; min-width: 0; }
  .rank-menu { position: relative; flex: none; }
  .rank-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
  .rank-menu > summary::-webkit-details-marker { display: none; }
  .rank-menu > summary .icon { width: 18px; height: 18px; }
  .rank-menu[open] > summary { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); color: var(--ink); }
  .rank-tools.is-set > summary::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
  .rank-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 250px;
    display: grid; gap: 12px; padding: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-lift, 0 18px 40px rgb(0 0 0 / .22));
  }
  @media (prefers-reduced-motion: no-preference) {
    .rank-menu[open] .rank-menu-panel { animation: rankMenuIn 180ms var(--ease-out, ease-out); }
    @keyframes rankMenuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
  }
  .rank-menu-field { display: grid; gap: 5px; }
  .rank-menu-field > span { font-size: 0.75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .rank-menu-field select { width: 100%; }
  .rank-menu-list { gap: 2px; padding: 6px; min-width: 200px; }
  .rank-menu-list button { appearance: none; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 10px 12px; border-radius: var(--radius-s); font: 600 0.92rem var(--font-body); cursor: pointer; touch-action: manipulation; }
  @media (hover: hover) and (pointer: fine) { .rank-menu-list button:hover { background: var(--surface-2); } }
  .rank-menu-list button:focus-visible { outline: 2px solid var(--jade); outline-offset: -2px; }
  .rank-meta { margin: 0 0 18px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
  .rank-meta:empty { display: none; }
  .rank-meta .dcp-points { color: var(--gold-text); text-decoration: none; }
  .rank-meta .dcp-points b { color: var(--ink); }
  .podium-section .section-label:empty, .page .section-label:empty { display: none; }
  @media (max-width: 520px) {
    .rank-menu-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .rank-menu > summary { width: 46px; height: 46px; padding: 0; justify-content: center; }
    .rank-tools.is-set > summary::after { position: absolute; top: 8px; right: 8px; }
    /* full toolbar width: the panel anchors to .rank-toolbar instead of its button */
    .rank-menu { position: static; }
    .rank-menu > summary { position: relative; }
    .rank-menu-panel { left: 0; right: 0; min-width: 0; }
  }
  .export-pager { display: flex; align-items: center; gap: 14px; font: 700 0.9rem var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
  .export-pager .btn-icon { border: 1px solid var(--line); background: var(--surface); }
  .export-pager .btn-icon:disabled { opacity: .35; cursor: default; }
  .export-controls { display: flex; flex-direction: column; gap: 22px; padding: 22px; border-left: 1px solid var(--line); }
  .export-group { display: flex; flex-direction: column; gap: 10px; }
  .export-group .field-hint { margin: 0; font-variant-numeric: tabular-nums; }
  .export-label { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; letter-spacing: .06em; color: var(--ink-soft); }
  .export-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .export-seg button {
    appearance: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px; min-height: 46px;
    border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink);
    font: 600 0.9rem var(--font-body); cursor: pointer; transition: border-color .15s ease, background .15s ease;
  }
  @media (hover: hover) and (pointer: fine) { .export-seg button:hover { border-color: var(--gold); } }
  .export-seg button[aria-pressed="true"] { border-color: var(--jade); background: color-mix(in srgb, var(--jade) 10%, var(--surface)); box-shadow: inset 0 0 0 1px var(--jade); }
  .export-seg button:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .seg-shape { flex: none; height: 22px; aspect-ratio: var(--ar); max-width: 30px; border: 2px solid currentColor; border-radius: 3px; opacity: .7; }
  .seg-swatch { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--gold); }
  .seg-swatch.parchment { background: linear-gradient(135deg, #f4ecd6, #e3d4ac); }
  .seg-swatch.obsidian { background: linear-gradient(135deg, #23272f, #0a0b0e); }
  .export-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
  @media (max-width: 760px) {
    .export-layout { grid-template-columns: 1fr; }
    .export-stage { padding: 14px; }
    .export-stage canvas { max-height: 46vh; }
    .export-controls { border-left: none; border-top: 1px solid var(--line); padding: 16px; gap: 16px; }
    .export-seg { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .export-seg button { flex-direction: column; gap: 6px; padding: 8px 4px; font-size: 0.78rem; }
    .export-seg-theme { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .export-seg-theme button { flex-direction: row; font-size: 0.85rem; }
    .export-actions { flex-direction: row; }
  }

  /* badge details: hover, keyboard focus or tap shows how it's earned */
  .badge-slot { position: relative; }
  .badge-btn { appearance: none; background: none; border: 0; padding: 6px 4px; margin: 0; width: 100%; color: inherit; font: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; cursor: pointer; border-radius: var(--radius-s); }
  .badge-btn:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .badge-tip {
    position: absolute; z-index: 20; left: 50%; bottom: calc(100% - 6px); transform: translate(-50%, 6px);
    width: max-content; max-width: 210px; padding: 10px 12px; border-radius: 10px;
    background: var(--ink); color: var(--surface); font-size: 0.78rem; line-height: 1.4; text-align: left;
    box-shadow: 0 10px 24px rgba(0,0,0,.28); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  }
  .badge-tip strong { display: block; font-family: var(--font-display); font-size: 0.8rem; color: var(--gold-soft); margin-bottom: 2px; }
  .badge-slot.earned .badge-tip strong { color: color-mix(in srgb, var(--jade) 45%, #fff); }
  .badge-tip-count { display: block; margin-top: 4px; opacity: .8; font-variant-numeric: tabular-nums; }
  .badge-tip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
  .badge-btn:focus-visible + .badge-tip, .badge-slot.open .badge-tip {
    opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .16s ease, transform .16s ease;
  }
  @media (hover: hover) and (pointer: fine) { .badge-slot:hover .badge-tip {
    opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .16s ease, transform .16s ease;
  } }
  /* keep tips inside the case at the edge columns */
  @media (min-width: 861px) {
    .badge-slot:nth-child(6n+1) .badge-tip { left: 0; transform: translate(0, 6px); }
    .badge-slot:nth-child(6n) .badge-tip { left: auto; right: 0; transform: translate(0, 6px); }
    .badge-slot:nth-child(6n+1).open .badge-tip, .badge-slot:nth-child(6n+1) .badge-btn:focus-visible + .badge-tip, .badge-slot:nth-child(6n).open .badge-tip, .badge-slot:nth-child(6n) .badge-btn:focus-visible + .badge-tip { transform: none; }
    @media (hover: hover) and (pointer: fine) { .badge-slot:nth-child(6n+1):hover .badge-tip, .badge-slot:nth-child(6n):hover .badge-tip { transform: none; } }
    .badge-slot:nth-child(6n+1) .badge-tip::after { left: 32px; }
    .badge-slot:nth-child(6n) .badge-tip::after { left: auto; right: 26px; }
  }
  @media (max-width: 520px) {
    .badge-slot:nth-child(3n+1) .badge-tip { left: 0; transform: translate(0, 6px); }
    .badge-slot:nth-child(3n) .badge-tip { left: auto; right: 0; transform: translate(0, 6px); }
    .badge-slot:nth-child(3n+1).open .badge-tip, .badge-slot:nth-child(3n).open .badge-tip { transform: none; }
    @media (hover: hover) and (pointer: fine) { .badge-slot:nth-child(3n+1):hover .badge-tip, .badge-slot:nth-child(3n):hover .badge-tip { transform: none; } }
    .badge-slot:nth-child(3n+1) .badge-tip::after { left: 28px; }
    .badge-slot:nth-child(3n) .badge-tip::after { left: auto; right: 22px; }
  }
  @media (prefers-reduced-motion: reduce) { .badge-tip { transition: none; } }

  /* ---------- compare: bigger numbers ---------- */
  .compare-table-row .score { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
  .compare-table-row.head { font-size: 0.74rem; }
  .compare-table-row .name { font-size: 0.95rem; }
  .ct-cover { width: 32px; height: 46px; }
  .cb-pct { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
  .cb-name { font-size: 1.02rem; }
  .cb-meta { font-size: 0.82rem; }
  .cb-rank { font-size: 1.1rem; }
  .compare-ad-scores { font-size: 1.12rem; gap: 8px; font-variant-numeric: tabular-nums; }
  .compare-ad-name { font-size: 0.92rem; }
  .compare-ad-cover { width: 36px; height: 50px; }
  .faceoff-vals { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
  .duel-meta { font-size: 0.9rem; }
  .friend-card-match { font-size: 1.05rem; }
  @media (max-width: 560px) {
    .compare-table-row .score { font-size: 1.02rem; }
    .cb-pct { font-size: 1.25rem; }
  }
  .compare-faceoff .faceoff-vals { font-size: 1.02rem; gap: 12px; flex-basis: 96px; font-variant-numeric: tabular-nums; }

  /* ---------- public profile link (/u/<id>) ---------- */
  .public-profile { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding: 28px 0 40px; }
  .public-profile-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 14px; }
  .public-picks { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .public-pick { display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
  @media (hover: hover) and (pointer: fine) { .public-pick:hover { border-color: var(--gold); transform: translateY(-1px); } }
  .public-pick-rank { font: 800 1.1rem var(--font-display); color: var(--gold-text); text-align: center; }
  .public-pick-cover { width: 40px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
  .public-pick-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .public-pick-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .public-pick-score { display: inline-flex; align-items: center; gap: 8px; font: 800 1.1rem var(--font-display); color: var(--jade); font-variant-numeric: tabular-nums; }
  .public-profile-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .public-profile-actions .field-hint { margin: 0; }
  @media (max-width: 820px) { .public-profile { grid-template-columns: 1fr; padding-top: 16px; } }

  /* settings on/off switch */
  .settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
  .settings-toggle-row .field-hint { display: block; margin-top: 2px; }
  .settings-switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; margin: 0;
    background: var(--line); position: relative; cursor: pointer; transition: background .2s ease; }
  .settings-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s cubic-bezier(.16,1,.3,1); }
  .settings-switch:checked { background: var(--jade); }
  .settings-switch:checked::after { transform: translateX(20px); }
  .settings-switch:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }

  /* ---------- Dex the owl (mascot) ---------- */
  .dex { display: block; overflow: visible; }
  .dex g, .dex path, .dex text, .dex rect, .dex circle { transform-box: view-box; }
  .dex .dex-body-wrap { transform-origin: 100px 180px; }
  .dex.dex-bob .dex-body-wrap { animation: dex-bob 3.4s ease-in-out infinite; }
  .dex.dex-hop .dex-body-wrap { animation: dex-hop 1.1s cubic-bezier(.3,.7,.4,1) infinite; }
  .dex.dex-breathe .dex-body-wrap { animation: dex-breathe 4s ease-in-out infinite; }
  .dex.dex-droop .dex-body-wrap { animation: dex-droop 4.5s ease-in-out infinite; }
  .dex.dex-jolt .dex-body-wrap { animation: dex-jolt 2.6s ease-out infinite; }
  .dex.dex-shudder .dex-body-wrap { animation: dex-shudder 3s ease-in-out infinite; }
  .dex.dex-glide .dex-body-wrap { animation: dex-glide 3s ease-in-out infinite; }
  .dex.dex-ponder .dex-head { animation: dex-ponder 4s ease-in-out infinite; }
  .dex.dex-blink .dex-lid { transform-box: fill-box; transform-origin: center; animation: dex-blink 5.2s infinite; }
  .dex .dex-wave { animation: dex-wave 1.4s ease-in-out infinite; }
  .dex .dex-nudge { animation: dex-nudge 1.6s ease-in-out infinite; }
  .dex .dex-flap-L { animation: dex-flap-l .9s ease-in-out infinite; }
  .dex .dex-flap-R { animation: dex-flap-r .9s ease-in-out infinite; }
  .dex .dex-sway { animation: dex-sway 2.4s ease-in-out infinite; }
  .dex .dex-quill { animation: dex-quill .7s ease-in-out infinite; }
  .dex .dex-zzz text { animation: dex-zzz 3s ease-in infinite; }
  .dex .dex-zzz text:nth-child(2) { animation-delay: .6s; }
  .dex .dex-zzz text:nth-child(3) { animation-delay: 1.2s; }
  .dex .dex-dots circle { animation: dex-dot 1.5s ease-in-out infinite; }
  .dex .dex-dots circle:nth-child(2) { animation-delay: .2s; }
  .dex .dex-dots circle:nth-child(3) { animation-delay: .4s; }
  .dex .dex-twinkle { animation: dex-twinkle 1.8s ease-in-out infinite; }
  .dex .dex-shine { animation: dex-shine 2.4s ease-in-out infinite; }
  .dex .dex-tear { animation: dex-tear 2.6s ease-in infinite; }
  .dex .dex-confetti { animation: dex-confetti 2s ease-in-out infinite; }
  @keyframes dex-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  @keyframes dex-hop { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(0) scaleY(.94); } 45% { transform: translateY(-14px) scaleY(1.03); } 70% { transform: translateY(0) scaleY(.97); } }
  @keyframes dex-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
  @keyframes dex-droop { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(3px) rotate(-1.5deg); } }
  @keyframes dex-jolt { 0%, 70%, 100% { transform: translateY(0); } 76% { transform: translateY(-10px); } 84% { transform: translateY(0); } 90% { transform: translateY(-3px); } }
  @keyframes dex-shudder { 0%, 80%, 100% { transform: translateX(0); } 84% { transform: translateX(-2px); } 88% { transform: translateX(2px); } 92% { transform: translateX(-1.5px); } 96% { transform: translateX(1px); } }
  @keyframes dex-glide { 0%, 100% { transform: translate(0, 0) rotate(-2deg); } 50% { transform: translate(4px, -8px) rotate(2deg); } }
  @keyframes dex-ponder { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
  @keyframes dex-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
  @keyframes dex-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }
  @keyframes dex-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
  @keyframes dex-flap-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(22deg); } }
  @keyframes dex-flap-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
  @keyframes dex-sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
  @keyframes dex-quill { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-7deg); } }
  @keyframes dex-zzz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -14px); } }
  @keyframes dex-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
  @keyframes dex-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
  @keyframes dex-shine { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
  @keyframes dex-tear { 0% { opacity: 0; transform: translateY(-4px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
  @keyframes dex-confetti { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
  @media (prefers-reduced-motion: reduce) { .dex, .dex * { animation: none !important; } }

  /* ---------- where Dex lives (each placement has its own feel) ---------- */
  .dex-slot { display: inline-block; line-height: 0; }
  .dex-slot--empty { display: block; width: max-content; margin: -18px auto 2px; }
  .dex-slot--hero { margin: 0 auto 10px; }
  /* home: in the suggestion box, spilling slightly over its edge */
  .dex-slot--suggest { flex: none; margin: -22px -4px -18px -10px; }
  /* About / Privacy: floated beside the intro like a book illustration */
  .dex-slot--float { float: right; margin: -10px 0 6px 20px; shape-outside: circle(48%); }
  .prose-head::after { content: ''; display: block; clear: both; }
  /* sign-in dialog: peeking in beside the title */
  .modal-head .dex-slot--peek { margin: -14px 4px -16px -8px; }
  .modal-head .dex-slot--peek + h2 { flex: 1; }
  /* profile: perched on the top edge of the badge case */
  .badge-case-panel { position: relative; margin-top: 54px; }
  .dex-slot--perch { position: absolute; top: -70px; right: 34px; pointer-events: none; }
  /* level-up / badge cards: cheering from behind a corner */
  .dex-slot--corner-left, .dex-slot--corner-right { position: absolute; bottom: -18px; pointer-events: none; }
  .dex-slot--corner-left { left: -52px; transform: rotate(-6deg); }
  .dex-slot--corner-right { right: -50px; transform: rotate(6deg); }
  .nav-notif-empty .dex-slot { display: block; width: max-content; margin: -4px auto 2px; }
  @media (max-width: 560px) {
    .dex-slot--float { margin: -6px 0 4px 12px; }
    .dex-slot--float .dex { width: 84px; height: 84px; }
    .dex-slot--perch { right: 14px; }
    .dex-slot--corner-left, .dex-slot--corner-right { position: static; display: block; width: max-content; margin: -40px auto -6px; transform: none; }
    .dex-slot--suggest { display: none; }
  }
  .quicklink-grid > .quicklink-card { flex-basis: 132px; }
  /* mid-width screens (small laptops, tablets): stop the nav overflowing */
  @media (min-width: 761px) and (max-width: 1080px) {
    .nav-account-text { display: none; }
    .nav-search-panel input { width: 170px; }
    .nav-search-panel input:focus { width: 220px; }
  }

  /* synopsis: folded to six lines until "Read more" */
  #animeDetailSynopsis p.syn-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
  .syn-more { margin-top: 10px; padding: 8px 0; min-height: 40px; background: none; border: 0; color: var(--gold-text); font: 700 0.9rem var(--font-body, inherit); cursor: pointer; }
  @media (hover: hover) and (pointer: fine) { .syn-more:hover { text-decoration: underline; } }
  .syn-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

  /* =====================================================================
     DAILY DUEL
     ===================================================================== */
  .dd {
    position: relative; margin-top: 28px; padding: clamp(18px, 3vw, 30px);
    border: 1px solid var(--line); border-radius: var(--radius-l);
    background:
      radial-gradient(420px 240px at 0% 0%, color-mix(in srgb, var(--jade) 12%, transparent), transparent 70%),
      radial-gradient(420px 240px at 100% 100%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%),
      var(--surface);
    box-shadow: var(--shadow-lift); overflow: hidden; isolation: isolate;
  }
  /* a hairline "fight line" running corner to corner behind the arena */
  .dd::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(115deg, transparent calc(50% - 1px), color-mix(in srgb, var(--gold) 40%, transparent) 50%, transparent calc(50% + 1px));
    opacity: .22;
  }
  .dd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
  .dd-head h2 { font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 0; letter-spacing: .01em; }
  .dd-q { margin: 4px 0 0; color: var(--ink-soft); font-size: 1rem; }
  .dd-q strong { color: var(--gold-text); font-weight: 800; }
  .dd-streak {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border-radius: 999px;
    font-weight: 800; font-size: .84rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  }
  .dd-streak .icon { width: 17px; height: 17px; }
  .dd-streak.is-on { color: var(--you); background: var(--you-soft); border-color: color-mix(in srgb, var(--you) 35%, transparent); }
  .dd-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: clamp(10px, 3vw, 30px); margin-top: 22px; }
  .dd-pick {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; margin: 0;
    background: none; border: 0; color: var(--ink); font: inherit; text-align: center; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dd-cover {
    position: relative; display: block; width: 100%; max-width: 220px; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
    background: var(--surface-2); box-shadow: 0 14px 30px rgba(20, 14, 4, .22);
    outline: 2px solid transparent; outline-offset: 3px;
    transition: transform 320ms cubic-bezier(.16,1,.3,1), outline-color 200ms ease, filter 400ms ease, box-shadow 320ms ease;
  }
  .dd-cover img, .dd-cover .cover-fallback { width: 100%; height: 100%; object-fit: cover; display: block; }
  .dd-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(.95rem, 2vw, 1.12rem); margin-top: 12px; line-height: 1.2; text-wrap: balance; }
  .dd-meta { font-size: .8rem; color: var(--muted); font-weight: 600; }
  .dd-arena:not(.is-voted) .dd-pick:focus-visible .dd-cover { outline-color: var(--gold); box-shadow: 0 22px 40px rgba(20, 14, 4, .3); }
  @media (hover: hover) and (pointer: fine) { .dd-arena:not(.is-voted) .dd-pick:hover .dd-cover { outline-color: var(--gold); box-shadow: 0 22px 40px rgba(20, 14, 4, .3); } }
  @media (hover: hover) and (pointer: fine) { .dd-arena:not(.is-voted) .dd-pick--a:hover .dd-cover { transform: translateY(-5px) rotate(-1.5deg); } }
  @media (hover: hover) and (pointer: fine) { .dd-arena:not(.is-voted) .dd-pick--b:hover .dd-cover { transform: translateY(-5px) rotate(1.5deg); } }
  .dd-pick:focus-visible { outline: none; }
  .dd-pick.is-picked .dd-cover { outline: 3px solid var(--gold); box-shadow: 0 18px 38px color-mix(in srgb, var(--gold) 40%, rgba(0,0,0,.25)); }
  .dd-pick.is-other .dd-cover { filter: grayscale(.65) brightness(.82); transform: scale(.96); }
  .dd-picked-mark {
    position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--gold); color: #17130a; font-size: .74rem; font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
  }
  .dd-picked-mark .icon { width: 13px; height: 13px; }
  .dd-vs {
    align-self: center; margin-top: -30px; width: 58px; height: 58px; display: grid; place-items: center;
    rotate: 45deg; border: 2px solid var(--gold); border-radius: 10px; background: var(--surface);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 12%, transparent), 0 10px 22px rgba(20, 14, 4, .2);
  }
  .dd-vs span { rotate: -45deg; font-family: var(--font-display); font-weight: 900; font-size: 1rem; color: var(--gold-text); letter-spacing: .04em; }
  .dd-hint { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }
  .dd-result { margin-top: 22px; }
  .dd-split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
  .dd-split-a { flex: 0 0 calc(var(--pa) * 1%); background: linear-gradient(90deg, var(--jade), color-mix(in srgb, var(--jade) 70%, var(--gold))); }
  .dd-split-b { flex: 1 1 auto; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 70%, var(--jade)), var(--gold)); margin-left: 2px; }
  .dd-result.is-reveal .dd-split-a { animation: duelSplit 1100ms cubic-bezier(.16,1,.3,1) both; }
  .dd-result.is-reveal .dd-split { animation: duelSplitIn 500ms cubic-bezier(.16,1,.3,1) both; }
  @keyframes duelSplit { from { flex-basis: 50%; } }
  @keyframes duelSplitIn { from { clip-path: inset(0 50% 0 50% round 999px); } to { clip-path: inset(0 0 0 0 round 999px); } }
  .dd-split-labels { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: .82rem; color: var(--muted); font-weight: 700; }
  .dd-split-labels strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 900; }
  .dd-split-labels strong:first-child { color: var(--jade); }
  .dd-split-labels strong:last-child { color: var(--gold-text); }
  .dd-verdict { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--ink-soft); font-size: .92rem; }
  .dd-verdict .dex-slot { flex: none; }
  .dd-yesterday { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .86rem; }
  .dd-yesterday strong { color: var(--ink); }
  @media (max-width: 560px) {
    .dd-vs { width: 42px; height: 42px; margin-top: -40px; border-radius: 8px; }
    .dd-vs span { font-size: .8rem; }
    .dd-cover { border-radius: 10px; }
    .dd-picked-mark { left: 6px; bottom: 6px; font-size: .72rem; padding: 4px 8px 4px 6px; }
  }

  /* home: Wrapped teaser */
  .wrapped-banner {
    display: flex; align-items: center; gap: 18px 20px; flex-wrap: wrap; margin-top: 18px; padding: 16px 20px;
    border-radius: var(--radius-l); color: #ece7d6;
    background: radial-gradient(360px 160px at 0% 50%, rgba(63,174,132,.22), transparent 70%), radial-gradient(360px 160px at 100% 50%, rgba(212,175,90,.22), transparent 70%), #101116;
    border: 1px solid rgba(212,175,90,.45); box-shadow: 0 14px 30px rgba(10,8,4,.25);
  }
  .wrapped-banner-covers { display: flex; padding-left: 10px; }
  .wrapped-banner-covers span { width: 40px; aspect-ratio: 2/3; border-radius: 5px; overflow: hidden; margin-left: -12px; box-shadow: 0 6px 14px rgba(0,0,0,.45); border: 1.5px solid #101116; }
  .wrapped-banner-covers span:nth-child(odd) { rotate: -6deg; } .wrapped-banner-covers span:nth-child(even) { rotate: 5deg; translate: 0 3px; }
  .wrapped-banner-covers img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .wrapped-banner-copy { flex: 1 1 220px; }
  .wrapped-banner h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; color: #f3d88f; }
  .wrapped-banner p { margin: 3px 0 0; color: #bcb6a2; font-size: .9rem; }

  /* =====================================================================
     WRAPPED: full-screen story viewer (always on the obsidian palette)
     ===================================================================== */
  body.is-wrapped .app-nav, body.is-wrapped .tab-bar, body.is-wrapped .site-footer { display: none !important; }
  #pageWrapped.active { position: fixed; inset: 0; z-index: 80; background: #050607; overflow: hidden; }
  #pageWrapped .wrap { max-width: none; padding: 0; height: 100%; }
  .wrapped {
    --bg: #0c0d10; --surface: #16181d; --surface-2: #1c1f26; --ink: #f1ead6; --ink-soft: #c9c2ac; --muted: #958e79;
    --gold: #d4af5a; --gold-soft: #2e2410; --gold-text: #d4af5a; --jade: #3fae84; --jade-soft: #11291f; --you: #d1685a; --you-soft: #2c1613; --line: #2f2c22;
    --tag-blue: #7e9bc9; --tag-blue-soft: #1c2536; --tier-platinum: #8fb3b3; --tier-platinum-soft: #1a2a2a; --rank-bronze: #c98a56; --rank-bronze-soft: #3a2a1a;
    height: 100%; display: grid; place-items: center; color: var(--ink);
  }
  .wrapped ::selection { background: var(--gold); color: #17130a; }
  .wrapped-shell {
    position: relative; container-type: inline-size; overflow: hidden; outline: none;
    width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9));
    background: radial-gradient(120% 70% at 50% 0%, #1b1d23, #0b0c0f 70%);
    touch-action: pan-y; user-select: none; -webkit-user-select: none;
  }
  @media (max-width: 699px) { .wrapped-shell { width: 100vw; height: 100dvh; } }
  @media (min-width: 700px) { .wrapped-shell { height: min(94dvh, 900px); width: calc(min(94dvh, 900px) * 9 / 16); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(212,175,90,.28); } }
  .wrapped-progress { position: absolute; z-index: 5; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; }
  .wrapped-progress span { flex: 1; height: 3px; border-radius: 3px; background: rgba(241,234,214,.22); overflow: hidden; }
  .wrapped-progress i { display: block; height: 100%; width: 0; background: #f1ead6; }
  .wrapped-progress .is-done i, .wrapped-progress .is-last i { width: 100%; }
  .wrapped-progress .is-now i { animation: wFill 7s linear forwards; }
  .wrapped-shell.is-paused .wrapped-progress .is-now i { animation-play-state: paused; }
  @keyframes wFill { from { width: 0; } to { width: 100%; } }
  .wrapped-close {
    position: absolute; z-index: 6; top: 24px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; border: 0; background: rgba(12,13,16,.55); color: #f1ead6; cursor: pointer; backdrop-filter: blur(6px);
  }
  .wrapped-close .icon { width: 20px; height: 20px; }
  .wrapped-close:focus-visible, .wrapped-shell .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  .wrapped-nav { position: absolute; z-index: 2; top: 70px; bottom: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .wrapped-nav--prev { left: 0; width: 32%; } .wrapped-nav--next { right: 0; width: 68%; }
  .wrapped-nav:focus-visible { outline: 2px solid rgba(212,175,90,.6); outline-offset: -6px; border-radius: 16px; }
  .wrapped-track { position: absolute; inset: 0; }
  .w-slide {
    position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 5cqi;
    padding: 20cqi 8cqi 12cqi; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 450ms ease, visibility 0s 450ms;
    overflow: hidden;
  }
  .w-slide.is-active { opacity: 1; visibility: visible; transition: opacity 450ms ease; }
  .w-actions, .w-actions * { pointer-events: auto; position: relative; z-index: 4; }
  .w-stack { display: flex; flex-direction: column; gap: 2.4cqi; position: relative; }
  .w-display { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 8.6cqi; line-height: 1.06; letter-spacing: -.005em; text-wrap: balance; color: var(--ink); }
  .w-display--xl { font-size: 12.5cqi; color: #f3d88f; }
  .w-body { margin: 0; font-size: 4.3cqi; line-height: 1.45; color: var(--ink-soft); max-width: 32ch; }
  .w-body strong { color: var(--ink); }
  .w-title-line { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 5.4cqi; color: #f3d88f; line-height: 1.15; }
  .w-big { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 34cqi; line-height: .9; color: #f3d88f; letter-spacing: -.02em; }
  .w-cover { display: block; aspect-ratio: 2 / 3; border-radius: 3.6cqi; overflow: hidden; box-shadow: 0 4cqi 9cqi rgba(0,0,0,.55); }
  .w-cover img, .w-cover .cover-fallback, .w-mosaic img, .w-fan img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .w-score { display: flex; align-items: center; gap: 3.5cqi; margin: 1cqi 0 0; }
  .w-score span:last-child { font-family: var(--font-display); font-weight: 900; font-size: 13cqi; line-height: 1; color: var(--ink); }
  .w-seal.grade { width: 13cqi; height: 13cqi; font-size: 8cqi; border-radius: 2.8cqi; }
  .w-actions { display: flex; flex-wrap: wrap; gap: 2.6cqi; margin-top: 3cqi; }
  .w-actions .btn { font-size: 3.9cqi; padding: 2.8cqi 5cqi; }
  .wrapped-shell .btn-ghost { color: #f1ead6; border-color: rgba(241,234,214,.35); background: transparent; }
  /* entrance: one authored rise per slide, staggered within it */
  .w-slide.is-active .w-stack > * { animation: wRise 700ms cubic-bezier(.16,1,.3,1) both; }
  .w-slide.is-active .w-stack > :nth-child(2) { animation-delay: 90ms; } .w-slide.is-active .w-stack > :nth-child(3) { animation-delay: 180ms; }
  .w-slide.is-active .w-stack > :nth-child(4) { animation-delay: 270ms; } .w-slide.is-active .w-stack > :nth-child(5) { animation-delay: 360ms; }
  @keyframes wRise { from { opacity: 0; translate: 0 5cqi; filter: blur(6px); } }
  /* intro */
  .w-intro { justify-content: flex-end; background: radial-gradient(90% 55% at 50% 22%, rgba(212,175,90,.24), transparent 70%); }
  .w-year { position: absolute; top: 14cqi; left: 50%; translate: -50% 0; font-family: var(--font-display); font-weight: 900; font-size: 31cqi; line-height: 1; color: transparent; -webkit-text-stroke: .5cqi rgba(212,175,90,.7); letter-spacing: -.02em; }
  .w-slide.is-active.w-intro .w-year { animation: wYear 1200ms cubic-bezier(.16,1,.3,1) both; }
  @keyframes wYear { from { opacity: 0; letter-spacing: .2em; filter: blur(10px); } }
  .w-dex { position: absolute; right: 4cqi; bottom: 36cqi; }
  .w-intro .w-dex { bottom: auto; top: 58cqi; right: 8cqi; }
  /* count */
  .w-count { justify-content: flex-end; }
  .w-mosaic { position: absolute; inset: -10cqi -10cqi 40% -10cqi; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3cqi; rotate: -8deg; opacity: .55;
    mask-image: linear-gradient(to bottom, #000 30%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); }
  .w-mosaic span { aspect-ratio: 2/3; border-radius: 2cqi; overflow: hidden; background: #1c1f26; }
  .w-slide.is-active .w-mosaic span { animation: wTile 900ms cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--i) * 45ms); }
  @keyframes wTile { from { opacity: 0; translate: 0 -6cqi; } }
  /* genre */
  .w-genre { background: radial-gradient(100% 60% at 0% 100%, rgba(63,174,132,.35), transparent 70%); }
  .w-fan { display: flex; justify-content: center; margin-top: 4cqi; }
  .w-fan span { width: 30cqi; aspect-ratio: 2/3; border-radius: 3cqi; overflow: hidden; margin: 0 -4cqi; box-shadow: 0 4cqi 8cqi rgba(0,0,0,.55); border: .6cqi solid #0c0d10; }
  .w-fan span:nth-child(1) { rotate: -10deg; translate: 0 3cqi; } .w-fan span:nth-child(3) { rotate: 10deg; translate: 0 3cqi; } .w-fan span:nth-child(2) { z-index: 1; }
  .w-slide.is-active .w-fan span { animation: wFan 900ms cubic-bezier(.16,1,.3,1) both; animation-delay: calc(200ms + var(--i) * 80ms); }
  @keyframes wFan { from { opacity: 0; rotate: 0deg; translate: 0 12cqi; } }
  /* best */
  .w-best { align-items: center; text-align: center; background: repeating-conic-gradient(from 0deg at 50% 38%, rgba(212,175,90,.10) 0deg 6deg, transparent 6deg 18deg), radial-gradient(70% 45% at 50% 38%, rgba(212,175,90,.28), transparent 70%); }
  .w-best .w-stack { align-items: center; }
  .w-best .w-body { max-width: none; }
  .w-cover--hero { width: 52cqi; outline: .7cqi solid var(--gold); outline-offset: 1cqi; }
  .w-slide.is-active .w-cover--hero { animation: wHero 900ms cubic-bezier(.16,1,.3,1) both; }
  @keyframes wHero { from { opacity: 0; scale: .8; filter: blur(8px); } }
  /* take */
  .w-take { background: linear-gradient(160deg, rgba(209,104,90,.28), transparent 45%), linear-gradient(340deg, rgba(63,174,132,.22), transparent 45%); }
  .w-cover--tilt { width: 40cqi; rotate: -5deg; align-self: flex-end; margin-right: 4cqi; }
  .w-versus { display: flex; align-items: flex-end; gap: 4cqi; margin-top: 2cqi; }
  .w-versus > span { display: flex; flex-direction: column; font-size: 3.6cqi; color: var(--muted); font-weight: 700; }
  .w-versus > span strong { font-family: var(--font-display); font-weight: 900; font-size: 11cqi; line-height: 1; color: var(--ink); }
  .w-versus > span:first-child strong { color: #f3d88f; }
  .w-versus-gap { padding: 1.4cqi 3cqi; border-radius: 999px; background: var(--you); color: #fff !important; font-family: var(--font-display); font-weight: 900; font-size: 5cqi !important; margin-bottom: 2cqi; }
  /* worst */
  .w-worst { background: radial-gradient(90% 50% at 50% 30%, rgba(149,142,121,.18), transparent 70%); }
  /* deepest cut: light from below, like something dug up */
  .w-deep { align-items: center; text-align: center; background: radial-gradient(80% 50% at 50% 70%, rgba(63,170,128,.22), transparent 70%); }
  .w-deep .w-stack { align-items: center; }
  .w-cover--muted { width: 42cqi; filter: grayscale(.45) contrast(1.05); }
  /* spread */
  .w-spread { justify-content: space-between; }
  .w-bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 2.6cqi; height: 52cqi; }
  .w-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
  .w-bar::before { content: ""; order: 2; width: 100%; height: var(--h); border-radius: 2cqi 2cqi .8cqi .8cqi; background: linear-gradient(to top, color-mix(in srgb, var(--g) 70%, #000), var(--g)); transform-origin: bottom; }
  .w-slide.is-active .w-bar::before { animation: wBar 900ms cubic-bezier(.16,1,.3,1) both; animation-delay: calc(150ms + var(--i) * 70ms); }
  @keyframes wBar { from { transform: scaleY(0); } }
  .w-bar em { order: 1; font-style: normal; font-weight: 800; font-size: 3.6cqi; color: var(--ink-soft); margin-bottom: 1.4cqi; }
  .w-bar b { order: 3; font-family: var(--font-display); font-weight: 900; font-size: 5cqi; color: var(--g); margin-top: 1.6cqi; }
  /* rank */
  .w-rank { align-items: center; text-align: center; background: radial-gradient(70% 45% at 50% 34%, color-mix(in srgb, var(--tier-color) 32%, transparent), transparent 70%); }
  .w-rank .w-stack { align-items: center; }
  .w-medal .tier-medal { --medal: 42cqi !important; }
  .w-slide.is-active .w-medal { animation: wMedal 1100ms cubic-bezier(.16,1,.3,1) both; }
  @keyframes wMedal { from { opacity: 0; rotate: -120deg; scale: .5; } }
  .w-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 2cqi; margin-top: 2cqi; }
  .w-badges span { width: 12cqi; height: 12cqi; display: block; }
  .w-badges svg { width: 100%; height: 100%; }
  /* persona */
  .w-persona { justify-content: flex-end; background: radial-gradient(90% 55% at 70% 25%, rgba(63,174,132,.26), transparent 70%), radial-gradient(70% 40% at 10% 90%, rgba(212,175,90,.18), transparent 70%); }
  .w-persona .w-dex { top: 18cqi; bottom: auto; right: 10cqi; }
  @media (prefers-reduced-motion: reduce) {
    .w-slide, .w-slide.is-active { transition: none; }
    .w-slide.is-active *, .w-slide.is-active .w-bar::before { animation: none !important; }
    .wrapped-progress .is-now i { animation-duration: 12s; }
    .dd-result.is-reveal .dd-split-a, .dd-result.is-reveal .dd-split { animation: none; }
  }
  .wrapped-empty { max-width: 460px; padding: 32px 24px; text-align: center; color: #f1ead6; display: grid; justify-items: center; gap: 10px; }
  .wrapped-empty h2 { font-family: var(--font-display); margin: 6px 0 0; font-size: 1.5rem; }
  .wrapped-empty p { color: #bcb6a2; margin: 0 0 10px; line-height: 1.55; }
  .wrapped-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

  /* =====================================================================
     LEADERBOARD (replaced Leagues on 2026-11-13)
     ===================================================================== */
  .lb-seg { display: flex; width: fit-content; padding: 3px; margin: 4px 0 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
  .lb-seg button { border: 0; background: none; color: var(--ink-soft); font: inherit; font-weight: 700; font-size: .9rem; padding: 8px 18px; border-radius: 999px; cursor: pointer; min-height: 38px; }
  .lb-seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .lb-seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
  .lb-summary { margin: 0 0 12px; color: var(--ink-soft); font-weight: 700; }
  .lb-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
  .lb-list li + li { border-top: 1px solid var(--line); }
  .lb-list-me { margin-top: 10px; }
  .lb-row-inner { display: grid; grid-template-columns: 44px 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 10px 18px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
  button.lb-row-inner { cursor: pointer; transition: background var(--transition); }
  @media (hover: hover) and (pointer: fine) { button.lb-row-inner:hover { background: var(--surface-2); } }
  button.lb-row-inner:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
  .lb-row.is-me .lb-row-inner { background: color-mix(in srgb, var(--jade) 9%, var(--surface)); }
  .lb-rank { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
  .lb-top-1 .lb-rank { color: var(--rank-gold); font-size: 1.5rem; }
  .lb-top-2 .lb-rank { color: var(--rank-silver); font-size: 1.35rem; }
  .lb-top-3 .lb-rank { color: var(--rank-bronze); font-size: 1.35rem; }
  .lb-face { position: relative; width: 44px; height: 44px; }
  .lb-face img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; background: var(--surface-2); }
  .lb-top-1 .lb-face img { box-shadow: 0 0 0 2px var(--rank-gold); }
  .lb-top-2 .lb-face img { box-shadow: 0 0 0 2px var(--rank-silver); }
  .lb-top-3 .lb-face img { box-shadow: 0 0 0 2px var(--rank-bronze); }
  .lb-face .tier-medal { position: absolute; right: -6px; bottom: -4px; }
  .lb-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .lb-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
  .lb-who span { color: var(--muted); font-size: .8rem; font-weight: 600; }
  .lb-count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
  .lb-count strong { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
  .lb-count span { color: var(--muted); font-size: .74rem; font-weight: 700; }
  @media (max-width: 520px) {
    .lb-row-inner { grid-template-columns: 30px 46px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  }

  /* ---------- How it works (signed-out home) ---------- */
  .how-it-works { position: relative; z-index: 1; width: min(980px, 100%); margin: 26px auto 0; text-align: center; }
  .how-it-works h2 { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .06em; margin: 0 0 18px; color: var(--ink); }
  .hiw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; position: relative; text-align: left; }
  /* brass hairline joining the three seals */
  .hiw-steps::before { content: ''; position: absolute; top: 19px; left: calc(16.66% + 22px); right: calc(16.66% + 22px); height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 55%, transparent) 12%, color-mix(in srgb, var(--gold) 55%, transparent) 88%, transparent); }
  .hiw-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .hiw-num {
    position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
    font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--gold-text);
  }
  /* the SimoDex diamond as the step seal */
  .hiw-num::before { content: ''; position: absolute; inset: 6px; transform: rotate(45deg); border: 1.5px solid var(--gold); border-radius: 4px; background: var(--surface); box-shadow: 0 4px 12px rgba(20, 14, 4, .12); z-index: -1; }
  .hiw-step h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; color: var(--ink); }
  .hiw-step p { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); max-width: 30ch; }
  .hiw-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
  @media (max-width: 700px) {
    .how-it-works { margin-top: 18px; }
    .hiw-steps { grid-template-columns: 1fr; gap: 18px; }
    .hiw-steps::before { top: 20px; bottom: 20px; left: 19px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--gold) 55%, transparent) 10%, color-mix(in srgb, var(--gold) 55%, transparent) 90%, transparent); }
    .hiw-step { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; }
    .hiw-step p { max-width: none; }
    .hiw-actions .btn { flex: 1 1 160px; }
  }

  /* ---------- About: questions ---------- */
  .faq { border-top: 1px solid var(--line); margin: 6px 0 8px; }
  .faq details { border-bottom: 1px solid var(--line); }
  .faq summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 15px 2px; font-weight: 700; color: var(--ink); border-radius: var(--radius-s);
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary::after {
    content: ''; flex: none; width: 8px; height: 8px; margin-right: 4px;
    border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
    transform: translateY(-2px) rotate(45deg); transition: transform var(--transition);
  }
  .faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
  @media (hover: hover) and (pointer: fine) { .faq summary:hover { color: var(--jade); } }
  .faq summary:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .faq details p { margin: 0 2px 16px; color: var(--ink-soft); }

  /* ---------- "/" shortcut hint in the nav search ---------- */
  .nav-search-kbd {
    position: absolute; right: 9px; pointer-events: none;
    min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center;
    font: 700 0.72rem var(--font-body); color: var(--muted);
    border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); box-shadow: 0 1px 0 var(--line);
    transition: opacity var(--transition);
  }
  .nav-search-panel input:focus ~ .nav-search-kbd,
  .nav-search-panel input:not(:placeholder-shown) ~ .nav-search-kbd { opacity: 0; }
  @media (hover: none), (max-width: 760px) { .nav-search-kbd { display: none; } }

  /* ---------- Community pulse (home spotlight, top right) ---------- */
  .pulse {
    position: relative; z-index: 3; flex: 0 0 auto;
    width: min(560px, 100%); margin-top: 26px; padding: 18px 20px 14px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: 0 14px 34px rgba(20, 14, 4, .12);
  }
  .pulse-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
  .pulse-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0; }
  .pulse-stat { padding: 2px 10px 0; border-left: 1px solid var(--line); }
  .pulse-stat:first-child { border-left: 0; padding-left: 0; }
  .pulse-stat dt { font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
  .pulse-stat dd { margin: 2px 0 0; font-family: var(--font-body); font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
  .pulse-delta { margin: 10px 0 8px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
  .pulse-delta.is-up { color: var(--jade); }
  .pulse-chart { margin: 0; }
  .pulse-plot { position: relative; height: 76px; }
  .pulse-plot svg { display: block; width: 100%; height: 100%; overflow: visible; cursor: crosshair; touch-action: pan-y; border-radius: 4px; }
  .pulse-plot svg:focus-visible { outline: 2px solid var(--jade); outline-offset: 4px; }
  .pulse-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
  .pulse-area { fill: color-mix(in srgb, var(--jade) 12%, transparent); }
  .pulse-line { fill: none; stroke: var(--jade); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
  .pulse-cross { stroke: color-mix(in srgb, var(--ink) 35%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
  .pulse-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
  .pulse-tip {
    position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; pointer-events: none;
    padding: 6px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700;
    color: var(--surface); background: var(--ink); box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  }
  .pulse-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .spotlight-banner { flex-direction: column; }
  @media (min-width: 1180px) {
    /* wide screens: spotlight on the left, the pulse panel up in the top-right corner */
    .spotlight-banner { flex-direction: row; align-items: center; gap: 36px; }
    .spotlight-rotator { flex: 1 1 0; min-width: 0; }
    .pulse { width: 300px; margin-top: 0; align-self: flex-start; }
  }
  @media (max-width: 640px) {
    .pulse { padding: 16px 16px 12px; }
    .pulse-stat { padding: 2px 8px 0; }
  }

  /* ---------- Compare (v2): head-to-head ---------- */
  .compare-main { --me: var(--you); min-width: 0; }
  .cmp-kind { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
  .cmp-kind button { appearance: none; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 16px; border-radius: 999px; font: 700 .9rem var(--font-body); color: var(--ink-soft); min-height: 38px; }
  .cmp-kind button span { font-size: .74rem; font-weight: 600; color: var(--muted); }
  .cmp-kind button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(20, 14, 4, .12); }
  .cmp-kind button:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }

  .cmp-solo { display: grid; gap: 16px; }
  .cmp-versus {
    position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px;
    padding: 24px; border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden;
    background: linear-gradient(105deg, color-mix(in srgb, var(--me) 13%, var(--surface)) 0%, var(--surface) 42%, var(--surface) 58%, color-mix(in srgb, var(--them) 16%, var(--surface)) 100%);
    box-shadow: var(--shadow);
  }
  .cmp-card {
    appearance: none; border: 0; background: none; font: inherit; color: inherit; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: var(--radius-m); min-width: 0;
  }
  button.cmp-card { cursor: pointer; transition: background var(--transition); }
  button.cmp-card:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  @media (hover: hover) and (pointer: fine) { button.cmp-card:hover { background: color-mix(in srgb, var(--them) 10%, transparent); } }
  .cmp-card-avatar { position: relative; width: 76px; height: 76px; margin-bottom: 6px; }
  .cmp-card-avatar img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--me); }
  .cmp-card.is-them .cmp-card-avatar img { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--them); }
  .cmp-card-avatar .tier-medal { position: absolute; right: -6px; bottom: -4px; }
  .cmp-card-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmp-card-tier { font-size: .78rem; font-weight: 700; color: var(--tier-color, var(--gold-text)); }
  .cmp-card-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 6px; font-size: .8rem; color: var(--ink-soft); }
  .cmp-card-facts b { font-weight: 800; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }

  .cmp-middle { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 170px; }
  .cmp-ring { position: relative; width: 132px; height: 132px; }
  .cmp-ring svg { width: 100%; height: 100%; display: block; }
  .cmp-ring-track { fill: none; stroke: color-mix(in srgb, var(--line) 85%, var(--ink) 10%); stroke-width: 10; }
  .cmp-ring-fill { fill: none; stroke: var(--jade); stroke-width: 10; stroke-linecap: round; }
  .cmp-ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 2.4rem/1 var(--font-body); letter-spacing: -.03em; color: var(--ink); }
  .cmp-ring-num small { font-size: 1rem; margin-left: 1px; color: var(--ink-soft); align-self: center; }
  .cmp-ring-label { margin: 6px 0 0; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .cmp-verdict { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); }
  .cmp-shared { margin: 2px 0 0; font-size: .8rem; color: var(--ink-soft); }

  .cmp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
  .cmp-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; min-width: 0; }
  .cmp-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
  .cmp-panel-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); }
  .cmp-sub { margin: 0 0 10px; font-size: .84rem; line-height: 1.5; color: var(--ink-soft); }
  .cmp-legend { display: flex; gap: 14px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
  .cmp-legend span { display: inline-flex; align-items: center; gap: 6px; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmp-legend span::before { content: ''; width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--me); }
  .cmp-legend .them::before { background: var(--them); }

  /* tale of the tape */
  .cmp-tape-row { display: grid; grid-template-columns: 52px 1fr minmax(96px, auto) 1fr 52px; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .cmp-panel-head + .cmp-tape-row { border-top: 0; }
  .cmp-tape-row.is-text { grid-template-columns: 1fr minmax(96px, auto) 1fr; }
  .cmp-tape-label { text-align: center; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
  .cmp-tape-val { font-weight: 800; font-size: .98rem; color: var(--ink); }
  .cmp-tape-val.me { text-align: right; }
  .cmp-tape-val.them { text-align: left; }
  .cmp-tape-row.is-text .cmp-tape-val { font-size: .88rem; }
  .cmp-tape-bar { height: 10px; display: flex; }
  .cmp-tape-bar.me { justify-content: flex-end; }
  .cmp-tape-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--me); }
  .cmp-tape-bar.them > span { background: var(--them); }

  /* scatter */
  .cmp-scatter-plot { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: 6px; max-width: 340px; margin: 0 auto; }
  .cmp-axis-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
  .cmp-axis-x { grid-column: 2; text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
  .cmp-scatter-box { position: relative; aspect-ratio: 1; }
  .cmp-scatter-box svg { width: 100%; height: 100%; display: block; overflow: visible; border-radius: 6px; cursor: crosshair; }
  .cmp-scatter-box svg:focus-visible { outline: 2px solid var(--jade); outline-offset: 4px; }
  .cmp-grid { stroke: var(--line); stroke-width: 1; }
  .cmp-band { fill: color-mix(in srgb, var(--jade) 10%, transparent); }
  .cmp-diag { stroke: color-mix(in srgb, var(--jade) 60%, transparent); stroke-width: 1.5; }
  .cmp-dot { fill: var(--them); stroke: var(--surface); stroke-width: 2; transition: r .15s ease; }
  .cmp-dot.is-far { fill: var(--me); }
  .cmp-dot.is-on { r: 8px; }
  .cmp-tip {
    position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; z-index: 2;
    display: grid; gap: 2px; padding: 7px 10px; border-radius: 8px; max-width: 220px; text-align: center;
    font-size: .78rem; color: var(--surface); background: var(--ink); box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  }
  .cmp-tip b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* grade spread */
  .cmp-grade-cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 170px; padding-top: 6px; }
  .cmp-grade-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
  .cmp-grade-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
  .cmp-grade-bars span { width: min(24px, 42%); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--me); }
  .cmp-grade-bars span.them { background: var(--them); }
  .cmp-grade-bars span:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }

  /* agree / argue */
  .cmp-pair { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 7px 6px; margin: 0 -6px; border-radius: var(--radius-s); text-decoration: none; color: inherit; }
  @media (hover: hover) and (pointer: fine) { .cmp-pair:hover { background: var(--surface-2); } }
  .cmp-pair-cover { width: 34px; height: 48px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
  .cmp-pair-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cmp-pair-name { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmp-pair-scores { display: flex; gap: 6px; }
  .cmp-pair-scores b { min-width: 46px; text-align: center; padding: 3px 6px; border-radius: 6px; font-size: .84rem; font-weight: 800; color: var(--ink); background: color-mix(in srgb, var(--me) 14%, var(--surface)); }
  .cmp-pair-scores b.them { background: color-mix(in srgb, var(--them) 20%, var(--surface)); }

  /* several friends at once */
  .cmp-board { margin-bottom: 16px; }
  .cmp-board-list { list-style: none; margin: 0; padding: 0; }
  .cmp-board-list li { display: grid; grid-template-columns: 22px minmax(120px, 1.2fr) 2fr 52px auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
  .cmp-board-list li:first-child { border-top: 0; }
  .cmp-board-rank { font-family: var(--font-display); font-weight: 800; color: var(--gold-text); }
  .cmp-board-who { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0; text-align: left; }
  .cmp-board-avatar { position: relative; flex: none; }
  .cmp-board-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--them); }
  .cmp-board-avatar .tier-medal { position: absolute; right: -6px; bottom: -4px; }
  .cmp-board-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cmp-board-meter { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
  .cmp-board-meter span { display: block; height: 100%; border-radius: 999px; background: var(--them); }
  .cmp-board-pct { font-weight: 800; font-size: 1.05rem; text-align: right; }
  .cmp-board-meta { font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }

  /* full table, folded on a head-to-head */
  .cmp-table { padding: 0; overflow: hidden; margin-top: 16px; }
  .cmp-solo + .cmp-table { margin-top: 16px; }
  .cmp-table > summary { list-style: none; cursor: pointer; padding: 16px 20px; margin: 0; flex-wrap: nowrap; }
  .cmp-table > summary::-webkit-details-marker { display: none; }
  .cmp-table > summary .cmp-sub { margin: 0 auto 0 0; }
  .cmp-table > summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform var(--transition); align-self: center; }
  .cmp-table[open] > summary::after { transform: rotate(-135deg); }
  .cmp-table[open] > summary { border-bottom: 1px solid var(--line); }

  @media (max-width: 760px) {
    .cmp-versus { grid-template-columns: 1fr 1fr; padding: 18px 12px; gap: 10px; }
    .cmp-middle { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
    .cmp-ring { width: 112px; height: 112px; }
    .cmp-ring-num { font-size: 2rem; }
    .cmp-card-name { font-size: 1rem; }
    .cmp-grid-2 { grid-template-columns: 1fr; }
    .cmp-tape-row { grid-template-columns: 44px 1fr 1fr 44px; row-gap: 4px; }
    .cmp-tape-row .cmp-tape-label { grid-column: 1 / -1; grid-row: 1; }
    .cmp-tape-row.is-text { grid-template-columns: 1fr 1fr; }
    .cmp-board-list li { grid-template-columns: 22px 1fr 52px; }
    .cmp-board-meter, .cmp-board-meta { display: none; }
    .cmp-panel { padding: 16px; }
    .cmp-kind { display: flex; }
    .cmp-kind button { flex: 1; justify-content: center; }
  }

  .cmp-share { position: absolute; top: 14px; right: 14px; }
  .cmp-versus { padding-top: 52px; }
  .cmp-lean { margin: 6px 0 0; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
  .cmp-ring.is-empty .cmp-ring-num { color: var(--muted); }
  .cmp-shared { max-width: 26ch; }
  .cmp-pick-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(92px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
  .cmp-pick { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; min-width: 0; }
  .cmp-pick-cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
  .cmp-pick-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cmp-pick-name { font-size: .8rem; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cmp-pick-score { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; }
  @media (hover: hover) and (pointer: fine) { .cmp-pick:hover .cmp-pick-cover { border-color: var(--gold); } }
  @media (max-width: 760px) { .cmp-share { position: static; grid-column: 1 / -1; justify-self: center; } .cmp-versus { padding-top: 18px; } }

  /* phones: the bell menu spans the screen instead of hanging off the left edge */
  @media (max-width: 760px) {
    .nav-notif-menu { position: fixed; left: 8px; right: 8px; width: auto; top: calc(60px + env(safe-area-inset-top, 0px)); max-height: min(70vh, 520px); }
  }
  /* small phones: the four section tabs share the width so none get clipped */
  @media (max-width: 480px) {
    .section-switch { display: flex; }
    .section-switch a { flex: 1 1 0; text-align: center; padding: 7px 6px; font-size: .82rem; }
  }

  .cmp-kind button { white-space: nowrap; }
  .cmp-tick { fill: var(--muted); font: 600 9px var(--font-body); }
  .cmp-pick-row { padding-bottom: 12px; }
  .cmp-board-pct.is-early { font-size: .8rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
  .cmp-more { border: 1px solid var(--line); border-radius: var(--radius-m); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
  .cmp-more > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 18px; font-family: var(--font-display); font-weight: 700; color: var(--ink); }
  .cmp-more > summary::-webkit-details-marker { display: none; }
  .cmp-more > summary .cmp-sub { margin: 0 auto 0 0; font-family: var(--font-body); font-weight: 600; }
  .cmp-more > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform var(--transition); align-self: center; }
  .cmp-more[open] > summary::after { transform: rotate(-135deg); }
  .cmp-more > summary:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; border-radius: var(--radius-m); }
  .cmp-more-body { display: grid; gap: 16px; padding: 0 12px 12px; }
  @media (max-width: 760px) { .cmp-kind button span { display: none; } .cmp-more-body { padding: 0 8px 8px; } }

  /* ---------- N/A categories ---------- */
  .slider-row { grid-template-columns: 150px 1fr 34px 46px; }
  .slider-na {
    appearance: none; cursor: pointer; justify-self: end; min-width: 42px; min-height: 30px; padding: 0 8px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
    font: 800 .74rem var(--font-body); letter-spacing: .02em;
  }
  .slider-na[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
  .slider-na:disabled { opacity: .4; cursor: not-allowed; }
  .slider-na:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .slider-row.is-na label { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
  .slider-row.is-na input[type='range'] { opacity: .35; cursor: not-allowed; }
  .slider-row.is-na .slider-val { color: var(--muted); font-size: .8rem; }
  .slider-na-hint { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--surface-2); }
  .cat-na-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
  .bd-na-note { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); }
  .bd-row.is-na .bd-you-val { color: var(--muted); }
  @media (pointer: coarse), (max-width: 640px) { .slider-row { grid-template-columns: minmax(84px, 34%) 1fr 34px 46px; } }
  @media (max-width: 480px) { .slider-row { grid-template-columns: 1fr 34px 46px; } }
  .cat-manage-row .cat-na-toggle input { flex: none; }

  /* ---------- invite links ---------- */
  .invite-card {
    max-width: 560px; margin: 32px auto; padding: 36px 28px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
    border-radius: var(--radius-l); box-shadow: var(--shadow);
  }
  .invite-avatar { position: relative; width: 120px; height: 120px; margin-bottom: 6px; }
  .invite-avatar img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold); }
  .invite-avatar .tier-medal { position: absolute; right: -4px; bottom: -2px; }
  .invite-card h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.2; text-wrap: balance; }
  .invite-meta { margin: 0 0 8px; max-width: 42ch; color: var(--ink-soft); line-height: 1.55; }
  .invite-card .field-hint { max-width: 40ch; margin: 4px 0 0; }
  .invite-strip {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    margin: -6px 0 18px; padding: 12px 16px; border-radius: var(--radius-m);
    background: var(--surface-2); border: 1px solid var(--line);
  }
  .invite-strip p { margin: 0; font-size: .88rem; color: var(--ink-soft); max-width: 60ch; }
  .invite-strip strong { color: var(--ink); }
  .cmp-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }

  /* ---------- first-run checklist (home) ---------- */
  .start-card {
    margin: 0 0 22px; padding: 18px 20px 16px; border-radius: var(--radius-l);
    background: linear-gradient(150deg, color-mix(in srgb, var(--jade) 9%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in srgb, var(--jade) 30%, var(--line)); box-shadow: var(--shadow);
  }
  .start-head { display: flex; align-items: center; gap: 12px; }
  .start-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
  .start-progress-label { margin: 2px 0 0; font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
  .start-hide { margin-left: auto; }
  .start-progress { height: 8px; margin: 14px 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 80%, transparent); overflow: hidden; }
  .start-progress span { display: block; height: 100%; border-radius: 999px; background: var(--jade); transition: width .6s cubic-bezier(.16, 1, .3, 1); }
  .start-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .start-steps li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: start; gap: 6px 10px; padding: 12px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
  .start-steps li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .start-steps strong { font-size: .9rem; color: var(--ink); }
  .start-steps span:not(.start-check) { font-size: .8rem; line-height: 1.45; color: var(--ink-soft); }
  .start-steps .btn { grid-column: 2; justify-self: start; }
  .start-check { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .82rem; color: var(--ink-soft); border: 2px solid var(--line); background: var(--surface); }
  .start-check .icon { width: 15px; height: 15px; }
  .start-steps li.is-done { background: transparent; border-style: dashed; }
  .start-steps li.is-done strong { color: var(--ink-soft); }
  .start-steps li.is-done .start-check { background: var(--jade); border-color: var(--jade); color: #fbf8ef; }
  @media (max-width: 900px) { .start-steps { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 560px) {
    .start-steps { grid-template-columns: 1fr; }
    .start-steps li { grid-template-columns: auto 1fr auto; align-items: center; }
    .start-steps .btn { grid-column: 3; grid-row: 1; }
  }
  .nav-notif-row.generic .n-icon { color: var(--gold-text); }
  .nav-notif-row.generic .n-icon .icon { width: 17px; height: 17px; }
  .nav-notif-row.generic .n-icon--friend, .nav-notif-row.generic .n-icon--submission_approved { color: var(--jade); }
  .nav-notif-row.generic .n-icon--submission_rejected { color: var(--you); }
  .dd-share { display: block; margin: 10px auto 0; }

  /* ---------------- friends feed ---------------- */
  .feed-wrap { max-width: 760px; }
  .feed-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
  .feed-filter {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
    font: 700 .88rem var(--font-body); cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition);
  }
  @media (hover: hover) and (pointer: fine) { .feed-filter:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); color: var(--ink); } }
  .feed-filter.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
  .feed-filter-n { font-variant-numeric: tabular-nums; font-size: .78rem; opacity: .75; }
  .feed-filter-n:empty { display: none; }
  .feed-filter:focus-visible, .feed-name:focus-visible, .feed-who:focus-visible, .feed-title a:focus-visible, .feed-strip-item:focus-visible, .home-feed-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

  .feed { display: flex; flex-direction: column; gap: 14px; }
  .feed-day { margin: 18px 0 2px; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink-soft); letter-spacing: .02em; }
  .feed-day:first-child { margin-top: 0; }

  .feed-card {
    position: relative; padding: 16px 18px 14px; border-radius: var(--radius-l);
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(40,30,12,.06), 0 8px 22px -14px rgba(40,28,10,.35);
    animation: feed-in .5s cubic-bezier(.16, 1, .3, 1) both;
  }
  .feed-card.is-new { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
  .feed-card.is-new::before {
    content: "New"; position: absolute; top: -9px; right: 16px; padding: 2px 9px; border-radius: 999px;
    background: var(--gold); color: var(--surface); font: 800 .72rem var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  }
  @keyframes feed-in { from { opacity: 0; transform: translateY(8px); } }
  @media (prefers-reduced-motion: reduce) { .feed-card { animation: none; } }

  .feed-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
  .feed-who { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; line-height: 0; }
  .feed-who img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
  .feed-line { margin: 0; font-size: .92rem; color: var(--ink-soft); min-width: 0; }
  .feed-name { padding: 0; border: 0; background: none; text-align: left; font: 800 .95rem var(--font-body); color: var(--ink); cursor: pointer; text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color var(--transition); }
  @media (hover: hover) and (pointer: fine) { .feed-name:hover { text-decoration-color: var(--gold); } }
  .feed-time { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

  .feed-body { display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; margin-top: 14px; align-items: start; }
  .feed-cover { position: relative; display: block; width: 92px; aspect-ratio: 2 / 3; border-radius: var(--radius-m); overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 16px -8px rgba(40,28,10,.55); }
  .feed-cover img, .feed-strip-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .feed-cover .cover-fallback, .feed-strip-cover .cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; font: 700 1.6rem var(--font-display); color: var(--muted); }
  .feed-main { min-width: 0; }
  .feed-title { margin: 0; font-family: var(--font-display); font-size: 1.22rem; line-height: 1.2; text-wrap: balance; }
  .feed-title a { color: var(--ink); text-decoration: none; }
  @media (hover: hover) and (pointer: fine) { .feed-title a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; } }
  .feed-cats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; }
  .feed-cats div { display: flex; flex-direction: column; gap: 1px; }
  .feed-cats dt { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .feed-cats dd { margin: 0; font-size: .88rem; color: var(--ink-soft); }
  .feed-cats dd b { color: var(--ink); font-variant-numeric: tabular-nums; }
  .feed-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .feed-chip { padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
  .feed-chip-gold { background: var(--gold-soft); color: var(--gold-text); }
  .feed-chip-hot { background: var(--you-soft); color: color-mix(in srgb, var(--you) 78%, var(--ink)); }
  .feed-score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .feed-score-num { font: 800 1.7rem/1 var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
  .feed-score-of { font-size: .74rem; font-weight: 700; color: var(--muted); }

  .feed-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .feed-you { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); flex: 1 1 260px; }
  .feed-you .grade { margin-right: 4px; vertical-align: 1px; }
  .feed-you b { color: var(--ink); font-variant-numeric: tabular-nums; }
  .feed-you-empty { color: var(--muted); }
  .feed-agree { color: color-mix(in srgb, var(--jade) 72%, var(--ink)); font-weight: 700; }
  .feed-argue { color: color-mix(in srgb, var(--you) 78%, var(--ink)); font-weight: 700; }
  .feed-actions { display: flex; gap: 8px; }
  .feed-actions [aria-pressed="true"] { color: color-mix(in srgb, var(--jade) 72%, var(--ink)); border-color: color-mix(in srgb, var(--jade) 45%, var(--line)); }

  .feed-strip { list-style: none; margin: 14px 0 0; padding: 0 0 4px; display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .feed-strip li { scroll-snap-align: start; }
  .feed-strip-item { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
  .feed-strip-cover { display: block; aspect-ratio: 2 / 3; border-radius: var(--radius-m); overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 14px -8px rgba(40,28,10,.5); transition: transform var(--transition); }
  .feed-strip-item.is-top .feed-strip-cover { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px -8px rgba(40,28,10,.5); }
  .feed-strip-score { display: flex; align-items: center; gap: 6px; font-size: .92rem; font-variant-numeric: tabular-nums; }
  .feed-strip-name { font-size: .78rem; font-weight: 700; color: var(--ink-soft); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  @media (hover: hover) { .feed-strip-item:hover .feed-strip-cover { transform: translateY(-3px); } }
  .feed-more { align-self: center; margin-top: 6px; }

  @media (max-width: 560px) {
    .feed-card { padding: 14px 14px 12px; }
    .feed-body { grid-template-columns: 72px 1fr; gap: 12px; }
    .feed-cover { width: 72px; }
    .feed-score { grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; }
    .feed-score-num { font-size: 1.35rem; }
    .feed-actions { width: 100%; }
    .feed-actions .btn { flex: 1; }
  }

  /* nav count + tab-bar dot for unseen feed activity */
  .nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--gold); color: var(--surface); font: 800 .72rem var(--font-body); font-variant-numeric: tabular-nums; }
  .nav-count[hidden] { display: none; }
  .tab-bar-item { position: relative; }
  .tab-bar-item.has-dot::after { content: ""; position: absolute; top: 6px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--surface); }

  /* home: friends lately */
  .home-feed { margin: 0 0 22px; padding: 16px 18px 10px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .home-feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .home-feed-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
  .home-feed-all { font-size: .86rem; font-weight: 800; color: var(--gold-text); text-decoration: none; }
  @media (hover: hover) and (pointer: fine) { .home-feed-all:hover { text-decoration: underline; text-underline-offset: 3px; } }
  .home-feed-list { list-style: none; margin: 8px 0 0; padding: 0; }
  .home-deep-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  .home-feed-list li + li { border-top: 1px solid var(--line); }
  .home-feed-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; color: var(--ink-soft); }
  .home-feed-row img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
  .home-feed-text { font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-feed-text b { color: var(--ink); }
  .home-feed-time { margin-left: 8px; font-size: .78rem; font-weight: 700; color: var(--muted); }
  .home-feed-score { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
  @media (hover: hover) { .home-feed-row:hover .home-feed-text b { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; } }
  .nav-dropdown-trigger.has-dot { position: relative; }
  .nav-dropdown-trigger.has-dot::after { content: ""; position: absolute; top: 4px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--surface); }

  /* feed reactions */
  .feed-react { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
  .feed-react-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
    font: 700 .84rem var(--font-body); cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform 120ms ease-out;
  }
  .feed-react-btn .icon { width: 16px; height: 16px; }
  .feed-react-btn:active { transform: scale(.96); }
  .feed-react-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  @media (hover: hover) { .feed-react-btn:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); color: var(--ink); } }
  .feed-react-n { font-variant-numeric: tabular-nums; font-size: .78rem; padding-left: 7px; border-left: 1px solid color-mix(in srgb, currentColor 55%, transparent); }
  .feed-react-agree[aria-pressed="true"] { background: var(--jade-soft); border-color: color-mix(in srgb, var(--jade) 50%, var(--line)); color: color-mix(in srgb, var(--jade) 72%, var(--ink)); }
  .feed-react-fight[aria-pressed="true"] { background: var(--you-soft); border-color: color-mix(in srgb, var(--you) 50%, var(--line)); color: color-mix(in srgb, var(--you) 78%, var(--ink)); }
  .feed-react-want[aria-pressed="true"] { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); color: var(--gold-text); }
  .feed-react-btn[aria-pressed="true"] .icon { animation: react-pop .32s cubic-bezier(.16, 1, .3, 1); }
  @keyframes react-pop { 40% { transform: scale(1.3); } }
  @media (prefers-reduced-motion: reduce) { .feed-react-btn[aria-pressed="true"] .icon { animation: none; } }
  .feed-react-who { margin: 0; flex-basis: 100%; font-size: .8rem; font-weight: 600; color: var(--muted); }

  /* reactions on your own ratings, top of the feed */
  .takes { padding: 14px 18px 6px; border-radius: var(--radius-l); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
  .takes-title { margin: 0; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
  .takes-list { list-style: none; margin: 6px 0 0; padding: 0; }
  .takes-list li + li { border-top: 1px solid var(--line); }
  .takes-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; color: var(--ink-soft); }
  .takes-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--radius-s); }
  .takes-kind { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
  .takes-kind .icon { width: 16px; height: 16px; }
  .takes-kind-agree { background: var(--jade-soft); color: var(--jade); }
  .takes-kind-fight { background: var(--you-soft); color: var(--you); }
  .takes-kind-want { background: var(--gold-soft); color: var(--gold-text); }
  .takes-text { font-size: .9rem; line-height: 1.4; min-width: 0; }
  .takes-text b { color: var(--ink); }
  .takes-score { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
  @media (hover: hover) { .takes-row:hover .takes-text b:last-of-type { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; } }
  .nav-notif-row.generic .n-icon--react_agree { color: var(--jade); }
  .nav-notif-row.generic .n-icon--react_fight { color: var(--you); }
  .nav-notif-row.generic .n-icon--react_want { color: var(--gold-text); }

  .feed-loading { margin: 40px 0; text-align: center; color: var(--muted); font-weight: 600; }

  /* =====================================================================
     MOTION: page arrivals, the spotlight swap, list reveals, dialogs.
     Everything here is opt-in (JS adds the classes) and off under
     prefers-reduced-motion. Busy pages (rankings, Browse, title pages)
     only get the short page arrival.
     ===================================================================== */
  @media (prefers-reduced-motion: no-preference) {
    /* page arrival after in-app navigation (not on first load) */
    .page-anim .page.active:not(#pageWrapped) { animation: page-in 320ms var(--ease-out) backwards; }
    @keyframes page-in { from { opacity: 0; translate: 0 8px; } }

    /* spotlight: the new title racks into focus, then its text follows */
    .spotlight-card { animation: none; }
    .spotlight-card:not(.no-enter) .spotlight-cover-wrap { animation: spot-focus 700ms var(--ease-out) backwards; }
    .spotlight-card:not(.no-enter) .spotlight-content > * { animation: spot-rise 560ms var(--ease-out) backwards; }
    .spotlight-card:not(.no-enter) .spotlight-content > :nth-child(2) { animation-delay: 50ms; }
    .spotlight-card:not(.no-enter) .spotlight-content > :nth-child(3) { animation-delay: 100ms; }
    .spotlight-card:not(.no-enter) .spotlight-content > :nth-child(4) { animation-delay: 150ms; }
    .spotlight-card:not(.no-enter) .spotlight-content > :nth-child(5) { animation-delay: 200ms; }
    @keyframes spot-focus { from { opacity: 0; scale: 1.05; filter: blur(10px); } }
    @keyframes spot-rise { from { opacity: 0; translate: 0 10px; } }

    /* auto-advance timer on the active thumbnail (pauses while you read) */
    .spotlight-thumb { position: relative; }
    .spotlight-thumb.active::after {
      content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
      background: var(--gold); transform-origin: left; transform: scaleX(0);
      animation: spot-timer var(--spot-ms, 6000ms) linear forwards;
    }
    .spotlight-rotator.is-paused .spotlight-thumb.active::after { animation-play-state: paused; }
    @keyframes spot-timer { to { transform: scaleX(1); } }

    /* cover tilts toward a mouse pointer, with a soft light where it points */
    @media (hover: hover) and (pointer: fine) {
      .spotlight-cover-wrap {
        position: relative;
        transform: perspective(900px) rotateY(calc(var(--px, 0) * 5deg)) rotateX(calc(var(--py, 0) * -5deg));
        transition: transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out);
      }
      .spotlight-cover-wrap::after {
        content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
        background: radial-gradient(circle at calc(50% + var(--px, 0) * 50%) calc(50% + var(--py, 0) * 50%), rgba(255, 248, 225, .22), transparent 60%);
        transition: opacity 400ms var(--ease-out);
      }
      .spotlight-card:hover .spotlight-cover-wrap { box-shadow: 0 28px 70px rgba(0,0,0,0.3); }
      .spotlight-card:hover .spotlight-cover-wrap::after { opacity: 1; }
    }

    /* depth as the spotlight scrolls away: the title sinks a little slower
       than the page, the glows drift the other way. Scroll-driven, so it
       runs off the main thread; browsers without it just scroll normally. */
    @supports (animation-timeline: view()) {
      .spotlight-banner { view-timeline: --spot block; }
      .spotlight-banner::before, .spotlight-banner::after {
        animation-timeline: --spot; animation-range: exit 0% exit 100%; animation-fill-mode: both; animation-timing-function: linear;
      }
      /* only where the pulse panel sits beside the title; stacked, it would slide under it */
      @media (min-width: 1180px) {
        .spotlight-rotator {
          animation: spot-sink linear both; animation-timeline: --spot; animation-range: exit 0% exit 100%;
        }
      }
      .spotlight-banner::before { animation-name: glow-up; }
      .spotlight-banner::after { animation-name: glow-down; }
      @keyframes spot-sink { to { translate: 0 18%; opacity: .35; } }
      @keyframes glow-up { to { translate: 40px -90px; } }
      @keyframes glow-down { to { translate: -40px -30px; } }
    }

    /* lists on the home page settle in once, in order, as they scroll into view */
    .reveal-ready [data-reveal]:not(.is-in) > * { opacity: 0; translate: 0 14px; }
    .reveal-ready [data-reveal].is-in > * {
      transition: opacity 600ms var(--ease-out), translate 700ms var(--ease-out);
      transition-delay: calc(var(--ri, 0) * 60ms);
    }

    /* dialogs open from just below and settle; the backdrop fades */
    dialog[open] { animation: dlg-in 300ms var(--ease-out); }
    dialog[open]::backdrop { animation: dlg-fade 300ms var(--ease-out); }
    @keyframes dlg-in { from { opacity: 0; translate: 0 12px; scale: .98; } }
    @keyframes dlg-fade { from { opacity: 0; } }
  }

  /* hover feedback on the home destinations: quicker in, softer settle */
  .quicklink-card { transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out), border-color 160ms ease; }
  .quicklink-icon { transition: background 200ms ease; }
  .quicklink-card:active { transform: translateY(-1px) scale(.99); transition-duration: 80ms; }

  /* =====================================================================
     MOTION, part 2: one entrance per page, in the Laocoon/Halcyon manner
     (headlines come into focus, things land in order), plus feedback on
     the bell, menus and toast. .arrive is added by switchPage() for 1.6s
     after an in-app navigation, so none of this replays while you work.
     ===================================================================== */
  @media (prefers-reduced-motion: no-preference) {
    /* page titles come into focus and their tracking settles */
    .page.arrive .brand h1,
    .page.arrive .prose-head h1,
    .page.arrive #animeDetailTitle { animation: title-focus 720ms var(--ease-out) backwards; }
    @keyframes title-focus { from { opacity: 0; filter: blur(8px); letter-spacing: 0.09em; } }

    /* the SIMODEX wordmark sharpens as the home intro scrolls into view */
    @supports (animation-timeline: view()) {
      .hero-home::before {
        animation: mark-focus linear both;
        animation-timeline: view(); animation-range: entry 0% cover 35%;
      }
      @keyframes mark-focus { from { opacity: .2; filter: blur(6px); letter-spacing: 0.2em; } }
    }

    /* podium: bronze, then silver, then gold lands; the medal stamps on */
    .page.arrive .podium-card { animation: podium-up 620ms var(--ease-out) backwards; }
    .page.arrive .podium-card.rank-2 { animation-delay: 110ms; }
    .page.arrive .podium-card.rank-1 { animation-delay: 220ms; }
    .page.arrive .podium-medal { animation: medal-stamp 420ms var(--ease-out) backwards; animation-delay: 520ms; }
    @keyframes podium-up { from { opacity: 0; translate: 0 26px; } }
    @keyframes medal-stamp { from { opacity: 0; scale: 1.6; } 60% { opacity: 1; scale: .92; } }

    /* profile: the license is dealt onto the table */
    .page.arrive .license-stage .license { animation: license-deal 760ms var(--ease-out) backwards; transform-origin: 50% 100%; }
    @keyframes license-deal { from { opacity: 0; translate: 0 24px; rotate: -2deg; filter: blur(4px); } }

    /* title page: score bars and the grade spread fill in from zero */
    .page.arrive .bd-fill { transform-origin: left; animation: bar-x 700ms var(--ease-out) backwards; animation-delay: 160ms; }
    .page.arrive .dist-bar { transform-origin: bottom; animation: bar-y 640ms var(--ease-out) backwards; animation-delay: 200ms; }
    @keyframes bar-x { from { transform: scaleX(0); } }
    @keyframes bar-y { from { transform: scaleY(0); } }
    .page.arrive .detail-hero-art.has-banner { animation: art-settle 1100ms var(--ease-out) backwards; }
    @keyframes art-settle { from { opacity: 0; scale: 1.06; } }

    /* compare: the taste-match ring draws round to its value */
    .cmp-ring-fill { animation: ring-draw 900ms var(--ease-out) backwards; animation-delay: 120ms; }
    @keyframes ring-draw { from { stroke-dashoffset: var(--ring, 0); } }

    /* community pulse: the line is drawn left to right the first time */
    .pulse-plot.is-first svg { animation: chart-wipe 1000ms var(--ease-out) backwards; animation-delay: 150ms; }
    @keyframes chart-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

    /* bell: the count pops when something new arrives */
    .nav-notif-badge.is-pop { animation: badge-pop 480ms var(--ease-out); }
    @keyframes badge-pop { 0% { scale: .4; } 55% { scale: 1.25; } 100% { scale: 1; } }

    /* menus (Ranking, Social, the bell) drop open from their trigger */
    .nav-dropdown.open .nav-dropdown-menu { animation: menu-in 180ms var(--ease-out); transform-origin: top; }
    @keyframes menu-in { from { opacity: 0; translate: 0 -6px; scale: .98; } }

    /* toast: rises with a slight settle */
    .toast { transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-out); }

    /* prose pages: a hairline under the nav shows how far through you are */
    @supports (animation-timeline: scroll()) {
      body:has(.page.active > .prose-page) .app-nav::after {
        content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
        background: var(--gold); transform-origin: left; transform: scaleX(0); pointer-events: none;
        animation: read-progress linear both; animation-timeline: scroll(root);
      }
      @keyframes read-progress { to { transform: scaleX(1); } }
    }
  }

  /* ---------- contrast fixes from the impeccable audit (2026-11-10) ----------
     Coloured text on its own soft tint is nudged toward --ink, which darkens
     it on parchment and lightens it on obsidian, so the hue stays and both
     themes clear 4.5:1. */
  input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
  .grade { color: color-mix(in srgb, var(--g) 72%, var(--ink)); }
  .tier-badge, .license-tier, .nav-account-tier, .tier-list-name { color: color-mix(in srgb, var(--tier-color, var(--muted)) 75%, var(--ink)); }
  .row-rank.rank-1 { color: var(--gold-text); }
  .row-rank.rank-2 { color: color-mix(in srgb, var(--rank-silver) 75%, var(--ink)); }
  .rank-step-name { color: color-mix(in srgb, var(--tier-color) 75%, var(--ink)); }
  .grade.grade-s, .spotlight-score .grade.grade-s { color: color-mix(in srgb, var(--gold-text) 55%, var(--ink)); }
  .badge-slot:not(.earned) .badge-name, .badge-how { color: var(--ink-soft); }
  .badge-slot.earned .badge-how { color: color-mix(in srgb, var(--jade) 80%, var(--ink)); }
  .podium-medal { color: #231f17; text-shadow: 0 1px 0 rgba(255, 250, 235, .45); }
  /* reading measure: keep prose and synopses near 70 characters a line */
  .prose-page p, .prose-page li, .faq details p, #animeDetailSynopsis p { max-width: 36em; }

  /* =====================================================================
     PROFILE: the license is the hero. It sits alone on a lit stage with
     its one action under it; the numbers follow as a strip, and the page
     ends on somewhere to go next.
     ===================================================================== */
  .profile-head { margin-bottom: 4px; }
  .license-stage {
    position: relative; isolation: isolate; display: grid; justify-items: center; gap: 18px;
    padding: 26px 0 34px; margin-bottom: 18px;
  }
  .license-stage::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(48% 62% at 50% 42%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%),
      radial-gradient(30% 9% at 50% 88%, color-mix(in srgb, var(--ink) 16%, transparent), transparent 100%);
  }
  .license-stage-card { position: relative; width: min(640px, 100%); }
  .license-stage-card .license { max-width: none; box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 30px 60px -18px rgba(40,28,10,0.38), 0 2px 6px rgba(40,28,10,0.08); }
  .license-stage-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
  @media (min-width: 640px) {
    .license-stage-card .license-name { font-size: 1.9rem; }
    .license-stage-card .license-photo { width: 112px; height: 140px; }
  }
  /* the card leans toward a mouse pointer and catches the light where it points */
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .license-stage-card {
      transform: perspective(1100px) rotateY(calc(var(--px, 0) * 5deg)) rotateX(calc(var(--py, 0) * -4deg));
      transition: transform 600ms var(--ease-out);
    }
    .license-stage-card::after {
      content: ''; position: absolute; inset: 0; border-radius: 18px; pointer-events: none; opacity: 0;
      background: radial-gradient(circle at calc(50% + var(--px, 0) * 50%) calc(50% + var(--py, 0) * 50%), rgba(255, 248, 225, .28), transparent 55%);
      mix-blend-mode: soft-light; transition: opacity 400ms var(--ease-out);
    }
    .license-stage-card:hover::after { opacity: 1; }
  }

  /* numbers as one ruled strip instead of a second card beside the license */
  .profile-ledger {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 18px 28px; align-items: center;
    background: none; border: 0; border-block: 1px solid var(--line); border-radius: 0; padding: 18px 2px; margin-bottom: 26px;
  }
  .ledger-strip { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, auto)); justify-content: space-between; gap: 14px 22px; }
  .ledger-strip div { min-width: 0; }
  .ledger-strip dt { font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); white-space: nowrap; }
  .ledger-strip dd { margin: 2px 0 0; font: 700 1.5rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
  .ledger-strip dd small { display: block; font: 600 0.74rem var(--font-body); color: var(--ink-soft); margin-top: 2px; }
  .ledger-strip .ledger-split { padding-right: 22px; border-right: 1px solid var(--line); }
  .profile-ledger .char-collection { margin: 0; background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 2px 0 2px 24px; }
  @media (max-width: 960px) {
    .profile-ledger { grid-template-columns: 1fr; }
    .profile-ledger .char-collection { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  }
  @media (max-width: 640px) {
    .ledger-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ledger-strip .ledger-split { padding-right: 0; border-right: 0; }
    .ledger-strip dd { font-size: 1.3rem; }
    .ledger-strip dt { white-space: normal; }
  }

  /* genre bars diverge from your own average, so differences are visible */
  .genre-chart-axis { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin: 14px 50px -4px 118px; font-size: 0.72rem; color: var(--muted); }
  .genre-chart-axis span:nth-child(2) { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); }
  .genre-chart-axis span:last-child { text-align: right; }
  .genre-chart-row .g-bar-wrap { position: relative; background: var(--surface-2); overflow: visible; }
  .genre-chart-row .g-bar-wrap::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink-soft); opacity: .5; }
  .genre-chart-row .g-bar { position: absolute; top: 0; bottom: 0; height: auto; border-radius: 999px; }
  .genre-chart-row .g-bar.up { left: 50%; background: var(--jade); }
  .genre-chart-row .g-bar.down { right: 50%; background: var(--gold); }
  .genre-chart-row .g-val { flex-basis: 40px; font-variant-numeric: tabular-nums; }
  .profile-highlight-row .h-count { font-size: 0.85rem; color: var(--ink-soft); }
  .controversial-row + .controversial-row { margin-top: 12px; }

  /* the page ends on somewhere to go */
  .profile-outro { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
  .profile-outro-tile {
    display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; text-decoration: none; color: var(--ink);
    border-radius: var(--radius-l); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
    background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 60%), var(--surface);
    transition: border-color 200ms ease, translate 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
  }
  .profile-outro-title { font: 700 1.2rem/1.2 var(--font-display); color: var(--ink); }
  .profile-outro-text { color: var(--ink-soft); font-size: 0.92rem; }
  @media (hover: hover) and (pointer: fine) { .profile-outro-tile:hover { border-color: var(--gold); translate: 0 -2px; box-shadow: 0 14px 30px -14px rgba(40,28,10,0.35); } }
  .profile-outro-tile:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }

  /* =====================================================================
     HOME HERO: the spotlit title owns the banner. Its art is blown up and
     softened behind everything (crossfading on each swap), its rank sits
     behind it as a large engraved numeral, and the name comes into focus
     word by word.
     ===================================================================== */
  .spotlight-backdrop { position: absolute; inset: -80px; z-index: 0; pointer-events: none; overflow: hidden; }
  .spotlight-backdrop img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: blur(64px) saturate(1.25); opacity: 0; transform: scale(1.1);
    transition: opacity 900ms var(--ease-out);
  }
  .spotlight-backdrop img.in { opacity: .34; }
  .spotlight-backdrop img.out { opacity: 0; }
  :root[data-theme="dark"] .spotlight-backdrop img.in { opacity: .42; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spotlight-backdrop img.in { opacity: .42; } }
  /* a veil keeps the text side calm whatever the art */
  .spotlight-backdrop::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(70% 80% at 62% 50%, color-mix(in srgb, var(--surface) 55%, transparent), transparent 75%);
  }
  .spotlight-rotator { position: relative; z-index: 1; }
  .spotlight-card { position: relative; isolation: isolate; }
  .spotlight-numeral {
    position: absolute; z-index: -1; right: -10px; top: 50%; translate: 0 -58%; pointer-events: none;
    font: 800 clamp(9rem, 17vw, 15rem)/1 var(--font-display); letter-spacing: -0.02em;
    color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--gold) 60%, transparent);
    opacity: .55; font-variant-numeric: lining-nums;
  }
  .spotlight-name { font-size: clamp(2.2rem, 3.4vw, 3.3rem); line-height: 1.06; text-wrap: balance; margin-bottom: 14px; }
  .spotlight-name .sw { display: inline-block; }
  @media (max-width: 640px) {
    .spotlight-numeral { display: none; }
    .spotlight-name { font-size: 1.7rem; line-height: 1.15; }
    .spotlight-backdrop::after { background: color-mix(in srgb, var(--surface) 35%, transparent); }
  }
  @media (prefers-reduced-motion: no-preference) {
    .spotlight-card:not(.no-enter) .spotlight-content > .spotlight-name { animation: none; }
    .spotlight-card:not(.no-enter) .spotlight-name .sw { animation: word-focus 720ms var(--ease-out) backwards; animation-delay: calc(60ms + var(--wi, 0) * 70ms); }
    .spotlight-card:not(.no-enter) .spotlight-numeral { animation: numeral-in 1000ms var(--ease-out) backwards; }
    @keyframes word-focus { from { opacity: 0; filter: blur(10px); translate: 0 .25em; } }
    @keyframes numeral-in { from { opacity: 0; translate: 40px -58%; } }
  }

  /* =====================================================================
     TITLE PAGES: a taller, cinematic banner that drifts slower than the
     page as you scroll (Halcyon's pinned-scene feel, without pinning), and
     a larger title set over it.
     ===================================================================== */
  @media (min-width: 761px) {
    .detail-hero { height: clamp(300px, 46vh, 460px); }
    .title-main h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); text-wrap: balance; }
  }
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: scroll()) {
      .detail-hero-art {
        animation: hero-drift linear both; animation-timeline: scroll(root); animation-range: 0 520px;
      }
      @keyframes hero-drift { to { translate: 0 22%; } }
      /* the arrival settle and the drift share the element; arrival wins briefly */
      .page.arrive .detail-hero-art.has-banner { animation: art-settle 1100ms var(--ease-out) backwards, hero-drift linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 520px; }
    }
  }

  /* =====================================================================
     ROUND 4: page-by-page fixes from the pre-push review
     ===================================================================== */
  /* Home, signed out: the pulse panel ends on a way in */

  /* Community: your own score reads as yours without shouting in coral */
  .mine-chip { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }

  /* Ranking: edit/delete stay out of the way until you point at a row */
  @media (hover: hover) and (pointer: fine) {
    .rank-row .row-actions-inline .btn-icon { opacity: 0; }
    .rank-row:hover .row-actions-inline .btn-icon,
    .rank-row:focus-within .row-actions-inline .btn-icon { opacity: 1; }
  }

  /* Title pages: chips over the banner get a solid backing so they stay legible */
  .anime-detail-meta .tag { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
  #animeDetailRecommendedGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  @media (max-width: 640px) { #animeDetailRecommendedGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  /* phones: cover, then what it is, then the numbers, then what you can do */
  @media (max-width: 860px) {
    .title-main { display: contents; }
    .title-side .anime-detail-cover { order: 1; }
    .anime-detail-meta { order: 2; margin: 0; }
    #animeDetailTitle { order: 3; margin: -8px 0 0; }
    .title-alt { order: 4; margin: -12px 0 0; min-height: 0; }
    .title-alt:empty { display: none; }
    .stat-strip { order: 5; margin: 0; }
    .title-actions { order: 6; }
    .title-main > .title-grid, .title-main > .title-panel, .title-main > .anime-detail-recommended { order: 7; }
    .info-panel { order: 8; }
    .owner-tools { order: 9; }
  }

  /* About / Privacy / Terms: the reading-progress line replaces the gold border, not stacks on it */
  body:has(.page.active > .prose-page) .app-nav { border-bottom-color: var(--line); }

  /* Wrapped: a quiet inset edge for keyboard focus instead of a big box */
  .wrapped-nav:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px rgba(212,175,90,.45); border-radius: 18px; }

  /* Profile: ledger values line up on one baseline even when a label wraps */
  .ledger-strip div { display: flex; flex-direction: column; justify-content: flex-end; }

  /* Browse: covers have a soft tint while loading, so the grid doesn't flash white */
  .browse-card-cover { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 12%, var(--surface-2)), var(--surface-2)); }

  /* Friends: long names get two lines before they truncate */
  .friend-card-name { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }

  /* 404: an engraved numeral behind Dex, and two ways forward */
  .not-found { position: relative; isolation: isolate; }
  .nf-numeral {
    position: absolute; z-index: -1; left: 50%; top: 18px; translate: -50% 0; pointer-events: none;
    font: 900 clamp(7rem, 22vw, 13rem)/1 var(--font-display); letter-spacing: .02em;
    color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--gold-text) 55%, transparent);
  }
  .nf-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

  /* Shared /u/ profile: the license gets the same lit stage as your own */
  .public-profile-license.license-stage { padding: 10px 0 24px; margin: 0; }
  .public-profile-license .license-stage-card { width: 100%; }

  /* =====================================================================
     LICENSE CARD: printed-document details. An engraved double rule under
     the band, a matted photo window with a hologram layer that catches the
     light as the card tilts, an engraved initial when there is no photo,
     and flat icon avatars centred on the mat instead of cropped.
     ===================================================================== */
  .license { box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 0 0 1px color-mix(in srgb, var(--tier-color) 12%, transparent) inset, 0 18px 40px rgba(40,28,10,0.16), 0 2px 6px rgba(40,28,10,0.08); }
  .license-band {
    position: relative; overflow: hidden;
    background:
      repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 1px, transparent 1px 5px),
      linear-gradient(90deg, color-mix(in srgb, var(--tier-color) 42%, #0d0b07), color-mix(in srgb, var(--tier-color) 55%, #0d0b07));
    box-shadow: 0 2px 0 color-mix(in srgb, var(--tier-color) 70%, transparent), 0 5px 0 -2px color-mix(in srgb, var(--tier-color) 26%, transparent);
  }
  .license-org { display: inline-flex; align-items: center; gap: 8px; }
  .license-org::before {
    content: ''; width: 7px; height: 7px; rotate: 45deg; flex-shrink: 0;
    background: color-mix(in srgb, var(--tier-color) 45%, #fbf8ef);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tier-color) 40%, #0d0b07), 0 0 0 3px color-mix(in srgb, var(--tier-color) 55%, #fbf8ef);
  }
  .license-body { padding-top: 22px; }

  /* photo window */
  .license-photo-frame {
    position: relative; flex-shrink: 0; align-self: flex-start; padding: 5px; border-radius: 13px; isolation: isolate;
    background: color-mix(in srgb, var(--tier-color) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--tier-color) 45%, var(--line));
    box-shadow: 0 6px 14px rgba(40,28,10,0.18);
  }
  .license-photo-frame .license-photo { display: block; border: 0; box-shadow: none; border-radius: 9px; }
  /* hologram: a faint foil band across the photo that shifts as the card leans */
  .license-photo-frame::after {
    content: ''; position: absolute; inset: 5px; border-radius: 9px; pointer-events: none; z-index: 1;
    background: linear-gradient(115deg, transparent 30%, rgba(245,211,107,.30) 42%, rgba(240,139,209,.22) 50%, rgba(139,198,240,.26) 58%, transparent 70%);
    background-size: 250% 100%; background-position: calc(50% + var(--px, 0) * 60%) 0;
    mix-blend-mode: soft-light; opacity: .7; transition: background-position 600ms var(--ease-out);
  }
  /* flat icon avatars: centred on a tinted mat, never cropped */
  .license-photo.is-icon {
    object-fit: contain; padding: 14%; box-sizing: border-box;
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tier-color) 20%, var(--surface)), color-mix(in srgb, var(--tier-color) 8%, var(--surface-2)) 72%);
  }
  /* no avatar: an engraved initial on guilloché, in the tier colour */
  .license-photo-frame .license-photo--blank, .license-photo--blank {
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    background:
      repeating-radial-gradient(circle at 50% 42%, transparent 0 7px, color-mix(in srgb, var(--tier-color) 14%, transparent) 7px 8px),
      radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tier-color) 14%, var(--surface)), var(--surface-2) 75%);
  }
  .license-photo--blank span {
    font: 800 3rem/1 var(--font-display); color: color-mix(in srgb, var(--tier-color) 80%, var(--ink));
    text-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
  }
  .license-stage-card .license-photo--blank span { font-size: 3.6rem; }
  @media (max-width: 420px) {
    .license-photo--blank span { font-size: 2.2rem; translate: -6px -12px; }
    .license-photo-frame { padding: 4px; }
    .license-photo-frame::after { inset: 4px; }
  }

  /* fields read like printed data */
  .license-fields dd { font-variant-numeric: tabular-nums; }
  .license-fields > div:not(.license-field-wide) { padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--tier-color) 22%, var(--line)); }
  .license-field-wide { padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--tier-color) 22%, var(--line)); }

  /* the medal sits in a soft pool of its own colour */
  .license-medal::before {
    content: ''; position: absolute; inset: -14px; border-radius: 50%; z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--tier-color) 22%, transparent), transparent);
  }

  /* the foil band catches the light once as the card is dealt in */
  @media (prefers-reduced-motion: no-preference) {
    .page.arrive .license-band::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(105deg, transparent 35%, rgba(255,248,225,.28) 50%, transparent 65%);
      translate: -100% 0; animation: license-glint 1.4s 500ms var(--ease-out) forwards;
    }
  }
  @keyframes license-glint { to { translate: 100% 0; } }
  @media (prefers-reduced-motion: reduce) { .license-photo-frame::after { transition: none; } }

  /* Compare: the mini cards borrow the license's printing */
  .cmp-card { position: relative; isolation: isolate; overflow: hidden; }
  .cmp-card::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .45;
    background: repeating-radial-gradient(circle at 115% 120%, transparent 0 9px, color-mix(in srgb, var(--tier-color) 10%, transparent) 9px 10px);
  }
  .cmp-card::after {
    content: 'Ranker license'; order: -1; margin-bottom: 8px; padding-bottom: 6px; align-self: stretch; text-align: center;
    font: 700 0.72rem/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid color-mix(in srgb, var(--tier-color) 30%, var(--line));
  }

  /* =====================================================================
     WATCHLIST TOOLBAR (count + sort)
     ===================================================================== */
  .watch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -6px 0 16px; }
  .watch-count { margin: 0; font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); }
  .watch-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
  .watch-sort select { min-width: 0; max-width: 62vw; }
  .watch-rank { color: var(--jade); font-weight: 800; }
  @media (max-width: 520px) {
    .watch-toolbar { margin-top: 0; }
    .watch-sort { flex: 1 1 100%; }
    .watch-sort select { flex: 1; max-width: none; }
  }

  /* ---------- phone run-through 2026-11-13 ---------- */
  /* tiny labels up to the 0.72rem floor */
  .rank-hash { font-size: max(0.6em, 0.72rem); }
  .season-chip-when { font-size: 0.72rem; }
  /* swipeable rows hint that they carry on past the edge */
  @media (max-width: 640px) {
    .type-tabs { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent); }
    /* three dropdowns: the last one takes the full row instead of sitting alone */
    .controls select:last-of-type { grid-column: 1 / -1; }
  }
  @media (max-width: 820px) {
    /* friend chips scroll inside the card, not past its edge */
    .compare-sidebar { overflow: hidden; }
    #compareFriendPicker { margin: 0 -12px; padding: 0 12px 2px; overscroll-behavior-x: contain; scroll-padding-inline: 12px; }
  }
  /* finger-sized targets on touch screens */
  @media (pointer: coarse) {
    .row-actions-inline .btn-icon, .watchlist-toggle-btn,
    #pageCommunity .rank-row .watchlist-toggle-btn { width: 40px; height: 40px; }
    .rank-row .btn-sm { min-height: 40px; }
    /* press feedback, since there is no hover on a phone */
    .btn:active, .btn-icon:active, .type-tab:active, .watchlist-toggle-btn:active { transform: scale(0.96); }
    .rank-row:active, .browse-card:active, .feed-card:active { transform: scale(0.99); }
  }
  dialog, .nav-menu, .notif-menu, .nav-search-results { overscroll-behavior: contain; }

  /* ---------- 2026-11-13: community board, pitch, leaderboard, tablet nav ---------- */
  /* ---------- home: community ranking board (the main feature) ---------- */
  .home-ranking-hero { margin: 36px 0 24px; position: relative; z-index: 2; }
  .hb-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .hb-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0; letter-spacing: 0; }
  .hb-sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
  .hb-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
  .hb-tab { appearance: none; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: 0.86rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; }
  .hb-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
  .hb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); column-gap: 40px; }
  .hb-row { display: grid; grid-template-columns: 34px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 0; }
  .hb-rank { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
  .hb-row:nth-child(-n+3) .hb-rank { color: var(--gold-text); }
  .hb-cover { width: 44px; height: 62px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
  .hb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .hb-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .hb-name { font-weight: 700; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hb-meta { font-size: 0.78rem; color: var(--muted); }
  .hb-meta b { color: var(--ink-soft); }
  .hb-score { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--jade); font-variant-numeric: tabular-nums; }
  .hb-score .grade { font-size: 0.72rem; }
  .hb-empty { padding: 18px 0; }
  .hb-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
  @media (hover: hover) and (pointer: fine) { .hb-row:hover { background: var(--surface-2); } .hb-row:hover .hb-name { text-decoration: underline; text-underline-offset: 3px; } }
  .hb-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
  @media (max-width: 760px) {
    .hb-list { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
    .hb-row { grid-template-columns: 26px 38px minmax(0, 1fr) auto; gap: 10px; padding: 9px 2px; }
    .hb-cover { width: 38px; height: 54px; }
    .hb-rank { font-size: 1.1rem; }
    .hb-tabs { width: 100%; } .hb-tab { flex: 1; }
    .hb-foot .btn { flex: 1; }
  }
  .hb-near .hb-name { color: var(--ink-soft); }
  .hb-near .hb-cover { opacity: .75; }
  .hb-score-soft { color: var(--muted); font-size: 1rem; }
  /* signed-out pitch: one sentence and the sign-up button above the spotlight */
  .home-pitch { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .home-pitch[hidden] { display: none; }
  .home-pitch p { margin: 0; font-weight: 600; font-size: 0.95rem; max-width: 52ch; }
  @media (min-width: 1180px) { .home-pitch { justify-content: center; gap: 12px 24px; } }
  .title-actions { flex-wrap: wrap; }
  .title-actions .btn { white-space: nowrap; justify-content: center; }
  .title-actions > .btn-primary { flex: 1 1 100%; }
  /* tablet widths: the full top bar is ~990px, so search becomes an icon and the
     account pill shows just the picture until there's room */
  @media (min-width: 760px) and (max-width: 1099px) {
    .nav-account-text, .nav-account-chevron { display: none; }
    .nav-account-btn { min-width: 0; padding: 3px; gap: 0; }
    .nav-search-open { display: inline-flex; }
    .nav-search-panel { display: none; }
    .nav-search.open .nav-search-panel {
      display: flex; position: fixed; left: 0; right: 0; top: 0; z-index: 70; gap: 8px;
      padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .nav-search.open .nav-search-panel input, .nav-search.open .nav-search-panel input:focus { width: auto; flex: 1; }
    .nav-search.open .nav-search-close { display: inline-flex; appearance: none; border: 0; background: none; font: 700 0.9rem var(--font-body); color: var(--jade); padding: 0 4px; cursor: pointer; }
    .nav-search-results { position: fixed; top: 60px; left: 16px; right: 16px; width: auto; }
  }
  /* leaderboard: who / range switches side by side, each ranker's top pick */
  .lb-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 4px 0 18px; }
  .lb-controls .lb-seg { margin: 0; }
  .lb-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .lb-row-inner { grid-template-columns: 44px 52px minmax(0, 1fr) 30px auto; }
  .lb-pick { width: 30px; height: 42px; border-radius: 3px; overflow: hidden; }
  .lb-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .lb-summary strong { color: var(--ink); }
  @media (max-width: 520px) { .lb-row-inner { grid-template-columns: 30px 44px minmax(0, 1fr) auto; } .lb-pick { display: none; } }
  /* the board sits in the same card style as the rest of home */
  .home-ranking-hero { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 24px; box-shadow: var(--shadow-lift); }
  .hb-tab, .lb-seg button { font-family: var(--font-body); }
  @media (max-width: 760px) { .home-ranking-hero { padding: 18px 16px; } }

  /* =====================================================================
     DEEP CUTS: niche points. Series colours (shows / movies / manga) are
     the --dc-* tokens, set per theme in the three token blocks and checked
     with the dataviz palette validator. Bars are thin segmented figures
     with surface gaps; a legend with the numbers always sits beside them.
     ===================================================================== */
  .dc-show { --dc: var(--dc-show); }
  .dc-movie { --dc: var(--dc-movie); }
  .dc-manga { --dc: var(--dc-manga); }

  .dc-bar { display: flex; gap: 2px; width: 100%; height: 10px; border-radius: 999px; overflow: hidden; }
  .dc-seg { flex: 0 0 var(--w); background: var(--dc); }
  .dc-rest { flex: 1 1 auto; min-width: 0; background: color-mix(in srgb, var(--gold) 14%, var(--surface-2)); }
  .dc-bar--slim { height: 4px; margin-top: 6px; max-width: 260px; }
  .dc-bar--slim .dc-rest { background: transparent; }
  @media (prefers-reduced-motion: no-preference) {
    .dc-seg { transform-origin: left center; }
    .lb-list.is-deep .dc-seg,
    .reveal-ready .dc-meter[data-reveal].is-in .dc-seg { animation: dc-grow 760ms var(--ease-out) backwards; animation-delay: calc(var(--si, 0) * 90ms + var(--i, 0) * 28ms); }
    .reveal-ready .dc-meter[data-reveal]:not(.is-in) .dc-seg { transform: scaleX(0); }
  }
  @keyframes dc-grow { from { transform: scaleX(0); } }
  /* the meter itself never fades with the generic reveal, only its bar grows */
  .reveal-ready .dc-meter[data-reveal]:not(.is-in) > *, .reveal-ready .dc-meter[data-reveal].is-in > * { opacity: 1; translate: none; animation: none; }

  .dc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
  .dc-legend li { display: inline-flex; align-items: center; gap: 6px; }
  .dc-legend b { font-family: var(--font-display); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
  .dc-legend li.is-zero { color: var(--muted); }
  .dc-legend li.is-zero b { color: var(--muted); }
  .dc-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--dc); flex-shrink: 0; }

  /* Profile panel: boxed like the rank path */
  .deep-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 22px 22px; margin-bottom: 26px; }
  .dc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
  .dc-head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
  .dc-head .field-hint { margin: 0; max-width: 52ch; }
  .dc-figure { display: flex; flex-direction: column; align-items: flex-end; margin: 0; line-height: 1; flex-shrink: 0; }
  .dc-figure strong { font: 900 2.6rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
  .dc-figure span { margin-top: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .dc-meter-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 10px; }
  .dc-next { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .dc-sub { font-family: var(--font-display); font-size: 0.92rem; margin: 20px 0 8px; color: var(--ink); }
  .dc-picks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .dc-pick {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px 8px 8px;
    border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface-2); color: var(--ink); text-decoration: none;
    transition: border-color var(--transition), background var(--transition);
  }
  .dc-pick-cover { width: 40px; height: 56px; border-radius: 4px; overflow: hidden; background: var(--surface); }
  .dc-pick-cover img, .dc-pick-cover .cover-fallback { width: 100%; height: 100%; object-fit: cover; display: flex; }
  .dc-pick-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .dc-pick-name > span { font-weight: 700; font-size: 0.9rem; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .dc-pick-name small { font-size: 0.74rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
  .dc-pick-pts { font: 800 1.05rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
  .dc-pick-pts.is-offer { color: var(--ink-soft); font-weight: 700; }
  @media (hover: hover) and (pointer: fine) { .dc-pick:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: var(--surface); } }
  .dc-pick:active { background: var(--surface); }
  .dc-pick:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  @media (max-width: 760px) { .dc-picks { grid-template-columns: 1fr; } }
  @media (max-width: 480px) {
    .dc-head { flex-direction: column; gap: 10px; }
    .dc-figure { flex-direction: row; align-items: baseline; gap: 8px; }
    .dc-figure strong { font-size: 2.2rem; }
  }

  /* Leaderboard */
  .lb-deep-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -4px 0 12px; font-size: 0.8rem; color: var(--muted); }
  .lb-deep-key .dc-legend { font-size: 0.8rem; }
  .lb-seg-metric[hidden] { display: none; }

  /* Title pages: one quiet row under the stats */
  .stat-strip .stat-you { border-right: 0; }
  .stat-niche {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
    padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--ink-soft);
  }
  .sn-label { font-weight: 700; color: var(--muted); letter-spacing: .04em; }
  .sn-label b { font-family: var(--font-display); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
  .stat-niche.is-deep .sn-label { color: var(--ink-soft); }
  .sn-meter {
    position: relative; width: 120px; height: 4px; border-radius: 999px; flex-shrink: 0;
    background: linear-gradient(90deg, color-mix(in srgb, var(--muted) 30%, var(--surface-2)) var(--cut, 30%), color-mix(in srgb, var(--gold) 45%, var(--surface-2)) var(--cut, 30%));
  }
  .sn-meter::before { content: ''; position: absolute; left: var(--cut, 30%); top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .6; }
  .sn-dot { position: absolute; top: 50%; left: var(--n); width: 10px; height: 10px; border-radius: 50%; translate: -50% -50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
  .stat-niche.is-deep .sn-dot { background: var(--gold-text); }
  .sn-note { margin-left: auto; font-weight: 600; }
  @media (max-width: 480px) { .sn-note { margin-left: 0; flex-basis: 100%; } }

  /* License: a third field when Deep cuts are on */
  .license-fields.has-deep { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @media (max-width: 420px) { .license-fields.has-deep { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (pointer: coarse) { .lb-seg button { min-height: 40px; } }

  /* ---------- Deep cuts vocabulary: one small outlined pill, two words ---------- */
  .niche-chip {
    display: inline-flex; align-items: center; align-self: flex-start; padding: 2px 9px; border-radius: 999px;
    font: 700 0.72rem/1.4 var(--font-body); letter-spacing: .03em; white-space: nowrap;
    color: var(--jade); border: 1px solid color-mix(in srgb, var(--jade) 45%, var(--line)); background: transparent;
  }
  .niche-chip.is-buried { color: var(--gold-text); border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
  .browse-card .niche-chip { margin-top: 6px; }
  .rank-niche { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
  .rank-niche .dc-pick-pts { font-size: 0.9rem; }
  .xp-toast-deep { margin-top: 6px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
  .xp-toast-deep b { font-family: var(--font-display); color: var(--jade); }

  /* ---------- Deep cuts page ---------- */
  .dcp-points { text-decoration: none; }
  .dcp-points b { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
  /* level picker: reads left to right as the scale itself, deepest first */
  .dcp-levels { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
  .dcp-levels::-webkit-scrollbar { display: none; }
  .dcp-level {
    appearance: none; display: inline-flex; align-items: baseline; gap: 7px; flex: none; white-space: nowrap; text-align: left; cursor: pointer; padding: 8px 15px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
    font: inherit; transition: border-color var(--transition), background var(--transition), transform var(--transition);
    touch-action: manipulation; user-select: none; -webkit-user-select: none;
  }
  .dcp-level-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); }
  .dcp-level-range { font-size: 0.72rem; color: var(--muted); }
  .dcp-level b { font-size: 0.8rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
  .dcp-level.is-buried .dcp-level-name { color: var(--gold-text); }
  .dcp-level.is-deep .dcp-level-name { color: var(--jade); }
  .dcp-level.active { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); background: color-mix(in srgb, var(--gold-soft) 55%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent); }
  .dcp-level:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
  .dcp-level:active { transform: scale(.98); }
  @media (hover: hover) and (pointer: fine) { .dcp-level:not(.active):hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); } }
  @media (max-width: 760px) {
    .dcp-levels { margin-inline: -20px; padding-inline: 20px; overscroll-behavior-x: contain; }
  }
  .dcp-list .rank-row { grid-template-columns: 40px 56px minmax(0, 1fr) auto auto; }
  .dcp-pos { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
  .dcp-scale-row { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
  .dcp-scale-row .sn-meter { width: 110px; }
  .dcp-n { font-size: 0.78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
  .dcp-n b { font-family: var(--font-display); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; }
  .dcp-n.is-deep { color: var(--jade); }
  .dcp-n.is-buried { color: var(--gold-text); }
  .dcp-row .sn-dot { background: var(--ink-soft); }
  .dcp-row:has(.dcp-n.is-deep) .sn-dot, .dcp-row:has(.dcp-n.is-buried) .sn-dot { background: var(--gold-text); }
  .dcp-unscored { display: block; margin-top: 7px; font-size: 0.75rem; color: var(--muted); }
  .dcp-pts { display: grid; justify-items: end; font: 800 1.3rem/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 64px; }
  .dcp-pts small { font: 600 0.72rem/1.3 var(--font-body); color: var(--muted); letter-spacing: .03em; }
  .dcp-pts.is-earned { color: var(--jade); }
  .dcp-row.is-mine .rank-title::after { content: 'Rated'; margin-left: 8px; font: 700 0.72rem/1 var(--font-body); color: var(--jade); letter-spacing: .04em; vertical-align: middle; }
  @media (max-width: 640px) {
    .dcp-list .rank-row { grid-template-columns: 28px 46px minmax(0, 1fr) auto; }
    .dcp-list .rank-row .row-actions-inline { grid-column: auto; margin-top: 0; position: absolute; top: 6px; right: 6px; }
    .dcp-list .rank-row { position: relative; }
    .dcp-list .rank-row .watchlist-toggle-btn { width: 28px; height: 28px; }
    .dcp-pts { align-self: end; min-width: 0; font-size: 1.1rem; }
    .dcp-scale-row .sn-meter { width: 72px; }
    .dcp-pos { font-size: 0.9rem; }
  }
  .dc-all { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 0.85rem; color: var(--jade); text-decoration: none; }
  .dc-all::after { content: ' \2192'; }
  @media (hover: hover) and (pointer: fine) { .dc-all:hover { text-decoration: underline; } }
