@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-display-var.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff") format("woff"); font-weight: 100 900; font-display: swap; }
:root {
  --sand: #dbd1bd; --sand-2: #e9e2d4; --paper: #f7f3ec; --olive: #434a00; --olive-2: #5b6410;
  --ink: #272727; --brown: #764d40; --muted: #5d5850; --line: #c9bea8;
  --serif: "Playfair Display", Georgia, serif; --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 4px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; color: var(--olive); line-height: 1.2; }
h1 { font-size: 30px; } h2 { font-size: 22px; margin-bottom: 4px; } h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--olive); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 14px; }
.label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--brown); font-weight: 600; margin-bottom: 6px; }
.banner { background: var(--brown); color: #fff; font-size: 13px; text-align: center; padding: 7px 14px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.brand { font-family: var(--serif); font-size: 20px; color: var(--olive); }
.mark { width: 36px; height: 36px; border-radius: 10px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font-size: 18px; color: var(--olive); cursor: pointer; }
.iconbtn-spacer { width: 40px; }
.card { background: var(--paper); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 0 rgba(0,0,0,.04); text-decoration: none; color: inherit; }
.soft { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sand-2); }
.hero { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 12px 6px; }
.hero-mark { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 8px 24px rgba(67,74,0,.25); }
.hero h1 { font-size: 40px; }
.lead { font-size: 17px; }
.price { font-weight: 600; color: var(--brown); }
.btn { display: block; width: 100%; text-align: center; border: 0; border-radius: 999px; padding: 14px 18px; font: 600 16px var(--sans); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--olive); color: #fff; }
.btn.ghost { background: transparent; color: var(--olive); border: 1.5px solid var(--olive); }
.btn.danger { background: transparent; color: #8a2b1f; border: 1.5px solid #8a2b1f; }
.btn.small-btn { width: auto; align-self: flex-start; padding: 9px 16px; font-size: 14px; background: var(--olive); color: #fff; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; cursor: pointer; align-self: flex-start; padding: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.field input { font: 16px var(--sans); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.field input:focus, .chip:focus-visible, .btn:focus-visible { outline: 3px solid rgba(67,74,0,.35); outline-offset: 2px; }
form { display: flex; flex-direction: column; gap: 14px; }
.consents { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; background: var(--sand-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--olive); }
.check em { color: var(--muted); font-style: normal; font-size: 13px; }
.error { color: #8a2b1f; font-size: 14px; min-height: 0; }
.error:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 9px 14px; font: 15px var(--sans); cursor: pointer; text-align: left; }
.chip.on { background: var(--olive); color: #fff; border-color: var(--olive); font-weight: 600; }
.group { display: flex; flex-direction: column; gap: 10px; }
.prompt { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.tip { background: #fff; border-left: 4px solid var(--brown); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.tip .label { margin-bottom: 2px; }
.greet { font-size: 32px; margin-top: 4px; }
.orbit { width: 100%; max-width: 360px; margin: 0 auto; display: block; }
.orbit .ring { fill: none; stroke: var(--olive); stroke-opacity: .35; stroke-dasharray: 4 6; }
.orbit .you { fill: var(--olive); }
.orbit .you-t { fill: #fff; font: 600 17px var(--sans); }
.orbit .you-s { fill: var(--sand); font: 11px var(--sans); }
.orbit .sat circle:first-child { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.orbit .sat.seen circle:first-child { stroke: var(--brown); stroke-width: 2.5; }
.orbit .sat text { fill: var(--ink); font: 500 13px var(--sans); }
.orbit .dot { fill: var(--brown); }
.orbit a { cursor: pointer; }
.nudge { background: var(--olive); color: #fff; }
.nudge .label { color: var(--sand); }
.nudge p:not(.label):not(.nudge-src) { font-family: var(--serif); font-size: 18px; line-height: 1.4; margin: 0; }
.nudge .nudge-src { color: var(--sand); opacity: .9; margin: 0; }
.sub-cta { background: var(--brown); color: #fff; }
.sub-cta span { font-size: 14px; opacity: .9; }
.plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan li { display: flex; flex-direction: column; border-bottom: 1px solid var(--sand-2); padding-bottom: 6px; }
.plan li span { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--brown); }
.seg { display: flex; background: var(--sand-2); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 10px; font: 600 15px var(--sans); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--olive); color: #fff; }
.area-title { font-size: 32px; }
.reframe { font-family: var(--serif); font-size: 18px; color: var(--olive); }
.recipe { background: #fff; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.recipe ol { margin: 0; padding-left: 20px; }
.note { background: var(--sand-2); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 15px; z-index: 50; max-width: 90vw; }
.crisis { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--sand-2); }
.crisis a { font-weight: 600; }
/* legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: 18px; }
.legal h1 { font-size: 30px; margin: 10px 0; } .legal h2 { margin-top: 24px; font-size: 20px; }
.legal p, .legal li { margin: 8px 0; }
.draft { background: #8a2b1f; color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* period tracker */
.period-link { flex-direction: row; align-items: center; gap: 14px; }
.period-link .chev { margin-left: auto; font-size: 26px; color: var(--olive); }
.period-dot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #b5654f; box-shadow: inset 0 0 0 6px #e6c2b5; }
.period-since { font-size: 16px; }
.period-est { border-left: 4px solid #b5654f; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; }
.cal-title { margin: 0; font-size: 20px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-head span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-cell { aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; font: 15px var(--sans); color: var(--ink); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.cal-cell.empty { cursor: default; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--olive); font-weight: 700; }
.cal-cell.p-day { background: #e6c2b5; }
.cal-cell.p-start { background: #b5654f; color: #fff; font-weight: 700; }
.cal-cell.p-next { box-shadow: inset 0 0 0 2px #b5654f; border: 0; outline: 2px dashed #b5654f; outline-offset: -5px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.lg.p-start { background: #b5654f; } .lg.p-day { background: #e6c2b5; } .lg.p-next { outline: 2px dashed #b5654f; outline-offset: -2px; }
.p-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-hist li { display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--sand-2); padding-bottom: 10px; }
.p-hist li > div:first-child { display: flex; flex-direction: column; }
.p-actions { display: flex; gap: 8px; }
.p-actions .chip { padding: 6px 14px; font-size: 14px; }

/* closing cards — a kind word at the end of each area */
.closing { border-left: 4px solid var(--brown); }
.closing p { font-size: 16px; }
.closing .echo { margin: 2px 0; padding: 10px 14px; border-radius: 12px; background: var(--sand-2); font-family: var(--serif); font-size: 19px; color: var(--olive); }
.grat { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--sand-2); padding-top: 10px; }
.grat-picked { color: var(--brown); }
.closing-link { font-weight: 600; text-decoration: none; padding: 10px 0 2px; }
.books { border-top: 1px solid var(--sand-2); padding-top: 10px; }
.books summary { cursor: pointer; font-weight: 600; color: var(--olive); }
.books ul { margin: 10px 0 6px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
/* goals ladder */
.ladder-goal { font-size: 22px; }
.ladder progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--sand-2); -webkit-appearance: none; appearance: none; }
.ladder progress::-webkit-progress-bar { background: var(--sand-2); border-radius: 999px; }
.ladder progress::-webkit-progress-value { background: var(--olive); border-radius: 999px; }
.ladder progress::-moz-progress-bar { background: var(--olive); border-radius: 999px; }
.rungs { list-style: none; margin: 0; padding: 0 0 0 14px; display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--line); }
.rung { position: relative; background: #fff; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.rung::before { content: ""; position: absolute; left: -17px; top: 50%; width: 14px; height: 3px; background: var(--line); }
.rung label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.rung input[type=checkbox] { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--olive); }
.rung-n { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--brown); font-weight: 600; }
.rung.done { background: var(--sand-2); }
.rung.done label > span { color: var(--muted); }
.rung.done::before { background: var(--olive); }
.rung-actions { display: flex; gap: 14px; padding-left: 32px; }
.rung.editing input { font: 16px var(--sans); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.rung.editing .rung-actions { padding-left: 0; gap: 8px; }
.add-rung { display: flex; gap: 8px; }
.add-rung input { flex: 1; min-width: 0; font: 16px var(--sans); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.add-rung .btn { align-self: center; }
.calc { border-top: 1px solid var(--sand-2); padding-top: 10px; display: block; }
.calc summary { cursor: pointer; font-weight: 600; color: var(--olive); }
.calc-fields { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 10px 0; }
.calc-out { background: var(--olive); color: #fff; border-radius: 12px; padding: 12px 14px; font-family: var(--serif); font-size: 17px; line-height: 1.4; margin-bottom: 6px; }

/* ---- v7: self-love, values, body goal, water, fuel, recipes, sobriety ---- */
.sl-dot { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--sand-2); box-shadow: inset 0 0 0 6px var(--brown); position: relative; }
.sl-dot::after { content: "♡"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--brown); font-size: 16px; }
.sl-dot.seen { background: #e8d6cf; }
.values h2 { margin: 0; }
.living { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.living h3, .bodygoal h3 { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--olive); }
.living .prompt { margin: 6px 0 0; }
.meal { margin: 8px 0 0; font-family: var(--serif); color: var(--olive); font-size: 20px; }
.rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rcard { display: flex; flex-direction: column; gap: 6px; padding: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; cursor: pointer; font: 600 13px/1.25 var(--sans); color: var(--ink, #2a2620); text-align: left; position: relative; }
.rcard img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--sand-2); }
.rcard span { padding: 0 8px; }
.rcard.on { outline: 3px solid var(--olive); outline-offset: -1px; }
.rcard.sug::before { content: "Suggested"; position: absolute; top: 6px; left: 6px; background: var(--olive); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.water-row { display: flex; gap: 16px; align-items: center; }
.glass { width: 120px; height: 160px; flex: none; }
.glass-outline { fill: none; stroke: var(--olive); stroke-width: 4; stroke-linejoin: round; }
.glass-mark { stroke: var(--line); stroke-width: 2; }
.water-fill { fill: #8fb9c9; transform: translateY(152px); }
.water-shine { fill: rgba(255,255,255,.35); }
.water-info { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.water-total { margin: 0; font-family: var(--serif); font-size: 30px; color: var(--olive); line-height: 1.1; }
.water-info .small { margin: 0; }
.water-add { font-size: 18px; }
.water-more { display: flex; gap: 6px; flex-wrap: wrap; }
.water-more .chip { padding: 6px 12px; font-size: 14px; }
.dots { display: flex; gap: 8px; }
.dots span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--olive); }
.dots span.on { background: var(--olive); }
.dots span.half { background: linear-gradient(to top, var(--olive) 50%, transparent 50%); }
.fuel-week { margin: 0; background: #fff; border-radius: 10px; padding: 8px 12px; }
.sober-count { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--olive); line-height: 1.3; }
details.sgrat summary { cursor: pointer; list-style: none; }
details.sgrat[open] { gap: 10px; }
details.sgrat summary::-webkit-details-marker { display: none; }
.grat-picked { margin: 0; color: var(--olive); font-weight: 600; }

/* ---- v8: movement, music, meditation, mantras ---- */
.mini { margin: 4px 0 0; font-weight: 600; font-size: 15px; }
.xmins { align-items: center; }
.xcustom { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.xcustom input { width: 78px; font: 16px var(--sans); padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.xactions { display: flex; align-items: center; gap: 14px; }
.xactions .btn[disabled] { opacity: .45; }
.xlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.xlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 8px 12px; }
.xli-actions { display: flex; gap: 12px; }
.xli-actions .link { align-self: center; }
.xtotal { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--olive); }
.xweek { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 4px 0 0; }
.xday { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.xbar-wrap { height: 64px; width: 100%; max-width: 30px; background: var(--sand-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.xbar { width: 100%; height: 0; background: var(--olive); border-radius: 8px; transition: height .5s ease; }
.xday.today span { color: var(--olive); font-weight: 700; }
.player .track { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.player .track.on { border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); }
.player .track[disabled] { opacity: .6; cursor: default; }
.tmeta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pbtn { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--olive); color: #fff; display: grid; place-items: center; font-size: 15px; letter-spacing: -2px; }
.ttime { font-variant-numeric: tabular-nums; color: var(--olive); font-weight: 600; }
.tdot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--olive); }
.track.on .tdot { background: var(--olive); box-shadow: inset 0 0 0 3px #fff; }
.medtracks { display: flex; flex-direction: column; gap: 8px; }
.medplay { display: flex; align-items: center; gap: 16px; padding: 6px 0; }
.medplay p { margin: 0; }
.pbig { width: 72px; height: 72px; flex: none; border-radius: 50%; border: 0; background: var(--olive); color: #fff; font-size: 24px; letter-spacing: -3px; cursor: pointer; box-shadow: 0 6px 18px rgba(67,74,0,.25); }
.medtime { font-family: var(--serif); font-size: 34px; color: var(--olive); font-variant-numeric: tabular-nums; line-height: 1.1; }
.breath { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 0; }
.breath-circle { width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #f7f3ec 0%, #e8dfcc 45%, #c9cfa0 100%); box-shadow: 0 0 0 10px rgba(67,74,0,.06), 0 0 40px rgba(67,74,0,.12); transform: scale(.72); will-change: transform; }
.breath-text { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--olive); min-height: 1.4em; }
.mlist { display: flex; flex-direction: column; gap: 8px; }
.mantra { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: 17px/1.35 var(--serif); color: var(--ink); cursor: pointer; }
.mantra.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.mantra-today { background: var(--sand-2); border-radius: 14px; padding: 16px; text-align: center; }
.mantra-today p { margin: 0; }
.mantra-big { font-family: var(--serif); font-size: 26px; line-height: 1.3; color: var(--olive); margin: 4px 0; }
.mantra-home { text-align: center; }
.mantra-home .mantra-big { margin: 0; }

/* ---- v10: money planner ---- */
.budget h2 { margin: 0; }
.bucket { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.bucket h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; }
.bucket h3 .small { font-family: var(--sans); font-size: 13px; }
.bsw, .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.b-in .bsw, .d-in { background: #2f3500; } .b-bills .bsw, .d-bills, .seg-bills { background: var(--olive); }
.b-fun .bsw, .d-fun, .seg-fun { background: #c08a5b; } .b-save .bsw, .d-save, .seg-save { background: #8fb9c9; }
.b-other .bsw, .d-other, .seg-other { background: #9a8f7d; } .d-left, .seg-left { background: #d9e3b5; }
.bline { display: flex; gap: 8px; align-items: center; }
.bname { flex: 1; min-width: 0; font: 16px var(--sans); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.bamt { display: flex; align-items: center; gap: 2px; width: 118px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; }
.bamt span { color: var(--muted); }
.bamt input { width: 100%; border: 0; font: 16px var(--sans); padding: 10px 0; background: transparent; text-align: right; outline: none; }
.bdel { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.addchip { padding: 6px 12px; font-size: 14px; border-style: dashed; }
.bsum { display: flex; flex-direction: column; gap: 12px; background: var(--sand-2); border-radius: 14px; padding: 14px; margin-top: 4px; }
.bsum .label { margin: 0; }
.bbar { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: #fff; }
.bbar span { height: 100%; width: 0; transition: width .5s ease; }
.blegend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.blegend li { display: flex; align-items: center; gap: 8px; }
.blegend strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.blegend .bleft { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 600; }
.blegend .bleft strong { font-family: var(--serif); font-size: 22px; color: var(--olive); }
.bsave { display: flex; flex-direction: column; gap: 8px; }
.bsave-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bsave-row div { background: #fff; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.bsave-row strong { font-family: var(--serif); font-size: 19px; color: var(--olive); }
.bsave-row span { font-size: 13px; color: var(--muted); }
.b5030 summary { cursor: pointer; color: var(--olive); font-weight: 600; }

/* start-again undo */
.undo-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 12px 12px 12px 18px; border-radius: 999px; font-size: 15px; max-width: min(92vw, 420px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.undo-bar-btn { border: 0; border-radius: 999px; background: #fff; color: var(--olive); font: 600 15px var(--sans); padding: 8px 16px; cursor: pointer; }
.confirm-overlay { position: fixed; inset: 0; background: rgba(39,39,39,.45); z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.confirm-card { background: var(--paper); border-radius: 22px; padding: 22px 20px 18px; width: min(100%, 420px); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.confirm-card h2 { margin: 0; }
.confirm-card p { margin: 0; }

/* weekly / monthly review graph */
.review { gap: 14px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-head h2 { margin: 0; }
.review-head .seg { flex: 0 0 auto; width: 148px; }
.review-svg { width: 100%; height: auto; display: block; background: transparent; }
.rev-grid { stroke: var(--line); stroke-width: 1; }
.rev-x { fill: var(--muted); font: 10px var(--sans); }
.rev-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.rev-leg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 10px; font: 13px var(--sans); cursor: pointer; }
.rev-leg.on { border-color: var(--olive); background: #fff; font-weight: 600; }
.rev-leg:not(.on) { opacity: .45; }
.rev-swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.review-sum { font-family: var(--serif); font-size: 18px; line-height: 1.4; color: var(--ink); margin: 0; }

/* steps */
.steps-row { display: flex; gap: 16px; align-items: center; }
.step-ring { width: 120px; height: 120px; flex: none; }
.step-ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.step-ring-fg { fill: none; stroke: #3d6b4f; stroke-width: 10; stroke-linecap: round; }
.step-ring-n { font: 700 18px var(--sans); fill: var(--olive); }
.step-ring-sub { font: 11px var(--sans); fill: var(--muted); }
.steps-info { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.steps-aim { display: flex; flex-direction: column; gap: 8px; }
.steps-aim-actions { display: flex; align-items: center; gap: 12px; }
/* tester feedback */
.feedback { text-decoration: none; color: inherit; border: 1.5px solid var(--olive); }
.feedback p:not(.label) { margin: 0; color: var(--olive); font-weight: 600; }

/* simpler review graph */
.review-svg { width: 100%; height: auto; display: block; background: transparent; border-radius: 0; overflow: visible; }
.rev-x { fill: var(--muted); font: 600 11px var(--sans); }
.rev-x-wk { fill: var(--muted); font: 500 9px var(--sans); }
.rev-end { font: 650 12px var(--sans); }
.rev-line { stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rev-fill { opacity: .09; }
.rev-dot-soft { opacity: .22; }
.rev-graph-wrap { padding: 6px 0 2px; }
.rev-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.rev-pill { border: 0; background: color-mix(in srgb, var(--pill) 18%, var(--paper)); color: var(--pill); border-radius: 999px; padding: 6px 11px; font: 600 12px var(--sans); cursor: pointer; }
.rev-pill.on { background: var(--pill); color: #fff; }
.rev-pill.empty { opacity: .38; cursor: default; }
.rev-pill-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.rev-more { font-size: 13px; color: var(--muted); margin: 0; }
.rev-more-btn { background: none; border: 0; padding: 0; font: 600 13px var(--sans); color: var(--olive); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* end-of-week Well done recap */
.recap-overlay { position: fixed; inset: 0; background: rgba(39,39,39,.45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); overflow: auto; }
.recap-card { background: var(--paper); border-radius: 24px; padding: 16px 18px 16px; width: min(100%, 440px); max-height: min(92vh, 820px); overflow: auto; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 48px rgba(0,0,0,.22); }
.recap-card h2 { text-align: center; font-size: 28px; margin: 0; }
.recap-lead { text-align: center; color: var(--muted); margin: 0; }
.recap-sun-wrap { display: flex; justify-content: center; height: 88px; }
.recap-sun { width: 88px; height: 88px; transform-origin: 50% 50%; }
.recap-sun-disc { fill: #e8b84a; }
.recap-sun-cheek { fill: #e0895a; opacity: .7; }
.recap-sun-eye { fill: #5a3a1c; }
.recap-sun-smile { stroke: #5a3a1c; stroke-width: 3.2; stroke-linecap: round; }
.recap-ray { stroke: #f0c65a; stroke-width: 5; stroke-linecap: round; }
.recap-spark { fill: #f3d36a; }

.recap-sun-wrap.play .recap-sun { animation: recap-bounce 900ms cubic-bezier(.2,1.1,.3,1) both; }
.recap-sun-wrap.play .recap-sun-burst { transform-origin: 80px 80px; animation: recap-spin 14s linear infinite; }
.recap-sun-wrap.play .recap-ray { animation: recap-ray 1.1s ease-out both; }
.recap-sun-wrap.play .recap-spark-a { animation: recap-spark 2.4s ease-in-out .15s infinite; }
.recap-sun-wrap.play .recap-spark-b { animation: recap-spark 2.6s ease-in-out .4s infinite; }
.recap-sun-wrap.play .recap-spark-c { animation: recap-spark 2.5s ease-in-out .7s infinite; }
.recap-sun-wrap.play .recap-spark-d { animation: recap-spark 2.7s ease-in-out .3s infinite; }

@keyframes recap-bounce {
  0% { transform: scale(.45) translateY(16px); opacity: 0; }
  55% { transform: scale(1.1) translateY(-6px); opacity: 1; }
  75% { transform: scale(.96) translateY(2px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes recap-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes recap-ray {
  0% { stroke-dasharray: 0 80; opacity: 0; }
  100% { stroke-dasharray: 80 0; opacity: 1; }
}
@keyframes recap-spark {
  0%, 100% { opacity: 0; transform: scale(.35) rotate(0deg); }
  35% { opacity: 1; transform: scale(1) rotate(18deg); }
  70% { opacity: .45; transform: scale(.7) rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .recap-sun-wrap.play .recap-sun,
  .recap-sun-wrap.play .recap-sun-burst,
  .recap-sun-wrap.play .recap-ray,
  .recap-sun-wrap.play .recap-spark-a,
  .recap-sun-wrap.play .recap-spark-b,
  .recap-sun-wrap.play .recap-spark-c,
  .recap-sun-wrap.play .recap-spark-d { animation: none !important; }
  .recap-sun { opacity: 1; transform: none; }
  .recap-spark { opacity: .85; }
}

/* What I ate */
.foodlog .field { margin-top: 10px; }
.foodlog .mini { margin: 14px 0 8px; }

/* Insight Timer (text-only, no logo) */
a.insight-card { display: block; text-decoration: none; color: inherit; }
a.insight-card p { margin: 0; }
a.insight-card .label { margin-bottom: 4px; }
a.insight-card .insight-go { color: var(--muted); font-size: 0.9em; margin-left: 0.3em; }
a.insight-card:focus-visible { outline: 2px solid var(--olive, #5c6b4a); outline-offset: 3px; }

/* Recap food rundown */
.recap-food { margin-top: 16px; text-align: left; }
.recap-food h3 { font: 650 1.02rem/1.3 var(--sans); margin: 0 0 6px; color: var(--ink); }
.recap-food p { margin: 0 0 8px; color: var(--ink); }
.recap-food a { color: var(--olive, #5c6b4a); font-weight: 600; }

.recap-card h2#recapTitle, .recap-card h2 { text-align: center; font-size: 24px; line-height: 1.2; margin: 0; text-wrap: balance; }
.recap-name { text-align: center; font-size: 15px; color: var(--muted); margin: -4px 0 6px; }
.recap-run { display: flex; flex-direction: column; gap: 2px; text-align: center; padding: 2px 4px; }
.recap-run p { margin: 0; font: 500 15px/1.45 var(--sans); color: var(--ink); }
.recap-next { margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--sand-2); }
.recap-next h3 { margin: 0 0 6px; font-size: 18px; }
.recap-next p { margin: 0 0 10px; }
.recap-next-actions { display: flex; flex-direction: column; gap: 8px; }

.field textarea { font: 16px var(--sans); padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); resize: vertical; min-height: 76px; }
.field textarea:focus { outline: 3px solid rgba(67,74,0,.35); outline-offset: 2px; }
.why-banner { background: #fff; border-left: 4px solid var(--brown); }
.why-text { font-family: var(--serif); font-size: 20px; line-height: 1.35; color: var(--ink); margin: 0; }
.habit-dots span { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font: 600 11px var(--sans); color: var(--olive); }
.habit-dots span.on { color: #fff; }
.habit-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.habit-cal-wd { text-align: center; font: 600 11px var(--sans); color: var(--muted); }
.habit-cal-empty { min-height: 36px; }
.habit-cal-day { min-height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.habit-cal-day.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.habit-cal-day.today { box-shadow: 0 0 0 2px rgba(67,74,0,.35); }
.fact-list { margin: 0; padding: 0 0 0 1.15em; display: flex; flex-direction: column; gap: 8px; }
.fact-list li { color: var(--ink); }
.modules-picker { display: flex; flex-direction: column; gap: 10px; }
#smokeHelp a, #smokeHealth a { font-weight: 600; }

.body-help { background: #fff; border-radius: 16px; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.body-help h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.body-help p { margin: 0; }
.body-help-hero { display: flex; justify-content: center; }
.body-help-hero .stretch-fig { width: 72px; height: 72px; }
.stretch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stretch-item { background: var(--paper, #f6f1e8); border-radius: 12px; padding: 10px 8px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stretch-item p { font-size: 13px; line-height: 1.3; margin: 0; }
.stretch-fig { width: 72px; height: 72px; color: var(--olive, #5c6b4a); display: block; }
.body-help-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.body-help-tips li { display: flex; gap: 10px; align-items: flex-start; background: var(--paper, #f6f1e8); border-radius: 12px; padding: 8px 10px; }
.body-help-tips .stretch-fig { width: 48px; height: 48px; flex: none; }
.body-help-tips p { margin: 0; font-size: 15px; line-height: 1.4; }
.body-help-safety { font-size: 13px; color: var(--muted); line-height: 1.4; }
.body-help-link { font-size: 15px; }
.body-help-link a { font-weight: 600; color: var(--olive, #5c6b4a); }

.quit-meds { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.quit-meds li { display: flex; flex-direction: column; gap: 2px; }
.quit-meds a { font-weight: 600; color: var(--olive, #5c6b4a); }

.end-prompt { background: #fff; border-left: 4px solid var(--brown); }
.end-prompt p:not(.label) { font-family: var(--serif); font-size: 18px; line-height: 1.45; margin: 0; }
.end-help { margin-top: 8px; }
.end-help > summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--olive, #434a00); list-style: none; }
.end-help > summary::-webkit-details-marker { display: none; }
.end-help > summary::after { content: " ›"; }
.end-help[open] > summary::after { content: " ˄"; }
.end-help .body-help { margin-top: 10px; }
.cele-overlay { position: fixed; inset: 0; background: rgba(39,39,39,.45); z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); overflow: auto; }
.cele-card { background: var(--paper, #f6f1e8); border-radius: 22px; padding: 22px 18px 20px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.cele-card h2 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; text-align: center; }
.cele-card .cele-paras p { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.cele-card .cele-paras p:last-child { margin-bottom: 0; }

/* Calendar & To-do */
.plan-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-toolbar h2 { margin: 0; font-size: 20px; }
.plan-nav { display: flex; align-items: center; gap: 6px; }
.plan-nav .iconbtn { width: 36px; height: 36px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font: 600 11px var(--sans); color: var(--muted); padding: 2px 0; }
.cal-day { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; }
.cal-day.out { color: #a39a8c; background: transparent; border-color: transparent; }
.cal-day.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.cal-day.today:not(.on) { box-shadow: 0 0 0 2px rgba(67,74,0,.35); }
.cal-dots { display: flex; gap: 2px; min-height: 6px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brown); }
.cal-day.on .cal-dot { background: #fff; }
.week-col { display: flex; flex-direction: column; gap: 6px; min-height: 88px; }
.week-col .cal-day { min-height: 36px; }
.week-item { font-size: 12px; line-height: 1.3; background: var(--sand-2); border-radius: 8px; padding: 5px 7px; color: var(--ink); text-align: left; border: 0; cursor: pointer; width: 100%; }
.plan-item, .todo-item { display: flex; align-items: flex-start; gap: 10px; text-align: left; }
.plan-item { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; font: 16px var(--sans); color: var(--ink); cursor: pointer; }
.plan-item .when { display: block; font-size: 12px; color: var(--brown); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.todo-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: 0; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-check { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--olive); background: #fff; flex: 0 0 24px; margin-top: 2px; cursor: pointer; color: var(--olive); font-size: 14px; padding: 0; }
.todo-check[aria-pressed="true"] { background: var(--olive); color: #fff; }
.todo-body { flex: 1; min-width: 0; }
.todo-actions { display: flex; gap: 8px; flex-shrink: 0; }
.mic-btn { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--olive); background: var(--paper); color: var(--olive); font-size: 20px; cursor: pointer; flex: 0 0 48px; }
.mic-btn.listen { background: var(--olive); color: #fff; box-shadow: 0 0 0 6px rgba(67,74,0,.15); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 10px rgba(67,74,0,.08); } }
.plan-actions { display: flex; gap: 8px; align-items: center; }
.plan-actions .btn { width: auto; flex: 1; padding: 12px 12px; }
.voice-live { min-height: 1.4em; font-size: 14px; color: var(--muted); font-style: italic; }
.plan-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--olive); flex: 0 0 12px; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .mic-btn.listen { animation: none; } }
