/* SubMac — OLED dark theme (2026-11-13)
   True black page (#000), near-black surfaces for cards and bands, light ink, and
   the marker yellow as the only accent. Loaded last on every page, so it overrides
   audit.css and app.css without touching them. Resume/cover previews and template
   thumbnails stay white on purpose: they are paper documents, not UI. */

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #0b0d10;
  --line: #22262e;
  --field: #98a0ac;
  --mark: #ffe14d;
  --navy: #eef1f4;
  --btn-bg: #f3f1ea;
  --btn-fg: #0a0a0a;
  --panel: #0c121b;

  --paper: #000000;
  --paper-2: #0b0d10;
  --sheet: #0b0d10;
  --ink: #eef1f4;
  --ink-2: #b7bec8;
  --ink-3: #87909c;
  --ink-hover: #ffffff;
  --rule: #22262e;
  --rule-2: #262b34;
  --faint: #98a0ac;
  --tone: #0b0d10;
  --tone-2: #141922;
  --red: #ffe14d;
  --red-ink: #ffe14d;
  --red-wash: rgba(255, 225, 77, 0.16);
  --ok: #8fd2a1;
  --danger: #ff7a63;
  --shadow-card: 0 18px 40px -26px rgba(0, 0, 0, 0.9);
  --shadow-lift: 0 34px 50px -28px rgba(0, 0, 0, 0.9);
}

/* ---------- base ---------- */
html[data-theme="dark"] body { background: #000; color: var(--ink); }
html[data-theme="dark"] ::selection { background: var(--mark); color: #0a0a0a; }
html[data-theme="dark"] .display em { color: var(--mark); background: none; }
html[data-theme="dark"] mark { background: var(--mark); color: #0a0a0a; }

/* ---------- header, menu, account popup ---------- */
html[data-theme="dark"] .site-head { background: #000; border-bottom-color: var(--line); }
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .acct-pop { background: var(--sheet); border-color: var(--line); }
html[data-theme="dark"] .nav-foot { background: #000; }
html[data-theme="dark"] .nav-list a:hover,
html[data-theme="dark"] .nav-list a:focus-visible { background: #141922; color: var(--ink); }
html[data-theme="dark"] .acct-pop a:hover,
html[data-theme="dark"] .acct-pop button:hover { background: #141922; }

/* ---------- buttons ---------- */
html[data-theme="dark"] .btn:hover { color: #0a0a0a; }
html[data-theme="dark"] .btn-ghost { background: transparent; }
html[data-theme="dark"] .btn-ghost:hover { background: #141922; border-color: var(--ink); color: var(--ink); }
html[data-theme="dark"] .avatar:hover { color: #0a0a0a; }
html[data-theme="dark"] .cta-band .btn { color: #0a0a0a; }
html[data-theme="dark"] .cta-band .btn:hover { color: #0a0a0a; }
html[data-theme="dark"] .hs-form .btn:hover,
html[data-theme="dark"] .offer .btn:hover,
html[data-theme="dark"] .lock-panel .btn:hover { background: var(--mark); border-color: var(--mark); color: #0a0a0a; }

/* These CTAs sit on the marker yellow in both themes, so their label stays ink. */
html[data-theme="dark"] .offer .btn:not(.btn-ghost),
html[data-theme="dark"] .lock-panel .btn:not(.btn-ghost) { color: #0a0a0a; }

/* The score/progress track was white; give it a visible dark track. */
html[data-theme="dark"] .bar { background: #181d26; }

/* ---------- panels that were navy ---------- */
html[data-theme="dark"] .cta-band,
html[data-theme="dark"] .offer,
html[data-theme="dark"] .lock-panel,
html[data-theme="dark"] .tpl-zoom,
html[data-theme="dark"] .badge.live { background: var(--panel); color: #fff; }
html[data-theme="dark"] .hs-step { background: var(--mark); color: #0a0a0a; }
html[data-theme="dark"] .plan .flag { color: #0a0a0a; }

/* Accent blocks are light in this theme, so their text must be dark ink, not white.
   (In light mode these use a navy/ink background with white text.) */
html[data-theme="dark"] .avatar,
html[data-theme="dark"] .avatar:hover,
html[data-theme="dark"] .seg button[aria-pressed="true"],
html[data-theme="dark"] .hc-warn .hc-ico,
html[data-theme="dark"] .badge-new { color: #0a0a0a; }
html[data-theme="dark"] .hs-pill,
html[data-theme="dark"] .badge:not(.live) { color: #0a0a0a !important; }

/* ---------- cards and fields ---------- */
html[data-theme="dark"] .hs-form,
html[data-theme="dark"] .plan,
html[data-theme="dark"] .doc,
html[data-theme="dark"] .soon-col,
html[data-theme="dark"] .ft-score,
html[data-theme="dark"] .ft-cta,
html[data-theme="dark"] .hc,
html[data-theme="dark"] .acct-card,
html[data-theme="dark"] dialog { background: var(--sheet); }
html[data-theme="dark"] .hs-form,
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .acct-pop { border-color: var(--line); }
html[data-theme="dark"] .hs-form textarea,
html[data-theme="dark"] .hs-form textarea:focus,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .drop { background: #06080a; border-color: var(--rule-2); }
html[data-theme="dark"] .hs-form textarea::placeholder { color: var(--ink-3); }
html[data-theme="dark"] .hs-form::before { background: linear-gradient(90deg, #2a2410, rgba(255, 225, 77, 0.55) 55%, #2a2410); }
html[data-theme="dark"] .hs-form { box-shadow: 0 1px 0 var(--line), 0 30px 70px -50px rgba(0, 0, 0, 0.9); }

/* ---------- score ring ---------- */
html[data-theme="dark"] .sc-track { stroke: #1b2028; }
html[data-theme="dark"] .sc-ring[data-band="mid"] .sc-arc { stroke: #e0a53c; }

/* ---------- footer, tables ---------- */
html[data-theme="dark"] .site-foot { background: #000; border-top-color: var(--line); }
html[data-theme="dark"] .cmp th,
html[data-theme="dark"] .cmp td { border-color: var(--line); }
html[data-theme="dark"] .cmp thead th { background: var(--surface); }
html[data-theme="dark"] .cmp tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

/* ---------- account danger zone ---------- */
html[data-theme="dark"] .acct-danger { background: #140d0b; border-color: #3a1f19; }
html[data-theme="dark"] .acct-confirm { background: #0b0d10; border-color: #3a1f19; }
html[data-theme="dark"] .btn.btn-danger { color: #1a0b07; }
html[data-theme="dark"] .btn.btn-danger:hover { color: #1a0b07; }

/* ---------- dialogs ---------- */
html[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, 0.74); }

/* ---------- keep documents on paper ---------- */
html[data-theme="dark"] .page,
html[data-theme="dark"] .tpl-page,
html[data-theme="dark"] .tpl-big,
html[data-theme="dark"] .tpl-thumb,
html[data-theme="dark"] .tpl .mini { background: #fff; color: #1a1a1a; }

/* ---------- theme toggle (both themes) ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; flex: none;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--mark); border-color: var(--mark); color: #0a0a0a; }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="light"] .tt-sun { display: none; }
html[data-theme="dark"] .tt-moon { display: none; }
@media (max-width: 520px) { .theme-toggle { width: 38px; height: 38px; } }