:root {
  --bg: #f6f7f4; --card: #ffffff; --ink: #1c2321; --muted: #5d6965;
  --line: #dfe3df; --accent: #1f7a55; --accent-ink: #ffffff; --accent-soft: #e6f3ec;
  --need: #1f7a55; --want: #d08a1f; --save: #3b6fd1; --warn: #b3412e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615; --card: #1b2120; --ink: #e8ecea; --muted: #9aa6a1;
    --line: #2c3533; --accent: #3fb884; --accent-ink: #08130e; --accent-soft: #1d2f27;
    --need: #3fb884; --want: #e4a743; --save: #6b97ea; --warn: #e2735f;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: center; justify-content: space-between; }
.gap { gap: 8px; justify-content: flex-start; }
.wrap-row { flex-wrap: wrap; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top .row { height: 56px; }
.brand { white-space: nowrap; flex-shrink: 0; font-weight: 700; color: var(--ink); text-decoration: none; }
nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 15px; }
nav a:hover { color: var(--accent); }
.hero { padding: 40px 0 16px; }
.hero h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin: 20px 0; scroll-margin-top: 72px; }
.card h2 { margin: 0 0 4px; font-size: 21px; }
.accent { background: var(--accent-soft); border-color: transparent; }
#p-img { width: 100%; height: auto; border-radius: 10px; margin-bottom: 14px; display: block; }
#p-img[hidden] { display: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 4px; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; min-width: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#sub-form { flex-wrap: wrap; margin-top: 14px; }
#sub-name { flex: 2 1 160px; } #sub-cost { flex: 1 1 90px; } #sub-freq { flex: 1 1 110px; }
button, .btn { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: 8px; padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.out { margin-top: 12px; }
.out strong { font-size: 1.15em; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.bar span { transition: width .3s; }
.bar .n { background: var(--need); } .bar .w { background: var(--want); } .bar .s { background: var(--save); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.warn { color: var(--warn); }
.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.list button { background: none; color: var(--muted); padding: 2px 8px; font-weight: 400; }
nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
nav a { margin-left: 0; white-space: nowrap; }
nav a[aria-current] { color: var(--accent); font-weight: 600; }
.top .row { gap: 16px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
label.inline input { width: 110px; }
#d-form { flex-wrap: wrap; margin-top: 14px; }
#d-form input { flex: 1 1 110px; } #d-name { flex: 2 1 160px !important; }
.cmp { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.cmp th, .cmp td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.cmp th { color: var(--muted); font-weight: 600; font-size: 13px; }
.cmp tr:nth-child(2) td { font-weight: 600; }
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin-top: 10px; }
.wk { background: var(--bg); color: var(--ink); border: 1px solid var(--line); padding: 8px 4px; display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.wk small { color: var(--muted); font-size: 11px; }
.wk.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.wk.on small { color: inherit; opacity: .8; }
.prose h2 { margin-top: 18px; font-size: 19px; }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: 6px; }
.inline-buy { font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tiles a { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink); text-decoration: none; font-weight: 600; }
.tiles a:hover { border-color: var(--accent); }
.tiles.big { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 8px 0 4px; }
.tiles.big a { display: flex; flex-direction: column; gap: 4px; }
.tiles.big span { color: var(--muted); font-weight: 400; font-size: 14px; }
.more { margin: 28px 0; } .more h2 { font-size: 17px; }
footer { padding: 24px 16px 40px; }
footer a, .card a:not(.btn) { color: var(--accent); }
