/* Appearance: the control, and the dark palette. Light is the default look in kit.css; everything here applies only when
   the page is dark (data-theme="dark", set by theme.js from the System, Light or Dark choice). */

/* The control: three radio buttons that read as one segmented switch. */
.appearance { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.appearance legend { float: left; padding: 0; margin-right: 12px; font: 500 14px/1.3 var(--sans); color: var(--muted); }
.appearance-options { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); }
.appearance label { position: relative; display: inline-flex; cursor: pointer; }
.appearance input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.appearance label > span { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 32px; padding: 0 12px; border-radius: 7px; color: var(--muted); font: 600 13.5px/1 var(--sans); transition: background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out); }
.appearance input:checked + span { background: #fff; color: var(--ink-solid); box-shadow: 0 1px 2px #1a1d2426, 0 0 0 1px var(--line-strong); }
.appearance input:focus-visible + span { outline: 2px solid var(--cobalt); outline-offset: 2px; }
@media (hover: hover) { .appearance input:not(:checked):hover + span { color: var(--ink-solid); } }
@media (max-width: 720px), (pointer: coarse) { .appearance label > span { min-height: 44px; min-width: 76px; } }
.site-foot .foot-theme { margin-top: 6px; }
.appearance-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.appearance-sheet .appearance { display: grid; gap: 10px; }
.appearance-sheet .appearance legend { float: none; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; } /* the sheet title already says Appearance */
.appearance-sheet .appearance-options { display: flex; }
.appearance-sheet .appearance label { flex: 1 1 0; }
.appearance-sheet .appearance label > span { width: 100%; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaee;
  --ink-solid: #f6f7f9;
  --ink-2: #c9ced6;
  --muted: #a6acb6;
  --faint: #868c97;
  --line: #2b3039;
  --line-strong: #414855;
  --paper: #121418;
  --paper-warm: #1d1b16;
  --paper-deep: #26231b;
  --panel: #1b1f26;
  --panel-line: #2d333d;
  --surface: #181b21;
  --surface-hover: #1f242b;
  --cobalt: #8fb0f3;
  --cobalt-ink: #b4cbf8;
  --cobalt-wash: #1c2842;
  --sage: #86b793;
  --sage-wash: #15271c;
  --brick: #f19a82;
  --brick-wash: #2e1b16;
  --gold: #d9aa4e;
  --shadow: 0 1px 2px #0006, 0 8px 24px -12px #000a;
  --shadow-pop: 0 18px 50px -14px #000c;
}

:root[data-theme="dark"] ::selection { background: #34508a; color: #fff; }
:root[data-theme="dark"] .appearance input:checked + span { background: #2c323c; color: #fff; box-shadow: 0 0 0 1px #4d5565; }
:root[data-theme="dark"] .brand img { filter: invert(1); }

/* Text that kit.css hard-codes as a mid grey. */
:root[data-theme="dark"] :is(.lede, .site-nav a, .field > span, .label, .prose, .prose blockquote, .chip, .notice, .faq details > div, .site-foot a, .oa-network-more a, .site-foot .foot-links .link-btn) { color: var(--ink-2); }
:root[data-theme="dark"] .site-foot .foot-line { color: var(--muted); }
:root[data-theme="dark"] .field > label { color: var(--ink-2); }

/* Surfaces that kit.css paints white. */
:root[data-theme="dark"] :is(.card, .table-wrap, .faq details, .dialog, .dropdown-menu, .input, .select, .textarea) { background: var(--surface); }
:root[data-theme="dark"] .site-head { background: #121418ee; }
:root[data-theme="dark"] .action-bar { background: #121418f2; }
:root[data-theme="dark"] .dialog-backdrop { background: #000000b3; }
:root[data-theme="dark"] .dialog { box-shadow: 0 30px 80px -20px #000, 0 0 0 1px var(--line); }
:root[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #20252d 40%, #2a303a 50%, #20252d 60%) 0 0 / 300% 100%; }
:root[data-theme="dark"] .spinner { border-color: #ffffff2b; border-top-color: currentColor; }

/* Buttons: the solid button flips to light on dark. */
:root[data-theme="dark"] .btn { color: #0b0b0c; }
:root[data-theme="dark"] .btn-line, :root[data-theme="dark"] .btn-quiet { color: var(--ink); }
:root[data-theme="dark"] .btn-danger-solid, :root[data-theme="dark"] .btn.btn-danger-solid { background: #b24a2f; border-color: #b24a2f; color: #fff; }
:root[data-theme="dark"] :is(.btn-line, .btn-quiet).btn-danger { color: var(--brick); }
@media (hover: hover) {
  :root[data-theme="dark"] .btn:hover { background: #d7dbe2; color: #0b0b0c; }
  :root[data-theme="dark"] .btn-line:hover { background: #ffffff0d; color: var(--ink-solid); border-color: #5b6372; }
  :root[data-theme="dark"] .btn-quiet:hover { background: #ffffff0f; color: var(--ink-solid); }
  :root[data-theme="dark"] .btn-danger-solid:hover { background: #c2553a; color: #fff; }
  :root[data-theme="dark"] :where(.btn):is(:disabled, [aria-disabled="true"]):hover { background: var(--ink-solid); }
  :root[data-theme="dark"] .site-nav a:hover, :root[data-theme="dark"] .dropdown-menu :where(a, button):hover { background: #ffffff0f; }
  :root[data-theme="dark"] :is(.input, .select, .textarea):hover { border-color: #5b6372; }
}

/* Fields. */
:root[data-theme="dark"] .input:focus, :root[data-theme="dark"] .select:focus, :root[data-theme="dark"] .textarea:focus { box-shadow: 0 0 0 3px #8fb0f347; }
:root[data-theme="dark"] :is(.input, .select, .textarea)[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #f19a8247; }
:root[data-theme="dark"] :is(.input, .select, .textarea)::placeholder { color: #8b919c; }
:root[data-theme="dark"] :is(.input, .select, .textarea):disabled { background: #1e2229; color: var(--muted); border-color: var(--line); }

/* Chips, notices, alerts, error and empty screens. */
:root[data-theme="dark"] .paper { border-color: #3a3427; }
:root[data-theme="dark"] .chip-free, :root[data-theme="dark"] .notice-ok { border-color: #29492f; color: #a9dbb6; }
:root[data-theme="dark"] .chip-cobalt { border-color: #2d4272; }
:root[data-theme="dark"] .notice-error { border-color: #5b3024; color: #f4bdab; }
:root[data-theme="dark"] .error-state { border-color: #5b3024; }
:root[data-theme="dark"] .error-state > :is(h2, h3) { color: #f4bdab; }
:root[data-theme="dark"] .error-state > p { color: #e3a897; }
:root[data-theme="dark"] .table td.yes { color: #a9dbb6; }
:root[data-theme="dark"] .table td.no { color: #e3a897; }
:root[data-theme="dark"] .toast { background: #2b313b; color: #f6f7f9; box-shadow: 0 10px 30px #000a, 0 0 0 1px #414855; }
:root[data-theme="dark"] :is(.code, .prose pre) { box-shadow: 0 0 0 1px var(--line); }

/* The app's own screens (styles.css). */
:root[data-theme="dark"] :is(.pos, .you-balance.pos, .field small.pos) { color: #7fd09a; }
:root[data-theme="dark"] :is(.field > label, .steps p, .features span, .not-list, .deep-links span, .you-next, .split-amount, .ai-link, .app-hero .lede, .hero-free) { color: var(--ink-2); }
:root[data-theme="dark"] :is(.chips-input, .features li, .more-apps a, .expense-list, .money-input) { background: var(--surface); }
:root[data-theme="dark"] .chips-input:focus-within, :root[data-theme="dark"] .money-input:focus-within { box-shadow: 0 0 0 3px #8fb0f347; }
:root[data-theme="dark"] .chips-input input::placeholder { color: #8b919c; }
:root[data-theme="dark"] .steps li::before { color: #0b0b0c; }
:root[data-theme="dark"] .tab-count { color: #f4bdab; }
:root[data-theme="dark"] .expense-icon { border-color: #3a3427; color: #dcc596; }
:root[data-theme="dark"] .expense-icon.payment { border-color: #29492f; color: #a9dbb6; }
:root[data-theme="dark"] .segmented button[aria-checked="true"] { background: #2c323c; color: #fff; box-shadow: 0 0 0 1px #4d5565; }
:root[data-theme="dark"] .app-hero { background: radial-gradient(56% 60% at 88% 18%, #1c2a4a, #1c2a4a00 72%), radial-gradient(46% 55% at 4% 100%, #17291e, #17291e00 70%), radial-gradient(40% 40% at 60% 0%, #2c2415, #2c241500 70%), linear-gradient(180deg, #17150f, var(--paper)); }
:root[data-theme="dark"] .hero-phones::before { background: radial-gradient(closest-side, #ffffff14, #fff0); }
@media (hover: hover) {
  :root[data-theme="dark"] .expense:hover { background: var(--surface-hover); }
  :root[data-theme="dark"] .person-chip button:hover { background: #2d416b; }
  :root[data-theme="dark"] .btn-danger-solid:hover { background: #c2553a; border-color: #c2553a; }
}
:root[data-theme="dark"] .expense:active { background: #252a32; }

/* The card illustrations are drawn on a light page. Flip them so they glow softly on dark instead of vanishing. */
:root[data-theme="dark"] .art { mix-blend-mode: screen; filter: invert(1) hue-rotate(180deg) brightness(.95); }
