:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8efeb;
  --muted: #a0aea7;
  --green: #48a788;
  --green-dark: #3b9274;
  --mint: #203a30;
  --line: #2b3c34;
  --paper: #18251f;
  --bg: #101914;
  --gold: #f2c875;
  --red: #ee8977;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .login-shell { background: radial-gradient(ellipse at 52% 43%, #1b2922 2%, #141f19 56%, #101914 100%); }
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .statement-card,
:root[data-theme="dark"] .add-btn,
:root[data-theme="dark"] .date-chip,
:root[data-theme="dark"] .modal-card { background: var(--paper); border-color: var(--line); }
:root[data-theme="dark"] .brand-mark { color: var(--ink); }
:root[data-theme="dark"] .input-wrap,
:root[data-theme="dark"] .modal-card input,
:root[data-theme="dark"] .sign-choice { background: #142019; border-color: #34473d; color: var(--ink); }
:root[data-theme="dark"] .input-wrap input { color: var(--ink); }
:root[data-theme="dark"] .input-wrap input::placeholder,
:root[data-theme="dark"] .modal-card input::placeholder { color: #87978e; }
:root[data-theme="dark"] .statement-header { background: #1b2922; color: #a0aea7; border-color: var(--line); }
:root[data-theme="dark"] .entry-row { border-color: #25352d; }
:root[data-theme="dark"] .entry-date,
:root[data-theme="dark"] .entry-type,
:root[data-theme="dark"] .subheading,
:root[data-theme="dark"] .modal-copy { color: #a0aea7; }
:root[data-theme="dark"] .avatar,
:root[data-theme="dark"] .modal-symbol { background: #254638; color: #9bd1b9; }
:root[data-theme="dark"] .icon-button { color: #b2c0b8; }
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .add-btn:hover { background: #23372d; color: #dce9e2; }
:root[data-theme="dark"] .entry-icon.positive { background: #203c30; color: #7ac4a1; }
:root[data-theme="dark"] .entry-icon.negative { background: #432c28; color: #ee9a87; }
:root[data-theme="dark"] .sign-choice.selected[data-sign="1"] { background: #203c30; border-color: #376650; color: #91d2b3; }
:root[data-theme="dark"] .sign-choice.selected[data-sign="-1"] { background: #432c28; border-color: #704239; color: #f0a18e; }
:root[data-theme="dark"] .login-footer,
:root[data-theme="dark"] .secure-note,
:root[data-theme="dark"] .statement-foot,
:root[data-theme="dark"] .app-footer { color: #89988f; }
:root[data-theme="dark"] .eyebrow { color: #9aa9a0; }
:root[data-theme="dark"] .login-copy,
:root[data-theme="dark"] .login-form label,
:root[data-theme="dark"] .modal-card label,
:root[data-theme="dark"] .user-pill,
:root[data-theme="dark"] .date-chip { color: #b5c2ba; }
:root[data-theme="dark"] .empty-state p { color: #a0aea7; }
:root[data-theme="dark"] .text-button { color: #87c9a9; }
:root[data-theme="dark"] .entry-amount.positive { color: #70c69b; }
:root[data-theme="dark"] .entry-amount.negative { color: #ed927e; }
:root[data-theme="dark"] .delete-entry { color: #9eaea4; }
:root[data-theme="dark"] .empty-icon { background: #203a30; color: #92c9ac; }
:root[data-theme="dark"] .secure-note span,
:root[data-theme="dark"] .statement-foot .secure-dot { color: #73c3a0; background-color: #73c3a0; }

.topbar-right { gap: 10px; }
.theme-toggle { width: 58px; height: 34px; flex: none; padding: 0 7px; display: inline-flex; align-items: center; justify-content: space-between; gap: 5px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: #68776f; }
.theme-toggle:hover { border-color: #a9cbb9; }
.theme-toggle-glyph { width: 14px; font-size: 14px; line-height: 1; text-align: center; }
.theme-toggle-track { width: 25px; height: 15px; padding: 2px; display: block; border-radius: 10px; background: #dce4df; transition: background .18s ease; }
.theme-toggle-track span { width: 11px; height: 11px; display: block; border-radius: 50%; background: white; box-shadow: 0 1px 2px #14231e30; transition: transform .18s ease; }
:root[data-theme="dark"] .theme-toggle { color: #e9d18e; }
:root[data-theme="dark"] .theme-toggle-track { background: #368467; }
:root[data-theme="dark"] .theme-toggle-track span { transform: translateX(10px); }
@media(max-width:600px) { .topbar-right { gap: 7px; } .theme-toggle { width: 54px; padding: 0 6px; } }
