:root{--bg:#f4f6f2;--paper:#fff;--ink:#1f3029;--muted:#718078;--line:#e4eae3;--green:#386d50;--green-dark:#264d39;--green-soft:#eaf1e9;--lime:#dce8d5;--accent:#c35b46;--shadow:0 10px 30px rgba(37,64,47,.07);--radius:22px;font-family:'DM Sans','Noto Sans SC',system-ui,sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none;text-rendering:optimizeLegibility}*{box-sizing:border-box}body{margin:0;min-width:320px;background:var(--bg);-webkit-font-smoothing:antialiased}.app-shell{max-width:760px;min-height:100dvh;margin:auto;padding:0 22px calc(104px + env(safe-area-inset-bottom))}.topbar{height:82px;display:flex;align-items:center;gap:12px}.brand-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:14px;background:var(--green);color:#fff;font-size:20px;font-weight:700;box-shadow:0 5px 15px #386d5030}.brand-copy{display:grid;gap:1px;flex:1}.brand-copy .eyebrow{font-size:9px;letter-spacing:.19em;color:var(--muted);font-weight:700}.brand-copy strong{font-size:15px;letter-spacing:.02em}.icon-button{border:1px solid var(--line);background:#fff;width:38px;height:38px;border-radius:50%;font-size:20px;color:var(--green);cursor:pointer}.view-root{animation:appear .22s ease}@keyframes appear{from{opacity:.55;transform:translateY(4px)}to{opacity:1;transform:none}}.page-heading{padding:20px 2px 18px}.page-heading .eyebrow{font-size:11px;letter-spacing:.13em;color:var(--green);font-weight:700}.page-heading h1{font-size:30px;line-height:1.2;letter-spacing:-.04em;margin:8px 0 7px;font-weight:700}.page-heading p{margin:0;color:var(--muted);font-size:14px;line-height:1.6}.hero-card{position:relative;overflow:hidden;background:var(--green-dark);color:#fff;border-radius:26px;padding:22px 23px 21px;margin-bottom:17px;box-shadow:var(--shadow)}.hero-card:after{content:"";position:absolute;width:175px;height:175px;border:1px solid #ffffff22;border-radius:50%;right:-60px;top:-67px;box-shadow:0 0 0 22px #ffffff08,0 0 0 44px #ffffff06}.hero-label{font-size:11px;letter-spacing:.11em;color:#cbdccf;font-weight:600}.hero-number-row{display:flex;align-items:baseline;gap:8px;margin:9px 0 2px}.hero-number{font-size:45px;line-height:1;font-weight:700;letter-spacing:-.06em}.hero-unit{font-size:14px;color:#d5e3d7}.hero-caption{font-size:12px;color:#cbdccf}.hero-foot{display:flex;justify-content:space-between;align-items:center;margin-top:19px;border-top:1px solid #ffffff24;padding-top:14px;font-size:12px;color:#d5e3d7}.delta{font-weight:700;color:#fff}.card{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:19px;margin-bottom:14px;box-shadow:var(--shadow)}.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:13px}.card-title{margin:0;font-size:16px;font-weight:700}.card-subtitle{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.section-kicker{font-size:10px;letter-spacing:.13em;color:var(--muted);font-weight:700}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field{display:grid;gap:7px;margin:12px 0}.field label,.field-label{font-size:12px;font-weight:600;color:#52635a}.field input,.field textarea,.field select,.inline-input{width:100%;min-height:46px;padding:11px 13px;border:1px solid var(--line);border-radius:13px;background:#fbfcfa;color:var(--ink);font:inherit;font-size:14px;outline:none}.field textarea{min-height:84px;resize:vertical}.field input:focus,.field textarea:focus,.field select:focus,.inline-input:focus{border-color:#7da28a;box-shadow:0 0 0 3px #386d5018}.field small,.helper{font-size:11px;color:var(--muted);line-height:1.55}.metric-input{position:relative}.metric-input input{padding-right:54px}.metric-input span{position:absolute;right:14px;top:50%;transform:translateY(-50%);font-size:12px;color:var(--muted)}.product-row{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:13px 0;border-top:1px solid var(--line)}.product-row:first-of-type{border-top:0}.product-name{font-size:14px;font-weight:650}.product-plan{font-size:11px;color:var(--muted);margin-top:4px}.status-select{max-width:130px;min-height:38px;padding:7px 9px;border-radius:11px;border:1px solid var(--line);background:#fbfcfa;color:var(--ink);font:inherit;font-size:12px}.dose-line{grid-column:1/-1;display:flex;align-items:center;gap:8px;margin-top:-3px}.dose-line label{font-size:11px;color:var(--muted);white-space:nowrap}.dose-line input{max-width:170px;min-height:36px;padding:7px 10px;font-size:12px}.primary-button,.secondary-button,.danger-button,.text-button{border:0;min-height:46px;border-radius:14px;padding:0 17px;font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .15s,background .15s}.primary-button{background:var(--green);color:white;width:100%;box-shadow:0 6px 15px #386d5026}.primary-button:active,.secondary-button:active{transform:scale(.985)}.secondary-button{background:var(--green-soft);color:var(--green-dark)}.danger-button{background:#fff0eb;color:#9b4638}.text-button{background:transparent;color:var(--green);padding:0 8px;min-height:35px}.button-row{display:flex;gap:9px;align-items:center}.button-row>*{flex:1}.photo-picker{display:flex;align-items:center;gap:12px;padding:12px;border:1px dashed #cbd8cd;border-radius:15px;background:#fbfcfa;cursor:pointer}.photo-picker .photo-icon{width:38px;height:38px;border-radius:12px;background:var(--green-soft);display:grid;place-items:center;font-size:18px}.photo-picker strong{display:block;font-size:12px}.photo-picker small{color:var(--muted);font-size:11px}.photo-preview{display:block;max-width:100%;max-height:260px;object-fit:cover;border-radius:14px;margin-top:10px}.notice{display:flex;gap:10px;padding:13px 14px;border-radius:15px;background:#eff3ed;color:#5d6d61;font-size:11px;line-height:1.6;margin:15px 0}.notice .notice-icon{font-size:15px}.divider{height:1px;background:var(--line);margin:16px 0}.empty-state{text-align:center;padding:25px 15px;color:var(--muted);font-size:13px;line-height:1.65}.empty-state .empty-icon{font-size:27px;margin-bottom:8px}.entry-list{display:grid;gap:11px}.entry-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:15px 16px}.entry-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.entry-date{font-size:13px;font-weight:700}.entry-date small{display:block;font-weight:400;color:var(--muted);font-size:11px;margin-top:3px}.entry-actions{display:flex;gap:3px}.entry-metrics{display:flex;flex-wrap:wrap;gap:8px;margin-top:11px}.metric-chip{background:#f0f4ef;border-radius:10px;padding:7px 10px;font-size:11px;color:#53655a}.metric-chip b{font-size:13px;color:var(--ink);margin-right:3px}.entry-note{font-size:12px;line-height:1.55;color:#5d6c63;margin:10px 0 0}.entry-photo{width:72px;height:72px;object-fit:cover;border-radius:12px;margin-top:10px}.tag{display:inline-flex;align-items:center;padding:5px 9px;background:#f4f1e7;border-radius:99px;color:#766944;font-size:10px;font-weight:600}.trend-switch{display:flex;gap:8px;background:#edf1eb;border-radius:14px;padding:4px;margin:13px 0}.trend-switch button{border:0;min-height:36px;flex:1;background:transparent;border-radius:11px;font:inherit;font-size:12px;color:var(--muted);cursor:pointer}.trend-switch button.active{background:#fff;color:var(--green-dark);font-weight:700;box-shadow:0 2px 8px #203c2812}.chart-wrap{height:220px;width:100%;position:relative}.chart-wrap svg{width:100%;height:100%;overflow:visible}.chart-grid{stroke:#e8ede6;stroke-width:1}.chart-line{fill:none;stroke:var(--green);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart-dot{fill:#fff;stroke:var(--green);stroke-width:2}.chart-label{font:10px 'DM Sans','Noto Sans SC',sans-serif;fill:#849188}.chart-value{font:11px 'DM Sans','Noto Sans SC',sans-serif;fill:#33463a;font-weight:700}.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.summary-box{background:#f6f8f4;border-radius:15px;padding:13px}.summary-box span{font-size:10px;color:var(--muted);display:block}.summary-box strong{font-size:18px;display:block;margin-top:6px}.summary-box em{font-size:10px;color:var(--muted);font-style:normal}.product-manager{padding:14px 0;border-top:1px solid var(--line)}.product-manager:first-child{border-top:0}.product-manager-top{display:flex;justify-content:space-between;gap:12px;align-items:center}.product-manager strong{font-size:13px}.product-manager p{margin:4px 0 0;font-size:11px;color:var(--muted)}.baseline-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.notice.warning{background:#fbf4e7;color:#796848}.modal-backdrop{position:fixed;inset:0;background:#14201975;display:grid;place-items:end center;padding:12px;z-index:5}.modal{width:min(100%,560px);max-height:88dvh;overflow:auto;background:var(--paper);border-radius:24px 24px 18px 18px;padding:20px;box-shadow:0 25px 80px #11251b40}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.modal-head h2{font-size:18px;margin:0}.close-button{width:34px;height:34px;border:0;border-radius:50%;background:#eff3ee;color:var(--ink);font-size:18px}.toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translate(-50%,15px);opacity:0;pointer-events:none;padding:11px 16px;border-radius:99px;background:#1e3328;color:#fff;font-size:12px;box-shadow:var(--shadow);transition:.2s;z-index:8;white-space:nowrap}.toast.show{opacity:1;transform:translate(-50%,0)}.tabbar{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,760px);display:grid;grid-template-columns:repeat(4,1fr);padding:9px 16px calc(9px + env(safe-area-inset-bottom));background:#fffffff0;backdrop-filter:blur(16px);border-top:1px solid #e4eae3;z-index:4}.tab{display:grid;justify-items:center;gap:3px;border:0;background:transparent;color:#8a968d;font:inherit;font-size:10px;cursor:pointer;padding:4px 0}.tab-icon{font-size:20px;line-height:1.1}.tab.active{color:var(--green-dark);font-weight:700}.tab.active .tab-icon{background:#e9f0e7;width:34px;height:28px;border-radius:12px;display:grid;place-items:center}.inline-link{color:var(--green);font-size:12px;font-weight:650;text-decoration:none}.hidden{display:none!important}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 0;border-top:1px solid var(--line)}.settings-row:first-child{border:0}.settings-row strong{font-size:13px}.settings-row p{font-size:11px;color:var(--muted);margin:4px 0 0}.settings-row .secondary-button{min-height:36px;font-size:11px}.file-input{display:none}.target-box{display:flex;gap:10px;align-items:flex-start;padding:13px;background:#f4f6f0;border-radius:15px;color:#526358;font-size:12px;line-height:1.55}.target-box b{color:var(--green-dark)}
@media(min-width:650px){.app-shell{padding-left:30px;padding-right:30px}.page-heading h1{font-size:36px}.card{padding:22px}.view-root{padding-bottom:20px}}
@media(max-width:390px){.app-shell{padding-left:15px;padding-right:15px}.page-heading h1{font-size:27px}.card{padding:16px}.status-select{max-width:112px}.form-grid{gap:8px}}
.planned-dose-list{display:grid;gap:8px}
.planned-dose-list label{display:grid;grid-template-columns:46px 1fr;align-items:center;gap:9px}
.planned-dose-list label span{font-size:12px;color:var(--muted);font-weight:650}
.planned-dose-list input{width:100%;min-height:42px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;background:#fbfcfa;color:var(--ink);font:inherit;font-size:13px;outline:none}
.planned-dose-list input:focus{border-color:#7da28a;box-shadow:0 0 0 3px #386d5018}
.product-manager-top{align-items:flex-start}
.product-manager-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:2px;flex-shrink:0}
.product-delete{color:var(--accent)}
.usage-hint{padding:11px 13px;margin:0 0 12px;border-radius:13px;background:#f4f6f0;color:var(--muted);font-size:11px;line-height:1.6}
.period-block{padding:14px;margin:12px 0;border:1px solid var(--line);border-radius:17px;background:#fff;overflow:hidden}
.period-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-14px -14px 6px;padding:12px 14px;border-bottom:1px solid #e9eee8;background:linear-gradient(110deg,#f0f5ed,#fafbf9)}
.period-title{display:flex;align-items:center;gap:10px;min-width:0}.period-title>div{display:grid;gap:3px}.period-head strong{font-size:14px;letter-spacing:.01em}.period-head small{font-size:10px;color:var(--muted)}
.period-icon{display:grid;place-items:center;width:34px;height:34px;flex:none;border:1px solid #dce8d8;border-radius:12px;background:#fff;color:var(--green);font-size:18px;box-shadow:0 2px 6px #264d390a}
.period-head--noon .period-icon{color:#a16b2f;background:#fffaf0;border-color:#f0e3c9}.period-head--evening .period-icon{color:#59688c;background:#f4f5fb;border-color:#e1e4f0}
.period-label{padding:5px 10px;border:1px solid #dce8d8;border-radius:99px;background:#fff;color:var(--green-dark);font-size:11px;font-weight:700;white-space:nowrap}
.period-block .product-row{padding:11px 0}
.period-note{margin:8px 0 10px}.period-note input{min-height:40px}
.period-save{width:100%;min-height:42px}
.quick-plan-action{display:grid;gap:7px;margin:-2px 0 14px;padding:13px 15px;border:1px solid #dfe9dc;border-radius:16px;background:linear-gradient(110deg,#f1f6ee,#fbfcfa)}
.quick-plan-action button{min-height:44px;border-color:#cbdcc9;color:var(--green-dark);font-weight:700}
.quick-plan-action small{padding:0 2px;color:var(--muted);font-size:10px;line-height:1.5}
.legacy-usage{display:grid;gap:3px;padding:10px 2px 0;color:var(--ink);font-size:11px}.legacy-usage small{color:var(--muted)}
.photo-preview,.entry-photo{cursor:zoom-in}
body.image-viewer-open{overflow:hidden}
.image-viewer{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:calc(48px + env(safe-area-inset-top)) 14px calc(46px + env(safe-area-inset-bottom));background:#101713f2;cursor:zoom-out}
.image-viewer img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:5px;cursor:default}
.image-viewer>span{position:absolute;bottom:calc(14px + env(safe-area-inset-bottom));left:0;width:100%;color:#ffffffb8;text-align:center;font-size:11px;pointer-events:none}
.image-viewer-close{position:absolute;top:calc(12px + env(safe-area-inset-top));right:14px;display:grid;place-items:center;width:40px;height:40px;border:1px solid #ffffff55;border-radius:50%;background:#ffffff1c;color:#fff;font-size:26px;line-height:1;cursor:pointer}
.photo-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:10px}.photo-item{min-width:0}.photo-gallery .photo-preview{width:100%;height:auto;aspect-ratio:1;max-height:none;object-fit:cover;border-radius:12px;margin:0}.photo-remove{display:block;width:100%;margin-top:3px}.photo-picker.is-full{cursor:not-allowed;opacity:.72}

