:root { color-scheme: light; font-family: system-ui, sans-serif; background: #f6f3ed; color: #173b3c; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f6f3ed; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.pwa-frame { min-height: 100vh; display: flex; flex-direction: column; }
.app-bar { min-height: 62px; padding: 14px max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; background: #174c4f; color: white; }
.brand { color: inherit; font-weight: 800; text-decoration: none; }
.account-menu { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.main-content { width: min(680px, 100%); flex: 1; margin: 0 auto; padding: 24px 18px 104px; }
.auth-panel, .welcome-card, .product-section { background: white; border: 1px solid #dbe4df; border-radius: 20px; padding: 24px; box-shadow: 0 8px 28px #173b3c0d; }
.install-guide { position: fixed; z-index: 5; inset: 12px; width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; margin: auto; background: #fff; border: 1px solid #dbe4df; border-radius: 20px; padding: 22px; box-shadow: 0 18px 60px #173b3c40; }
.install-guide::before { content: ""; position: fixed; z-index: -1; inset: 0; background: #173b3c66; }
.install-guide h2 { margin: 18px 0 8px; font-size: 1.08rem; }
.guide-step { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; }
.guide-step svg { flex: 0 0 30px; width: 30px; height: 30px; padding: 5px; border-radius: 9px; background: #e6efeb; stroke: #174c4f; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.guide-step svg circle { fill: #174c4f; stroke: none; }
.guide-step p { margin: 0; line-height: 1.8; }
.guide-dismiss { display: flex; align-items: center; gap: 8px; margin: 18px 0 14px; }
.guide-dismiss input { width: auto; }
.auth-panel { max-width: 440px; margin: 8vh auto 0; }
h1 { margin: 0 0 10px; line-height: 1.4; font-size: clamp(1.35rem, 5vw, 2rem); }
.muted, .status { color: #587071; line-height: 1.8; }
.eyebrow { color: #c47745; font-size: .82rem; font-weight: 700; margin: 0 0 8px; }
form { display: grid; gap: 10px; margin-top: 20px; }
label { font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #b7c9c6; border-radius: 12px; padding: 12px; background: #fff; color: inherit; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid #f0b27b; outline-offset: 2px; }
.primary-button, .secondary-button { min-height: 46px; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 700; }
.primary-button { background: #174c4f; color: #fff; }
.secondary-button { background: #e6efeb; color: #174c4f; }
.text-button { border: 0; background: transparent; color: inherit; text-decoration: underline; padding: 4px; }
.separator { display: flex; align-items: center; gap: 12px; color: #78908e; margin-top: 20px; }
.separator::before, .separator::after { content: ""; height: 1px; flex: 1; background: #dbe4df; }
.chat-screen { display: grid; gap: 16px; }
.chat-empty { min-height: 38vh; display: grid; place-items: center; color: #78908e; border: 1px dashed #b7c9c6; border-radius: 20px; padding: 24px; }
.composer { position: sticky; bottom: 76px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; background: #f6f3ed; padding-top: 10px; }
.composer textarea { resize: vertical; min-height: 46px; }
.voice-composer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.voice-composer audio { width: min(100%, 320px); }
.voice-composer .status { flex-basis: 100%; margin: 0; }
.chat-turns { display: grid; gap: 18px; }
.chat-turn { display: grid; gap: 8px; }
.chat-turn p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 14px; border-radius: 14px; background: #fff; line-height: 1.8; }
.vip-agent-reply { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.chat-turn .user-message { background: #e6efeb; margin-inline-start: 32px; }
.chat-turn .assistant-message { margin-inline-end: 32px; }
.chat-record-actions { display: flex; gap: 8px; margin-inline-end: 32px; }
.chat-record-actions button { border: 0; border-radius: 12px; padding: 10px 18px; background: #e6efeb; color: #174c4f; font-weight: 700; }
.pwa-dialog-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 18px; background: #173b3c66; }
.pwa-dialog { width: min(520px, 100%); margin: 0; padding: 22px; border: 1px solid #dbe4df; border-radius: 20px; background: #fff; box-shadow: 0 18px 60px #173b3c40; }
.pwa-dialog h2 { margin: 0; }
.pwa-dialog-error { min-height: 1.5em; color: #a33; }
.pwa-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pwa-dialog-actions button { flex: 1; }
.danger-button { background: #a33; }
.health-onboarding, .health-lab { margin-top: 20px; padding: 18px; border: 1px solid #dbe4df; border-radius: 16px; background: #fbf8f2; }
.health-onboarding h2, .health-lab h2 { margin: 0 0 10px; font-size: 1.05rem; }
.health-onboarding-question { font-size: 1.05rem; font-weight: 700; line-height: 1.8; margin: 0 0 14px; color: #173b3c; }
.health-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.health-choices button { flex: 0 1 auto; }
.health-onboarding form { margin-top: 0; }
.health-onboarding [data-health-answer] { margin: 0; }
.health-section-title { margin: 26px 0 10px; font-size: 1.02rem; color: #174c4f; }
.health-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.health-chat { margin-top: 22px; border-top: 1px solid #dbe4df; padding-top: 16px; }
.health-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.health-chat-header h2 { font-size: 1.1rem; margin: 0; }
.health-chat-turns { display: grid; gap: 10px; min-height: 48px; margin: 12px 0; }
.health-chat-turn { white-space: pre-wrap; padding: 12px; border-radius: 12px; background: #e6efeb; line-height: 1.8; }
.health-composer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; margin-top: 12px; }
.health-composer textarea { resize: vertical; }
.health-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 4px 0 10px; }
.health-stat-card { border: 1px solid #dbe4df; border-radius: 12px; padding: 14px; background: #fff; display: grid; gap: 6px; text-align: center; }
.health-stat-card span { color: #587071; font-size: .82rem; }
.health-stat-card strong { font-size: 1.1rem; }
.health-meta { display: block; color: #78908e; font-size: .82rem; }
.health-state-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.health-chip { font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: #e6efeb; color: #174c4f; }
.health-chip--declared { background: #174c4f; color: #fff; }
.health-chip--none_declared { background: #e6efeb; color: #587071; }
.health-chip--unanswered { background: #fbeee3; color: #c47745; }
.health-group-title { margin: 22px 0 10px; font-size: 1.02rem; color: #174c4f; border-top: 1px solid #dbe4df; padding-top: 16px; }
.health-record-list, .health-measurement-list { display: grid; gap: 8px; }
.health-record-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #f6f3ed; }
.health-record-text { margin: 0; flex: 1; }
.health-measurement-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #f6f3ed; flex-wrap: wrap; }
.health-measurement-info { display: grid; gap: 2px; }
.health-measurement-info strong { font-size: 1rem; }
.health-measurement-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.health-measurement-actions button, .health-record-row button { min-height: 38px; padding: 6px 14px; font-size: .85rem; }
.product-section { margin-top: 8px; }
.section-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 20px 0; }
.section-actions button.is-active { background: #174c4f; color: #fff; }
.result-card { border-top: 1px solid #dbe4df; margin-top: 16px; padding-top: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.result-card p { margin: 8px 0; }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.report-title { margin: 0; font-size: 1.15rem; }
.report-subtitle { color: #78908e; font-size: .85rem; }
.report-group { margin-top: 18px; }
.report-group-title { margin: 0 0 8px; font-size: .95rem; color: #587071; font-weight: 700; }
.report-list { display: grid; gap: 6px; }
.report-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #f6f3ed; }
.report-list-name { flex: 1; }
.report-badge { flex: 0 0 auto; color: #174c4f; }
.report-badge--activity { color: #c47745; }
.report-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin: 18px 0 4px; }
.report-total-card { border: 1px solid #dbe4df; border-radius: 12px; padding: 14px; background: #fff; display: grid; gap: 6px; }
.report-total-card span { color: #587071; font-size: .82rem; }
.report-meta-list { display: grid; gap: 6px; margin: 14px 0; }
.report-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed #dbe4df; }
.report-meta-row:last-child { border-bottom: 0; }
.help-list { display: grid; gap: 16px; }
.nutrient-grid, .plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin: 16px 0; }
.nutrient-card, .plan-card { border: 1px solid #dbe4df; border-radius: 12px; padding: 16px; background: #fff; }
.nutrient-card { display: grid; gap: 6px; }
.plan-card h2 { font-size: 1.1rem; }
.plan-card button { width: 100%; }
.payment-text { white-space: pre-wrap; unicode-bidi: plaintext; }
.purchase-form { display: grid; gap: 14px; margin: 16px 0; }
.purchase-consent { display: flex; align-items: start; gap: 10px; }
.purchase-consent input { width: auto; flex: 0 0 auto; margin-top: 8px; }
.purchase-form input[type="file"] { width: 100%; margin-top: 8px; }
.help-list article { border-top: 1px solid #dbe4df; padding-top: 12px; }
.help-list h2 { font-size: 1.05rem; margin: 0 0 6px; }
select { width: 100%; border: 1px solid #b7c9c6; border-radius: 12px; padding: 12px; background: #fff; color: inherit; }
.bottom-nav { position: fixed; z-index: 2; bottom: 0; inset-inline: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #dbe4df; }
.bottom-nav button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #587071; font-size: .72rem; }
.bottom-nav button[aria-current="page"] { background: #e6efeb; color: #174c4f; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 760px) { .bottom-nav { position: static; width: min(680px, 100%); margin: 0 auto 16px; border: 1px solid #dbe4df; border-radius: 16px; } }
@media (min-width: 480px) { .section-actions, .health-actions { grid-template-columns: repeat(3, 1fr); } }
