/* Health tracker: warm editorial surface with Apple Health as an explicit native bridge. */
#scHealth{min-height:100svh;background:#F5EEE6;padding-top:0}
.health-wrap{padding-top:max(16px,env(safe-area-inset-top));padding-bottom:calc(var(--nav) + 34px)}
.health-head{display:flex;align-items:center;gap:13px;margin:0 0 18px}
.health-head>button{width:44px;height:44px;border:1px solid rgba(27,23,19,.12);border-radius:50%;background:rgba(255,255,255,.66);color:var(--ink);font-size:19px;cursor:pointer}
.health-head span,.health-section-title span{display:block;color:var(--accent-d);font-size:9px;font-weight:900;letter-spacing:.13em}
.health-head h1{font:900 34px/.95 var(--brand-display,Georgia,serif);letter-spacing:-.04em;text-transform:uppercase;margin-top:4px}

.health-summary{position:relative;overflow:hidden;border-radius:29px;background:var(--panel);color:#fff;padding:21px;box-shadow:0 17px 42px rgba(27,21,18,.15)}
.health-summary::after{content:"";position:absolute;right:-64px;top:-78px;width:190px;height:190px;border-radius:50%;background:rgba(245,112,80,.17);border:1px solid rgba(255,255,255,.08)}
.health-summary-top{position:relative;z-index:1;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.health-summary-top small{display:block;color:rgba(255,255,255,.57);font-size:10.5px;font-weight:750;text-transform:capitalize}
.health-summary-top strong{display:block;margin-top:10px;font:900 44px/.92 var(--brand-display,Georgia,serif);letter-spacing:-.045em}
.health-summary-top strong em{font-family:inherit;font-size:12px;font-style:normal;letter-spacing:0;color:rgba(255,255,255,.62)}
.health-summary-top>span{position:relative;z-index:1;padding:6px 9px;border-radius:99px;background:rgba(255,255,255,.1);font-size:9px;font-weight:850;white-space:nowrap}
.health-macros{position:relative;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:22px}
.health-macros>div{position:relative;border-radius:16px;background:rgba(255,255,255,.07);padding:11px 12px 11px 29px}
.health-macros>div::before{content:"";position:absolute;left:12px;top:15px;width:7px;height:7px;border-radius:50%;background:var(--accent)}
.health-macros .carbs::before{background:var(--butter)}.health-macros .fat::before{background:var(--powder)}.health-macros .fiber::before{background:#B7D83F}
.health-macros span{display:block;color:rgba(255,255,255,.56);font-size:8.5px;font-weight:750}
.health-macros b{display:block;margin-top:2px;font-size:13px}

.health-week,.health-history{margin-top:13px;border:1px solid rgba(73,52,32,.08);border-radius:25px;background:#fff;padding:18px;box-shadow:0 7px 22px rgba(73,52,32,.045)}
.health-section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:16px}
.health-section-title h2{font:800 23px/1 var(--brand-display,Georgia,serif);letter-spacing:-.035em;margin-top:4px}
.health-section-title>small{color:var(--grey);font-size:9px}
.health-chart{height:133px;display:grid;grid-template-columns:repeat(7,1fr);gap:8px;align-items:end;padding:4px 0 0}
.health-bar{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0}
.health-bar b{height:20px;max-width:100%;overflow:hidden;color:var(--grey);font-size:7.5px;font-weight:750;text-align:center}
.health-bar i{display:block;width:min(24px,72%);min-height:4px;border-radius:8px 8px 3px 3px;background:var(--butter)}
.health-bar:nth-child(7) i{background:var(--accent)}
.health-bar span{margin-top:7px;color:var(--grey);font-size:8.5px;font-weight:800;text-transform:uppercase}

.health-apple-card{margin-top:13px;border-radius:25px;background:#fff;padding:18px;border:1px solid rgba(73,52,32,.08);box-shadow:0 7px 22px rgba(73,52,32,.045)}
.health-connection-copy{display:grid;grid-template-columns:22px minmax(0,1fr);gap:11px;align-items:start}
.health-status-dot{width:18px;height:18px;border-radius:7px;background:#EAE0D7;box-shadow:inset 0 0 0 5px #F6F0EB}
.health-status-dot.on{background:#77A52A;box-shadow:inset 0 0 0 5px #DDEACA}.health-status-dot.ready{background:var(--accent);box-shadow:inset 0 0 0 5px #FCE1D9}.health-status-dot.off{background:#B94A3B;box-shadow:inset 0 0 0 5px #F6D9D4}.health-status-dot.web{background:#899EAE;box-shadow:inset 0 0 0 5px #DFE7EC}
.health-connection-copy b{display:block;font:800 18px/1.08 var(--brand-display,Georgia,serif);letter-spacing:-.025em}
.health-connection-copy p{margin:6px 0 0;color:var(--grey);font-size:11px;line-height:1.42}
.health-connect{width:100%;min-height:46px;margin-top:14px;border:0;border-radius:14px;background:var(--ink);color:#fff;font-size:11.5px;font-weight:850;cursor:pointer}
.health-connect.secondary{background:var(--soft);color:var(--ink)}.health-connect:disabled{opacity:.52;cursor:not-allowed}
.health-privacy{display:block;margin-top:9px;color:var(--grey);font-size:8.5px;line-height:1.45}

.health-entry-list{display:grid;gap:8px}
.health-entry{border:1px solid var(--line);border-radius:18px;padding:12px;background:#FFFCF9}
.health-entry-main{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:9px}
.health-entry-icon{color:var(--accent);font-size:8px}.health-entry-main>div{min-width:0}
.health-entry-main>div>b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.health-entry-main>div>small{display:block;margin-top:3px;color:var(--grey);font-size:8.5px}
.health-entry-main>strong{font:800 18px/1 var(--brand-display,Georgia,serif);white-space:nowrap}
.health-entry-main>strong small{font-family:inherit;font-size:8px;color:var(--grey)}
.health-entry-meta{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:10px 0 0 21px}
.health-entry-meta>span,.health-entry-meta>em{border-radius:99px;background:var(--soft);padding:4px 6px;color:var(--grey);font-size:7.5px;font-style:normal;font-weight:800}
.health-entry-meta>em{margin-left:auto;background:#E8EDF0;color:#53636E}.health-entry-meta>em.synced{background:#E6EFD8;color:#567C1A}.health-entry-meta>em.error{background:#F7DFDA;color:var(--warn)}
.health-entry-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:8px}
.health-entry-actions:empty{display:none}.health-entry-actions button{border:0;border-radius:10px;background:var(--soft);padding:7px 8px;color:var(--ink);font-size:8px;font-weight:800;cursor:pointer}.health-entry-actions button.danger{background:transparent;color:var(--warn)}
.health-empty{text-align:center;padding:18px 12px 12px}.health-empty>span{display:block;font-size:31px;color:var(--accent)}.health-empty b{display:block;margin-top:5px;font:800 18px/1 var(--brand-display,Georgia,serif)}.health-empty p{max-width:280px;margin:8px auto 0;color:var(--grey);font-size:10.5px;line-height:1.45}
.health-local-note{max-width:360px;margin:14px auto 0;color:var(--grey);font-size:8.5px;line-height:1.5;text-align:center}

.health-glance{width:100%;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px;margin:0 0 13px;padding:15px;border:1px solid rgba(27,23,19,.12);border-radius:22px;background:var(--panel);color:#fff;text-align:left;cursor:pointer;box-shadow:none}
.health-glance-mark{width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:var(--accent)}.health-glance-mark i{font-style:normal;font-size:21px}
.health-glance-copy{min-width:0}.health-glance-copy small{display:block;color:rgba(255,255,255,.52);font-size:7.5px;font-weight:900;letter-spacing:.1em}.health-glance-copy b{display:block;margin-top:3px;font:800 22px/1 var(--brand-display,Georgia,serif)}.health-glance-copy em{display:block;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgba(255,255,255,.64);font-size:8.5px;font-style:normal}.health-glance-arrow{font-size:17px;color:rgba(255,255,255,.62)}

#scDash .home-action--health{min-height:178px;padding:16px!important;display:flex!important;flex-direction:column;align-items:flex-start!important;gap:0!important;text-align:left;background:#C7E0E9!important}
#scDash .home-action--health::before{right:-27px;bottom:-42px;width:102px;height:102px;background:rgba(255,255,255,.3)}
#scDash .home-action--health>div{margin-top:auto;padding-top:20px}#scDash .home-action--health b{font-size:18px}
.health-profile-action{border:1px solid var(--line)!important;border-radius:16px!important;background:var(--soft)!important}.health-profile-action>i{background:#fff!important}

.health-completion-overlay{align-items:flex-end;background:rgba(23,19,17,.5);backdrop-filter:blur(7px)}
.health-completion{position:relative;width:min(100%,520px);max-height:calc(100svh - 14px);overflow:auto;border-radius:30px 30px 0 0;background:#FFFBF7;padding:22px 20px max(22px,env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(23,19,17,.18)}
.health-modal-close{position:absolute;right:18px;top:18px;z-index:2;width:40px;height:40px;border:0;border-radius:50%;background:var(--soft);color:var(--ink);cursor:pointer}
.health-completion-head{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:12px;padding-right:42px}
.health-completion-head>span{width:48px;height:48px;border-radius:17px;display:grid;place-items:center;background:#DCECC3;color:#52751B;font-size:20px;font-weight:900}
.health-completion-head small{display:block;color:var(--accent-d);font-size:8px;font-weight:900;letter-spacing:.12em}.health-completion-head h2{margin-top:4px;font:800 23px/1.02 var(--brand-display,Georgia,serif);letter-spacing:-.03em}.health-completion-head p{margin:5px 0 0;color:var(--grey);font-size:9px}
.health-completion-loading{min-height:190px;display:flex;align-items:center;justify-content:center;gap:13px}.health-completion-loading b{display:block;font-size:12px}.health-completion-loading p{margin:3px 0 0;color:var(--grey);font-size:10px}
.health-completion-error{margin:24px 0 0;padding:15px;border-radius:17px;background:#FBE5E1}.health-completion-error b{font-size:12px}.health-completion-error p{margin:5px 0 0;color:var(--warn);font-size:10px}
.health-portions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;padding:13px 14px;border-radius:18px;background:var(--cream)}.health-portions>div>b{display:block;font-size:11.5px}.health-portions>div>span{display:block;margin-top:2px;color:var(--grey);font-size:8.5px}
.health-portion-stepper{display:grid;grid-template-columns:38px 38px 38px;align-items:center;gap:5px}.health-portion-stepper button{width:38px;height:38px;border:0;border-radius:12px;background:#fff;color:var(--ink);font-size:17px;cursor:pointer}.health-portion-stepper strong{text-align:center;font-size:12px}
.health-meal-energy{text-align:center;padding:22px 0 14px}.health-meal-energy>small{display:block;color:var(--grey);font-size:8px;font-weight:900;letter-spacing:.12em}.health-meal-energy>strong{display:block;margin-top:7px;font:900 42px/.9 var(--brand-display,Georgia,serif);letter-spacing:-.045em}.health-meal-energy em{font-family:inherit;font-size:11px;font-style:normal;color:var(--grey);letter-spacing:0}
.health-meal-macros{display:grid;grid-template-columns:1fr 1fr;gap:7px}.health-meal-macros>span{border:1px solid var(--line);border-radius:14px;padding:10px;color:var(--grey);font-size:8.5px}.health-meal-macros b{display:block;color:var(--ink);font-size:12px}
.health-completion-sync{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:start;margin-top:12px;padding:13px;border-radius:17px;background:#F1EBE5}.health-completion-sync>span{width:38px;height:38px;border-radius:13px;background:#fff;display:grid;place-items:center;color:#B63838;font-size:18px}.health-completion-sync>span.on{background:#F7DCDC}.health-completion-sync b{display:block;font-size:11px}.health-completion-sync p{margin:3px 0 0;color:var(--grey);font-size:8.5px;line-height:1.4}.health-completion-sync button{margin-top:8px;border:0;border-radius:10px;background:var(--ink);color:#fff;padding:7px 9px;font-size:8px;font-weight:800;cursor:pointer}
.health-estimate{margin:9px 2px 0;color:var(--grey);font-size:7.5px;line-height:1.4;text-align:center}
.health-completion-actions{display:grid;gap:7px;margin-top:15px}.health-completion-actions button{min-height:45px;border:0;border-radius:14px;background:var(--soft);color:var(--ink);font-size:10.5px;font-weight:850;cursor:pointer}.health-completion-actions .health-save-meal{background:var(--ink);color:#fff}.health-completion-actions button:disabled{opacity:.58;cursor:wait}

@media (min-width:600px){.health-completion{border-radius:30px;max-height:calc(100svh - 40px);margin-bottom:20px}}
@media (max-width:360px){.health-summary{padding:18px}.health-summary-top strong{font-size:38px}.health-chart{gap:4px}.health-portion-stepper{grid-template-columns:36px 34px 36px}.health-portion-stepper button{width:36px;height:36px}#scDash .home-action--health{min-height:186px;padding:14px!important}#scDash .home-action--health b{font-size:16px}}
@media (prefers-reduced-motion:reduce){.health-glance,.health-connect{transition:none}}
