:root { color-scheme:light; --ink:#182d28; --muted:#73837d; --border:#e5ece6; --paper:#ffffff; --wash:#f5f8f5; --green:#2d7860; --green-strong:#1d654e; --green-soft:#e6f3ec; --orange:#e8a864; --blue:#7897c8; --shadow:0 8px 34px rgba(30,55,42,.055); --round:20px; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; font-synthesis:none }
* { box-sizing:border-box }
body { margin:0; color:var(--ink); background:#f8faf8; min-width:320px; }
button,input,textarea,select { font:inherit }
button { cursor:pointer }
button:disabled { cursor:default; opacity:.55 }
:focus-visible { outline:3px solid #9dd7bf; outline-offset:2px }
a {color:var(--green-strong)}
.layout { min-height:100vh; display:grid; grid-template-columns:246px minmax(0,1fr) }
.sidebar { background:#fff; border-right:1px solid var(--border); display:flex; flex-direction:column; padding:30px 18px 22px; position:sticky; top:0; height:100vh }
.brand { display:flex; align-items:center; gap:10px; padding:0 14px 36px; font-weight:800; font-size:22px; letter-spacing:-.9px }
.logo { width:36px; height:36px; display:grid; place-items:center; border-radius:12px; background:var(--green); color:#fff; font-size:24px; font-weight:700; box-shadow:0 7px 15px #2d786023 }
.brand span span { color:var(--green) }
.side-section { color:#a3ada8; font-size:10px; text-transform:uppercase; letter-spacing:1.9px; font-weight:800; padding:0 16px 13px }
.nav { display:flex; flex-direction:column; gap:5px }
.nav-button { display:flex; align-items:center; gap:13px; width:100%; text-align:left; border:0; background:transparent; padding:14px 16px; border-radius:13px; color:#667b72; font-weight:650; font-size:14px }
.nav-button:hover { background:#f5f8f5 }
.nav-button.active { background:#eaf5ee; color:var(--green-strong) }
.nav-icon { font-size:19px; width:22px; text-align:center; line-height:1 }
.sidebar-bottom { margin-top:auto; border:1px solid #e5eee6; background:#f8fbf8; border-radius:17px; padding:16px }
.sidebar-bottom .mini-icon { width:31px; height:31px; display:grid; place-items:center; background:#e5f3e9; border-radius:9px; margin-bottom:9px }
.sidebar-bottom strong { display:block; font-size:13px; margin-bottom:7px }
.sidebar-bottom p { font-size:12px; line-height:1.6; color:var(--muted); margin:0 }
.main { min-width:0; width:100%; max-width:1520px; margin:0 auto; padding:34px 44px 90px }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:28px }
.eyebrow { color:var(--green); letter-spacing:2px; text-transform:uppercase; font-weight:850; font-size:10px; margin-bottom:7px }
h1 { margin:0; font-size:32px; letter-spacing:-1.35px; line-height:1.15 }
.subhead { margin:8px 0 0; font-size:13px; color:var(--muted); line-height:1.55 }
.date-picker { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--border); padding:6px; border-radius:12px; box-shadow:var(--shadow) }
.date-picker input { border:0; color:var(--ink); padding:7px; background:transparent; font-weight:650; font-size:13px; min-width:132px; }
.icon-btn { border:0; width:32px; height:32px; background:#f1f6f2; border-radius:9px; color:var(--green-strong); font-size:21px; line-height:1 }
.icon-btn:hover { background:#e3f0e7 }
.btn { border-radius:11px; border:1px solid transparent; padding:11px 15px; display:inline-flex; gap:8px; align-items:center; justify-content:center; text-align:center; background:var(--green); color:white; font-size:13px; font-weight:750; line-height:1.3; white-space:nowrap; transition:transform .1s,background .12s }
.btn:hover:not(:disabled) { background:var(--green-strong) }
.btn:active:not(:disabled) { transform:scale(.98) }
.btn.light { background:#eff6f1; border-color:#deebe1; color:var(--green-strong) }
.btn.light:hover { background:#e1f0e6 }
.btn.white { background:#fff; border-color:var(--border); color:#425b4d }
.btn.white:hover { background:#f8faf8 }
.btn.danger { background:#fff1f0; color:#a44844 }
.btn.tiny { padding:8px 11px; font-size:12px; border-radius:9px }
.btn.full { width:100% }
.btn.text { padding:6px; background:none; color:var(--green) }
.btn.text:hover { background:#eff6f1 }
.panel { background:#fff; border:1px solid var(--border); border-radius:var(--round); box-shadow:var(--shadow); overflow:hidden }
.panel-pad { padding:22px }
.section-title {display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:19px }
.section-title h2 { font-size:17px; font-weight:800; margin:0; letter-spacing:-.5px }
.section-title p { margin:3px 0 0; font-size:12px; color:var(--muted) }
.overview { display:grid; grid-template-columns:minmax(250px,1.28fr) repeat(4,minmax(130px,1fr)); gap:14px; margin-bottom:21px }
.hero { background:linear-gradient(133deg,#205f4b,#39896b); color:#fff; border-radius:var(--round); padding:21px 23px; min-height:173px; position:relative; overflow:hidden; box-shadow:0 12px 25px #26785822 }
.hero:after {content:''; position:absolute; width:225px; height:225px; right:-105px; top:-94px; border-radius:50%; border:38px solid #ffffff11; pointer-events:none }
.hero-caption {font-size:12px; color:#c5e7d4; font-weight:650 }
.hero-big {font-size:41px; line-height:1.1; letter-spacing:-1.8px; font-weight:830; margin:13px 0 4px }
.hero-unit { font-size:14px; color:#d0eddb; font-weight:650; margin-left:5px }
.hero-foot { font-size:12px; color:#d0eddb; margin:8px 0 13px }
.progress-track { height:7px; background:#ffffff36; border-radius:40px; overflow:hidden }
.progress-fill {height:100%; border-radius:40px; background:#bde5c9; max-width:100% }
.stat { background:white; border:1px solid var(--border); border-radius:var(--round); padding:20px 18px; display:flex; flex-direction:column; justify-content:space-between; min-height:173px }
.stat-top { display:flex; align-items:center; justify-content:space-between; gap:5px; color:var(--muted); font-size:12px; font-weight:650 }
.stat-dot {width:10px; height:10px; border-radius:50% }
.stat-num { font-size:27px; font-weight:850; letter-spacing:-1px; line-height:1.15; margin-top:19px }
.stat-unit {font-size:12px; color:var(--muted); font-weight:500; letter-spacing:0; margin-left:4px }
.stat-target {font-size:11px; color:var(--muted); margin:5px 0 11px}
.stat-track {height:5px; border-radius:20px; overflow:hidden; background:#ecf0ee }
.stat-bar {height:100%; border-radius:20px; max-width:100% }
.dashboard-grid {display:grid; grid-template-columns:minmax(0,1.36fr) minmax(310px,.84fr); gap:20px; align-items:start }
.stack {display:flex; flex-direction:column; gap:19px; min-width:0 }
.meal-block {margin-top:18px; }
.meal-heading {display:flex; align-items:center; justify-content:space-between; gap:8px; background:#f8faf8; border-radius:10px; padding:10px 12px; font-size:12px; font-weight:800; color:#557064 }
.meal-heading span:last-child { font-weight:550; color:#84958b }
.log-item {display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px; align-items:center; border-bottom:1px solid #edf2ed; padding:13px 3px 13px 8px }
.log-item:last-child {border-bottom:0}
.log-name { font-size:13px; font-weight:750; margin-bottom:4px }
.log-note {color:var(--muted); font-size:11px; line-height:1.4 }
.log-value {font-size:13px; font-weight:800; text-align:right; white-space:nowrap }
.log-value span {font-size:10px; font-weight:550; color:var(--muted); display:block; margin-top:3px }
.ghost-icon { border:0; color:#8c9e95; padding:7px; background:transparent; border-radius:8px; font-size:15px; }
.ghost-icon:hover {color:var(--green); background:#eaf4ed }
.empty {padding:32px 16px; text-align:center; color:var(--muted) }
.empty-illustration { margin:0 auto 13px; background:#eaf6ef; width:55px; height:55px; border-radius:17px; display:grid; place-items:center; font-size:24px }
.empty strong {display:block; color:var(--ink); margin-bottom:7px; font-size:14px }
.empty p {margin:0 auto 16px; line-height:1.7; font-size:12px; max-width:320px }
.input, .select, textarea {background:#fff; color:var(--ink); border:1px solid #dce6df; border-radius:11px; width:100%; padding:11px 12px; font-size:13px; outline:none; min-width:0}
.input:focus,.select:focus,textarea:focus {border-color:#74b592; box-shadow:0 0 0 3px #b0dfc142 }
textarea {resize:vertical; min-height:96px; line-height:1.5}
.field label { display:block; color:#60756b; font-size:12px; font-weight:760; margin-bottom:7px }
.search {width:100%; position:relative }
.search input {padding-left:39px }
.search-icon {position:absolute; left:14px; top:11px; font-size:15px; color:#98aa9f }
.quick-row {display:flex; align-items:center; justify-content:space-between; padding:12px 3px; border-bottom:1px solid #eef2ef; gap:10px }
.quick-row:last-child {border-bottom:0 }
.quick-name {font-weight:740; font-size:12px; line-height:1.4 }
.quick-detail {font-size:11px; color:var(--muted); margin-top:3px }
.pill {display:inline-block; border-radius:40px; background:#f0f5f0; padding:4px 8px; font-size:10px; color:#5b7565; font-weight:750; white-space:nowrap }
.pill.estimate {background:#fff4e5; color:#a66b2a}
.divider-with-text {display:flex; align-items:center; gap:11px; text-align:center; font-size:10px; letter-spacing:1px; color:#98a99f; text-transform:uppercase; font-weight:780; margin:19px 0 }
.divider-with-text:before,.divider-with-text:after {content:''; height:1px; flex:1; background:var(--border)}
.ai-panel {background:linear-gradient(160deg,#eef7f2,#f8fbf7); border:1px solid #dcece0; border-radius:17px; padding:18px }
.ai-heading {display:flex; align-items:center; gap:10px; margin-bottom:10px}
.ai-spark {display:grid; place-items:center; background:#dcedde; width:34px; height:34px; border-radius:11px; color:var(--green); font-size:20px }
.ai-heading strong {font-size:14px }
.ai-heading small {display:block; color:#70877a; margin-top:3px; font-size:11px }
.ai-footnote {font-size:10px; color:#8b9d91; margin:10px 0 0; line-height:1.5 }
.ai-item {background:white; border:1px solid #deebe0; border-radius:11px; padding:12px; margin-top:10px }
.ai-item-top {display:flex; align-items:center; justify-content:space-between; gap:9px}
.ai-item strong {font-size:12px}
.ai-item p {font-size:11px; line-height:1.5; color:var(--muted); margin:5px 0 9px }
.inline-actions {display:flex; align-items:center; flex-wrap:wrap; gap:8px }
.week-chart {display:flex; align-items:flex-end; justify-content:space-around; gap:12px; height:128px; padding:3px 4px 0 }
.week-day {display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; flex:1; gap:7px; min-width:0 }
.week-bar-wrap {height:95px; width:100%; max-width:36px; background:#f1f5f1; border-radius:9px 9px 5px 5px; display:flex; align-items:end; overflow:hidden }
.week-bar {width:100%; background:linear-gradient(#71ba93,#3c8a6a); border-radius:9px 9px 5px 5px; min-height:0 }
.week-label {color:#94a49b; font-size:10px; font-weight:650 }
.week-day.selected .week-label {color:var(--green); font-weight:850 }
.week-day.selected .week-bar {background:linear-gradient(#377e61,#226a50) }
.nutrition-table {width:100%; border-collapse:collapse; font-size:12px }
.nutrition-table td {padding:11px 2px; border-bottom:1px solid #f0f3f0 }
.nutrition-table tr:last-child td {border-bottom:0 }
.nutrition-table td:nth-child(2), .nutrition-table td:nth-child(3) {text-align:right; font-variant-numeric:tabular-nums }
.nutrition-table td:first-child {font-weight:650 }
.nutrition-table td:nth-child(2) {font-weight:780 }
.nutrition-table td:nth-child(3) {color:var(--muted); font-size:11px; width:98px }
.library-header {display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:20px}
.library-count {color:var(--muted); font-size:12px; margin-top:5px}
.library-tools {display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap }
.library-tools .search {flex:1; min-width:220px}
.library-tools .select {width:auto; min-width:150px}
.food-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px}
.food-card {background:white; border:1px solid var(--border); border-radius:16px; padding:17px; display:flex; flex-direction:column; gap:14px; box-shadow:var(--shadow)}
.food-card-top {display:flex; justify-content:space-between; align-items:start; gap:9px}
.food-card h3 {font-size:14px; margin:0 0 4px; line-height:1.4 }
.food-card p {color:var(--muted); font-size:11px; margin:0; line-height:1.45}
.food-card .metrics {display:flex; gap:6px; flex-wrap:wrap}
.metric-chip {background:#f5f8f5; border-radius:8px; padding:7px 9px; font-size:11px; color:#667f71 }
.metric-chip b {color:#2a4e3d; font-size:12px }
.food-card-actions {display:flex; gap:8px; margin-top:auto; align-items:center}
.food-card-actions .btn:first-child {flex:1 }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:19px; align-items:start }
.settings-stack {display:flex; flex-direction:column; gap:19px }
.settings-copy {font-size:12px; line-height:1.7; color:var(--muted); margin:0 0 16px }
.goal-grid,.form-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
.goal-grid .field input {background:#fafcfb }
.status-pill {display:inline-flex; gap:7px; align-items:center; font-size:11px; padding:6px 10px; border-radius:99px; background:#f2f4f2; color:#6c7b72; font-weight:740}
.status-pill.on {background:#e4f4e7; color:#23734d}
.status-dot {width:7px; height:7px; border-radius:50%; background:currentColor}
.notice {padding:12px 14px; border-radius:11px; background:#f4f9f5; border:1px solid #e3efe5; color:#5b7564; font-size:11px; line-height:1.6}
.notice.warning {background:#fff8eb; border-color:#f8e9d1; color:#8f6a2c}
.form-grid .span-all {grid-column:1/-1}
.form-actions {display:flex; justify-content:flex-end; gap:8px; margin-top:20px; flex-wrap:wrap}
.modal {border:1px solid #e4ece5; border-radius:20px; box-shadow:0 30px 85px #153b2860; padding:25px; background:white; width:min(680px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); overflow:auto; color:var(--ink)}
.modal::backdrop {background:#132e2488; backdrop-filter:blur(3px)}
.modal.small-modal {width:min(430px,calc(100vw - 28px))}
.modal-head {display:flex; align-items:center; justify-content:space-between; margin-bottom:17px; gap:10px }
.modal-head h2 {margin:0; font-size:20px; letter-spacing:-.6px }
.modal-title-note {font-size:12px; color:var(--muted); margin:-10px 0 20px }
.nutrients-heading {font-size:13px; font-weight:800; margin:24px 0 13px }
.modal .field {min-width:0}
.modal .field .hint {font-size:10px; color:#91a097; margin-top:5px }
.toast {position:fixed; z-index:300; right:22px; bottom:22px; background:#223f31; color:#fff; border-radius:12px; padding:12px 16px; box-shadow:0 9px 26px #16422b33; font-size:12px; font-weight:650; max-width:min(410px,calc(100vw - 40px)); opacity:0; pointer-events:none; transform:translateY(15px); transition:all .2s }
.toast.visible {opacity:1; transform:translateY(0)}
.loading {height:100vh; display:flex; align-items:center; justify-content:center; gap:12px; color:var(--green); font-weight:700}
.spinner {display:inline-block; width:17px; height:17px; border:2px solid #accbb4; border-top-color:#2d7860; border-radius:50%; animation:spin .8s linear infinite; vertical-align:middle }
@keyframes spin {to{transform:rotate(360deg)}}
.mobile-nav {display:none}
@media(max-width:1250px) { .overview {grid-template-columns:repeat(4,minmax(0,1fr))} .hero {grid-column:span 4; min-height:155px} .hero-big {margin-top:9px} .stat {min-height:137px; padding:17px} .stat-num {margin-top:11px} .main {padding:30px 28px 80px} }
@media(max-width:980px) { .layout {grid-template-columns:190px minmax(0,1fr)} .sidebar {padding:25px 11px} .brand {padding:0 8px 34px; font-size:19px} .dashboard-grid {grid-template-columns:minmax(0,1fr)} .settings-grid {grid-template-columns:minmax(0,1fr)} .sidebar-bottom {display:none} }
@media(max-width:690px) { .layout {display:block} .sidebar {display:none} .main {padding:20px 15px 94px} .topbar {align-items:flex-start; gap:14px; flex-direction:column; margin-bottom:20px} h1 {font-size:27px} .date-picker {align-self:stretch; justify-content:space-between; width:100%} .date-picker input {text-align:center} .overview {grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:15px} .hero {grid-column:span 2; min-height:153px} .stat {min-height:128px; padding:15px} .stat-num {font-size:24px} .panel-pad {padding:17px} .dashboard-grid,.stack {gap:14px} .food-grid {grid-template-columns:1fr} .library-header {align-items:flex-start; flex-wrap:wrap} .mobile-nav {position:fixed; bottom:0; padding-bottom:env(safe-area-inset-bottom); left:0; width:100%; display:flex; background:#fff; border-top:1px solid var(--border); z-index:100; box-shadow:0 -3px 12px #1f392609} .mobile-nav button {border:0; background:white; color:#8aa097; flex:1; padding:10px 4px 8px; font-size:10px; font-weight:750; display:flex; flex-direction:column; align-items:center; gap:4px} .mobile-nav button span {font-size:20px} .mobile-nav button.active {color:var(--green)} .library-tools .select {min-width:120px} .goal-grid,.form-grid {gap:9px} .modal {padding:18px} .toast {bottom:84px; right:12px} }
@media(max-width:375px) {.stat {padding:11px} .stat-top {font-size:11px} .stat-num {font-size:22px} .hero-big {font-size:37px} }
.ai-details {margin:10px 0 2px; background:#f9fcf9; border:1px solid #e3eee6; border-radius:10px; padding:10px 12px}
.ai-details summary {font-size:11px; color:var(--green-strong); font-weight:800; cursor:pointer}
.ai-details .field label {font-size:10px}
.ai-details .input {padding:8px 9px; font-size:12px}

.library-more { display:flex; flex-direction:column; align-items:center; gap:10px; padding:22px; color:var(--muted); font-size:12px; }
.library-more p { margin:0; }

/* v0.3 reusable, ingredient-by-ingredient saved meals */
.recipe-card .food-card-top {min-height:73px}
.recipe-card .recipe-chips {display:flex;flex-wrap:wrap;gap:6px;margin-top:-3px}
.recipe-chips span {background:#f6faf7;border:1px solid #e5eee7;border-radius:8px;padding:5px 8px;color:#587265;font-size:10px;line-height:1.4}
.recipe-modal {width:min(780px,calc(100vw - 28px));padding:26px}
.recipe-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:23px 0 12px}
.recipe-head h3 {font-size:16px;margin:0;letter-spacing:-.3px}
.recipe-head p {font-size:11px;color:var(--muted);margin:5px 0 0;line-height:1.5}
.recipe-ingredient {background:#fbfdfb;border:1px solid #e1ece4;border-radius:14px;padding:14px 16px;margin:10px 0}
.recipe-part-heading {display:flex;gap:9px;align-items:center;margin-bottom:13px;font-size:13px}
.recipe-part-heading strong {flex:1;min-width:0}
.recipe-part-heading .ghost-icon {flex-shrink:0}
.recipe-index {background:#deefe3;color:#28684e;width:24px;height:24px;display:grid;place-items:center;border-radius:8px;font-size:11px;font-weight:800;flex-shrink:0}
.recipe-part-grid {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:11px;align-items:end}
.recipe-part-grid .span-all {grid-column:1/-1}
.recipe-item-cal {justify-self:end;align-self:center;text-align:right;color:#2c7355;font-weight:800;font-size:14px;white-space:nowrap}
.recipe-item-cal span {color:#80958a;font-size:11px;font-weight:550}
.recipe-totals {background:#eef7f0;border:1px solid #d9eade;border-radius:16px;padding:18px;margin-top:17px}
.recipe-big {font-size:30px;font-weight:850;letter-spacing:-1.2px;margin:4px 0 15px}
.recipe-big small {font-size:12px;font-weight:650;color:#6a8574;letter-spacing:0}
.recipe-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.recipe-metrics>div {background:#fff;border:1px solid #e5efe6;border-radius:10px;padding:9px}
.recipe-metrics span {display:block;color:var(--muted);font-size:10px;margin-bottom:4px}
.recipe-metrics strong {display:block;color:#315d47;font-size:12px;white-space:nowrap}
.recipe-log-fields {margin-top:18px}
.recipe-actions {align-items:center}
.recipe-actions .btn.light {margin-right:auto;white-space:normal}
@media(max-width:690px) {
 .recipe-modal {padding:16px}
 .recipe-part-grid {grid-template-columns:minmax(0,1fr)}
 .recipe-part-grid .span-all {grid-column:auto}
 .recipe-item-cal {justify-self:start;text-align:left}
 .recipe-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
 .recipe-actions .btn {flex:1}
 .recipe-actions .btn.light {flex:1 0 100%}
 .recipe-card .food-card-actions {flex-wrap:wrap}
}

/* v0.4 family weekly meal plan and editable grocery checklist */
.plan-toolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:13px;flex-wrap:wrap}
.plan-toolbar strong{display:block;margin:5px 0 6px;font-size:17px}
.plan-toolbar p,.plan-explain{font-size:12px;color:var(--muted);line-height:1.6;margin:0}
.plan-toolbar .inline-actions{justify-content:flex-end}
.plan-person{min-width:130px;max-width:175px}
.plan-explain{margin:0 0 18px}
.plan-days{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin-bottom:23px}
.plan-day{overflow:hidden;padding:0}
.plan-day-top{padding:14px 16px;background:#ecf6ef;border-bottom:1px solid #d8e8dc;display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.plan-day-top strong{font-size:15px;color:#295e44}
.plan-day-top span{font-size:11px;color:#648476}
.plan-slot{padding:13px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #edf1ed}
.plan-slot:last-child{border-bottom:0}
.plan-slot>div{min-width:0}
.plan-slot-label{display:block;color:#729083;text-transform:uppercase;font-size:10px;font-weight:800;letter-spacing:.7px;margin-bottom:4px}
.plan-slot strong{display:block;font-size:12px;line-height:1.45}
.plan-slot small{display:block;font-size:10px;color:#899d91;margin-top:4px;line-height:1.5}
.plan-slot button{flex-shrink:0}
.plan-lower{display:grid;grid-template-columns:1.25fr 1fr;gap:17px;align-items:start}
.plan-lower .stack{gap:17px}
.shop-group{margin-top:18px}
.shop-group h3{font-size:12px;letter-spacing:.6px;text-transform:uppercase;color:#3b7959;margin:0 0 8px}
.shop-item{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #edf2ed;padding:12px 0}
.shop-item-info{flex:1;min-width:0}
.shop-item-info strong{font-size:12px;display:block;line-height:1.4}
.shop-item-info small{font-size:11px;color:var(--muted);display:block;line-height:1.55;margin:3px 0 9px}
.shop-item.completed .shop-item-info>strong{color:#77928a;text-decoration:line-through}
.shop-qty-label{font-size:10px;color:var(--muted);display:flex;align-items:center;gap:7px}
.shop-qty{font-size:11px!important;padding:7px 8px!important;width:min(220px,100%)!important}
.shop-status{width:110px;min-width:100px;flex:0 0 110px;padding:8px;font-size:11px}
.prep-note{padding:13px 0;border-bottom:1px solid #edf2ed}
.prep-note:last-child{border-bottom:0}
.prep-note strong{font-size:12px}
.prep-note p{font-size:11px;color:var(--muted);line-height:1.65;margin:6px 0 0}
@media(max-width:1100px){.plan-lower{grid-template-columns:1fr}}
@media(max-width:850px){.plan-days{grid-template-columns:1fr}}
@media(max-width:690px){.plan-toolbar .inline-actions{justify-content:flex-start}.plan-day-top{padding:13px}.plan-slot{padding:12px 13px}.plan-slot button{font-size:10px;padding:9px}.plan-person{max-width:100%}.shop-item{align-items:flex-start}.shop-status{min-width:95px;flex-basis:95px}.shop-qty{width:100%!important}.mobile-nav button{font-size:9px;padding:9px 1px 7px}}

/* v0.5 nutrition history, adjustable averages and day-by-day entries */
.history-controls{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:20px;margin-bottom:22px}
.history-chips{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:10px}
.history-chip{border:1px solid #dfe9e1;color:#496c5b;background:#fff;border-radius:9px;padding:11px 13px;font-weight:800;font-size:12px;min-width:47px}
.history-chip:hover{background:#eef8f1}
.history-chip.active{background:#2d785c;border-color:#2d785c;color:#fff}
.history-custom{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#687f71;background:#f6f9f6;border:1px solid #e1ece4;padding:4px 9px;border-radius:10px}
.history-custom input{width:65px;padding:7px 6px;text-align:center;font-weight:800}
.history-control-end{display:flex;gap:13px;align-items:flex-end;flex-wrap:wrap}
.history-control-end .field{min-width:180px}
.history-control-end .field label,.history-metric-field label{font-size:11px;display:block;color:#71877a;margin-bottom:6px;font-weight:750}
.history-control-end .field select{min-width:210px}
.history-summary{margin-bottom:20px}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:17px}
.history-heading h2{font-size:22px;letter-spacing:-.6px;margin:6px 0 6px}
.history-heading p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}
.history-average-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:13px}
.history-avg-card{background:white;border:1px solid var(--border);padding:18px 16px;border-radius:15px;display:flex;flex-direction:column;gap:9px;box-shadow:var(--shadow);min-width:0}
.history-avg-card.featured{background:linear-gradient(132deg,#236449,#398e68);border-color:transparent;color:white}
.history-avg-card>span{font-size:11px;font-weight:750;color:#6a8678}
.history-avg-card.featured>span{color:#d5ebdb}
.history-avg-card strong{font-size:27px;letter-spacing:-1px;line-height:1.2;font-weight:850;white-space:nowrap}
.history-avg-card strong small{font-size:11px;letter-spacing:0;font-weight:600;margin-left:4px;color:#859b8e}
.history-avg-card.featured strong small{color:#d9efe0}
.history-avg-card>small{font-size:10px;color:#899d90;line-height:1.4}
.history-avg-card.featured>small{color:#cae7d4}
.history-chart-panel{margin-bottom:20px}
.history-chart-panel .section-title{flex-wrap:wrap}
.history-chart-panel .section-title p{max-width:570px;line-height:1.5}
.history-metric-field .select{min-width:185px}
.history-chart{display:block;width:100%;height:auto;min-height:170px;max-height:300px;overflow:visible}
.history-chart-empty{border:1px dashed #dbe8de;border-radius:12px;padding:70px 20px;text-align:center;color:#83978b;font-size:13px}
.history-log-panel{margin-bottom:20px}
.history-day-list{border-top:1px solid #e8eee9}
.history-day{border-bottom:1px solid #e8eee9}
.history-day summary{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(80px,.6fr) minmax(95px,.6fr) 18px;align-items:center;gap:13px;padding:14px 5px;list-style:none;cursor:pointer}
.history-day summary::-webkit-details-marker{display:none}
.history-day summary:hover{background:#f8fbf8}
.history-day[open] summary{background:#f5faf6}
.history-date strong{font-size:12px;display:block;line-height:1.6}
.history-date small{color:var(--muted);font-size:11px}
.history-day-stat{font-size:14px;font-weight:800;color:#346b51;font-variant-numeric:tabular-nums;text-align:right}
.history-day-stat small{font-size:11px;color:#8aa095;font-weight:600}
.history-day.missing .history-day-stat{color:#a6b5ab}
.history-chevron{color:#8ba59a;text-align:center;font-size:18px;transition:transform .15s}
.history-day[open] .history-chevron{transform:rotate(180deg)}
.history-detail{background:#f8fbf9;padding:13px 17px 16px;border-radius:0 0 12px 12px}
.history-nutrient-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:15px}
.history-nutrient{background:white;border:1px solid #e8eee9;border-radius:9px;padding:9px 11px;min-width:0}
.history-nutrient span{display:block;font-size:10px;color:var(--muted);margin-bottom:5px}
.history-nutrient strong{font-size:12px;color:#355f49;font-variant-numeric:tabular-nums}
.history-load-more{text-align:center;padding:17px 0 0}
.history-loading{padding:65px 15px;text-align:center;color:#688578;font-size:13px}
@media(max-width:1200px){.history-average-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:690px){
 .mobile-nav button{font-size:9px;gap:3px;padding:8px 1px 7px;min-width:0}
 .mobile-nav button span{font-size:18px}
 .history-controls{gap:14px}
 .history-control-end{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:9px}
 .history-control-end .field{min-width:0}
 .history-control-end .field input,.history-control-end .field select{width:100%;min-width:0;font-size:11px;padding:9px 6px}
 .history-chips{gap:6px}
 .history-chip{min-width:41px;padding:10px 8px}
 .history-average-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .history-avg-card{padding:14px 13px;gap:8px}
 .history-avg-card strong{font-size:24px}
 .history-heading h2{font-size:18px}
 .history-chart-panel .section-title{align-items:flex-start}
 .history-metric-field,.history-metric-field select{width:100%;min-width:0}
 .history-nutrient-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .history-day summary{grid-template-columns:minmax(0,1fr) 85px 16px;gap:5px}
 .history-day-stat.extra{display:none}
 .history-date strong{font-size:11px}
 .history-date small{font-size:10px}
}

.macrotracker-exit{position:fixed;bottom:14px;right:14px;z-index:99;padding:8px 12px;border:1px solid #adc8b7;background:#fff;color:#315e47;border-radius:30px;font:600 12px system-ui;box-shadow:0 3px 12px #153e2526;cursor:pointer}
.macrotracker-exit:hover{background:#e9f5ee}
@media(max-width:760px){.macrotracker-exit{bottom:calc(85px + env(safe-area-inset-bottom));right:8px;padding:7px 9px;font-size:11px}}

/* Claude multi-meal review and durable error states */
.ai-meal-group { margin:15px 0 8px; }
.ai-meal-group h3 { font-size:13px; font-weight:700; color:#23593f; border-bottom:1px solid #d6e8dc; padding:8px 0; margin:0 0 6px; }
.ai-error { background:#fff1ee; border:1px solid #dba5a1; color:#853b36; border-radius:10px; padding:13px; margin:12px 0; font-size:12px; }
.ai-error p { margin:6px 0 0; line-height:1.4; }
.ai-panel textarea { min-height:140px; width:100%; }

/* v0.8 readability refresh: larger, legible labels, better contrast and tap targets */
:root { --muted:#50665b; --ink:#173328; --border:#d7e4db; font-size:16px; }
body { font-size:15px; line-height:1.55; }
.main { padding:30px 34px 80px; }
.brand { font-size:23px; letter-spacing:-.5px; }
.nav-button { font-size:15px; padding:13px 15px; }
.side-section,.eyebrow { font-size:12px; letter-spacing:1px; }
h1 { font-size:clamp(27px,3vw,36px);letter-spacing:-.75px;line-height:1.2; }
.subhead,.library-count,.settings-copy,.notice,.hint,.ai-footnote { font-size:14px;line-height:1.65; }
.section-title h2 { font-size:19px; }
.section-title p,.food-card p,.quick-detail,.log-note,.modal-title-note {font-size:14px;line-height:1.5;}
.food-card h3,.quick-name,.log-name {font-size:16px;line-height:1.4;}
.btn {font-size:14px;min-height:42px;padding:11px 16px;}
.btn.tiny {font-size:13px;min-height:38px;padding:9px 12px;}
.input,.select,textarea,input[type=date],input[type=number],select {font-size:15px;min-height:42px;}
.field label,.shop-qty-label,.history-control-end .field label,.history-metric-field label{font-size:13px;line-height:1.4;}
.metric-chip,.pill {font-size:12px;}
.library-info {border:1px solid #cfdfd1;background:#f0f7f0;color:#345640;padding:11px 15px;border-radius:11px;margin:0 0 16px;font-size:13px;line-height:1.5;}
.food-warning {display:block;color:#85591b;background:#fff7e9;font-weight:650;font-size:12px;border-radius:7px;padding:7px 9px;margin-top:6px;line-height:1.35;}
.log-item,.quick-row {min-height:64px;}
.plan-slot strong,.shop-item-info strong,.prep-note strong {font-size:14px;}
.plan-slot small,.shop-item-info small,.prep-note p,.plan-day-top span,.history-date small,.history-day-stat small {font-size:12px;}
.plan-slot-label,.shop-group h3,.history-nutrient span,.history-avg-card>small {font-size:12px;}
.history-date strong,.history-nutrient strong,.history-avg-card>span {font-size:13px;}
.history-avg-card strong {font-size:28px;}
.ai-meal-group h3,.ai-error {font-size:14px;}
@media(max-width:900px){.main{padding:24px 20px 92px}}
@media(max-width:690px){
  body{font-size:14px}
  .main{padding:20px 14px 105px}
  .panel-pad{padding:17px}
  .mobile-nav button,.mobile-nav button span {font-size:11px;}
  .mobile-nav button span{font-size:19px;}
  .btn,.btn.tiny{font-size:13px;min-height:40px;white-space:normal;}
  .history-control-end .field input,.history-control-end .field select{font-size:14px;}
  .history-date strong{font-size:13px}
  .plan-slot button{font-size:12px}
  .shop-status,.shop-qty{font-size:13px!important;}
}

/* v0.9.0: liquid tracking has its own readable counter, separate from macros. */
.hydration-panel { margin:-2px 0 22px; border-color:#d5e7ea; background:linear-gradient(118deg,#ffffff 70%,#f2fbfd); }
.hydration-icon { display:flex; align-items:center; justify-content:center; width:44px; height:44px; flex-shrink:0; background:#e3f3fa; border-radius:15px; font-size:26px; }
.hydration-main { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.hydration-main strong { display:block; font-size:38px; line-height:1.18; color:#1b655f; font-weight:850; letter-spacing:-1px; }
.hydration-main strong small { font-size:18px; color:#426b70; font-weight:680; letter-spacing:0; }
.hydration-main p { color:#516d72; font-size:14px; margin:5px 0 0; }
.hydration-equivalent { text-align:right; font-size:24px; font-weight:800; color:#327c8b; }
.hydration-equivalent small { display:block; font-size:12px; font-weight:550; color:#537781; }
.hydration-track { height:9px; background:#e1edf1; border-radius:30px; overflow:hidden; margin-top:15px; }
.hydration-track > div { height:100%; background:#4597b3; border-radius:30px; }
.hydration-quick { display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-top:18px; }
.hydration-quick > span { font-size:14px; font-weight:750; margin-right:4px; }
.hydration-quick .btn { font-size:13px; background:#edf7fa; color:#21667d; border-color:#d9e9ee; }
.hydration-note { font-size:12px; line-height:1.6; color:#5d747c; margin:13px 0 0; }
.fluid-chip { background:#e8f6fa; color:#24667a; }
@media (max-width:690px) { .hydration-panel{padding:19px;} .hydration-main strong{font-size:31px;} .hydration-equivalent{font-size:21px;} .hydration-quick{gap:7px;} .hydration-quick .btn{padding:10px 11px;font-size:12px;} }


/* v0.9.1: legible typography, clearer calorie total, consistent controls and contrast */
:root {
  --ink: #182f27;
  --muted: #50645b;
  --green: #257459;
  --green-strong: #185d45;
  --border: #d6e2d9;
  --shadow: 0 5px 19px rgba(26, 60, 44, .065);
  font-size: 16px;
}
body { background: #f5f8f6; color: var(--ink); font-size: 16px; line-height: 1.55; }
.main { max-width: 1480px; padding: 32px 36px 95px; }
h1 { font-size: clamp(28px,2.7vw,38px); letter-spacing: -.85px; line-height: 1.15; }
.subhead { font-size: 14px; line-height: 1.55; }
.eyebrow { color: #21654d; font-size: 11px; letter-spacing: 1.35px; }
.topbar { margin-bottom: 24px; }
.panel, .stat, .food-card, .history-avg-card { border-color: var(--border); box-shadow: var(--shadow); }
.panel-pad { padding: 23px; }
.section-title h2 { font-size: 19px; letter-spacing: -.35px; }
.section-title p { font-size: 13px; line-height: 1.55; }

/* Calorie count: never position the small unit within the number glyphs. */
.hero {
  background: linear-gradient(125deg, #1a6047 0%, #287d5f 100%);
  min-width: 0; min-height: 175px; padding: 21px 22px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero:after { opacity: .36; }
.hero-caption { font-size: 12px; line-height: 1.35; color: #eefaf2; letter-spacing: .75px; font-weight: 800; }
.hero-reading { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; margin: 8px 0 5px; z-index: 1; position: relative; }
.hero-big { display: block; font-size: clamp(38px, 3.2vw, 53px); letter-spacing: -1.75px; line-height: 1.05; margin: 0; font-variant-numeric: tabular-nums; font-weight: 850; }
.hero-unit { display: inline-flex; align-items: center; padding: 5px 10px; margin: 0; color: #fff; background: rgba(255,255,255,.19); border: 1px solid rgba(255,255,255,.38); border-radius: 9px; font-size: 15px; line-height: 1.35; font-weight: 800; letter-spacing: .15px; flex: 0 0 auto; }
.hero-foot { color: #edf8f1; font-size: 13px; line-height: 1.5; margin: 2px 0 13px; position: relative; z-index:1; }
.progress-track { height: 8px; background: rgba(255,255,255,.27); }
.progress-fill { background:#ddf5e2; }
.stat { min-width: 0; gap: 10px; }
.stat-top { font-size: 13px; font-weight: 730; color: #3f5c4e; }
.stat-num { font-size: clamp(27px,2.5vw,33px); font-variant-numeric: tabular-nums; margin-top: 11px; overflow-wrap: anywhere; }
.stat-unit { font-size: 14px; font-weight: 700; color: #4a6558; margin-left: 6px; }
.stat-target { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 7px 0 10px; }
.stat-track { height: 6px; }

/* Consistent readable microcopy and more comfortable click targets. */
.nav-button { font-size: 15px; font-weight: 700; min-height: 48px; color: #486356; }
.nav-button.active { background: #e1f2e7; color: #185d45; box-shadow: inset 3px 0 0 #287c5f; }
.side-section { font-size: 11px; color: #62796b; }
.btn { min-height: 44px; font-size: 14px; font-weight: 750; }
.btn.tiny { min-height: 39px; font-size: 13px; }
.icon-btn { width: 37px; height: 37px; }
.input,.select,textarea { min-height: 44px; font-size: 15px; color: var(--ink); }
.input::placeholder,textarea::placeholder { color: #657b6e; opacity: 1; }
.field label { font-size: 13px; color:#3d5b4c; }
.notice,.settings-copy,.library-info,.plan-explain { font-size: 14px; line-height: 1.6; }
.nutrition-table { font-size: 14px; }
.nutrition-table td { padding: 12px 3px; }
.nutrition-table td:nth-child(3) { font-size: 12px; }
.nutrition-table td:first-child { color: #294b3a; }
.nutrition-table td:nth-child(2) { color: #173e2d; }
.log-name, .quick-name { font-size: 15px; }
.log-note,.quick-detail,.recipe-head p { font-size: 13px; line-height: 1.5; }
.log-value { font-size: 14px; font-variant-numeric: tabular-nums; }
.log-value span,.meal-heading,.ai-heading small,.ai-item p { font-size: 12px; }
.quick-row { min-height: 69px; }
.food-card { padding: 19px; gap: 12px; }
.food-card h3 { font-size: 16px; }
.food-card p { font-size: 13px; }
.metric-chip { font-size: 12px; color: #486251; background: #f0f6f1; }
.metric-chip b { font-size: 13px; }
.pill,.food-warning,.recipe-chips span { font-size: 12px; line-height: 1.4; }
.recipe-ingredient { background: #f7fbf8; }
.recipe-part-heading,.recipe-metrics strong,.recipe-item-cal { font-size: 14px; }
.recipe-index { font-size: 13px; width: 29px; height: 29px; }
.recipe-metrics span,.recipe-item-cal span,.recipe-big small { font-size: 12px; }
.recipe-metrics strong { white-space: normal; overflow-wrap: anywhere; }
.recipe-big { font-variant-numeric: tabular-nums; }
.ai-panel { background: linear-gradient(155deg,#edf7f0,#f7faf7); }
.ai-heading strong { font-size: 15px; }
.ai-heading small { color: #4c6758; }
.ai-item strong,.ai-details summary { font-size: 13px; }
.ai-footnote,.hydration-note,.prep-note p { font-size: 13px; line-height: 1.65; color: #51685d; }
.ai-error { font-size: 14px; line-height: 1.5; }
.ai-details .field label { font-size: 12px; }
.ai-details .input { font-size: 14px; }
.history-heading p,.history-avg-card>small { font-size: 13px; }
.history-avg-card > span,.history-avg-card strong small { font-size: 13px; }
.history-avg-card strong { white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.history-nutrient span,.history-date small,.history-day-stat small { font-size: 12px; }
.history-nutrient strong,.history-date strong { font-size: 14px; }
.history-day summary { min-height: 58px; }
.history-control-end .field label, .history-metric-field label { font-size: 13px; }
.history-custom { font-size: 13px; }
.history-chip { font-size: 13px; min-height: 43px; }
.plan-slot strong,.shop-item-info strong { font-size: 14px; }
.plan-slot small,.shop-item-info small,.shop-qty-label { font-size: 12px; }
.shop-status { font-size: 13px; min-height: 42px; }
.hydration-main strong { font-variant-numeric: tabular-nums; }
.hydration-main strong small { font-size: 18px; }
.hydration-note { color: #4d6970; }
.modal .field .hint { font-size: 12px; color: #53695d; }
.modal-head h2 { font-size: 22px; }
.modal-title-note { font-size: 13px; }
.toast { font-size: 14px; line-height: 1.45; }
:focus-visible { outline: 3px solid #126d51; outline-offset: 3px; }

/* Avoid squeezing calorie labels when the window is resized. */
@media (min-width:1251px) {
 .overview { grid-template-columns: minmax(260px,1.45fr) repeat(4,minmax(128px,1fr)); }
}
@media (max-width:1250px) {
 .hero { min-height: 172px; }
 .hero-big { font-size: 48px; }
 .hero-reading { margin: 7px 0; }
 .stat { min-height: 143px; }
 .main { padding: 28px 28px 90px; }
}
@media (max-width:690px) {
 body { font-size: 15px; }
 .main { padding: 22px 15px 115px; }
 .topbar { gap: 13px; }
 .hero { padding: 21px; min-height: 176px; }
 .hero-reading { flex-wrap: nowrap; gap: 13px; }
 .hero-big { font-size: clamp(38px,10.4vw,52px); }
 .hero-unit { font-size: 15px; padding: 6px 11px; }
 .stat { min-height: 143px; padding: 16px 15px; }
 .stat-top { font-size: 13px; }
 .stat-num { font-size: 28px; }
 .stat-target { font-size: 12px; }
 .section-title h2 { font-size: 18px; }
 .panel-pad { padding: 18px; }
 .food-card { padding: 17px; }
 .history-average-grid { gap: 10px; }
 .history-avg-card { padding: 16px 13px; }
 .history-avg-card strong { font-size: 25px; }
 .modal { padding: 18px; }
 .mobile-nav { border-top-color: #bfcfc4; }
 .mobile-nav button { color: #4e6559; min-height: 61px; padding: 9px 2px 8px; font-size: 11px; line-height: 1.15; }
 .mobile-nav button.active { color: #185d45; background: #eff8f1; }
 .mobile-nav button span { font-size: 20px; }
 .hydration-main strong { font-size: 34px; }
}
@media (max-width:375px) {
 .hero-reading { flex-wrap: wrap; }
 .stat-num { font-size: 25px; }
 .stat { padding: 14px 12px; }
 .mobile-nav button { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* v0.9.2 — accessible light and dark color schemes.
   All colors are local user-interface preferences, never nutrition values. */
:root, :root[data-theme="sage"] {
 color-scheme:light;
 --page-bg:#f5f8f6; --panel-bg:#fff; --panel-alt:#f1f7f3; --panel-hover:#e8f3eb;
 --ink:#182f27; --muted:#50645b; --border:#d6e2d9; --border-strong:#bdd0c2;
 --green:#257459; --green-strong:#185d45; --green-soft:#e1f2e7;
 --button-bg:#257459; --button-fg:#fff; --soft-fg:#185d45;
 --hero-from:#1a6047; --hero-to:#287d5f; --hero-light:#eff9f0;
 --focus:#126d51; --chart-grid:#dfe9e2; --chart-text:#547062; --chart-line:#2d7959; --chart-goal:#b27e37;
 --water-bg:#f0faff; --water-ink:#1b655f; --water-chip:#e3f4fa; --water-accent:#28768d;
 --warn-bg:#fff7e9; --warn-ink:#8c5e22; --danger-bg:#fff1ee; --danger-ink:#853b36;
 --panel-shadow:0 5px 19px rgba(26,60,44,.065);
}
:root[data-theme="coastal"] {
 --page-bg:#f2f7fc; --panel-bg:#fff; --panel-alt:#edf5fb; --panel-hover:#e2eef8;
 --ink:#1b3345; --muted:#526a7d; --border:#d1e1ed; --border-strong:#b8d2e2;
 --green:#176a8e; --green-strong:#155676; --green-soft:#dfeef8;
 --button-bg:#176a8e; --button-fg:#fff; --soft-fg:#155676;
 --hero-from:#15516e; --hero-to:#2c82a4; --hero-light:#f1f9fe;
 --focus:#0b5d83; --chart-grid:#d5e5f2; --chart-text:#4b6b80; --chart-line:#2386ab; --chart-goal:#b47739;
 --water-bg:#eff9fc; --water-ink:#175b7b; --water-chip:#dceffa; --water-accent:#287b9c;
 --warn-bg:#fff6e8; --warn-ink:#805319; --danger-bg:#fdf0ed; --danger-ink:#943d37; --panel-shadow:0 5px 19px rgba(20,70,110,.055);
}
:root[data-theme="sand"] {
 --page-bg:#faf7f0; --panel-bg:#fffdfa; --panel-alt:#f8f0e3; --panel-hover:#f5e9d8;
 --ink:#423024; --muted:#6f5c4b; --border:#eadbc9; --border-strong:#d6bda2;
 --green:#9b5832; --green-strong:#86452a; --green-soft:#f7e9d6;
 --button-bg:#95502c; --button-fg:#fff; --soft-fg:#793b23;
 --hero-from:#834526; --hero-to:#b97c4e; --hero-light:#fff8e9;
 --focus:#884224; --chart-grid:#e5d7c7; --chart-text:#7c624b; --chart-line:#a86838; --chart-goal:#8260aa;
 --water-bg:#f1f8f8; --water-ink:#255b68; --water-chip:#e4f0f1; --water-accent:#367e85;
 --warn-bg:#fff0d8; --warn-ink:#754b1d; --danger-bg:#fff0e9; --danger-ink:#8e3c35; --panel-shadow:0 5px 19px rgba(98,58,25,.065);
}
:root[data-theme="lavender"] {
 --page-bg:#f8f6fc; --panel-bg:#fff; --panel-alt:#f3effb; --panel-hover:#ede7fa;
 --ink:#302b46; --muted:#645d7d; --border:#ded7ed; --border-strong:#c8badd;
 --green:#6d53a4; --green-strong:#573c8a; --green-soft:#ede7f8;
 --button-bg:#6d53a4; --button-fg:#fff; --soft-fg:#573c8a;
 --hero-from:#513985; --hero-to:#8667b8; --hero-light:#f9f2ff;
 --focus:#6346a7; --chart-grid:#e4def0; --chart-text:#6c6485; --chart-line:#8062bc; --chart-goal:#b5834a;
 --water-bg:#f1f8fc; --water-ink:#346481; --water-chip:#e3eff8; --water-accent:#4487a0;
 --warn-bg:#fff7e9; --warn-ink:#855a28; --danger-bg:#fff0f1; --danger-ink:#963e4f; --panel-shadow:0 5px 19px rgba(66,42,117,.06);
}
:root[data-theme="midnight"] {
 color-scheme:dark;
 --page-bg:#0a1525; --panel-bg:#142238; --panel-alt:#1c304a; --panel-hover:#27415b;
 --ink:#eef5ff; --muted:#b9cbe0; --border:#374c65; --border-strong:#536d86;
 --green:#7dc1ef; --green-strong:#9edaff; --green-soft:#24415c;
 --button-bg:#347cae; --button-fg:#fff; --soft-fg:#bce8ff;
 --hero-from:#174b72; --hero-to:#226893; --hero-light:#e5f7ff;
 --focus:#a8e1ff; --chart-grid:#3b526a; --chart-text:#b7ccdd; --chart-line:#81d2ff; --chart-goal:#f1bd78;
 --water-bg:#172e45; --water-ink:#aee8f4; --water-chip:#274d62; --water-accent:#a3dafa;
 --warn-bg:#493724; --warn-ink:#ffe1aa; --danger-bg:#4b282d; --danger-ink:#ffc5c8; --panel-shadow:0 10px 32px rgba(0,0,0,.23);
}
:root[data-theme="graphite"] {
 color-scheme:dark;
 --page-bg:#15191b; --panel-bg:#23292d; --panel-alt:#2d3538; --panel-hover:#384348;
 --ink:#eff5f4; --muted:#bfcdca; --border:#404d50; --border-strong:#607174;
 --green:#7bdacb; --green-strong:#a1eee2; --green-soft:#294944;
 --button-bg:#278f81; --button-fg:#fff; --soft-fg:#a9efe2;
 --hero-from:#235e56; --hero-to:#2d8175; --hero-light:#f0fff8;
 --focus:#a3f8e8; --chart-grid:#465357; --chart-text:#bbceca; --chart-line:#81ddcd; --chart-goal:#f0b966;
 --water-bg:#24383e; --water-ink:#b0e1eb; --water-chip:#355059; --water-accent:#9dd5e6;
 --warn-bg:#493a26; --warn-ink:#ffdfa5; --danger-bg:#4b3031; --danger-ink:#ffd0cf; --panel-shadow:0 10px 30px rgba(0,0,0,.2);
}
:root[data-theme="evergreen"] {
 color-scheme:dark;
 --page-bg:#0c1914; --panel-bg:#162820; --panel-alt:#1d352b; --panel-hover:#284537;
 --ink:#ecf9ef; --muted:#b4d0bf; --border:#365847; --border-strong:#537964;
 --green:#92deb1; --green-strong:#b7f4ce; --green-soft:#294b38;
 --button-bg:#2f8760; --button-fg:#fff; --soft-fg:#bef9d4;
 --hero-from:#236343; --hero-to:#34845b; --hero-light:#edfff4;
 --focus:#b4f5cf; --chart-grid:#3a5b49; --chart-text:#bad7c4; --chart-line:#9defbc; --chart-goal:#f7be83;
 --water-bg:#1a3738; --water-ink:#b8ece6; --water-chip:#245154; --water-accent:#a4e0e6;
 --warn-bg:#443921; --warn-ink:#ffdfab; --danger-bg:#4d2c2e; --danger-ink:#ffc7c7; --panel-shadow:0 10px 30px rgba(0,0,0,.22);
}
:root[data-theme="aubergine"] {
 color-scheme:dark;
 --page-bg:#171321; --panel-bg:#271f33; --panel-alt:#342942; --panel-hover:#453451;
 --ink:#faf3ff; --muted:#d1c2df; --border:#50405f; --border-strong:#715b83;
 --green:#d3adff; --green-strong:#e2caff; --green-soft:#493559;
 --button-bg:#8258ab; --button-fg:#fff; --soft-fg:#f0d8ff;
 --hero-from:#5a327b; --hero-to:#8355a4; --hero-light:#fdf1ff;
 --focus:#ebc6ff; --chart-grid:#594967; --chart-text:#d2c2dc; --chart-line:#d1a8fa; --chart-goal:#f6ca7c;
 --water-bg:#2b2e45; --water-ink:#c4d9ff; --water-chip:#3c4260; --water-accent:#bed7ff;
 --warn-bg:#48342b; --warn-ink:#fbdcaa; --danger-bg:#4e2b39; --danger-ink:#ffc6d6; --panel-shadow:0 10px 30px rgba(0,0,0,.24);
}
/* Themed components; direct overrides remove original light-only literals. */
body {background:var(--page-bg);color:var(--ink)}
.sidebar,.mobile-nav,.mobile-nav button,.panel,.stat,.food-card,.history-avg-card,.history-nutrient,.recipe-metrics>div {background:var(--panel-bg);color:var(--ink);border-color:var(--border);box-shadow:var(--panel-shadow)}
.sidebar {box-shadow:none}
.panel,.stat,.food-card {border-color:var(--border)}
.brand span span,.eyebrow,.side-section,.empty strong,.history-heading h2,.section-title h2,.nav-button.active,.history-day-stat,.nutrition-table td:first-child,.nutrition-table td:nth-child(2) {color:var(--ink)}
.brand span span,.eyebrow {color:var(--green-strong)}
.subhead,.section-title p,.settings-copy,.library-count,.quick-detail,.log-note,.modal-title-note,.ai-footnote,.hint,.field label,.pill,.food-card p,.history-heading p {color:var(--muted)}
a {color:var(--green-strong)}
.nav-button {color:var(--muted)}
.nav-button:hover,.nav-button.active,.mobile-nav button.active,.meal-heading,.history-day summary:hover,.history-day[open] summary,.empty-illustration,.sidebar-bottom,.sidebar-bottom .mini-icon {background:var(--panel-alt);color:var(--green-strong)}
.nav-button.active {box-shadow:inset 3px 0 0 var(--green)}
.side-section {color:var(--muted)}
.sidebar-bottom {border-color:var(--border)}
.sidebar-bottom p,.sidebar-bottom strong {color:var(--muted)}
.date-picker,.input,.select,textarea,.goal-grid .field input,.history-custom,.history-chip,.btn.white,.history-avg-card,.recipe-metrics>div,.recipe-chips span,.recipe-part-grid input {background:var(--panel-bg);color:var(--ink);border-color:var(--border)}
input,button,select,textarea {accent-color:var(--green)}
.input::placeholder,textarea::placeholder {color:var(--muted)}
.input:focus,.select:focus,textarea:focus {border-color:var(--green);box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 30%,transparent)}
:focus-visible {outline-color:var(--focus)}
.icon-btn,.btn.light,.btn.text:hover,.ghost-icon:hover,.ai-spark,.status-pill.on,.recipe-index,.mobile-nav button.active,.history-chip:hover {background:var(--green-soft);color:var(--soft-fg);border-color:var(--border)}
.logo,.btn:not(.white):not(.light):not(.danger):not(.text),.history-chip.active {background:var(--button-bg);color:var(--button-fg);border-color:var(--button-bg)}
.btn:not(.white):not(.light):not(.danger):not(.text):hover {background:var(--green-strong);color:var(--page-bg)}
.btn.white:hover,.btn.light:hover {background:var(--panel-hover)}
.btn.danger {background:var(--danger-bg);color:var(--danger-ink)}
.btn.text {background:transparent;color:var(--green-strong)}
.date-picker input,.ghost-icon,.history-day-stat,.metric-chip b {color:var(--ink)}
.meal-heading span:last-child,.log-value span,.stat-unit,.stat-target,.stat-top,.log-note,.quick-detail,.food-card p,.pill,.history-date small,.history-day-stat small,.history-custom,.history-avg-card>span,.history-avg-card strong small,.history-avg-card>small {color:var(--muted)}
.stat-track,.history-day-list,.history-day,.quick-row,.log-item,.nutrition-table td,.plan-slot,.shop-item,.prep-note {border-color:var(--border)}
.stat-track {background:var(--panel-alt)}
.stat-top,.stat-unit {color:var(--muted)}
.hero,.history-avg-card.featured {background:linear-gradient(125deg,var(--hero-from),var(--hero-to));color:#fff;border-color:transparent}
.hero-caption,.hero-foot,.hero-unit,.history-avg-card.featured>span,.history-avg-card.featured>small,.history-avg-card.featured strong small {color:#f2fbff}
.hero-unit {background:#ffffff24;border-color:#ffffff66}
.history-avg-card.featured strong {color:#fff}
.nutrition-table td:first-child,.nutrition-table td:nth-child(2) {color:var(--ink)}
.ai-panel,.ai-details,.recipe-ingredient,.recipe-totals,.history-detail,.history-custom,.metric-chip,.pill,.recipe-chips span,.library-info,.notice,.plan-day-top,.history-nutrient,.history-chart-empty {background:var(--panel-alt);color:var(--ink);border-color:var(--border)}
.ai-panel {background:linear-gradient(145deg,var(--panel-alt),var(--panel-bg))}
.ai-item,.history-avg-card,.recipe-metrics>div {background:var(--panel-bg);color:var(--ink);border-color:var(--border)}
.ai-spark,.ai-heading small,.recipe-index,.recipe-item-cal,.recipe-metrics strong,.history-nutrient strong,.plan-day-top strong,.ai-details summary,.ai-meal-group h3,.history-day-stat {color:var(--green-strong)}
.recipe-big small,.recipe-item-cal span,.recipe-chips span,.plan-day-top span,.shop-qty-label {color:var(--muted)}
.recipe-ingredient,.recipe-totals,.recipe-chips span {border-color:var(--border)}
.recipe-metrics span,.recipe-head p {color:var(--muted)}
.food-warning,.pill.estimate,.notice.warning {background:var(--warn-bg);color:var(--warn-ink);border-color:var(--border)}
.ai-error {background:var(--danger-bg);color:var(--danger-ink);border-color:var(--border-strong)}
.plan-day-top {border-color:var(--border)}
.plan-slot-label,.shop-group h3,.plan-slot small,.prep-note p {color:var(--muted)}
.history-chip.active {color:#fff}
.history-custom input {background:var(--panel-bg);color:var(--ink)}
.history-avg-card.featured>span,.history-avg-card.featured>small,.history-avg-card.featured strong small {color:#eef8ff}
.history-day summary:hover,.history-day[open] summary,.history-detail,.history-chart-empty {background:var(--panel-alt)}
.history-day-stat.missing {color:var(--muted)}
.modal {background:var(--panel-bg);color:var(--ink);border-color:var(--border-strong)}
.modal::backdrop {background:rgba(0,0,0,.64)}
.hydration-panel {background:linear-gradient(118deg,var(--panel-bg) 70%,var(--water-bg));border-color:var(--border)}
.hydration-icon,.fluid-chip {background:var(--water-chip);color:var(--water-accent)}
.hydration-main strong,.hydration-main strong small,.hydration-equivalent,.hydration-equivalent small {color:var(--water-ink)}
.hydration-main p,.hydration-note {color:var(--muted)}
.hydration-track {background:var(--panel-alt)}
.hydration-track>div {background:var(--water-accent)}
.hydration-quick .btn {background:var(--water-chip);color:var(--water-ink);border-color:var(--border)}
.macrotracker-exit {background:var(--panel-bg);color:var(--green-strong);border-color:var(--border-strong)}
.macrotracker-exit:hover {background:var(--panel-hover)}
.mobile-nav {border-color:var(--border)}
.mobile-nav button {box-shadow:none;color:var(--muted)}
.mobile-nav button.active {color:var(--green-strong)}
/* Controls with inline default system colors must remain legible in dark mode. */
:root[data-theme="midnight"] input[type="date"],:root[data-theme="graphite"] input[type="date"],:root[data-theme="evergreen"] input[type="date"],:root[data-theme="aubergine"] input[type="date"] {color-scheme:dark}
/* Visual theme selection cards */
.theme-section {margin-bottom:20px}
.theme-section .section-title {flex-wrap:wrap;margin-bottom:20px}
.theme-saved-note {font-size:12px;font-weight:700;color:var(--muted)}
.theme-group-label {font-size:12px;font-weight:800;letter-spacing:1.2px;color:var(--muted);margin:2px 0 11px}
.theme-group-full {grid-column:1/-1;margin:14px 0 0}
.theme-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.theme-choice {position:relative;display:block;cursor:pointer;min-width:0}
.theme-radio {position:absolute;opacity:0;width:1px;height:1px;left:20px;top:20px}
.theme-choice-body {display:block;padding:8px;border:2px solid var(--border);border-radius:15px;background:var(--panel-bg);height:100%;transition:border-color .14s,transform .14s}
.theme-choice:hover .theme-choice-body {border-color:var(--border-strong);transform:translateY(-1px)}
.theme-radio:checked+.theme-choice-body {border-color:var(--green);box-shadow:0 0 0 1px var(--green)}
.theme-radio:focus-visible+.theme-choice-body {outline:3px solid var(--focus);outline-offset:3px}
.theme-preview {--p-bg:#f5f8f6;--p-nav:#e8f2eb;--p-panel:#fff;--p-accent:#257459;--p-text:#182f27;display:flex;width:100%;height:77px;border-radius:9px;background:var(--p-bg);border:1px solid color-mix(in srgb,var(--p-text) 14%,transparent);overflow:hidden}
.theme-preview-nav {width:26%;background:var(--p-nav);border-right:1px solid color-mix(in srgb,var(--p-text) 12%,transparent)}
.theme-preview-content {flex:1;display:flex;flex-direction:column;gap:9px;padding:12px}
.theme-preview-heading {height:10px;width:75%;max-width:120px;border-radius:4px;background:var(--p-accent)}
.theme-preview-chips {display:flex;gap:5px;min-height:30px}
.theme-preview-chips span {display:block;flex:1;border-radius:5px;background:var(--p-panel);border:1px solid color-mix(in srgb,var(--p-text) 13%,transparent)}
.theme-preview-chips span:first-child {background:var(--p-accent);opacity:.8}
.theme-choice-info {display:flex;flex-direction:column;gap:3px;padding:11px 6px 5px;max-width:calc(100% - 6px)}
.theme-choice-info strong {font-size:15px;color:var(--ink);font-weight:800;line-height:1.25}
.theme-choice-info>span {font-size:12px;color:var(--muted);line-height:1.4}
.theme-check {display:none;position:absolute;right:15px;bottom:15px;color:var(--green-strong);font-weight:900}
.theme-radio:checked+.theme-choice-body .theme-check {display:block}
.theme-help {font-size:13px;line-height:1.5;color:var(--muted);margin:18px 0 0}
[data-preview-theme="coastal"] .theme-preview {--p-bg:#f1f7fc;--p-nav:#e2eef8;--p-panel:#fff;--p-accent:#176a8e;--p-text:#1b3345}
[data-preview-theme="sand"] .theme-preview {--p-bg:#faf7f0;--p-nav:#f5e9d8;--p-panel:#fffdfa;--p-accent:#9b5832;--p-text:#423024}
[data-preview-theme="lavender"] .theme-preview {--p-bg:#f8f6fc;--p-nav:#ede7fa;--p-panel:#fff;--p-accent:#6d53a4;--p-text:#302b46}
[data-preview-theme="midnight"] .theme-preview {--p-bg:#0a1525;--p-nav:#142238;--p-panel:#21334c;--p-accent:#347cae;--p-text:#eef5ff}
[data-preview-theme="graphite"] .theme-preview {--p-bg:#15191b;--p-nav:#23292d;--p-panel:#384348;--p-accent:#278f81;--p-text:#eff5f4}
[data-preview-theme="evergreen"] .theme-preview {--p-bg:#0c1914;--p-nav:#162820;--p-panel:#284537;--p-accent:#2f8760;--p-text:#ecf9ef}
[data-preview-theme="aubergine"] .theme-preview {--p-bg:#171321;--p-nav:#271f33;--p-panel:#453451;--p-accent:#8258ab;--p-text:#faf3ff}
@media(max-width:1050px){.theme-grid {grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:430px){.theme-grid{gap:9px}.theme-choice-body{padding:6px}.theme-preview{height:64px}.theme-choice-info strong{font-size:14px}.theme-choice-info>span{font-size:11px}}
@media(prefers-reduced-motion:reduce){.theme-choice-body{transition:none}}
/* Small components that must not keep a bright surface in dark palettes. */
.week-bar-wrap {background:var(--panel-alt);border:1px solid var(--border)}
.week-bar {background:linear-gradient(var(--green),var(--button-bg))}
.week-day.selected .week-bar {background:linear-gradient(var(--green-strong),var(--button-bg))}
.week-label,.week-day.selected .week-label {color:var(--muted)}
.status-pill {background:var(--panel-alt);color:var(--muted);border:1px solid var(--border)}
.status-pill.on {background:var(--green-soft);color:var(--green-strong)}
.log-item:last-child,.quick-row:last-child {border-bottom:0}
.history-day.missing .history-day-stat,.history-day-stat small {color:var(--muted)}

/* v0.9.3: fluid-ounce-first logging */
.fluid-entry-field {display:flex;align-items:center;gap:10px}
.fluid-entry-field .input {width:100%;min-width:0}
.fluid-entry-field span {white-space:nowrap;color:var(--ink);font-size:14px;font-weight:750}
.field-hint {font-size:12px;line-height:1.45;color:var(--muted);margin:6px 0 0}
.hydration-quick .water-custom-form {display:inline-flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:4px}
.water-custom-form label {font-weight:700;color:var(--ink);font-size:13px}
.water-custom-form .input {width:80px;min-height:36px;flex:none}
.water-custom-form span {font-size:13px;color:var(--ink);font-weight:700}
/* v0.9.5 Claude controls: readable on both dark and light palettes. */
.ai-meal-choice {display:flex;align-items:center;gap:10px;margin:9px 0;font-size:13px;font-weight:700;color:var(--ink)}
.ai-library-opt {display:flex;gap:10px;align-items:flex-start;font-size:13px;font-weight:600;margin:16px 0;color:var(--ink);line-height:1.5}
.ai-library-opt input {min-width:17px;min-height:17px;margin:2px 0 0}

/* v0.9.6 app-owned dialogs: always centered in the viewport, not at the browser title bar. */
.action-dialog {
  position:fixed; inset:0; margin:auto; padding:0;
  width:min(460px,calc(100vw - 28px));
  max-height:calc(100dvh - 36px); overflow:auto;
  background:var(--panel-bg); color:var(--ink); border:1px solid var(--border-strong);
  border-radius:20px; box-shadow:0 24px 80px rgba(0,0,0,.30);
}
.action-dialog::backdrop {background:rgba(9,19,20,.62); backdrop-filter:blur(3px)}
.action-dialog-inner {padding:27px; display:grid;grid-template-columns:46px minmax(0,1fr);column-gap:16px; row-gap:14px}
.action-dialog-icon {grid-row:1/span 2; width:46px;height:46px;display:grid;place-items:center;
  font-size:23px;font-weight:900;border-radius:14px;
  background:var(--danger-bg);color:var(--danger-ink)}
.action-dialog-inner.normal .action-dialog-icon {background:var(--green-soft);color:var(--green-strong)}
.action-dialog-copy {min-width:0;grid-column:2}
.action-dialog h2 {font-size:21px;line-height:1.23;letter-spacing:-.4px;margin:2px 0 9px;color:var(--ink)}
.action-dialog p {font-size:15px;line-height:1.56;color:var(--muted);margin:0;overflow-wrap:anywhere}
.action-dialog-field {grid-column:1/-1;margin-top:3px}
.action-dialog-field label {font-size:13px;color:var(--ink)}
.action-dialog .action-dialog-actions {grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;
  flex-wrap:wrap;margin-top:8px;padding-top:16px;border-top:1px solid var(--border)}
.action-dialog-actions .btn {min-height:44px;padding:11px 18px;font-size:14px}
.action-dialog-actions .btn.danger {background:var(--danger-bg);color:var(--danger-ink);border:1px solid var(--border-strong)}
.action-dialog-actions .btn.danger:hover {filter:brightness(.94)}
/* QA: dialog close controls are comfortable to click or tap and visible in every theme. */
.modal-head .ghost-icon {min-width:40px;min-height:40px;color:var(--ink);font-size:18px}
.modal-head {align-items:flex-start}
.modal, .action-dialog {scrollbar-color:var(--border-strong) transparent;overscroll-behavior:contain}
.modal .field label {font-size:13px;line-height:1.4;color:var(--ink)}
.form-actions .btn,.food-card-actions .btn {min-height:38px}
.settings-stack,.panel-pad,.food-card,.history-heading,.recipe-ingredient {min-width:0}
.inline-actions {flex-wrap:wrap}
.ai-meal-choice,.ai-library-opt {color:var(--ink)}
@media (max-width:690px) {
  .action-dialog {width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
  .action-dialog-inner {padding:19px;grid-template-columns:38px minmax(0,1fr);column-gap:12px}
  .action-dialog-icon {width:38px;height:38px;font-size:20px;border-radius:11px}
  .action-dialog h2 {font-size:19px}
  .action-dialog p {font-size:14px}
  .action-dialog-actions .btn {flex:1;min-width:120px}
  .modal {max-height:calc(100dvh - 24px)}
  .modal .form-actions .btn {white-space:normal;min-height:42px}
}
@media (prefers-reduced-motion:reduce) {
 .action-dialog,.action-dialog * {scroll-behavior:auto;transition:none}
}

/* v0.9.7 spreadsheet history import: readable in light/dark themes and small windows. */
.history-import-panel{margin-bottom:20px}
.history-import-panel .section-title{flex-wrap:wrap}
.history-import-modal{width:min(700px,calc(100vw - 26px));max-height:calc(100dvh - 28px);overflow:auto;padding:26px;color:var(--ink);background:var(--panel-bg,var(--paper));border:1px solid var(--border-strong,var(--border));border-radius:20px}
.history-import-modal::backdrop{background:rgba(8,18,24,.67);backdrop-filter:blur(3px)}
.history-import-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}
.history-import-stats>div{padding:13px;border:1px solid var(--border);border-radius:12px;background:var(--panel-alt);min-width:0}
.history-import-stats strong{display:block;font-size:25px;font-weight:850;color:var(--ink);line-height:1.2}
.history-import-stats span{display:block;font-size:12px;color:var(--muted);line-height:1.4;margin-top:3px}
.history-import-dates{font-size:13px;line-height:1.5;color:var(--muted)}
.history-import-checkbox{display:flex;gap:10px;align-items:center;font-size:14px;line-height:1.5;font-weight:700;padding:14px 0;color:var(--ink)}
.history-import-checkbox input{width:19px;height:19px;accent-color:var(--green);flex-shrink:0}
.history-import-subtitle{font-size:15px;margin:18px 0 10px;color:var(--ink)}
.history-import-samples{border:1px solid var(--border);border-radius:12px;max-height:220px;overflow:auto}
.history-import-samples>div{padding:10px 12px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:13px;border-bottom:1px solid var(--border)}
.history-import-samples>div:last-child{border-bottom:0}
.history-import-samples span{overflow-wrap:anywhere;color:var(--ink)}
.history-import-samples strong{color:var(--muted);font-size:12px;font-weight:700}
.history-import-small{font-size:12px;line-height:1.65;color:var(--muted);margin:15px 0}
@media(max-width:650px){.history-import-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.history-import-modal{padding:17px}}

/* v0.9.8 - aligned layouts, intentionally composed Claude form */
.main {max-width:1480px;}
.dashboard-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.dashboard-grid>.stack {min-width:0}
.panel-pad {height:auto}
.ai-panel {margin:0 0 20px;padding:24px;background:var(--panel-bg);border:1px solid var(--border);box-shadow:var(--shadow);}
.ai-section-header {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:19px;}
.ai-heading {margin:0;align-items:center;min-width:0;}
.ai-spark {width:46px;height:46px;flex:0 0 46px;border-radius:14px;font-size:23px;}
.ai-heading h2 {font-size:21px;line-height:1.2;letter-spacing:-.45px;margin:0 0 5px;color:var(--ink)}
.ai-heading p {font-size:14px;margin:0;line-height:1.5;color:var(--muted);}
.ai-compose {display:grid;grid-template-columns:minmax(0,1.65fr) minmax(230px,1fr);gap:18px 22px;align-items:stretch}
.ai-compose-main {min-width:0;display:flex;flex-direction:column;gap:8px}
.ai-compose-main label {font-size:14px;font-weight:800;color:var(--ink);}
.ai-compose textarea {height:178px;min-height:178px;resize:vertical;width:100%;border:1px solid var(--border-strong,var(--border));border-radius:13px;background:var(--panel-bg);color:var(--ink);padding:15px 16px;font-size:15px;line-height:1.6;}
.ai-compose textarea::placeholder {color:var(--muted);opacity:.86;}
.ai-prompt-hint {margin:0;color:var(--muted);font-size:13px;line-height:1.5;}
.ai-compose-guide {padding:18px;border:1px solid var(--border);background:var(--panel-alt);border-radius:14px;min-width:0;}
.ai-compose-guide strong {display:block;font-size:14px;color:var(--ink);margin-bottom:13px;}
.ai-compose-guide p {margin:0 0 12px;font-size:13px;line-height:1.4;color:var(--ink);}
.ai-compose-guide span {display:block;margin-top:14px;border-top:1px solid var(--border);padding-top:12px;color:var(--muted);font-size:12px;line-height:1.5;}
.ai-compose-actions {grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:16px;border-top:1px solid var(--border);flex-wrap:wrap;}
.ai-compose-actions p {margin:0;color:var(--muted);font-size:13px;line-height:1.5;flex:1 1 270px;}
.ai-action-buttons {display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end;}
.ai-submit {min-width:204px;min-height:46px;font-size:14px!important;white-space:normal!important;}
.ai-panel .ai-error {margin-top:16px;}
.ai-panel .ai-meal-group {border:1px solid var(--border);border-radius:14px;padding:14px;margin:12px 0;}
.ai-panel .ai-item {background:var(--panel-bg);border-color:var(--border)}
.ai-panel .ai-item-top {flex-wrap:wrap;}
.ai-panel .ai-item strong {font-size:14px;line-height:1.45;}
.ai-panel .ai-results-header {border-color:var(--border)}
.update-panel {margin-bottom:18px;}
.update-status {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px;}
.update-status>div {background:var(--panel-alt);border:1px solid var(--border);padding:12px 14px;border-radius:11px;display:flex;flex-direction:column;gap:5px;min-width:0;}
.update-status span {font-size:12px;color:var(--muted);}
.update-status strong {font-size:17px;color:var(--ink);font-variant-numeric:tabular-nums;}
.settings-grid>.settings-stack {min-width:0;}
.library-header>.inline-actions {gap:8px;justify-content:flex-end;}
@media (max-width:1100px) {.ai-compose {grid-template-columns:minmax(0,1fr)}.ai-compose-guide {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 13px;}.ai-compose-guide strong,.ai-compose-guide span {grid-column:1/-1;margin:0}.ai-compose-guide p{margin:0;}}
@media (max-width:980px) {.dashboard-grid {grid-template-columns:minmax(0,1fr)}.ai-panel {padding:20px}}
@media (max-width:690px) {.ai-panel {padding:17px;margin-bottom:14px}.ai-compose{gap:13px}.ai-heading h2{font-size:19px}.ai-section-header{margin-bottom:14px}.ai-compose-guide{grid-template-columns:minmax(0,1fr);gap:8px;padding:13px}.ai-compose textarea{height:168px;min-height:168px;font-size:14px}.ai-compose-actions{align-items:stretch}.ai-action-buttons{width:100%;justify-content:stretch}.ai-action-buttons .btn{flex:1}.ai-submit{min-width:0;width:100%}.update-status{gap:8px}.update-status>div{padding:10px}}
@media (max-width:690px) {
  .ai-action-buttons { flex-direction:column;align-items:stretch; }
  .ai-action-buttons>.btn {width:100%;flex:none;min-height:46px;}
}


/* v0.9.9 Today page layout: matched card rows, centered content, Claude last. */
.balanced-dashboard {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-areas:
    "diary meals"
    "breakdown quick"
    "week week";
  gap:18px;
  align-items:stretch;
  margin-bottom:20px;
}
.balanced-slot {min-width:0; display:flex; flex-direction:column;}
.balanced-slot>.panel {height:100%;width:100%;min-width:0;}
.slot-diary {grid-area:diary;}
.slot-meals {grid-area:meals;}
.slot-breakdown {grid-area:breakdown;}
.slot-quick {grid-area:quick;}
.slot-week {grid-area:week;}
.slot-week .week-chart {justify-content:space-evenly; max-width:940px; width:100%; margin:2px auto 0;}
.balanced-dashboard + .ai-panel {margin:0 0 20px;}
@media (max-width:980px) {
  .balanced-dashboard {grid-template-columns:minmax(0,1fr); grid-template-areas:"diary" "meals" "quick" "breakdown" "week";}
  .balanced-slot>.panel {height:auto;}
}
@media (max-width:690px) {
  .balanced-dashboard {gap:14px; margin-bottom:14px;}
  .balanced-dashboard + .ai-panel {margin:0 0 14px;}
}

/* v0.9.10 — polished, responsive and theme-aware Nutrition trend */
.history-chart-panel {padding:26px 28px 22px; overflow:hidden;}
.history-chart-panel .section-title {gap:18px;align-items:end;margin-bottom:20px;}
.history-chart-panel .section-title h2 {font-size:22px;letter-spacing:-.55px;}
.history-chart-panel .section-title p {font-size:13px;line-height:1.55;max-width:600px;}
.history-metric-field {min-width:210px;max-width:270px;}
.history-metric-field label {font-size:12px;color:var(--muted);letter-spacing:.1px;}
.history-metric-field .select {font-size:14px;min-height:43px;border:1px solid var(--border-strong);width:100%;}
.trend-dashboard {min-width:0;}
.trend-insights {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:0 0 16px;}
.trend-stat {display:flex;flex-direction:column;justify-content:center;min-width:0;padding:16px 18px;border-radius:14px;border:1px solid var(--border);background:var(--panel-alt);gap:5px;}
.trend-stat:first-child {background:var(--water-bg);border-color:var(--border);}
.trend-stat>span {font-size:12px;font-weight:750;color:var(--muted);}
.trend-stat strong {font-size:24px;font-weight:850;letter-spacing:-.8px;line-height:1.15;overflow-wrap:anywhere;color:var(--ink);font-variant-numeric:tabular-nums;}
.trend-stat:first-child strong {color:var(--green-strong);}
.trend-stat small {color:var(--muted);font-size:11.5px;line-height:1.35;overflow-wrap:anywhere;}
.trend-surface {border:1px solid var(--border);background:var(--panel-alt);border-radius:16px;padding:15px 15px 14px;min-width:0;}
.trend-plot {position:relative;min-width:0;}
.history-chart {display:block;width:100%;height:auto;min-height:0;max-height:none;overflow:visible;}
.trend-grid-line {stroke:var(--chart-grid);stroke-width:1;stroke-dasharray:3 6;}
.trend-axis-label {font:600 12px system-ui,-apple-system,Segoe UI,sans-serif;fill:var(--chart-text);font-variant-numeric:tabular-nums;}
.trend-date-label {font-weight:700;}
.trend-area {fill:var(--chart-line);fill-opacity:.11;stroke:none;}
.trend-line {stroke:var(--chart-line);stroke-width:3.7;stroke-linejoin:round;stroke-linecap:round;fill:none;}
.trend-goal-line {stroke:var(--chart-goal);stroke-width:2;stroke-dasharray:7 6;}
.trend-goal-label {font:750 11px system-ui,-apple-system,Segoe UI,sans-serif;fill:var(--chart-goal);paint-order:stroke;stroke:var(--panel-alt);stroke-width:3px;stroke-linejoin:round;}
.trend-interactive {cursor:help;outline:none;}
.trend-target {fill:transparent;stroke:none;}
.trend-marker {fill:var(--chart-line);stroke:var(--panel-alt);stroke-width:2.6;transform-box:fill-box;transform-origin:center;transition:r .16s ease,stroke-width .16s ease;}
.trend-unlogged .trend-marker {fill:var(--panel-alt);stroke:var(--chart-text);stroke-width:2;stroke-dasharray:2 2;}
.trend-interactive:hover .trend-marker,.trend-interactive:focus-visible .trend-marker,.trend-interactive.is-active .trend-marker {stroke-width:3.5;r:8;}
.trend-interactive:focus-visible .trend-target {stroke:var(--focus);stroke-width:2;}
.trend-tooltip {position:absolute;transform:translate(-50%,-105%);pointer-events:none;z-index:4;max-width:230px;width:max-content;min-width:145px;background:var(--ink);color:var(--panel-bg);padding:10px 13px;border-radius:11px;box-shadow:0 10px 28px rgba(0,0,0,.19);font-size:12px;line-height:1.4;white-space:normal;text-align:left;}
.trend-tooltip[hidden] {display:none;}
.trend-tooltip strong {display:block;font-size:16px;font-weight:850;letter-spacing:-.2px;color:inherit;}
.trend-tooltip span {display:block;margin-top:3px;color:inherit;opacity:.84;}
.trend-tooltip::after {content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--ink);}
.trend-key {display:flex;gap:16px;flex-wrap:wrap;align-items:center;justify-content:center;margin:9px 0 0;color:var(--muted);font-size:12px;font-weight:700;}
.trend-key span {display:inline-flex;align-items:center;gap:8px;white-space:nowrap;}
.trend-key i {display:inline-block;width:24px;height:0;border-top:3px solid var(--chart-line);border-radius:3px;}
.trend-key .trend-legend-goal {border-color:var(--chart-goal);border-top-style:dashed;}
.trend-key .trend-legend-missing {width:10px;height:10px;border:2px dashed var(--chart-text);border-radius:50%;}
.trend-explainer {font-size:12px;line-height:1.6;color:var(--muted);margin:12px 2px 0;}
.history-chart-empty {display:flex;flex-direction:column;align-items:center;gap:7px;background:var(--panel-alt);color:var(--ink);border:1px dashed var(--border);border-radius:14px;padding:48px 16px;text-align:center;font-size:14px;}
.history-chart-empty strong {font-size:16px;color:var(--ink);}
.history-chart-empty span {color:var(--muted);}
@media(max-width:800px) {
  .history-chart-panel {padding:19px 18px 18px;}
  .history-chart-panel .section-title {align-items:flex-start;}
  .trend-stat {padding:13px 14px;}
  .trend-stat strong {font-size:21px;}
  .trend-surface {padding:10px 6px 13px;}
}
@media(max-width:690px) {
  .history-chart-panel {padding:16px 13px;}
  .history-chart-panel .section-title {gap:10px;margin-bottom:14px;}
  .history-chart-panel .section-title h2 {font-size:20px;}
  .history-chart-panel .section-title p {font-size:12px;}
  .history-metric-field {min-width:0;max-width:none;width:100%;}
  .trend-insights {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px;}
  .trend-stat {padding:12px;}
  .trend-stat:first-child {grid-column:1 / -1;}
  .trend-stat strong {font-size:20px;}
  .trend-stat:first-child strong {font-size:24px;}
  .trend-stat>span {font-size:11px;}
  .trend-stat small {font-size:10.5px;}
  .trend-key {font-size:11px;gap:10px 12px;justify-content:flex-start;margin:8px 5px 0;}
  .trend-key i {width:17px;}
  .trend-tooltip {padding:8px 10px;max-width:190px;min-width:128px;}
  .trend-tooltip strong {font-size:14px;}
  .trend-explainer {font-size:11px;margin-top:9px;}
}
@media(prefers-reduced-motion:reduce) {.trend-marker {transition:none;}}

/* v0.9.11 ingredient search: visible matches, including in dark themes. */
.recipe-food-picker { min-width:0; }
.recipe-food-picker > label {display:block; margin-bottom:8px;}
.recipe-current-food {display:flex; flex-wrap:wrap; align-items:baseline; gap:7px 10px; padding:11px 13px; margin-top:9px; border:1px solid var(--border); border-radius:11px; background:var(--panel-bg); color:var(--ink);}
.recipe-current-food > span {font-size:12px; font-weight:600; color:var(--muted)}
.recipe-current-food > strong {font-weight:800; font-size:14px; overflow-wrap:anywhere}
.recipe-current-food > small {font-size:12px; color:var(--muted); margin-left:auto;}
.recipe-search-hint,.recipe-search-empty,.recipe-search-count {font-size:12px; line-height:1.5; margin:8px 2px 0; color:var(--muted);}
.recipe-search-empty {padding:10px 12px; border:1px dashed var(--border-strong);border-radius:10px;}
.recipe-search-count {font-weight:650;color:var(--ink);}
.recipe-search-results {margin-top:8px;border:1px solid var(--border-strong);border-radius:12px;max-height:250px;overflow-y:auto;overscroll-behavior:contain;background:var(--panel-bg);}
.recipe-search-option {display:flex;gap:10px;align-items:center;justify-content:space-between;width:100%;border:0;border-bottom:1px solid var(--border);background:var(--panel-bg);color:var(--ink);text-align:left;cursor:pointer;padding:11px 13px;font:inherit;min-height:56px;}
.recipe-search-option:last-child {border-bottom:0;}
.recipe-search-option:hover,.recipe-search-option:focus-visible {background:var(--panel-hover);outline:2px solid var(--focus);outline-offset:-2px;}
.recipe-search-option[aria-selected="true"] {background:var(--panel-alt);}
.recipe-search-option-main {min-width:0;display:flex;flex-direction:column;gap:4px;flex:1;}
.recipe-search-option-main strong {font-size:13px;line-height:1.4;overflow-wrap:anywhere;}
.recipe-search-option-main small,.recipe-search-option-meta small {color:var(--muted);font-size:11px;}
.recipe-search-option-meta {display:flex;flex-direction:column;gap:4px;align-items:flex-end;font-size:11px;color:var(--ink);min-width:100px;max-width:48%;text-align:right;}
.recipe-search-selected {border-radius:99px;padding:3px 7px;font-size:10px;background:var(--green-soft);color:var(--soft-fg);font-weight:800;}
@media(max-width:490px){.recipe-search-option {align-items:flex-start;flex-wrap:wrap}.recipe-search-option-meta {max-width:100%;align-items:flex-start;text-align:left}.recipe-current-food>small{margin-left:0;width:100%}}

/* v0.9.12 local-network update settings */
.update-lan-box { padding:16px; background:var(--panel-subtle, var(--surface-soft, rgba(130,160,155,.08))); border:1px solid var(--border);border-radius:13px;margin:16px 0; }
.update-lan-box h3 {margin:0 0 7px;font-size:15px;letter-spacing:-.2px;}
.update-lan-box .inline-actions {flex-wrap:wrap;align-items:center;}
.update-share-details {margin-top:14px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--panel-bg,transparent);overflow-wrap:anywhere;}
.update-share-details strong {display:block;margin-bottom:8px;}
.update-share-details label {display:block;font-size:12px;font-weight:750;margin:10px 0 5px;}
#lan-share-url {flex:1 1 200px;min-width:0;font-size:12px;}
#lan-peer-url {width:100%;min-width:0;}

/* Full release updater controls */
.native-trust-check{display:flex;align-items:flex-start;gap:12px;margin:16px 0;padding:13px 15px;border:1px solid var(--border, #bbc9d4);border-radius:12px;line-height:1.55;font-size:0.95rem;}
.native-trust-check input{margin-top:5px;flex:none;accent-color:var(--accent, #32785d);width:18px;height:18px;}
.update-share-details code{word-break:break-all;font-size:0.83rem;line-height:1.5;}
.update-panel .field{margin-block:12px;}
.update-panel .inline-actions{flex-wrap:wrap;}
@media (max-width:520px){.update-lan-box{padding:15px;}.update-panel .inline-actions .input{min-width:0;flex-basis:100%;}.native-trust-check{font-size:0.9rem;}}

/* Complete food-library browser inside the saved-meal editor */
.recipe-picker-tools{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(170px,1fr);gap:12px;margin-bottom:12px}
.recipe-picker-tools .field{min-width:0}
.recipe-page-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;flex-wrap:wrap}
.recipe-page-controls span{font-size:12px;color:var(--muted);font-weight:700}
.recipe-search-option-main strong{font-size:14px}
.recipe-search-option-main small,.recipe-search-option-meta small{font-size:12px}
@media(max-width:540px){.recipe-picker-tools{grid-template-columns:1fr}.recipe-page-controls{gap:5px}.recipe-page-controls .btn{padding:8px}}

/* Permanent release updates */
.online-update-banner{position:sticky;top:12px;z-index:110;display:flex;align-items:center;gap:12px;justify-content:space-between;padding:16px 18px;margin:4px 0 18px;border:1px solid var(--border, #b9c9c7);border-radius:14px;background:var(--panel-alt);box-shadow:0 4px 12px rgba(0,0,0,.055)}
.online-update-banner>div{flex:1;min-width:0}.online-update-banner strong{font-size:1.04rem}.online-update-banner p{margin:4px 0 0;color:var(--muted);line-height:1.4}
.update-publisher-tools{margin:16px 0 8px;padding:14px;border:1px solid var(--border,#cbd5d1);border-radius:12px}
.update-publisher-tools summary{cursor:pointer;font-weight:650}.update-publisher-tools .field{margin:10px 0}
.online-update-form .field{margin-bottom:10px}.online-update-form .inline-actions{margin-top:10px}
@media(max-width:640px){.online-update-banner{flex-wrap:wrap;padding:12px}.online-update-banner>div{flex-basis:100%}.online-update-banner .btn{flex:1}}

/* Create a reusable meal by selecting existing diary snapshots. */
.diary-meal-builder{border:1px solid var(--border,#bacbc5);padding:12px;border-radius:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:10px 0;background:var(--panel-alt)}
.diary-meal-builder{color:var(--ink)}
.diary-meal-builder>span{font-weight:700}.diary-meal-builder p{flex-basis:100%;margin:0;font-size:.88rem;color:var(--muted)}
.diary-select-entry{padding:8px;min-width:36px;min-height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto}.diary-select-entry input{accent-color:var(--green);width:19px;height:19px}

/* CSP-safe calorie bar heights; positive values retain a visible minimum. */
.week-bar.week-level-0 {height:0%}
.week-bar.week-level-1 {height:1%}
.week-bar.week-level-2 {height:2%}
.week-bar.week-level-3 {height:3%}
.week-bar.week-level-4 {height:4%}
.week-bar.week-level-5 {height:5%}
.week-bar.week-level-6 {height:6%}
.week-bar.week-level-7 {height:7%}
.week-bar.week-level-8 {height:8%}
.week-bar.week-level-9 {height:9%}
.week-bar.week-level-10 {height:10%}
.week-bar.week-level-11 {height:11%}
.week-bar.week-level-12 {height:12%}
.week-bar.week-level-13 {height:13%}
.week-bar.week-level-14 {height:14%}
.week-bar.week-level-15 {height:15%}
.week-bar.week-level-16 {height:16%}
.week-bar.week-level-17 {height:17%}
.week-bar.week-level-18 {height:18%}
.week-bar.week-level-19 {height:19%}
.week-bar.week-level-20 {height:20%}
.week-bar.week-level-21 {height:21%}
.week-bar.week-level-22 {height:22%}
.week-bar.week-level-23 {height:23%}
.week-bar.week-level-24 {height:24%}
.week-bar.week-level-25 {height:25%}
.week-bar.week-level-26 {height:26%}
.week-bar.week-level-27 {height:27%}
.week-bar.week-level-28 {height:28%}
.week-bar.week-level-29 {height:29%}
.week-bar.week-level-30 {height:30%}
.week-bar.week-level-31 {height:31%}
.week-bar.week-level-32 {height:32%}
.week-bar.week-level-33 {height:33%}
.week-bar.week-level-34 {height:34%}
.week-bar.week-level-35 {height:35%}
.week-bar.week-level-36 {height:36%}
.week-bar.week-level-37 {height:37%}
.week-bar.week-level-38 {height:38%}
.week-bar.week-level-39 {height:39%}
.week-bar.week-level-40 {height:40%}
.week-bar.week-level-41 {height:41%}
.week-bar.week-level-42 {height:42%}
.week-bar.week-level-43 {height:43%}
.week-bar.week-level-44 {height:44%}
.week-bar.week-level-45 {height:45%}
.week-bar.week-level-46 {height:46%}
.week-bar.week-level-47 {height:47%}
.week-bar.week-level-48 {height:48%}
.week-bar.week-level-49 {height:49%}
.week-bar.week-level-50 {height:50%}
.week-bar.week-level-51 {height:51%}
.week-bar.week-level-52 {height:52%}
.week-bar.week-level-53 {height:53%}
.week-bar.week-level-54 {height:54%}
.week-bar.week-level-55 {height:55%}
.week-bar.week-level-56 {height:56%}
.week-bar.week-level-57 {height:57%}
.week-bar.week-level-58 {height:58%}
.week-bar.week-level-59 {height:59%}
.week-bar.week-level-60 {height:60%}
.week-bar.week-level-61 {height:61%}
.week-bar.week-level-62 {height:62%}
.week-bar.week-level-63 {height:63%}
.week-bar.week-level-64 {height:64%}
.week-bar.week-level-65 {height:65%}
.week-bar.week-level-66 {height:66%}
.week-bar.week-level-67 {height:67%}
.week-bar.week-level-68 {height:68%}
.week-bar.week-level-69 {height:69%}
.week-bar.week-level-70 {height:70%}
.week-bar.week-level-71 {height:71%}
.week-bar.week-level-72 {height:72%}
.week-bar.week-level-73 {height:73%}
.week-bar.week-level-74 {height:74%}
.week-bar.week-level-75 {height:75%}
.week-bar.week-level-76 {height:76%}
.week-bar.week-level-77 {height:77%}
.week-bar.week-level-78 {height:78%}
.week-bar.week-level-79 {height:79%}
.week-bar.week-level-80 {height:80%}
.week-bar.week-level-81 {height:81%}
.week-bar.week-level-82 {height:82%}
.week-bar.week-level-83 {height:83%}
.week-bar.week-level-84 {height:84%}
.week-bar.week-level-85 {height:85%}
.week-bar.week-level-86 {height:86%}
.week-bar.week-level-87 {height:87%}
.week-bar.week-level-88 {height:88%}
.week-bar.week-level-89 {height:89%}
.week-bar.week-level-90 {height:90%}
.week-bar.week-level-91 {height:91%}
.week-bar.week-level-92 {height:92%}
.week-bar.week-level-93 {height:93%}
.week-bar.week-level-94 {height:94%}
.week-bar.week-level-95 {height:95%}
.week-bar.week-level-96 {height:96%}
.week-bar.week-level-97 {height:97%}
.week-bar.week-level-98 {height:98%}
.week-bar.week-level-99 {height:99%}
.week-bar.week-level-100 {height:100%}

/* Selection adds a checkbox column without displacing the food or edit action. */
.log-item.selecting {grid-template-columns:auto minmax(0,1fr) auto auto;gap:8px}
.log-item>div {min-width:0}
.log-name,.log-note {overflow-wrap:anywhere}
@media(max-width:480px){.log-item.selecting{gap:5px;padding-left:0}.diary-meal-builder{gap:8px}}

.history-loading,.history-control-end .field label,.history-metric-field label {color:var(--muted)}
.modal .field .hint {color:var(--muted)}

.recipe-directions{margin:12px 0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--panel-alt);color:var(--ink);min-width:0}
.recipe-directions summary{cursor:pointer;font-weight:750;color:var(--green-strong)}
.recipe-directions ul{padding-left:20px;font-size:13px;line-height:1.6}
.recipe-steps{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.7;margin-top:12px}
.plan-slot>div{min-width:0}.plan-slot-actions{display:flex;flex-direction:column;gap:10px;max-width:100%;width:190px;flex-shrink:0}
.plan-slot-actions label{font-size:12px;color:var(--muted)}.plan-slot-actions select{width:100%;margin-top:5px}
@media(max-width:700px){.plan-slot{flex-wrap:wrap}.plan-slot-actions{width:100%}.recipe-directions{padding:10px}}
.plan-slot{flex-direction:column;align-items:stretch}
.plan-slot-actions{width:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end}
@media(max-width:700px){.plan-slot-actions{grid-template-columns:minmax(0,1fr)}}

/* Each ingredient reveals its library only on request. */
.recipe-library-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;white-space:normal;text-align:left}
.recipe-library-toggle:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.recipe-library-panel{min-width:0;margin-top:12px}
.recipe-library-panel[hidden]{display:none}

/* Every configured daily target is visible together on the overview. */
.daily-targets .overview{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.daily-targets .stat{min-height:164px;padding:16px;gap:6px}
.daily-targets .stat-top{min-height:36px;line-height:1.4}
.daily-targets .stat-num{font-size:clamp(24px,2.2vw,32px);margin-top:0}
.daily-target-status{font-size:12px;line-height:1.5;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
.daily-target-progress{display:block;width:100%;height:7px;appearance:none;border:0;border-radius:20px;overflow:hidden;background:var(--panel-alt);color:var(--green-strong)}
.daily-target-progress::-webkit-progress-bar{background:var(--panel-alt);border-radius:20px}
.daily-target-progress::-webkit-progress-value{background:var(--green-strong);border-radius:20px}
.daily-target-progress::-moz-progress-bar{background:var(--green-strong);border-radius:20px}
@media(max-width:1150px){.daily-targets .overview{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:690px){.daily-targets .overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.daily-targets .stat{padding:13px;min-height:155px}.daily-targets .section-title{align-items:flex-start;gap:12px;flex-wrap:wrap}}

#label-scan-preview{display:block;max-width:100%;max-height:340px;object-fit:contain;margin:16px auto;border-radius:8px}
#label-scan-preview[hidden]{display:none}
#label-scan-status{line-height:1.5;overflow-wrap:anywhere}

.label-scan-paste{display:flex;flex-direction:column;gap:8px;padding:20px;margin-bottom:16px;border:2px dashed var(--border);border-radius:12px;background:var(--panel-alt);color:var(--ink);line-height:1.5}
.label-scan-paste span{font-size:13px;color:var(--muted)}
.label-scan-paste:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
/* Card actions wrap before they can spill into adjacent cards. */
.food-card-actions{flex-wrap:wrap;gap:8px}
.food-card-actions .btn{white-space:normal;max-width:100%;min-width:0}
.food-card-top>div{min-width:0}
.food-card h3,.recipe-chips span{overflow-wrap:anywhere}


.label-camera-actions{margin-bottom:18px}.label-camera-actions .hint{margin:10px 0 0;line-height:1.5}

.finish-day{margin-bottom:22px}.finish-focus{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.finish-focus .btn{white-space:normal}.finish-filter{display:flex;align-items:center;gap:9px;font-size:14px;margin-bottom:10px}.finish-filter input{width:18px;height:18px}.finish-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.finish-card{padding:16px;border:1px solid var(--border);border-radius:12px;min-width:0;overflow-wrap:anywhere}.finish-card h3{margin:0 0 8px;font-size:16px}.finish-card p{line-height:1.5}.finish-card>.btn{margin-top:8px}.finish-note{margin:18px 0 0;line-height:1.5}@media(max-width:690px){.finish-grid{grid-template-columns:1fr}.finish-focus .btn{min-height:44px}.finish-card>.btn{min-height:44px}}

/* Portion previews keep numbers visible while the quantity field retains focus. */
.portion-calculator{margin-top:14px;padding:14px;border:1px solid var(--border,#ccd6d0);border-radius:12px;text-align:left}.portion-summary{margin:0 0 10px;font-size:14px;font-weight:600}.portion-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;text-align:left}.portion-grid>div{min-width:0}.portion-grid span{display:block;font-size:12px;opacity:.8;overflow-wrap:anywhere}.portion-grid strong{display:block;font-size:14px;font-weight:650}.recipe-item-cal{min-width:0;text-align:left}.recipe-part-grid .recipe-item-cal{grid-column:1/-1}.recipe-item-cal .portion-grid{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}

/* Fixed foreground/background pairs keep warning colors readable in every theme. */
.finish-card .food-warning.finish-warning-low{background:#e7f5e9;color:#215b32;border:1px solid #92bd9a;border-left:4px solid #39834b}
.finish-card .food-warning.finish-warning-medium{background:#fff4cc;color:#624900;border:1px solid #d8bd58;border-left:4px solid #b08a00}
.finish-card .food-warning.finish-warning-high{background:#fce9e7;color:#8d2723;border:1px solid #dba09b;border-left:4px solid #bc433a}
.finish-card .food-warning{padding:9px 11px;border-radius:8px;line-height:1.45;overflow-wrap:anywhere}
.finish-warning-key{margin-top:14px}
