/* Daily Pals design system: light, friendly, bold headlines. Brand colors come from :root vars set per site. */
:root {
  --brand: #0f766e; --brand-ink: #0b5a54; --tint: #ecfdf8; --tint-line: #c6f0e4; --accent: #f59e0b;
  --ink: #0f172a; --body: #334155; --muted: #64748b; --faint: #94a3b8;
  --bg: #ffffff; --soft: #f6f8fb; --card: #ffffff; --line: #e5e9f0; --line-strong: #d5dbe5;
  --ok: #15803d; --ok-tint: #e9f7ee; --warn: #92400e; --warn-tint: #fff6e5; --danger: #c2261d; --danger-tint: #fdecea;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 17px/1.55 var(--font); color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, b, strong { color: var(--ink); }
h1, h2, h3 { letter-spacing: -.025em; line-height: 1.1; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
button { font: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-weight: 650; font-size: 16px; text-decoration: none; cursor: pointer; line-height: 1.2; min-height: 48px; transition: transform .06s ease, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn.primary:hover { background: var(--brand-ink); }
.btn.big { padding: 16px 26px; font-size: 18px; min-height: 58px; }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); box-shadow: none; }
.btn.soft { background: var(--tint); border-color: var(--tint-line); color: var(--brand-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger-tint); background: var(--danger-tint); }
.btn.sm { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }

/* ---------- Landing ---------- */
.blobs { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.blobs i:nth-child(1) { width: 520px; height: 520px; background: var(--tint-line); top: -160px; right: -120px; }
.blobs i:nth-child(2) { width: 420px; height: 420px; background: color-mix(in srgb, var(--accent) 30%, white); top: 220px; left: -180px; opacity: .35; }
.nav { display: flex; align-items: center; gap: 12px; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 19px; letter-spacing: -.02em; }
.logo .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); display: grid; place-items: center; font-size: 20px; box-shadow: var(--shadow); }
.nav .spacer { flex: 1; }
.nav .logo { white-space: nowrap; }
@media (max-width: 480px) { .nav .btn.ghost { display: none; } .nav .logo { font-size: 17px; } }
.hero { position: relative; padding: 40px 0 70px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; color: var(--brand-ink); background: var(--tint); border: 1px solid var(--tint-line); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(38px, 6vw, 62px); font-weight: 850; margin: 18px 0 16px; }
.hero p.lead { font-size: 20px; color: var(--body); margin: 0 0 28px; max-width: 34em; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; color: var(--muted); font-size: 15px; }
.trust span { display: inline-flex; gap: 6px; align-items: center; }
.phone { background: #fff; border: 1px solid var(--line); border-radius: 34px; box-shadow: 0 30px 80px rgba(15, 23, 42, .18); padding: 10px; max-width: 360px; margin: 0 auto; overflow: hidden; }
.phone img { border-radius: 26px; }
section.band { padding: 70px 0; }
section.band.soft { background: var(--soft); }
.band h2 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 820; margin: 0 0 12px; }
.band .sub { font-size: 19px; color: var(--muted); margin: 0 0 36px; max-width: 40em; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feat .n { width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; font-size: 20px; }
.feat h3 { font-size: 20px; margin: 0 0 6px; }
.feat p { margin: 0; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.price-card { max-width: 460px; margin: 0 auto; background: var(--card); border: 2px solid var(--tint-line); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); text-align: center; }
.price-card .amount { font-size: 54px; font-weight: 850; color: var(--ink); letter-spacing: -.03em; }
.price-card .per { font-size: 18px; color: var(--muted); font-weight: 600; }
.price-card ul { text-align: left; padding: 0; list-style: none; margin: 20px 0 24px; }
.price-card li { padding: 7px 0 7px 30px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 18px; list-style: none; display: flex; justify-content: space-between; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 24px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 10px 0 0; color: var(--muted); }
footer.site { padding: 40px 0 60px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer.site a { color: var(--muted); }
footer.site .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0; }
.legal { padding: 30px 0 60px; }
.legal h1 { font-size: 36px; }
.legal h2 { font-size: 22px; margin-top: 30px; }

/* ---------- App shell ---------- */
body.app { background: var(--soft); min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.topbar .logo { font-size: 17px; }
.topbar .logo .mark { width: 30px; height: 30px; font-size: 17px; border-radius: 9px; }
.topbar .spacer { flex: 1; }
main.view { max-width: 640px; margin: 0 auto; padding: 18px 18px 30px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar .in { max-width: 640px; margin: 0 auto; display: flex; }
.tabbar button { flex: 1; border: 0; background: none; padding: 9px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; color: var(--faint); cursor: pointer; }
.tabbar button svg.i { width: 23px; height: 23px; }
.tabbar button.on { color: var(--brand); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.hero-card { background: linear-gradient(150deg, var(--tint), var(--card) 75%); border-color: var(--tint-line); }
.card.flat { box-shadow: none; }
.card h2 { font-size: 22px; margin: 0 0 6px; }
.card h3 { font-size: 18px; margin: 0 0 4px; }
.kicker { font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); }
.section-label { font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 22px 4px 10px; }
.title-xl { font-size: 28px; font-weight: 850; color: var(--ink); letter-spacing: -.025em; line-height: 1.15; margin: 4px 0 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.stat .v { font-size: 24px; font-weight: 850; color: var(--ink); letter-spacing: -.02em; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .4s; }

/* Lesson item */
.item { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: 10px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.item:hover { border-color: var(--tint-line); }
.item .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--tint); color: var(--brand-ink); display: grid; place-items: center; flex: none; font-size: 20px; font-weight: 800; }
.item.done .ic { background: var(--ok); color: #fff; }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; font-size: 16.5px; }
.item .tx span { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.badge.brand { background: var(--tint); color: var(--brand-ink); border-color: var(--tint-line); }
.badge.ok { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; margin: 12px 0; background: var(--warn-tint); color: var(--warn); }
.note.info { background: var(--tint); color: var(--brand-ink); }
.note.ok { background: var(--ok-tint); color: var(--ok); }
.note.bad { background: var(--danger-tint); color: var(--danger); }

/* Lesson detail */
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
.steps-list li { counter-increment: s; position: relative; padding: 12px 0 12px 48px; border-top: 1px solid var(--line); }
.steps-list li:first-child { border-top: 0; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.checkin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.checkin button { border: 1.5px solid var(--line-strong); background: var(--card); border-radius: 14px; padding: 12px 6px; cursor: pointer; font-weight: 650; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14.5px; }
.checkin button .e { font-size: 24px; }
.checkin button:hover { border-color: var(--brand); }

/* Quiz */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.quiz-top .bar { flex: 1; }
.q-title { font-size: 27px; font-weight: 850; color: var(--ink); letter-spacing: -.025em; line-height: 1.2; margin: 6px 0 8px; }
.q-help { color: var(--muted); margin: 0 0 18px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line-strong); background: var(--card); border-radius: 16px; padding: 15px 16px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); font-weight: 650; width: 100%; }
.opt small { display: block; color: var(--muted); font-weight: 500; font-size: 14px; }
.opt.on { border-color: var(--brand); background: var(--tint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.opt .tick { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: #fff; font-size: 14px; flex: none; }
.opt.on .tick { background: var(--brand); border-color: var(--brand); }
input.field, select.field, textarea.field { width: 100%; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; font: inherit; font-size: 18px; color: var(--ink); background: var(--card); }
input.field:focus, select.field:focus, textarea.field:focus { outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent); border-color: var(--brand); }
label.lbl { display: block; font-weight: 650; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.debt { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; background: var(--card); }
.debt .g { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.debt input.field { font-size: 16px; padding: 11px 12px; }

/* Paywall */
.plans { display: grid; gap: 10px; margin: 14px 0; }
.plan-opt { position: relative; }
.plan-opt .save { position: absolute; top: -10px; right: 14px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 16px; white-space: pre-wrap; font-size: 16px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink); }
.composer { display: flex; gap: 8px; position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: var(--soft); padding: 10px 0; }

/* Tasks (Tiny Wins) */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.task .chk { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line-strong); background: var(--card); flex: none; cursor: pointer; display: grid; place-items: center; color: #fff; font-weight: 900; }
.task.done .chk { background: var(--ok); border-color: var(--ok); }
.task.done .tt { text-decoration: line-through; color: var(--faint); }
.task .tt { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.task .sub { margin: 8px 0 0; padding: 0; list-style: none; font-weight: 500; }
.task .sub li { display: flex; gap: 8px; align-items: center; padding: 4px 0; color: var(--body); font-size: 15px; cursor: pointer; }
.task .sub li.d { text-decoration: line-through; color: var(--faint); }
.timer { font-size: 64px; font-weight: 850; text-align: center; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .9; } }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }

/* Debt chart */
.chart svg { width: 100%; height: 160px; display: block; }
.big-date { font-size: 40px; font-weight: 850; color: var(--ink); letter-spacing: -.03em; line-height: 1.05; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.building { text-align: center; padding: 70px 10px; }
.building .mark { font-size: 54px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

@media (max-width: 820px) {
  .hero-grid, .grid2 { grid-template-columns: 1fr; }
  .steps3 { grid-template-columns: 1fr; }
  .hero { padding-top: 10px; }
  .hero p.lead { font-size: 18px; }
  .debt .g { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
