/* ===== Brand tokens: swap these when your brand colours are ready ===== */
:root {
  --bg: #fbf6f4;
  --surface: #ffffff;
  --surface-2: #f5ebe8;
  --text: #2b2224;
  --muted: #76696b;
  --line: #eaddd9;
  --accent: #b5566f;        /* primary pink */
  --accent-ink: #ffffff;
  --accent-soft: #f7e1e6;
  --ok: #3f7d5c;
  --warn-soft: #fff1dc;
  --warn-ink: #7a4b07;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(43,34,36,.05), 0 6px 20px rgba(43,34,36,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1718;
    --surface: #262022;
    --surface-2: #30282a;
    --text: #f3ebe9;
    --muted: #b3a5a7;
    --line: #3b3133;
    --accent: #e48aa2;
    --accent-ink: #2a1219;
    --accent-soft: #43262e;
    --ok: #7fc59f;
    --warn-soft: #3d2f17;
    --warn-ink: #f2c98a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; }
h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ===== Layout ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font: 600 .8rem/1 var(--font-display); letter-spacing: .04em;
}
.brand-text { font-family: var(--font-display); font-size: 1.1rem; }
.icon-btn { color: var(--muted); padding: 8px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover, .icon-btn[aria-current="page"] { color: var(--accent); }

main { max-width: 520px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; font-size: .72rem; text-decoration: none; color: var(--muted);
  min-height: 56px;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tabbar.hidden, .icon-btn.hidden { display: none; }

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.card.soft { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card.alert { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }
.card.alert h2, .card.alert p { color: var(--warn-ink); }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ===== Buttons & forms ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 12px 18px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.danger { background: transparent; color: #b3261e; border-color: #e7b9b5; }
.btn + .btn, .btn-row { margin-top: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn { margin: 0; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
input[type="email"], input[type="date"], input[type="time"], select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px;
}
.choice-group { display: grid; gap: 10px; margin-bottom: 16px; border: 0; padding: 0; }
.choice-group legend { font-weight: 600; margin-bottom: 8px; font-size: .95rem; padding: 0; }
.choice {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer;
  background: var(--surface);
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); width: 20px; height: 20px; flex: none; }
.choice small { display: block; color: var(--muted); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 4px 0 14px; cursor: pointer; }
.consent input { accent-color: var(--accent); width: 20px; height: 20px; margin-top: 2px; flex: none; }

/* ===== Today ===== */
.hero { text-align: center; padding: 22px 18px; }
.hero h1 { margin-bottom: 4px; }
.check-btn {
  width: 168px; height: 168px; margin: 18px auto 10px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent);
  font: 600 1rem/1.25 var(--font); cursor: pointer; padding: 18px;
  -webkit-tap-highlight-color: transparent; transition: transform .15s ease;
}
.check-btn:active { transform: scale(.96); }
.check-btn svg { width: 40px; height: 40px; margin: 0 auto 6px; display: block; }
.check-btn.done { border-style: solid; background: var(--accent); color: var(--accent-ink); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font: 500 1.6rem/1.1 var(--font-display); }
.stat span { font-size: .8rem; color: var(--muted); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.day {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted); font: inherit; font-size: .72rem;
}
.day i {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); font-style: normal; font-size: .85rem; color: var(--text);
}
.day.on i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.today i { border-color: var(--accent); }
.day[disabled] { opacity: .35; cursor: default; }

.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; }
.card.alert .progress { background: rgba(0,0,0,.08); }

/* ===== Products ===== */
.product { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; }
.product img { width: 88px; height: 88px; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.product h3 { margin: 0 0 2px; }
.price { font-weight: 600; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }

/* ===== Lists ===== */
ul.clean { padding-left: 1.2em; margin: 0 0 .5em; }
ul.clean li { margin-bottom: .35em; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .85rem;
  display: grid; place-items: center;
}
.claim { font-family: var(--font-display); font-size: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px;
  font-size: .9rem; transition: all .2s ease; max-width: calc(100% - 32px); text-align: center; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
