/* Profile, Settings, Accent and the profile switcher (screens/profile.js).
   The app draws these as a system inset-grouped Form on the grouped page
   (Surface.page #000 / #F2F2F7, cards #1C1C1E / #FFFFFF, Surfaces.swift).
   Measured on app/37, 38, 45 (402pt, iOS 26.5): cards 16 in, corner 26,
   rows 52 (73 with a 44pt avatar), icon slot 24 then text at 56, sections
   36 apart, caption-caps headers 16 in. */
[data-screen="profile"], [data-screen="settings"], [data-screen="accent"] {
  --bg: #000; --card: #1c1c1e; --card2: #2c2c2e;
  --pf-track: rgba(120, 120, 128, 0.32);   /* iOS switch track, off */
  --pf-seg-bg: rgba(118, 118, 128, 0.24);  /* iOS segmented control in a grouped cell */
  --pf-seg-on: #636366;
  --knock: var(--card);
}
@media (prefers-color-scheme: light) {
  [data-screen="profile"], [data-screen="settings"], [data-screen="accent"] {
    --bg: #f2f2f7; --card: #fff; --card2: #f2f2f7;
    --pf-track: rgba(120, 120, 128, 0.16);
    --pf-seg-bg: rgba(118, 118, 128, 0.12);
    --pf-seg-on: #fff;
  }
}

.pf-sec { margin-top: 36px; }
.pf-sec.pf-first { margin-top: 0; }
.pf-first > .pf-head { padding-top: 17px; }
.app .pf-head { display: flex; align-items: center; min-height: 16px; padding: 0 16px 10px; font: 500 12.5px/16px var(--text); letter-spacing: 0.05em; text-transform: uppercase; color: var(--sub); }
.app .pf-info { display: grid; place-items: center; width: 30px; height: 30px; margin: -7px 0 -7px 4px; color: var(--sub); }
.pf-info .i { width: 17px; height: 17px; stroke-width: 1.5; }
.pf-foot { padding: 7px 16px 0; color: var(--sub); font-size: var(--t-foot); line-height: 1.35; letter-spacing: -0.005em; }

.pf-card { position: relative; overflow: hidden; border-radius: 26px; background: var(--card); }
.pf-card > * { position: relative; }
/* The separator under a row starts where that row's words start (56; 72 under the avatar row; 16 under a cell). */
.pf-card > :not(:last-child)::after { content: ""; position: absolute; left: var(--sep, 56px); right: 16px; bottom: 0; height: 1px; background: var(--line); transform: scaleY(0.5); transform-origin: 0 100%; pointer-events: none; }
.app .pf-row { display: flex; align-items: center; width: 100%; min-height: 52px; padding: 0 16px; font-size: var(--t-body); line-height: 1.29; text-align: left; transition: background-color var(--press), opacity var(--press); }
.app .pf-row.is-pressed { opacity: 1; background: var(--card2); }
.pf-glyph { flex: none; width: 24px; height: 24px; margin-right: 16px; color: var(--acc-ink); }
.pf-t { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 11px 0; }
.pf-t small { margin-top: 2px; color: var(--sub); font-size: var(--t-cap); }
.pf-plain { --sep: 16px; }
.pf-plain .pf-glyph { color: var(--ink); }
.pf-plain .pf-glyph + .pf-t { }
.pf-accent .pf-label { color: var(--acc-ink); }
.pf-destructive .pf-label, .pf-destructive .pf-glyph { color: var(--red); }
.pf-chev { flex: none; margin-left: 8px; color: var(--faint); line-height: 0; }
.pf-chev .i { width: 15px; height: 15px; stroke-width: 2.5; }
.pf-value { flex: none; margin-left: 8px; color: var(--sub); }

/* The profile's row: its 44pt avatar, the name in headline. */
.app .pf-me { --sep: 72px; min-height: 73px; }
.pf-avatar { flex: none; width: 44px; height: 44px; margin-right: 12px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.pf-name { font-weight: 600; }

/* YOUR PHOTO: the photo (220 tall, fitted), the tonal Take Selfie, Crop & Zoom. */
.pf-cell { --sep: 16px; padding: 15px 16px; }
.app .pf-photo { display: flex; justify-content: center; width: 100%; height: 220px; overflow: hidden; border-radius: var(--r-card); transition: opacity var(--press); }
.pf-photo img { height: 100%; width: auto; max-width: 100%; object-fit: cover; object-position: 50% 15%; }
.app .pf-tonal { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 16px; border-radius: var(--r-card); background: var(--fill-strong); font-size: var(--t-body); font-weight: 600; transition: opacity var(--press); }
.pf-tonal .i { width: 24px; height: 24px; }

/* YOUR AVATAR: the fact grid, three to a row, caption over a menu. */
.pf-card-facts { padding: 15px 16px 16px; }
.pf-facts { display: grid; gap: 16px; }
.pf-facts-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pf-fact { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pf-cap { font: 500 12px/16px var(--text); letter-spacing: 0.05em; text-transform: uppercase; color: var(--sub); }
.app .pf-fact-v { display: inline-flex; align-items: baseline; gap: 4px; min-height: 22px; color: var(--sub); font-size: var(--t-sub); font-weight: 600; font-variant-numeric: tabular-nums; transition: opacity var(--press); }
.app .pf-fact-v.is-set { color: var(--acc-ink); }
.pf-updown { width: 11px; height: 11px; stroke-width: 2.4; color: var(--faint); align-self: center; }

/* The demo's own section: apart, quiet. */
.pf-sec.pf-demo { margin-top: 56px; }
.pf-demo .pf-card { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.pf-demo .pf-foot { line-height: 1.4; }

/* The ⓘ popover (InfoBubble, 268 wide). */
.pf-pop { position: absolute; z-index: 50; padding: 12px 14px; border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: inset 0 0 0 0.5px var(--glass-rim), 0 12px 32px rgba(0, 0, 0, 0.3); color: var(--ink); opacity: 0; transform: scale(0.9); transition: opacity 0.16s ease-out, transform 0.22s cubic-bezier(0.3, 1.25, 0.5, 1); pointer-events: auto; }
.pf-pop.is-on { opacity: 1; transform: none; }
.pf-pop b { display: block; margin-bottom: 4px; font-size: var(--t-sub); font-weight: 600; }
.pf-pop p { font-size: var(--t-sub); line-height: 1.33; color: var(--sub); }

/* Settings: the switch, the segmented control, the accent capsule. */
.pf-switch { position: relative; flex: none; width: 51px; height: 31px; margin-left: 8px; border-radius: 16px; background: var(--pf-track); }
.pf-switch i { position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); }
.pf-cell-seg { padding: 8px 16px; }
.pf-seg { display: flex; height: 32px; padding: 2px; border-radius: 9px; background: var(--pf-seg-bg); }
.app .pf-seg button { flex: 1; display: grid; place-items: center; border-radius: 7px; font-size: 13px; font-weight: 500; letter-spacing: 0; }
.app .pf-seg button[aria-current] { background: var(--pf-seg-on); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.pf-capsule { flex: none; width: 34px; height: 20px; margin-right: 12px; border-radius: 10px; box-shadow: inset 0 0 0 0.5px rgba(var(--halo-rgb), 0.18); }

/* Accent: the sample, the nine rows. */
.ac-sample { display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.ac-chip { padding: 7px 12px; border-radius: 999px; background: var(--acc); color: var(--on-acc); font-size: var(--t-foot); font-weight: 500; }
.ac-check { width: 24px; height: 24px; color: var(--acc-ink); --knock: var(--on-acc); }
.ac-link { color: var(--acc-ink); font-size: var(--t-foot); }
.app .ac-row { --sep: 72px; min-height: 52px; }
.ac-swatch { flex: none; width: 44px; height: 26px; margin-right: 12px; border-radius: 13px; box-shadow: inset 0 0 0 0.5px rgba(var(--halo-rgb), 0.18); }
.ac-row.is-on .ac-swatch { outline: 2px solid var(--ink); outline-offset: 3px; }
.ac-row.is-on .pf-label { font-weight: 600; }
.ac-tick { flex: none; width: 20px; height: 18px; stroke-width: 2.6; color: var(--acc-ink); opacity: 0; }
.ac-row.is-on .ac-tick { opacity: 1; }

/* The profile switcher sheet: two columns of discs, the current one ringed in the accent. */
.pp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding: 12px 0; }
.pp-tile { position: relative; min-width: 0; }
.app .pp-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; transition: opacity var(--press); }
.app .pp-pick.is-pressed { opacity: 0.6; }
.pp-disc { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 8px; border-radius: 50%; }
.pp-disc img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.is-current .pp-disc { box-shadow: inset 0 0 0 3px var(--acc); }
.pp-check { position: absolute; right: 4px; bottom: 4px; line-height: 0; color: var(--acc); --knock: var(--on-acc); }
.pp-check .i { width: 30px; height: 30px; }
.pp-check .i .k { stroke-width: 2.4; }
.pp-add { display: grid; place-items: center; }
.pp-add::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px dashed var(--sub); }
.pp-add .i { width: 42px; height: 42px; stroke-width: 1.7; color: var(--sub); }
.pp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-cap); line-height: 1.25; color: var(--ink); letter-spacing: 0; }
.app .pp-more { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--x-bg); color: #fff; }
.pp-more .i { width: 22px; height: 22px; }
