/*
 * Layout and controls follow the plate calculator; the COLOURS are the church's (owner 2026-12-03): green from the
 * church website (mpec site, "comunidad" variant) and brown and gold from the church logo (#c8a848, #a87828, and the
 * site's #d4af37). Every variant is contrast-checked in web/test/colors.test.ts.
 */
:root {
  --plate-font-scale: 1;
  color-scheme: light; color: var(--ink); background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-synthesis: none;
}
/* palette: green light */
:root, :root[data-palette="green"] {
  --ink: #1c2a24; --muted: #46564e; --page: #f3f8f4; --surface: #ffffff; --border: #c4d9cc; --control-border: #5f8070;
  --empty-border: #8fab9c; --accent: #2f6b4f; --accent-strong: #1f4a37; --on-strong: #ffffff; --accent-soft: #d5ebdd;
  --focus: #2f6b4f; --negative: #9c2424; --fee-surface: #edf5ef; --shadow: #1c2a2420;
}
/* palette: green dark */
:root[data-theme="dark"], :root[data-palette="green"][data-theme="dark"] {
  --ink: #e6efea; --muted: #b4c6bd; --page: #0e1714; --surface: #121d19; --border: #2f4a3e; --control-border: #6f9482;
  --empty-border: #6f9482; --accent: #8fd3ad; --accent-strong: #1f4a37; --on-strong: #ffffff; --accent-soft: #183427;
  --focus: #8fd3ad; --negative: #ffb4ab; --fee-surface: #16231e; --shadow: #00000052;
  color-scheme: dark;
}
/* palette: gold light */
:root[data-palette="gold"] {
  --ink: #2e2111; --muted: #5a4b33; --page: #faf5ea; --surface: #ffffff; --border: #dccba5; --control-border: #8a7340;
  --empty-border: #b49d68; --accent: #6f5210; --accent-strong: #4d360d; --on-strong: #ffffff; --accent-soft: #f3e6cf;
  --focus: #a87828; --negative: #9c2424; --fee-surface: #f7efdf; --shadow: #2e211120;
}
/* palette: gold dark */
:root[data-palette="gold"][data-theme="dark"] {
  --ink: #f5ecd9; --muted: #d3c29c; --page: #17110a; --surface: #221a0f; --border: #5a4a26; --control-border: #a08a52;
  --empty-border: #a08a52; --accent: #d4af37; --accent-strong: #5a3f10; --on-strong: #ffffff; --accent-soft: #3a2c12;
  --focus: #d4af37; --negative: #ffb4ab; --fee-surface: #2b2113; --shadow: #00000052;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: calc(1rem * var(--plate-font-scale)); }
#app { width: min(760px, 100%); margin: 0 auto; padding: 0 16px 64px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; }
.utility-bar { margin: 0 -16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { margin: 0 0 8px; color: var(--accent); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.header-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.font-stepper { display: flex; gap: 4px; }
nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--control-border); border-radius: 100px; color: var(--accent); text-decoration: none; font-weight: 750; }
nav a[aria-current="page"] { background: var(--accent-strong); color: var(--on-strong); border-color: var(--accent-strong); }
h1 { margin: 20px 0 4px; font-family: Georgia, serif; font-size: calc(2rem * var(--plate-font-scale)); line-height: 1.05; }
h2 { margin: 0 0 4px; font-size: calc(1.2rem * var(--plate-font-scale)); }
h3 { margin: 12px 0 6px; font-size: calc(1.05rem * var(--plate-font-scale)); }
.synced { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.period { margin: 0 0 12px; color: var(--muted); }
.panel { padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px var(--shadow); }
.card, .week { margin-top: 18px; }
.week > .card + .card { margin-top: 10px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.more-filters { grid-column: 1 / -1; }
.more-filters > summary { margin: 0; color: var(--accent); }
.field { display: grid; gap: 6px; font-weight: 700; }
select, input, button { font: inherit; }
select, input { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--control-border); border-radius: 9px; background: var(--surface); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .actions { grid-column: 1 / -1; }
.filters .actions button { white-space: nowrap; }
button, a.button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--accent); border-radius: 100px; background: var(--accent-strong); color: var(--on-strong); font-weight: 750; cursor: pointer; text-decoration: none; }
button.chip { min-width: 44px; padding: 8px 12px; background: var(--surface); color: var(--accent); border-color: var(--control-border); }
button.chip[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* The toggle shows the mode you would switch to: a moon in light mode, a sun in dark mode. */
button.chip .icon-moon, :root[data-theme="dark"] button.chip .icon-sun { display: block; margin: 0 auto; }
button.chip .icon-sun, :root[data-theme="dark"] button.chip .icon-moon { display: none; }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.figures div { padding: 10px 12px; border-radius: 10px; background: var(--fee-surface); }
.figures .gross { grid-column: 1 / -1; background: var(--accent-soft); }
dt { color: var(--muted); font-size: calc(.9rem * var(--plate-font-scale)); }
dd { margin: 2px 0 0; font-size: calc(1.4rem * var(--plate-font-scale)); font-weight: 800; overflow-wrap: anywhere; }
.gross dd { font-family: Georgia, serif; font-size: calc(2.2rem * var(--plate-font-scale)); }
details > summary { margin-top: 12px; min-height: 44px; display: flex; align-items: center; font-weight: 750; cursor: pointer; }
.transactions { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.transactions p { margin: 0 0 4px; }
.who { font-weight: 800; }
.person details > summary { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; list-style: none; }
.person summary::-webkit-details-marker { display: none; }
.person summary .who::before { content: "▸ "; color: var(--accent); }
.person details[open] summary .who::before { content: "▾ "; }
.person .detail { grid-column: 1 / -1; color: var(--muted); font-weight: 600; font-size: calc(.9rem * var(--plate-font-scale)); }
.gifts { list-style: none; margin: 10px 0 0; padding: 0; }
.gifts li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.gifts li strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.amount { font-family: Georgia, serif; font-size: calc(1.5rem * var(--plate-font-scale)); font-weight: 800; }
.error { color: var(--negative); font-weight: 700; }
.empty { padding: 36px 20px; text-align: center; border: 2px dashed var(--empty-border); border-radius: 16px; }
.signin { display: grid; gap: 14px; padding-top: 40px; max-width: 420px; margin: 0 auto; }
.signin form .actions { margin-top: 14px; }
.providers { display: grid; gap: 10px; }
.providers a.button { display: flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
