/* ── Consumer account: sign-in + preferences hub ─────────────────────────────
   iOS-Settings-inspired: grouped cards, real toggles, generous spacing. Built to
   scale — add a new <section class="acct-group"> or a new .acct-row and it fits. */

.acct-wrap { max-width: 640px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 32px) 96px; }

/* ── Auth screens (login · check inbox · expired) ── */
.acct-auth { max-width: 460px; margin: clamp(8px, 4vw, 40px) auto 0; text-align: center; }
.acct-auth-icon { width: 60px; height: 60px; margin: 0 auto 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; color: rgb(var(--accent-blue));
  background: color-mix(in srgb, rgb(var(--accent-blue)) 14%, transparent);
  border: 1px solid color-mix(in srgb, rgb(var(--accent-blue)) 26%, transparent); }
.acct-auth-icon.is-warn { color: rgb(var(--accent-amber)); background: color-mix(in srgb, rgb(var(--accent-amber)) 14%, transparent); border-color: color-mix(in srgb, rgb(var(--accent-amber)) 26%, transparent); }
.acct-auth h1 { font-size: clamp(1.7rem, 4vw, 2.1rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.acct-auth p { color: var(--text2); line-height: 1.6; margin: 0 auto 18px; max-width: 40ch; }
.acct-auth-tip { font-size: .88rem; color: var(--muted); }
.acct-auth-legal { font-size: .8rem; color: var(--muted); margin-top: 20px; }
.acct-auth-form { display: flex; flex-direction: column; gap: 14px; margin: 26px 0 6px; text-align: left; }
.acct-field span { display: block; font-size: .82rem; font-weight: 600; color: var(--text2); margin-bottom: 7px; }
.acct-field input { width: 100%; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; color: var(--text); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.acct-field input:focus { outline: none; border-color: rgb(var(--accent-blue)); box-shadow: 0 0 0 3px color-mix(in srgb, rgb(var(--accent-blue)) 18%, transparent); }
.acct-submit { width: 100%; justify-content: center; margin-top: 4px; }
.acct-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ── Hub header (identity) ── */
.acct-hub-head { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(28px, 5vw, 40px); }
.acct-avatar { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #04140a; /* token-ok */
  background: linear-gradient(150deg, rgb(var(--accent-green)), rgb(var(--accent-teal))); }
.acct-hub-id { flex: 1 1 auto; min-width: 0; }
.acct-hub-name { font-size: clamp(1.4rem, 3.4vw, 1.8rem); font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-hub-email { color: var(--muted); font-size: .92rem; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-signout { flex: 0 0 auto; align-self: flex-start; font-size: .88rem; font-weight: 600; color: rgb(var(--accent-blue)); text-decoration: none; padding: 6px 4px; }
.acct-signout:hover { text-decoration: underline; }

/* ── Groups & cards (iOS Settings) ── */
.acct-group { margin-bottom: clamp(26px, 4vw, 38px); }
.acct-group-title { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px 4px; }
.acct-group-note { font-size: .82rem; color: var(--muted); margin: 12px 4px 0; line-height: 1.5; }
.acct-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }

.acct-row { display: flex; align-items: center; gap: 20px; padding: 18px 20px; }
.acct-row + .acct-row { border-top: 1px solid var(--border); }
.acct-row-text { flex: 1 1 auto; min-width: 0; }
.acct-row-text h3 { font-size: 1rem; font-weight: 600; margin: 0 0 3px; color: var(--text); }
.acct-row-text p { font-size: .86rem; color: var(--text2); line-height: 1.5; margin: 0; }
.acct-row-control { flex: 0 0 auto; display: flex; align-items: center; }

.acct-row-value { color: var(--muted); font-size: .92rem; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row-link { font-size: .92rem; font-weight: 600; color: rgb(var(--accent-blue)); text-decoration: none; white-space: nowrap; }
.acct-row-link:hover { text-decoration: underline; }

.acct-inline-input { width: min(220px, 46vw); box-sizing: border-box; text-align: right; background: transparent; border: 1px solid transparent;
  border-radius: 9px; padding: 8px 10px; color: var(--text); font-size: .95rem; transition: border-color .15s, background .15s; }
.acct-inline-input::placeholder { color: var(--muted); }
.acct-inline-input:hover { border-color: var(--border); }
.acct-inline-input:focus { outline: none; text-align: left; background: var(--bg); border-color: rgb(var(--accent-blue)); }

/* ── iOS-style toggle ── */
.acct-switch { position: relative; display: inline-block; width: 52px; height: 31px; flex: 0 0 auto; }
.acct-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.acct-knob { position: absolute; inset: 0; border-radius: 999px; background: var(--border2); transition: background .22s ease; }
.acct-knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); transition: transform .22s ease; /* token-ok */ }
.acct-switch input:checked + .acct-knob { background: var(--green); /* token-ok */ }
.acct-switch input:checked + .acct-knob::after { transform: translateX(21px); }
.acct-switch input:focus-visible + .acct-knob { box-shadow: 0 0 0 3px color-mix(in srgb, rgb(var(--accent-green)) 26%, transparent); }

/* ── Danger row ── */
.acct-row.is-danger h3 { color: rgb(var(--accent-red, 248,81,73)); }
.acct-danger-btn { background: transparent; border: 1px solid color-mix(in srgb, rgb(var(--accent-red, 248,81,73)) 40%, var(--border));
  color: rgb(var(--accent-red, 248,81,73)); font-weight: 600; font-size: .9rem; border-radius: 10px; padding: 9px 16px; cursor: pointer; transition: background .15s; }
.acct-danger-btn:hover { background: color-mix(in srgb, rgb(var(--accent-red, 248,81,73)) 12%, transparent); }

/* ── Activity stat cards ── */
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.acct-stat { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 16px; text-align: center; }
.acct-stat-num { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.acct-stat-num.acct-stat-sm { font-size: 1.25rem; }
.acct-stat-label { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }

/* ── Avatar picker ── */
.av-preset { object-fit: cover; }
.acct-row-block { flex-direction: column; align-items: stretch; gap: 16px; }
.acct-avatars { display: flex; flex-wrap: wrap; gap: 12px; }
.acct-av-opt { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; line-height: 0; transition: border-color .15s, transform .15s; }
.acct-av-opt img { width: 46px; height: 46px; border-radius: 50%; display: block; }
.acct-av-opt:hover { transform: translateY(-2px); }
.acct-av-opt.is-on { border-color: rgb(var(--accent-green)); }
.acct-av-initial span { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.15rem; color: #04140a; background: linear-gradient(150deg, rgb(var(--accent-green)), rgb(var(--accent-teal))); } /* token-ok */

/* ── Recent comments ── */
.acct-comment { display: block; padding: 16px 20px; text-decoration: none; color: inherit; transition: background .12s; }
.acct-comment + .acct-comment { border-top: 1px solid var(--border); }
.acct-comment:hover { background: color-mix(in srgb, rgb(var(--accent-blue)) 6%, transparent); }
.acct-comment-body { display: block; color: var(--text); font-size: .95rem; line-height: 1.5; }
.acct-comment-meta { display: block; margin-top: 5px; font-size: .8rem; color: var(--muted); }

/* ── Saved toast ── */
.acct-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); opacity: 0;
  background: var(--green); color: #04140a; /* token-ok */ font-weight: 650; font-size: .9rem; padding: 10px 20px; border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; }
.acct-toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 400px) {
  .acct-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .acct-row-control { justify-content: flex-start; }
  .acct-inline-input { width: 100%; text-align: left; border-color: var(--border); }
  .acct-row-value { max-width: 100%; white-space: normal; }
}
