@font-face { font-family: 'Fraunces'; src: url(../fonts/Fraunces.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
@font-face { font-family: 'Inter'; src: url(../fonts/Inter.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
:root {
  --bg: #0e1511; --bg2: #121b16; --card: #17221c; --card2: #1c2a22; --line: #26362c; --line2: #33473a;
  --text: #efe8d8; --muted: #9eab9a; --dim: #6f7d6e;
  --lime: #c6e27a; --lime2: #a9cd55; --amber: #f2b649; --rust: #e2774b; --moon: #f3e3b3; --sky: #8fc3d9; --violet: #b9a4e8;
  --r: 18px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, .serif { font-family: Fraunces, Georgia, serif; font-variation-settings: 'SOFT' 100, 'WONK' 0; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; font-weight: 640; line-height: 1.08; }
h2 { font-size: 22px; font-weight: 620; line-height: 1.15; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 11.5px; letter-spacing: .02em; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); }

/* layout */
#app { min-height: 100%; }
.screen { min-height: 100vh; padding: calc(var(--safe-t) + 10px) 18px calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 14px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 78%, transparent); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.growpill { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; min-width: 0; }
.growpill .moon { width: 30px; height: 30px; flex: none; }
.growpill b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.growpill span { display: block; font-size: 11.5px; color: var(--muted); }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); }
.iconbtn svg { width: 20px; height: 20px; }

/* tabbar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(14,21,17,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(8px + var(--safe-b)); display: flex; justify-content: space-around; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--dim); font-size: 11px; font-weight: 560; letter-spacing: .01em; }
.tabbar button svg { width: 23px; height: 23px; }
.tabbar button.on { color: var(--lime); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sect { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
.sect h3 { font-size: 18px; }
.link { color: var(--lime); font-weight: 600; font-size: 13.5px; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 18px 16px; background: radial-gradient(120% 90% at 85% 10%, #2b4430 0%, #18261d 55%, #131d17 100%); border: 1px solid var(--line2); min-height: 196px; }
.hero .plant { position: absolute; right: 6px; bottom: 32px; height: 150px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
.hero .info { position: relative; max-width: 62%; }
.hero .daynum { font-family: Fraunces, serif; font-size: 54px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--moon); }
.hero .daynum small { font-size: 16px; color: var(--muted); font-family: Inter, sans-serif; font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.hero .phase { margin-top: 6px; font-size: 15px; font-weight: 600; }
.hero .next { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.hero .next b { color: var(--text); font-weight: 600; }
.phasebar { position: relative; display: flex; gap: 3px; margin-top: 16px; height: 8px; }
.phasebar i { display: block; height: 100%; border-radius: 4px; opacity: .35; }
.phasebar i.done { opacity: .9; } .phasebar i.cur { opacity: 1; }
.phasebar .marker { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--moon); box-shadow: 0 0 0 3px rgba(14,21,17,.8); }
.ph-germ, .ph-clone { background: #d9c58c; } .ph-seedling { background: #9fd49a; } .ph-veg { background: #5fbf6a; } .ph-flower { background: #b9a4e8; } .ph-flush { background: #8fc3d9; } .ph-harvest { background: #f2b649; } .ph-dry { background: #d4925c; } .ph-cure { background: #c98a4f; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--c); vertical-align: 0; }

/* date strip */
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 18px 6px; margin: 14px -18px 0; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip button { scroll-snap-align: center; flex: none; width: 52px; padding: 8px 0 9px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: center; position: relative; }
.strip button .dw { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.strip button .dn { font-family: Fraunces, serif; font-size: 20px; font-weight: 600; margin-top: 1px; }
.strip button .dd { font-size: 10px; color: var(--dim); }
.strip button.today { border-color: var(--lime2); }
.strip button.sel { background: var(--lime); color: #142012; border-color: var(--lime); }
.strip button.sel .dw, .strip button.sel .dd { color: #2c3c22; }
.strip button .pip { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--amber); }
.strip button.sel .pip { background: #142012; }

/* tasks */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.task + .task { margin-top: 8px; }
.task.key { background: linear-gradient(180deg, #213122, #1a271e); border-color: #3d5634; }
.task .box { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line2); display: grid; place-items: center; margin-top: 1px; transition: .15s; }
.task.key .box { border-color: var(--lime2); }
.task.done .box { background: var(--lime); border-color: var(--lime); }
.task.done .box::after { content: ''; width: 10px; height: 6px; border: 2.5px solid #142012; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.task .tt { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.task .td { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(158,171,154,.6); }
.task .tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); margin-bottom: 3px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--lime); border-radius: 3px; transition: width .3s; }

/* marv */
.marv { display: flex; gap: 12px; align-items: flex-end; }
.marv .face { flex: none; width: 58px; height: 58px; border-radius: 50%; background: #2c3b2f url(../img/marv_face.webp) center/cover; border: 2px solid var(--line2); }
.marv .bubble { position: relative; background: var(--card2); border: 1px solid var(--line2); border-radius: 18px 18px 18px 6px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.marv .bubble .who { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 3px; }
.marv .bubble em { font-style: normal; }

/* chips & pills */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px 4px; margin: 0 -18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 560; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--lime); border-color: var(--lime); color: #142012; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--card2); border: 1px solid var(--line2); color: var(--muted); }
.badge.lime { color: var(--lime); border-color: #46602f; background: #1f2e1d; }
.badge.amber { color: var(--amber); border-color: #5c4a22; background: #2a2416; }
.badge.rust { color: var(--rust); border-color: #5c3322; background: #2b1c16; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 16px; font-weight: 650; font-size: 15.5px; background: var(--lime); color: #142012; }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line2); }
.btn.small { width: auto; padding: 10px 16px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .4; }
.btn svg { width: 20px; height: 20px; }

/* guide */
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line2); display: grid; place-items: center; font-family: Fraunces, serif; font-weight: 600; color: var(--lime); }
.step h4 { margin: 3px 0 4px; font-size: 15.5px; font-weight: 640; }
.step p { font-size: 14px; color: #cfd2c4; line-height: 1.5; }
.targets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.target .l { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.target .v { font-size: 13.5px; font-weight: 600; margin-top: 2px; line-height: 1.3; }
.target.wide { grid-column: span 2; }
.stagehead { display: flex; align-items: center; gap: 14px; }
.stagehead img { width: 70px; height: 92px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }

/* doctor */
.scanhero { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 18px; background: radial-gradient(110% 100% at 100% 0%, #2f3d26, #172219 60%); border: 1px solid var(--line2); }
.scanhero .ring { position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; border: 1px dashed rgba(198,226,122,.25); }
.scanhero .ring.r2 { right: -10px; top: -10px; width: 140px; height: 140px; }
.photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; display: block; background: var(--card2); }
.result { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.result:first-of-type { border-top: 0; }
.result .rank { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.result.top .rank { background: var(--lime); color: #142012; }
.result .bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; } .result .bar i { display: block; height: 100%; background: var(--lime2); border-radius: 3px; }
.result .pct { font-family: Fraunces, serif; font-size: 20px; font-weight: 600; min-width: 52px; text-align: right; }
.symgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.sym { padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; text-align: left; }
.sym.on { background: #26371f; border-color: var(--lime2); color: var(--lime); }
.issue h4 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 16px 0 6px; font-weight: 700; }
.issue ul { margin: 0; padding-left: 18px; } .issue li { margin: 4px 0; font-size: 14px; color: #d7dacb; }
.issue p { font-size: 14px; color: #d7dacb; }
.note { font-size: 12.5px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; line-height: 1.45; }
.note b { color: var(--text); }

/* tips */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 13px 0; font-size: 15px; }
.search svg { width: 18px; height: 18px; color: var(--dim); }
.tip { padding: 15px 16px; }
.tip .meta { display: flex; gap: 6px; margin-bottom: 7px; }
.tip h4 { font-family: Fraunces, serif; font-size: 17px; font-weight: 600; margin: 0 0 5px; }
.tip p { font-size: 14px; color: #d3d6c8; line-height: 1.5; }

/* journal */
.jday { margin-top: 18px; }
.jday .jh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.jday .jh b { font-family: Fraunces, serif; font-size: 17px; font-weight: 600; }
.jentry { display: flex; gap: 12px; }
.jentry img { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; flex: none; background: var(--card2); }
.jentry .jt { font-size: 14px; line-height: 1.45; }
.jentry + .jentry { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty img { height: 150px; opacity: .95; margin-bottom: 10px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--dim); padding: 4px 0; font-weight: 600; }
.cal button { aspect-ratio: 1; border-radius: 10px; font-size: 13px; font-weight: 560; position: relative; background: var(--card); }
.cal button.out { opacity: 0; pointer-events: none; }
.cal button.none { background: transparent; color: var(--dim); }
.cal button .k { position: absolute; bottom: 4px; left: 50%; margin-left: -2px; width: 4px; height: 4px; border-radius: 50%; background: #142012; }
.cal button.today { outline: 2px solid var(--moon); outline-offset: 1px; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto; background: var(--bg2); border-top: 1px solid var(--line2); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + var(--safe-b)); animation: up .25s cubic-bezier(.2,.9,.3,1); max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--moon); color: #1b1a12; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* wizard */
.wiz { min-height: 100vh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 20px calc(20px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.wiz .wtop { display: flex; align-items: center; gap: 12px; }
.wiz .wprog { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; } .wiz .wprog i { display: block; height: 100%; background: var(--lime); transition: width .3s; }
.wiz .wbody { flex: 1; padding-top: 26px; }
.wiz .q { font-size: 28px; margin: 8px 0 6px; }
.opts { display: grid; gap: 10px; margin-top: 20px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); }
.opt.on { border-color: var(--lime); background: #1f2d1e; }
.opt img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.opt .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--card2); display: grid; place-items: center; flex: none; color: var(--lime); }
.opt .ico svg { width: 26px; height: 26px; }
.opt b { display: block; font-size: 15.5px; font-weight: 640; } .opt span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.opts.two .opt { flex-direction: column; align-items: flex-start; }
.field { width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 17px; outline: 0; }
.field:focus { border-color: var(--lime2); }
input[type=range] { width: 100%; accent-color: var(--lime); }
.bigval { font-family: Fraunces, serif; font-size: 44px; font-weight: 600; color: var(--moon); }

/* gate */
.gate { min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--safe-t) + 20px) 22px calc(26px + var(--safe-b)); position: relative; overflow: hidden; max-width: 560px; margin: 0 auto; }
.gate .sky { position: absolute; inset: 0; background: radial-gradient(90% 55% at 70% 18%, #34492f 0%, #18241c 45%, var(--bg) 75%); }
.gate .bigmoon { position: absolute; right: -60px; top: calc(var(--safe-t) + 30px); width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fbf1cf, #e9d49a 60%, #c9b071); box-shadow: 0 0 80px rgba(243,227,179,.25); }
.gate .bigmoon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 22% 62%, rgba(150,120,60,.22) 0 9%, transparent 10%), radial-gradient(circle at 60% 30%, rgba(150,120,60,.18) 0 6%, transparent 7%), radial-gradient(circle at 55% 72%, rgba(150,120,60,.16) 0 12%, transparent 13%); }
.gate .marvbig { position: absolute; left: 50%; transform: translateX(-62%); bottom: 300px; height: 52vh; max-height: 470px; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); }
.gate .content { position: relative; z-index: 2; background: linear-gradient(transparent, var(--bg) 22%); padding-top: 50px; }
.logo { font-family: Fraunces, serif; font-weight: 700; font-size: 38px; line-height: .98; letter-spacing: -0.02em; color: var(--moon); }
.logo em { font-style: italic; font-weight: 500; color: var(--lime); }
.check { display: flex; gap: 12px; align-items: flex-start; text-align: left; font-size: 14px; color: #d3d6c8; }
.check .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line2); display: grid; place-items: center; margin-top: 1px; }
.check.on .box { background: var(--lime); border-color: var(--lime); }
.check.on .box::after { content: ''; width: 10px; height: 6px; border: 2.5px solid #142012; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }
.fade-in { animation: fade .25s; }
.sp { height: 12px; } .sp2 { height: 22px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line2); border-top-color: var(--lime); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:root { --c-germ:#d9c58c; --c-clone:#d9c58c; --c-seedling:#9fd49a; --c-veg:#5fbf6a; --c-flower:#b9a4e8; --c-flush:#8fc3d9; --c-dry:#d4925c; --c-cure:#c98a4f; }

.cal button.past { opacity: .55; }
.msrow { border-top: 1px solid var(--line); } .msrow:first-child { border-top: 0; }
:root { --c-harvest: #f2b649; }
