/* UI-only palette. Print explicitly restores the original colors. */
:root { color-scheme: light; }
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --card: #25313d; --bg: #19222c; --panel: #25313d; --surface: #25313d;
    --text: #e3eaf0; --muted: #a8b7c5; --line: #455463;
    --accent: #74d2b9; --danger: #e08080;
    --shadow: 0 8px 26px #00000020;
    --ui-fill-eef6f3: #25313d;
    --ui-fill-f7faf9: #25313d;
    --ui-text-718c87: #dce5ec;
    --ui-fill-ffffffb3: #25313db3;
    --ui-text-b42318: #dca8a4;
    --ui-text-18734a: #a4c4b6;
    --ui-text-33414b: #dce5ec;
    --ui-border-cbd4da: #4b5a67;
    --ui-fill-fff: #25313d;
    --ui-fill-e8f5ef: #25313d;
    --ui-text-176044: #a3beb3;
    --ui-fill-fbecec: #25313d;
    --ui-fill-edf0f2: #25313d;
    --ui-text-69747b: #dce5ec;
    --ui-fill-e8f3f0: #25313d;
    --ui-fill-eef1f3: #25313d;
    --ui-fill-dcefe9: #25313d;
    --ui-text-166534: #a3bfae;
    --ui-fill-dcfce7: #234139;
    --ui-text-92400e: #d0b2a0;
    --ui-fill-fef3c7: #453d25;
    --ui-text-4b5563: #dce5ec;
    --ui-fill-f3f4f6: #25313d;
    --ui-fill-f2f7f6: #25313d;
    --ui-fill-f7f9fa: #25313d;
    --ui-text-1d4d43: #a5b7b3;
    --ui-text-235d73: #a8bcc4;
    --ui-fill-f3e7e7: #25313d;
    --ui-fill-f1f4f5: #25313d;
    --ui-fill-eef2f3: #25313d;
    --ui-fill-fff2cc: #4a2d34;
    --ui-text-705400: #c3b99b;
    --ui-border-ead58e: #4a2d34;
    --ui-fill-eef1f5: #25313d;
    --ui-fill-fff4f2: #25313d;
    --ui-text-855b00: #cbbc9b;
    --ui-fill-e5f3ee: #25313d;
    --ui-fill-d6eae1: #25313d;
    --ui-text-64748b: #bfc5cd;
    --ui-fill-fff0ef: #25313d;
    --ui-fill-f3f6f7: #25313d;
    --ui-fill-e8f2ef: #25313d;
    --ui-text-1d5f50: #a5bdb8;
    --ui-fill-fff8e5: #25313d;
    --ui-text-8a5700: #cdba9b;
    --ui-border-cbd5e1: #4b5a67;
    --ui-fill-f1f5f9: #25313d;
    --ui-fill-fee2e2: #25313d;
    --ui-text-991b1b: #d2a5a5;
    --ui-border-dce3ed: #4b5a67;
    --ui-text-475569: #dce5ec;
    --ui-fill-fff7d6: #453d25;
    --ui-fill-edf9f1: #25313d;
    --ui-text-14532d: #a2b9ab;
  }
  :root[data-theme="dark"] .button.primary { background: #176b5b; color: #fff; border-color: #338c78; }
  :root[data-theme="dark"] .button.danger { background: #973b43; color: #fff; border-color: #c66972; }
  :root[data-theme="dark"] dialog { background: var(--panel); color: var(--text); }
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: auto; min-height: 108px; }
.theme-choice { font-size: 12px; flex: 0 0 auto; gap: 3px; }
.theme-choice select { width: auto; min-width: 145px; padding-top: 7px; padding-bottom: 7px; }
.button:not(.primary):not(.danger):not(.pdf-pending):not(.disabled) { background-color: #e7edf1; border-color: #a4b3be; }
.button:not(.primary):not(.danger):not(.pdf-pending):not(.disabled):hover { background-color: #d9e3e9; border-color: #718897; }
.button.pdf-pending { background: #e8ecef; color: #344450; border-color: #a7b4bd; cursor: pointer; }
.button.pdf-pending:hover { background: #dbe2e7; border-color: #7f919e; }
.button:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid #409e8b; outline-offset: 2px; }
.invoice-jump { display: flex; justify-content: flex-end; margin-bottom: 12px; }
#invoice-actions-anchor, #invoice-bottom { scroll-margin-block: 24px; }
.shell > main { min-width: 0; }
@media screen {
  :root[data-theme="dark"] .button:not(.primary):not(.danger):not(.pdf-pending):not(.disabled) { background-color: #354553; border-color: #718394; color: #e3eaf0; }
  :root[data-theme="dark"] .button:not(.primary):not(.danger):not(.pdf-pending):hover { background-color: #445969; border-color: #9badbd; }
  :root[data-theme="dark"] .button.pdf-pending { background: #cdd5dc; color: #25313d; border-color: #a4b3be; }
  :root[data-theme="dark"] .button.pdf-pending:hover { background: #e0e6eb; }
}
@media (max-width: 1250px) {
  .invoice-item { grid-template-columns: 65px 95px minmax(150px, 1fr) 95px 65px 120px 78px; }
  .invoice-item output, .invoice-item-head > span:nth-child(6) { display: none; }
}
@media (max-width: 1250px) {
  .invoice-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-item .item-description { grid-column: 1 / -1; }
  .invoice-item-head { display: none; }
  .invoice-item output { display: block; }
  .invoice-item input { min-width: 0; }
}
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; padding: 18px 5vw; }
  .topbar h1 { font-size: 23px; overflow-wrap: anywhere; }
  .theme-choice { margin-left: auto; }
  .billing-address-main { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  :root { color-scheme: light; }
  .theme-choice, .invoice-jump { display: none !important; }
}

@media screen { :root[data-theme="dark"] a:not([class]) { color: #8bcdbd; } }
.theme-choice select { font: inherit; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background-color: var(--panel); }
.board-toolbar .theme-choice { margin-left: auto; }

