:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --ink: #102218;
  --muted: #5d6f64;
  --line: #d5e4d5;
  --paper: #f1f8ef;
  --surface: rgba(255, 255, 255, 0.88);
  --green: #0f6b3c;
  --green-soft: #cef2cb;
  --leaf-dark: #073c23;
  --leaf-mid: #0c7a43;
  --leaf-bright: #31c56c;
  --lime: #91db55;
  --blue: #2568ae;
  --blue-soft: #d8eaff;
  --violet: #7b43ad;
  --violet-soft: #ead9f7;
  --orange: #a84e1c;
  --orange-soft: #ffe0ca;
  --pink: #a83660;
  --pink-soft: #f9d7e3;
  --teal: #147078;
  --teal-soft: #caeeee;
  --danger: #8e263a;
  --shadow: 0 20px 60px rgba(31, 68, 47, 0.13);
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

html { background: #d7e5d3; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 2%, rgba(92, 189, 104, .22), transparent 28%),
    radial-gradient(circle at 8% 92%, rgba(154, 218, 95, .16), transparent 25%),
    #e9f2e6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(17, 46, 29, 0.16);
  position: relative;
  overflow-x: hidden;
}

.app-main {
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 8px) 18px calc(92px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 16px;
}

.brand { display: flex; align-items: center; min-width: 0; }
.topbar-logo { display: block; width: 188px; max-width: 66vw; height: 42px; object-fit: contain; object-position: left center; }
.topbar-logo-small { width: 150px; height: 36px; object-position: center; }

.icon-btn, .back-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 15px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 25px rgba(27,55,37,.08);
  cursor: pointer;
}
.back-btn { font-size: 24px; }

.hero {
  position: relative;
  padding: 26px;
  min-height: 280px;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 92% 12%, rgba(130, 231, 117, .23), transparent 34%),
    linear-gradient(145deg, #052f1b, #0c5f34 58%, #187e44);
  color: white;
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(195, 255, 175, .10);
}
.hero::before { width: 230px; height: 230px; right: -75px; top: -90px; }
.hero::after { width: 150px; height: 150px; left: -55px; bottom: -90px; }
.eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #81d99c; }
.hero h1 { position: relative; margin: 0; font-size: clamp(2rem, 8vw, 2.7rem); line-height: 1.02; letter-spacing: -.05em; }
.hero-copy { position: relative; max-width: 330px; margin: 14px 0 24px; color: #d9eee1; font-size: 1rem; line-height: 1.5; }
.hero-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  padding: 12px 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #d6f9ca, #9ae47a); color: #0b4a29; box-shadow: 0 10px 26px rgba(3,24,13,.22); }
.btn-secondary { background: rgba(255,255,255,.13); color: white; border: 1px solid rgba(255,255,255,.2); }
.btn-dark { background: var(--ink); color: white; }
.btn-ghost { background: #edf5f0; color: var(--ink); }
.btn-danger { background: #fff0f2; color: var(--danger); }
.btn-wide { width: 100%; }

.progress-row { display: grid; grid-template-columns: 82px 1fr; gap: 16px; align-items: center; margin: 18px 0 0; }
.progress-ring { --p: 0; position: relative; width: 82px; height: 82px; border-radius: 50%; background: conic-gradient(#9ee375 calc(var(--p) * 1%), rgba(255,255,255,.14) 0); display: grid; place-items: center; }
.progress-ring::before { content: ""; width: 62px; height: 62px; border-radius: 50%; background: #124f35; position: absolute; }
.progress-ring strong { position: relative; font-size: 1rem; }
.progress-copy strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.progress-copy span { color: #c9ddd0; font-size: .88rem; line-height: 1.35; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.section h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.025em; }
.section-link { border: 0; background: none; color: var(--green); font-weight: 800; cursor: pointer; padding: 7px 0; }

.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.route-card {
  min-height: 112px;
  text-align: left;
  border: 1px solid rgba(24, 74, 44, .06);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 30px rgba(30, 68, 45, .07);
  cursor: pointer;
}
.route-icon { width: 31px; height: 31px; border-radius: 11px 11px 11px 3px; display: flex; align-items: center; justify-content: center; margin: 0 0 12px; padding: 0; color: var(--green); background: linear-gradient(145deg, #dff5d6, #c2edc2); font-size: .82rem; font-weight: 900; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.route-card strong { display: block; font-size: .94rem; line-height: 1.25; }
.route-card > span:not(.route-icon) { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; }

.tool-list { display: grid; gap: 11px; }
.tool-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 13px;
  align-items: center;
  border: 0;
  border-radius: 22px;
  padding: 15px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 32px rgba(30,68,45,.065);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.tool-no { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-weight: 900; color: var(--accent); background: var(--soft); }
.tool-card strong { display: block; font-size: .98rem; line-height: 1.25; }
.tool-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.tool-arrow { color: var(--accent); font-size: 1.25rem; }
.tool-card.done .tool-no::after { content: "✓"; font-size: 1rem; }
.tool-card.done .tool-no { font-size: 0; }

.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: -2px -18px 16px; padding: 2px 18px 7px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); border-radius: 999px; background: white; padding: 10px 14px; color: var(--muted); font-size: .88rem; font-weight: 700; cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: white; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 10px calc(8px + var(--safe-bottom));
  background: rgba(249, 253, 250, .9);
  backdrop-filter: blur(22px) saturate(140%);
  border-top: 1px solid rgba(33,65,44,.1);
}
.nav-btn { border: 0; background: transparent; min-height: 51px; color: #758078; border-radius: 16px; font-weight: 750; font-size: .69rem; cursor: pointer; }
.nav-btn span { display: block; font-size: 1.18rem; line-height: 1.2; margin-bottom: 2px; }
.nav-btn.active { color: var(--green); background: #def2d7; }

.screen-title { margin: 3px 0 7px; font-size: 2rem; line-height: 1.08; letter-spacing: -.045em; }
.screen-subtitle { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }

.tool-hero { --accent: var(--green); --soft: var(--green-soft); position: relative; border-radius: 30px 30px 30px 8px; padding: 24px; overflow: hidden; background: linear-gradient(150deg, white, color-mix(in srgb, var(--soft) 48%, white)); box-shadow: var(--shadow); border: 1px solid rgba(25, 101, 55, .07); }
.tool-hero::after { content: ""; position: absolute; width: 145px; height: 145px; border-radius: 50%; right: -55px; top: -65px; background: var(--soft); opacity: .5; }
.leaf-window { position: absolute; overflow: hidden; pointer-events: none; }
.leaf-window img { display: block; width: auto; max-width: none; }
.hero-leaf { width: 184px; height: 230px; right: -31px; top: -4px; opacity: .20; z-index: 0; }
.hero-leaf img { height: 230px; }
.tool-leaf { width: 118px; height: 142px; right: -20px; top: -8px; opacity: .10; z-index: 0; }
.tool-leaf img { height: 142px; }
.tool-kicker { position: relative; z-index: 1; display: inline-flex; padding: 7px 11px; border-radius: 999px; background: var(--soft); color: var(--accent); font-size: .74rem; font-weight: 850; text-transform: uppercase; letter-spacing: .055em; }
.tool-hero h1 { position: relative; z-index: 1; margin: 15px 0 12px; max-width: 330px; font-size: 2rem; line-height: 1.06; letter-spacing: -.045em; }
.tool-purpose { position: relative; z-index: 1; margin: 0; font-size: 1.04rem; line-height: 1.52; font-weight: 700; }
.when { position: relative; z-index: 1; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); color: var(--muted); line-height: 1.5; }
.when strong { color: var(--accent); }

.step-list { display: grid; gap: 11px; }
.check-row { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; border-radius: 20px; padding: 16px; background: white; box-shadow: 0 9px 25px rgba(28,63,41,.06); cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.fake-check { width: 28px; height: 28px; border: 2px solid var(--accent); border-radius: 9px; display: grid; place-items: center; color: white; background: white; font-weight: 900; transition: .16s ease; }
.check-row input:checked + .fake-check { background: var(--accent); }
.check-row input:checked + .fake-check::after { content: "✓"; }
.check-copy strong { display: block; margin: 2px 0 5px; color: var(--accent); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.check-copy span { display: block; line-height: 1.48; }

.form-card, .info-card { border-radius: 24px 24px 24px 7px; padding: 18px; background: white; box-shadow: 0 10px 30px rgba(30,68,45,.07); }
.form-card label { display: block; margin-bottom: 9px; color: var(--accent, var(--green)); font-size: .83rem; font-weight: 850; }
.form-card textarea, .text-input {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #f9fcfa;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
  outline: none;
}
.text-input { min-height: 48px; resize: none; }
.form-card textarea:focus, .text-input:focus { border-color: var(--accent, var(--green)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--green)) 13%, transparent); }
.saved-note { min-height: 18px; margin: 7px 2px 0; color: var(--muted); font-size: .74rem; }

.section-head-stacked { display: block; }
.section-head-stacked h2 { margin-bottom: 7px; }
.section-head-stacked p { margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.45; }
.quality-list { display: grid; gap: 12px; border-left: 4px solid var(--accent, var(--green)); }
.quality-item { display: flex; align-items: center; gap: 10px; min-height: 32px; line-height: 1.4; }
.quality-item input { width: 19px; height: 19px; accent-color: var(--accent, var(--green)); flex: 0 0 19px; margin: 0; }
.quality-item span { flex: 1; }
.warning-card { border-radius: 22px; padding: 18px; color: #7b3228; background: #fff0ed; }
.warning-card h3 { margin: 0 0 9px; font-size: 1rem; }
.warning-card ul { margin: 0; padding-left: 20px; line-height: 1.5; }

.completion-card { position: relative; overflow: hidden; border-radius: 25px 25px 25px 8px; padding: 20px; background: linear-gradient(145deg, #071d12, #0a3f25); color: white; }
.completion-card h3 { margin: 0 0 8px; font-size: 1.2rem; }
.completion-card p { margin: 0 0 16px; color: #cfe0d5; line-height: 1.45; }

.protocol-page { min-height: 100dvh; margin: calc(-1 * (var(--safe-top) + 8px)) -18px calc(-1 * (92px + var(--safe-bottom))); padding: calc(var(--safe-top) + 16px) 18px calc(100px + var(--safe-bottom)); color: white; background: linear-gradient(165deg, #10283f, #245a83); }
.protocol-page .back-btn { background: rgba(255,255,255,.12); color: white; }
.protocol-page .screen-subtitle { color: #cfe6f7; }
.timer-card { border-radius: 31px; padding: 24px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.timer-display { margin: 6px 0 18px; font-size: 4rem; line-height: 1; font-weight: 850; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; gap: 10px; }
.protocol-steps { display: grid; gap: 11px; margin-top: 18px; }
.protocol-step { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.09); color: #ddebfa; opacity: .68; }
.protocol-step.active { background: white; color: #18344c; opacity: 1; box-shadow: 0 15px 35px rgba(0,0,0,.18); }
.protocol-step.done { opacity: .92; }
.protocol-time { color: #9ed3fa; font-weight: 850; }
.protocol-step.active .protocol-time { color: #266991; }
.protocol-step strong { display: block; margin-bottom: 4px; }
.protocol-step p { margin: 0; font-size: .9rem; line-height: 1.4; }

.safety-banner { border: 0; width: 100%; text-align: left; border-radius: 23px; padding: 18px; background: linear-gradient(135deg, #531626, #872f45); color: white; cursor: pointer; }
.safety-banner strong { display: block; margin-bottom: 5px; }
.safety-banner span { color: #f7dce3; line-height: 1.4; font-size: .9rem; }
.safety-page { background: #501728; color: white; min-height: 100dvh; margin: calc(-1 * (var(--safe-top) + 8px)) -18px calc(-1 * (92px + var(--safe-bottom))); padding: calc(var(--safe-top) + 16px) 18px calc(92px + var(--safe-bottom)); }
.safety-page .back-btn { background: rgba(255,255,255,.12); color: white; }
.safety-page .screen-subtitle { color: #f1cfd8; }
.safety-grid { display: grid; gap: 12px; }
.safety-card { padding: 19px; border-radius: 23px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.11); }
.safety-card h2 { margin: 0 0 8px; font-size: 1.07rem; color: #ffd5e0; }
.safety-card p { margin: 0; line-height: 1.5; color: white; }

.week-list { display: grid; gap: 11px; }
.week-item { display: grid; grid-template-columns: 44px 1fr 24px; gap: 12px; align-items: center; padding: 16px; border-radius: 21px; background: white; box-shadow: 0 9px 28px rgba(30,68,45,.06); cursor: pointer; }
.week-day { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-weight: 900; }
.week-item strong { display: block; }
.week-item small { display: block; margin-top: 4px; color: var(--muted); }
.week-item input { width: 21px; height: 21px; accent-color: var(--teal); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.stat-card { padding: 19px; border-radius: 22px; background: white; box-shadow: 0 10px 30px rgba(30,68,45,.07); }
.stat-card strong { display: block; font-size: 1.85rem; letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-size: .82rem; }
.settings-list { display: grid; gap: 10px; }
.settings-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-radius: 19px; padding: 16px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.settings-row strong { display: block; }
.settings-row small { display: block; margin-top: 4px; color: var(--muted); }

.empty { padding: 35px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 22px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%, 20px); max-width: calc(100% - 36px); padding: 12px 16px; border-radius: 14px; background: #102019; color: white; box-shadow: 0 14px 35px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: .2s ease; font-size: .9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

@media (min-width: 760px) {
  .app-shell { margin-top: 24px; margin-bottom: 24px; min-height: calc(100dvh - 48px); border-radius: 34px; }
  .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
}

@media (max-width: 370px) {
  .app-main { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 21px; }
  .route-grid { grid-template-columns: 1fr; }
  .tool-hero h1, .screen-title { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
