/* Profile pages, one look on web, iPhone and iPad (audits/profile-ui-consistency-2026-11-15.md).
   The app is the reference (SpossityMain.js profileMenu* / toggleRow styles and NativeProfileDetails):
   - Rows and actions are list rows: left-aligned label, hairline divider, no fill.
   - Inputs and choice chips are the one raised control: radius 14, min 48px, token border and fill.
   - Selected = controls.selection (violet). Text from the text tokens.
   Loaded after every other web stylesheet; scoped to the Profile menu and its pages. */
:root {
  --pf-ink: #0b285b; --pf-soft: #52698f; --pf-link: #2167f5;
  --pf-divider: rgba(11, 40, 91, .13);
  --pf-control-fill: rgba(255, 255, 255, .6); --pf-control-border: #cbdcf4;
  --pf-selected-fill: #7836ef; --pf-selected-border: #9b6cff;
  --pf-hover: rgba(33, 103, 245, .06);
  --pf-danger: #b42332;
}
html[data-theme="dark"]:root {
  --pf-ink: #f5f8ff; --pf-soft: #9fb4d2; --pf-link: #397cff;
  --pf-divider: rgba(133, 177, 239, .17);
  --pf-control-fill: #081729; --pf-control-border: #38577e;
  --pf-selected-fill: #7656c8; --pf-selected-border: #9b6cff;
  --pf-hover: rgba(133, 177, 239, .08);
  --pf-danger: #ffb2bc;
}

/* Type scale (app: section 9 · menu title 13 / note 10.5 · page title 17 · detail text 14 / note 12). */
html:root body .profile-menu-panel.profile-menu-panel .profile-menu-label,
html:root body .profile-settings-panel.profile-settings-panel .profile-menu-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1.55px; text-transform: uppercase; color: var(--pf-soft);
}
html:root body .profile-menu-panel.profile-menu-panel .profile-menu-copy strong { font-size: 13px; font-weight: 700; letter-spacing: -.12px; color: var(--pf-ink); }
html:root body .profile-menu-panel.profile-menu-panel .profile-menu-copy small { font-size: 10.5px; line-height: 14px; color: var(--pf-soft); }
html:root body .profile-settings-panel.profile-settings-panel .profile-detail-heading { font-size: 17px; font-weight: 800; line-height: 1.15; color: var(--pf-ink); }
html:root body .profile-settings-panel.profile-settings-panel .profile-settings-back { font-size: 13px; font-weight: 700; color: var(--pf-link); }
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-detail-intro, .profile-setting-note, .profile-scope-note, .profile-invite-empty, .profile-settings-account > span, .profile-settings-status) {
  font-size: 12px; line-height: 18px; color: var(--pf-soft);
}
html:root body .profile-settings-panel.profile-settings-panel .profile-detail-intro { margin: 4px 0 12px; }

/* Rows inside a page (Settings, Profile, Security, Invite, Block, toggles). */
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-menu-item, .profile-setting-row) {
  min-height: 54px; border: 0; border-bottom: 1px solid var(--pf-divider); border-radius: 0;
  background: transparent; box-shadow: none; color: var(--pf-ink);
}
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-menu-copy, .profile-setting-row) strong { font-size: 14px; font-weight: 700; color: var(--pf-ink); }
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-menu-copy, .profile-setting-row) small { font-size: 12px; line-height: 18px; color: var(--pf-soft); }
html:root body .profile-settings-panel.profile-settings-panel .profile-menu-meta { color: var(--pf-soft); background: transparent; }

/* Actions (Choose photo, Save, Sign out of other devices…): the app's action row. */
html:root body .profile-settings-panel.profile-settings-panel .profile-security-action {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 48px; margin: 0;
  padding: 0 8px; border: 0; border-bottom: 1px solid var(--pf-divider); border-radius: 0; box-shadow: none;
  background: transparent; color: var(--pf-ink); font: inherit; font-size: 14px; font-weight: 700; text-align: left; text-decoration: none;
}
html:root body .profile-settings-panel.profile-settings-panel .profile-security-action.profile-delete-action { color: var(--pf-danger); }
html:root body .profile-settings-panel.profile-settings-panel .profile-security-action:disabled { opacity: .5; cursor: default; }
@media (hover: hover) {
  html:root body .profile-settings-panel.profile-settings-panel :is(.profile-security-action, .profile-menu-item, .profile-setting-row):not(:disabled):hover {
    background: var(--pf-hover); border-radius: 10px; translate: none; box-shadow: none;
  }
}

/* The one raised control: inputs, choice chips, relationship chips. */
html:root body .profile-settings-panel.profile-settings-panel :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), textarea, select) {
  min-height: 48px; padding: 12px; border: 1px solid var(--pf-control-border); border-radius: 14px;
  background: var(--pf-control-fill); color: var(--pf-ink); font-size: 15px; box-shadow: none;
}
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-choice-grid button, .profile-invite-relationships span) {
  min-height: 48px; border: 1px solid var(--pf-control-border); border-radius: 14px;
  background: var(--pf-control-fill); color: var(--pf-ink); font-size: 14px; font-weight: 700; box-shadow: none;
}
html:root body .profile-settings-panel.profile-settings-panel :is(.profile-choice-grid button[aria-pressed="true"], .profile-invite-relationships input:checked + span) {
  border-color: var(--pf-selected-border); background: var(--pf-selected-fill); color: #fff;
}
html:root body .profile-settings-panel.profile-settings-panel .profile-invite-relationships legend { font-size: 12px; color: var(--pf-soft); }

/* The person you picked: plain on the page, like the app (no extra card). */
html:root body .profile-settings-panel.profile-settings-panel .profile-invite-selected { padding: 0; border-radius: 0; background: transparent; color: var(--pf-ink); }
html:root body .profile-settings-panel.profile-settings-panel .profile-invite-selected-person { font-size: 14px; color: var(--pf-ink); }

/* The one primary button on a page (Send invitation, Block, Confirm): app size. */
html:root body .profile-settings-panel.profile-settings-panel .profile-invite-send { min-height: 48px; border-radius: 14px; font-size: 14px; font-weight: 800; }

/* The Profile dialog takes focus when it opens; it needs no outline of its own. */
html:root body .home-profile-popover-content:is(:focus, :focus-visible) { outline: none !important; box-shadow: none !important; }

/* "1 Keep Up · 0 Keeping Up" on one line in the link blue, as in the app. */
html:root body .profile-menu-panel .profile-menu-identity small,
html:root body .profile-menu-panel .profile-menu-identity small :is(button, span) {
  display: inline; margin: 0; color: var(--pf-link) !important; font-size: 11px; font-weight: 700;
}
html:root body .profile-menu-panel .profile-menu-identity small { display: block; margin-top: 5px; }

/* Phones and tablets: the Profile panel opens below the top bar, as in the app. */
@media (max-width: 1100px) {
  body.is-logged-in .home-profile-popover-content {
    max-height: calc(100svh - 174px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  }
}
/* Dark mode: the Keep Ups line is violet, as in the app. */
html[data-theme="dark"]:root body .profile-menu-panel .profile-menu-identity small,
html[data-theme="dark"]:root body .profile-menu-panel .profile-menu-identity small :is(button, span) { color: #9b6cff !important; }

/* Profile panel matches the app: one even card colour, readable counts, and on iPad the app's size and position. */
html[data-theme="dark"] body.is-logged-in .home-profile-popover .profile-menu-identity { background: transparent !important; }
html:root body .home-profile-popover .profile-menu-meta { font-size: 10px; font-weight: 800; }
html[data-theme="dark"]:root body .home-profile-popover .profile-menu-meta { color: #9fb4d2; }
html[data-tablet-scale]:not([data-tablet-scale=""]) body .home-profile-popover > .home-profile-popover-content { top: 123px; right: 34px; bottom: 108px; left: 34px; width: auto; height: auto; max-height: none; }
html[data-tablet-scale]:not([data-tablet-scale=""]) body .home-profile-popover > .home-profile-popover-content > * { zoom: var(--profile-zoom, 1); }
