/* Profile — compact mobile-first layout (the 2026-09 redesign).
   First view: identity, the goal line, one primary button and (when it applies) a caution line.
   Below it one card with four disclosure rows (Personal details, Health goals, Preferences,
   Data & privacy) that open in place, and a plain "Log out" row. Every button sets its own colours:
   the base `button { color: white }` in app.css would otherwise make light buttons unreadable. */

.pf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pf-muted { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.pf-note { font-size: 13px; color: var(--text-secondary); line-height: 1.45; margin: 4px 0 8px; }
.pf-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 4px 0 0; }
.pf-none { color: var(--text-secondary); font-weight: 500; }
.pf-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 4px; }
.pf-status { font-size: 13px; color: var(--text-primary); margin: 6px 0 0; line-height: 1.45; }
.pf-status:empty { display: none; }

/* ---- first view: who you are (the mascot's slot at the right), the goal, one button ---- */
.pf-top { padding: 12px 14px 14px; margin-bottom: 10px; }
/* The row keeps a 52 px square free at its right end for the one mascot (js/companion.js moves it
   into [data-mascot-anchor="profile"]); no text or control ever sits under it. */
.pf-id { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 52px; }
.pf-id > .mascot-slot { flex: 0 0 52px; min-width: 52px; min-height: 52px; margin-left: auto; }
.pf-avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--accent-light), var(--peach-light)); color: var(--accent-strong); font-family: var(--font-display); font-size: 18px; font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }
.pf-id-text { flex: 1 1 auto; min-width: 0; }
.pf-email { display: block; font-size: 15.5px; font-weight: 800; color: var(--text-primary); overflow-wrap: anywhere; line-height: 1.3; }
.pf-id-text .pf-muted { margin-top: 1px; }
/* The goal: one soft strip under the identity. */
.pf-goal { margin: 10px 0 0; padding: 6px 10px; border-radius: var(--radius-md); background: var(--surface-soft); font-size: 14.5px; color: var(--text-primary); line-height: 1.45; }
.pf-goal:empty { display: none; }
.pf-goal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pf-goal-line b { font-weight: 800; }
.pf-chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: var(--radius-pill); background: var(--accent-light); color: var(--accent-strong); font-size: 12px; font-weight: 800; white-space: nowrap; }
.pf-goal-target { font-size: 13px; color: var(--text-secondary); font-weight: 600; margin-top: 1px; }
.pf-caution { display: flex; align-items: center; gap: 4px 10px; margin: 8px 0 0; padding: 6px 8px 6px 12px; border-radius: var(--radius-md); background: #FFF1DE; color: #6B4300; font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.pf-caution[hidden] { display: none; }
.pf-caution-msg { flex: 1 1 auto; min-width: 0; }
.pf-caution .link-btn { flex: 0 0 auto; margin: 0; padding: 0 8px; color: #6B4300; font-weight: 800; white-space: nowrap; }
.pf-caution .link-btn:hover { background: #FFE3BD; color: #6B4300; }
button.pf-primary { display: block; width: 100%; margin: 10px 0 0; min-height: 46px; border-radius: var(--radius-md); background: var(--accent); color: var(--text-on-accent); font-size: 16px; font-weight: 800; box-shadow: 0 1px 2px rgba(35, 95, 70, 0.18), 0 4px 12px rgba(35, 95, 70, 0.16); }
button.pf-primary:hover { background: var(--accent-strong); }
/* Wide screens: the button sizes to its label instead of spanning the whole card. */
@media (min-width: 700px) { button.pf-primary { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 220px; padding: 0 28px; } }

/* ---- the four sections: one list, compact rows (≈50 px), a tinted icon chip each ---- */
.pf-list { padding: 6px; }
.pf-sec + .pf-sec { margin-top: 1px; }
.pf-sec-h { margin: 0; font-size: inherit; scroll-margin-top: 12px; }
button.pf-sum { min-height: 46px; padding: 4px 10px 4px 8px; gap: 10px; border-radius: var(--radius-md); justify-content: flex-start; background: transparent; }
button.pf-sum:hover { background: var(--surface-soft); filter: none; }
button.pf-sum[aria-expanded="true"] { background: var(--surface-soft); border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
button.pf-sum::after { margin-left: auto; }
.pf-sec + .pf-sec::before { content: ""; display: block; height: 1px; margin: 0 10px 1px 48px; background: var(--line); }
.pf-sum-icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.pf-sum-icon svg { width: 16px; height: 16px; }
.tone-lavender .pf-sum-icon { background: var(--lavender-light); color: var(--lavender-ink); }
.tone-coral .pf-sum-icon { background: var(--coral-light); color: var(--coral-ink); }
.tone-yellow .pf-sum-icon { background: var(--yellow-light); color: var(--yellow-ink); }
.tone-sky .pf-sum-icon { background: var(--sky-light); color: var(--sky-ink); }
.pf-sum-text { display: flex; flex-direction: column; min-width: 0; }
.pf-sum-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; color: var(--text-primary); line-height: 1.25; letter-spacing: -0.005em; }
.pf-sum-help { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* App & updates (js/appUpdate.js): a newer version is said in the section's own line, in the accent. */
.pf-sum.pf-sum-new .pf-sum-help { color: var(--accent-strong); font-weight: 800; }
.pf-app-new { color: var(--text-primary); }
.pf-app-warn { color: #8A4B00; font-weight: 700; }
#pf-app-body .pf-rows { margin: 0 0 6px; }
#pf-app-body .pf-primary.pf-app-get { width: 100%; margin: 4px 0 6px; }
.pf-app-dl progress { display: block; width: 100%; height: 10px; margin: 8px 0 2px; accent-color: var(--accent); }
#pf-app-body .link-btn.pf-app-alt { display: inline; min-height: 0; padding: 0; font-size: inherit; vertical-align: baseline; }
@media (pointer: coarse) { #pf-app-body .link-btn.pf-app-alt { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; } }
.pf-body { padding: 2px 8px 8px; }

.pf-group { padding: 10px 2px 12px; }
.pf-group + .pf-group { border-top: 1px solid var(--line); }
.pf-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.pf-group-head h3 { margin: 0; font-family: var(--font-display); font-size: 14.5px; font-weight: 800; color: var(--text-primary); }
button.pf-edit { margin: 0; min-height: 36px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--accent-light); color: var(--accent-strong); font-size: 14px; font-weight: 800; flex-shrink: 0; box-shadow: none; }
button.pf-edit:hover { background: color-mix(in srgb, var(--accent-light) 60%, var(--accent-2)); color: var(--accent-strong); }

.pf-rows { margin: 4px 0 0; }
.pf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.pf-row:last-child { border-bottom: 0; }
.pf-row dt { font-size: 13px; color: var(--text-secondary); }
.pf-row dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-primary); text-align: right; overflow-wrap: anywhere; }
.pf-weight { font-size: 13px; color: var(--text-primary); margin: 6px 0 0; line-height: 1.45; }
.pf-weight:empty { display: none; }
.pf-link { display: inline-flex; align-items: center; margin-top: 4px; font-size: 13.5px; text-align: left; }

.pf-safety { margin: 6px 0 4px; padding: 10px 12px; border-radius: var(--radius-md); background: #FFF1DE; color: #4F3300; scroll-margin-top: 12px; }
.pf-safety:focus { outline: none; }
.pf-safety:focus-visible { outline: 3px solid #B26A00; outline-offset: 2px; }
.pf-safety h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 800; color: #6B4300; }
.pf-safety-lead { margin: 0 0 4px; font-size: 13.5px; font-weight: 800; }
.pf-safety ul { list-style: disc; margin: 4px 0 6px; padding-left: 18px; }
.pf-safety li { display: list-item; border-top: 0; padding: 2px 0; font-size: 13.5px; line-height: 1.45; }
.pf-safety .pf-muted { color: #6B4300; }

/* targets */
#pf-targets .goal-mode-toggle { margin-top: 6px; }
#pf-targets .goal-mode-btn:hover:not(.active), #pf-targets .eb-btn:hover:not(.active) { background: var(--accent-light); color: var(--text-primary); }
#pf-targets .pf-note { margin-bottom: 4px; }
.pf-target-rows { margin-bottom: 4px; }
#pf-targets .goals-grid { margin-top: 8px; }
.pf-field { min-width: 0; }
.goals-grid .pf-field:first-child { grid-column: 1 / -1; } /* calories + its caution get the full width */
.pf-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-height: 20px; }
.goals-grid .pf-field-head label { display: inline; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.pf-saved { font-size: 12px; font-weight: 800; color: var(--accent-strong); white-space: nowrap; }
.pf-saved:empty { display: none; }
.pf-eb-head { margin: 12px 0 0; }
.pf-eb-head .pf-label { margin: 0; }
#goal-calorie-warning { margin: 6px 0 4px; padding: 6px 10px; border-radius: 10px; background: #FFF1DE; color: #6B4300; font-size: 12.5px; }
#goal-calorie-warning:focus { outline: none; }
#goal-supervised-wrap { font-size: 12.5px; color: var(--text-primary); }
.pf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.pf-why { margin: 8px 0 4px; padding: 6px 12px 8px; border-radius: var(--radius-md); background: var(--surface-soft); }
.pf-why .pf-rows { margin: 0; }
.pf-why p { margin: 4px 0 0; }
.pf-history { margin-top: 8px; }
button.pf-sub-disc { margin-top: 8px; font-size: 14px; }

/* buttons on the light card */
button.pf-btn { margin: 0; min-height: 40px; padding: 6px 14px; border-radius: 12px; border: 0; box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); color: var(--text-primary); font-size: 14px; font-weight: 700; }
button.pf-btn:hover { background: var(--accent-light); color: var(--text-primary); }
button.pf-btn[hidden] { display: none; }
button.pf-btn-main { background: var(--accent); box-shadow: none; color: var(--text-on-accent); }
button.pf-btn-main:hover { background: var(--accent-strong); color: var(--text-on-accent); }
button.pf-btn.pf-danger { color: #A4231B; box-shadow: inset 0 0 0 1px #EBC0BB; }
button.pf-btn.pf-danger:hover { background: #FDECEA; color: #A4231B; }
button.pf-btn.pf-danger-solid { background: #B3261E; box-shadow: none; color: #fff; }
button.pf-btn.pf-danger-solid:hover { background: #8E1C16; color: #fff; }
button.pf-btn:disabled { opacity: 0.6; cursor: default; }
#admin-dashboard-btn { margin-top: 8px; }
.pf-confirm { margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-md); background: #FDECEA; color: #5C1712; }
.pf-confirm p { margin: 0 0 4px; font-size: 13.5px; line-height: 1.45; }
form.pf-form { display: block; margin: 8px 0 0; }
.pf-form input:not([type="checkbox"]), .pf-form select { width: 100%; }
.pf-form .pf-label:first-of-type { margin-top: 0; }

.pf-sources { margin: 4px 0 0; }
.pf-sources li { font-size: 13.5px; padding: 7px 0; align-items: flex-start; }
.pf-sources li span:first-child { font-weight: 700; color: var(--text-primary); min-width: 0; }
.pf-sources li span:last-child { text-align: right; color: var(--text-secondary); font-size: 12.5px; min-width: 0; max-width: 58%; }
#pf-ai-status { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-soft); font-size: 13px; font-weight: 600; }
.pf-advanced { padding: 6px 2px 0; }
.pf-bullets { list-style: disc; margin: 4px 0 4px; padding-left: 18px; }
.pf-bullets li { display: list-item; border-top: 0; padding: 2px 0; font-size: 13px; color: var(--text-primary); }
.pf-build { margin: 4px 0 0; font-size: 11.5px; }
.pf-build:empty { display: none; }

.pf-list > .pf-logout { position: relative; }
.pf-list > .pf-logout::before { content: ""; position: absolute; top: -3px; left: 10px; right: 10px; height: 1px; background: var(--line); }
button.pf-logout { display: flex; align-items: center; width: 100%; margin: 4px 0 0; min-height: 46px; padding: 0 12px; border-radius: var(--radius-md);
  background: transparent; color: var(--text-secondary); font-size: 14.5px; font-weight: 700; text-align: left; box-shadow: none; }
button.pf-logout:hover { background: var(--surface-soft); color: var(--text-primary); }

/* Preferences › How DHUT looks (rendered by js/adaptive/adaptiveApp.js) */
.pf-look .adp-sub { margin: 14px 0 6px; font-size: 13.5px; font-weight: 800; color: var(--text-primary); }
.pf-look .adp-sub:first-child { margin-top: 6px; }
.pf-look .adp-loc { font-size: 13.5px; margin: 0 0 6px; }
.pf-look .adp-loc .aw-muted { font-size: 13.5px; }
.pf-look .adp-field > span { font-size: 12.5px; }
.pf-look .aw-muted { line-height: 1.45; }
button.adp-preview-toggle { margin-top: 14px; font-size: 14px; }
.adp-preview-box { padding: 8px 0 0; }
.adp-preview-box .aw-muted { margin-top: 6px; }
#tab-profile .install-app-row { margin: 4px 0 6px; }
#tab-profile .install-app-row .pf-note { margin: 2px 0 0; }

#tab-profile button:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }

/* phones: tap targets (the base rules give every button 44 px; these small ones too) */
@media (pointer: coarse) {
  button.pf-edit, button.pf-btn { min-height: 44px; }
  .pf-link { min-height: 44px; }
}
@media (max-width: 380px) {
  .pf-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px; }
  .pf-sum-help { font-size: 12px; }
}
/* motion: nothing here animates except the disclosure arrow — and not even that when reduced */
@media (prefers-reduced-motion: reduce) { #tab-profile *, #tab-profile *::after { transition: none !important; } }
html[data-motion="reduced"] #tab-profile *, html[data-motion="reduced"] #tab-profile *::after,
html[data-motion="off"] #tab-profile *, html[data-motion="off"] #tab-profile *::after { transition: none !important; }
