/* =====================================================================
   DAWU V5.6 — true light theme + portable admin polish
   Loaded LAST on purpose: older design layers used legacy --bg/--panel vars
   and a few hard-coded black surfaces.  V5.6 maps both legacy and new tokens.
   ===================================================================== */
:root{
  --bg:#090c10;--panel:#0f141a;--ink:#f7f9fb;--muted:#c5ced8;--line:rgba(255,255,255,.14);--accent:#75c8cf;
  --ui-accent-ink:#08292d;
}
html[data-theme="light"]{
  --bg:#f7f9fb;--panel:#ffffff;--ink:#16212c;--muted:#526477;--line:rgba(21,44,61,.15);--accent:#176477;
  --ui-bg:#f7f9fb;--ui-bg-elev:#eef3f7;--ui-surface:rgba(255,255,255,.94);--ui-surface-strong:#ffffff;--ui-surface-soft:rgba(23,100,119,.055);
  --ui-text:#16212c;--ui-text-2:#465769;--ui-text-3:#5c6d7d;--ui-line:rgba(21,44,61,.15);--ui-line-strong:rgba(21,44,61,.24);
  --ui-accent:#176477;--ui-accent-strong:#0d4d5d;--ui-accent-ink:#ffffff;
  color-scheme:light;
}
html[data-theme="dark"]{color-scheme:dark}

/* The page itself must really switch theme, not only its text variables. */
html[data-theme="light"],html[data-theme="light"] body,html[data-theme="light"] main{
  background-color:#f7f9fb!important;color:#16212c!important;
}
html[data-theme="light"] body{
  background-image:
    radial-gradient(900px 520px at 8% 0%,rgba(73,145,166,.08),transparent 68%),
    radial-gradient(760px 480px at 94% 4%,rgba(120,154,178,.06),transparent 72%),
    linear-gradient(180deg,#f7f9fb,#f7f9fb)!important;
}
html[data-theme="light"] body:before{opacity:.09!important}

/* Navigation / shells */
html[data-theme="light"] .topbar{background:rgba(247,249,251,.84)!important;border-bottom-color:rgba(21,44,61,.12)!important}
html[data-theme="light"] .nav,html[data-theme="light"] .desktop-actions .theme-toggle,html[data-theme="light"] .header-actions .theme-toggle,html[data-theme="light"] .menu-toggle,html[data-theme="light"] .header-link{
  background:rgba(255,255,255,.86)!important;color:#34475a!important;border-color:rgba(21,44,61,.13)!important;box-shadow:0 8px 26px rgba(45,63,78,.06),inset 0 1px 0 #fff!important;
}
html[data-theme="light"] .nav a{color:#4b5d6f!important}
html[data-theme="light"] .nav a:hover{color:#16212c!important;background:rgba(23,100,119,.055)!important}
html[data-theme="light"] .nav a.active{background:#d9f0f3!important;color:#123b46!important}
html[data-theme="light"] .menu-toggle span{background:#263a4b!important}

/* General glass surfaces. */
html[data-theme="light"] .vcard,
html[data-theme="light"] .person-card,
html[data-theme="light"] .series-card,
html[data-theme="light"] .evidence-card,
html[data-theme="light"] .journal-card,
html[data-theme="light"] .journal-sidebar,
html[data-theme="light"] .collection-sidebar,
html[data-theme="light"] .people-intro,
html[data-theme="light"] .person-hero,
html[data-theme="light"] .pf-panel,
html[data-theme="light"] .identify-video-card,
html[data-theme="light"] .identify-pick-panel,
html[data-theme="light"] .quick-optional,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .quick-summary,
html[data-theme="light"] .home-search,
html[data-theme="light"] .search-field,
html[data-theme="light"] .segmented,
html[data-theme="light"] .tabs{
  background:rgba(255,255,255,.92)!important;color:#16212c!important;border-color:rgba(21,44,61,.13)!important;
  box-shadow:0 14px 42px rgba(45,63,78,.075),inset 0 1px 0 #fff!important;
}
html[data-theme="light"] .vcard:after,html[data-theme="light"] .person-card:after,html[data-theme="light"] .journal-card:after,html[data-theme="light"] .evidence-card:after{opacity:.05!important}

/* All-video / category page controls. */
html[data-theme="light"] .collection{background:transparent!important}
html[data-theme="light"] .collection-toolbar select,
html[data-theme="light"] select,
html[data-theme="light"] input,
html[data-theme="light"] textarea{
  color:#203141!important;background:#fff!important;border-color:rgba(21,44,61,.14)!important;box-shadow:none!important;
}
html[data-theme="light"] input::placeholder,html[data-theme="light"] textarea::placeholder{color:#718092!important;opacity:1!important}
html[data-theme="light"] .category-filters button{color:#415569!important;background:transparent!important;border-color:transparent!important}
html[data-theme="light"] .category-filters button:hover{background:#f0f5f8!important;color:#16212c!important}
html[data-theme="light"] .category-filters button.selected{background:#e1f2f4!important;color:#123b46!important;border-left-color:#2890a6!important}
html[data-theme="light"] .category-filters button.selected span{color:#176477!important}
html[data-theme="light"] .result-info,html[data-theme="light"] .page-title p{color:#5d6d7e!important}

/* Video-card overlays: light theme no longer leaves black UI badges behind. */
html[data-theme="light"] .preview-badge{
  color:#124653!important;background:rgba(232,247,248,.94)!important;border-color:rgba(23,100,119,.28)!important;
  box-shadow:0 6px 18px rgba(48,87,98,.10)!important;text-shadow:none!important;
}
html[data-theme="light"] .duration{
  color:#263746!important;background:rgba(255,255,255,.90)!important;border:1px solid rgba(21,44,61,.14)!important;border-radius:8px!important;text-shadow:none!important;
}
html[data-theme="light"] .play-icon,
html[data-theme="light"] .hero-feature-play,
html[data-theme="light"] .circle-arrow,
html[data-theme="light"] .identify-cover-trigger>span{
  color:#173946!important;background:rgba(255,255,255,.92)!important;border:1px solid rgba(21,44,61,.14)!important;box-shadow:0 8px 24px rgba(45,63,78,.10)!important;
}
/* Actual embedded video can remain black for correct 16:9 letterboxing. */
html[data-theme="light"] .preview-ended{background:linear-gradient(145deg,#fff,#eef4f7)!important;color:#16212c!important;border-color:rgba(21,44,61,.14)!important}
html[data-theme="light"] .preview-ended>p{color:#526477!important}

/* Buttons and chips. */
html[data-theme="light"] .button:not(.light),
html[data-theme="light"] .text-button,
html[data-theme="light"] .pf-type,
html[data-theme="light"] .wrong-chip,
html[data-theme="light"] .journal-kind-chip{
  color:#314659!important;background:rgba(255,255,255,.88)!important;border:1px solid rgba(21,44,61,.14)!important;box-shadow:none!important;text-shadow:none!important;
}
html[data-theme="light"] .button:not(.light):hover,
html[data-theme="light"] .pf-type:hover,
html[data-theme="light"] .journal-kind-chip:hover{background:#edf4f6!important;color:#163b46!important;border-color:rgba(23,100,119,.27)!important}
html[data-theme="light"] .button.light{background:#176477!important;color:#fff!important;border-color:#176477!important}
html[data-theme="light"] .button.light:hover{background:#0d4d5d!important;color:#fff!important}
html[data-theme="light"] .journal-kind-chip.active,html[data-theme="light"] .pf-type.active,html[data-theme="light"] .wrong-chip.marked{background:#dff1f3!important;color:#123b46!important;border-color:#8dc8d1!important}

/* Person / identify readability. */
html[data-theme="light"] .person-caption h3,html[data-theme="light"] .vcard h3,html[data-theme="light"] .vcard h3 a,html[data-theme="light"] .identify-v2 h1,html[data-theme="light"] .identify-v2 h2,html[data-theme="light"] .quick-step h2{color:#16212c!important}
html[data-theme="light"] .person-caption span,html[data-theme="light"] .video-meta,html[data-theme="light"] .video-bottom,html[data-theme="light"] .quick-step p,html[data-theme="light"] .identify-privacy{color:#526477!important}
html[data-theme="light"] .quick-person{background:#f8fafb!important;color:#16212c!important;border-color:rgba(21,44,61,.13)!important}
html[data-theme="light"] .quick-person:hover,html[data-theme="light"] .quick-person.picked{background:#e8f4f5!important;border-color:#79b9c4!important}
html[data-theme="light"] .quick-person small{color:#56697a!important}
html[data-theme="light"] .quick-selected span,html[data-theme="light"] .video-cast a{background:#eef5f6!important;color:#314f5c!important;border-color:#cbdde1!important}

/* Dynamics / timeline. */
html[data-theme="light"] .journal-card h2,html[data-theme="light"] .journal-card p,html[data-theme="light"] .journal-bottom,html[data-theme="light"] .journal-meta,html[data-theme="light"] .timeline-entry,html[data-theme="light"] .tl-body{color:#16212c!important}
html[data-theme="light"] .journal-card p,html[data-theme="light"] .journal-meta,html[data-theme="light"] .journal-bottom,html[data-theme="light"] .tl-date{color:#526477!important}
html[data-theme="light"] .timeline-entry{border-color:rgba(21,44,61,.13)!important;background:rgba(255,255,255,.82)!important}

/* YSJF-inspired 16-series rail controls stay visible and usable on desktop. */
html[data-theme="light"] .ysjf-series-nav{background:rgba(255,255,255,.94)!important;color:#1b3542!important;border-color:rgba(21,44,61,.18)!important;box-shadow:0 12px 34px rgba(45,63,78,.15)!important}
html[data-theme="light"] .ysjf-series-nav:hover{background:#eaf5f6!important;border-color:#8cbec7!important}
html[data-theme="light"] .ysjf-series-name{color:#405466!important}

/* Footer / empty / loader must follow the chosen theme too. */
html[data-theme="light"] .footer{background:#eef3f7!important;color:#465769!important;border-top-color:rgba(21,44,61,.12)!important}
html[data-theme="light"] .footer-logo{color:#16212c!important}
html[data-theme="light"] .footer-top p,html[data-theme="light"] .footer-bottom{color:#526477!important}
html[data-theme="light"] .empty,html[data-theme="light"] .editorial-empty,html[data-theme="light"] .loader-screen{background:transparent!important;color:#16212c!important}
html[data-theme="light"] .loader-mark{color:#16212c!important}.loader-mark span{color:var(--ui-accent)!important}

/* Theme toggle gives a clear state.  Moon in light mode = action to go dark. */
.theme-toggle[data-current-theme="light"]{background:rgba(255,255,255,.92)!important}
.theme-toggle[data-current-theme="dark"]{background:rgba(17,23,30,.90)!important}
html[data-theme="dark"] .theme-toggle[data-current-theme="dark"]{color:#eaf2f7!important}

@media(max-width:760px){
  html[data-theme="light"] .nav{background:rgba(249,251,252,.97)!important}
}
