:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #1d2523; --muted: #5d6a66; --line: #e2ded4;
  --brand: #1f5f5b; --brand-ink: #ffffff; --brand-soft: #e3efed;
  --ok: #2f7d4f; --ok-soft: #e4f3ea; --warn: #8a5a00; --warn-soft: #fbf0d9; --bad: #a3322a; --bad-soft: #fbe5e2;
  --bar: #d9e6e3; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615; --card: #1b2120; --ink: #e8eeec; --muted: #9db0ab; --line: #2c3533;
    --brand: #5fb3a9; --brand-ink: #0d1a18; --brand-soft: #1f3330;
    --ok: #6fcf97; --ok-soft: #173326; --warn: #f2c26b; --warn-soft: #33290f; --bad: #f08a80; --bad-soft: #3a1c19;
    --bar: #2a3634; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Layout */
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 8px; gap: 12px; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--brand); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
nav.tabs a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px;
}
nav.tabs a svg { width: 24px; height: 24px; }
nav.tabs a[aria-current="page"] { color: var(--brand); font-weight: 600; }
@media (min-width: 760px) {
  nav.tabs { position: static; border: 0; background: none; justify-content: flex-start; gap: 4px; padding: 0 0 12px; }
  nav.tabs a { flex: 0 0 auto; flex-direction: row; font-size: .95rem; padding: 8px 12px; }
  nav.tabs a svg { width: 18px; height: 18px; }
  nav.tabs a[aria-current="page"] { background: var(--brand-soft); }
  .shell { padding-bottom: 48px; }
  .toast { bottom: 24px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.hero { display: grid; gap: 6px; }
.hero .big { font-size: 2.2rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.hero .big small { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* Progress rows */
.req { padding: 10px 0; border-top: 1px solid var(--line); }
.req:first-child { border-top: 0; padding-top: 0; }
.req .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.req .label { font-weight: 600; }
.req .nums { white-space: nowrap; font-variant-numeric: tabular-nums; }
.req .sub { font-size: .85rem; color: var(--muted); margin-top: 3px; }
.bar { height: 8px; background: var(--bar); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.req.done .bar > i { background: var(--ok); }
.req.over .bar > i { background: var(--warn); }
.tick { color: var(--ok); font-weight: 700; }

/* Alerts */
.alert { border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; font-size: .93rem; border: 1px solid transparent; }
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--brand-soft); color: var(--ink); }

/* Forms */
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
label.f > em { display: block; font-style: normal; color: var(--muted); font-size: .82rem; margin-top: 3px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); margin: 0; }
label.check { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; }
.nums2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 0; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

button, .btn {
  font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.secondary, .btn.secondary { background: transparent; color: var(--brand); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; color: var(--brand); padding: 4px 6px; min-height: 0; font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.full { width: 100%; }

/* Week list */
.week { padding: 12px 0; border-top: 1px solid var(--line); }
.week:first-child { border-top: 0; padding-top: 0; }
.week .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.week .line { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; font-size: .92rem; }
.week .line .who { color: var(--muted); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.muted { background: var(--bar); color: var(--muted); }
.livebox { border-radius: 12px; padding: 10px 12px; margin: 4px 0 14px; font-size: .93rem; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-weight: 600; max-width: calc(100% - 32px);
}
.auth { max-width: 420px; margin: 8vh auto 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-item:first-of-type { border-top: 0; }
.hidden { display: none !important; }
table.mini { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.mini td, table.mini th { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
table.mini th:first-child, table.mini td:first-child { text-align: left; }
.btn svg, button svg { width: 18px; height: 18px; flex: none; }
header.top > .muted { min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { white-space: nowrap; }

/* ===== Landing page ===== */
.landing { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }
.lp-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 12px; }
.lp-nav { display: flex; gap: 14px; align-items: center; }
.lp-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.lp-hero { display: grid; gap: 28px; padding: 28px 0 40px; align-items: center; }
.lp-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.02em; margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.lp-hero-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.08); display: grid; gap: 10px; }
.mock-label { color: var(--muted); font-size: .9rem; }
.mock-big { font-size: 2.4rem; font-weight: 750; letter-spacing: -.02em; }
.mock-big small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.mock-alert { margin: 0; font-size: .88rem; }
@media (min-width: 860px) { .lp-hero { grid-template-columns: 1.15fr 1fr; padding: 56px 0 64px; } }

.lp-story { display: grid; gap: 24px; align-items: center; background: #101413; color: #eef3f1; border-radius: 22px; padding: 24px; margin: 8px 0 48px; }
.lp-story img { width: 100%; max-width: 360px; height: auto; border-radius: 16px; justify-self: center; display: block; }
.lp-story .eyebrow { color: #7fd1c6; }
.lp-story h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 12px; }
.lp-story p { color: #c9d6d2; font-size: 1.05rem; }
@media (min-width: 760px) { .lp-story { grid-template-columns: 340px 1fr; padding: 36px; gap: 40px; } }

.lp-features h2, .lp-pricing h2, .lp-faq h2, .lp-final h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 18px; }
.feature-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 48px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: 1fr 1fr 1fr; } }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.feature h3 { margin: 0 0 6px; }
.feature p { color: var(--muted); margin: 0; }

.price-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 48px; }
@media (min-width: 760px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price { display: flex; flex-direction: column; }
.price h3 { margin: 0 0 6px; }
.price-big { font-size: 2.2rem; font-weight: 750; margin: 0; }
.price-big small { font-size: .95rem; font-weight: 500; color: var(--muted); }
.price ul { padding-left: 18px; flex: 1; }
.price .btn { align-self: flex-start; }

.lp-faq { max-width: 760px; margin-bottom: 48px; }
.lp-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.lp-faq summary { font-weight: 650; cursor: pointer; }
.lp-faq details p { margin: 10px 0 0; color: var(--muted); }
.lp-final { text-align: center; background: var(--brand-soft); border-radius: 22px; padding: 36px 20px; margin-bottom: 28px; }
.lp-foot { text-align: center; }
