/* Existing account and PIN controls, using the v2 surface and theme tokens. */
:root { --ink:var(--text); --blue:var(--accent); }
:root[data-polar-accent=blue] { --accent:#9ebdff; --accent-soft:#9ebdff18; --blue:var(--accent); }
:root[data-polar-accent=violet] { --accent:#c5acff; --accent-soft:#c5acff18; --blue:var(--accent); }
:root[data-theme=light][data-polar-accent=blue] { --accent:#3266d5; }
:root[data-theme=light][data-polar-accent=violet] { --accent:#7950bd; }
.profile-shell { --blue:var(--accent); --ink:var(--text); }
.profile-shell .page-title {display:flex;align-items:center;gap:12px;margin:16px 0 24px;}
.profile-shell .page-title h1 {font-size:25px;line-height:1.2;margin:0;letter-spacing:-.6px;}
.profile-shell .page-title p {font-size:12px;font-weight:400;margin:6px 0 0;color:var(--muted);}
.profile-shell .back {width:38px;height:38px;flex:none;border-radius:50%;background:var(--surface);display:grid;place-items:center;}
.profile-shell .back svg {width:20px;height:20px;}
.profile-shell .back span {display:none;}
.profile-shell .panel {padding:22px 18px;border:1px solid var(--line);background:var(--surface);border-radius:var(--radius);}
.profile-settings-grid {grid-template-columns:1fr;gap:16px;}
.profile-shell .profile-identity {background:radial-gradient(ellipse at 45% 0,var(--accent-soft),transparent 75%),var(--surface);border-color:var(--line);}
.profile-shell .profile-wallet-id,.profile-shell .profile-save,.profile-shell .profile-recovery-code {background:var(--surface-2);}
.profile-shell .profile-wallet-id code {color:var(--text);}
.profile-shell .profile-upload {border-color:var(--surface);}
.profile-shell p,.profile-shell small {color:var(--muted);}
.profile-shell small {display:block;}
.profile-shell .profile-section>label:not(.profile-setting) {display:block;}
.profile-shell input:not([type=checkbox]):not([type=radio]):not([type=file]),.profile-shell select {width:100%;background:var(--bg-elev);color:var(--text);border:1px solid var(--line);border-radius:13px;padding:13px 14px;margin-top:8px;min-height:48px;font:inherit;font-size:16px;}
.profile-shell .primary,.profile-shell .secondary {display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:50px;padding:14px 18px;margin-top:16px;border-radius:16px;font-size:14px;font-weight:650;}
.profile-shell .primary {background:var(--accent);color:var(--accent-ink);}
.profile-shell .secondary {background:var(--surface-2);color:var(--text);}
.profile-shell .primary:disabled {opacity:.45;cursor:default;}
.profile-shell .secondary svg {width:20px;height:20px;}
.profile-shell .text-button {font-size:13px;color:var(--accent);padding:8px;}
.profile-shell .profile-signout {color:var(--bad);}
.profile-shell .profile-save {flex-direction:column;align-items:stretch;text-align:center;}
.profile-shell .profile-save .primary {margin:0;width:100%;min-width:0;}
.profile-shell .profile-form .muted {line-height:1.7;}
.profile-shell .notice.error {padding:14px;border-radius:14px;background:var(--bad-soft);color:var(--bad);font-size:13px;margin:12px 0;}
.profile-shell .profile-lock .profile-pin-input {font-size:28px;}
.profile-shell .profile-form .primary {margin-top:24px;}
.profile-shell .profile-recovery-ack {color:var(--text);}
.profile-shell .profile-recovery-code {border-color:var(--accent);}
.profile-shell .profile-row small {line-height:1.6;}
.profile-shell .profile-accents {min-width:0;}
.profile-shell .profile-info-line strong {overflow-wrap:anywhere;}
.polar-large-text .body strong,.polar-large-text .hello strong {font-size:17px;}
.polar-large-text .body small,.polar-large-text .tabbar button {font-size:13px;}
.profile-reduced-motion .hero {transform:none!important;}

/* Collapsible sections (v2 only; classic keeps the full form). */
.profile-page > .page-title .back { display: none; }
.profile-shell .profile-section.collapsible { padding-block: 16px; }
.profile-shell .profile-section.collapsible > .profile-section-heading { cursor: pointer; margin-bottom: 0; align-items: center; user-select: none; }
.profile-shell .profile-section.collapsible > .profile-section-heading > div { flex: 1; }
.profile-shell .section-chev { width: 18px; height: 18px; color: var(--faint); transition: transform .25s; flex: none; }
.profile-shell .profile-section.open .section-chev { transform: rotate(90deg); color: var(--accent); }
.profile-shell .profile-section.collapsible:not(.open) > :not(.profile-section-heading) { display: none; }
.profile-shell .profile-section.open > .profile-section-heading { margin-bottom: 16px; }
.profile-shell .profile-wallet-id { flex-wrap: wrap; }
.profile-shell .profile-wallet-id button { color: var(--accent); }
.profile-id-hint { display: block; width: 100%; order: 3; font-size: 12px; color: var(--muted); }
/* Save bar appears only with unsaved changes and floats above the tab bar. */
.profile-shell .profile-save { display: none; }
.profile-shell .profile-save.dirty {
  display: flex; position: sticky; bottom: calc(86px + var(--safe-bottom)); z-index: 5;
  background: var(--bg-elev); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); border-radius: 20px; padding: 12px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: rise .3s cubic-bezier(.2, .9, .25, 1);
}
.profile-shell .profile-section-heading > svg.section-chev { width: 18px; height: 18px; padding: 0; background: none; border-radius: 0; color: var(--faint); }
.profile-shell .profile-section.open .profile-section-heading > svg.section-chev { color: var(--accent); }
/* Wallet ID: text on the left, copy and QR side by side on the right. */
.profile-shell .profile-wallet-id { grid-template-columns: 1fr 40px 40px; }
.profile-shell .profile-wallet-id small, .profile-shell .profile-wallet-id code, .profile-shell .profile-id-hint { grid-column: 1; }
.profile-shell .profile-wallet-id button { grid-row: 1 / 4; width: 40px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.profile-shell .profile-wallet-id button + button { grid-column: 3; }
.profile-shell .profile-wallet-id button:hover { background: var(--surface-2); }
.profile-shell .profile-save.dirty { flex-direction: row; align-items: center; text-align: left; gap: 12px; }
.profile-shell .profile-save.dirty #profile-save-status { flex: 1; font-size: 13px; }
.profile-shell .profile-save.dirty .primary { width: auto; padding-inline: 20px; }
