/* Unified palette from the original finance-toolbar-directions mockup.
   The existing token names remain compatible with the app surfaces; register
   dimensions, typography, row spacing and column sizing stay unchanged. */
@media screen {
  :root {
    --studio-canvas:#242731;--studio-sidebar:#242731;--studio-panel:#2b2e34;
    --studio-field:#22252a;--studio-raised:#363b43;--studio-edge:#40454d;
    --studio-text:#f2f3f6;--studio-secondary:#a7b0be;--studio-muted:#a0a9b7;
    --studio-accent:#a7a3ff;--studio-on-accent:#202039;
    --studio-selected:#373653;--studio-selected-text:#f2f3f6;--studio-danger:#f0aaa0;
    --studio-shadow:0 12px 36px #0004,0 2px 6px #0002;
    --studio-row:#242731;--studio-row-alt:#2b2e34;--studio-row-hover:#363b43;
    --studio-warning:#ddc08a;--studio-warning-bg:#352f24;--studio-warning-edge:#65583e;
    --studio-error-bg:#3b2928;--studio-error-edge:#765049;
    --studio-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23a7b0be' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --bg:var(--studio-canvas);--sidebar:var(--studio-sidebar);--surface:var(--studio-panel);
    --surface-raised:var(--studio-raised);--input:var(--studio-field);--line:var(--studio-edge);
    --text:var(--studio-text);--muted:var(--studio-secondary);--subtle:var(--studio-muted);
    --accent:var(--studio-accent);--accent-hover:#bebaff;--selection:var(--studio-selected);
    --future:#9a9fae;--forecast-text:#9a9fae;--forecast-hover:#aab0bd;--forecast-selected:#bec0d6;
    --desktop-chrome:var(--studio-sidebar);--desktop-heading:var(--studio-canvas);
    --desktop-control:var(--studio-raised);--desktop-edge:var(--studio-edge);
    --desktop-menu-bg:var(--studio-panel);--desktop-menu-edge:var(--studio-edge);
    --desktop-menu-selected:var(--studio-selected);--desktop-menu-shadow:var(--studio-shadow);
    --desktop-row-dark:var(--studio-row);--desktop-row-gray:var(--studio-row-alt);
    --desktop-row-hover:var(--studio-row-hover);--desktop-row-selected:var(--studio-selected);
    --desktop-edit-selection:#373653;
  }
  :root[data-theme="light"] {
    --studio-canvas:#f0f2f7;--studio-sidebar:#f0f2f7;--studio-panel:#fff;
    --studio-field:#f7f8fa;--studio-raised:#e9edf2;--studio-edge:#dce1e8;
    --studio-text:#202630;--studio-secondary:#626c7a;--studio-muted:#626c7a;
    --studio-accent:#5756d5;--studio-on-accent:#fff;
    --studio-selected:#e7e7fc;--studio-selected-text:#393891;--studio-danger:#a6352d;
    --studio-shadow:0 12px 36px #29364717,0 2px 6px #2936470c;
    --studio-row:#fff;--studio-row-alt:#f0f2f7;--studio-row-hover:#e9edf2;
    --studio-warning:#79591b;--studio-warning-bg:#fff4df;--studio-warning-edge:#dac28e;
    --studio-error-bg:#fcecea;--studio-error-edge:#deb7b0;
    --studio-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23626c7a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --accent-hover:#4847bd;--future:#646f7d;--forecast-text:#646f7d;
    --forecast-hover:#626c7a;--forecast-selected:#66658a;--desktop-edit-selection:#e7e7fc;
  }

  /* Use one centered chevron on collapsed native selects, including Safari.
     Native selection, keyboard handling and mobile pickers remain intact. */
  html body select:not([multiple]):not([size]),html body select[size="1"]:not([multiple]) {
    -webkit-appearance:none;appearance:none;
    background-image:var(--studio-chevron)!important;background-repeat:no-repeat!important;
    background-position:right 9px center!important;background-size:16px 16px!important;
    padding-inline-end:32px!important;
  }
  html body :is(input,select,textarea) { border-color:var(--line);color:var(--text); }
  html body :is(input,textarea)::placeholder { color:var(--studio-muted); }
  html body label { color:var(--text); }
  html body .button { background-color:var(--surface-raised);border-color:var(--line);color:var(--text); }
  html body .button:hover:not(:disabled) { background-color:var(--studio-row-hover); }
  html body .button.primary { background-color:var(--accent);border-color:var(--accent);color:var(--studio-on-accent); }
  html body .button.primary:hover:not(:disabled) { background-color:var(--accent-hover);border-color:var(--accent-hover); }
  html body .button.quiet { background-color:transparent;border-color:transparent;color:var(--muted); }
  html body .button.quiet:hover:not(:disabled) { background-color:var(--studio-raised);color:var(--text); }
  html body .button.danger { background-color:transparent;border-color:var(--studio-error-edge);color:var(--studio-danger); }
  html body .button.danger:hover:not(:disabled) { background-color:var(--studio-error-bg); }
  html body .icon-button:hover { background-color:var(--studio-raised);color:var(--text); }
  html body .skip-link { background-color:var(--accent);color:var(--studio-on-accent); }

  /* Register paint only; no geometry or text metrics are changed here. */
  html body :is(.page-heading,.register-panel,.balance-view) { background-color:var(--studio-canvas); }
  html body :is(.account-navigation,.register-filters,.register-footer) { background-color:var(--studio-sidebar);border-color:var(--line); }
  html body :is(.today-balance>span,.register-count,.today-jump,.toolbar-button) { color:var(--muted); }
  html body .account-tab { color:var(--muted); }
  html body .account-tab:hover { background-color:var(--studio-raised);color:var(--text); }
  html body .account-tab:is([aria-selected="true"],.active) { background-color:var(--studio-selected);color:var(--studio-selected-text); }
  html body .search-field { background-color:var(--input);border-color:var(--line); }
  html body .search-field>span:not(.sr-only) { color:var(--muted); }
  html body .search-field input { background-color:transparent;color:var(--text); }
  html body .filter-controls select { background-color:var(--studio-raised);color:var(--text); }
  html body :is(.today-jump,.toolbar-button):hover:not(:disabled) { background-color:var(--studio-raised);color:var(--text); }
  html body .register-table th { background-color:var(--studio-sidebar);border-color:var(--line);color:var(--muted); }
  html body .register-table th:not(:first-child)::after { border-color:var(--line); }
  html body .register-table th.active-sort { color:var(--accent);box-shadow:inset 0 2px var(--accent); }
  html body .register-table th.column-status { color:var(--muted); }
  .register-table td { color:var(--text); }
  html body .register-table tbody tr:focus-visible { outline-color:var(--accent); }
  html body .register-table .inline-editing :is(input,select) { background-color:var(--input);border-color:color-mix(in srgb,var(--accent) 60%,var(--line));color:var(--text); }
  html body .register-table .inline-editing input[readonly] { background-color:var(--surface-raised);border-color:var(--line);color:var(--muted); }
  html body .register-table tbody tr.inline-action-row td { background-color:var(--desktop-edit-selection);color:var(--text); }
  html body .register-table .inline-error-row td { background-color:var(--studio-error-bg);color:var(--studio-danger); }
  html body .inline-more-fields summary { color:var(--accent); }
  html body .row-button { color:var(--text);border-color:var(--line); }
  html body .row-button:hover { background-color:var(--studio-raised); }
  html body #register-scroll { scrollbar-color:var(--studio-muted) var(--studio-sidebar); }
  html body .category-selection { border-color:var(--line); }
  html body .mobile-finance-balance .mf-add-button { color:var(--studio-on-accent); }
  html body :is(.workspace-heading-actions .workspace-button,.workspace-review-button,.workspace-report-tabs [aria-pressed="true"],.workspace-calendar-day.is-today .workspace-calendar-date) { color:var(--studio-on-accent); }

  /* Meaningful error and warning colors stay separate from the violet accent. */
  html body .app-status { background-color:var(--studio-selected);border-color:var(--line);color:var(--text); }
  html body .app-status.error { background-color:var(--studio-error-bg);border-color:var(--studio-error-edge);color:var(--studio-danger); }
  html body .anchor-notice { background-color:var(--studio-warning-bg);border-color:var(--studio-warning-edge);color:var(--studio-warning); }
  html body .anchor-notice p { color:var(--studio-warning); }
  html body .account-balance.unverified { color:var(--studio-warning); }
}
@media screen and (min-width:681px) {
  html body .register-table tbody tr td { background-color:var(--desktop-row-dark); }
  html body .register-table tbody tr:nth-child(even) td,html body .register-table tbody tr.stripe-gray td { background-color:var(--desktop-row-gray); }
  html body .register-table tbody tr.stripe-dark td { background-color:var(--desktop-row-dark); }
  html body .register-table tbody tr:hover td { background-color:var(--desktop-row-hover); }
  html body .register-table tbody tr:is([aria-selected="true"],.selected-row,.selected,.is-selected) td { background-color:var(--desktop-row-selected); }
  html body .register-table tbody tr.inline-editing td,html body .register-table tbody tr.inline-action-row td { background-color:var(--desktop-edit-selection); }
  html body .register-table tbody tr.inline-error-row td { background-color:var(--studio-error-bg); }
  html body .register-table tbody tr.register-drag-source td { background-color:var(--selection); }
}
@media screen and (max-width:680px) {
  html body .mobile-account-label select { background-color:var(--studio-field);border-color:var(--line); }
  html body #register-body tr[data-row-id] { border-color:var(--line); }
  html body #register-body tr.stripe-gray { background-color:var(--studio-row-alt); }
  html body #register-body tr.stripe-dark { background-color:var(--studio-row); }
  html body #register-body tr.selected-row { background-color:var(--studio-selected);box-shadow:inset 3px 0 var(--accent); }
  html body #register-body tr[data-row-id]:not(.unpaid-scheduled-row) td:is(.column-date,.column-category,.column-memo) { color:var(--muted); }
  html body #register-body tr[data-row-id]:not(.unpaid-scheduled-row) td.column-transfer { color:var(--blue); }
  html body #register-body tr[data-row-id]:not(.unpaid-scheduled-row) td:is(.column-balance,.column-transfer,.column-memo)::before { color:var(--muted); }
  html body #register-body tr:is(.inline-editing,.inline-action-row) { background-color:var(--desktop-edit-selection);border-color:var(--line); }
  html body .mobile-selection-toggle[aria-pressed="true"],html body .mobile-filters-toggle[aria-expanded="true"] { background-color:var(--studio-selected);color:var(--studio-selected-text); }
  html body .mobile-row-selection input { accent-color:var(--accent); }
}
@media screen and (forced-colors:active) {
  html body select:not([multiple]):not([size]),html body select[size="1"]:not([multiple]) { -webkit-appearance:auto;appearance:auto;background-image:none!important; }
}
