:root{--health-accent:var(--ptg-primary,#9f7bff);--health-text:var(--ptg-text,#f3f4f6)}
*{box-sizing:border-box}body.ptg-health-page{margin:0;background:var(--ptg-tertiary,#111827);color:var(--health-text);font:16px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
[hidden]{display:none!important}
.health-app{width:min(1200px,96%);max-width:100%;margin:20px auto 58px;padding:clamp(10px,2vw,20px);min-width:0}
.health-hero{border-radius:20px;padding:clamp(22px,5vw,45px);background:linear-gradient(135deg,#242044,#173749);border:1px solid #555580;margin-bottom:20px}
.health-eyebrow{letter-spacing:.15em;text-transform:uppercase;color:#b8f4ee;font-weight:800;font-size:.78rem;margin:0}
.health-hero h1{font-size:clamp(2rem,5vw,3.4rem);line-height:1.08;margin:8px 0 16px;color:#f3e8ff}
.health-hero p{max-width:800px;margin:9px 0;color:#dee7f4}
.health-privacy{font-size:.91rem}
.health-card{background:var(--ptg-secondary,#1f2937);border:1px solid #4d5970;border-radius:16px;padding:clamp(16px,3vw,25px);margin:15px 0;min-width:0;box-shadow:0 8px 24px #0002}
.health-card h2{font-size:1.3rem;color:#e9d5ff;margin:0 0 10px}
.health-card p{margin:7px 0 15px}
.health-card a{color:#c4b5fd}
.health-toolbar{display:flex;gap:16px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.health-date-group{display:flex;gap:9px;align-items:end;flex-wrap:wrap}
.health-date-group label{display:grid;gap:5px}
.health-tabs{display:flex;gap:9px;flex-wrap:wrap;padding:10px;margin:17px 0;border:1px solid #4e4662;background:#191a30;border-radius:14px}
.health-tabs button{background:transparent;border:1px solid transparent;border-radius:10px;color:#e5daf8}
.health-tabs button:hover,.health-tabs button:focus-visible{background:#36304f}
.health-tabs button[aria-selected=true]{background:#6941a2;border-color:#b79cf0;color:white}
.health-panel{min-width:0}
.health-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:15px 0}
.health-metric{background:#23283c;border:1px solid #4b526c;border-radius:13px;padding:17px;min-width:0}
.health-metric>span{display:block;font-size:.87rem;color:#c4c9dc}
.health-metric>strong{display:block;font-size:clamp(1.25rem,2.3vw,1.85rem);margin:4px 0;color:#dcfce7;overflow-wrap:anywhere}
.health-metric>small{display:block;font-size:.78rem;color:#adb8ce}
.health-two-column{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.health-two-column>.health-card{margin:0 0 16px;min-width:0}
.health-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin:14px 0}
.health-wide{grid-column:1/-1}
.health-form-grid label,.health-card>label{display:grid;gap:6px;font-weight:700;color:#e8e4f7;font-size:.89rem}
.health-card input,.health-card select,.health-card textarea,.health-date-group input{min-width:0;width:100%;background:#101827;border:1px solid #79829e;border-radius:9px;color:#fff;padding:11px 12px;font:inherit;min-height:44px}
.health-card input:focus-visible,.health-card select:focus-visible{outline:3px solid #a78bfa;outline-offset:2px}
.health-app button{border:1px solid #ab95e6;border-radius:10px;background:var(--health-accent);color:#111827;padding:11px 16px;min-height:43px;font:700 .93rem/1.3 system-ui,sans-serif;cursor:pointer}
.health-app button:disabled{opacity:.52;cursor:not-allowed}
.health-app button:hover:not(:disabled){filter:brightness(1.12)}
.health-app button:focus-visible{outline:3px solid #73ede1;outline-offset:3px}
.health-app button.health-secondary{background:#2b354e;color:#f7f3ff;border-color:#7a86a2}
.health-app button.health-danger{background:#8e222b;color:white;border-color:#fb7185;margin-top:8px}
.health-actions,.health-shortcuts{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0}
.health-hint{color:#b7c3d5;font-size:.88rem}
.health-food-results{display:grid;gap:6px;max-height:290px;overflow:auto;margin:12px 0}
.health-food-choice{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#141d30;border:1px solid #576681;border-radius:9px;padding:10px 12px;text-align:left}
.health-food-choice strong{display:block;color:#f5eaff;font-size:.9rem}
.health-food-choice small{color:#bdc7de;font-size:.78rem}
.health-food-choice>span:last-child{font-weight:850;color:#a7f3d0;white-space:nowrap}
.health-entry-list{display:grid;gap:9px}
.health-entry{display:flex;justify-content:space-between;align-items:flex-start;gap:13px;padding:13px;border-radius:10px;background:#151e31;border:1px solid #4c5772;min-width:0}
.health-entry strong{display:block;overflow-wrap:anywhere}
.health-entry small{display:block;color:#c4cede;font-size:.82rem;overflow-wrap:anywhere}
.health-entry-details{min-width:0;flex:1}
.health-entry-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.health-entry-actions button{font-size:.79rem!important;min-height:36px!important;padding:7px 9px!important}
.health-entry .health-remove{background:#4d283a!important;border-color:#8d5870!important;color:#ffdbe7!important}
.health-heading-line{display:flex;align-items:center;justify-content:space-between;gap:12px}
.health-heading-line strong{color:#a7f3d0}
.health-plan-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.health-plan-day{background:#161e30;border:1px solid #48516f;border-radius:12px;padding:10px;min-width:0}
.health-plan-day strong,.health-plan-day span{display:block;overflow-wrap:anywhere}
.health-plan-day small{color:#bdc7df}
.health-plan-day button{margin:8px 0 0;width:100%;font-size:.78rem;padding:8px!important;min-height:34px}
.health-guides{margin-top:26px}
.health-guide-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.health-guide{border:1px solid #445b6f;border-radius:12px;background:#1a2638;padding:16px;min-width:0}
.health-guide h3{margin:0;color:#baf4ee}
.health-guide p{color:#d6dbeb;font-size:.87rem;margin:4px 0}
.health-guide ol{padding-left:23px;margin-bottom:0;font-size:.85rem;line-height:1.6}
.health-table-wrap{overflow:auto;max-width:100%}
.health-table-wrap table{border-collapse:collapse;width:100%;min-width:520px;font-size:.91rem}
.health-table-wrap th,.health-table-wrap td{padding:10px 12px;border-bottom:1px solid #4c526b;text-align:left}
.health-table-wrap th{color:#d8b4fe;background:#20273e}
.health-table-wrap td{color:#f1f5fa}
.health-table-wrap tr:last-child td{border-bottom:0}
.health-panel svg{width:100%;height:auto;display:block;max-height:270px}
.health-panel svg text{font:14px system-ui,sans-serif;fill:#d5e3f1}
.health-panel svg .health-plot-grid{stroke:#52637d;stroke-width:1;opacity:.4}
.health-panel svg .health-plot-bar{fill:#a7b7ff}
.health-panel svg .health-plot-line{fill:none;stroke:#80ebd0;stroke-width:4;stroke-linejoin:round;stroke-linecap:round}
.health-panel svg .health-plot-dot{fill:#80ebd0}
.health-panel svg .health-plot-target{stroke:#ffbd83;stroke-width:2;stroke-dasharray:7 6}
.health-footer-note{text-align:center;color:#b6bbd5;font-size:.85rem;margin:20px auto}
#health-sync-status{margin:0;font-size:.9rem;color:#c4b5fd}
#health-sync-status[data-error=true]{color:#fecaca}
#health-day-summary{color:#d7e0f0}
@media(max-width:1024px){.health-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.health-plan-week{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:720px){.health-two-column,.health-form-grid{grid-template-columns:1fr}.health-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.health-plan-week{grid-template-columns:repeat(2,minmax(0,1fr))}.health-wide{grid-column:auto}.health-app{width:100%;padding:12px}.health-date-group{width:100%}.health-date-group label{flex:1;min-width:170px}.health-toolbar{align-items:stretch}.health-entry{flex-direction:column}.health-entry-actions{width:100%;justify-content:flex-start}}
@media(max-width:390px){.health-metrics{grid-template-columns:1fr}.health-guide-grid{grid-template-columns:1fr}.health-tabs button{flex:1 1 130px}}

/* Distinguish calorie lookup results from the primary save buttons. */
.health-food-results button.health-food-choice{background:#141d30;color:#eff5ff;border:1px solid #596783;justify-content:space-between;text-align:left;display:flex;width:100%}
.health-food-results button.health-food-choice:hover{background:#263450}
