/* White and light blue: shared tokens cover the shell, charts, dialogs and forms. */
html[data-theme="lightblue"],
html[data-layout="accountant"][data-theme="lightblue"] {
  color-scheme: light;
  --green: #216a9e; --lime: #c2e4fa; --paper: #f5faff;
  --ink: #15354f; --muted: #405d73; --line: #ccdeec;
  --accountant-surface: #ffffff; --accountant-raised: #edf6fd;
  --accountant-backdrop: #e8f3fb; --theme-button-ink: #ffffff;
  --theme-soft: #e9f5ff; --theme-soft-text: #265d83; --theme-tint: #f3f9fe;
  --theme-accent: #4794c8; --theme-accent-strong: #216a9e;
  --theme-bar: #94c6e8; --theme-empty: #d6e4ef; --theme-focus: #2179b6;
  --theme-dark-hover: #175785; --theme-chart-fill: #d5ecfc;
  --theme-side-text: #15354f; --theme-side-muted: #536e82;
  --theme-side-line: #ccdeec; --theme-side-tint: #e9f5ff;
  --theme-decoration: #81c2ee2b; --theme-shadow: #1f61851a; --theme-backdrop: #15354f80;
  --surface: #ffffff; --success: #246446; --warning: #875211; --danger: #a53929;
}

/* Complete color palettes. Layout, data and semantic warning/error states stay in their own stylesheets. */
html[data-theme="navy"] {
  --green: #152a45; --lime: #b8d8ff; --paper: #f1f5fa;
  --ink: #213650; --muted: #5b6e85; --line: #d9e2ed;
  --theme-soft: #eaf1fb; --theme-soft-text: #345776; --theme-tint: #f6f9fe;
  --theme-accent: #5c8fc7; --theme-accent-strong: #245b9d;
  --theme-bar: #afc9e8; --theme-empty: #dbe3ed; --theme-focus: #2d69ad;
  --theme-dark-hover: #234364; --theme-side-text: #f0f5fe;
  --theme-side-muted: #bccce0; --theme-side-line: #3a4e69;
  --theme-side-tint: #2c4260; --theme-chart-fill: #dceafa;
  --theme-decoration: #b8d8ff20; --theme-shadow: #152a4512; --theme-backdrop: #10213988;
}
html[data-theme="plum"] {
  --green: #34213f; --lime: #e5c8f2; --paper: #f7f3f9;
  --ink: #402a4a; --muted: #74617d; --line: #e5d9eb;
  --theme-soft: #f0e7f6; --theme-soft-text: #694378; --theme-tint: #fcf9fd;
  --theme-accent: #a77bb7; --theme-accent-strong: #794394;
  --theme-bar: #d4b8e0; --theme-empty: #e5dfe9; --theme-focus: #8a50a5;
  --theme-dark-hover: #52355f; --theme-side-text: #faf2ff;
  --theme-side-muted: #d8c2e2; --theme-side-line: #61496d;
  --theme-side-tint: #533d60; --theme-chart-fill: #eee0f5;
  --theme-decoration: #e5c8f220; --theme-shadow: #34213f12; --theme-backdrop: #2b173988;
}
html[data-theme="copper"] {
  --green: #292c32; --lime: #edc6a6; --paper: #f8f4ef;
  --ink: #35312e; --muted: #756659; --line: #e6ddd3;
  --theme-soft: #f3e7db; --theme-soft-text: #855029; --theme-tint: #fcf9f5;
  --theme-accent: #b77746; --theme-accent-strong: #955321;
  --theme-bar: #dec0a3; --theme-empty: #e5dfd8; --theme-focus: #a05b2b;
  --theme-dark-hover: #424146; --theme-side-text: #faf4ee;
  --theme-side-muted: #d0c1b5; --theme-side-line: #4b4947;
  --theme-side-tint: #48413c; --theme-chart-fill: #f1dfcd;
  --theme-decoration: #edc6a620; --theme-shadow: #292c3212; --theme-backdrop: #29242088;
}
html[data-theme="forest"] {
  --green: #19352e; --lime: #d7ed9d; --paper: #f5f5ee;
  --ink: #233e34; --muted: #647469; --line: #dfe3d7;
  --theme-soft: #e9eddc; --theme-soft-text: #56673d; --theme-tint: #f7f9f2;
  --theme-accent: #95ad71; --theme-accent-strong: #456442;
  --theme-bar: #d9e6ba; --theme-empty: #dce1d6; --theme-focus: #708652;
  --theme-dark-hover: #315244; --theme-side-text: #edf1df;
  --theme-side-muted: #b9cabd; --theme-side-line: #3c5146;
  --theme-side-tint: #385246; --theme-chart-fill: #e6efd5;
  --theme-decoration: #d7ed9d18; --theme-shadow: #18372d12; --theme-backdrop: #132d2588;
}

html[data-theme] { color-scheme: light; }
html[data-theme] aside { background: var(--green); color: var(--theme-side-text); }
html[data-theme] .brand small,
html[data-theme] .workspace small,
html[data-theme] .workspace > span,
html[data-theme] .side-bottom small,
html[data-theme] .mobile-navigation label { color: var(--theme-side-muted); }
html[data-theme] nav a { color: var(--theme-side-muted); }
html[data-theme] nav a:hover { color: var(--theme-side-text); background: var(--theme-side-tint); }
html[data-theme] nav a.active { background: var(--lime); color: var(--green); }
html[data-theme] .side-bottom { border-color: var(--theme-side-line); }
html[data-theme] .avatar { background: var(--theme-side-tint); color: var(--lime); }
html[data-theme] header i { color: var(--muted); }
html[data-theme] .eyebrow,
html[data-theme] .card small,
html[data-theme] .members,
html[data-theme] footer,
html[data-theme] .sales-detail-label { color: var(--muted); }
html[data-theme] button:hover { border-color: var(--theme-accent); background: var(--theme-soft); }
html[data-theme] .primary,
html[data-theme] .tabs button.active,
html[data-theme] .page-numbers button[aria-current="page"] {
  background: var(--green); border-color: var(--green); color: #fff;
}
html[data-theme] .primary:hover { background: var(--theme-dark-hover); border-color: var(--theme-dark-hover); }
html[data-theme] button:focus-visible,
html[data-theme] a:focus-visible,
html[data-theme] input:focus-visible,
html[data-theme] select:focus-visible,
html[data-theme] summary:focus-visible,
html[data-theme] #order-results:focus-visible { outline-color: var(--theme-focus); }
html[data-theme] input[type="checkbox"] { accent-color: var(--theme-accent-strong); }
html[data-theme] .demo,
html[data-theme] .notice,
html[data-theme] .sync-rules-notice {
  background: var(--theme-soft); color: var(--theme-soft-text); border-color: var(--line);
}
html[data-theme] .segmented { background: var(--theme-soft); }
html[data-theme] .segmented button { background: transparent; }
html[data-theme] .segmented button:hover { background: var(--theme-tint); }
html[data-theme] .segmented button.active { background: #fff; box-shadow: 0 1px 4px var(--theme-shadow); }
html[data-theme] .card.feature { background: var(--green); color: #fff; }
html[data-theme] .card.feature small,
html[data-theme] .card.feature p { color: var(--theme-side-muted); }
html[data-theme] .card.feature::after { color: var(--theme-decoration); }
html[data-theme] .textbutton { color: var(--theme-accent-strong); }
html[data-theme] .textbutton:hover { background: var(--theme-soft); }
html[data-theme] .bar { background: var(--theme-bar); }
html[data-theme] .barcol:last-child .bar { background: var(--theme-accent-strong); }
html[data-theme] .source,
html[data-theme] td,
html[data-theme] th { border-bottom-color: var(--line); }
html[data-theme] th { background: var(--theme-tint); color: var(--muted); }
html[data-theme] .track { background: var(--theme-soft); }
html[data-theme] .track > div { background: var(--theme-accent); }
html[data-theme] .badge:not(.warn):not(.error):not(.neutral) { background: var(--theme-soft); color: var(--theme-soft-text); }
html[data-theme] .badge.neutral { background: var(--theme-tint); color: var(--muted); }
html[data-theme] .subrow { color: var(--theme-soft-text); }
html[data-theme] dialog::backdrop { background: var(--theme-backdrop); }
html[data-theme] .payment-summary { background: var(--theme-tint); }
html[data-theme] .paydot { background: var(--theme-accent); }
html[data-theme] .paydot.card { background: var(--theme-accent-strong); }
html[data-theme] .paydot.cash { background: #b39252; }
html[data-theme] .gateway-origin code { background: var(--theme-soft); color: var(--theme-soft-text); }
html[data-theme] .order-payment { color: var(--theme-soft-text) !important; }
html[data-theme] .sync-rules-summary { border-left-color: var(--theme-accent); }

/* Shared chart tokens also support the hourly SVG without embedding a palette in its markup. */
html[data-theme] .sales-chart-scroll { scrollbar-color: var(--theme-accent) var(--theme-tint); }
html[data-theme] .sales-bar-button { background: transparent; }
html[data-theme] .sales-bar-button:hover,
html[data-theme] .sales-bar-button:focus-visible { background: var(--theme-soft); }
html[data-theme] .sales-bar-button:focus-visible,
html[data-theme] .sales-site-list:focus-visible,
html[data-theme] .sales-gateway-details > summary:focus-visible { outline-color: var(--theme-focus); }
html[data-theme] .sales-bar-track { border-color: var(--line); }
html[data-theme] .sales-bar-fill { background: var(--theme-bar); }
html[data-theme] .sales-bar-fill.is-empty { background: var(--theme-empty); }
html[data-theme] .sales-bar-button.is-selected .sales-bar-fill { background: var(--theme-accent-strong); }
html[data-theme] .sales-bar-button.is-selected .sales-bar-label { color: var(--theme-accent-strong); }
html[data-theme] .sales-chart-detail { background: var(--theme-tint); border-color: var(--line); }
html[data-theme] .sales-detail-columns,
html[data-theme] .sales-detail-columns li,
html[data-theme] .sales-gateway-details,
html[data-theme] .sales-gateway-details li { border-color: var(--line); }
html[data-theme] .sales-site-list { scrollbar-color: var(--theme-accent) var(--theme-tint); }
html[data-theme] .sales-detail-empty { color: var(--muted); }
html[data-theme] .sales-gateway-details > summary::marker { color: var(--theme-accent-strong); }

@media (max-width: 700px) {
  html[data-theme] .mobile-navigation select {
    color: var(--green); background: var(--theme-tint); border-color: var(--theme-accent);
  }
  html[data-theme] .order-table td:nth-child(2) { color: var(--muted); border-color: var(--line); }
  html[data-theme] .tablewrap tbody td.subrow { color: var(--theme-soft-text); border-left-color: var(--theme-bar); }
}

/* Natural light palettes keep dark text, white cards and muted accents. */
/* Soft gray */
html[data-theme="neutral"],
html[data-layout="accountant"][data-theme="neutral"] {
  color-scheme: light;
  --green: #4d5861; --lime: #dbe3e8; --paper: #f4f5f5;
  --ink: #263139; --muted: #526069; --line: #cfd7da;
  --accountant-surface: #ffffff; --accountant-raised: #eef1f2;
  --accountant-backdrop: #e7ebed; --theme-button-ink: #ffffff;
  --theme-soft: #e7ecef; --theme-soft-text: #3f515d; --theme-tint: #f7f8f8;
  --theme-accent: #687d89; --theme-accent-strong: #4d5861;
  --theme-bar: #acbdc6; --theme-empty: #dbe2e6; --theme-focus: #4d697b;
  --theme-dark-hover: #394852; --theme-chart-fill: #dee8ed;
  --theme-side-text: #ffffff; --theme-side-muted: #e1e8ed;
  --theme-side-line: #7c8c98; --theme-side-tint: #465e70;
  --theme-decoration: #8b9da32b; --theme-shadow: #26313916; --theme-backdrop: #26313980;
  --surface: #ffffff; --success: #2e6848; --warning: #7d5216; --danger: #9c382b;
  --theme-success-bg: #edf5ef; --theme-warning-bg: #fff4df; --theme-danger-bg: #fff2ef;
}
/* Warm sand */
html[data-theme="sand"],
html[data-layout="accountant"][data-theme="sand"] {
  color-scheme: light;
  --green: #7a5a3f; --lime: #eadcca; --paper: #f8f5ef;
  --ink: #3b342b; --muted: #695d50; --line: #d9cfc0;
  --accountant-surface: #ffffff; --accountant-raised: #f3eee5;
  --accountant-backdrop: #eee9df; --theme-button-ink: #ffffff;
  --theme-soft: #f1e9dc; --theme-soft-text: #664f38; --theme-tint: #fbf9f5;
  --theme-accent: #94745a; --theme-accent-strong: #7a5a3f;
  --theme-bar: #cbb396; --theme-empty: #e5dcd0; --theme-focus: #7a5a3f;
  --theme-dark-hover: #60432e; --theme-chart-fill: #efe0cd;
  --theme-side-text: #ffffff; --theme-side-muted: #eee4d8;
  --theme-side-line: #aa927b; --theme-side-tint: #715239;
  --theme-decoration: #bba1802b; --theme-shadow: #5d493216; --theme-backdrop: #3b342b80;
  --surface: #ffffff; --success: #2e6848; --warning: #7d5216; --danger: #9c382b;
  --theme-success-bg: #edf5ef; --theme-warning-bg: #fff4df; --theme-danger-bg: #fff2ef;
}
/* Soft sage */
html[data-theme="sage"],
html[data-layout="accountant"][data-theme="sage"] {
  color-scheme: light;
  --green: #4d6856; --lime: #dbe7d5; --paper: #f4f7f3;
  --ink: #2f3b32; --muted: #536454; --line: #cdd8c8;
  --accountant-surface: #ffffff; --accountant-raised: #edf2ea;
  --accountant-backdrop: #e4ece1; --theme-button-ink: #ffffff;
  --theme-soft: #e7eee3; --theme-soft-text: #3d5943; --theme-tint: #f8faf7;
  --theme-accent: #65846c; --theme-accent-strong: #4d6856;
  --theme-bar: #a6bf9e; --theme-empty: #d9e3d4; --theme-focus: #44654c;
  --theme-dark-hover: #395340; --theme-chart-fill: #dfebd9;
  --theme-side-text: #ffffff; --theme-side-muted: #e3ece1;
  --theme-side-line: #879e8c; --theme-side-tint: #405d47;
  --theme-decoration: #a1b6942b; --theme-shadow: #354b3716; --theme-backdrop: #2f3b3280;
  --surface: #ffffff; --success: #2e6848; --warning: #7d5216; --danger: #9c382b;
  --theme-success-bg: #edf5ef; --theme-warning-bg: #fff4df; --theme-danger-bg: #fff2ef;
}
/* Light slate */
html[data-theme="slate"],
html[data-layout="accountant"][data-theme="slate"] {
  color-scheme: light;
  --green: #4c657c; --lime: #d8e3ec; --paper: #f3f5f8;
  --ink: #293746; --muted: #536579; --line: #cdd6e0;
  --accountant-surface: #ffffff; --accountant-raised: #edf1f5;
  --accountant-backdrop: #e5eaf0; --theme-button-ink: #ffffff;
  --theme-soft: #e7edf4; --theme-soft-text: #405d75; --theme-tint: #f7f9fb;
  --theme-accent: #7189a0; --theme-accent-strong: #4c657c;
  --theme-bar: #a6b9cc; --theme-empty: #d8e1eb; --theme-focus: #476984;
  --theme-dark-hover: #354d65; --theme-chart-fill: #dce7f1;
  --theme-side-text: #ffffff; --theme-side-muted: #e2eaf3;
  --theme-side-line: #8a9dae; --theme-side-tint: #405b72;
  --theme-decoration: #91a7bd2b; --theme-shadow: #344c6516; --theme-backdrop: #29374680;
  --surface: #ffffff; --success: #2e6848; --warning: #7d5216; --danger: #9c382b;
  --theme-success-bg: #edf5ef; --theme-warning-bg: #fff4df; --theme-danger-bg: #fff2ef;
}

/* Light state colors outrank the later Accountant dark-shell fallbacks. */
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .accountant-app { box-shadow: 0 8px 34px var(--theme-shadow); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .accountant-top { background: linear-gradient(110deg, var(--accountant-surface), var(--theme-tint)); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .account-menu-items { box-shadow: 0 12px 30px var(--theme-shadow); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) input::placeholder { color: var(--muted); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .badge.warn { background: var(--theme-warning-bg); color: var(--warning); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .badge.error { background: var(--theme-danger-bg); color: var(--danger); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .badge.neutral { background: var(--accountant-raised); color: var(--muted); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .danger,
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) #formerror,
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) #payment-error { color: var(--danger); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .sync-rules-error { color: var(--danger); background: var(--theme-danger-bg); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .paydot { background: var(--theme-accent); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .paydot.card { background: var(--theme-accent-strong); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .paydot.cash { background: var(--warning); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .pull-info-site[data-pull-state="failed"] .pull-info-status { color: var(--danger); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .pull-info-site[data-pull-state="completed"] .pull-info-status { color: var(--success); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .date-report-error { border-left-color: var(--danger); background: var(--theme-danger-bg); color: var(--danger); }
html[data-layout="accountant"]:is([data-theme="neutral"], [data-theme="sand"], [data-theme="sage"], [data-theme="slate"]) .date-report-coverage-warning { border-color: var(--warning); background: var(--theme-warning-bg); color: var(--warning); }
