:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --text: #15201b;
  --muted: #5a6a63;
  --line: #dce4e0;
  --accent: #1d7a58;
  --accent-ink: #ffffff;
  --accent-soft: #e1f1ea;
  --warn: #8a5300;
  --warn-soft: #fff3dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --go: #23a26d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 26, .06), 0 4px 16px rgba(16, 32, 26, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1311;
    --surface: #161d1a;
    --surface-2: #1d2622;
    --text: #e6eeea;
    --muted: #97a8a0;
    --line: #27322d;
    --accent: #43b98d;
    --accent-ink: #04130d;
    --accent-soft: #173027;
    --warn: #f0b45a;
    --warn-soft: #2b2112;
    --bad: #f0857b;
    --bad-soft: #321a18;
    --go: #2fc283;
    --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);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { justify-content: center; text-align: center; }
.hidden { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 44px; padding: .55em 1.1em;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 54px; font-size: 1.05rem; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.two > * { flex: 1 1 0; }
.stack { display: grid; gap: 14px; }

/* site header / footer */
.site-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.site-foot .cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-foot h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-foot a { color: var(--muted); }

/* landing */
.hero { padding: 36px 0 28px; display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr .9fr; padding: 64px 0 48px; } }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.hero .row { margin-top: 8px; }
.phone {
  justify-self: center; width: min(320px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  padding: 18px; box-shadow: var(--shadow);
}
.phone .mini-count { font-size: 3.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.phone .mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.phone .mini-stat { background: var(--surface-2); border-radius: 12px; padding: 10px; }
.phone .mini-stat b { display: block; font-size: 1.15rem; }
.phone svg { width: 100%; height: auto; margin-top: 12px; }
.section { padding: 36px 0; }
.section > h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); margin-bottom: .8em; letter-spacing: -.01em; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tile h3 { font-size: 1.05rem; }
.tile p:last-child { margin-bottom: 0; }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; list-style: none; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 58px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; }
.price-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.price.pro { border-color: var(--accent); }
.price .amt { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.price ul { padding-left: 1.1em; margin: 12px 0 0; }
.price li { margin-bottom: 6px; }
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 650; }
details.faq p { margin: 10px 0 0; color: var(--muted); }
.help { background: var(--warn-soft); color: var(--text); border-radius: var(--radius); padding: 16px 18px; }
.help strong { color: var(--warn); }

/* tables (compare pages) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.6em; }
.crumbs { font-size: .875rem; color: var(--muted); margin: 8px 0 18px; }
.crumbs a { color: var(--muted); }

/* app shell */
.app-body { min-height: 100vh; min-height: 100dvh; }
.app-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.app-main { padding-bottom: 48px; display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: .35em; }
.card > :last-child { margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .07em; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.hero-count { text-align: center; padding: 26px 18px; }
.count { display: flex; justify-content: center; align-items: baseline; gap: 10px; }
.count #c-days { font-size: clamp(4rem, 22vw, 6rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.count-unit { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.count-sub { font-variant-numeric: tabular-nums; color: var(--muted); margin: 6px 0 18px; }
.milestone { text-align: left; }
.ms-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: .92rem; font-weight: 600; }
.ms-head h2 { margin: 0; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }
.bar.thin { height: 6px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 2px; }
.stat-v { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .85rem; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 99px; padding: 7px 14px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; }
.tab[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.clarity-score { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 8px; }
.clarity-score .big { font-size: 2.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.delta { font-weight: 700; font-size: .95rem; }
.delta.up { color: var(--accent); }
.delta.down { color: var(--bad); }
.chart { width: 100%; height: auto; display: block; margin: 6px 0 12px; }
.chart .base { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; opacity: .6; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.breakdown div { background: var(--surface-2); border-radius: 12px; padding: 10px; font-size: .85rem; color: var(--muted); }
.breakdown b { display: block; color: var(--text); font-size: 1.05rem; }
.trig-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.trig-list li { background: var(--surface-2); border-radius: 99px; padding: 4px 11px; font-size: .85rem; }

/* forms */
.field { display: grid; gap: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding-left: 12px; }
.input-prefix span { color: var(--muted); font-weight: 600; }
.input-prefix input { border: 0; min-height: 44px; }
.input-prefix:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-prefix input:focus { outline: none; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 64px; padding: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 650; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.chips legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .92rem; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.note { border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.note.warn { background: var(--warn-soft); }
.note.warn strong { color: var(--warn); }

/* brain check */
.test-head { margin-bottom: 14px; }
.step { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pad {
  width: 100%; height: min(52vh, 360px); border: 0; border-radius: 20px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.pad.wait { background: #c9473d; color: #fff; }
.pad.go { background: var(--go); color: #fff; }
.pad.early { background: var(--warn-soft); color: var(--text); }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }
.memo-show { font-size: clamp(2.2rem, 11vw, 3.6rem); font-weight: 800; letter-spacing: .12em; text-align: center; padding: 48px 0 28px; font-variant-numeric: tabular-nums; word-break: break-all; }
.memo-input { font-size: 1.6rem !important; letter-spacing: .1em; text-align: center; font-variant-numeric: tabular-nums; }
.feedback { text-align: center; font-weight: 700; min-height: 1.5em; }
.feedback.ok { color: var(--accent); }
.feedback.no { color: var(--bad); }
.flank { font-size: clamp(2.6rem, 14vw, 4.2rem); text-align: center; padding: 48px 0; letter-spacing: .08em; font-weight: 700; user-select: none; -webkit-user-select: none; min-height: 1.5em; }
.arrow-btn { min-height: 76px; font-size: 2rem; }
.result-score { font-size: 4.5rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; text-align: center; margin: 6px 0; }

/* urge timer */
.urge { text-align: center; padding: 28px 18px; }
.breath { position: relative; width: 210px; height: 210px; margin: 10px auto 18px; display: grid; place-items: center; }
.breath-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); transform: scale(.55); animation: breathe 16s ease-in-out infinite; }
.breath span { position: relative; font-weight: 700; }
@keyframes breathe { 0% { transform: scale(.55); } 25% { transform: scale(1); } 50% { transform: scale(1); } 75% { transform: scale(.55); } 100% { transform: scale(.55); } }
@media (prefers-reduced-motion: reduce) { .breath-ring { animation: none; transform: scale(.8); } }
.urge-time { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tip { color: var(--muted); min-height: 3em; max-width: 26em; margin: 8px auto 16px; }

/* dialogs + toast */
dialog.sheet { border: 0; padding: 0; background: transparent; width: min(520px, 100vw); max-width: 100vw; margin: auto auto 0; }
@media (min-width: 600px) { dialog.sheet { margin: auto; } }
dialog.sheet::backdrop { background: rgba(5, 12, 9, .45); }
dialog.sheet > form, dialog.sheet > div { background: var(--surface); color: var(--text); border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; }
@media (min-width: 600px) { dialog.sheet > form, dialog.sheet > div { border-radius: 20px; } }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: .92rem; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 7px; vertical-align: middle; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
