/* Snackr Studio — one phone-first column, bottom tab bar, full-height sheets for editing. */
:root {
  --bg: #F4F5F0;
  --surface: #FFFFFF;
  --sunk: #ECEEE7;
  --fg: #1E2721;
  --muted: #5F6B63;
  --line: #DCE1D7;
  --accent: #A3305F;
  --accent-ink: #FFFFFF;
  --accent-soft: #F7E3EC;
  --leaf: #2F7A4F;
  --leaf-soft: #E1F0E6;
  --warn: #9A5B07;
  --warn-soft: #FBEFD9;
  --bad: #B3261E;
  --bad-soft: #FADEDC;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131915; --surface: #1C241F; --sunk: #18201B; --fg: #E8EDE7; --muted: #9AA79E; --line: #2E3932;
    --accent: #E784AC; --accent-ink: #1C1016; --accent-soft: #3A2230; --leaf: #6CC48E; --leaf-soft: #1E3326;
    --warn: #E9A94B; --warn-soft: #3A2C14; --bad: #F08A82; --bad-soft: #3B1F1D; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
main { max-width: 720px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 22px; }
h1 { font: 800 28px/1.1 var(--display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 .dot { color: var(--accent); }
h2 { font: 600 12px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
h3 { margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
[hidden] { display: none !important; }

button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.quiet { background: var(--sunk); color: var(--fg); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.tile b { display: block; font: 800 22px/1.15 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile small { color: var(--muted); font-size: 12px; }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles .tile:first-child { grid-column: 1 / -1; } }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.good { background: var(--leaf-soft); color: var(--leaf); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.paid { background: var(--accent); color: var(--accent-ink); }

/* Week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; display: grid; gap: 4px; justify-items: center; min-width: 0; }
.day.today { border-color: var(--accent); }
.day .dn { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.day .dd { font: 700 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 3px; min-height: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots i.posted { background: var(--leaf); }
.dots i.ready, .dots i.scheduled { background: var(--accent); }
.dots i.creating, .dots i.planned, .dots i.idea { background: var(--warn); }

/* Lists */
.list { display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; width: 100%; }
.item.flag { border-left: 4px solid var(--warn); }
.item.late { border-left: 4px solid var(--bad); }
.item.open { background: transparent; border-style: dashed; color: var(--muted); }
.item .when { font: 600 13px/1.25 var(--body); font-variant-numeric: tabular-nums; }
.item .when em { display: block; font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.item .what { min-width: 0; }
.item .what strong { display: block; overflow-wrap: anywhere; font-weight: 600; }
.item .what span { color: var(--muted); font-size: 13px; }
.week-label { font: 700 16px/1.2 var(--display); margin: 8px 0 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.empty { text-align: center; padding: 28px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; display: grid; gap: 10px; justify-items: center; }
.empty p { color: var(--muted); max-width: 42ch; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* Ideas from the planner */
.idea { display: grid; gap: 6px; }
.idea .meta { font-size: 13px; color: var(--muted); }

/* Deals */
.deal { display: grid; gap: 10px; }
.deal .brand { font: 800 19px/1.2 var(--display); overflow-wrap: anywhere; }
.fee { font: 800 18px/1.2 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 3px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--leaf); flex: none; }
.check.done span { color: var(--muted); text-decoration: line-through; }
.group-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Brands */
.brand-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; width: 100%; }
.brand-row strong { display: block; overflow-wrap: anywhere; }
.brand-row span { color: var(--muted); font-size: 13px; }

/* Forms */
.field { display: grid; gap: 4px; min-width: 0; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], select, textarea {
  font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
textarea.tall { min-height: 160px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 460px) { .two { grid-template-columns: 1fr; } }
.help { font-size: 13px; color: var(--muted); background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.picked { display: flex; gap: 6px; flex-wrap: wrap; }
.picked button { border: 1px solid var(--line); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.suggest { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.suggest button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 10px; font-size: 14px; }
.suggest button span { color: var(--muted); font-size: 12px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; }

/* Claude drafts */
.draft { border: 1px solid var(--accent); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; background: var(--accent-soft); }
.draft pre { white-space: pre-wrap; font: inherit; margin: 0; background: var(--surface); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.draft ul { margin: 0; padding-left: 20px; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 20; display: grid; align-items: end; justify-items: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; height: 94%; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px 0; display: grid; gap: 14px; align-content: start; }
.sheet h3 { font: 800 22px/1.15 var(--display); overflow-wrap: anywhere; }
.sheet-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sheet-actions > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .2s ease-out; } @keyframes up { from { transform: translateY(30px); opacity: .5; } } }

/* Tab bar */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(5, 1fr); max-width: 720px; margin: 0 auto; }
nav.tabs a { text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; display: grid; justify-items: center; gap: 2px; padding: 4px 0; }
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a[aria-current="page"] { color: var(--accent); }
nav.tabs .new { align-self: center; justify-self: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 0; font-size: 26px; line-height: 1; box-shadow: 0 4px 14px rgb(0 0 0 / .18); }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }

/* Sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 14px; }
