.theme-toggle {
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  background: rgba(4,48,87,.24);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.theme-toggle:hover, .theme-toggle:focus-visible { border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.12); transform: translateY(-1px); }
.theme-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }

html[data-theme="dark"] {
  color-scheme: dark;
  --navy-950: #f1f6fb;
  --navy-900: #c2dced;
  --navy-800: #8bc9f2;
  --blue-700: #70b9e8;
  --blue-500: #458bb9;
  --blue-300: #254b68;
  --blue-100: #111d27;
  --surface: rgba(16, 25, 33, .96);
  --ink: #e8eef4;
  --muted: #a6b5c2;
  --shadow: 0 22px 55px rgba(0, 0, 0, .42);
  --image-dark-overlay: rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] body {
  color: var(--ink);
  background-color: #020508;
  background-image: linear-gradient(rgba(1,5,8,.74), rgba(1,5,8,.84)), url("/assets/images/legacy/bg_blue.jpg");
  background-repeat: no-repeat, repeat-x;
  background-position: top, top;
  background-size: 100% 100%, auto auto;
}
html[data-theme="dark"] #header,
html[data-theme="dark"] .masthead {
  background:
    linear-gradient(var(--image-dark-overlay), var(--image-dark-overlay)),
    url("/assets/images/legacy/header.png") center top / auto 160px no-repeat;
  background-blend-mode: multiply;
}
html[data-theme="dark"] .main-nav {
  border-color: rgba(142,190,222,.2);
  background: linear-gradient(180deg, rgba(9, 25, 39, 0.96) 0%, rgba(11, 31, 47, 0.96) 100%);
  box-shadow: 0 20px 45px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a:focus-visible,
html[data-theme="dark"] .main-nav a.active { background: rgba(119,190,235,.18); }
html[data-theme="dark"] .theme-toggle { background: rgba(0,0,0,.3); }

html[data-theme="dark"] .portal-top {
  background: linear-gradient(var(--image-dark-overlay), var(--image-dark-overlay)), url("/assets/images/legacy/main_top.png") center / 100% 100% no-repeat;
  background-blend-mode: multiply;
}
html[data-theme="dark"] .portal-surface {
  border-inline: 0;
  background:
    linear-gradient(var(--image-dark-overlay), var(--image-dark-overlay)), url("/assets/images/legacy/main_content_bg.png") center top / 100% 623px no-repeat,
    url("/assets/images/legacy/main_bg.jpg") center top / 100% auto repeat-y;
  background-blend-mode: multiply;
}
html[data-theme="dark"] .page-bottom-bg {
  background-color: transparent;
  background-image: linear-gradient(var(--image-dark-overlay), var(--image-dark-overlay)), url("/assets/images/legacy/bg_bottom.jpg");
  background-repeat: no-repeat, repeat-x;
  background-position: left bottom, left bottom;
  background-size: 100% 100%, auto 100%;
}
html[data-theme="dark"] .portal-footer {
  color: #dce7ef;
  background: none;
}
html[data-theme="dark"] .portal-footer::before {
  inset: 0;
  width: auto;
  background: linear-gradient(var(--image-dark-overlay), var(--image-dark-overlay)), url("/assets/images/legacy/main_footer.png") center top / 100% 100% no-repeat;
  background-blend-mode: multiply;
  -webkit-mask-image: none;
  mask-image: none;
}
html[data-theme="dark"] .portal-footer::after {
  display: none;
}

html[data-theme="dark"] .classic-welcome,
html[data-theme="dark"] .page-hero { border-color: #36546a; background: radial-gradient(circle at 80% 20%, rgba(50,116,157,.26), transparent 30%), linear-gradient(145deg, #152a39, #08131c 75%); }
html[data-theme="dark"] .classic-welcome p,
html[data-theme="dark"] .page-hero p { color: #c7d7e3; }
html[data-theme="dark"] .beni-editorial-feature,
html[data-theme="dark"] .legacy-tabs { border-color: #314959; background: #101920; }
html[data-theme="dark"] .beni-editorial-copy { background: linear-gradient(145deg, #102838, #07131c 73%, #02080d); }
html[data-theme="dark"] .legacy-tabs .TabbedPanelsTabGroup { background: linear-gradient(180deg, #0b1821, #050a0f); }
html[data-theme="dark"] .tabs-index-shadow {
  background-image: linear-gradient(rgba(5, 18, 30, 0.42), rgba(5, 18, 30, 0)),
    url("/assets/images/legacy/content_box_shadow.png");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% auto;
}
html[data-theme="dark"] .legacy-tabs .tabbed_panels_tab { color: #9eb8ca; }
html[data-theme="dark"] .legacy-tabs .TabbedPanelsContentGroup { background: #101920; }
html[data-theme="dark"] .legacy-tabs .tabbed_panels_tab[aria-selected="true"] { color: #f0f6fa; background: linear-gradient(90deg, #243b4b, #142631); }
html[data-theme="dark"] .legacy-tabs h2,
html[data-theme="dark"] .legacy-tabs p,
html[data-theme="dark"] .legacy-tab-story small { color: #bed0dc; }
html[data-theme="dark"] .legacy-tabs a { color: #82c9f2; }
html[data-theme="dark"] .legacy-tab-story { border-color: rgba(145,181,205,.16); }

html[data-theme="dark"] .content-card,
html[data-theme="dark"] .heritage-story,
html[data-theme="dark"] .portal-loading,
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .product-availability,
html[data-theme="dark"] .client-auth-panel,
html[data-theme="dark"] .client-loading,
html[data-theme="dark"] .client-empty-state,
html[data-theme="dark"] .client-account-strip,
html[data-theme="dark"] .client-data-section { color: #dfe8ef; border-color: #2d4658; background: #111a21; box-shadow: var(--shadow); }
html[data-theme="dark"] .content-card h3,
html[data-theme="dark"] .heritage-story h2,
html[data-theme="dark"] .timeline h3,
html[data-theme="dark"] .contact-form h2,
html[data-theme="dark"] .client-empty-state h2,
html[data-theme="dark"] .client-account-strip strong,
html[data-theme="dark"] .client-record-list h3,
html[data-theme="dark"] .client-document-table div strong,
html[data-theme="dark"] .client-document-table b,
html[data-theme="dark"] .client-note-list h3,
html[data-theme="dark"] .client-support-list summary { color: #edf4f9; }
html[data-theme="dark"] .content-card p,
html[data-theme="dark"] .heritage-story p,
html[data-theme="dark"] .timeline p,
html[data-theme="dark"] .story-body,
html[data-theme="dark"] .client-loading p,
html[data-theme="dark"] .client-empty-state p,
html[data-theme="dark"] .client-data-empty,
html[data-theme="dark"] .client-record-list p,
html[data-theme="dark"] .client-record-meta,
html[data-theme="dark"] .client-document-table article,
html[data-theme="dark"] .client-note-list p { color: #a9bbc8; }
html[data-theme="dark"] .timeline { border-color: #304756; }
html[data-theme="dark"] .timeline article { border-color: rgba(118,153,176,.18); }
html[data-theme="dark"] .story-detail footer { color: #dfe8ef; }

html[data-theme="dark"] .product-availability { background: linear-gradient(135deg, #16242e, #0c141a); }
html[data-theme="dark"] .product-availability > strong { color: #93c9ec; }
html[data-theme="dark"] .product-availability li { color: #d8e5ee; border-color: #304b5e; background: #0a1218; }
html[data-theme="dark"] .platform-icon { color: #6fc5f4; }
html[data-theme="dark"] .product-availability.compact { background: rgba(0,0,0,.22); }

html[data-theme="dark"] .contact-context { background: linear-gradient(145deg, #111f29, #050b10); }
html[data-theme="dark"] .contact-context p { color: #b5c7d3; }
html[data-theme="dark"] .form-grid label,
html[data-theme="dark"] .client-auth-panel form > label { color: #b5c9d7; }
html[data-theme="dark"] .form-grid input,
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .client-auth-panel form input:not([type="checkbox"]),
html[data-theme="dark"] .client-login-box input { color: #edf4f8; border-color: #3a5364; background: #070d12; }
html[data-theme="dark"] .form-grid input:focus,
html[data-theme="dark"] .form-grid textarea:focus { border-color: #5daee0; box-shadow: 0 0 0 3px rgba(56,145,201,.18); }

html[data-theme="dark"] .client-login-box {
  border-color: #304959;
  background: linear-gradient(180deg, #1a2d3a, #101920);
}
html[data-theme="dark"] .beni-shopping-box h2 { background: linear-gradient(#172630, #070d12); }
html[data-theme="dark"] .client-login-box label { color: #d7e7f2; }
html[data-theme="dark"] .client-login-box > a { color: #9fd6f6; }
html[data-theme="dark"] .expand-menu-header,
html[data-theme="dark"] .side-box h2,
html[data-theme="dark"] .classic-accordion .expand-menu-tab {
  background: linear-gradient(#203340, #111b22);
}
html[data-theme="dark"] .expand-menu-content,
html[data-theme="dark"] .side-box h2,
html[data-theme="dark"] .classic-accordion .expand-menu-tab .expand-menu-content { color: #dce8ef; }
html[data-theme="dark"] .classic-accordion .menu-right-link {
  background-color: #1a2a35;
  background-image: linear-gradient(180deg, #243845, #1a2a35 48%, #15232d);
}
html[data-theme="dark"] .classic-accordion .menu-right-link li a { color: #c5d5df; }
html[data-theme="dark"] .classic-accordion .menu-right-link li a:hover,
html[data-theme="dark"] .classic-accordion .menu-right-link li a:active,
html[data-theme="dark"] .classic-accordion .menu-right-link li a:focus-visible {
  color: #fff;
  background-color: #3a6f99;
}
html[data-theme="dark"] .shopping-content { color: #dce8ef; background: linear-gradient(180deg, #101920 68%, #070d12); }
html[data-theme="dark"] .beni-shopping-box p { color: #dce8ef; }
html[data-theme="dark"] .beni-shopping-box a { color: #7ccaf4; }
html[data-theme="dark"] .start-project-box > div { color: #c4d3dd; background: linear-gradient(135deg, #131e25, #0a1015); }

html[data-theme="dark"] .network-banner { color: #dce8ef; border-color: #315b76; background: linear-gradient(13deg, #172c3a 0 69%, #223e50 69% 100%); }
html[data-theme="dark"] .network-banner strong { color: #81c7ef; }
html[data-theme="dark"] .signal-card { border-color: #324d60; background: #324d60; }
html[data-theme="dark"] .signal-card div { background: linear-gradient(135deg, #182731, #0c141a); }
html[data-theme="dark"] .signal-card strong { color: #dfeaf1; }
html[data-theme="dark"] .signal-card span { color: #9eb2c0; }
html[data-theme="dark"] .insight-list { border-color: #304957; }
html[data-theme="dark"] .insight-list a { border-color: rgba(117,151,173,.2); }
html[data-theme="dark"] .insight-list a:hover { background: rgba(255,255,255,.04); }

html[data-theme="dark"] .client-auth-panel aside,
html[data-theme="dark"] .client-data-section > header { background: linear-gradient(145deg, #172b38, #09131a); }
html[data-theme="dark"] .client-account-strip div,
html[data-theme="dark"] .client-record-list article,
html[data-theme="dark"] .client-document-table article,
html[data-theme="dark"] .client-note-list article,
html[data-theme="dark"] .client-support-list details { border-color: rgba(112,147,170,.18); }
html[data-theme="dark"] .client-account-strip small,
html[data-theme="dark"] .client-record-list small,
html[data-theme="dark"] .client-document-table div small,
html[data-theme="dark"] .client-support-list summary span,
html[data-theme="dark"] .client-support-list summary time { color: #7fb7dc; }
html[data-theme="dark"] .client-message-thread article { background: #182d3a; }
html[data-theme="dark"] .client-message-thread article.from-client { background: #203846; }
html[data-theme="dark"] .client-message-thread small,
html[data-theme="dark"] .client-message-thread p { color: #c2d2dc; }

@media (max-width: 860px) {
  html[data-theme="dark"] .main-nav { background: linear-gradient(180deg, rgba(9, 25, 39, 0.98) 0%, rgba(11, 31, 47, 0.98) 100%); }
}
