/* Theme tokens also power the miniature previews in Settings. */
:root, [data-palette="dark-red"] {
  color-scheme: light;
  --accent: #be123c;
  --accent-hover: #be123c;
  --accent-soft: #fce7e7;
  --accent-border: #f87171;
  --on-accent: #ffffff;
  --ink: #302322;
  --muted: #6d4440;
  --line: #efcbcb;
  --bg: #fff5f5;
  --surface: #ffffff;
  --surface-alt: #fff1f1;
  --shade-one: #fce7e7;
  --shade-two: #ffeded;
  --shade-three: #fbdcdc;
  --chrome-bg: #7f1d1d;
  --chrome-ink: #ffffff;
  --chrome-muted: #fce7e7;
  --chrome-active: #be123c;
  --chrome-line: #c55c65;
  --success: #356850;
  --success-soft: #eaf3ed;
  --danger: #a23443;
  --danger-soft: #fcecee;
  --shadow: 0 3px 16px #53263205;
  --white: var(--surface);
  --button-bg: var(--accent);
  --button-hover: var(--accent-hover);
}

:root[data-theme="dark-red"], [data-palette="dark-red"] {
  --button-bg: #e11d48;
}

:root[data-theme="crimson"], [data-palette="crimson"] {
  --accent: #be123c;
  --button-bg: #e11d48;
  --accent-hover: #be123c;
  --accent-soft: #ffe4e6;
  --accent-border: #fb7185;
  --ink: #34202a;
  --muted: #734252;
  --line: #f2c4ce;
  --bg: #fff3f6;
  --surface-alt: #fff0f4;
  --shade-one: #ffe4e6;
  --shade-two: #ffedf2;
  --shade-three: #ffdae5;
  --chrome-bg: #9f1239;
  --chrome-muted: #ffe4e6;
  --chrome-active: #e11d48;
  --chrome-line: #fb7185;
}

:root[data-theme="ruby"], [data-palette="ruby"] {
  --accent: #d90429;
  --accent-hover: #b91c1c;
  --accent-soft: #fde2e4;
  --accent-border: #f43f5e;
  --ink: #351f23;
  --muted: #71464c;
  --line: #efc4c9;
  --bg: #fff4f4;
  --surface-alt: #fff0f1;
  --shade-one: #fde2e4;
  --shade-two: #ffecee;
  --shade-three: #fbd5db;
  --chrome-bg: #8b1010;
  --chrome-muted: #fde2e4;
  --chrome-active: #d90429;
  --chrome-line: #d96b79;
}

:root[data-theme="wine"], [data-palette="wine"] {
  --accent: #9d174d;
  --accent-hover: #831843;
  --accent-soft: #f9e6ea;
  --accent-border: #be185d;
  --ink: #33202c;
  --muted: #71435d;
  --line: #e8c5d5;
  --bg: #fcf3f8;
  --surface-alt: #fbeef5;
  --shade-one: #f9e6ea;
  --shade-two: #f9edf3;
  --shade-three: #f3dae6;
  --chrome-bg: #500724;
  --chrome-muted: #f9e6ea;
  --chrome-active: #831843;
  --chrome-line: #bb6288;
}

:root[data-theme="black"], [data-palette="black"] {
  color-scheme: dark;
  --accent: #36dbf5;
  --accent-hover: #a5f3fc;
  --accent-soft: #183e49;
  --accent-border: #3f6d79;
  --on-accent: #083344;
  --ink: #f8fafc;
  --muted: #b5d3eb;
  --line: #2d4d67;
  --bg: #0b1d30;
  --surface: #152c42;
  --surface-alt: #1b354f;
  --shade-one: #17364f;
  --shade-two: #1a314c;
  --shade-three: #173d42;
  --success: #95efc4;
  --success-soft: #173c3c;
  --danger: #ffabb8;
  --danger-soft: #382a3c;
  --shadow: 0 3px 16px #00000012;
  --chrome-bg: #0b1e31;
  --chrome-ink: #ffffff;
  --chrome-muted: #d2e4f7;
  --chrome-active: #0e4567;
  --chrome-line: #2d526d;
}

:root[data-theme="white"], [data-palette="white"] {
  --accent: #2459cb;
  --accent-hover: #1943a1;
  --accent-soft: #edf4ff;
  --accent-border: #b2c8f5;
  --ink: #17253a;
  --muted: #506077;
  --line: #d7e1ef;
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-alt: #f0f5fc;
  --shade-one: #e6efff;
  --shade-two: #eef3fc;
  --shade-three: #e2f1fa;
  --chrome-bg: #263850;
  --chrome-ink: #ffffff;
  --chrome-muted: #dce8f7;
  --chrome-active: #3c5779;
  --chrome-line: #7390b2;
}

:root[data-theme="blue"], [data-palette="blue"] {
  --accent: #2353d6;
  --accent-hover: #193ea9;
  --accent-soft: #eaf1ff;
  --accent-border: #a9c1ff;
  --ink: #14284c;
  --muted: #445d81;
  --line: #c2d4fa;
  --bg: #edf3ff;
  --surface: #ffffff;
  --surface-alt: #eef4ff;
  --shade-one: #d5e4ff;
  --shade-two: #e1ebff;
  --shade-three: #dceaff;
  --chrome-bg: #1946bb;
  --chrome-ink: #ffffff;
  --chrome-muted: #e1eaff;
  --chrome-active: #3062e0;
  --chrome-line: #7899ec;
}

:root[data-theme="aqua"], [data-palette="aqua"] {
  --accent: #087988;
  --accent-hover: #056170;
  --accent-soft: #e1fbff;
  --accent-border: #89d8e4;
  --ink: #12373e;
  --muted: #3b646e;
  --line: #b2e3eb;
  --bg: #eafbff;
  --surface: #ffffff;
  --surface-alt: #edfcff;
  --shade-one: #bfeef4;
  --shade-two: #d8f7fc;
  --shade-three: #c9f2ef;
  --chrome-bg: #096779;
  --chrome-ink: #ffffff;
  --chrome-muted: #ddfbff;
  --chrome-active: #0d7f90;
  --chrome-line: #62bdca;
}

:root[data-theme="lime"], [data-palette="lime"] {
  --on-accent: #213408;
  --accent: #426710;
  --accent-hover: #34520b;
  --accent-soft: #effcdb;
  --accent-border: #b6dc82;
  --ink: #243715;
  --muted: #50643c;
  --line: #cbe7a8;
  --bg: #f4fce8;
  --surface: #ffffff;
  --surface-alt: #f3fbe9;
  --shade-one: #d9f5ae;
  --shade-two: #e9facf;
  --shade-three: #def3bd;
  --chrome-bg: #3e6519;
  --chrome-ink: #ffffff;
  --chrome-muted: #edffd7;
  --chrome-active: #527d20;
  --chrome-line: #9fca66;
  --button-bg: #bef264;
  --button-hover: #a3e635;
}

:root[data-theme="yellow"], [data-palette="yellow"] {
  --on-accent: #422b00;
  --accent: #8a5000;
  --accent-hover: #6d3e00;
  --accent-soft: #fff7ce;
  --accent-border: #e6c85b;
  --ink: #3b2c10;
  --muted: #705b2b;
  --line: #ecda96;
  --bg: #fff9e3;
  --surface: #ffffff;
  --surface-alt: #fff9e5;
  --shade-one: #fff0a0;
  --shade-two: #fff5bf;
  --shade-three: #ffe9aa;
  --chrome-bg: #855008;
  --chrome-ink: #ffffff;
  --chrome-muted: #fff3d0;
  --chrome-active: #a3680c;
  --chrome-line: #d2a750;
  --button-bg: #facc15;
  --button-hover: #eab308;
}

/* Every surface uses a token, including dark-mode inputs and feedback. */
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.sidebar {
  background: var(--chrome-bg);
  color: var(--chrome-ink);
  border-color: var(--chrome-line);
  padding: 30px 18px;
}
.brand { color: var(--chrome-ink); }
.brand-icon {
  background: var(--chrome-ink);
  color: var(--chrome-bg);
  width: 42px;
  height: 42px;
  border-radius: 13px;
}
.sidebar-label { color: var(--chrome-muted); }
.sidebar nav { gap: 7px; }
.sidebar nav a {
  color: var(--chrome-muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 12px;
}
.sidebar nav a:hover,
.sidebar nav a[aria-current] {
  background: var(--chrome-active);
  border-color: var(--chrome-line);
  color: var(--chrome-ink);
}
.sidebar nav a[aria-current] { font-weight: 700; }
.sidebar-bottom { border-top: 1px solid var(--chrome-line); }
.sidebar-bottom small, .sidebar-bottom a, .sidebar .text-button { color: var(--chrome-muted); }
.topbar {
  background: var(--chrome-bg);
  color: var(--chrome-muted);
  border-color: var(--chrome-line);
  gap: 18px;
}
.theme-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  background: var(--chrome-active);
  color: var(--chrome-ink);
  border: 1px solid var(--chrome-line);
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
}
.topbar .text-button { color: var(--chrome-ink); }
.sidebar :focus-visible, .topbar :focus-visible { outline-color: var(--chrome-ink); }
.palette-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chrome-ink); }
.page-heading { margin-bottom: 28px; }
.eyebrow { color: var(--accent); }
.button {
  background: var(--button-bg);
  border-color: var(--accent);
  color: var(--on-accent);
  border-radius: 9px;
  min-height: 42px;
}
.button:hover { background: var(--button-hover); filter: none; }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--surface-alt); border-color: var(--accent-border); }
.balance-card {
  background: var(--shade-one);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 25px;
  box-shadow: var(--shadow);
}
.balance-card:nth-child(3n + 2) { background: var(--shade-two); }
.balance-card:nth-child(3n) { background: var(--shade-three); }
.card-label { color: var(--muted); font-weight: 550; margin-bottom: 23px; }
.balance-value { color: var(--ink); font-size: 29px; }
.balance-value small, .secondary-value { color: var(--muted); }
.tag { color: var(--accent); background: var(--surface); border: 1px solid var(--accent-border); border-radius: 6px; }
.summary-strip {
  background: var(--shade-two);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 25px;
  gap: 25px;
}
.summary-strip > div, .summary-strip > a { flex: 1; border-color: var(--line); }
.summary-strip > :last-child { border-right: 0; padding-right: 0; }
.summary-strip small, .metrics small { color: var(--muted); }
.summary-strip strong { color: var(--ink); }
.summary-strip > a strong { color: var(--accent); }
.panel { background: var(--surface); border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metrics { border-color: var(--line); gap: 12px; }
.metrics > div { background: var(--surface-alt); padding: 17px; border-radius: 10px; }
.metrics > div:nth-child(2n) { background: var(--shade-three); }
.positive { color: var(--success); }
.muted, dt, .helptext { color: var(--muted); }
input, select, textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); }
.line-row { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; }
.form-footer { border-color: var(--line); }
.errorlist { color: var(--danger); }
.notice { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); border-radius: 0 9px 9px 0; }
.alert { color: var(--success); background: var(--success-soft); border-color: var(--line); }
.alert.error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
th { color: var(--muted); background: var(--surface-alt); border-color: var(--line); }
td { border-color: var(--line); }
td small { color: var(--muted); }
tbody tr:hover { background: var(--surface-alt); }
.empty { color: var(--muted); }
.choice-card { color: var(--ink); background: var(--surface); border-color: var(--line); border-radius: 13px; }
.choice-card:nth-child(3n + 1) { background: var(--shade-one); }
.choice-card:nth-child(3n + 2) { background: var(--shade-two); }
.choice-card:nth-child(3n) { background: var(--shade-three); }
.choice-card:hover { border-color: var(--accent); }
.choice-card span { color: var(--accent); }
.choice-card p { color: var(--muted); }
.login-card { background: var(--surface); border-color: var(--line); border-radius: 18px; box-shadow: var(--shadow); }
footer { color: var(--muted); }

.history-filters { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto; gap: 14px; align-items: end; }
.history-filters > div { min-width: 0; }
.history-filters label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.history-filters input, .history-filters select { width: 100%; min-height: 43px; }
.history-filters .button { min-height: 43px; }
.history-filters > .errorlist { grid-column: 1 / -1; }
.branch-balance-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.branch-actions { margin: 24px 0 18px; }

/* One scoped financial overview, used exclusively on warehouse pages. */
.warehouse-overview { padding: 28px; border-top: 4px solid var(--accent); scroll-margin-top: 20px; }
.overview-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.overview-heading h2 { font-size: 24px; margin-bottom: 8px; }
.overview-heading p:last-child { margin-bottom: 0; }
.overview-date { background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent); border-radius: 7px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.overview-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 20px; margin: 24px 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.overview-filters > div { min-width: 0; }
.overview-filters label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.overview-filters input, .overview-filters select { width: 100%; min-height: 43px; }
.overview-filters .button { min-height: 43px; }
.overview-scope { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.overview-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.overview-metric { min-width: 0; padding: 22px; border: 1px solid var(--accent-border); border-radius: 12px; background: var(--shade-one); }
.overview-metric:nth-child(2) { background: var(--shade-two); }
.overview-metric h3 { margin: 0 0 20px; font-size: 13px; font-weight: 600; }
.overview-amount { margin: 0 0 10px; font-size: clamp(22px, 2.1vw, 30px); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-amount span { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.overview-metric small { display: block; margin-top: 18px; color: var(--muted); font-size: 11px; }
.overview-metric.overview-total { background: var(--chrome-bg); border-color: var(--chrome-bg); color: var(--chrome-ink); }
.overview-total small, .overview-total .overview-amount span { color: var(--chrome-muted); }
.overview-advance { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0 12px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); font-size: 12px; }
.overview-advance small { display: block; margin-top: 4px; color: var(--muted); }
.overview-advance span { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.overview-note { color: var(--muted); font-size: 12px; margin: 0 0 20px; max-width: 900px; }
.overview-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.overview-details summary { padding: 14px 18px; background: var(--surface-alt); font-weight: 600; cursor: pointer; }
.overview-details summary span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }
.overview-details .table-wrap { margin: 0; }
.overview-details table { margin: 0; }

/* Settings: live palette choices with a small preview of the actual layout. */
.design-panel { padding: 28px; scroll-margin-top: 24px; }
.design-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.design-heading h2 { font-size: 23px; margin-bottom: 8px; }
.design-heading p:last-child { margin: 0; }
.design-heading .button { flex-shrink: 0; }
.theme-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.theme-choice {
  appearance: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.theme-choice:hover { border-color: var(--accent-border); background: var(--surface-alt); }
.theme-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.theme-preview {
  display: grid;
  grid-template-columns: 25% 1fr;
  height: 108px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  pointer-events: none;
}
.preview-nav { display: flex; flex-direction: column; gap: 7px; padding: 12px 8px; background: var(--chrome-bg); border-right: 1px solid var(--chrome-line); }
.preview-logo { display: block; width: 15px; height: 15px; border-radius: 5px; background: var(--chrome-ink); margin-bottom: 3px; }
.preview-nav i { display: block; height: 4px; border-radius: 3px; background: var(--chrome-line); }
.preview-nav i:first-of-type { background: var(--chrome-ink); }
.preview-main { position: relative; display: flex; flex-direction: column; padding: 22px 11px 8px; gap: 8px; }
.preview-main::before { content: ''; position: absolute; inset: 0 0 auto; height: 11px; background: var(--chrome-bg); }
.preview-title { width: 55%; height: 5px; border-radius: 3px; background: var(--accent); }
.preview-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preview-cards i { display: block; height: 27px; background: var(--shade-one); border: 1px solid var(--line); border-radius: 4px; }
.preview-cards i:last-child { background: var(--shade-two); }
.preview-table { display: flex; flex-direction: column; gap: 5px; padding: 7px; background: var(--surface); border-radius: 4px; }
.preview-table i { height: 3px; background: var(--line); border-radius: 3px; }
.theme-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 4px 5px; }
.theme-caption strong { font-size: 13px; font-weight: 650; }
.theme-caption small { display: block; font-size: 10px; line-height: 1.5; color: var(--muted); margin-top: 3px; }
.theme-check { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; border: 1px solid var(--line); color: transparent; flex-shrink: 0; }
.theme-choice[aria-pressed="true"] .theme-check { color: var(--on-accent); background: var(--button-bg); border-color: var(--accent); }
.design-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; }
.design-footer p { margin: 0; }
.theme-status { color: var(--accent); font-weight: 550; }
.settings-management { margin-top: 36px; }
.settings-management > h2 { margin-bottom: 14px; }

@media (max-width: 1100px) {
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics { gap: 10px; }
  .metrics strong { font-size: 20px; }
}
@media (max-width: 720px) {
  .history-filters { gap: 12px; }
  .panel:not(.design-panel) { overflow-x: auto; }
  .sidebar { padding: 16px; }
  .sidebar nav a { padding: 8px 11px; }
  .topbar { gap: 9px; padding: 0 16px; }
  .topbar > span:first-child { display: none; }
  .theme-shortcut { margin-left: auto; font-size: 10px; padding: 5px 9px; }
  .balance-card { padding: 22px; }
  .balance-value { font-size: 27px; }
  .summary-strip { padding: 20px; gap: 20px; }
  .summary-strip > div, .summary-strip > a { min-width: 125px; padding-right: 10px; }
  .metrics > div { padding: 12px; }
  .metrics strong { font-size: 18px; }
  .design-panel { padding: 18px; }
  .design-heading { flex-direction: column; gap: 14px; }
  .design-heading h2 { font-size: 21px; }
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .theme-preview { height: 100px; }
  .theme-caption { gap: 5px; padding: 10px 2px 4px; }
  .theme-caption small { font-size: 10px; }
  .theme-check { width: 20px; height: 20px; }
  .preview-main { padding: 22px 8px 8px; }
  .preview-nav { padding: 12px 6px; }
  .warehouse-overview { padding: 18px; }
  .overview-heading { flex-direction: column; gap: 12px; }
  .overview-heading h2 { font-size: 22px; }
  .overview-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 12px; }
  .overview-filters > div:first-child { grid-column: 1 / -1; }
  .overview-filters .button { grid-column: 1 / -1; }
  .overview-metric { padding: 20px; }
  .overview-amount { font-size: 27px; }
}
.transaction-amount { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transaction-products { margin-top: 10px; min-width: 180px; }
.transaction-products summary, .revision-entry summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.transaction-products > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.history-actions { display: grid; gap: 10px; }
.revision-entry { padding: 18px 0; border-top: 1px solid var(--line); }
.revision-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.revision-comparison > div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.revision-values { margin: 0; }
.revision-values > div { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.revision-values dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.revision-values dd { margin: 0; }
@media (max-width: 640px) { .revision-comparison { grid-template-columns: 1fr; } }
/* Comfortable reading sizes and touch targets across every palette. */
body { font-size: 17px; line-height: 1.6; }
h1 { font-size: clamp(30px, 2.7vw, 38px); letter-spacing: -.6px; }
h2, .design-heading h2, .overview-heading h2 { font-size: 25px; }
h3 { font-size: 20px; }
small, td small, .helptext, .errorlist, footer, .eyebrow, .tag,
.branch-balance-note, .overview-date, .overview-scope, .overview-amount span,
.overview-metric small, .overview-advance, .overview-note,
.overview-details summary span, .revision-values dt, .details dt, .design-footer { font-size: 14px; }
label, .filters label, .history-filters label, .overview-filters label,
.card-label, .overview-metric h3 { font-size: 16px; font-weight: 600; }
input, select, textarea { font-size: 17px; min-height: 50px; padding: 12px 14px; }
input[type=checkbox] { width: 22px; min-height: 22px; }
.button, .button.large { font-size: 16px; min-height: 50px; padding: 12px 20px; }
.button.secondary { background: var(--surface); }
.button.secondary:hover { background: var(--surface-alt); }
.balance-value, .overview-amount { font-size: clamp(30px, 2.8vw, 38px); }
.balance-value small, .secondary-value small { font-size: 15px; }
.secondary-value { font-size: 23px; }
.metrics strong, .summary-strip strong { font-size: 27px; }
table { font-size: 16px; }
th { font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 700; padding: 16px; }
td { padding: 19px 16px; }
td strong { font-weight: 650; }
.choice-card span { font-size: 16px; }
.login-card { max-width: 480px; }
.login-card h1 { font-size: 30px; }
.sidebar { width: 292px; padding: 26px 18px; overflow: hidden; }
main { margin-left: 292px; }
.auth-main { margin-left: 0; }
.brand { font-size: 28px; }
.sidebar-label { font-size: 12px; margin: 28px 12px 14px; }
.sidebar nav { gap: 6px; flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
.sidebar .brand, .sidebar-label { flex-shrink: 0; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px; font-size: 16px; min-height: 50px; color: var(--chrome-ink); }
.ui-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.sidebar-bottom { padding: 16px 0 0; gap: 8px; margin-top: 18px; flex-shrink: 0; }
.account-profile { display: flex; align-items: center; gap: 12px; padding: 8px 10px 14px; }
.account-profile > div { min-width: 0; }
.account-profile strong { display: block; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.account-profile small { display: block; font-size: 14px; margin-top: 5px; }
.account-avatar { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 15px; background: var(--chrome-active); border: 1px solid var(--chrome-line); }
.account-action { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: 16px; cursor: pointer; background: transparent; color: var(--chrome-ink); }
.sidebar-bottom a { color: var(--chrome-ink); }
.account-action:hover { background: var(--chrome-active); border-color: var(--chrome-line); text-decoration: none; }
.account-logout { background: var(--chrome-active); border-color: var(--chrome-line); }
.topbar { min-height: 76px; height: auto; padding: 14px 30px; font-size: 15px; }
.theme-shortcut { font-size: 14px; min-height: 44px; padding: 9px 14px; }
.content { padding: 34px 30px; }
.history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.history-filters input, .history-filters select, .history-filters .button,
.overview-filters input, .overview-filters select, .overview-filters .button { min-height: 50px; }
.theme-options { grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); }
.theme-caption strong { font-size: 18px; }
.theme-caption small { font-size: 14px; }
.theme-caption { align-items: flex-start; }
.theme-check { margin-top: 4px; }
.theme-preview { height: 125px; }
@media (min-width: 721px) and (max-height: 840px) {
  .sidebar-bottom { margin-top: 24px; }
}
@media (max-width: 1100px) {
  .sidebar { width: 270px; padding: 22px 12px; }
  main { margin-left: 270px; }
  .auth-main { margin-left: 0; }
  .content { padding: 28px 22px; }
  .topbar { padding: 14px 22px; flex-wrap: wrap; }
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: 100%; padding: 18px 16px; overflow: visible; }
  .sidebar .brand { font-size: 26px; }
  .sidebar nav a { font-size: 16px; padding: 11px 14px; }
  .sidebar-bottom { display: grid; margin-top: 18px; padding-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-profile { grid-column: 1 / -1; padding-bottom: 6px; }
  .account-action { height: 100%; font-size: 15px; padding: 10px; gap: 8px; }
  .account-action .ui-icon { width: 20px; height: 20px; flex-basis: 20px; }
  main { margin-left: 0; }
  .topbar { padding: 12px 16px; gap: 12px; font-size: 14px; }
  .theme-shortcut { font-size: 14px; margin-left: auto; }
  .content { padding: 26px 16px; }
  .panel { padding: 18px; }
  .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-caption strong { font-size: 17px; }
  .theme-caption small { font-size: 13px; }
  .theme-preview { height: 100px; }
  .overview-heading, .design-heading { flex-direction: column; }
  .form-footer { align-items: stretch; }
  .form-footer .button { white-space: normal; }
}
/* Shared workspace design: every surface follows the selected palette. */
.sidebar, .topbar { background: linear-gradient(120deg, var(--chrome-bg), color-mix(in srgb, var(--chrome-bg) 94%, var(--chrome-active))); }
.sidebar nav a { position: relative; border-radius: 10px; }
.sidebar nav a[aria-current]::before { content: ""; position: absolute; left: -5px; top: 12px; bottom: 12px; width: 5px; border-radius: 5px; background: var(--chrome-ink); }
:root[data-theme="black"] .sidebar nav a[aria-current]::before { background: var(--accent); }
.topbar-date, .section-hint { display: inline-flex; align-items: center; gap: 12px; }
.section-hint { color: var(--muted); font-size: 14px; }
.panel, .choice-card, .login-card { background: linear-gradient(125deg, var(--surface), var(--surface-alt)); border-radius: 12px; }
.section-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.section-icon { color: var(--accent); display: grid; place-items: center; flex: 0 0 36px; }
.section-icon .ui-icon { width: 28px; height: 28px; }
.section-description { margin: 4px 0 0; font-size: 15px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .balance-card.stat-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(120deg, var(--surface-alt), color-mix(in srgb, var(--surface) 75%, var(--shade-one))); color: var(--ink); box-shadow: var(--shadow); }
.stat-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: 15px; line-height: 1.35; }
.stat-heading .tag { margin-left: auto; font-size: 12px; }
.stat-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 11px; color: #fff; background: var(--tile-color); box-shadow: inset 0 0 18px #ffffff15; }
.stat-icon .ui-icon { width: 25px; height: 25px; }
.tone-blue { --tile-color: #0875ba; }.tone-purple { --tile-color: #6044b4; }.tone-green { --tile-color: #167659; }.tone-aqua { --tile-color: #087d8e; }.tone-gold { --tile-color: #8c6614; }
.stat-value { font-size: clamp(27px, 1.9vw, 34px); font-weight: 750; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -.6px; }
.stat-value small, .stat-secondary small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.stat-secondary { margin-top: 5px; font-size: 20px; color: var(--muted); }
.pending-card .stat-value { color: var(--accent); }
.pending-card:hover { text-decoration: none; border-color: var(--accent); }
.flow-metrics { gap: 16px; }
.flow-metrics > div { display: flex; align-items: center; gap: 16px; border-radius: 10px; padding: 16px; min-width: 0; }
.metrics.flow-metrics > .flow-income { background: var(--success-soft); color: var(--success); }
.metrics.flow-metrics > .flow-expense { background: var(--danger-soft); color: var(--danger); }
.flow-metrics > div > div { padding: 0; background: none; border: 0; min-width: 0; }
.flow-metrics small { color: inherit; font-size: 14px; }
.flow-metrics strong { font-size: clamp(20px, 1.6vw, 27px); overflow-wrap: anywhere; }
.flow-icon { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 15%, transparent); }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; }
th { background: color-mix(in srgb, var(--surface-alt) 70%, var(--shade-one)); }
td { padding: 15px 16px; }
input, select, textarea, .button { border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
tr:is([data-kind="income"], [data-kind="other_income"], [data-kind="sale"], [data-kind="branch_payment"]) .transaction-amount { color: var(--success); }
tr:is([data-kind="expense"], [data-kind="salary"], [data-kind="other_expense"], [data-kind="purchase"], [data-kind="supplier_payment"], [data-kind="mandatory"]) .transaction-amount { color: var(--danger); }
@media (min-width: 1450px) { .sidebar { width: 262px; } main { margin-left: 262px; } .auth-main { margin-left: 0; } }
@media (max-width: 1250px) { .flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .section-hint { display: none; } }
@media (max-width: 720px) { .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 14px; } .section-title { gap: 10px; } .section-title h2 { font-size: 22px; } .dashboard-stats { grid-template-columns: 1fr; } .flow-metrics { grid-template-columns: 1fr; } .topbar-date { gap: 8px; } .stat-value { font-size: 32px; } }

/* Operation names and searchable tags. */
.document-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.document-tags .tag { white-space: normal; overflow-wrap: anywhere; }
.filtered-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.total-currency { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.total-currency h3 { margin: 0 0 12px; color: var(--accent); }
.total-currency dl { margin: 0; }
.total-currency dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.total-currency dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.negative { color: var(--danger); }.total-currency .positive { color: var(--success); }
.totals-help { margin: 16px 0 0; font-size: 14px; }
@media (max-width: 720px) { .filtered-totals { grid-template-columns: 1fr; } .history-filters { grid-template-columns: 1fr; } }
/* Cashboxes: the primary account stays visible while assistants scroll. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sidebar nav { margin-top: 28px; }
.topbar { justify-content: flex-end; }
.topbar-date { margin-right: auto; }
.cash-showcase { display: grid; grid-template-columns: minmax(380px, 1.2fr) minmax(0, 1.8fr); gap: 22px; margin-bottom: 22px; align-items: stretch; }
.cash-showcase-single { grid-template-columns: minmax(0, 1fr); }
.cash-card.stat-card { padding: 28px; border-radius: 18px; min-height: 280px; }
.cash-card .stat-heading { font-size: 18px; margin-bottom: 25px; gap: 14px; }
.cash-card .stat-icon { flex-basis: 56px; height: 56px; border-radius: 15px; }
.cash-card .stat-icon .ui-icon { width: 30px; height: 30px; }
.cash-card .stat-value { font-size: clamp(34px, 2.8vw, 42px); line-height: 1.2; margin-top: 5px; }
.cash-card .stat-secondary { font-size: 27px; margin-top: 2px; }
.cash-amount > small { color: var(--muted); font-size: 14px; letter-spacing: .8px; }
.cash-amount-usd { margin-top: 20px; }
.cash-card.cash-card-primary { min-height: 330px; background: linear-gradient(125deg, var(--chrome-bg), var(--chrome-active)); border-color: var(--chrome-line); color: var(--chrome-ink); box-shadow: 0 10px 28px color-mix(in srgb, var(--chrome-bg) 15%, transparent); }
.cash-card-primary .stat-heading, .cash-card-primary .cash-amount > small, .cash-card-primary .stat-secondary { color: var(--chrome-muted); }
.cash-card-primary .stat-value { font-size: clamp(38px, 3.2vw, 48px); }
.cash-card-primary .stat-icon, .cash-card-primary .tag { background: color-mix(in srgb, var(--chrome-ink) 14%, transparent); color: var(--chrome-ink); }
.cash-card-actions { margin-top: 24px; }
.cash-card-actions .button { flex: 1; background: var(--chrome-ink); color: var(--chrome-bg); border-color: var(--chrome-ink); }
.cash-card-actions .button.secondary { background: transparent; color: var(--chrome-ink); border-color: var(--chrome-line); }
.cash-carousel { min-width: 0; align-self: center; }
.carousel-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 15px; }
.carousel-controls { display: flex; align-items: center; gap: 8px; }
.carousel-position { font-variant-numeric: tabular-nums; white-space: nowrap; }
.carousel-arrow.button { padding: 0; width: 42px; min-height: 42px; font-size: 23px; }
.carousel-arrow:disabled { opacity: .35; cursor: default; }
.cash-carousel-track { position: relative; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--accent-border) transparent; padding: 4px 2px 12px; }
.cash-carousel-track > .cash-card { flex: 0 0 min(360px, 90%); min-width: 0; scroll-snap-align: start; }
.dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cashbox-archive { margin-top: 24px; }
.cashbox-archive > summary { padding: 14px 0; font-weight: 650; cursor: pointer; }
.closure-balances { display: flex; gap: 32px; flex-wrap: wrap; margin: 28px 0; }
.closure-balances dd { margin: 3px 0 0; font-size: 28px; font-weight: 700; }
.stat-card, .choice-card, .panel, .button, .sidebar nav a { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
@media (hover: hover) {
  .stat-card:hover, .choice-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 12%, transparent); }
  .cash-card-primary:hover { border-color: var(--chrome-ink); box-shadow: 0 12px 30px color-mix(in srgb, var(--chrome-bg) 24%, transparent); }
  .panel:hover { border-color: var(--accent-border); }
  .button:not(:disabled):hover { transform: translateY(-1px); }
  .flow-metrics > div:hover { box-shadow: inset 0 0 0 1px currentColor; }
}
@media (max-width: 1100px) { .cash-showcase { grid-template-columns: minmax(0, 1fr); } .cash-card-primary { max-width: none; } .cash-card-primary .cash-amount { display: inline-block; vertical-align: top; margin-right: 30px; } .cash-card-primary .cash-amount-usd { margin-top: 0; } }
@media (max-width: 720px) { .cash-card.stat-card { padding: 24px; min-height: 265px; } .cash-card.cash-card-primary { min-height: 310px; } .cash-card-primary .cash-amount { display: block; margin-right: 0; } .cash-card-primary .cash-amount-usd { margin-top: 18px; } .cash-card .stat-heading { font-size: 17px; } .cash-card-primary .stat-value { font-size: 38px; } .cash-card .stat-value { overflow-wrap: anywhere; } .dashboard-stats { grid-template-columns: 1fr; } .carousel-toolbar { flex-wrap: wrap; } .carousel-controls { margin-left: auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Shared operation picker and touch navigation use the active palette. */
.operation-heading { flex-direction: row; align-items: center; }
.operation-heading h1 { margin: 0; }
.operation-tabs { display: flex; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); width: fit-content; }
.operation-tabs a { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 9px 24px; border-radius: 10px; color: var(--muted); font-weight: 650; }
.operation-tabs a:hover { text-decoration: none; background: var(--surface-alt); }
.operation-tabs a[aria-current] { background: var(--button-bg); color: var(--on-accent); }
.operation-builder { padding: 0; margin: 20px 0; scroll-margin-top: 84px; border-style: dashed; }
.operation-builder > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 16px 20px; color: var(--accent); font-weight: 650; cursor: pointer; list-style: none; }
.operation-builder > summary::-webkit-details-marker { display: none; }
.operation-builder[open] { border-style: solid; }
.operation-builder[open] > summary { border-bottom: 1px solid var(--line); }
.operation-builder[open] > summary .ui-icon { transform: rotate(45deg); }
.operation-type-form { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 20px; }
.operation-type-form > .errorlist { grid-column: 1 / -1; }
.operation-type-form > button { margin-top: 32px; }
.direction-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.direction-field legend { font-size: 16px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.direction-options { display: flex; gap: 6px; }
.direction-options label { position: relative; flex: 1; margin: 0; cursor: pointer; }
.direction-options input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.direction-options span { display: grid; place-items: center; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); }
.direction-options input:checked + span { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.direction-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.operation-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.operation-tile { display: grid; grid-template-columns: 48px minmax(0, 1fr) 12px; align-items: center; gap: 15px; min-height: 112px; padding: 20px; }
.operation-tile strong { overflow-wrap: anywhere; line-height: 1.45; }
.choice-card.operation-card { display: flex; align-items: center; padding: 0; min-width: 0; }
.operation-card > .operation-tile { grid-template-columns: 44px minmax(0, 1fr); flex: 1; min-width: 0; padding: 16px; gap: 12px; color: var(--ink); }
.operation-card > .operation-tile:hover { text-decoration: none; }
.operation-card .operation-symbol { width: 44px; height: 44px; }
.operation-edit { width: 44px; height: 44px; flex-basis: 44px; margin-right: 8px; color: var(--accent); border: 1px solid var(--accent-border); background: var(--surface); }
.operation-edit .ui-icon { width: 20px; height: 20px; }
.choice-card .operation-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.operation-symbol .ui-icon { width: 24px; height: 24px; }
.choice-card .operation-chevron { margin: 0; font-size: 25px; color: var(--muted); }
.mobile-brand, .mobile-top-actions, .mobile-dock { display: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: 0 0 48px; padding: 0; border: 1px solid transparent; border-radius: 14px; background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
.icon-button .ui-icon { width: 25px; height: 25px; }
.mobile-sheet { position: fixed; inset: auto 0 0; width: min(600px, 100%); max-width: 100%; max-height: calc(100dvh - 24px); margin: 0 auto; padding: 24px 22px max(24px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink); }
.mobile-sheet::backdrop { background: rgb(0 0 0 / .5); }
body.menu-open { overflow: hidden; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.sheet-heading h2 { margin: 0; }
.sheet-profile { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--accent-soft); border-radius: 15px; }
.sheet-profile > div { min-width: 0; overflow-wrap: anywhere; }
.sheet-profile .account-avatar { background: var(--surface); color: var(--accent); border-color: var(--line); }
.sheet-profile small { display: block; color: var(--muted); }
.sheet-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.sheet-links a { display: flex; align-items: center; gap: 10px; padding: 16px 12px; min-height: 62px; font-size: 16px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; overflow-wrap: anywhere; }
.sheet-links .ui-icon { color: var(--accent); }
.sheet-links a:hover { text-decoration: none; background: var(--accent-soft); border-color: var(--accent); }
.mobile-sheet .account-action { color: var(--ink); }
.mobile-sheet .account-action:hover { background: var(--surface-alt); border-color: var(--line); }
@media (max-width: 1180px) {
  .sidebar { display: none; }
  main { margin-left: 0; min-width: 0; }
  main:not(.auth-main) > .content { padding: 24px max(22px, env(safe-area-inset-right)) calc(108px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
  .topbar { position: sticky; top: 0; z-index: 20; min-height: 68px; padding: 8px max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left)); padding-top: max(8px, env(safe-area-inset-top)); gap: 16px; flex-wrap: nowrap; }
  .mobile-brand { display: flex; gap: 10px; margin-right: auto; color: var(--chrome-ink); font-size: 26px; }
  .mobile-brand:hover { text-decoration: none; }
  .mobile-brand .brand-icon { width: 35px; height: 35px; font-size: 23px; }
  .topbar-date { margin-right: 0; }
  .topbar .theme-shortcut { display: none; }
  .mobile-top-actions { display: flex; gap: 8px; color: var(--chrome-ink); }
  .mobile-top-actions .icon-button:hover { background: var(--chrome-active); color: var(--chrome-ink); }
  .mobile-profile { border: 1px solid var(--chrome-line); border-radius: 50%; background: var(--chrome-active); }
  .mobile-dock { position: fixed; z-index: 30; inset: auto 0 0; display: flex; justify-content: center; padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: var(--chrome-bg); color: var(--chrome-ink); border-top: 1px solid var(--chrome-line); box-shadow: 0 -4px 18px rgb(0 0 0 / .06); }
  .mobile-dock > a, .mobile-dock > button { flex: 1 1 0; max-width: 150px; min-width: 0; min-height: 65px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--chrome-muted); font-size: 12px; font-weight: 600; line-height: 1.4; cursor: pointer; }
  .mobile-dock > a:hover, .mobile-dock > button:hover { text-decoration: none; color: var(--chrome-ink); background: var(--chrome-active); }
  .mobile-dock > [aria-current], .mobile-dock > [aria-expanded="true"] { color: var(--chrome-ink); background: var(--chrome-active); }
  .mobile-dock .ui-icon { width: 25px; height: 25px; }
  .dock-create-icon { width: 48px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: var(--chrome-ink); color: var(--chrome-bg); }
  .mobile-dock .dock-create { padding-top: 2px; color: var(--chrome-ink); }
  .mobile-dock :focus-visible { outline: 2px solid var(--chrome-ink); }
  .page-heading { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .cash-showcase { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea, summary, [id] { scroll-margin-top: 88px; scroll-margin-bottom: 108px; }
  .table-wrap { overscroll-behavior-x: contain; }
}
@media (max-width: 720px) {
  main:not(.auth-main) > .content { padding: 20px max(16px, env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); min-height: 64px; }
  .topbar .topbar-date { display: none; }
  .topbar .mobile-top-actions { gap: 4px; }
  .mobile-top-actions .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .operation-heading { gap: 12px; flex-wrap: nowrap; }
  .operation-heading h1 { font-size: 28px; }
  .operation-heading .button { padding: 10px 12px; font-size: 15px; }
  .operation-tabs { width: 100%; }
  .operation-tabs a { padding: 9px; flex: 1; gap: 6px; }
  .operation-tabs .ui-icon { width: 18px; flex-basis: 18px; }
  .operation-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 18px; }
  .operation-tile { min-height: 88px; padding: 16px; }
  .operation-type-form { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
  .operation-type-form > button { margin-top: 0; width: 100%; }
  .operation-builder { margin: 16px 0; }
  .operation-builder > summary { padding: 14px 18px; }
  .panel { min-width: 0; }
  .form-footer { align-items: stretch; gap: 12px; }
  .form-footer .button { flex: 1; }
  .transaction-table, .transaction-table tbody { display: block; }
  .transaction-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .transaction-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 18px; border-bottom: 1px solid var(--line); }
  .transaction-table tr:last-child { border-bottom: 0; }
  .transaction-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .transaction-table .empty { grid-column: 1 / -1; }
  .history-table td:nth-child(1) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .history-table td:nth-child(1), .history-table td:nth-child(2), .history-table td:nth-child(3), .history-table td:nth-child(6),
  .recent-table td:nth-child(4), .recent-table td:nth-child(5) { grid-column: 1 / -1; }
  .recent-table td:nth-child(1):not(.empty) { display: none; }
  .recent-table td:nth-child(3) { text-align: right; font-size: 14px; color: var(--muted); }
  .transaction-table .transaction-amount { font-size: 22px; white-space: normal; }
  .transaction-table .transaction-products { min-width: 0; }
  .history-table td:nth-child(4), .history-table td:nth-child(5), .recent-table td:nth-child(6) { font-size: 14px; color: var(--muted); }
  .transaction-table td:last-child a { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
  .transaction-table .history-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .transaction-table td:last-child .history-actions a { flex: 1; }
  .recent-table td:last-child { text-align: right; }
}
@media print {
  :root[data-theme] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-alt: #f5f5f5;
    --ink: #222; --muted: #555; --line: #ddd;
    --accent: #333; --accent-soft: #eee; --on-accent: #fff;
    --chrome-bg: #eee; --chrome-ink: #222; --chrome-muted: #555;
    --shade-one: #fff; --shade-two: #fff; --shade-three: #fff;
  }
  .sidebar, .topbar, .mobile-dock, .mobile-sheet, .design-panel, footer { display: none; }
  main { margin: 0; }
  .panel { box-shadow: none; }
  .cash-carousel-track { overflow: visible; flex-wrap: wrap; }
  .carousel-controls, .cash-card-actions { display: none; }
}
