.profile-page { min-height:100dvh; }
body.profile-page { overflow-x:clip;overflow-y:auto; }
.profile-page.unit-wheel-open { overflow:hidden; }
.profile-shell { min-height:100dvh; padding:0 0 calc(8.2rem + env(safe-area-inset-bottom)); overflow-x:clip; }
.profile-hero { padding:calc(1.6rem + env(safe-area-inset-top)) 2rem 2.2rem; background:linear-gradient(115deg,#f8f4df 0%,#eaf3f7 54%,#d9edfb 100%); }
.profile-quick-actions { display:flex;justify-content:flex-end;gap:1.2rem;height:5.6rem; }
.profile-quick-actions button { width:4.4rem;height:4.4rem;display:grid;place-items:center;border-radius:50%;color:var(--theme-text);background:transparent; }
.profile-quick-actions svg { width:2.8rem;height:2.8rem;fill:currentColor; }
.account-entry { width:100%;min-height:12rem;padding:1.6rem 0;display:flex;align-items:center;gap:1.5rem;text-align:left;background:transparent; }
.account-avatar { flex:none;width:10rem;height:10rem;display:grid;place-items:center; }
.account-avatar svg { width:100%;height:100%;fill:none;stroke:#777873;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round; }
.account-copy { min-width:0;display:grid;gap:.8rem; }
.account-copy strong { color:var(--theme-text);font-size:clamp(2rem,calc(1.3rem + 1.8vw),2.5rem);font-weight:600; }
.account-copy span { color:#909596;font-size:clamp(1.5rem,calc(1.2rem + .9vw),1.8rem); }
.profile-chevron { flex:none;color:#aeb2b4;font-size:3.2rem;font-weight:300;line-height:1; }
.account-entry > .profile-chevron { margin-left:auto; }
.profile-stats { min-height:8.8rem;margin-top:1.1rem;display:grid;grid-template-columns:repeat(3,minmax(0,1fr)); }
.profile-stats > div { min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;text-align:center; }
.profile-stats > div + div { border-left:1px solid rgba(45,58,60,.12); }
.profile-stats strong { max-width:100%;color:var(--theme-text);font-size:clamp(2.2rem,calc(1.1rem + 2.5vw),2.8rem);font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap; }
.profile-stats span { color:#969b9e;font-size:clamp(1.4rem,calc(1.1rem + .9vw),1.7rem); }
.profile-stats small { max-width:100%;overflow:hidden;color:var(--theme-text-muted);font-size:clamp(1rem,calc(.8rem + .6vw),1.2rem);text-overflow:ellipsis;white-space:nowrap; }
.profile-health-stat strong { font-size:clamp(1.6rem,calc(1rem + 1.5vw),2.2rem); }
.profile-health-stat strong[data-status="healthy"] { color:var(--theme-primary-dark); }
.profile-health-stat strong[data-status="outside-range"] { color:var(--theme-health-alert); }
.profile-health-stat strong[data-status="unavailable"] { color:var(--theme-text-muted);font-size:var(--font-body-strong); }
.profile-health-stat #profile-bmi-value { max-width:100%;overflow:hidden;color:var(--theme-text-muted);font-size:clamp(1.6rem,calc(1rem + 1.5vw),2.2rem);font-weight:600;line-height:1.2;text-overflow:ellipsis;white-space:nowrap; }
.profile-health-stat #profile-bmi-value[data-status="healthy"] { color:var(--theme-primary-dark); }
.profile-health-stat #profile-bmi-value[data-status="outside-range"] { color:var(--theme-health-alert); }
.premium-card { min-height:6.8rem;margin:1.5rem 2rem;padding:1.8rem 2rem;display:flex;align-items:center;justify-content:space-between;gap:1.2rem;border-radius:1.7rem;background:#10091d;color:#f5d39c; }
.premium-card > div { min-width:0;display:grid;gap:.8rem; }
.premium-card strong { font-size:clamp(1.6rem,calc(1.2rem + 1.2vw),2rem);font-weight:600; }
.premium-card span { color:#b7a9b9;font-size:clamp(1.2rem,calc(.9rem + .75vw),1.4rem); }
.premium-card button { flex:none;min-height:4rem;padding:0 clamp(1.2rem,2.65vw,1.8rem);border-radius:10px;background:#f4d39e;color:#21192a;font:inherit;font-size:clamp(1.3rem,calc(1rem + .75vw),1.5rem);font-weight:600; }
.profile-menu-group { margin:0 2rem 2rem;overflow:hidden;border-radius:1.5rem;background:var(--theme-surface);box-shadow:var(--theme-shadow-card-subtle); }
.profile-menu-row { width:100%;min-height:7.4rem;padding:0 clamp(1.2rem,2.65vw,1.8rem);display:flex;align-items:center;gap:clamp(.7rem,2vw,1.4rem);border-bottom:1px solid rgba(30,50,60,.045);color:var(--theme-text);text-align:left;text-decoration:none;background:var(--theme-surface); }
.profile-menu-row:last-child { border-bottom:0; }
.profile-menu-row > svg { flex:none;width:2.4rem;height:2.4rem; }
.profile-unit-wheel { z-index:30; }
.profile-unit-wheel .Data_content-item { width:min(100%,34rem); }
.profile-unit-wheel .card { width:100%; }
.profile-menu-row strong { min-width:0;flex:1;font-size:clamp(1.55rem,calc(1.3rem + .75vw),1.8rem);font-weight:500;line-height:1.25;overflow-wrap:anywhere; }
.profile-menu-value { flex:0 1 auto;max-width:38%;overflow:hidden;color:#a2a6a8;font-size:clamp(1.05rem,calc(.85rem + .75vw),1.4rem);text-overflow:ellipsis;white-space:nowrap; }
.profile-menu-value#profile-unit-value { flex:none; min-width:3rem; min-height:2rem; padding:0 .8rem;display:inline-flex;align-items:center;justify-content:center;border-radius:.5rem;background:var(--theme-primary);color:var(--theme-surface);font-size:var(--font-caption); line-height:1; }
.profile-toast { position:fixed;z-index:30;left:50%;bottom:calc(9rem + env(safe-area-inset-bottom));max-width:calc(100vw - 4rem);padding:1rem 1.6rem;border-radius:999px;background:rgba(32,33,36,.86);color:white;font-size:var(--font-label);opacity:0;pointer-events:none;transform:translate(-50%,1rem);transition:opacity .2s,transform .2s; }
.profile-toast.is-visible { opacity:1;transform:translate(-50%,0); }
.profile-login-dialog { position:fixed;inset:auto auto 0 50%;width:min(100vw,68rem);max-width:none;max-height:min(70dvh,58rem);box-sizing:border-box;margin:0;padding:3.2rem 2.4rem calc(2.4rem + env(safe-area-inset-bottom));overflow:visible;border:0;border-radius:2rem 2rem 0 0;background:var(--theme-page);color:var(--theme-text);text-align:center;box-shadow:0 -1rem 4rem rgba(var(--theme-black-rgb),.16);transform:translateX(-50%); }
.profile-login-dialog[open] { animation:profile-login-in .32s cubic-bezier(.22,1,.36,1) both; }
.profile-login-dialog::backdrop { background:rgba(20,24,25,.48); }
@keyframes profile-login-in { from { transform:translate(-50%,100%); } to { transform:translate(-50%,0); } }
.profile-login-close { position:absolute;top:1.5rem;right:1.5rem;width:3.6rem;height:3.6rem;border-radius:50%;background:var(--theme-border-soft);color:var(--theme-text-body);font-size:2.6rem;line-height:1; }

.profile-login-dialog h2 { padding:0;font-size:var(--font-heading);font-weight:600; }
.profile-login-dialog p { margin:.8rem 0 2.2rem;padding:0;color:var(--theme-text-muted);font-size:var(--font-note);line-height:1.5; }
.profile-provider-button { width:100%;min-height:5.4rem;margin:.8rem 0;padding:0 1.6rem;display:flex;align-items:center;justify-content:center;gap:1.1rem;border:1px solid var(--theme-border);border-radius:1.1rem;background:var(--theme-surface);color:var(--theme-text);font:inherit;font-size:var(--font-control);font-weight:500; }
.profile-provider-button > span { font-size:var(--font-value);font-weight:600; }
.profile-provider-button .google-mark { color:#4285f4; }
.profile-provider-x { background:#111;color:white;border-color:#111; }
.profile-login-dialog small { display:block;margin-top:1.4rem;color:var(--theme-text-footnote);font-size:var(--font-caption); }
@media (min-width:700px) {
  .profile-shell { max-width:68rem;margin:0 auto;background:var(--theme-page);box-shadow:var(--theme-shadow-shell); }
  .profile-hero { padding-right:3rem;padding-left:3rem; }
  .premium-card,.profile-menu-group { margin-right:2.5rem;margin-left:2.5rem; }
}
@media (max-width:360px) {
  .profile-menu-row { gap:1rem;padding-right:1.3rem;padding-left:1.3rem; }
  .profile-menu-row strong { font-size:var(--font-control); }
  .profile-menu-value { font-size:var(--font-caption); }
  .premium-card { padding-right:1.4rem;padding-left:1.4rem; }
  .premium-card button { padding:0 1.2rem; }
}
.profile-share-dialog label { display:block;margin-bottom:.6rem;color:var(--theme-text-muted);font-size:var(--font-label);text-align:left; }
.profile-theme-options { display:flex;gap:1rem;margin:0 0 2rem;padding:0;border:0;min-width:0; }
.profile-theme-options legend,.profile-theme-option input { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
.profile-theme-option { position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1.2rem .2rem;border:1px solid var(--theme-border);border-radius:1rem;background:var(--theme-surface);color:var(--theme-text-secondary);font-size:var(--font-label);cursor:pointer; }
.profile-theme-option:has(input:checked) { border-color:var(--theme-primary);background:var(--theme-primary-wash); }
.profile-theme-swatch { width:4.4rem;height:4.4rem;border-radius:50%;display:grid;place-items:center;color:var(--theme-icon-on-color);font-size:2.4rem; }
.profile-theme-swatch[data-color="green"] { background:var(--theme-color-green); }
.profile-theme-swatch[data-color="orange"] { background:var(--theme-color-orange); }
.profile-theme-swatch[data-color="blue"] { background:var(--theme-color-blue); }
.profile-theme-option input:checked + .profile-theme-swatch::after { content:'✓'; }
.profile-theme-option input:focus-visible + .profile-theme-swatch { outline:2px solid var(--theme-text);outline-offset:4px; }
.profile-theme-dialog .app-confirm-actions { grid-template-columns:1fr; }
.profile-theme-dialog button:focus-visible { outline:2px solid var(--theme-primary-dark);outline-offset:2px; }
.profile-share-dialog input { width:100%;min-width:0;box-sizing:border-box;margin-bottom:1.6rem;padding:1rem;border:1px solid var(--theme-border);border-radius:.8rem;background:var(--theme-surface);color:var(--theme-text);font:inherit;font-size:var(--font-control); }
.profile-share-dialog input:focus-visible,.profile-share-dialog button:focus-visible { outline:2px solid var(--theme-primary-dark);outline-offset:2px; }
