/* Colors come from config/theme.js. js/app.js copies them into these variables at startup. */
:root {
  --ground: #FBFCF5; --card: #FFFFFF; --ink: #1E2212; --muted: #5B6147;
  --accent: #B2C522; --accent-soft: #EEF3C9; --accent-text: #4F5A0A;
  --line: #D9DDC8; --idle: #E3E6D6;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); }
body { min-height: 100vh; min-height: 100dvh; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 28px 22px 24px; }
.screen.has-nav { padding-bottom: 96px; }
h1 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
h2 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 600; }
p { margin: 0; line-height: 1.45; }
.sub { font-size: 14px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.small { font-size: 12px; color: var(--muted); }
.byline { font-size: 14px; font-weight: 600; color: var(--muted); }
.byline span { font-size: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center { align-items: center; text-align: center; }
.push { margin-top: auto; }
.card { padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 10px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent-text); }
input[type=text], input[type=time], input[type=number], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-family: var(--body); font-size: 16px;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
input.amount { font-family: var(--display); font-size: 28px; font-weight: 500; min-height: 56px; }
input[type=range] { width: 100%; height: 32px; accent-color: #5F6D0C; }

button { font-family: var(--body); cursor: pointer; color: var(--ink); }
.btn { min-height: 52px; padding: 0 20px; border-radius: 26px; border: none; background: var(--ink); color: var(--ground); font-family: var(--display); font-size: 17px; font-weight: 600; width: 100%; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.small-btn { min-height: 44px; font-size: 15px; }
.btn.danger { background: #8A2A1B; color: #FFFFFF; }
.link { min-height: 44px; background: none; border: none; color: var(--accent-text); font-size: 14px; font-weight: 500; text-decoration: underline; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500; }
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }
.chip.dark[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.option { min-height: 56px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); text-align: left; font-size: 16px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.option span { font-size: 13px; font-weight: 400; color: var(--accent-text); }
.option[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 54px; padding: 6px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 15px; font-weight: 600; }
.tile span { font-size: 12px; font-weight: 400; color: var(--accent-text); }
.tile.done { background: var(--accent-soft); border-color: var(--accent); }
.ring { width: min(64vw, 250px); height: auto; align-self: center; }
.count { font-family: var(--display); font-size: 18px; font-weight: 500; text-align: center; }
.statement { min-height: 92px; font-family: var(--display); font-size: 23px; font-weight: 500; line-height: 1.3; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.bars span { height: 5px; border-radius: 3px; background: var(--idle); }
.bars span.on { background: var(--accent); } .bars span.now { background: var(--ink); }
.slider-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 26px; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 500; }
.slider-row b { font-family: var(--display); font-size: 16px; text-align: right; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.list li { padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; line-height: 1.45; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: 88vw; padding: 10px 16px; border-radius: 20px; background: var(--ink); color: var(--ground); font-size: 14px; z-index: 5; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--idle); }
nav.tabs div { max-width: 480px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
nav.tabs button { min-height: 66px; background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
nav.tabs button i { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
nav.tabs button[aria-current=page] { color: var(--ink); font-weight: 600; }
nav.tabs button[aria-current=page] i { background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .chip, .tile, .option { transition: background-color .15s, border-color .15s; } }
