#themeToggle { min-height:44px; padding:8px 12px; flex-shrink:0; font-size:12px; }

/* Pearl: opaque reading surfaces over softly framed, rotating artwork.
   Keep all palette overrides scoped so the original dark theme stays intact. */
html[data-theme=light] {
  color-scheme:light;
  --bg:#f8f6fa; --bg-deep:#eee8f1; --surface:#fffdff; --surface-solid:#fffdff;
  --surface-strong:#f1ebf4; --surface-hot:#eadde9; --ink:#382e43; --muted:#706377;
  --line:#e1d9e7; --line-strong:#b19aba; --accent:#87516d; --accent-strong:#70425e;
  --accent-soft:#f2e5ee; --teal:#49695f; --gold:#815c36; --danger:#a82242;
  --shadow:0 2px 6px #46305204,0 14px 36px #4630520a;
  --glow:0 0 0 3px #87516d14;
  --pearl-panel:linear-gradient(125deg,#fffefefa,#fbf8fcf5);
  --pearl-elevated:0 2px 8px #46305206,0 22px 48px #46305214;
}
html[data-theme=light] body,html[data-theme=light] body.player-open {
  color:var(--ink);
  background:radial-gradient(ellipse at 93% 0%,#e6dbf080,transparent 48%),
    radial-gradient(ellipse at 3% 42%,#f5e1e870,transparent 44%),
    linear-gradient(135deg,#fbf9fc,var(--bg) 52%,#f4edf4);
}
html[data-theme=light] .scene-canvas { opacity:.07; }
html[data-theme=light] .ambient-grain {
  background:radial-gradient(ellipse at 75% 2%,#ffffff90,transparent 52%),
    radial-gradient(ellipse at 0% 75%,#e8d9ed38,transparent 48%);
}
html[data-theme=light] .background-artwork { opacity:1; }
html[data-theme=light] .background-artwork::after {
  background:linear-gradient(90deg,#f8f6fa55,#f8f6fae0 24%,#f8f6faf2 48%,#f8f6fa9c 76%,#f8f6fa28),
    linear-gradient(0deg,#f8f6fae6,transparent 45%,#f8f6fab3);
}
html[data-theme=light] .background-portrait {
  top:5vh; right:-10vw; width:clamp(360px,44vw,760px); height:102vh; opacity:.58;
  mask-image:radial-gradient(ellipse 70% 58% at 50% 48%,#000 26%,transparent 80%);
}
html[data-theme=light] .background-portrait-1 { top:16vh; left:-12vw; right:auto; width:clamp(300px,35vw,600px); opacity:.38; }
html[data-theme=light] .background-portrait img { filter:saturate(.76) contrast(.9); }
html[data-theme=light] body.player-open .background-artwork { visibility:visible; opacity:.65; }

/* Navigation and headings. */
html[data-theme=light] .topbar { border-bottom-color:var(--line); }
html[data-theme=light] .brand-mark > span,html[data-theme=light] .accent-dot { color:var(--accent); }
html[data-theme=light] :is(.section-kicker,.hero-copy .hero-kicker) { color:var(--accent-strong); }
html[data-theme=light] .hero-copy h2 { color:var(--ink); }
html[data-theme=light] .hero-copy h2 em { color:var(--accent); }
html[data-theme=light] .hero-stats strong { color:var(--ink); }
html[data-theme=light] .motion-indicator { background:var(--accent); border-color:var(--accent); }
html[data-theme=light] .motion-indicator::after { background:#fff; }
html[data-theme=light] .motion-switch[aria-pressed="false"] .motion-indicator { background:var(--surface-strong); border-color:var(--muted); }
html[data-theme=light] .motion-switch[aria-pressed="false"] .motion-indicator::after { background:var(--muted); }

/* Soft elevation instead of the dark theme's heavy black shadows. */
html[data-theme=light] :is(.video-card,.home-card,.profile-stat,.profile-section,.watch-card,.auth-panel,.feature-dialog,.admin-tools,.admin-user,.floating-player,.empty-state) {
  color:var(--ink); background:var(--surface-solid); border-color:var(--line); box-shadow:var(--shadow);
}
html[data-theme=light] :is(.home-card,.video-card) { border:1px solid var(--line); border-radius:16px; }
html[data-theme=light] .video-card::before { background:none; }
html[data-theme=light] :is(.profile-section,.watch-card) { background:var(--pearl-panel); }
html[data-theme=light] :is(.admin-tools,.admin-user) { background:#f8f4f9; box-shadow:none; }
html[data-theme=light] .profile-stat { background:linear-gradient(135deg,#fff,#f4eef7); }
html[data-theme=light] .home-empty { background:#fffdffe8; border-color:var(--line-strong); }
html[data-theme=light] :is(.cinema-hero,.access-gate) {
  background:radial-gradient(ellipse at 82% 34%,#e9def1b3,transparent 54%),
    radial-gradient(ellipse at 18% 100%,#f5e5ed80,transparent 56%),var(--pearl-panel);
  border-color:#e3d9e9; box-shadow:inset 0 1px #fff,var(--pearl-elevated);
}
html[data-theme=light] :is(.gallery-art,.access-art img) { border-color:#f1e6f0; box-shadow:3px 5px 0 #8e6d8524,0 18px 30px #50324733; }
html[data-theme=light] .gallery-orbit { border-color:#a786b04a; box-shadow:0 0 40px #ccb1d22b,inset 0 0 35px #ccb1d218; }
html[data-theme=light] .gallery-orbit::after { border-color:#a786b024; }
html[data-theme=light] .exhibition-caption button { color:var(--accent-strong); background:var(--surface); border-color:var(--line-strong); }
html[data-theme=light] .category-card { border-color:var(--line-strong); box-shadow:3px 4px 0 #d7c8df,0 14px 30px #50324718; }

/* Inputs retain visible placeholders, including on iOS and in dialogs. */
html[data-theme=light] :is(.profile-button,.icon-button,.ghost-button,.moment-chip,.search-chip,.card-menu-inline,.view-toggle,.search-box,.select-box,.auth-form label,.meta-editor label,.up-next-banner,.toast,.swipe-track) {
  background:var(--surface); color:var(--ink); border-color:var(--line);
}
html[data-theme=light] :is(.search-box,.select-box) { box-shadow:0 2px 5px #46305204; }
html[data-theme=light] :is(.search-box,.select-box,.auth-form label,.meta-editor label):focus-within { border-color:var(--accent); box-shadow:var(--glow); }
html[data-theme=light] :is(.advanced-form input,.advanced-form textarea,.advanced-form select,.feature-dialog input,.feature-dialog select,.feature-dialog textarea,.comfort-tools select,.display-preferences select,.playback-tools select,.admin-user select,.password-form input,.auth-form input,.meta-editor input,.search-box input,.select-box select,#sleepTimer,option) {
  color:var(--ink); background:var(--surface); border-color:var(--line-strong);
}
html[data-theme=light] :is(input,textarea)::placeholder { color:var(--muted); opacity:1; }
html[data-theme=light] :is(input,select,textarea) { color-scheme:light; }
html[data-theme=light] :is(.primary-button,.primary-button:hover) { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 4px 12px #87516d1c; }
html[data-theme=light] :is(.ghost-button:hover,.menu-button:hover,.tab-button:hover,.view-toggle .active,.tab-button.active,.menu-button.active,.quick-filters .active,.shuffle-button) {
  color:var(--accent-strong); background:var(--accent-soft); border-color:var(--line-strong);
}
html[data-theme=light] .shuffle-button:hover:not(:disabled) { background:#e9d6e4; border-color:var(--accent); }
html[data-theme=light] .menu-button.active { box-shadow:inset 2px 0 var(--accent); }
html[data-theme=light] :is(.video-copy p,.video-stats span,.library-head p,.filter-summary,.playback-hint,.playback-speed,.autonext-toggle,.hero-copy p:not(.hero-kicker),.hero-browse,.select-box span,.nav-caption,.nav-version,.nav-foot p,.access-copy>small,.exhibition-caption,.recovery-fields) { color:var(--muted); }
html[data-theme=light] :is(.tag-chip,.later-chip.active) { color:var(--accent-strong); border-color:var(--line); background:var(--accent-soft); }
html[data-theme=light] .tag-chip:hover { border-color:var(--line-strong); background:#e9d6e4; }
html[data-theme=light] .star-button { color:var(--muted); }
html[data-theme=light] .star-button.active { color:var(--gold); }
html[data-theme=light] :is(.connection-notice,.form-error) { background:#fce9ee; color:#812a48; border-color:#bb7b94; }
html[data-theme=light] :is(#advancedError,#featureError) { color:var(--danger); }
html[data-theme=light] .ghost-button.danger { color:var(--danger); border-color:#bb7b94; }
html[data-theme=light] .auth-form .show-passwords { background:transparent; }
html[data-theme=light] .auth-panel { height:auto; align-content:start; }
html[data-theme=light] :is(.auth-current p,.auth-note,.auth-panel .player-header p) { color:var(--muted); }
html[data-theme=light] .auth-panel .tab-button { color:var(--muted); background:transparent; border-color:var(--line); }
html[data-theme=light] .auth-panel .tab-button:is(.active,:hover) { color:var(--accent-strong); background:var(--accent-soft); border-color:var(--line-strong); }
html[data-theme=light] .auth-shell .player-backdrop { background:#32213f66; backdrop-filter:blur(6px); }
html[data-theme=light] :is(.feature-dialog,.remote-dialog)::backdrop { background:#32213f66; backdrop-filter:blur(6px); }
html[data-theme=light] :is(.auth-panel,.feature-dialog,.remote-dialog,.remote-dock) { border-color:var(--line-strong); background:var(--surface-solid); color:var(--ink); box-shadow:var(--pearl-elevated); }
html[data-theme=light] :is(button,a,input,select,summary,textarea):focus-visible { outline-color:var(--accent-strong); }
html[data-theme=light] .select-box select:focus-visible { outline-offset:-2px; border-radius:6px; }
html[data-theme=light] ::selection { color:#fff; background:var(--accent-strong); }

/* Photo/video overlays intentionally stay dark: labels and icons must stay white. */
html[data-theme=light] .card-menu { color:#fff; border-color:#ffffff55; }
html[data-theme=light] :is(.category-image-button,.category-hide-button) { color:#fff; background:#16111cdb; border-color:#ffffff55; }
html[data-theme=light] .watch-stage { border-color:#c6b1ce; box-shadow:0 0 0 3px #e3d9e9,0 18px 40px #4630521c; }
html[data-theme=light] :is(.scene-player-controls,.scene-timeline-tip,.timeline-scene-list) { --ink:#fff; --accent-strong:#ffc7e0; color:#fff; }
html[data-theme=light] .scene-player-controls :focus-visible { outline-color:#ffc7e0; }
html[data-theme=light] #discreetScreen { color:#fff; background:#20252b; }
html[data-theme=light] #unlockTouch { color:#fff; background:#201c22; }
html[data-theme=light] .remote-rail #remoteSeek { background:transparent; }

@media (hover:hover) and (pointer:fine) {
  html[data-theme=light] :is(.video-card,.home-card):hover { border-color:var(--line-strong); box-shadow:var(--pearl-elevated); }
  html[data-theme=light] .category-card:hover { border-color:var(--accent); box-shadow:3px 5px 0 #cbb4d2,0 18px 32px #50324724; }
  html[data-theme=light] body:not(.motion-off) .gallery-art:hover { box-shadow:0 22px 38px #50324740; }
}
@media(min-width:901px){
  html[data-theme=light] .main-menu { background:#fffdfff0; border-radius:16px; box-shadow:0 0 0 10px #fffdfff0,0 12px 32px #4630520c; }
}
@media(max-width:900px){
  html[data-theme=light] .admin-user { grid-template-columns:minmax(0,1fr); }
  html[data-theme=light] .admin-user > div { min-width:0; max-width:100%; }
  html[data-theme=light] :is(.main-menu,body.player-open .main-menu) { background:#fffdfff5; border-color:#d9cce2; box-shadow:0 6px 26px #4630521c,inset 0 1px #fff; }
  html[data-theme=light] .menu-button.active { box-shadow:none; }
  html[data-theme=light] .background-portrait { top:8vh; right:-34vw; width:110vw; height:100vh; opacity:.48; }
  html[data-theme=light] .background-artwork::after { background:linear-gradient(90deg,#f8f6faf2,#f8f6fad9 45%,#f8f6fa66),linear-gradient(0deg,#f8f6fad9,transparent 60%,#f8f6fa99); }
}
@media(max-width:600px){
  .topbar,body.player-open .topbar { flex-wrap:wrap; }
  .top-actions { margin-left:auto; max-width:100%; flex-wrap:wrap; }
  #themeToggle { padding-inline:8px; }
  html[data-theme=light] :is(.cinema-hero,.access-gate) { box-shadow:0 6px 22px #4630520c; }
  html[data-theme=light] .top-actions :is(.icon-button,.profile-button) { min-height:44px; }
  html[data-theme=light] .top-actions .icon-button { min-width:44px; }
  html[data-theme=light] .auth-panel { width:calc(100% - 24px); }
}
