/* Auth pages, profiles and settings. */

/* ─── Auth ───────────────────────────────────────────────────────────────── */

.auth { margin: 0 auto; width: 100%; max-width: 28rem; padding: 2rem 1rem 0; }
.auth-card { border-radius: 1.5rem; padding: 1.75rem 1.25rem; box-shadow: 0 1px 0 var(--line); }
.auth-head { margin-bottom: 1.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.auth-head h1 { font-family: var(--font-serif); font-size: 1.875rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); }
.auth-subtitle { margin-top: 0.375rem; font-size: 0.9375rem; line-height: 1.625; color: var(--muted); }
.auth-subtitle strong { font-weight: 500; color: var(--ink-2); }
.auth-footer { margin-top: 1.25rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
.auth-wait { display: flex; justify-content: center; padding: 1.5rem 0; color: var(--ink-2); }
.auth-note { margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); }

.steps { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.step { display: flex; flex: 1; flex-direction: column; gap: 0.375rem; }
.step-bar { height: 0.25rem; border-radius: 9999px; background: var(--surface-3); }
.step.is-current .step-bar, .step.is-done .step-bar { background: var(--ink); }
.step.is-current .step-label { color: var(--ink); }

/* Sign-up in three steps. */
.signup-steps-count { margin-bottom: 0.5rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.signup-consent { text-align: center; }
.signup-help { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.875rem; color: var(--muted); text-align: center; }
.signup-change summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.signup-change summary:hover { color: var(--ink); }
.signup-change[open] summary { margin-bottom: 1rem; }
.signup-change .form { text-align: left; }
.link-button { font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ─── Profile ────────────────────────────────────────────────────────────── */

.profile-header { --pad-x: 1.25rem; border-radius: 1.5rem; padding: 1.5rem var(--pad-x); }
.profile-top { display: flex; align-items: flex-start; gap: 1rem; }
.profile-avatar { position: relative; display: inline-flex; flex-shrink: 0; }
/* The cover, edge to edge across the top of the card; the picture overlaps its foot. */
.profile-cover {
  position: relative;
  display: block;
  margin: -1.5rem calc(-1 * var(--pad-x)) 0;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border-radius: calc(1.5rem - 1px) calc(1.5rem - 1px) 0 0;
  background: var(--surface-2);
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  aspect-ratio: 5 / 1;
  border-bottom: 1px dashed var(--line-strong);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}
.profile-cover.is-empty:hover { background: var(--surface-3); color: var(--ink); }
.profile-cover-edit {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  background: rgb(0 0 0 / 0.55);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.profile-cover-edit:hover { background: rgb(0 0 0 / 0.72); }
.has-cover .profile-top {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "avatar action" "who who";
  align-items: end;
  gap: 0.75rem 1rem;
}
.has-cover .profile-avatar { grid-area: avatar; justify-self: start; margin-top: -3.5rem; }
.has-cover .profile-avatar .avatar { box-shadow: 0 0 0 4px var(--surface); }
.has-cover .profile-who { grid-area: who; padding-top: 0; }
.has-cover .profile-action { grid-area: action; }
.profile-avatar-edit {
  position: absolute;
  right: 0.125rem;
  bottom: 0.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 0 0 3px var(--surface);
  transition: transform 0.15s;
}
.profile-avatar-edit:hover { transform: scale(1.06); }
.profile-avatar-edit.is-busy, .profile-cover-edit.is-busy, .profile-cover.is-busy { opacity: 0.6; pointer-events: none; cursor: progress; }
@media (max-width: 479px) {
  .profile-avatar .avatar-2xl { width: 5.5rem; height: 5.5rem; font-size: 1.75rem; }
  .has-cover .profile-avatar { margin-top: -2.75rem; }
}

/* Settings: the profile picture and cover, as the profile shows them. */
.pictures { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.pictures-preview { position: relative; padding-bottom: 2.5rem; }
.pictures-cover { aspect-ratio: 3 / 1; overflow: hidden; border-radius: 0.875rem; background: var(--surface-2); }
.pictures-cover img { width: 100%; height: 100%; object-fit: cover; }
.pictures-avatar { position: absolute; bottom: 0; left: 1rem; display: inline-flex; }
.pictures-avatar .avatar { box-shadow: 0 0 0 4px var(--surface); }
.pictures-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.pictures-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pictures-label { min-width: 7.5rem; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.profile-who { min-width: 0; flex: 1; padding-top: 0.25rem; }
.profile-who h1 { font-family: var(--font-serif); font-size: 1.75rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.025em; overflow-wrap: anywhere; color: var(--ink); }
.profile-handle { margin-top: 0.125rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9375rem; color: var(--muted); }
.profile-action { flex-shrink: 0; }
.btn-follow { min-width: 6rem; }
.profile-bio { margin-top: 1rem; font-size: 0.9375rem; line-height: 1.625; white-space: pre-wrap; color: var(--ink-2); }
.profile-stats { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.875rem; }
.profile-stats a, .profile-stats span { color: var(--muted); }
.profile-stats a:hover { color: var(--ink); }
.profile-stats strong { font-weight: 600; color: var(--ink); }
.profile-meta { margin-top: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-size: 0.875rem; color: var(--muted); }
.profile-joined { display: inline-flex; align-items: center; gap: 0.375rem; }
.chip-streak { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.625rem; }

.profile-nav { margin-top: 1.5rem; display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); }
.profile-tab { margin-bottom: -1px; border-bottom: 2px solid transparent; padding: 0.625rem 0.75rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); transition: color 0.15s; }
.profile-tab:hover { color: var(--ink); }
.profile-tab.is-selected { border-color: var(--ink); color: var(--ink); }
.profile-body { margin-top: 1rem; }

.people { overflow: hidden; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface); }
.people li + li { border-top: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; transition: background-color 0.15s; }
.person:hover { background: var(--surface-2); }
.person-who { min-width: 0; flex: 1; }
.person-name, .person-handle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name { font-weight: 600; color: var(--ink); }
.person-handle { font-size: 0.875rem; color: var(--muted); }
.person-since { flex-shrink: 0; font-size: 0.75rem; color: var(--muted); }
.follow-skeleton { display: flex; flex-direction: column; gap: 0.5rem; }
.follow-skeleton-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }

/* ─── Settings ───────────────────────────────────────────────────────────── */

.sections { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.settings-section { border-radius: 1.5rem; padding: 1.5rem 1.25rem; }
.settings-section h2 { font-family: var(--font-serif); font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -0.025em; }
.settings-note { margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.625; color: var(--muted); }
.settings-body { margin-top: 1.25rem; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.email-info { min-width: 0; }
.email-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.email-status { margin-top: 0.125rem; display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; color: var(--ink-2); }

/* ─── Two-factor sign-in (/settings/two-factor, /login/code) ─────────────── */

/* The QR code stays black on white in both themes, so every camera reads it. */
.qr-wrap { margin: 1rem 0 0.5rem; align-self: flex-start; border-radius: 0.75rem; background: #fff; padding: 0.25rem; box-shadow: inset 0 0 0 1px var(--line); }
.qr { display: block; width: 12rem; height: 12rem; }
.qr .qr-bg { fill: #fff; }
.qr .qr-dots { fill: #000; }
.secret-key code { display: inline-block; border-radius: 0.5rem; background: var(--surface-2); padding: 0.375rem 0.625rem; font-size: 0.9375rem; letter-spacing: 0.04em; color: var(--ink); word-break: break-word; }
.recovery-codes { margin: 0.75rem 0 0.5rem; padding-left: 1.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.5rem 1.5rem; font-size: 1rem; color: var(--ink); }
.recovery-codes code { font-size: 1rem; letter-spacing: 0.04em; }
.recovery-help { margin-top: 1.25rem; font-size: 0.875rem; }
.recovery-help summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }
.recovery-help summary:hover { color: var(--ink); }
.recovery-help[open] summary { margin-bottom: 0.75rem; }

/* ─── More about you (/settings/about-you, /welcome, profiles) ───────────── */

.about-link { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.about-link strong { font-weight: 600; color: var(--ink); }

.promise { margin: 1.25rem 0; border-radius: 1rem; background: var(--surface-2); padding: 1rem 1.25rem; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); }
.promise-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--ink); }
.promise-list { margin-top: 0.5rem; padding-left: 1.25rem; list-style: disc; display: flex; flex-direction: column; gap: 0.25rem; }
.promise-more { margin-top: 0.5rem; font-size: 0.875rem; }
.promise-more a, .consent-panel a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }

.about-form { display: flex; flex-direction: column; gap: 1rem; }
.about-questions { display: flex; flex-direction: column; gap: 1.5rem; }
.about-q { display: flex; flex-direction: column; gap: 0.5rem; }
.about-multi { display: grid; grid-template-columns: 1fr; gap: 0.375rem 1rem; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9375rem; color: var(--ink); cursor: pointer; }
.check input { margin-top: 0.2rem; flex-shrink: 0; width: 1rem; height: 1rem; accent-color: var(--ink); }
.check-note { display: block; font-size: 0.8125rem; color: var(--muted); }
.about-show { font-size: 0.875rem; color: var(--ink-2); }
.consent-check { border-radius: 0.75rem; box-shadow: inset 0 0 0 1px var(--line-strong); padding: 0.75rem 0.875rem; line-height: 1.5; }
.consent-check:has(input:checked) { box-shadow: inset 0 0 0 1px var(--ink-2); background: var(--surface-2); }

.about-more { display: flex; flex-direction: column; gap: 1rem; }
.about-more[open] { gap: 1rem; }
.about-more > section + section { margin-top: 1rem; }
.about-more-summary { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; cursor: pointer; list-style: none; border-radius: 9999px; background: var(--surface); padding: 0.625rem 1.125rem; font-size: 0.9375rem; font-weight: 500; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.about-more-summary::-webkit-details-marker { display: none; }
.about-more-summary::after { content: ''; width: 0.5rem; height: 0.5rem; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: translateY(-0.125rem) rotate(45deg); transition: transform 0.15s; }
.about-more[open] > .about-more-summary { margin-bottom: 1rem; }
.about-more[open] > .about-more-summary::after { transform: translateY(0.125rem) rotate(-135deg); }
.about-more-summary:hover { background: var(--surface-2); }

.consent-panel { display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.consent-panel strong { font-weight: 600; color: var(--ink); }
.consent-withdraw { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.welcome-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.welcome-actions { align-items: center; }
.welcome-more { font-size: 0.9375rem; }
.link-button { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }
.link-button:hover { color: var(--ink); }

/* The political compass: neutral quadrants, the dot is the only strong mark. */
.compass-layout { display: flex; flex-direction: column; gap: 1rem; }
.compass-figure { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.compass-row { display: flex; align-items: center; gap: 0.375rem; }
.compass-label { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.compass-label-side { writing-mode: vertical-rl; transform: rotate(180deg); }
.compass-pad { width: min(15rem, 62vw); aspect-ratio: 1; border-radius: 0.5rem; touch-action: none; }
.compass-pad.is-live { cursor: crosshair; }
.compass-pad.is-live:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.compass { display: block; width: 100%; height: 100%; }
.compass-q-a { fill: var(--surface-2); }
.compass-q-b { fill: var(--surface-3); }
.compass-grid { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.compass-axis { fill: none; stroke: var(--ink-2); stroke-width: 1.25; }
.compass-frame { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.compass-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 0.35; }
.compass-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: end; }
.compass-clear { grid-column: 1 / -1; justify-self: start; }
.compass-reading { min-height: 1.25rem; font-size: 0.875rem; color: var(--ink-2); }
.compass-reading:empty { display: none; }

/* On profiles: what the person chose to show. */
.profile-about { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.profile-about-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.about-list { margin-top: 0.625rem; display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.about-item { display: grid; grid-template-columns: minmax(7.5rem, 38%) 1fr; gap: 0.75rem; font-size: 0.9375rem; }
.about-item dt { color: var(--muted); }
.about-item dd { color: var(--ink); overflow-wrap: anywhere; }
.about-item-compass dd { display: flex; align-items: center; gap: 0.75rem; }
.about-compass { width: 4.5rem; height: 4.5rem; flex-shrink: 0; }
.about-compass-text { display: flex; flex-direction: column; }
.about-sub { font-size: 0.8125rem; color: var(--muted); }

@media (min-width: 640px) {
  .about-multi { grid-template-columns: 1fr 1fr; }
  .compass-layout { flex-direction: row; align-items: center; gap: 1.5rem; }
  .compass-controls { grid-template-columns: 1fr; flex: 1; }
}

@media (min-width: 640px) {
  .auth { padding-top: 3.5rem; }
  .auth-card { padding: 2.25rem 2rem; }
  .profile-header, .settings-section { padding-inline: 1.75rem; }
  .profile-header { --pad-x: 1.75rem; }
}

/* ─── Your interests, and why you're seeing a post (the ranking, §23) ─────────── */

.interest-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.interest-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(4rem, 8rem) auto; align-items: center; gap: 0.75rem; font-size: 0.9375rem; }
.interest-label { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.interest-examples { display: flex; flex-direction: column; gap: 0.125rem; margin-top: 0.25rem; }
.interest-examples a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--muted); text-decoration: none; }
.interest-examples a:hover { color: var(--ink); text-decoration: underline; }
.interest-bar { height: 0.375rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.interest-bar i { display: block; height: 100%; border-radius: inherit; background: var(--s1); }
.why-post { margin: 0.25rem 0 1rem; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: anywhere; color: var(--ink-2); }
.why-headline { font-size: 1rem; font-weight: 500; line-height: 1.5; color: var(--ink); }
.why-reasons { margin: 0.75rem 0; padding-left: 1.25rem; list-style: disc; display: flex; flex-direction: column; gap: 0.375rem; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); }

/* ─── Pro (/pro) ─────────────────────────────────────────────────────────── */

.pro-title { display: flex; align-items: center; gap: 0.625rem; }
.pro-title .pro-badge { width: 2rem; height: 2rem; margin: 0; }
.pro-status strong { font-weight: 600; color: var(--ink); }
.pro-benefits { margin-top: 1.5rem; border-radius: 1.5rem; padding: 0.5rem 1.25rem; display: flex; flex-direction: column; }
.pro-benefit { display: flex; align-items: flex-start; gap: 0.875rem; padding: 1rem 0; }
.pro-benefit + .pro-benefit { border-top: 1px solid var(--line); }
.pro-benefit-icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.75rem; background: var(--surface-2); color: var(--ink-2); }
.pro-benefit-icon .pro-badge { width: 20px; height: 20px; margin: 0; }
.pro-benefit-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.pro-benefit-name { font-weight: 600; color: var(--ink); }
.pro-benefit-note { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); }
.pro-get { margin-top: 1.25rem; }
