  /* Profile page */
  body.profile-active {
    overflow: hidden;
  }
  body.profile-active #site-top-counters,
  body.profile-active .header,
  body.profile-active #preview-banner {
    display: none !important;
  }
  body.profile-active #app-container {
    display: block !important;
    min-height: 100vh;
  }
  .profile-page {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1400;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top, 0px);
    background:
      radial-gradient(circle at 12% 8%, rgba(245,158,11,0.18), transparent 26%),
      radial-gradient(circle at 84% 10%, rgba(124,58,237,0.30), transparent 30%),
      radial-gradient(circle at 65% 92%, rgba(34,211,238,0.10), transparent 28%),
      linear-gradient(135deg, #050410 0%, #120d26 48%, #050410 100%);
  }
  body.light-mode .profile-page {
    background:
      radial-gradient(circle at 12% 8%, rgba(245,158,11,0.16), transparent 28%),
      radial-gradient(circle at 84% 10%, rgba(124,58,237,0.16), transparent 32%),
      linear-gradient(135deg, #f4f1fb 0%, #ffffff 48%, #ede9fe 100%);
  }
  .profile-shell.container {
    max-width: 1320px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 18px 34px;
    display: grid;
    grid-template-columns: minmax(350px, 420px) minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "hero favs"
      "links favs";
    gap: 16px;
    align-content: start;
  }
  .profile-topbar {
    grid-area: topbar;
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0 4px;
    background: transparent;
    backdrop-filter: none;
  }
  body.light-mode .profile-topbar {
    background: transparent;
  }
  .profile-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .profile-topbar-title {
    color: #f8f4ff;
    font-family: 'Sora', sans-serif;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: -0.2px;
  }
  .profile-topbar-sub {
    color: #8f86aa;
    font-size: 12px;
    margin-top: 2px;
  }
  .profile-back-btn {
    padding: 9px 15px;
    border: 1px solid rgba(196,181,253,0.20);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    color: #e8e3f3;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }
  .profile-back-btn:hover { border-color: #8b5cf6; background: rgba(139,92,246,0.14); }
  .profile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
  }
  .profile-settings-btn,
  .profile-share-btn,
  .profile-save-btn {
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  }
  .profile-settings-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(196,181,253,0.22);
    background: rgba(255,255,255,0.06);
    color: #f7f3ff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.045);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .profile-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(196,181,253,0.22);
    background: rgba(255,255,255,0.06);
    color: #f7f3ff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.045);
  }
  .profile-settings-btn:hover,
  .profile-share-btn:hover {
    border-color: #f4d27a;
    background: rgba(245,158,11,0.13);
    transform: translateY(-1px);
  }
  .profile-save-btn {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    box-shadow: 0 12px 30px rgba(124,58,237,0.30), inset 0 0 0 1px rgba(255,255,255,0.12);
  }
  .profile-save-btn:hover { transform: translateY(-1px); }
  .profile-settings-page {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow-y: auto;
    padding: max(22px, calc(env(safe-area-inset-top, 0px) + 18px)) 0 42px;
    background:
      linear-gradient(180deg, rgba(5,4,16,0.97), rgba(5,4,16,0.985)),
      radial-gradient(circle at 18% 12%, rgba(124,58,237,0.22), transparent 28%),
      radial-gradient(circle at 82% 8%, rgba(245,158,11,0.12), transparent 24%);
  }
  .profile-settings-shell {
    display: grid;
    gap: 16px;
  }
  .profile-page.settings-open .profile-shell {
    visibility: hidden;
    pointer-events: none;
  }
  .profile-page.settings-open .profile-settings-page {
    visibility: visible;
    pointer-events: auto;
  }
  .profile-settings-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .profile-settings-card {
    border: 1px solid rgba(167,139,250,0.18);
    border-radius: 24px;
    padding: 20px;
    background: rgba(255,255,255,0.04);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  }
  .profile-settings-card-head { margin-bottom: 14px; }
  .profile-settings-card-title {
    color: #f7f3ff;
    font-size: 16px;
    font-weight: 900;
  }
  .profile-settings-card-sub {
    margin-top: 4px;
    color: #bdb4d8;
    font-size: 13px;
    line-height: 1.5;
  }
  .profile-rating-option-list {
    display: grid;
    gap: 10px;
  }
  .profile-rating-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(196,181,253,0.14);
    border-radius: 18px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
  }
  /* v809: respect the HTML `hidden` attribute. `display: flex` above
     otherwise wins over the browser default `display: none` that the
     `hidden` attribute is supposed to set — which is why Light Mode and
     Cream Light remained visible in Profile → Settings → Theme even
     though their wrapping <label> already had hidden + aria-hidden. */
  .profile-rating-option[hidden] { display: none !important; }
  .profile-rating-option input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: #8b5cf6;
  }
  .profile-rating-option-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .profile-rating-option-copy strong {
    color: #f7f3ff;
    font-size: 14px;
    font-weight: 800;
  }
  .profile-rating-option-copy small {
    color: #bdb4d8;
    font-size: 12px;
  }
  .profile-rating-option-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  .profile-rating-option-disabled input {
    cursor: not-allowed;
  }
  .profile-rating-option-copy .theme-disabled-note {
    margin-top: 2px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 300;
    line-height: 1.25;
  }
  .profile-hero-card {
    grid-area: hero;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(167,139,250,0.20);
    border-radius: 28px;
    padding: 70px 18px 18px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
      radial-gradient(circle at 16% 18%, rgba(245,158,11,0.20), transparent 30%),
      radial-gradient(circle at 86% 10%, rgba(124,58,237,0.33), transparent 36%),
      rgba(6,5,16,0.82);
    box-shadow: 0 24px 70px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.045);
  }
  .profile-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255,255,255,0.10), transparent 30%, rgba(255,255,255,0.035));
  }
  .profile-card-logout-btn {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 2;
    padding: 8px 13px;
    border: 1px solid rgba(239,68,68,0.24);
    border-radius: 999px;
    background: rgba(35,10,20,0.68);
    color: #fda4af;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  }
  .profile-card-lists-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    padding: 8px 13px;
    border: 1px solid rgba(244,210,122,0.30);
    border-radius: 999px;
    background: rgba(244,210,122,0.10);
    color: #fff0bf;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  }
  .profile-card-lists-btn:hover {
    transform: translateY(-1px);
    border-color: #f4d27a;
    background: rgba(244,210,122,0.18);
    color: #fff6d8;
  }
  .profile-card-logout-btn:hover {
    transform: translateY(-1px);
    border-color: #ef4444;
    background: rgba(69,10,20,0.84);
    color: #fecdd3;
  }
  .profile-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 124px 1fr;
    gap: 16px;
    align-items: start;
  }
  .profile-avatar-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .profile-page-avatar {
    width: 118px;
    height: 118px;
    border-radius: 30px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.18);
    background: #151025;
    box-shadow: 0 18px 42px rgba(0,0,0,0.34), 0 0 0 7px rgba(167,139,250,0.08), 0 0 42px rgba(245,158,11,0.12);
  }
  .profile-avatar-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
  .profile-mini-btn {
    border: 1px solid rgba(196,181,253,0.18);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.06);
    color: #e8e3f3;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    font-family: 'DM Sans', sans-serif;
  }
  .profile-mini-btn:hover { border-color: #a78bfa; background: rgba(167,139,250,0.14); }
  .profile-main-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .profile-eyebrow { font-size: 10px; color: #f4d27a; text-transform: uppercase; letter-spacing: 1.7px; font-weight: 900; }
  .profile-name-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 0 0 2px;
    background: transparent;
    color: #fff;
    font-size: clamp(27px, 3vw, 40px);
    font-family: 'Sora', sans-serif;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.8px;
  }
  .profile-name-input.creator-name-input {
    color: #f4d27a;
    text-shadow: 0 0 12px rgba(244,210,122,0.26), 0 0 22px rgba(251,191,36,0.14);
  }
  .profile-name-input.creative-team-name-input {
    color: #67e8f9;
    text-shadow: 0 0 12px rgba(34,211,238,0.22), 0 0 22px rgba(34,211,238,0.12);
  }
  .profile-creator-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: calc(100% - 120px);
    margin: 0 auto 14px;
    color: #f4d27a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 0 10px rgba(244,210,122,0.24), 0 0 18px rgba(251,191,36,0.12);
    position: relative;
    z-index: 1;
  }
  .profile-page.own-creator-profile .profile-creator-badge {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: min(54vw, 430px);
    margin: 0;
    z-index: 2;
  }
  .profile-creator-badge .creator-role {
    color: #ff5a6b;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-shadow: 0 0 10px rgba(255,90,107,0.24), 0 0 18px rgba(255,90,107,0.12);
  }
  .profile-name-input::placeholder { color: rgba(255,255,255,0.34); }
  .profile-bio-input {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    outline: none;
    padding: 10px 2px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #e8e3f3;
    font-size: 13px;
    line-height: 1.48;
    font-family: 'DM Sans', sans-serif;
    text-shadow: 0 1px 10px rgba(0,0,0,0.42), 0 0 18px rgba(0,0,0,0.2);
  }
  .profile-bio-input:focus { border: 0; background: transparent; }
  .profile-social-counts {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 14px 0 5px;
  }
  .profile-social-count {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(196,181,253,0.18);
    border-radius: 18px;
    padding: 12px 13px 11px;
    background:
      radial-gradient(circle at 18% 0%, rgba(244,210,122,0.16), transparent 44%),
      linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
      rgba(255,255,255,0.045);
    color: #f7f3ff;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-align: center;
    box-shadow:
      0 12px 26px rgba(0,0,0,0.18),
      inset 0 0 0 1px rgba(255,255,255,0.035);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  }
  .profile-social-count::before {
    content: "";
    position: absolute;
    inset: -45% -20% auto auto;
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(103,232,249,0.24), transparent 66%);
    pointer-events: none;
  }
  .profile-social-count::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255,255,255,0.12), transparent 38%, rgba(255,255,255,0.035));
    pointer-events: none;
  }
  .profile-social-count:hover {
    transform: translateY(-2px);
    border-color: rgba(103,232,249,0.34);
    background: rgba(103,232,249,0.08);
    box-shadow:
      0 16px 34px rgba(0,0,0,0.24),
      0 0 24px rgba(103,232,249,0.08),
      inset 0 0 0 1px rgba(255,255,255,0.045);
  }
  .profile-social-count strong {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 21px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.6px;
  }
  .profile-social-count span {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 6px;
    color: #c7bdf0;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .profile-social-count:first-child {
    background:
      radial-gradient(circle at 18% 0%, rgba(244,210,122,0.20), transparent 44%),
      linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
      rgba(255,255,255,0.045);
  }
  .profile-social-count:first-child strong { color: #f9e7a8; }
  .profile-social-count:last-child {
    background:
      radial-gradient(circle at 82% 0%, rgba(103,232,249,0.18), transparent 44%),
      linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
      rgba(255,255,255,0.045);
  }
  .profile-social-count:last-child strong { color: #bff8ff; }
  .profile-social-sheet {
    width: min(92vw, 430px);
  }
  .profile-social-list {
    display: grid;
    gap: 9px;
    max-height: min(58vh, 460px);
    overflow-y: auto;
    padding-right: 2px;
  }
  .profile-social-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(196,181,253,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.045);
  }
  .profile-social-user-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    border: 0;
    background: transparent;
    color: #f7f3ff;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
  }
  .profile-social-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(196,181,253,0.18);
    background: #151025;
  }
  .profile-social-view-btn {
    border: 1px solid rgba(103,232,249,0.22);
    border-radius: 999px;
    padding: 8px 11px;
    background: rgba(103,232,249,0.08);
    color: #8feeff;
    font-size: 11px;
    font-weight: 950;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
  }
  .profile-url-inline { display: none; }
  .profile-url-inline input { width: 100%; margin-top: 2px; }
  .profile-theme-row {
    margin-top: 2px;
    border-top: 1px solid rgba(196,181,253,0.12);
    padding: 10px 0 0;
  }
  .profile-stats-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
  }
  .profile-stat-card {
    position: relative;
    overflow: hidden;
    padding: 14px 12px 12px;
    min-height: 118px;
    border-radius: 18px;
    border: 1px solid rgba(167,139,250,0.14);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.028)),
      rgba(255,255,255,0.032);
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,0.03),
      0 14px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
  }
  .profile-stat-card::before {
    content: "";
    position: absolute;
    inset: auto -18% 52% 38%;
    height: 120px;
    background: radial-gradient(circle, rgba(167,139,250,0.22), transparent 68%);
    transform: rotate(12deg);
  }
  .profile-stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.07), transparent 42%);
    pointer-events: none;
  }
  .profile-stat-hours {
    border-color: rgba(244,210,122,0.16);
    background:
      radial-gradient(circle at top right, rgba(245,158,11,0.14), transparent 34%),
      linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.028)),
      rgba(255,255,255,0.032);
  }
  .profile-stat-score {
    background:
      radial-gradient(circle at top right, rgba(103,232,249,0.12), transparent 34%),
      linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.028)),
      rgba(255,255,255,0.032);
  }
  .profile-stat-icon { display: none; }
  .profile-stat-value { position: relative; z-index: 1; font-size: 25px; font-weight: 950; color: #f7f3ff; letter-spacing: -0.9px; line-height: 0.95; }
  .profile-stat-label { position: relative; z-index: 1; margin-top: 10px; color: #a9a0c6; font-size: 10px; line-height: 1.24; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 900; }
  .profile-stat-label-main { color: #f7f3ff; font-size: 10px; letter-spacing: 0.5px; }
  .profile-stat-label-sub { display: block; margin-top: 4px; color: #bdb4d8; font-size: 9px; letter-spacing: 0.55px; }
  .profile-stat-card.profile-stat-hidden { opacity: 0.72; }
  .profile-stat-toggle { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; color: #bdb4d8; font-size: 7px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; user-select: none; }
  .profile-stat-toggle input { width: 10px; height: 10px; accent-color: #8b5cf6; }
  .profile-section-card {
    border: 1px solid rgba(167,139,250,0.17);
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
      rgba(6,5,16,0.78);
    padding: 18px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22), inset 0 0 0 1px rgba(255,255,255,0.035);
  }
  .profile-favorites-card { grid-area: favs; }
  .profile-links-card { grid-area: links; }
  .profile-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .profile-section-title { color: #f8f4ff; font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 900; letter-spacing: -0.2px; }
  .profile-section-sub { color: #8f86aa; font-size: 12px; margin-top: 4px; line-height: 1.45; }
  .profile-favorites-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .profile-favorite-group {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(167,139,250,0.13);
    border-radius: 20px;
    padding: 13px;
    background: rgba(255,255,255,0.035);
  }
  .profile-favorite-group::after {
    content: "";
    position: absolute;
    inset: auto -20% -42% 42%;
    height: 110px;
    background: radial-gradient(circle, rgba(245,158,11,0.12), transparent 68%);
    pointer-events: none;
  }
  .profile-favorite-title { position: relative; color: #e8e3f3; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
  .profile-pin-slot { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 9px; align-items: center; margin-bottom: 9px; }
  .profile-pin-slot:last-child { margin-bottom: 0; }
  .profile-pin-cover {
    width: 46px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #2a1f5e, #151025);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8f7fd0;
    font-size: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 18px rgba(0,0,0,0.24);
  }
  .profile-pin-select {
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border-radius: 12px;
    border: 1px solid #3d3466;
    background: #0a081a;
    color: #e8e3f3;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
  }
  .profile-links-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .profile-link-row {
    display: grid;
    grid-template-columns: 34px 1fr 28px;
    gap: 9px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(167,139,250,0.13);
    border-radius: 17px;
    background: rgba(255,255,255,0.035);
  }
  .profile-link-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #151025;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
  }
  .profile-link-icon img { width: 21px; height: 21px; object-fit: contain; }
  .profile-link-field label { display: block; color: #e8e3f3; font-size: 11px; font-weight: 950; margin-bottom: 4px; }
  .profile-link-field input {
    width: 100%;
    padding: 8px 9px;
    border-radius: 10px;
    border: 1px solid #3d3466;
    background: #0a081a;
    color: #e8e3f3;
    font-size: 12px;
    outline: none;
    font-family: 'DM Sans', sans-serif;
  }
  .profile-external-link {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #3d3466;
    color: #c4b5fd;
    text-decoration: none;
    background: rgba(167,139,250,0.08);
    font-size: 13px;
  }
  .profile-external-link.disabled { pointer-events: none; opacity: 0.35; }
  body.preview-mode .user-area { pointer-events: auto !important; opacity: 1 !important; }
  body.preview-mode .edit-profile-btn,
  body.preview-mode .user-avatar { pointer-events: auto !important; opacity: 1 !important; }
  body.preview-mode .logout-btn { pointer-events: none !important; opacity: 0.45 !important; }

  body.light-mode .profile-back-btn,
  body.light-mode .profile-mini-btn,
  body.light-mode .profile-settings-btn,
  body.light-mode .profile-share-btn { background: #ede9fe; border-color: #c8bfe8; color: #12082e; }
  body.light-mode .profile-card-lists-btn {
    background: rgba(245,158,11,0.10);
    border-color: rgba(217,119,6,0.20);
    color: #8a4b00;
  }
  body.light-mode .profile-card-lists-btn:hover {
    border-color: #d97706;
    background: rgba(245,158,11,0.16);
  }
  body.light-mode .profile-settings-btn:hover,
  body.light-mode .profile-share-btn:hover { border-color: #d97706; background: rgba(245,158,11,0.14); }
  body.light-mode .profile-settings-page {
    background:
      linear-gradient(180deg, rgba(244,241,251,0.985), rgba(244,241,251,0.99)),
      radial-gradient(circle at 18% 12%, rgba(124,58,237,0.12), transparent 28%);
  }
  body.light-mode .profile-settings-card {
    border-color: #d8cfee;
    background: rgba(255,255,255,0.82);
  }
  body.light-mode .profile-settings-card-title,
  body.light-mode .profile-rating-option-copy strong { color: #12082e; }
  body.light-mode .profile-settings-card-sub,
  body.light-mode .profile-rating-option-copy small { color: #6d5b92; }
  body.light-mode .profile-rating-option {
    border-color: rgba(124,58,237,0.12);
    background: rgba(124,58,237,0.03);
  }
  body.light-mode .profile-topbar-title,
  body.light-mode .profile-name-input,
  body.light-mode .profile-stat-value,
  body.light-mode .profile-section-title,
  body.light-mode .profile-favorite-title,
  body.light-mode .profile-link-field label { color: #12082e; }
  body.light-mode .profile-name-input.creator-name-input,
  body.light-mode .profile-creator-badge {
    color: #c89200;
    text-shadow: 0 0 8px rgba(200,146,0,0.18), 0 0 14px rgba(244,210,122,0.10);
  }
  body.light-mode .profile-topbar-sub,
  body.light-mode .profile-stat-label,
  body.light-mode .profile-stat-label-sub,
  body.light-mode .profile-stat-toggle,
  body.light-mode .profile-section-sub { color: #5a4780; }
  body.light-mode .profile-stat-label-main { color: #12082e; }
  body.light-mode .profile-hero-card,
  body.light-mode .profile-section-card { background: rgba(255,255,255,0.78); border-color: #d8cfee; box-shadow: 0 20px 50px rgba(30,20,60,0.10), inset 0 0 0 1px rgba(255,255,255,0.62); }
  body.light-mode .profile-card-logout-btn {
    background: rgba(255,255,255,0.82);
    border-color: rgba(220,38,38,0.18);
    color: #b91c1c;
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
  }
  body.light-mode .profile-card-lists-btn {
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
  }
  body.light-mode .profile-card-logout-btn:hover {
    border-color: #dc2626;
    background: #fff1f2;
    color: #991b1b;
  }
  body.light-mode .profile-eyebrow { color: #b7791f; }
  body.light-mode .profile-name-input::placeholder { color: rgba(18,8,46,0.32); }
  body.light-mode .profile-bio-input,
  body.light-mode .profile-pin-select,
  body.light-mode .profile-link-field input { background: #fff; border-color: #d8cfee; color: #12082e; }
  body.light-mode .profile-bio-input {
    background: transparent;
    border-color: transparent;
    text-shadow: 0 1px 10px rgba(255,255,255,0.72), 0 0 16px rgba(255,255,255,0.4);
  }
  body.light-mode .profile-social-count,
  body.light-mode .profile-social-user-row {
    background: rgba(124,58,237,0.045);
    border-color: #d8cfee;
    color: #12082e;
  }
  body.light-mode .profile-social-count span {
    color: #5a4780;
  }
  body.light-mode .profile-social-user-main {
    color: #12082e;
  }
  body.light-mode .profile-social-view-btn {
    background: rgba(8,145,178,0.08);
    border-color: rgba(8,145,178,0.20);
    color: #0e7490;
  }
  body.light-mode .profile-stat-card,
  body.light-mode .profile-favorite-group,
  body.light-mode .profile-link-row { background: rgba(124,58,237,0.045); border-color: #d8cfee; }
  body.light-mode .profile-link-icon { background: #f4f1fb; border-color: #d8cfee; }

  @media (max-width: 1050px) {
    .profile-shell.container {
      grid-template-columns: 1fr;
      grid-template-areas:
        "topbar"
        "hero"
        "favs"
        "links";
      max-width: 820px;
    }
    .profile-hero-inner { grid-template-columns: 150px 1fr; }
    .profile-page-avatar { width: 140px; height: 140px; }
    .profile-links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 700px) {
    .profile-page {
      position: fixed;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .profile-page::-webkit-scrollbar { display: none; }
    .profile-shell.container { padding: 12px 12px 26px; gap: 12px; }
    .profile-topbar { padding: 8px 0 4px; }
    .profile-topbar-title { font-size: 15px; }
    .profile-topbar-sub { display: none; }
    .profile-topbar { align-items: flex-start; }
    .profile-topbar-actions { gap: 7px; }
    .profile-settings-topbar {
      align-items: flex-start;
      flex-direction: column;
      gap: 10px;
    }
    .profile-settings-btn,
    .profile-share-btn,
    .profile-save-btn,
    .profile-back-btn { padding: 9px 12px; font-size: 12px; }
    .profile-settings-btn {
      width: 38px;
      min-width: 38px;
      height: 38px;
      padding: 0;
      font-size: 15px;
    }
    .profile-share-btn span:last-child { display: none; }
    .profile-settings-card {
      padding: 16px;
      border-radius: 20px;
    }
    .profile-rating-option {
      padding: 12px 14px;
      border-radius: 16px;
    }
    .profile-hero-card,
    .profile-section-card { border-radius: 22px; padding: 15px; }
    .profile-hero-card { padding-top: 66px; }
    .profile-card-logout-btn {
      top: 15px;
      left: 15px;
      padding: 8px 13px;
      font-size: 11px;
    }
    .profile-card-lists-btn {
      top: 15px;
      right: 15px;
      padding: 8px 13px;
      font-size: 11px;
    }
    .profile-page.own-creator-profile .profile-creator-badge {
      top: 15px;
      max-width: calc(100% - 132px);
    }
    .profile-creator-badge {
      width: 100%;
      margin-bottom: 12px;
    }
    .profile-hero-inner { grid-template-columns: 1fr; gap: 12px; }
    .profile-avatar-panel { flex-direction: row; align-items: center; justify-content: center; }
    .profile-page-avatar { width: 96px; height: 96px; border-radius: 24px; }
    .profile-avatar-actions { justify-content: flex-start; }
    .profile-name-input { text-align: center; font-size: 31px; }
    .profile-eyebrow { text-align: center; }
    .profile-social-counts { justify-content: center; }
    .profile-stats-grid,
    .profile-favorites-grid,
    .profile-links-grid { grid-template-columns: 1fr; }
    .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .profile-stat-card { min-height: 102px; padding: 12px 10px 10px; border-radius: 16px; }
    .profile-stat-value { font-size: 22px; }
    .profile-stat-label { margin-top: 8px; }
    .profile-section-head { margin-bottom: 12px; }
    .profile-section-title { font-size: 18px; }
  }

  /* Profile grouped showcase redesign */
  .profile-shell.container {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    grid-template-areas:
      "topbar topbar"
      "hero hero"
      "favs links";
  }
  .profile-favorites-card { align-self: start; }
  .profile-showcase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .profile-media-group { position: relative; overflow: hidden; border: 1px solid rgba(167,139,250,0.15); border-radius: 24px; padding: 15px; background: radial-gradient(circle at 8% 2%, rgba(245,158,11,0.10), transparent 26%), linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025); }
  .profile-media-group[data-profile-group="overall"] {
    background: radial-gradient(circle at 8% 8%, rgba(245,158,11,0.18), transparent 28%), radial-gradient(circle at 88% 0%, rgba(139,92,246,0.18), transparent 34%), linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border-color: rgba(245,158,11,0.20);
  }
  .profile-media-group[data-profile-group="overall"] .profile-fav-poster { box-shadow: 0 14px 28px rgba(245,158,11,0.14), 0 10px 22px rgba(0,0,0,0.28); }
  .profile-media-group.profile-media-group-wide { grid-column: 1 / -1; }
  .profile-media-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .profile-media-title-wrap { min-width: 0; }
  .profile-media-title { display: flex; align-items: center; gap: 8px; color: #f8f4ff; font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 950; letter-spacing: -0.25px; }
  .profile-media-sub { margin-top: 4px; color: #8f86aa; font-size: 11px; line-height: 1.35; }
  .profile-group-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .profile-group-stat { border: 0; border-radius: 0; padding: 10px 0; background: transparent; }
  .profile-group-stat-value { color: #f7f3ff; font-size: 19px; line-height: 1; font-weight: 500; letter-spacing: -0.4px; }
  .profile-group-stat-label { color: #bdb4d8; font-size: 9px; line-height: 1.25; text-transform: uppercase; letter-spacing: 0.85px; font-weight: 900; margin-top: 6px; }
  .profile-fav-row { margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(196,181,253,0.11); }
  .profile-fav-row:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
  .profile-fav-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
  .profile-fav-row-title { color: #e8e3f3; font-size: 11px; font-weight: 950; text-transform: uppercase; letter-spacing: 1px; }
  .profile-row-toggle { display: inline-flex; align-items: center; gap: 6px; color: #bdb4d8; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.7px; cursor: pointer; user-select: none; white-space: nowrap; }
  .profile-row-toggle input { accent-color: #8b5cf6; }
  .profile-hidden-note { border: 1px dashed rgba(167,139,250,0.22); border-radius: 16px; padding: 14px; color: #8f86aa; font-size: 12px; text-align: center; background: rgba(255,255,255,0.025); }
  .profile-fav-poster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .profile-fav-poster-card { position: relative; min-width: 0; border: 1px solid rgba(167,139,250,0.13); border-radius: 18px; padding: 8px; background: rgba(255,255,255,0.035); text-align: center; }
  .profile-fav-share-btn { display: none; }
  .profile-fav-share-icon { width: 10px; height: 10px; display: block; }
  .profile-section-share-btn { position: absolute; top: 12px; right: 12px; z-index: 4; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; background: transparent; color: #ffffff; cursor: pointer; opacity: 0.8; transition: opacity 0.18s; }
  .profile-section-share-btn:hover { opacity: 1; }
  .profile-section-share-btn .profile-fav-share-icon { width: 16px; height: 16px; }
  .profile-fav-poster { width: 100%; aspect-ratio: 2 / 3; border-radius: 13px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a1f5e, #151025); border: 1px solid rgba(255,255,255,0.08); color: #8f7fd0; font-size: 24px; background-size: cover; background-position: center; box-shadow: 0 12px 22px rgba(0,0,0,0.26); }
  .profile-fav-poster-action { cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
  .profile-fav-poster-action:hover { transform: translateY(-2px); border-color: rgba(244,210,122,0.55); box-shadow: 0 16px 28px rgba(0,0,0,0.32), 0 0 0 1px rgba(244,210,122,0.12); }
  .profile-fav-name { margin-top: 8px; min-height: 30px; color: #f7f3ff; font-size: 12px; line-height: 1.25; font-weight: 900; text-align: center; overflow-wrap: anywhere; }
  .profile-fav-rating { margin-top: 4px; color: #f4d27a; font-size: 11px; line-height: 1.2; font-weight: 950; text-align: center; min-height: 14px; }
  .profile-fav-rank { margin-top: 6px; font-size: 20px; line-height: 1; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.28)); }
  .profile-fav-shared-focus { box-shadow: 0 0 0 1px rgba(201,168,76,0.84), 0 0 0 5px rgba(201,168,76,0.18), 0 18px 36px rgba(0,0,0,0.32) !important; }
  .profile-fav-empty { color: #a99dc6; }
  .profile-fav-empty-rating { color: #6c627f; }
  .profile-card-edit-panel { display: none; margin-top: 9px; padding: 8px; border-radius: 14px; border: 1px solid rgba(167,139,250,0.18); background: rgba(10,8,26,0.92); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035); }
  .profile-card-edit-panel.open { display: block; }
  .profile-pin-select { margin-top: 8px; min-height: 35px; border-radius: 11px; font-size: 11px; padding: 7px 7px; }
  .profile-manual-input, .profile-manual-image, .profile-manual-rating { width: 100%; margin-top: 7px; padding: 7px 8px; border-radius: 10px; border: 1px solid #3d3466; background: #0a081a; color: #e8e3f3; outline: none; font-family: 'DM Sans', sans-serif; font-size: 11px; }
  .profile-manual-rating { text-align: center; color: #f4d27a; font-weight: 900; }
  .profile-links-card { align-self: start; position: sticky; top: 74px; }
  body.light-mode .profile-media-group, body.light-mode .profile-fav-poster-card { background: rgba(124,58,237,0.045); border-color: #d8cfee; }
  body.light-mode .profile-group-stat { background: transparent; border-color: transparent; }
  body.light-mode .profile-media-title, body.light-mode .profile-group-stat-value, body.light-mode .profile-fav-row-title, body.light-mode .profile-fav-name { color: #12082e; }
  body.light-mode .profile-media-sub, body.light-mode .profile-group-stat-label, body.light-mode .profile-row-toggle, body.light-mode .profile-hidden-note { color: #5a4780; }
  body.light-mode .profile-fav-poster { background: linear-gradient(135deg, #ede9fe, #fff); border-color: #d8cfee; color: #7c3aed; }
  body.light-mode .profile-manual-input, body.light-mode .profile-manual-image, body.light-mode .profile-manual-rating { background: #fff; border-color: #d8cfee; color: #12082e; }
  body.light-mode .profile-card-edit-panel { background: rgba(255,255,255,0.94); border-color: #d8cfee; }
  body.light-mode .profile-manual-rating { color: #b7791f; }
  .profile-theme-row.settings-focus-ring {
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(244,210,122,0.26), 0 0 0 4px rgba(244,210,122,0.10);
    transition: box-shadow 0.2s ease;
  }
  body.light-mode .profile-theme-row.settings-focus-ring {
    box-shadow: 0 0 0 1px rgba(217,119,6,0.22), 0 0 0 4px rgba(217,119,6,0.10);
  }
  @media (max-width: 1050px) {
    .profile-shell.container { grid-template-columns: 1fr; grid-template-areas: "topbar" "hero" "favs" "links"; max-width: 900px; }
    .profile-links-card { position: static; }
  }
  @media (max-width: 760px) {
    .profile-showcase-grid { grid-template-columns: 1fr; }
    .profile-media-group.profile-media-group-wide { grid-column: auto; }
    .profile-fav-poster-grid { gap: 7px; }
    .profile-fav-poster-card { padding: 6px; border-radius: 15px; }
    .profile-fav-poster { border-radius: 11px; font-size: 20px; }
    .profile-fav-name { font-size: 10.5px; min-height: 28px; }
    .profile-fav-rating { font-size: 10px; }
    .profile-pin-select, .profile-manual-input, .profile-manual-image, .profile-manual-rating { font-size: 10px !important; padding: 6px; }
    .profile-group-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-media-title { font-size: 16px; }
  }





  /* Mobile-only floating profile export badges */
  .profile-mobile-links-zone { display: none; }
  @media (max-width: 700px) {
    .profile-links-card { display: none; }
    .profile-mobile-links-zone {
      display: block;
      margin-top: 12px;
    }
    .profile-mobile-links-line {
      height: 1px;
      width: 100%;
      margin: 2px 0 13px;
      background: linear-gradient(90deg, transparent, rgba(196,181,253,0.26), transparent);
    }
    .profile-mobile-links-line-bottom {
      margin: 13px 0 2px;
    }
    .profile-mobile-links-grid {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      padding: 0 2px 2px;
    }
    .profile-mobile-link-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .profile-mobile-link-badge {
      position: relative;
      width: 42px;
      height: 42px;
      border: 1px solid rgba(196,181,253,0.18);
      border-radius: 15px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
        rgba(10,8,26,0.62);
      box-shadow: 0 12px 24px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.04);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .profile-mobile-link-badge:hover,
    .profile-mobile-link-badge:focus-visible {
      transform: translateY(-2px);
      border-color: rgba(196,181,253,0.46);
      outline: none;
    }
    .profile-mobile-link-badge img {
      width: 26px;
      height: 26px;
      object-fit: contain;
      display: block;
      border-radius: 7px;
      flex-shrink: 0;
    }
    .profile-mobile-link-badge.empty { opacity: 0.52; }
    .profile-mobile-link-badge.mobile-link-hidden { opacity: 0.34; filter: grayscale(0.75); }
    .profile-mobile-link-toggle {
      position: absolute;
      right: -4px;
      top: -6px;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(21,16,37,0.96);
      border: 1px solid rgba(196,181,253,0.24);
      box-shadow: 0 6px 14px rgba(0,0,0,0.18);
      z-index: 2;
    }
    .profile-mobile-link-toggle input {
      width: 12px;
      height: 12px;
      margin: 0;
      accent-color: #8b5cf6;
      cursor: pointer;
    }
    .profile-mobile-links-hint {
      width: 100%;
      text-align: center;
      color: #a99dc6;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.28px;
      margin-top: 2px;
    }
    body.light-mode .profile-mobile-links-line {
      background: linear-gradient(90deg, transparent, rgba(124,58,237,0.24), transparent);
    }
    body.light-mode .profile-mobile-link-badge {
      background: rgba(255,255,255,0.74);
      border-color: #d8cfee;
      box-shadow: 0 12px 24px rgba(30,20,60,0.10), inset 0 0 0 1px rgba(255,255,255,0.64);
    }
    body.light-mode .profile-mobile-link-toggle {
      background: rgba(255,255,255,0.96);
      border-color: #d8cfee;
    }
  }

  /* Profile link edit modal (bottom sheet) */
  .plm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(5,4,16,0.72);
    align-items: flex-end;
    justify-content: center;
  }
  .plm-overlay.plm-open {
    display: flex;
  }
  .plm-sheet {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(160deg, #1a1430 0%, #0e0b22 100%);
    border: 1px solid rgba(196,181,253,0.18);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    padding: 20px 20px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(100%);
    transition: transform 0.22s cubic-bezier(0.32,0.72,0,1);
  }
  .plm-overlay.plm-open .plm-sheet {
    transform: translateY(0);
  }
  .plm-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .plm-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .plm-title {
    flex: 1;
    font-size: 15px;
    font-weight: 800;
    color: #f7f3ff;
    font-family: 'Sora', sans-serif;
  }
  .plm-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(196,181,253,0.18);
    color: #a9a0c6;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .plm-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(196,181,253,0.22);
    border-radius: 10px;
    padding: 11px 13px;
    color: #e8e3f3;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
  }
  .plm-input:focus { border-color: #8b5cf6; }
  .plm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
  }
  .plm-toggle-label {
    font-size: 13px;
    color: #a9a0c6;
    font-weight: 600;
  }
  .plm-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .plm-toggle-track input { opacity: 0; width: 0; height: 0; position: absolute; }
  .plm-toggle-thumb {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    border: 1px solid rgba(196,181,253,0.22);
    transition: background 0.18s;
  }
  .plm-toggle-thumb::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a9a0c6;
    transition: transform 0.18s, background 0.18s;
  }
  .plm-toggle-track input:checked + .plm-toggle-thumb { background: rgba(139,92,246,0.3); border-color: #8b5cf6; }
  .plm-toggle-track input:checked + .plm-toggle-thumb::after { transform: translateX(16px); background: #8b5cf6; }
  .plm-actions {
    display: flex;
    gap: 10px;
    margin-top: 2px;
  }
  .plm-save-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
  }
  .plm-remove-btn {
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.08);
    color: #f87171;
    font-size: 14px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
  }
  body.light-mode .plm-sheet {
    background: linear-gradient(160deg, #f4f1fb 0%, #ede9fe 100%);
    border-color: #d8cfee;
  }
  body.light-mode .plm-title { color: #12082e; }
  body.light-mode .plm-close { background: rgba(0,0,0,0.04); border-color: #d8cfee; color: #5a4780; }
  body.light-mode .plm-input { background: #fff; border-color: #d8cfee; color: #12082e; }
  body.light-mode .plm-toggle-label { color: #5a4780; }
  body.light-mode .plm-toggle-thumb { background: #e0d9f0; border-color: #c8bfe8; }
  body.light-mode .plm-toggle-thumb::after { background: #7c6fa0; }

  /* Profile favorite picker modal */
  .profile-favorite-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(10px);
  }
  .profile-favorite-picker-overlay.open { display: flex; }
  .profile-favorite-picker-modal {
    width: min(92vw, 520px);
    max-height: min(86vh, 720px);
    overflow-y: auto;
    border-radius: 24px;
    border: 1px solid rgba(196,181,253,0.18);
    background:
      radial-gradient(circle at 12% 0%, rgba(245,158,11,0.14), transparent 30%),
      radial-gradient(circle at 90% 4%, rgba(139,92,246,0.18), transparent 34%),
      linear-gradient(180deg, rgba(21,16,37,0.98), rgba(7,5,17,0.98));
    box-shadow: 0 28px 90px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.035);
    padding: 20px;
  }
  .profile-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
  .profile-picker-title { color: #f7f3ff; font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 950; letter-spacing: -0.3px; }
  .profile-picker-sub { color: #bdb4d8; font-size: 12px; line-height: 1.4; margin-top: 4px; }
  .profile-picker-close {
    width: 36px; height: 36px; border-radius: 999px; border: 1px solid rgba(196,181,253,0.16);
    background: rgba(255,255,255,0.05); color: #f7f3ff; cursor: pointer; font-size: 18px; font-weight: 900;
  }
  .profile-picker-searchbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
  .profile-picker-searchbar input,
  .profile-picker-rating-input,
  .profile-picker-manual-input {
    width: 100%; min-width: 0; border-radius: 16px; border: 1px solid #3d3466; background: #0a081a;
    color: #e8e3f3; outline: none; font-family: 'DM Sans', sans-serif; font-size: 14px; padding: 13px 14px;
  }
  .profile-picker-searchbar input:focus,
  .profile-picker-rating-input:focus,
  .profile-picker-manual-input:focus { border-color: #8b5cf6; }
  .profile-picker-search-btn,
  .profile-picker-confirm-btn,
  .profile-picker-secondary-btn {
    border-radius: 16px; border: 1px solid rgba(167,139,250,0.28); padding: 12px 16px;
    background: linear-gradient(135deg, #7c3aed, #9333ea); color: #fff; font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 950; cursor: pointer;
  }
  .profile-picker-secondary-btn { background: rgba(255,255,255,0.06); color: #c4b5fd; }
  .profile-picker-results { display: flex; flex-direction: column; gap: 8px; }
  .profile-picker-result {
    display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px; width: 100%; text-align: left;
    border: 1px solid rgba(167,139,250,0.14); border-radius: 16px; background: rgba(255,255,255,0.045);
    padding: 8px; cursor: pointer; color: #e8e3f3; font-family: 'DM Sans', sans-serif;
  }
  .profile-picker-result:hover { border-color: rgba(244,210,122,0.48); background: rgba(255,255,255,0.07); }
  .profile-picker-result-img { width: 48px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: #211936; display: flex; align-items: center; justify-content: center; color: #a78bfa; font-size: 20px; }
  .profile-picker-result-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .profile-picker-result-copy strong { display: block; color: #f7f3ff; font-size: 13px; line-height: 1.2; }
  .profile-picker-result-copy span { display: block; color: #8f86aa; font-size: 11px; margin-top: 3px; }
  .profile-picker-selected {
    display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; margin-bottom: 14px;
    padding: 12px; border-radius: 18px; border: 1px solid rgba(244,210,122,0.22); background: rgba(245,158,11,0.07);
  }
  .profile-picker-selected-poster { width: 78px; aspect-ratio: 2 / 3; border-radius: 12px; background: #211936; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #f4d27a; }
  .profile-picker-selected-title { color: #f7f3ff; font-size: 15px; font-weight: 950; line-height: 1.2; }
  .profile-picker-selected-meta { color: #bdb4d8; font-size: 12px; margin-top: 4px; }
  .profile-picker-library-note { color: #f4d27a; font-size: 12px; margin-top: 7px; font-weight: 900; }
  .profile-picker-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
  .profile-picker-message { border: 1px dashed rgba(167,139,250,0.22); border-radius: 16px; padding: 16px; color: #bdb4d8; text-align: center; font-size: 13px; background: rgba(255,255,255,0.025); }
  .profile-picker-manual-stack { display: flex; flex-direction: column; gap: 10px; }
  body.light-mode .profile-favorite-picker-modal { background: #fff; border-color: #d8cfee; }
  body.light-mode .profile-picker-title,
  body.light-mode .profile-picker-selected-title,
  body.light-mode .profile-picker-result-copy strong { color: #12082e; }
  body.light-mode .profile-picker-sub,
  body.light-mode .profile-picker-selected-meta,
  body.light-mode .profile-picker-result-copy span,
  body.light-mode .profile-picker-message { color: #5a4780; }
  body.light-mode .profile-picker-searchbar input,
  body.light-mode .profile-picker-rating-input,
  body.light-mode .profile-picker-manual-input { background: #f8f6ff; border-color: #d8cfee; color: #12082e; }
  body.light-mode .profile-picker-result { background: #f8f6ff; border-color: #e0d9f0; }
  @media (max-width: 600px) {
    .profile-favorite-picker-overlay { align-items: flex-start; padding: 72px 14px 20px; }
    .profile-favorite-picker-modal { width: 100%; border-radius: 22px; padding: 16px; }
    .profile-picker-searchbar { grid-template-columns: 1fr; }
    .profile-picker-search-btn { min-height: 44px; }
  }

  /* Profile database favorite picker */
  .profile-fav-row-source { margin-top: 3px; color: #706781; font-size: 10px; font-weight: 800; letter-spacing: 0.25px; }
  .profile-db-search-wrap { margin-top: 8px; position: relative; }
  .profile-db-search-row { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
  .profile-db-search-input,
  .profile-db-rating {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid #3d3466;
    background: #0a081a;
    color: #e8e3f3;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 10.5px;
  }
  .profile-db-search-input:focus,
  .profile-db-rating:focus { border-color: #8b5cf6; }
  .profile-db-search-btn {
    padding: 0 8px;
    border-radius: 10px;
    border: 1px solid rgba(167,139,250,0.24);
    background: rgba(139,92,246,0.13);
    color: #f7f3ff;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
  }
  .profile-db-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    max-height: 190px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2248 transparent;
  }
  .profile-db-result {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(167,139,250,0.16);
    background: rgba(255,255,255,0.04);
    color: inherit;
    text-align: left;
    cursor: pointer;
  }
  .profile-db-result:hover { border-color: #8b5cf6; background: rgba(139,92,246,0.13); }
  .profile-db-result-img {
    width: 34px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #151025;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8f7fd0;
    font-size: 15px;
  }
  .profile-db-result-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .profile-db-result-copy { min-width: 0; }
  .profile-db-result-copy strong { display: block; color: #f7f3ff; font-size: 11px; line-height: 1.15; overflow-wrap: anywhere; }
  .profile-db-result-copy span { display: block; margin-top: 2px; color: #bdb4d8; font-size: 9.5px; line-height: 1.2; overflow-wrap: anywhere; }
  .profile-db-message { padding: 8px; border: 1px dashed rgba(167,139,250,0.22); border-radius: 12px; color: #8f86aa; font-size: 10px; text-align: center; }
  .profile-db-rating { margin-top: 7px; text-align: center; color: #f4d27a; font-weight: 900; }
  .profile-db-clear {
    width: 100%;
    margin-top: 6px;
    border: none;
    background: transparent;
    color: #a99dc6;
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
  }
  .profile-db-clear:hover { color: #f4d27a; }
  body.light-mode .profile-fav-row-source { color: #7c6fa0; }
  body.light-mode .profile-db-search-input,
  body.light-mode .profile-db-rating { background: #fff; border-color: #d8cfee; color: #12082e; }
  body.light-mode .profile-db-rating { color: #b7791f; }
  body.light-mode .profile-db-search-btn { background: rgba(124,58,237,0.10); border-color: #c8bfe8; color: #12082e; }
  body.light-mode .profile-db-result { background: rgba(124,58,237,0.045); border-color: #d8cfee; }
  body.light-mode .profile-db-result:hover { border-color: #7c3aed; background: rgba(124,58,237,0.10); }
  body.light-mode .profile-db-result-copy strong { color: #12082e; }
  body.light-mode .profile-db-result-copy span,
  body.light-mode .profile-db-message { color: #5a4780; }
  body.light-mode .profile-db-result-img { background: #f4f1fb; color: #7c3aed; }
  @media (max-width: 760px) {
    .profile-db-search-row { grid-template-columns: 1fr; }
    .profile-db-search-btn { min-height: 30px; }
    .profile-db-results { max-height: 150px; }
  }


  /* Read-only profile + friend profile actions */
  .profile-page.viewing-other-profile .profile-settings-btn,
  .profile-page.viewing-other-profile .profile-save-btn,
  .profile-page.viewing-other-profile .profile-avatar-actions,
  .profile-page.viewing-other-profile .profile-theme-row,
  .profile-page.viewing-other-profile .profile-url-inline,
  .profile-page.viewing-other-profile .profile-card-edit-panel,
  .profile-page.viewing-other-profile .profile-db-search-wrap,
  .profile-page.viewing-other-profile .profile-db-rating,
  .profile-page.viewing-other-profile .profile-db-clear,
  .profile-page.viewing-other-profile .profile-manual-field,
  .profile-page.viewing-other-profile .profile-row-toggle {
    display: none !important;
  }
  .profile-page.viewing-other-profile .profile-name-input,
  .profile-page.viewing-other-profile .profile-bio-input {
    pointer-events: none;
    user-select: text;
  }
  .profile-page.viewing-other-profile .profile-name-input { cursor: default; }
  .profile-page.viewing-other-profile .profile-bio-input {
    resize: none;
    min-height: 92px;
    background: transparent;
  }
  .profile-readonly-empty-link { color: #706781; font-size: 12px; font-weight: 800; }
  .viewing-banner-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .profile-view-btn {
    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    color: #fff !important;
    border-color: transparent !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(124,58,237,0.35) !important;
  }
  .profile-view-btn:hover { filter: brightness(1.08) !important; text-decoration: none; }
  .friend-actions-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .friend-profile-btn { border-color: rgba(167,139,250,0.38); color: #c4b5fd; }
  .friend-profile-btn:hover { border-color: #f4d27a; color: #f4d27a; }
  body.light-mode .profile-page.viewing-other-profile .profile-bio-input { background: transparent; }
  body.light-mode .profile-readonly-empty-link { color: #7c6fa0; }
  body.light-mode .profile-view-btn {
    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    color: #fff !important;
    border-color: transparent !important;
  }
  body.light-mode .profile-view-btn:hover { filter: brightness(1.08) !important; }
  body.light-mode .friend-profile-btn { color: #5a4780; border-color: #c8bfe8; }
  body.light-mode .friend-profile-btn:hover { color: #b7791f; border-color: #d97706; }

  body.true-dark-mode {
    /* v482: "True Dark Mode" renamed to "Default Theme". Page background is
       now #0E0E0E (neutral grey) — dark cards float on this grey base. */
    background: #0E0E0E;
    color: #f5f5f5;
  }
  body.true-dark-mode #mylist-view,
  body.true-dark-mode #discover-view,
  body.true-dark-mode #community-view {
    background: #0E0E0E;
  }
  body.true-dark-mode #mylist-view .card,
  body.true-dark-mode #discover-view .discover-card,
  body.true-dark-mode #discover-view .discover-section-card,
  body.true-dark-mode #discover-view .discover-rail,
  body.true-dark-mode #discover-view .discover-friend-card,
  body.true-dark-mode #discover-view .discover-friends-card,
  body.true-dark-mode #discover-view .discover-friends-card-tile,
  body.true-dark-mode #mylist-view .toolbar,
  body.true-dark-mode #mylist-view .mylist-section-card {
    background: #272727 !important;
    border-color: rgba(255, 255, 245, 0.12) !important;
    box-shadow: none !important;
  }
  body.true-dark-mode #mylist-view .ep-list,
  body.true-dark-mode #mylist-view .game-status-options,
  body.true-dark-mode #discover-view .discover-section,
  body.true-dark-mode #discover-view .discover-rail-item {
    background: #2c2c2c !important;
    border-color: rgba(255, 255, 245, 0.10) !important;
  }
  body.true-dark-mode .header,
  body.true-dark-mode .login-screen,
  body.true-dark-mode .profile-page,
  body.true-dark-mode .profile-settings-page,
  body.true-dark-mode .game-media-profile-overlay .discover-media-page {
    background: #0E0E0E;
  }
  body.true-dark-mode .header,
  body.true-dark-mode .main-nav,
  body.true-dark-mode .friends-tabs,
  body.true-dark-mode .toolbar,
  body.true-dark-mode .card,
  body.true-dark-mode .discover-card,
  body.true-dark-mode .modal,
  body.true-dark-mode .comments-page-header,
  body.true-dark-mode .comment-input-area,
  body.true-dark-mode .user-card,
  body.true-dark-mode .login-feature,
  body.true-dark-mode .profile-hero-card,
  body.true-dark-mode .profile-section-card,
  body.true-dark-mode .profile-settings-card,
  body.true-dark-mode .discover-media-library-dock {
    background: #0a0a0a;
    border-color: #202020;
    box-shadow: none;
  }
  /* v435: bottom nav keeps a translucent dark background in true-dark-mode so the
     existing backdrop-filter: blur(20px) actually has something to blur. The
     other surfaces stay flat dark. */
  body.true-dark-mode .mobile-bottom-nav {
    background: rgba(8, 8, 12, 0.62) !important;
    border-color: rgba(255, 255, 245, 0.10) !important;
    backdrop-filter: blur(22px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
  }
  /* Fallback for browsers without backdrop-filter — keep it readable. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.true-dark-mode .mobile-bottom-nav {
      background: rgba(10, 10, 14, 0.94) !important;
    }
  }
  body.true-dark-mode .section-toggle,
  body.true-dark-mode .discover-hub-toggle,
  body.true-dark-mode .comments-scope-tabs {
    background: #0a0a0a;
    border-color: #202020;
  }
  body.true-dark-mode input[type="text"],
  body.true-dark-mode input[type="number"],
  body.true-dark-mode input[type="url"],
  body.true-dark-mode .comment-textarea,
  body.true-dark-mode .find-search,
  body.true-dark-mode .profile-bio-input,
  body.true-dark-mode .profile-link-field input,
  body.true-dark-mode .profile-db-search-input,
  body.true-dark-mode .profile-db-rating {
    background: #050505;
    border-color: #0E0E0E;
    color: #f5f5f5;
  }
  body.true-dark-mode .profile-topbar-title,
  body.true-dark-mode .profile-settings-card-title,
  body.true-dark-mode .profile-section-title,
  body.true-dark-mode .card-title,
  body.true-dark-mode .discover-title,
  body.true-dark-mode .discover-section-title,
  body.true-dark-mode .discover-card-title,
  body.true-dark-mode .comments-page-title,
  body.true-dark-mode .user-card-name,
  body.true-dark-mode .season-title,
  body.true-dark-mode .ep-name {
    color: #fafafa;
  }
  body.true-dark-mode .subtitle,
  body.true-dark-mode .stat-label,
  body.true-dark-mode .card-genre,
  body.true-dark-mode .rating-label,
  body.true-dark-mode .progress-meta,
  body.true-dark-mode .theme-toggle-label,
  body.true-dark-mode .discover-subtitle,
  body.true-dark-mode .discover-card-meta,
  body.true-dark-mode .comments-page-meta,
  body.true-dark-mode .comment-time,
  body.true-dark-mode .profile-topbar-sub,
  body.true-dark-mode .profile-settings-card-sub,
  body.true-dark-mode .profile-section-sub {
    color: #a3a3a3;
  }
  body.true-dark-mode .discover-section-desc,
  body.true-dark-mode .discover-card-context { color: #ffffff; }
  body.true-dark-mode .btn-secondary,
  body.true-dark-mode .comments-btn,
  body.true-dark-mode .back-btn,
  body.true-dark-mode .profile-back-btn,
  body.true-dark-mode .profile-share-btn,
  body.true-dark-mode .profile-settings-btn {
    background: #111;
    border-color: #2a2a2a;
    color: #f5f5f5;
  }
  body.true-dark-mode .profile-card-logout-btn {
    background: rgba(34, 10, 14, 0.9);
    border-color: rgba(239, 68, 68, 0.25);
  }
  body.true-dark-mode .profile-card-lists-btn {
    background: rgba(133, 77, 14, 0.26);
    border-color: rgba(244, 210, 122, 0.36);
    color: #fde7a7;
  }
  @media (max-width: 600px) {
    .viewing-banner-actions { width: 100%; }
    .viewing-banner-actions .back-btn { flex: 1; text-align: center; }
    .friend-actions-group { width: 100%; justify-content: flex-start; margin-top: 8px; }
  }


  /* Mobile-only landing feature layout + text sizing */
  @media (max-width: 600px) {
    .login-features .login-feature:nth-child(-n+3) {
      display: grid;
      grid-template-columns: auto 1fr;
      grid-template-rows: auto auto;
      column-gap: 14px;
      align-items: start;
      text-align: left;
    }
    .login-features .login-feature:nth-child(-n+3) .login-feature-icon {
      grid-column: 1;
      grid-row: 1 / span 2;
      margin: 0;
      align-self: start;
    }
    .login-features .login-feature:nth-child(-n+3) .login-feature-title {
      grid-column: 2;
      grid-row: 1;
      font-size: 18px;
      margin-bottom: 4px;
    }
    .login-features .login-feature:nth-child(-n+3) .login-feature-desc {
      grid-column: 2;
      grid-row: 2;
      font-size: 15px;
    }
  }


  /* Mobile-only friend card action layout — desktop stays unchanged */
  .friend-mobile-list-btn,
  .friend-mobile-profile-btn,
  .friend-mobile-remove-x {
    display: none;
  }
  @media (max-width: 700px) {
    .friend-list-card {
      position: relative;
    }
    .friend-list-card .friend-card-main {
      min-width: 0;
    }
  }
  @media (max-width: 600px) {
    .friend-list-card {
      flex-direction: row !important;
      align-items: center !important;
      justify-content: space-between !important;
      gap: 10px !important;
      padding: 14px 46px 14px 14px !important;
      min-height: 86px;
    }
    .friend-list-card .friend-card-main {
      width: auto;
      flex: 1 1 auto;
      min-width: 0;
      align-items: center !important;
      gap: 12px !important;
      cursor: pointer !important;
    }
    .friend-list-card .friend-card-copy {
      min-width: 0;
      flex: 1;
    }
    .friend-list-card .user-card-avatar {
      width: 44px;
      height: 44px;
    }
    .friend-list-card .user-card-name {
      font-size: 15px;
      line-height: 1.12;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .friend-list-card .user-card-stats {
      display: none;
    }
    .friend-list-card .friend-actions-group {
      width: auto !important;
      max-width: 156px;
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      justify-content: flex-end !important;
      gap: 6px !important;
      margin-top: 0 !important;
      padding-left: 0 !important;
      flex: 0 0 auto;
    }
    .friend-list-card .friend-profile-desktop-btn,
    .friend-list-card .friend-remove-desktop-btn,
    .friend-list-card .friend-pending-btn {
      display: none !important;
    }
    .friend-list-card .friend-mobile-list-btn,
    .friend-list-card .friend-mobile-profile-btn {
      display: inline-flex !important;
      width: auto;
      min-width: 66px;
      min-height: 34px;
      padding: 0 10px;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.01em;
      white-space: nowrap;
    }
    .friend-list-card .friend-mobile-list-btn {
      border-color: rgba(167,139,250,0.38);
      background: rgba(139,92,246,0.13);
      color: #f4f0ff;
    }
    .friend-list-card .friend-mobile-profile-btn {
      border-color: rgba(244,210,122,0.34);
      background: rgba(244,210,122,0.08);
      color: #f4d27a;
    }
    .friend-list-card .friend-mobile-remove-x {
      display: inline-flex !important;
      position: absolute;
      top: 8px;
      right: 8px;
      width: 20px;
      height: 20px;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      border: 1px solid rgba(239,68,68,0.24);
      background: rgba(239,68,68,0.08);
      color: #fca5a5;
      font-size: 13px;
      line-height: 1;
      font-weight: 500;
      cursor: pointer;
    }
    .friend-list-card .friend-mobile-remove-x:active {
      transform: scale(0.96);
    }
    @media (max-width: 390px) {
      .friend-list-card {
        padding-right: 40px !important;
      }
      .friend-list-card .friend-actions-group {
        max-width: 136px;
        gap: 5px !important;
      }
      .friend-list-card .friend-mobile-list-btn,
      .friend-list-card .friend-mobile-profile-btn {
        min-width: 58px;
        padding: 0 8px;
        font-size: 10px;
      }
    }
    body.light-mode .friend-list-card .friend-mobile-list-btn {
      border-color: rgba(124,58,237,0.26);
      background: rgba(124,58,237,0.08);
      color: #4c1d95;
    }
    body.light-mode .friend-list-card .friend-mobile-profile-btn {
      border-color: rgba(217,119,6,0.28);
      background: rgba(217,119,6,0.07);
      color: #92400e;
    }
    body.light-mode .friend-list-card .friend-mobile-remove-x {
      border-color: rgba(220,38,38,0.20);
      background: rgba(220,38,38,0.07);
      color: #b91c1c;
    }
  }
  /* Mobile profile showcase cleanup: remove inner title-card bubbles while preserving desktop */
  @media (max-width: 760px) {
    .profile-fav-poster-card,
    body.light-mode .profile-fav-poster-card {
      border: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      border-radius: 0 !important;
      padding: 0 !important;
    }
    .profile-fav-poster {
      box-shadow: 0 10px 18px rgba(0,0,0,0.22);
    }
  }


  /* Profile top-3 cleanup: remove inner showcase cards, keep only the main section card */
  .profile-fav-poster-card,
  body.light-mode .profile-fav-poster-card {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
  .profile-fav-poster-grid { gap: 14px; }
@media (max-width: 760px) {
    .profile-fav-poster-grid { gap: 6px; }
    .profile-fav-name { font-size: 11px; }
    .profile-fav-rating { font-size: 13px; line-height: 1.1; }
}

/* Surgical fix: keep follow/profile actions aligned right in profile follower/following modals */
.profile-social-user-row .profile-social-user-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding-right: 8px;
}
.profile-social-user-row .profile-social-user-main > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-social-user-row .friend-actions-group {
  flex: 0 0 auto;
  width: auto !important;
  max-width: none;
  margin-left: auto;
  margin-top: 0 !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap;
}
.profile-social-user-row .friend-action-btn,
.profile-social-user-row .profile-social-view-btn {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .profile-social-user-row {
    gap: 8px;
  }
  .profile-social-user-row .profile-social-avatar {
    width: 38px;
    height: 38px;
  }
  .profile-social-user-row .friend-actions-group {
    width: auto !important;
    margin-top: 0 !important;
    justify-content: flex-end !important;
  }
  .profile-social-user-row .friend-action-btn,
  .profile-social-user-row .profile-social-view-btn {
    padding: 6px 9px;
    font-size: 10px;
  }
}


/* Game-only media profile + external links */
.card-title-profile-btn,
.game-title-profile-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.game-title-profile-btn:hover {
  color: #c4b5fd;
  text-shadow: 0 0 12px rgba(196,181,253,0.16);
}

.game-external-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid rgba(0, 224, 84, 0.38);
  background: linear-gradient(135deg, rgba(255, 128, 0, 0.18), rgba(0, 224, 84, 0.16), rgba(64, 188, 244, 0.14));
  color: #dfffea;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  text-decoration: none;
  vertical-align: middle;
  box-shadow: 0 0 14px rgba(0, 224, 84, 0.10);
}

.game-external-icon:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 224, 84, 0.7);
}

.discover-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 34px;
}

.discover-card-title-row .discover-card-title {
  min-height: 0;
  flex: 1;
}

.discover-card-title-row .game-external-icon {
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: -2px;
}

.game-media-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: block;
  background: #05040d;
  color: #f8f4ff;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-media-profile-overlay.open {
  opacity: 1;
  transform: translateY(0);
}

body.game-media-profile-open {
  overflow: hidden;
}

body.game-media-profile-open .mobile-bottom-nav {
  display: none !important;
}

.game-media-profile-overlay .discover-media-page {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  will-change: transform;
  contain: paint;
  background:
    linear-gradient(180deg, rgba(5,4,13,0.18), #05040d 48%),
    #05040d;
}

.game-media-profile-overlay .discover-media-page::-webkit-scrollbar {
  display: none;
}

.game-media-profile-overlay .discover-media-back,
.game-media-profile-overlay .discover-media-add-floating {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  z-index: 4;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  font-family: 'DM Sans', sans-serif;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.game-media-profile-overlay .discover-media-back {
  left: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(8,7,18,0.62);
}

.game-media-profile-overlay .discover-media-add-floating {
  right: 14px;
  border: 1px solid rgba(255, 216, 127, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 216, 127, 0.24), rgba(34, 211, 238, 0.12)),
    rgba(8, 7, 18, 0.66);
  color: #fff3c6;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 216, 127, 0.14);
}

.game-media-profile-overlay .discover-media-add-floating.added {
  border-color: rgba(34, 211, 238, 0.55);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(8, 7, 18, 0.68);
  color: #bff8ff;
}

.game-media-profile-overlay .discover-media-hero {
  position: relative;
  min-height: 58vh;
  padding: max(70px, calc(env(safe-area-inset-top, 0px) + 56px)) 18px 26px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center top;
  isolation: isolate;
}

.game-media-profile-overlay .discover-media-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(145deg, #151025, #05040d);
}

.game-media-profile-overlay .discover-media-hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5,4,13,0.08) 0%, rgba(5,4,13,0.72) 58%, #05040d 100%),
    linear-gradient(90deg, rgba(5,4,13,0.84), rgba(5,4,13,0.26));
  backdrop-filter: blur(1px);
}

.game-media-profile-overlay .discover-media-hero-content {
  width: 100%;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 15px;
  align-items: end;
}

.game-media-profile-overlay .discover-media-poster {
  width: 112px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 18px 44px rgba(0,0,0,0.48);
  overflow: hidden;
}

.game-media-profile-overlay .discover-media-poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.game-media-profile-overlay .discover-media-kicker {
  color: #f4d27a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.game-media-profile-overlay .discover-media-hero h2 {
  margin: 6px 0 8px;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  line-height: 0.98;
  font-weight: 950;
}

.game-media-profile-overlay .discover-media-hero p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-media-profile-overlay .discover-media-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.game-media-profile-overlay .discover-media-chips span {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: #efe9fb;
  font-size: 11px;
  font-weight: 900;
}

.game-media-profile-overlay .discover-media-body {
  padding: 0 16px max(34px, env(safe-area-inset-bottom, 0px));
}

.game-media-profile-overlay .discover-media-loading {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #b8afd1;
  text-align: center;
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  font-weight: 800;
}

.game-media-profile-overlay .discover-media-score-row {
  display: flex;
  gap: 14px;
  margin: 0 0 14px;
}

.game-media-profile-overlay .discover-media-score {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #f6c84c;
}

.game-media-profile-overlay .discover-media-score span {
  color: currentColor;
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
  font-family: 'Sora', sans-serif;
}

.game-media-profile-overlay .discover-media-score .discover-media-score-star {
  font-size: 23px;
  font-weight: 900;
  transform: translateY(-1px);
}

.game-media-profile-overlay .discover-media-score div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.game-media-profile-overlay .discover-media-score small,
.game-media-profile-overlay .discover-media-score em {
  color: #bdb4d8;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.game-media-profile-overlay .discover-media-score em {
  color: #706781;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.4px;
}

.game-media-profile-overlay .discover-media-watch {
  flex: 0 0 min(42vw, 168px);
  width: min(42vw, 168px);
  min-width: 136px;
  padding: 2px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-media-profile-overlay .discover-media-watch-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.game-media-profile-overlay .discover-media-watch-head strong {
  color: #f4d27a;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.game-media-profile-overlay .discover-media-watch-head span {
  color: #8f85aa;
  font-size: 9px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.game-media-profile-overlay .discover-media-watch-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-media-profile-overlay .discover-media-watch-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.game-media-profile-overlay .discover-media-watch-label {
  color: #bdb4d8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.game-media-profile-overlay .discover-media-watch-providers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-media-profile-overlay .discover-media-watch-text {
  color: #f4efff;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
}

.game-media-profile-overlay .discover-media-watch-provider {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.game-media-profile-overlay .discover-media-watch-provider-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.game-media-profile-overlay .discover-media-watch-provider-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

  .game-media-profile-overlay .discover-media-watch-provider-name {
  min-width: 0;
  color: #f4efff;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
  word-break: break-word;
}

.game-media-profile-overlay .discover-media-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.game-media-profile-overlay .discover-media-facts strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 950;
}

.game-media-profile-overlay .discover-media-facts div.primary strong {
  color: #f4d27a;
  font-size: 16px;
}

.game-media-profile-overlay .discover-media-facts span {
  display: block;
  margin-top: 4px;
  color: #bdb4d8;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.game-media-profile-overlay .discover-media-section {
  margin-top: 22px;
}

.game-media-profile-overlay .discover-media-section h3 {
  margin: 0 0 12px;
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 950;
}

.game-media-profile-overlay .discover-media-similar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.game-media-profile-overlay .discover-media-similar::-webkit-scrollbar {
  display: none;
}

.game-media-profile-overlay .discover-media-similar img {
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  object-fit: cover;
}

.game-media-profile-overlay .discover-media-similar-card {
  padding: 0 0 3px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.game-media-profile-overlay .discover-media-similar span {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
}

.game-media-external-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 18px;
}

.game-media-external-link {
  border: none;
  background: transparent;
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 60px;
  padding: 0;
  box-shadow: none;
}

.game-media-external-link span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 950;
  color: #fff;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 16px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}

.game-media-external-link small {
  color: #ece6fb;
  font-size: 9px;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(0,0,0,0.28);
}

.game-media-external-link.backloggd span {
  background: linear-gradient(135deg, #ff8000, #00e054, #40bcf4);
}

.game-media-external-link.metacritic span {
  background: linear-gradient(135deg, #fbbf24, #15803d);
}

.game-media-external-link.hltb span {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
}

.game-media-external-link.steam span {
  background: linear-gradient(135deg, #111827, #2563eb);
}

.game-media-external-link.imdb span {
  background: linear-gradient(135deg, #f5c518, #daa520);
}

.game-media-external-link.letterboxd span {
  background: linear-gradient(135deg, #00d374, #00c562);
}

.game-media-external-link.myanimelist span {
  background: linear-gradient(135deg, #2e51a2, #1c3d7a);
}

@media (min-width: 701px) {
  .game-media-profile-overlay {
    background: rgba(5, 4, 13, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .game-media-profile-overlay .discover-media-page {
    max-width: 760px;
    margin: 0 auto;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 80px rgba(0,0,0,0.44);
  }
}

@media (max-width: 600px) {
  .discover-card-title-row {
    min-height: 28px;
  }
  .discover-media-watch,
  .game-media-profile-overlay .discover-media-watch {
    flex-basis: min(42vw, 152px);
    width: min(42vw, 152px);
    min-width: 124px;
  }
  .discover-media-watch-provider-name,
  .game-media-profile-overlay .discover-media-watch-provider-name {
    font-size: 10px;
  }
  .game-external-icon {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }
  .game-media-external-links {
    gap: 8px;
  }
  .game-media-external-link {
    min-height: 56px;
  }
  .game-media-external-link span {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }
  .game-media-external-link small {
    font-size: 8px;
  }
}

body.light-mode .game-title-profile-btn:hover {
  color: #5a4780;
}

body.light-mode .game-external-icon {
  border-color: rgba(8,145,178,0.3);
  color: #065f46;
}

body.light-mode .game-media-profile-overlay {
  background: rgba(244, 241, 251, 0.92);
}

body.light-mode .game-media-profile-overlay .discover-media-page {
  background: #fff;
}

body.light-mode .game-media-profile-overlay .discover-media-body {
  color: #12082e;
}

/* Live friends activity badge */
.main-nav-btn {
  position: relative;
}
.nav-badge.friend-activity-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  display: inline-block;
  vertical-align: top;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18), 0 0 14px rgba(239, 68, 68, 0.55);
}
.mobile-bottom-nav .nav-badge {
  position: absolute;
  top: 5px;
  right: 8px;
  margin-left: 0;
  z-index: 2;
}
.mobile-bottom-nav .nav-badge.friend-activity-dot {
  top: 7px;
  right: 12px;
}


/* Game external buttons: official site icons/logos only */
.game-external-icon {
  padding: 3px;
  overflow: hidden;
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.16);
  color: transparent;
}
.game-external-icon img {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
}
.game-card-backloggd-icon,
.game-card-metacritic-icon,
.game-discover-backloggd-icon {
  background: rgba(255,255,255,0.07);
}
.game-media-external-link .game-media-external-link-icon {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09) !important;
  border: none;
  overflow: hidden;
}
.game-media-external-link .game-media-external-link-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.game-media-external-link.backloggd .game-media-external-link-icon,
.game-media-external-link.metacritic .game-media-external-link-icon,
.game-media-external-link.hltb .game-media-external-link-icon,
.game-media-external-link.steam .game-media-external-link-icon {
  background: rgba(255,255,255,0.09) !important;
}
@media (max-width: 600px) {
  .game-external-icon img {
    width: 14px;
    height: 14px;
  }
  .game-media-external-link .game-media-external-link-icon {
    width: 34px;
    height: 34px;
    padding: 6px;
  }
}

@media (max-width: 700px) {
  .discover-media-profile-overlay .discover-media-hero,
  .game-media-profile-overlay .discover-media-hero {
    min-height: auto;
    padding: max(72px, calc(env(safe-area-inset-top, 0px) + 62px)) 16px 24px;
    align-items: flex-start;
    justify-content: center;
  }

  .discover-media-profile-overlay .discover-media-hero-content,
  .game-media-profile-overlay .discover-media-hero-content {
    width: min(100%, 390px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: center;
  }

  .discover-media-profile-overlay .discover-media-hero-top,
  .game-media-profile-overlay .discover-media-hero-top {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: start;
    gap: 10px;
  }

  .discover-media-profile-overlay .discover-media-hero-main,
  .game-media-profile-overlay .discover-media-hero-main {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .discover-media-profile-overlay .discover-media-poster,
  .game-media-profile-overlay .discover-media-poster {
    width: min(46vw, 172px);
    min-width: 142px;
    border-radius: 12px;
  }

  .discover-media-profile-overlay .discover-media-kicker,
  .game-media-profile-overlay .discover-media-kicker,
  .discover-media-profile-overlay .discover-media-tagline,
  .game-media-profile-overlay .discover-media-tagline {
    text-align: center;
  }

  .discover-media-profile-overlay .discover-media-hero h2,
  .game-media-profile-overlay .discover-media-hero h2 {
    margin: 4px auto 5px;
    max-width: 100%;
    text-align: center;
    font-size: clamp(24px, 8vw, 34px);
  }

  .discover-media-profile-overlay .discover-media-score-hero,
  .game-media-profile-overlay .discover-media-score-hero {
    justify-content: center;
    align-self: center;
    width: auto;
  }

  .discover-media-profile-overlay .discover-media-hero p,
  .game-media-profile-overlay .discover-media-hero p {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    -webkit-line-clamp: 4;
  }

  .discover-media-profile-overlay .discover-media-chips,
  .game-media-profile-overlay .discover-media-chips,
  .discover-media-profile-overlay .discover-media-watch-inline-rows,
  .game-media-profile-overlay .discover-media-watch-inline-rows,
  .discover-media-profile-overlay .discover-media-watch-inline-head,
  .game-media-profile-overlay .discover-media-watch-inline-head {
    justify-content: center;
  }

  .discover-media-profile-overlay .discover-media-watch-inline,
  .game-media-profile-overlay .discover-media-watch-inline {
    align-items: center;
    text-align: center;
  }
}


/* Database More Like This */
.discover-ai-more-loading {
  min-width: 220px;
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px solid rgba(167,139,250,0.18);
  background: rgba(255,255,255,0.035);
  color: #b8afd1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.discover-ai-similar-card {
  width: 118px;
}

.discover-ai-similar-placeholder {
  width: 118px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.24), rgba(5,4,16,0.92));
  border: 1px solid rgba(167,139,250,0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 34px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(0,0,0,0.28);
  transition: transform 0.18s ease;
}

.discover-ai-similar-card:active .discover-ai-similar-placeholder {
  transform: scale(0.97);
}

.discover-ai-similar-card.resolving {
  opacity: 0.58;
  pointer-events: none;
}

.game-media-profile-overlay .discover-ai-similar-card {
  width: 160px;
}

.game-media-profile-overlay .discover-ai-similar-placeholder {
  width: 160px;
  aspect-ratio: 16 / 9;
  font-size: 30px;
}

body.light-mode .discover-ai-more-loading {
  background: rgba(124,58,237,0.06);
  color: #5b4b85;
  border-color: rgba(124,58,237,0.14);
}

body.light-mode .discover-ai-similar-placeholder {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(250,248,255,0.96));
  color: #5b21b6;
  border-color: rgba(124,58,237,0.16);
}

/* Actor/actress credit cards: prevent long media titles from covering role text */
.discover-person-credit-card {
  gap: 4px;
  min-width: 0;
}
.discover-person-credit-card .discover-person-credit-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 0;
  max-height: 2.45em;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  margin-top: 8px;
}
.discover-person-credit-card .discover-person-credit-role {
  display: block;
  clear: both;
  min-height: 0;
  margin-top: 1px;
  color: #c4b5fd;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 850;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Media profile official app/site logos next to app/site names */
.game-media-external-link-label {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.1;
}
.game-media-external-label-logo {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  object-fit: contain;
  display: inline-block;
  flex: 0 0 12px;
}
.discover-provider-name-with-logo {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
}
.discover-provider-name-text {
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  text-transform: none !important;
  min-width: 0;
  overflow-wrap: anywhere;
}
.discover-provider-trailing-logo {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255,255,255,0.10);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.discover-provider-trailing-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.discover-media-watch-inline-provider-list {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  vertical-align: middle;
}
.discover-media-watch-inline-row .discover-media-watch-inline-provider-list,
.discover-media-watch-inline-row .discover-media-watch-inline-provider,
.discover-media-watch-inline-row .discover-provider-name-text,
.discover-media-watch-inline-row .discover-provider-trailing-logo {
  color: #f4efff !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.game-media-profile-overlay .discover-media-watch-provider .discover-provider-name-with-logo {
  color: #f4efff !important;
}
.game-media-profile-overlay .discover-media-watch-provider .discover-provider-trailing-logo {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

/* More Like This fallback note */
.discover-ai-more-note {
  width: 220px;
  min-height: 118px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(167,139,250,0.18);
  background: rgba(255,255,255,0.035);
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  display: flex;
  align-items: center;
}

body.light-mode .discover-ai-more-note {
  background: rgba(124,58,237,0.06);
  color: #5b21b6;
  border-color: rgba(124,58,237,0.14);
}

/* Actor/actress profile bio + most-known polish */
.discover-person-bio-facts strong {
  overflow-wrap: anywhere;
}

.discover-person-ai-note {
  margin: -4px 0 12px;
  color: #b8afd1;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

body.light-mode .discover-person-ai-note {
  color: #5b4b85;
}

/* Desktop access for universal media + actor profiles without changing existing cards/layout */
@media (min-width: 701px) {
  body.discover-media-profile-open {
    overflow: hidden;
  }
  body.discover-media-profile-open .mobile-bottom-nav {
    display: none !important;
  }
  .discover-media-profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: block;
    background: rgba(5, 4, 13, 0.82);
    color: #f8f4ff;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .discover-media-profile-overlay.open {
    opacity: 1;
    transform: translateY(0);
  }
  .discover-media-profile-overlay .discover-media-page {
    height: 100dvh;
    max-width: 760px;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    will-change: transform;
    contain: paint;
    background:
      linear-gradient(180deg, rgba(5,4,13,0.18), #05040d 48%),
      #05040d;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 80px rgba(0,0,0,0.44);
  }
  .discover-media-profile-overlay .discover-media-page::-webkit-scrollbar {
    display: none;
  }
  .discover-media-profile-overlay .discover-media-back,
  .discover-media-profile-overlay .discover-media-add-floating {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 0px));
    z-index: 4;
    border-radius: 999px;
    padding: 9px 13px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    font-family: 'DM Sans', sans-serif;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .discover-media-profile-overlay .discover-media-back {
    left: max(14px, calc(50% - 366px));
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(8,7,18,0.62);
  }
  .discover-media-profile-overlay .discover-media-add-floating {
    right: max(14px, calc(50% - 366px));
    border: 1px solid rgba(255, 216, 127, 0.5);
    background:
      linear-gradient(135deg, rgba(255, 216, 127, 0.24), rgba(34, 211, 238, 0.12)),
      rgba(8, 7, 18, 0.66);
    color: #fff3c6;
    font-weight: 950;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), 0 0 18px rgba(255, 216, 127, 0.14);
  }
  .discover-media-profile-overlay .discover-media-add-floating.added {
    border-color: rgba(34, 211, 238, 0.55);
    background:
      linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(255, 255, 255, 0.08)),
      rgba(8, 7, 18, 0.68);
    color: #bff8ff;
  }
  .discover-media-profile-overlay .discover-media-hero {
    position: relative;
    min-height: 58vh;
    padding: max(70px, calc(env(safe-area-inset-top, 0px) + 56px)) 18px 26px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center top;
    isolation: isolate;
  }
  .discover-media-profile-overlay .discover-media-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(145deg, #151025, #05040d);
  }
  .discover-media-profile-overlay .discover-media-hero-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(180deg, rgba(5,4,13,0.08) 0%, rgba(5,4,13,0.72) 58%, #05040d 100%),
      linear-gradient(90deg, rgba(5,4,13,0.84), rgba(5,4,13,0.26));
    backdrop-filter: blur(1px);
  }
  .discover-media-profile-overlay .discover-media-hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .discover-media-profile-overlay .discover-media-hero-top {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 15px;
    align-items: end;
  }
  .discover-media-profile-overlay .discover-media-hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: end;
  }
  .discover-media-profile-overlay .discover-media-poster {
    width: 112px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    box-shadow: 0 18px 44px rgba(0,0,0,0.48);
    overflow: hidden;
  }
  .discover-media-profile-overlay .discover-media-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }
  .discover-media-profile-overlay .discover-media-kicker {
    color: #f4d27a;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 1.2px;
    text-transform: uppercase;
  }
  .discover-media-profile-overlay .discover-media-hero h2 {
    margin: 6px 0 8px;
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    line-height: 0.98;
    font-weight: 950;
    letter-spacing: 0;
  }
  .discover-media-profile-overlay .discover-media-tagline {
    margin: 2px 0 8px;
    color: #f4d27a;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    line-height: 1.32;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 10px 24px rgba(0,0,0,0.4);
  }
  .discover-media-profile-overlay .discover-media-hero p {
    margin: 2px 0 0;
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .discover-media-profile-overlay .discover-media-body {
    padding: 0 16px max(34px, env(safe-area-inset-bottom, 0px));
  }
  .discover-title-profile-btn,
  .media-title-profile-btn {
    cursor: pointer;
  }
  .discover-title-profile-btn:hover,
  .media-title-profile-btn:hover {
    color: #c4b5fd;
    text-shadow: 0 0 12px rgba(196,181,253,0.16);
  }
}

body.light-mode .discover-media-profile-overlay {
  background: rgba(244, 241, 251, 0.92);
}

body.light-mode .discover-media-profile-overlay .discover-media-page {
  background: #fff;
}

body.light-mode .discover-media-profile-overlay .discover-media-body {
  color: #12082e;
}

/* Export buttons: keep only the top icon/logo, no duplicate logo beside the bottom label */
.game-media-external-link-label .game-media-external-label-logo {
  display: none !important;
}


/* Profile scroll performance: reduce expensive paints and keep scrolling high-refresh friendly */
/* v34 surgical: activity poster opens full media profile from tapped poster */
.discover-media-profile-overlay.activity-origin-media-profile,
.discover-media-profile-overlay.activity-origin-media-profile.open,
.game-media-profile-overlay.activity-origin-media-profile,
.game-media-profile-overlay.activity-origin-media-profile.open {
  transform: translate3d(0, 0, 0) !important;
  transition: none !important;
  will-change: clip-path, opacity, transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.discover-media-profile-overlay,
.game-media-profile-overlay {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.discover-media-page,
.game-media-profile-overlay .discover-media-page {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: scroll-position;
  contain: layout paint style;
}

.discover-media-profile-overlay .discover-media-hero-shade,
.game-media-profile-overlay .discover-media-hero-shade,
.discover-media-profile-overlay .discover-media-back,
.discover-media-profile-overlay .discover-media-add-floating,
.game-media-profile-overlay .discover-media-back,
.game-media-profile-overlay .discover-media-add-floating {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

@media (min-width: 701px) {
  .discover-media-profile-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(5, 4, 13, 0.92);
  }
}

.discover-media-section,
.discover-media-facts,
.discover-media-credits,
.discover-media-trailer,
.game-media-external-links {
  content-visibility: auto;
  contain-intrinsic-size: 1px 420px;
}

.discover-media-cast,
.discover-media-similar {
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.discover-media-cast img,
.discover-media-similar img,
.discover-media-poster img {
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Desktop profile-title click targets: no layout change, only interaction clarity */
.profile-db-openable .profile-fav-poster,
.profile-db-openable .profile-fav-name,
.card-cover-profile-btn,
.card-title-profile-btn,
.media-title-profile-btn,
.game-title-profile-btn {
  cursor: pointer;
}

.profile-db-openable .profile-fav-name:hover,
.card-cover-profile-btn:hover,
.card-title-profile-btn:hover,
.media-title-profile-btn:hover,
.game-title-profile-btn:hover {
  color: #c4b5fd;
  text-shadow: 0 0 12px rgba(196,181,253,0.16);
}
.card-cover-profile-btn:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 3px;
}

/* Mobile HD / high-refresh polish */
html,
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
canvas {
  image-rendering: auto;
}

@media (max-width: 700px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .discover-media-profile-overlay,
  .game-media-profile-overlay {
    background: #05040d;
  }

  .discover-media-profile-overlay .discover-media-page,
  .game-media-profile-overlay .discover-media-page {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .discover-media-profile-overlay .discover-media-hero,
  .game-media-profile-overlay .discover-media-hero {
    background-size: cover;
    background-position: center top;
  }

  .discover-media-profile-overlay .discover-media-poster img,
  .game-media-profile-overlay .discover-media-poster img,
  .discover-media-cast img,
  .discover-media-similar img,
  .discover-media-trailer video,
  .discover-media-trailer iframe {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  .discover-media-profile-overlay .discover-media-hero h2,
  .game-media-profile-overlay .discover-media-hero h2,
  .discover-media-section h3 {
    text-wrap: balance;
  }
}

/* My Lists section tabs: moved into content area above status tabs */
#mylist-view #mylist-header.mylist-section-card {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 4px;
  border: 1px solid var(--line-soft, rgba(139,92,246,0.22));
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.035);
}
#mylist-view #mylist-header .section-toggle {
  width: auto;
  margin: 0;
  padding: 0;
  gap: 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#mylist-view #mylist-header .section-btn {
  justify-content: center;
}
body.light-mode #mylist-view #mylist-header.mylist-section-card {
  background: rgba(124,58,237,0.06);
  border-color: rgba(124,58,237,0.16);
  box-shadow: 0 10px 24px rgba(61,36,120,0.08), inset 0 1px 0 rgba(255,255,255,0.72);
}
body.true-dark-mode #mylist-view #mylist-header.mylist-section-card {
  background: rgba(255,255,255,0.026);
  border-color: rgba(255,255,255,0.09);
}
@media (max-width: 600px) {
  #mylist-view #mylist-header.mylist-section-card {
    width: 100%;
    margin: 0 0 8px;
    padding: 4px;
  }
  #mylist-view #mylist-header .section-toggle {
    width: 100%;
    margin: 0;
  }
  #mylist-view #mylist-header .section-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 7px;
    font-size: 12px;
    letter-spacing: 0;
  }
  #mylist-view #mylist-edit-controls {
    margin-top: 0;
    margin-bottom: 8px;
  }
}

/* Floating profile export icons - restored top hero export links only */
.media-profile-floating-exports {
  width: 100%;
  max-width: 390px;
  margin: 14px auto 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 2px;
  position: relative;
  z-index: 3;
}

.game-media-profile-overlay .media-profile-floating-exports {
  grid-column: 1 / -1;
}

.media-profile-floating-export {
  width: 68px;
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  color: #f8f4ff;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.media-profile-floating-export-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
  overflow: hidden;
  transform: translateZ(0);
}

.media-profile-floating-export-icon img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  image-rendering: auto;
}

.media-profile-floating-export small {
  display: block;
  width: 100%;
  color: #f4efff;
  font-size: 10px;
  line-height: 1.08;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.1px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
  overflow-wrap: anywhere;
}

.media-profile-floating-export.imdb .media-profile-floating-export-icon {
  background: rgba(245,197,24,0.20);
  border-color: rgba(245,197,24,0.38);
}

.media-profile-floating-export.letterboxd .media-profile-floating-export-icon {
  background: rgba(0,211,116,0.16);
  border-color: rgba(0,211,116,0.32);
}

.media-profile-floating-export.steam .media-profile-floating-export-icon {
  background: rgba(31,111,173,0.18);
  border-color: rgba(102,192,244,0.32);
}

.media-profile-floating-export.backloggd .media-profile-floating-export-icon {
  background: rgba(255,128,0,0.16);
  border-color: rgba(64,188,244,0.30);
}

.media-profile-floating-export.metacritic .media-profile-floating-export-icon {
  background: rgba(251,191,36,0.16);
  border-color: rgba(251,191,36,0.32);
}

.media-profile-floating-export.hltb .media-profile-floating-export-icon {
  background: rgba(56,189,248,0.15);
  border-color: rgba(56,189,248,0.30);
}

@media (max-width: 600px) {
  .media-profile-floating-exports {
    max-width: 350px;
    gap: 13px;
    margin-top: 13px;
  }

  .media-profile-floating-export {
    width: 60px;
    gap: 6px;
  }

  .media-profile-floating-export-icon {
    width: 47px;
    height: 47px;
  }

  .media-profile-floating-export-icon img {
    width: 31px;
    height: 31px;
  }

  .media-profile-floating-export small {
    font-size: 9px;
  }
}

/* v17: Discover card consistency + mobile nav/activity polish */
.discover-card {
  border-radius: 9px;
}
.discover-card:not(.discover-card-expanded) {
  overflow: hidden;
}
.discover-poster {
  border-radius: 8px 8px 0 0;
}
.discover-card-body {
  min-height: 132px;
}
.discover-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 600px) {
  .discover-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .discover-card {
    border-radius: 8px;
  }
  .discover-poster,
  .discover-card.games-discover-card .discover-poster {
    aspect-ratio: 5 / 7 !important;
    border-radius: 7px 7px 0 0;
  }
  .discover-card-body,
  .discover-card.games-discover-card .discover-card-body {
    height: auto;
    min-height: 112px;
    padding: 8px 8px 9px;
    gap: 6px;
  }
  .discover-card-heading-row {
    gap: 5px;
  }
  .discover-card-title,
  .discover-card-title-row .discover-card-title {
    min-height: 0;
    font-size: 10.8px;
    line-height: 1.22;
  }
  .discover-card-title-row {
    min-height: 0;
  }
  .discover-card-meta {
    min-height: 17px;
    margin-top: 5px;
    margin-bottom: 6px;
    font-size: 9.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .discover-rating-meta {
    font-size: 11px;
  }
  .discover-rating-star {
    font-size: 13px;
  }
  .discover-card-genre {
    min-height: 13px;
    font-size: 9.4px;
    line-height: 1.18;
  }
  .discover-card-rating {
    min-width: 38px;
    max-width: 44px;
    min-height: 22px;
    padding: 3px 4px;
    border-radius: 7px;
  }
  .discover-card-rating-label {
    font-size: 7px;
  }
  .discover-card-rating-value {
    font-size: 10px;
  }
  .discover-add-btn {
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
    border-radius: 999px;
  }
  .mobile-bottom-nav .main-nav-btn {
    font-size: 15px;
    min-height: 48px;
  }
}

.activity-content-col {
  position: relative;
  padding-right: 0;
}
.activity-card-name {
  font-size: 18px;
  line-height: 1.15;
}
.activity-card-avatar,
.activity-card-avatar-placeholder {
  position: static;
  right: auto;
  top: auto;
  width: 54px;
  height: 54px;
  transform: none;
  margin-left: 0;
}
.activity-card-avatar-placeholder {
  font-size: 15px;
}
.activity-who-row {
  padding-right: 0;
}
@media (max-width: 600px) {
  .activity-content-col {
    padding-right: 0;
  }
  .activity-card-name {
    font-size: 18px;
  }
  .activity-card-avatar,
  .activity-card-avatar-placeholder {
    width: 52px;
    height: 52px;
  }
}

.activity-name {
  font-size: 15px;
}
.activity-avatar,
.activity-avatar-placeholder {
  width: 44px;
  height: 44px;
}

/* Surgical update: mobile double-tap zoom guard + profile cleanup */
html,
body,
button,
a,
input,
textarea,
select,
[onclick] {
  touch-action: manipulation;
}

.screenlist-gold-star-icon {
  display: inline-block;
  flex: 0 0 auto;
  color: #f59e0b;
  font-family: inherit;
  font-weight: 900;
  line-height: 1;
  vertical-align: -0.06em;
}
.profile-stat-value,
.profile-group-stat-value,
.profile-stat-label-main,
.profile-group-stat-label,
.profile-fav-rating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.profile-stat-label,
.profile-group-stat-label {
  align-items: center;
}
.profile-stat-value-star,
.profile-stat-label-star,
.profile-fav-rating-star {
  color: #f59e0b;
  filter: drop-shadow(0 4px 8px rgba(245,158,11,0.22));
}
.profile-stat-value-star { font-size: 0.78em; }
.profile-stat-label-star,
.profile-fav-rating-star { font-size: 0.95em; }
.profile-fav-rank {
  color: #f4d27a;
  font-family: 'Sora', sans-serif;
  font-size: 16px !important;
  font-weight: 950;
  letter-spacing: -0.2px;
  margin: 0 0 7px !important;
}
.profile-empty-rank {
  color: #f4d27a;
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 7vw, 42px);
  font-weight: 950;
  line-height: 1;
}
.profile-fav-rating-hidden { display: none !important; }
.profile-no-rating-favorite .profile-fav-name { min-height: 30px; }
.profile-fav-poster,
.profile-pin-cover,
.profile-picker-selected-poster,
.profile-picker-result-img,
.profile-db-result-img {
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
.profile-picker-result-img img,
.profile-db-result-img img {
  object-fit: cover !important;
  background: #151025;
}

/* Full-page media profile: stack Where to Watch / Buy rows max 3 per column, then add columns right */
.discover-media-watch-inline-rows,
.discover-media-watch-stack,
.game-media-profile-overlay .discover-media-watch-stack {
  display: grid !important;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, max-content);
  align-items: start;
  gap: 8px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.discover-media-watch-inline-rows::-webkit-scrollbar,
.discover-media-watch-stack::-webkit-scrollbar,
.game-media-profile-overlay .discover-media-watch-stack::-webkit-scrollbar {
  display: none;
}
.discover-media-watch-inline-row,
.discover-media-watch-row,
.game-media-profile-overlay .discover-media-watch-row {
  break-inside: avoid;
}
@media (max-width: 700px) {
  .discover-media-watch-inline-rows,
  .discover-media-watch-stack,
  .game-media-profile-overlay .discover-media-watch-stack {
    max-width: 100%;
    grid-auto-columns: minmax(118px, max-content);
    gap: 7px 18px;
  }
}


/* v23 surgical: mobile My Lists category tabs stay below Edit My List and wrap into two clean rows */
@media (max-width: 600px) {
  #mylist-view #mylist-edit-controls {
    margin-top: 0;
    margin-bottom: 10px;
  }
  #mylist-view #mylist-header.mylist-section-card {
    width: 100%;
    margin: 0 0 10px;
    padding: 5px;
    border-radius: 18px;
  }
  #mylist-view #mylist-header .section-toggle {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin: 0;
    gap: 5px;
  }
  #mylist-view #mylist-header .section-btn {
    width: 100%;
    min-width: 0;
    flex: none;
    padding: 8px 5px;
    font-size: 11.5px;
    line-height: 1.1;
    letter-spacing: 0;
    justify-content: center;
  }
  #mylist-view .card-action-row {
    padding-left: 104px;
  }
}

.season-header-left .season-progress {
  margin-left: 4px;
}
.season-header-left .season-name {
  color: #b8afd1;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

/* v29 surgical: user-filtered activity page only */
.activity-page.user-filter-active .activity-group-label-today,
.activity-page.user-filter-active .activity-group-label-this-week,
.activity-page.user-filter-active .activity-group-label-this-month {
  color: #a78bfa;
  text-shadow: 0 0 18px rgba(167,139,250,0.22);
}
body.light-mode .activity-page.user-filter-active .activity-group-label-today,
body.light-mode .activity-page.user-filter-active .activity-group-label-this-week,
body.light-mode .activity-page.user-filter-active .activity-group-label-this-month {
  color: #7c3aed;
  text-shadow: none;
}
.activity-page.user-filter-active .activity-who-row-user-filter {
  justify-content: flex-start;
}
.activity-page.user-filter-active .activity-who-row-user-filter .activity-card-time {
  margin-right: auto;
}

/* v31 surgical: My Lists show-card footer buttons same size */
#mylist-view .show-card .card-footer-actions {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

#mylist-view .show-card .comments-btn,
#mylist-view .show-card .card-action-row .ep-toggle-bar {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  justify-content: center;
  box-sizing: border-box;
}

/* v33 surgical: My Lists add-title modal matches media-profile add modal and stays centered on mobile */
#modal.modal-overlay {
  z-index: 3300;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#modal .modal.add-title-modal {
  width: min(92vw, 520px);
  max-width: 520px;
  max-height: calc(100vh - 48px);
  padding: 22px 24px 24px;
  border-radius: 20px;
  overflow-y: auto;
}
#modal .modal.add-title-modal > h3 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.15;
}
#modal .modal.add-title-modal #api-key-section,
#modal .modal.add-title-modal #tmdb-search-area,
#modal .modal.add-title-modal #tmdb-selected-area,
#modal .modal.add-title-modal .modal-status-picker {
  margin-left: 0;
  margin-right: 0;
}
#modal .modal.add-title-modal #api-key-section {
  display: none;
}
#modal .modal.add-title-modal .cover-search-row {
  margin-top: 14px !important;
}
#modal .modal.add-title-modal .cover-search-row input {
  width: 100%;
}
#modal .modal.add-title-modal .modal-actions {
  justify-content: center;
  margin: 20px -24px -24px;
  padding: 16px 24px 22px;
}
@media (max-width: 600px) {
  #modal.modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
  }
  #modal .modal.add-title-modal {
    width: min(92vw, 420px);
    max-height: calc(100vh - 36px);
  }
}


/* v35 surgical: filtered activity page quick actions + restored add-title search trigger */
.activity-page-quick-actions {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  transform: translateX(-50%);
  z-index: 4600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(8, 6, 20, 0.84);
  border: 1px solid rgba(167,139,250,0.30);
  box-shadow: 0 14px 34px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.activity-page-quick-actions button {
  border: 1px solid rgba(167,139,250,0.28);
  border-radius: 999px;
  background: rgba(124,58,237,0.18);
  color: #f7f3ff;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.activity-page-quick-actions button:hover {
  background: rgba(139,92,246,0.28);
  border-color: rgba(196,181,253,0.50);
}
@media (max-width: 600px) {
  .activity-page-quick-actions {
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 14px));
    gap: 8px;
    padding: 7px;
  }
  .activity-page-quick-actions button {
    padding: 9px 12px;
    font-size: 11px;
  }
  #modal .modal.add-title-modal .cover-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  #modal .modal.add-title-modal .cover-search-row input {
    min-width: 0;
  }
}

/* v293: Profile cleanup — flatter full profile, roomier stats, no extra showcase descriptions. */
.profile-name-input,
body.light-mode .profile-name-input,
body.true-dark-mode .profile-name-input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.profile-social-count,
.profile-social-count:first-child,
.profile-social-count:last-child,
body.light-mode .profile-social-count,
body.true-dark-mode .profile-social-count {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 9px 4px !important;
  overflow: visible !important;
}
.profile-social-count::before,
.profile-social-count::after { display: none !important; content: none !important; }
.profile-social-count:hover {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

.profile-link-row,
body.light-mode .profile-link-row,
body.true-dark-mode .profile-link-row {
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 0 !important;
}
body.light-mode .profile-link-row { border-bottom-color: rgba(18,8,46,0.12) !important; }
.profile-link-icon,
.profile-external-link,
.profile-mobile-link-badge,
.profile-mobile-link-toggle,
body.light-mode .profile-link-icon,
body.light-mode .profile-external-link,
body.light-mode .profile-mobile-link-badge,
body.light-mode .profile-mobile-link-toggle,
body.true-dark-mode .profile-link-icon,
body.true-dark-mode .profile-external-link,
body.true-dark-mode .profile-mobile-link-badge,
body.true-dark-mode .profile-mobile-link-toggle {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.profile-mobile-link-badge:hover,
.profile-mobile-link-badge:focus-visible {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.profile-section-card.profile-favorites-card,
body.light-mode .profile-section-card.profile-favorites-card,
body.true-dark-mode .profile-section-card.profile-favorites-card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.profile-section-card.profile-favorites-card .profile-section-head { padding: 0 2px; }
.profile-media-sub { display: none !important; }
.profile-media-head { margin-bottom: 14px !important; }

.profile-stats-grid {
  gap: 14px !important;
  margin-top: 24px !important;
}
.profile-stat-card {
  min-height: 134px !important;
  padding: 18px 15px 15px !important;
  justify-content: center !important;
}
.profile-stat-value { font-size: 28px !important; line-height: 1.05 !important; }
.profile-stat-label { margin-top: 12px !important; line-height: 1.36 !important; }
.profile-stat-label-sub { margin-top: 5px !important; line-height: 1.35 !important; }
.profile-group-stats {
  gap: 12px !important;
  margin-bottom: 14px !important;
}
.profile-group-stat {
  padding: 12px 0 !important;
}
.profile-group-stat-label {
  line-height: 1.35 !important;
  margin-top: 7px !important;
}

@media (max-width: 700px) {
  .profile-mobile-links-zone { margin-top: 14px !important; }
  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 22px !important;
  }
  .profile-stat-card {
    min-height: 122px !important;
    padding: 16px 13px 14px !important;
  }
  .profile-stat-value { font-size: 25px !important; }
  .profile-stat-label { font-size: 9.5px !important; line-height: 1.34 !important; }
  .profile-stat-label-sub { font-size: 9px !important; }
  .profile-media-group { padding: 16px 14px !important; }
}


/* v384: profile edit polish */

@media (max-width: 700px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 22px !important;
    font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  }
  .profile-stat-card {
    min-height: 132px !important;
    padding: 17px 14px 15px !important;
    border-radius: 18px !important;
    font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    justify-content: center !important;
  }
  .profile-stat-value {
    font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 29px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    letter-spacing: -0.7px !important;
  }
  .profile-stat-label {
    font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    margin-top: 12px !important;
    font-size: 10px !important;
    line-height: 1.28 !important;
    letter-spacing: 0.45px !important;
  }
  .profile-stat-label-main {
    font-size: 10.5px !important;
    font-weight: 950 !important;
  }
  .profile-stat-label-sub {
    margin-top: 5px !important;
    font-size: 9px !important;
    font-weight: 850 !important;
  }
}

@media (display-mode: standalone) and (max-width: 700px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* v384: profile edit polish */
.profile-topbar-icon {
  width: 18px;
  height: 18px;
  display: block;
}
.profile-share-btn .profile-topbar-icon { width: 17px; height: 17px; }
.profile-save-btn { min-width: 112px; }
.profile-avatar-panel {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}
.profile-avatar-edit-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(196,181,253,0.32);
  background: rgba(8,6,20,0.94);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,0.34), inset 0 0 0 1px rgba(255,255,255,0.06);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.profile-avatar-edit-btn svg {
  width: 17px;
  height: 17px;
  display: block;
}
.profile-avatar-edit-btn:hover,
.profile-avatar-edit-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(244,210,122,0.58);
  background: rgba(18,12,38,0.98);
  outline: none;
}
.profile-page.viewing-other-profile .profile-avatar-edit-btn { display: none; }
.profile-avatar-actions { display: none !important; }
.profile-eyebrow { display: none !important; }
.profile-bio-input,
body.light-mode .profile-bio-input,
body.true-dark-mode .profile-bio-input {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
.profile-bio-input:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.profile-mobile-link-toggle,
.plm-toggle-row { display: none !important; }
body.light-mode .profile-avatar-edit-btn {
  background: rgba(255,255,255,0.96);
  color: #12082e;
  border-color: rgba(124,58,237,0.22);
  box-shadow: 0 12px 28px rgba(30,20,60,0.13), inset 0 0 0 1px rgba(255,255,255,0.66);
}
@media (max-width: 1050px) {
  .profile-hero-inner {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center;
    gap: 14px !important;
  }
  .profile-main-fields {
    width: 100%;
    align-items: center;
  }
  .profile-name-input,
  .profile-bio-input { text-align: center; }
  .profile-mobile-links-zone { width: 100%; }
}
@media (max-width: 700px) {
  .profile-avatar-panel { margin-inline: auto !important; }
  .profile-page-avatar {
    width: 138px !important;
    height: 138px !important;
  }
  .profile-avatar-edit-btn {
    top: -5px;
    right: -5px;
  }
  .profile-main-fields { gap: 8px; }
  .profile-bio-input { padding-inline: 0 !important; }
}


/* v385: mobile/PWA profile edit mode, header row, and strict 2-card stats grid */
.profile-page:not(.profile-edit-mode):not(.viewing-other-profile) .profile-section-toggle-input,
.profile-page:not(.profile-edit-mode):not(.viewing-other-profile) .profile-stat-toggle,
.profile-page:not(.profile-edit-mode):not(.viewing-other-profile) .profile-row-toggle {
  display: none !important;
}
.profile-page:not(.profile-edit-mode):not(.viewing-other-profile) .profile-avatar-edit-btn {
  display: none !important;
}
.profile-page.profile-edit-mode .profile-avatar-edit-btn {
  display: inline-flex !important;
}
.profile-page.profile-edit-mode .profile-mobile-link-toggle,
.profile-page.profile-edit-mode .plm-toggle-row {
  display: flex !important;
}
.plm-toggle-row {
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  color: #f8f4ff;
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.plm-toggle-row input { width: 15px; height: 15px; accent-color: #8b5cf6; }

@media (max-width: 900px) {
  .profile-page:not(.viewing-other-profile) .profile-hero-inner,
  .profile-page.viewing-other-profile .profile-hero-inner {
    display: grid !important;
    grid-template-columns: 138px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: stretch !important;
    gap: 13px !important;
    text-align: left !important;
  }
  .profile-page .profile-avatar-panel {
    grid-column: 1 !important;
    width: 138px !important;
    margin: 0 !important;
    justify-self: start !important;
  }
  .profile-page .profile-page-avatar {
    width: 138px !important;
    height: 138px !important;
  }
  .profile-page .profile-avatar-edit-btn {
    width: 28px !important;
    height: 28px !important;
    top: -3px !important;
    right: -3px !important;
  }
  .profile-page .profile-avatar-edit-btn svg {
    width: 13px !important;
    height: 13px !important;
  }
  .profile-page .profile-main-fields {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 5px !important;
    text-align: left !important;
  }
  .profile-page .profile-name-input {
    grid-column: 1 !important;
    grid-row: 1 !important;
    text-align: left !important;
    padding: 0 !important;
  }
  .profile-page .profile-bio-input {
    grid-column: 1 !important;
    grid-row: 2 !important;
    text-align: left !important;
    padding: 0 !important;
    min-height: 40px !important;
  }
  .profile-page .profile-social-counts {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    justify-self: end !important;
    margin: 0 !important;
    gap: 0 !important;
  }
  .profile-page .profile-social-counts .profile-social-count:first-child {
    display: none !important;
  }
  .profile-page .profile-social-counts .profile-social-count:last-child {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 64px !important;
    max-width: 76px !important;
    min-height: 56px !important;
    padding: 8px 9px !important;
    border-radius: 14px !important;
  }
  .profile-page .profile-social-count strong { font-size: 18px !important; }
  .profile-page .profile-social-count span { font-size: 9px !important; margin-top: 4px !important; }
  .profile-page .profile-mobile-links-zone {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    margin-top: 6px !important;
  }
  .profile-page .profile-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-top: 20px !important;
    width: 100% !important;
    font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  }
  .profile-page .profile-stat-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 124px !important;
    grid-column: auto !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page .profile-hero-inner {
    display: grid !important;
    grid-template-columns: 138px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: stretch !important;
    gap: 13px !important;
    text-align: left !important;
  }
  .profile-page .profile-avatar-panel { grid-column: 1 !important; width: 138px !important; margin: 0 !important; justify-self: start !important; }
  .profile-page .profile-page-avatar { width: 138px !important; height: 138px !important; }
  .profile-page .profile-main-fields {
    grid-column: 2 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 10px !important;
    row-gap: 5px !important;
    text-align: left !important;
  }
  .profile-page .profile-name-input { grid-column: 1 !important; grid-row: 1 !important; text-align: left !important; padding: 0 !important; }
  .profile-page .profile-bio-input { grid-column: 1 !important; grid-row: 2 !important; text-align: left !important; padding: 0 !important; min-height: 40px !important; }
  .profile-page .profile-social-counts { grid-column: 2 !important; grid-row: 1 / span 2 !important; margin: 0 !important; justify-self: end !important; align-self: center !important; }
  .profile-page .profile-social-counts .profile-social-count:first-child { display: none !important; }
  .profile-page .profile-social-counts .profile-social-count:last-child { display: flex !important; flex-direction: column !important; justify-content: center !important; min-width: 64px !important; max-width: 76px !important; min-height: 56px !important; padding: 8px 9px !important; border-radius: 14px !important; }
  .profile-page .profile-mobile-links-zone { grid-column: 1 / -1 !important; grid-row: 3 !important; width: 100% !important; margin-top: 6px !important; }
  .profile-page .profile-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .profile-page .profile-stat-card { grid-column: auto !important; width: 100% !important; min-width: 0 !important; }
}


/* v386: mobile/PWA profile header correction — exports stay in their own row, following restored */
@media (max-width: 900px) {
  .profile-page:not(.viewing-other-profile) .profile-hero-inner,
  .profile-page.viewing-other-profile .profile-hero-inner {
    display: grid !important;
    grid-template-columns: 138px minmax(0, 1fr) !important;
    align-items: start !important;
    justify-items: stretch !important;
    gap: 13px !important;
    text-align: left !important;
  }

  .profile-page .profile-avatar-panel {
    grid-column: 1 !important;
    width: 138px !important;
    margin: 0 !important;
    justify-self: start !important;
  }

  .profile-page .profile-main-fields {
    grid-column: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-items: start !important;
    column-gap: 10px !important;
    row-gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    text-align: left !important;
  }

  .profile-page .profile-name-input {
    grid-column: 1 !important;
    grid-row: 1 !important;
    text-align: left !important;
    padding: 0 !important;
    min-width: 0 !important;
  }

  .profile-page .profile-bio-input {
    grid-column: 1 !important;
    grid-row: 2 !important;
    text-align: left !important;
    padding: 0 !important;
    min-height: 38px !important;
    max-height: 84px !important;
  }

  .profile-page .profile-social-counts {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: start !important;
    justify-self: end !important;
    gap: 6px !important;
    margin: 0 !important;
    min-width: 62px !important;
  }

  .profile-page .profile-social-counts .profile-social-count,
  .profile-page .profile-social-counts .profile-social-count:first-child,
  .profile-page .profile-social-counts .profile-social-count:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    min-height: 38px !important;
    padding: 4px 4px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .profile-page .profile-social-count strong {
    font-size: 16px !important;
    line-height: 1 !important;
  }

  .profile-page .profile-social-count span {
    font-size: 8.5px !important;
    line-height: 1.05 !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
  }

  .profile-page .profile-mobile-links-zone {
    display: block !important;
    width: 100% !important;
    margin: 16px 0 0 !important;
  }

  .profile-page .profile-mobile-links-line {
    width: calc(100% - 24px) !important;
    margin: 0 auto 12px !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent) !important;
  }

  .profile-page .profile-mobile-links-line-bottom {
    margin: 12px auto 0 !important;
  }

  .profile-page .profile-mobile-links-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .profile-page .profile-stats-grid,
  .profile-page .profile-hero-card > .profile-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .profile-page .profile-stat-card,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page .profile-social-counts .profile-social-count:first-child,
  .profile-page .profile-social-counts .profile-social-count:last-child {
    display: flex !important;
  }

  .profile-page .profile-mobile-links-zone {
    display: block !important;
    width: 100% !important;
    margin: 16px 0 0 !important;
  }

  .profile-page .profile-stats-grid,
  .profile-page .profile-hero-card > .profile-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
  }
}


/* v387: mobile/PWA profile follow counts + stat-card alignment cleanup */
.profile-page .profile-creator-badge {
  gap: 9px !important;
}

@media (max-width: 900px) {
  .profile-page:not(.viewing-other-profile) .profile-main-fields,
  .profile-page.viewing-other-profile .profile-main-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    row-gap: 7px !important;
  }

  .profile-page .profile-name-input {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .profile-page .profile-bio-input {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .profile-page .profile-social-counts {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 3px 0 0 !important;
  }

  .profile-page .profile-social-counts .profile-social-count,
  .profile-page .profile-social-counts .profile-social-count:first-child,
  .profile-page .profile-social-counts .profile-social-count:last-child {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .profile-page .profile-social-count strong {
    font-size: 16px !important;
    line-height: 1 !important;
  }

  .profile-page .profile-social-count span {
    font-size: 10px !important;
    line-height: 1 !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
  }

  .profile-page .profile-stat-card,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card {
    display: grid !important;
    grid-template-rows: minmax(30px, auto) 1fr !important;
    align-items: stretch !important;
    justify-items: center !important;
    text-align: center !important;
    min-height: 124px !important;
    padding: 14px 10px 12px !important;
  }

  .profile-page .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-label {
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: center !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .profile-page .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-value {
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1 !important;
  }

  .profile-page .profile-stat-label-main,
  .profile-page .profile-stat-label-sub {
    display: block !important;
    text-align: center !important;
  }

  .profile-page .profile-stat-value-star,
  .profile-page .profile-stat-label-star {
    display: none !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page:not(.viewing-other-profile) .profile-main-fields,
  .profile-page.viewing-other-profile .profile-main-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    row-gap: 7px !important;
  }

  .profile-page .profile-social-counts {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 3px 0 0 !important;
  }

  .profile-page .profile-social-counts .profile-social-count,
  .profile-page .profile-social-counts .profile-social-count:first-child,
  .profile-page .profile-social-counts .profile-social-count:last-child {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .profile-page .profile-stat-card,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card {
    display: grid !important;
    grid-template-rows: minmax(30px, auto) 1fr !important;
    align-items: stretch !important;
    justify-items: center !important;
    text-align: center !important;
    min-height: 124px !important;
    padding: 14px 10px 12px !important;
  }

  .profile-page .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-label {
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: center !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
  }

  .profile-page .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-value {
    grid-row: 2 !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 1 !important;
  }

  .profile-page .profile-stat-value-star,
  .profile-page .profile-stat-label-star {
    display: none !important;
  }
}


/* v388: profile edit controls visibility + hours stat font bump */
.profile-page.profile-edit-mode .profile-stat-toggle,
.profile-page.profile-edit-mode .profile-row-toggle {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.profile-page.profile-edit-mode .profile-section-toggle-input {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.profile-page.profile-edit-mode .profile-stat-card.profile-stat-hidden {
  display: grid !important;
  visibility: visible !important;
  opacity: 0.86 !important;
}
.profile-page.profile-edit-mode .profile-stat-toggle {
  top: 8px !important;
  right: 8px !important;
  min-height: 22px !important;
  padding: 3px 7px !important;
  border-radius: 999px !important;
  background: rgba(8, 6, 20, 0.86) !important;
  border: 1px solid rgba(196, 181, 253, 0.28) !important;
  color: #ffffff !important;
  font-size: 9px !important;
  line-height: 1 !important;
}
.profile-page.profile-edit-mode .profile-stat-toggle input {
  width: 13px !important;
  height: 13px !important;
  display: inline-block !important;
}
.profile-page.profile-edit-mode .profile-mobile-link-toggle,
.profile-page.profile-edit-mode .plm-toggle-row {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 900px) {
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value {
    font-size: 27px !important;
  }
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-main {
    font-size: 12px !important;
  }
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-sub {
    font-size: 11px !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value {
    font-size: 27px !important;
  }
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-main {
    font-size: 12px !important;
  }
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-sub {
    font-size: 11px !important;
  }
}


/* v390: compact profile average rating values */
@media (max-width: 900px) {
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value {
    font-size: 26px !important;
  }
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-value {
    font-size: 26px !important;
  }
  .profile-page .profile-stat-value-star,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-value-star {
    display: inline-block !important;
    color: #f59e0b !important;
    font-size: 0.78em !important;
    margin-right: 1px !important;
  }
  .profile-page .profile-stat-label-star,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-label-star {
    display: none !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value {
    font-size: 26px !important;
  }
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-value {
    font-size: 26px !important;
  }
  .profile-page .profile-stat-value-star,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-value-star {
    display: inline-block !important;
    color: #f59e0b !important;
    font-size: 0.78em !important;
    margin-right: 1px !important;
  }
  .profile-page .profile-stat-label-star,
  .profile-page .profile-hero-card > .profile-stats-grid .profile-stat-label-star {
    display: none !important;
  }
}

/* v391: top 3 profile ranks use plain numerals without periods. */


/* v392: profile showcase cards use clean generic stat labels above poster rows. */
.profile-media-group[data-profile-group="movies"] .profile-group-stat-label,
.profile-media-group[data-profile-group="shows"] .profile-group-stat-label,
.profile-media-group[data-profile-group="anime"] .profile-group-stat-label,
.profile-media-group[data-profile-group="games"] .profile-group-stat-label {
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
}


/* v393: profile showcase stats are values-only, with sleeker number rendering. */
.profile-group-stats.profile-group-stats-values-only {
  align-items: center !important;
}
.profile-group-stats.profile-group-stats-values-only .profile-group-stat {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 6px 0 !important;
}
.profile-group-stats.profile-group-stats-values-only .profile-group-stat-label {
  display: none !important;
}
.profile-group-stats.profile-group-stats-values-only .profile-group-stat-value {
  margin: 0 !important;
  text-align: center !important;
}
.profile-page .profile-stat-value,
.profile-page .profile-fav-rank,
.profile-page .profile-fav-rating,
.profile-page .profile-follow-number,
.profile-page .profile-count-number,
.profile-page .profile-mini-stat strong,
.profile-page [data-profile-db-rating-preview],
.profile-page [data-manual-rating-preview] {
  font-family: 'Aptos Display', Aptos, 'SF Pro Display', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: 780 !important;
  letter-spacing: -0.035em !important;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}
.profile-page .profile-group-stat-value {
  font-family: 'Aptos Display', Aptos, 'SF Pro Display', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.03em !important;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'tnum' 1;
}
.profile-page .profile-media-group .profile-media-title {
  font-weight: 600 !important;
}
.profile-page .screenlist-gold-star-icon {
  font-family: inherit !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
}


/* v394: center profile showcase category titles and Top 3 row titles. */
.profile-page .profile-media-group .profile-media-head {
  justify-content: center !important;
  text-align: center !important;
}
.profile-page .profile-media-group .profile-media-title-wrap {
  width: 100% !important;
  text-align: center !important;
}
.profile-page .profile-media-group .profile-media-title {
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
}
.profile-page .profile-media-group .profile-media-sub {
  text-align: center !important;
}
.profile-page .profile-media-group .profile-fav-row-head {
  position: relative !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 22px !important;
}
.profile-page .profile-media-group .profile-fav-row-title {
  flex: 1 1 auto !important;
  width: 100% !important;
  text-align: center !important;
}
.profile-page .profile-media-group .profile-fav-row-head .profile-row-toggle {
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}
@media (max-width: 560px) {
  .profile-page .profile-media-group .profile-fav-row-head .profile-row-toggle {
    position: static !important;
    transform: none !important;
    margin-left: 8px !important;
  }
  .profile-page .profile-media-group .profile-fav-row-title {
    text-align: center !important;
  }
}


/* v395: profile showcase values keep context labels below the numbers. */
.profile-group-stats.profile-group-stats-showcase-labels {
  align-items: start !important;
}
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 46px !important;
  padding: 6px 0 8px !important;
  text-align: center !important;
}
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat-value {
  margin: 0 !important;
  text-align: center !important;
  line-height: 1 !important;
}
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat-label {
  display: block !important;
  margin-top: 5px !important;
  color: rgba(232, 227, 243, 0.72) !important;
  font-family: Aptos, 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 8.5px !important;
  font-weight: 850 !important;
  letter-spacing: 0.08em !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
  text-align: center !important;
}
body.light-mode .profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat-label {
  color: rgba(18, 8, 46, 0.62) !important;
}


/* v397: profile showcase avg-rating offset + upper stat card sizing/font balance */
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat[data-profile-group-stat="movieAvg"],
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat[data-profile-group-stat="tvAvg"],
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat[data-profile-group-stat="animeAvg"],
.profile-group-stats.profile-group-stats-showcase-labels .profile-group-stat[data-profile-group-stat="gamesAvg"] {
  transform: translateX(9px) !important;
}

@media (max-width: 900px) {
  .profile-page .profile-stat-card,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card {
    min-height: 112px !important;
    padding: 12px 9px 10px !important;
    grid-template-rows: minmax(28px, auto) 1fr !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-value {
    font-family: 'Aptos Display', Aptos, 'SF Pro Display', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 25px !important;
    font-weight: 780 !important;
    line-height: 1 !important;
    letter-spacing: -0.035em !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label {
    font-size: 9.5px !important;
    line-height: 1.24 !important;
    margin: 0 !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label-main {
    font-size: 10px !important;
    line-height: 1.14 !important;
    letter-spacing: 0.5px !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label-sub {
    font-size: 9px !important;
    line-height: 1.12 !important;
    margin-top: 4px !important;
  }
}

@media (display-mode: standalone) and (max-width: 1050px) {
  .profile-page .profile-stat-card,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card {
    min-height: 112px !important;
    padding: 12px 9px 10px !important;
    grid-template-rows: minmax(28px, auto) 1fr !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-value,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-value {
    font-family: 'Aptos Display', Aptos, 'SF Pro Display', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 25px !important;
    font-weight: 780 !important;
    line-height: 1 !important;
    letter-spacing: -0.035em !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label {
    font-size: 9.5px !important;
    line-height: 1.24 !important;
    margin: 0 !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-main,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label-main {
    font-size: 10px !important;
    line-height: 1.14 !important;
    letter-spacing: 0.5px !important;
  }

  .profile-page .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-stat-card.profile-stat-score .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-hours .profile-stat-label-sub,
  .profile-page .profile-hero-card > .profile-stats-grid > .profile-stat-card.profile-stat-score .profile-stat-label-sub {
    font-size: 9px !important;
    line-height: 1.12 !important;
    margin-top: 4px !important;
  }
}

/* v398: profile Top 3 editable library picker */
.profile-page.profile-edit-mode .profile-db-slot .profile-fav-poster-action,
.profile-page.profile-edit-mode .profile-manual-slot .profile-fav-poster-action {
  border-color: rgba(34, 211, 238, 0.72) !important;
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.18),
    0 14px 28px rgba(0,0,0,0.30) !important;
}
.profile-page.profile-edit-mode .profile-db-slot .profile-fav-poster-action::after,
.profile-page.profile-edit-mode .profile-manual-slot .profile-fav-poster-action::after {
  content: 'Edit';
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(5,4,16,0.78);
  color: #ffffff;
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.profile-page.profile-edit-mode .profile-fav-poster {
  position: relative;
}
.profile-favorite-picker-overlay.profile-favorite-picker-bottom-sheet {
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  background: rgba(0,0,0,0.70) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.profile-favorite-picker-bottom-sheet .profile-library-picker-modal {
  width: min(100vw, 760px) !important;
  height: min(92vh, 840px) !important;
  max-height: min(92vh, 840px) !important;
  border-radius: 26px 26px 0 0 !important;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateY(18px);
  animation: profileLibraryPickerRise 260ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes profileLibraryPickerRise {
  from { transform: translateY(36px); opacity: 0.76; }
  to { transform: translateY(0); opacity: 1; }
}
.profile-library-picker-modal .profile-picker-head {
  align-items: center !important;
  margin-bottom: 12px !important;
  flex: 0 0 auto;
}
.profile-library-picker-modal .profile-picker-title {
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif !important;
  font-size: 20px !important;
}
.profile-library-picker-modal .profile-picker-sub {
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif !important;
  font-size: 12px !important;
  color: rgba(248,244,255,0.70) !important;
}
.profile-library-search-toggle {
  width: 39px;
  height: 39px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.12);
  color: #ffffff;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.profile-library-picker-modal .profile-picker-close {
  flex: 0 0 auto;
}
.profile-library-searchbar {
  grid-template-columns: 1fr !important;
  flex: 0 0 auto;
  margin-bottom: 12px !important;
}
.profile-library-searchbar input {
  min-height: 46px;
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif !important;
  font-size: 16px !important;
}
.profile-library-picker-modal #profile-picker-results,
.profile-library-picker-modal .profile-picker-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 12px;
}
.profile-library-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}
.profile-library-picker-tile {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 0;
  min-width: 0;
  text-align: center;
  cursor: pointer;
  font-family: Aptos, 'Aptos Display', 'Segoe UI', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.profile-library-picker-poster {
  display: flex;
  width: 100%;
  aspect-ratio: 2 / 3;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid rgba(196,181,253,0.14);
  background: linear-gradient(145deg, #211936, #0b0819);
  color: #a78bfa;
  box-shadow: 0 12px 26px rgba(0,0,0,0.30);
}
.profile-library-picker-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-library-picker-name {
  display: block;
  margin-top: 6px;
  color: #f7f3ff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.16;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-library-picker-tile:active .profile-library-picker-poster {
  transform: scale(0.98);
}
.profile-library-clear-btn {
  width: 100%;
  min-height: 42px;
}
body.light-mode .profile-library-picker-modal .profile-picker-sub { color: rgba(31, 20, 56, 0.68) !important; }
body.light-mode .profile-library-picker-name { color: #12082e; }
body.light-mode .profile-library-picker-poster { background: #f8f6ff; border-color: #d8cfee; }
@media (min-width: 760px) {
  .profile-favorite-picker-bottom-sheet .profile-library-picker-modal {
    width: min(720px, 94vw) !important;
  }
}

/* ============================================================================
   v465: Top 3 Fictional Characters editor — mobile/PWA-first centered modal
   ============================================================================ */
.profile-character-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(env(safe-area-inset-top, 0px), 16px) 14px max(env(safe-area-inset-bottom, 0px), 16px);
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-editor-overlay.open {
  display: flex;
  opacity: 1;
}
.profile-character-editor-modal {
  position: relative;
  width: min(94vw, 460px);
  max-height: min(92dvh, 92vh);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid rgba(196, 181, 253, 0.18);
  background:
    radial-gradient(circle at 14% 0%, rgba(245, 158, 11, 0.10), transparent 32%),
    radial-gradient(circle at 90% 6%, rgba(139, 92, 246, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(21, 16, 37, 0.985), rgba(7, 5, 17, 0.985));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transform: translateY(8px) scale(0.985);
  opacity: 0;
  animation: profileCharacterEditorIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes profileCharacterEditorIn {
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.profile-character-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 6px 20px;
  flex: 0 0 auto;
}
.profile-character-editor-kicker {
  color: #c4b5fd;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.profile-character-editor-title {
  color: #f7f3ff;
  font-family: 'Sora', 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.4px;
  margin-top: 2px;
}
.profile-character-editor-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(196, 181, 253, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #f7f3ff;
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-editor-close:active { transform: scale(0.94); }
.profile-character-editor-body {
  padding: 4px 18px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.profile-character-editor-body::-webkit-scrollbar { width: 6px; }
.profile-character-editor-body::-webkit-scrollbar-thumb {
  background: rgba(196, 181, 253, 0.22);
  border-radius: 999px;
}
.profile-character-preview-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(196, 181, 253, 0.14);
  background: rgba(255, 255, 255, 0.035);
}
.profile-character-preview-poster {
  width: 96px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  background: linear-gradient(135deg, #2a1f5e, #151025);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8f7fd0;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}
.profile-character-preview-empty .profile-character-preview-rank {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 950;
  color: rgba(196, 181, 253, 0.45);
}
.profile-character-preview-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-character-field-label {
  color: #c4b5fd;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-character-field-input {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid #3d3466;
  background: #0a081a;
  color: #e8e3f3;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  /* v617: 16px minimum — iOS Safari won't raise the keyboard for inputs
     smaller than 16px inside a fixed-position sheet. */
  font-size: 16px;
  font-weight: 700;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
}
.profile-character-field-input:focus {
  border-color: #8b5cf6;
  background: #100b22;
}
.profile-character-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(196, 181, 253, 0.13);
  background: rgba(255, 255, 255, 0.025);
}
.profile-character-section-head { display: flex; flex-direction: column; gap: 2px; }
.profile-character-section-title {
  color: #f7f3ff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.1px;
}
.profile-character-section-sub {
  color: #9990b3;
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
}
.profile-character-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.profile-character-search-btn {
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  padding: 0 18px;
  min-height: 44px;
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-search-btn:active { transform: scale(0.96); }
.profile-character-search-results {
  min-height: 80px;
}
.profile-character-search-empty {
  border: 1px dashed rgba(167, 139, 250, 0.22);
  border-radius: 14px;
  padding: 16px;
  color: #9990b3;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.025);
}
.profile-character-search-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.profile-character-search-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1px solid rgba(196, 181, 253, 0.16);
  background: #100b22;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}
.profile-character-search-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-character-search-tile:hover { border-color: rgba(244, 210, 122, 0.55); transform: translateY(-1px); }
.profile-character-search-tile:active { transform: scale(0.96); }
.profile-character-search-tile-broken { display: none; }
.profile-character-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: rgba(124, 58, 237, 0.14);
  color: #f7f3ff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 900;
  min-height: 46px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-upload-btn:active { transform: scale(0.97); }
.profile-character-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: 60dvh;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #050410;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.profile-character-crop-stage:active { cursor: grabbing; }
.profile-character-crop-image {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
  max-width: none;
  max-height: none;
}
.profile-character-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(244, 210, 122, 0.6);
  border-radius: 16px;
}
.profile-character-crop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-character-crop-zoom {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(196, 181, 253, 0.18);
  border-radius: 999px;
  outline: none;
}
.profile-character-crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  border: 0;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}
.profile-character-crop-zoom::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  border: 0;
}
.profile-character-crop-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.profile-character-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 18px max(env(safe-area-inset-bottom, 0px), 16px);
  border-top: 1px solid rgba(196, 181, 253, 0.10);
  background: rgba(7, 5, 17, 0.6);
  flex: 0 0 auto;
}
.profile-character-editor-clear {
  border-radius: 14px;
  border: 1px solid rgba(196, 181, 253, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 900;
  padding: 11px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-editor-clear:active { transform: scale(0.96); }
.profile-character-editor-save {
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 950;
  padding: 11px 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-character-editor-save:active { transform: scale(0.96); }
body.light-mode .profile-character-editor-modal {
  background: #fff;
  border-color: #d8cfee;
}
body.light-mode .profile-character-editor-title { color: #12082e; }
body.light-mode .profile-character-section-title { color: #12082e; }
body.light-mode .profile-character-field-input,
body.light-mode .profile-character-section,
body.light-mode .profile-character-preview-row {
  background: #f8f6ff;
  border-color: #d8cfee;
  color: #12082e;
}
body.light-mode .profile-character-search-empty { background: #f8f6ff; color: #5a4780; }
@media (min-width: 760px) {
  .profile-character-editor-modal {
    width: min(520px, 92vw);
  }
}

/* v611: profile poster editor bottom sheet + borderless sections */
body.profile-character-editor-open {
  overflow: hidden !important;
}
body.profile-character-editor-open #profile-page {
  overflow: hidden !important;
}
.profile-character-editor-overlay {
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.62) !important;
}
.profile-character-editor-modal {
  width: 100% !important;
  max-width: 100% !important;
  height: 80dvh !important;
  max-height: 80dvh !important;
  border: 0 !important;
  border-radius: 24px 24px 0 0 !important;
  /* v615: keyframes own the transform timeline. The previous
     `transform: translateY(100%) !important` static rule sat above the
     animation in the cascade and pinned the sheet below the viewport,
     so the open call just blurred the screen. */
  opacity: 1 !important;
  animation: profilePosterSheetIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}
@keyframes profilePosterSheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.profile-character-preview-row,
.profile-character-section {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.profile-character-field-input,
.profile-character-search-btn,
.profile-character-upload-btn,
.profile-character-search-empty {
  border: 0 !important;
  box-shadow: none !important;
}
body.light-mode .profile-character-field-input,
body.light-mode .profile-character-section,
body.light-mode .profile-character-preview-row {
  border: 0 !important;
  box-shadow: none !important;
}
@media (min-width: 760px) {
  .profile-character-editor-modal {
    width: min(560px, 100vw) !important;
    max-width: 560px !important;
  }
}
