/* Independent preferences compose with either theme. Document paper has its own palette. */
.appearance-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.appearance-controls .button { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.appearance-controls [aria-pressed="true"] { outline: 2px solid var(--blue); outline-offset: 2px; }
:root[data-contrast="high"] {
  --canvas: #fff;
  --surface: #fff;
  --surface-raised: #fff;
  --sidebar: #f1f3f6;
  --ink: #080d17;
  --muted: #303949;
  --line: #566174;
  --blue: #1336a8;
  --focus: #1336a8;
  --soft: #e8edf5;
  --blue-soft: #dce5ff;
  --hover: #dce5ff;
}
:root[data-theme="dark"][data-contrast="high"] {
  --canvas: #080b10;
  --surface: #10151e;
  --surface-raised: #151d29;
  --sidebar: #10151e;
  --ink: #fff;
  --muted: #e0e7f2;
  --line: #a8b7cc;
  --blue: #c4d4ff;
  --focus: #ffe685;
  --soft: #202c40;
  --blue-soft: #253b61;
  --hover: #253b61;
}
:root[data-contrast="high"] :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:root[data-contrast="high"] :is(.card, .metric, .topbar, .button, input, select, textarea, dialog) { border-color: var(--line); }
:root[data-contrast="high"] .badge { border: 1px solid currentColor; font-weight: 750; }
:root[data-contrast="high"] .badge.green { color: #13552f; background: #e1f8e9; }
:root[data-contrast="high"] .badge.red { color: #8b1120; background: #ffe8eb; }
:root[data-contrast="high"] .badge.amber { color: #694000; background: #fff1cf; }
:root[data-contrast="high"] .badge.blue { color: #1336a8; background: #e6edff; }
:root[data-contrast="high"] :is(.badge.gray, .badge.neutral) { color: #263247; background: #edf1f7; }
/* Override pixel-sized UI text without scaling document previews or exported invoices. */
:root[data-text-size="large"] body { font-size: 18px; }
:root[data-text-size="large"] :is(p, a, label, button, input, select, textarea, summary, td, th, dt, dd, small, legend, code, .badge, .muted, .cell-caption, .table-date, .nav-label, .form-status, .dash-eyebrow, .dash-legend, .dash-month, .dash-empty, .dash-stat-footer, .dash-boardbar > span):not(.paper, .paper *) { font-size: 1.2rem; }
:root[data-text-size="large"] :is(.button, input, select, textarea):not(.paper *) { min-height: 44px; }
:root[data-text-size="large"] :is(.button, .nav a, .tab, .filter-group button):not(.paper *) { white-space: normal; }
:root[data-text-size="large"] :is(.fields, .dash-heading, .dash-actions, .tabs, .filter-group) { min-width: 0; }
:root[data-text-size="large"] :is(.dash-heading, .dash-actions, .tabs, .filter-group) { flex-wrap: wrap; }
:root[data-text-size="large"] :is(.settings-grid, .fields) > * { min-width: 0; }
@media (max-width: 480px) {
  .appearance-controls > .button { flex: 1 1 100%; }
  :root[data-text-size="large"] .fields { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .appearance-controls { display: none; }
}
