/* Original presentation retained; appearance changes surface colors only. */
.appearance-settings h2{margin:0 0 6px}.appearance-settings p{margin:0 0 14px}.appearance-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:4px;border:1px solid var(--line);border-radius:12px;max-width:420px;background:#efefe6}.appearance-choices button{min-height:44px;padding:10px 12px;background:transparent;color:var(--ink);border:1px solid transparent;border-radius:8px;font-size:13px}.appearance-choices button[aria-pressed=true]{background:#fffef9;border-color:#dedfd4;box-shadow:0 1px 3px #203d3508}.appearance-settings .appearance-note{font-size:11px;margin:10px 0 0}
html[data-appearance=light]{color-scheme:light}
html[data-appearance=dark]{color-scheme:dark;--cream:#2e3026;--ink:#d7ddd2;--muted:#a1a797;--line:#494c40;--warm-line:#494c40;--panel:#30312b;--surface:#30312b;--soft-ink:#a1a797;background:#2e3026!important}
html[data-appearance=dark] body{background:#2e3026!important;color:var(--ink)!important}
html[data-appearance=dark] .card,html[data-appearance=dark] dialog,html[data-appearance=dark] .calm-details,html[data-appearance=dark] .calm-fold,html[data-appearance=dark] .web-workspace-panel,html[data-appearance=dark] .bell-dropdown,html[data-appearance=dark] .connection-details>div{background:#30312b!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-appearance=dark] .small,html[data-appearance=dark] .hint,html[data-appearance=dark] .eyebrow,html[data-appearance=dark] .stat-label{color:var(--muted)!important}
html[data-appearance=dark] .ghost,html[data-appearance=dark] input,html[data-appearance=dark] select,html[data-appearance=dark] textarea,html[data-appearance=dark] .web-workspace-panel .report-period select,html[data-appearance=dark] .web-workspace-panel .report-period input{background:#252720!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-appearance=dark] .metric-feature{background:#294f40!important;color:#f5f3e9!important}
html[data-appearance=dark] .metric-feature .small,html[data-appearance=dark] .metric-feature .stat-label{color:#c8d3c7!important}
html[data-appearance=dark] .text-link,html[data-appearance=dark] a{color:#c0a36b}
html[data-appearance=dark] .category-chart-list button,html[data-appearance=dark] .notification-bell>summary{background:transparent!important;color:var(--ink)!important}
html[data-appearance=dark] .tag,html[data-appearance=dark] .spatial-info,html[data-appearance=dark] #reportingMonthNotice,html[data-appearance=dark] .checkin-income{background:#393d30!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-appearance=dark] .spatial-stage{background:transparent}
html[data-appearance=dark] .appearance-choices{background:#252720;border-color:var(--line)}
html[data-appearance=dark] .appearance-choices button{color:var(--muted)}
html[data-appearance=dark] .appearance-choices button[aria-pressed=true]{background:#353b30;color:var(--ink);border-color:#68715c;box-shadow:none}

/* Preserve readable notice text in dark appearance. */
html[data-appearance=dark] .overview-notice{background:#30312b!important;color:#d7ddd2!important;border-color:#494c40!important}
html[data-appearance=dark] .overview-notice.red{background:#392f28!important;color:#e1a58c!important;border-color:#795844!important}
html[data-appearance=dark] .overview-notice.amber{background:#383529!important;color:#d1bd94!important}

/* Wallet faces have their own surfaces, outside the generic .card selector.
   Keep both sides and their controls on the same dark palette as the page;
   never put dark-mode ivory text onto the hard-coded light wallet face. */
html[data-appearance=dark] .wallet-face{background:var(--panel)!important;color:var(--ink)!important;border-color:var(--line)!important;box-shadow:none}
html[data-appearance=dark] .wallet-front h3{color:var(--ink)}
html[data-appearance=dark] .wallet-face .paid-toggle{background:#252720;color:var(--ink);border-color:var(--line)}
html[data-appearance=dark] .wallet-face .paid-toggle.is-paid{background:#294035;color:#d7ddd2;border-color:#526b57}
html[data-appearance=dark] .wallet-face .paid-toggle input{accent-color:#9eb6a4}
html[data-appearance=dark] .wallet-face .bar{background:#42473a}
html[data-appearance=dark] .wallet-bottom,html[data-appearance=dark] .credit-capacity,html[data-appearance=dark] .bank-card-status{border-color:var(--line)}
html[data-appearance=dark] .wallet-face .icon-btn,html[data-appearance=dark] .wallet-face .flip-btn{color:#c0c8b9}
html[data-appearance=dark] .wallet-face .debt-number{color:#d59b83}
html[data-appearance=dark] .wallet-face .cash-number{color:#8dc5d7}
html[data-appearance=dark] .wallet-tools .segmented{background:#252720;border-color:var(--line)}
html[data-appearance=dark] .wallet-tools .segmented button{color:#a1a797}
html[data-appearance=dark] .wallet-tools .segmented .selected{background:#353b30;color:var(--ink);box-shadow:none}

html[data-appearance=dark] #content section.debt-card{isolation:isolate;color-scheme:dark;background:none!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-appearance=dark] .debt-card .paid-toggle{background:#252720!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-appearance=dark] .debt-card .paid-toggle.is-paid{background:#294035!important;color:var(--ink)!important;border-color:#526b57!important}
html[data-appearance=dark] .debt-card .debt-number{color:#d59b83}
html[data-appearance=dark] .debt-card.settled .debt-number{color:#9eb6a4}
html[data-appearance=dark] .debt-card .bar{background:#42473a}

html[data-appearance=dark] .wallet-art-slot{background:#252720}

/* Follow the system palette during startup, before the saved choice is applied. */
@media (prefers-color-scheme: dark){
 html:not([data-appearance]){color-scheme:dark;--ink:#d7ddd2;--muted:#a1a797;--line:#494c40}
 html:not([data-appearance]) #content section.debt-card{background:none!important;color:var(--ink)!important;border-color:var(--line)!important}
 html:not([data-appearance]) #content section.debt-card .paid-toggle{background:#252720;color:var(--ink);border-color:var(--line)}
}


.debt-card[data-debt-appearance=dark] .tag{background:#393d30!important;color:var(--ink)!important;border-color:var(--line)!important}
.debt-card[data-debt-appearance=dark] .paid-toggle,.debt-card[data-debt-appearance=dark] .ghost{background:#252720!important;color:var(--ink)!important;border-color:var(--line)!important}
.debt-card[data-debt-appearance=dark] .paid-toggle.is-paid{background:#294035!important;border-color:#526b57!important}
.debt-card[data-debt-appearance=dark] .small{color:var(--muted)!important}

/* The debt grid uses the page surface in both appearance modes. */
#content .debt-wallet-grid > .debt-card,
#content .debt-wallet-grid > .debt-card :is(.paid-toggle,.ghost,.tag){background:none!important;background-image:none!important}
