:root {
  --canvas: #f7f6f1;
  --ink: #20342e;
  --muted: #6d7972;
  --line: #e5e9e2;
  --leaf: #285e48;
  --leaf-soft: #e8f2e9;
  --warm: #f5efe0;
  --warm-ink: #796647;
  --shadow: 0 10px 35px rgba(28, 56, 42, .045);
}

html { background: var(--canvas); }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
}
.app-shell { min-height: 100vh; padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.container { max-width: 820px; }
.app-header { border-bottom: 1px solid rgba(32, 52, 46, .06); }
.brand-name { font-size: 1.08rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.2; }
.brand-mark { display: flex; gap: 3px; height: 13px; align-items: flex-end; margin-bottom: 3px; }
.brand-mark span { width: 11px; height: 4px; border-radius: 5px; background: #72a77c; transform: rotate(-22deg); }
.brand-mark span:nth-child(2) { height: 7px; background: #4c8665; }
.brand-mark span:nth-child(3) { height: 10px; background: var(--leaf); }
.header-note { color: #839087; font-size: .78rem; letter-spacing: .015em; }
main.container { padding-top: 27px; }
.section-kicker, .eyebrow {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-kicker { margin-bottom: 6px; }
.page-title { font-size: clamp(1.75rem, 6vw, 2.25rem); font-weight: 750; letter-spacing: -.045em; }
.subheading { color: var(--muted); font-size: .9rem; }
.stage-chip { flex: none; border-radius: 99px; background: var(--leaf-soft); color: var(--leaf); font-weight: 700; padding: 8px 12px; font-size: .78rem; white-space: nowrap; }
.card { border-radius: 22px; box-shadow: var(--shadow); }
.hero-card { background: linear-gradient(135deg, #e6efe4 0%, #f0f4e9 58%, #e5f0e9 100%); min-height: 215px; }
.hero-card.is-ready { background: linear-gradient(135deg, #e7f2e7, #f0f5e8); }
.hero-card.is-closed { background: #eef0ea; }
.hero-card.is-complete { background: linear-gradient(135deg, #dcece0, #f0f3e4); }
.hero-card .eyebrow { color: #4e6d5a; }
.hero-value { font-size: clamp(3.45rem, 16vw, 6rem); font-weight: 760; letter-spacing: -.07em; line-height: 1.05; margin-top: 18px; color: #173d2d; }
.hero-value.is-message { font-size: clamp(2.25rem, 8.5vw, 3.75rem); letter-spacing: -.055em; line-height: 1.1; max-width: 620px; }
.hero-detail { color: #4d6656; font-size: .99rem; margin-top: 12px; min-height: 24px; line-height: 1.45; }
.count-card, .quiet-card { background: #fff; }
.count-value { font-size: 2.6rem; font-weight: 750; letter-spacing: -.055em; line-height: 1.1; margin-top: 4px; }
.count-value span { font-size: 1.5rem; color: #839087; font-weight: 500; }
.goal-pill { background: #f3f6f0; color: #426452; border-radius: 12px; font-size: .76rem; padding: 8px 10px; font-weight: 700; text-align: center; max-width: 118px; }
.progress { height: 8px; background: #e9efe8; border-radius: 99px; overflow: hidden; }
.progress-bar { background: #5a9670; border-radius: 99px; transition: width .3s ease; }
.progress-bar.is-over { background: #be9b60; }
.small-note { color: var(--muted); font-size: .87rem; line-height: 1.45; }
.btn { border-radius: 13px; font-weight: 650; min-height: 45px; }
.btn-primary { background: var(--leaf); border-color: var(--leaf); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: #1e4b38 !important; border-color: #1e4b38 !important; }
.btn-outline-secondary { color: #4f6759; border-color: #cdd8cc; }
.btn-outline-secondary:hover, .btn-outline-secondary:focus { background: #edf2ec; border-color: #b8c9b9; color: var(--ink); }
.record-button { min-height: 70px; font-size: 1.07rem; letter-spacing: .055em; box-shadow: 0 8px 20px rgba(40, 94, 72, .15); }
.record-button.is-secondary { background: transparent; color: var(--leaf); border: 1.5px solid #a9c5ad; box-shadow: none; letter-spacing: 0; }
.record-button.is-secondary:hover, .record-button.is-secondary:focus { color: #fff; }
.last-log-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .88rem; padding: 0 4px; }
.last-log-row[hidden] { display: none; }
.last-log-row .btn-link { color: var(--leaf); text-decoration: none; font-weight: 700; }
.program-progress { height: 7px; }
.log-toggle { display: flex; justify-content: space-between; align-items: center; background: transparent; color: var(--ink); border: 0; border-radius: 22px; padding: 21px 24px; font-weight: 700; text-align: left; }
.toggle-symbol { color: var(--muted); font-size: 1.45rem; line-height: .6; transition: transform .2s; }
.log-toggle[aria-expanded="true"] .toggle-symbol { transform: rotate(180deg); }
.log-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 11px 0; }
.log-row time { font-size: 1.07rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.log-delay { font-size: .82rem; color: #558262; }
.card-title-small { font-size: 1.1rem; font-weight: 750; letter-spacing: -.02em; margin-bottom: 18px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; }
.stat-item { border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.stat-label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 3px; }
.stat-value { font-size: 1.22rem; line-height: 1.2; font-weight: 720; letter-spacing: -.02em; overflow-wrap: anywhere; }
.comparison-box { background: var(--leaf-soft); color: #325f42; padding: 14px 16px; border-radius: 14px; font-weight: 650; font-size: .92rem; line-height: 1.45; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border-left: 4px solid #a8c9af; border-radius: 15px; padding: 16px 18px; margin-bottom: 9px; box-shadow: var(--shadow); }
.history-row.is-over { border-left-color: #c6a66e; background: #fffdf9; }
.history-row .history-date { font-weight: 650; }
.history-row .history-status { font-size: .75rem; color: var(--muted); }
.history-row .history-count { font-size: 1.13rem; font-weight: 730; white-space: nowrap; }
.history-row .history-count span { color: var(--muted); font-weight: 500; }
.form-control { border-radius: 11px; min-height: 48px; border-color: #d5ded5; color: var(--ink); }
.form-control:focus { border-color: #76a985; box-shadow: 0 0 0 .2rem rgba(85, 151, 106, .14); }
.settings-save { min-height: 52px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -5px 25px rgba(30, 50, 40, .055); padding-bottom: env(safe-area-inset-bottom); z-index: 1020; backdrop-filter: blur(12px); }
.nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); padding-left: 8px; padding-right: 8px; }
.nav-item-app { border: 0; background: none; color: #85918a; min-height: 69px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; font-size: .69rem; font-weight: 650; padding: 5px 1px; }
.nav-item-app.active { color: var(--leaf); }
.nav-glyph { font-size: 1.32rem; line-height: 1; font-weight: 400; }
.modal-content { border: 0; border-radius: 22px; box-shadow: 0 15px 45px rgba(20, 40, 28, .15); }
.onboarding-content { background: #f6f8f3; }
.onboarding-content p { color: #55695c; line-height: 1.55; }
.onboarding-mark { width: 44px; height: 44px; border-radius: 13px; background: #dcecdf; color: var(--leaf); font-weight: 700; font-size: 1.5rem; display: grid; place-items: center; margin-bottom: 20px; }
.toast { border-radius: 13px; border: 0; box-shadow: 0 8px 30px rgba(20, 40, 28, .12); color: var(--ink); }
[hidden] { display: none !important; }

@media (min-width: 600px) {
  .hero-card { min-height: 235px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-item-app { font-size: .79rem; }
}
