/* ===== Theme: light (default) and soft dark olive ===== */
:root {
  --peach-ink: #7A3F25;
  --danger-ink: #9A4A2C;
  --butter-ink: #3D2B04;
  --butter-ink2: #6B5320;
  --green-ink: #2F5A1E;
  --mist-ink: #2F4A55;
  --green-bg: #E2EED8;
  --line-soft: #F4F1E7;
  --chip: #F1EEE4;
  --peach-soft: #FFF8F4;
  --butter-soft: #FFFBF0;
  --olive-softer: #FAFBF6;
  --peach-hatch: #FCF0EA;
  --grey-hatch: #F6F4EE;
  --grey-hatch2: #FCFBF7;
  --line-strong: #D9DFC8;
  --btn-shadow-out: #CFD8B8;
  --btn-shadow-soft: #E9CF9B;
  --tabbar-bg: rgba(255, 255, 255, .96);
  --chip-bg: rgba(255, 255, 255, .7);
  --toast-bg: #4A5624;
  --toast-ink: #FFFFFF;
  --toast-info: #2E3322;
  --olive-hover: #4A5624;
  color-scheme: light;
}

/* Dark: when the person picks Dark, or picks Auto and their phone is in dark mode */
:root[data-theme="dark"] {
  --cream: #1C2017;
  --card: #272C20;
  --ink: #ECEADC;
  --muted: #A8AB97;
  --line: #3A4030;
  --olive: #7D8E46;
  --olive-dark: #CFDAAE;
  --olive-soft: #313827;
  --olive-softer: #2B3123;
  --olive-hover: #8FA053;
  --sage: #39432C;
  --butter: #4A3E21;
  --peach: #4C3027;
  --mist: #2C3B41;
  --gold: #D9A03A;
  --gold-dark: #9C7420;
  --gold-ink: #2A1D02;
  --ok: #6FA556;
  --peach-ink: #F3C7B4;
  --danger-ink: #F0A98C;
  --butter-ink: #F5DFA5;
  --butter-ink2: #E3CC92;
  --green-ink: #CDE6BC;
  --mist-ink: #C4DDE6;
  --green-bg: #2F4426;
  --line-soft: #31372A;
  --chip: #343A2B;
  --peach-soft: #33271F;
  --butter-soft: #322C1C;
  --peach-hatch: #3A2A22;
  --grey-hatch: #2B3024;
  --grey-hatch2: #252A1F;
  --line-strong: #4A523C;
  --btn-shadow-out: #151812;
  --btn-shadow-soft: #2E2614;
  --tabbar-bg: rgba(32, 36, 26, .97);
  --chip-bg: rgba(0, 0, 0, .22);
  --toast-bg: #E6EBD3;
  --toast-ink: #1C2017;
  --toast-info: #ECEADC;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #1C2017;
    --card: #272C20;
    --ink: #ECEADC;
    --muted: #A8AB97;
    --line: #3A4030;
    --olive: #7D8E46;
    --olive-dark: #CFDAAE;
    --olive-soft: #313827;
    --olive-softer: #2B3123;
    --olive-hover: #8FA053;
    --sage: #39432C;
    --butter: #4A3E21;
    --peach: #4C3027;
    --mist: #2C3B41;
    --gold: #D9A03A;
    --gold-dark: #9C7420;
    --gold-ink: #2A1D02;
    --ok: #6FA556;
    --peach-ink: #F3C7B4;
    --danger-ink: #F0A98C;
    --butter-ink: #F5DFA5;
    --butter-ink2: #E3CC92;
    --green-ink: #CDE6BC;
    --mist-ink: #C4DDE6;
    --green-bg: #2F4426;
    --line-soft: #31372A;
    --chip: #343A2B;
    --peach-soft: #33271F;
    --butter-soft: #322C1C;
    --peach-hatch: #3A2A22;
    --grey-hatch: #2B3024;
    --grey-hatch2: #252A1F;
    --line-strong: #4A523C;
    --btn-shadow-out: #151812;
    --btn-shadow-soft: #2E2614;
    --tabbar-bg: rgba(32, 36, 26, .97);
    --chip-bg: rgba(0, 0, 0, .22);
    --toast-bg: #E6EBD3;
    --toast-ink: #1C2017;
    --toast-info: #ECEADC;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* Avatars keep their pastel colours, so their letters stay dark in both themes */
.avatar:not(.group-av):not(.new-av) { color: #3B4520; }
.bday-card.mine b, .bday-card.mine span:not(.cake) { color: var(--gold-ink) !important; }

/* Logo sits on a soft cream pill in dark mode so the olive letters stay readable */
:root[data-theme="dark"] .logo { background: #F3EFE3; border-radius: 12px; padding: 3px 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { background: #F3EFE3; border-radius: 12px; padding: 3px 8px; } }



/* Theme switch */
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--chip); border-radius: 14px; padding: 4px; }
.theme-seg button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 11px; font-weight: 800; color: var(--muted); }
.theme-seg button span { font-size: 20px; }
.theme-seg button[aria-pressed="true"] { background: var(--card); color: var(--olive-dark); box-shadow: var(--shadow); }
