/* Flamingo, the redesign, phase 3b: settings, sign-in, check
   your email, report, delete account, the legal pages, the error and
   suspended pages, and the shared cards (account nudge, push, setup nudge,
   copy, invite link). Loaded after r.css and uses its tokens. Classes start
   with "ra-"; the old partials that settings reuses (the phone card, photo
   card, notification grid, sign-in box) are restyled by their old class
   names, under ".r". */

/* ---------- small shared pieces ---------- */
.ra-sec { display: flex; flex-direction: column; gap: 10px; }
.ra-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--plum-bg); color: var(--plum); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ra-ico-sm { width: 36px; height: 36px; }
.ra-ico-sm svg { width: 18px; height: 18px; }
.ra-note { font-size: 13px; color: var(--muted); }
.ra-center { align-items: stretch; }
.ra-center-head { text-align: center; align-items: center; }
.ra-bigico { align-self: center; width: 72px; height: 72px; border-radius: 50%; background: var(--card); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-top: 8px; }
.ra-bigico-plum { background: var(--plum-bg); color: var(--plum); }
.r .muted { color: var(--muted); }
.r small { font-size: inherit; }

/* ---------- the account nudge ("Keep your spot") and the start-a-group line ---------- */
.ra-nudge { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 24px; background: var(--card); border: 1px solid var(--card-line); }
.ra-nudge-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ra-nudge-body strong { font-size: 16px; font-weight: 800; }
.ra-nudge-body p { font-size: 14px; color: var(--muted); }
.ra-nudge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; }
.ra-nudge-actions form, .ra-start form { margin: 0; }
.nudge-mail { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.nudge-mail input[type="email"] { flex: 1 1 190px; min-width: 0; }
.nudge-mail .primary { flex: none; }
.ra-nudge-result .ra-ico svg { width: 22px; height: 22px; }
.ra-start .ra-nudge-body { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.ra-start .ra-nudge-body p { color: var(--text); }
/* One ask at a time: the reminder card, when it shows, goes first. */
.ra-push-prompt:not([hidden]) ~ .ra-nudge { display: none; }

/* the quiet "add a photo and turn on reminders" line on home */
.ra-setup { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 20px; border: 1px dashed var(--border); color: var(--text) !important; text-decoration: none; font-size: 14px; font-weight: 600; }
.ra-setup > span:nth-child(2) { flex: 1; min-width: 0; }
.ra-setup > svg { color: var(--muted); flex: none; }

/* ---------- the push card and the permission prompt ---------- */
.ra-push { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 24px; background: var(--card); border: 1px solid var(--card-line); }
.ra-push-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ra-push-body strong { font-size: 16px; font-weight: 800; }
.ra-push-body p { font-size: 14px; }
.ra-push .push-status:empty { display: none; }
.ra-push-prompt { flex-wrap: wrap; align-items: flex-start; }
.ra-push-prompt .ra-push-body { flex-basis: calc(100% - 60px); }
.ra-push-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.ra-push-actions button.primary { flex: 1 1 200px; min-height: 48px; }

/* ---------- copy box and invite link ---------- */
.ra-copy, .ra-invite { display: flex; flex-direction: column; gap: 10px; }
.ra-copy textarea { background: var(--tile); font-size: 15px; line-height: 1.4; }
.ra-copy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ra-copy-actions > * { flex: 1 1 140px; }
.ra-invite { gap: 12px; }
.ra-invite-tools { display: flex; flex-wrap: wrap; gap: 8px; }
/* three equal tiles: icon over label so "Edit message" stays on one line */
.r .ra-invite-tools .btn-ico { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px 2px; border-radius: 16px; font-size: 13px; }
.r .ra-invite-tools:has(.rb-fold[open]) .btn-ico, .r .ra-invite-tools .rb-fold[open] > .btn-ico { flex-direction: row; gap: 8px; min-height: 48px; font-size: 14px; }
.ra-invite-fold.rg-qrbox[open] { text-align: center; }

/* ---------- settings ---------- */
.ra-profile { gap: 16px; }
.ra-profile-top { display: flex; align-items: center; gap: 14px; }
.r-face-xl { width: 64px; height: 64px; font-size: 20px; font-weight: 800; }
.r-face-sm { width: 32px; height: 32px; font-size: 12px; }
.ra-profile-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ra-profile-name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.ra-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ra-form { display: flex; flex-direction: column; gap: 12px; }
.ra-form > button.primary, .ra-np-form > button.primary, .ra-usage > button.primary { align-self: flex-start; }

.ra-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ra-day { position: relative; display: block; }
.ra-day input { position: absolute; opacity: 0; inset: 0; width: 100% !important; height: 100% !important; margin: 0; cursor: pointer; }
.ra-day span { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; }
.ra-day input:checked + span { background: var(--pink); border-color: var(--pink); color: var(--on-pink); font-weight: 800; }
.ra-day input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.ra-away .r-field-row { margin-top: 8px; }
.ra-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px; background: var(--ok-bg); color: var(--ok-fg); font-size: 14px; font-weight: 600; }
.ra-saved a { color: var(--ok-fg); text-decoration: underline; }

.ra-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; color: var(--text) !important; text-decoration: none; font-size: 15px; border-top: 1px solid var(--line); }
.ra-row-top { margin: 0 -4px; padding: 0 4px; }
.ra-rows > :first-child { border-top: 0; }
.ra-row-text { display: flex; flex-direction: column; min-width: 0; }
.ra-row-text strong { font-weight: 700; }
.ra-row svg { flex: none; color: var(--muted); }
.ra-signout { border-top: 1px solid var(--line); }
.ra-signout .ra-row-btn { width: 100%; justify-content: flex-start; border: 0; background: none; border-radius: 0; padding: 0; min-height: 52px; font-size: 15px; }
.ra-rows { gap: 0; }
.ra-rows > .ra-blocked, .ra-rows > .ra-usage { padding: 14px 0; border-top: 1px solid var(--line); }
.ra-rows > .ra-blocked:first-child, .ra-rows > .ra-blocked:first-child + .ra-usage { border-top: 0; }
.ra-blocked { display: flex; flex-direction: column; gap: 8px; }
.ra-blocked-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ra-blocked-list li span:nth-child(2) { flex: 1; min-width: 0; font-weight: 600; }
.ra-usage { display: flex; flex-direction: column; gap: 10px; }
.ra-toggle { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ra-toggle-text { display: flex; flex-direction: column; gap: 4px; }
.ra-toggle input { margin-top: 2px; }
.ra-delete { align-self: flex-start; color: var(--danger) !important; font-size: 14px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; margin: 4px 4px 0; }

/* language and theme as segmented controls */
.ra-look { gap: 12px; }
.ra-look .lang-switch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 24px; background: var(--tile); border: 0; }
.ra-look .lang-switch button { height: 40px; min-height: 40px; border: 0; border-radius: 20px; background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.ra-look .lang-switch button[aria-current] { background: var(--surface); color: var(--text); font-weight: 800; box-shadow: 0 1px 4px rgba(11, 31, 58, 0.12); }

/* the photo card (shared avatar_card) inside the profile card */
.r .avatar-card { padding: 0; background: none; border: 0; gap: 0; }
.r .avatar-card-face { display: none; }
.r .avatar-card h2 { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.r .avatar-card-body { display: flex; flex-direction: column; gap: 8px; }
.r .avatar-card form { display: flex; flex-direction: column; gap: 10px; }
.r .avatar-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.r .avatar-card .actions { align-items: center; }
.r .avatar-card .button.small, .r .button.small, .r button.small { min-height: 40px; font-size: 14px; }

/* the phone texts card (shared phone) */
.r .phone { gap: 12px; }
.r .phone h2 { font-size: 18px; font-weight: 800; }
.r .phone h2 > span[aria-hidden] { display: none; }
.r .phone form { display: flex; flex-direction: column; gap: 10px; }
.r .phone label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.r .phone fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.r .phone legend { padding: 0; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.r .phone label.check { flex-direction: row; font-weight: 500; }
.r .phone .actions form { display: block; }
.r .phone .phone-code { letter-spacing: 0.2em; }

/* the notification grid */
.r .notify-prefs { gap: 12px; }
.ra-np-form { display: flex; flex-direction: column; gap: 16px; }
.r .np-grid { width: 100%; border-collapse: collapse; }
.r .np-grid th, .r .np-grid td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 15px; }
.r .np-grid thead th { font-size: 12px; color: var(--muted); font-weight: 700; }
.r .np-grid tbody th { font-weight: 700; }
.r .np-grid .np-col, .r .np-grid td { text-align: center; width: 4.5rem; }
.r .np-grid .np-group th { padding-top: 18px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 0; text-align: left; }
.r .np-check { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; margin: 0; cursor: pointer; }
.r .np-ch { display: none; }
.r .np-na { color: var(--muted); }
.r .np-lead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; font-weight: 500; font-size: 13px; color: var(--muted); }
.r .np-lead select { width: auto; max-width: 100%; min-height: 40px; font-size: 14px; }
.r .np-quiet { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.r .np-quiet legend { padding: 0; font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.r .np-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) {
  .r .np-grid, .r .np-grid tbody, .r .np-grid tr, .r .np-grid th, .r .np-grid td { display: block; width: auto; }
  .r .np-grid thead { display: none; }
  .r .np-grid tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .r .np-grid tbody th, .r .np-grid td { border: 0; padding: 0; text-align: left; }
  .r .np-grid tbody th { flex-basis: 100%; margin-bottom: 2px; }
  .r .np-grid .np-group { border-bottom: 0; padding-bottom: 0; }
  .r .np-grid .np-group th { padding-top: 10px; }
  .r .np-ch { display: inline; font-size: 14px; }
  .r .np-check { justify-content: flex-start; min-width: 0; }
}

/* the account block (email, phone, membership) */
.r .account-channels { display: flex; flex-direction: column; }
.r .channel-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.r .channel-row:first-child { border-top: 0; padding-top: 4px; }
.r .channel-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.r .channel-info strong { flex-basis: 100%; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.r .channel-info p { flex-basis: 100%; }
.r .channel-form { margin: 0; }
.r .channel-edit .ra-form { margin-top: 10px; }
.r .signin-form .signin-step-1 label { font-size: 14px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.r .signin-change-row { margin: 0; }

/* ---------- sign-in page ---------- */
.ra-signin { gap: 20px; padding-top: 20px; }
.ra-signin-intro { display: flex; flex-direction: column; gap: 20px; }
.ra-signin-sample { background: var(--card); border-radius: 24px; padding: 16px; }
.ra-signin-card { gap: 12px; }

/* ---------- check your email ---------- */
.ra-code { gap: 12px; }
.r .code-input { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 0.3em; min-height: 64px; }
.r .code-input::placeholder { letter-spacing: 0.3em; font-weight: 500; opacity: 0.5; }
.ra-resend { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ra-resend form { margin: 0; }
.r button.ra-inline-link { display: inline; min-height: 0; font-size: inherit; }
.ra-dev { text-align: center; }

/* ---------- report ---------- */
.ra-quote { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--tile); }
.ra-quote blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--border); font-size: 15px; overflow-wrap: anywhere; }
.ra-quote .report-thumb { border-radius: 12px; max-width: 100%; height: auto; }
.ra-choices { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ra-choices legend { padding: 0; margin-bottom: 8px; }
.ra-choice { position: relative; display: block; }
.ra-choice input { position: absolute; opacity: 0; inset: 0; width: 100% !important; height: 100% !important; margin: 0; cursor: pointer; }
.ra-choice span { display: flex; align-items: center; min-height: 52px; padding: 0 16px 0 48px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 600; position: relative; }
.ra-choice span::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); }
.ra-choice input:checked + span { border-color: var(--pink); background: var(--tile); font-weight: 800; }
.ra-choice input:checked + span::before { border-color: var(--pink); background: radial-gradient(circle, var(--pink) 0 45%, var(--surface) 50%); }
.ra-choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- delete account and the checklists ---------- */
.ra-alert { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: var(--warn-bg); color: var(--warn-fg); }
.ra-alert strong { font-size: 16px; font-weight: 800; }
.ra-alert p { font-size: 14px; }
.ra-alert-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ra-list ul { display: flex; flex-direction: column; gap: 10px; }
.ra-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.ra-list li svg { flex: none; margin-top: 2px; color: var(--ok-fg); }
.ra-kept .ra-dot { flex: none; width: 8px; height: 8px; margin: 8px 5px 0; border-radius: 50%; background: var(--gray-bar); }
.r button.ra-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.r button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- legal pages ---------- */
.ra-legal-tabs { margin-top: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ra-prose { font-size: 16px; line-height: 1.6; display: flex; flex-direction: column; gap: 12px; }
.ra-prose h2 { margin-top: 18px; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.ra-prose h3 { margin-top: 8px; font-size: 17px; font-weight: 800; }
.ra-prose ul, .ra-prose ol { list-style: revert; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ra-prose ol { list-style: decimal; }
.ra-prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.ra-prose th, .ra-prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ra-prose a { overflow-wrap: anywhere; }
.ra-prose .policy-updated { display: none; }

/* ---------- error and suspended pages ---------- */
.ra-error { padding-top: 24px; }
.ra-code404 { align-self: center; font-size: 96px; line-height: 1; font-weight: 800; letter-spacing: -0.04em; color: var(--pink); margin-top: 12px; }
.ra-error-actions { max-width: 360px; width: 100%; align-self: center; }
.ra-center-card { text-align: center; align-items: center; }
.ra-center-card .r-big { overflow-wrap: anywhere; }

/* ---------- phase 4c: settings hub, sign-in phone, code boxes, contents ---------- */
.ra-profile-link { flex-direction: row; align-items: center; gap: 14px; color: var(--text) !important; text-decoration: none; }
.ra-profile-link .ra-profile-id { flex: 1; }
.ra-profile-link > svg { flex: none; color: var(--muted); }
.ra-sec > .ra-row.r-card { padding-top: 0; padding-bottom: 0; }

.ra-signin-box { gap: 12px; }
.ra-more { width: 100%; }
.ra-more-title { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; margin: 4px 0 10px; }
.ra-more .signin-step-1 label, .ra-more .signin-step-1 { text-align: left; }
.ra-email-form .signin-btn-submit { margin-top: 4px; }

.ra-mailapp { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ra-mailapp svg { width: 20px; height: 20px; }
.ra-otp { display: flex; justify-content: center; gap: 8px; }
.ra-otp-box { flex: 1 1 0; min-width: 0; max-width: 56px; height: 64px; padding: 0; text-align: center; font-size: 26px; font-weight: 800; border-radius: 14px; }
.ra-otp-on > label { display: block; margin-bottom: 8px; }
.ra-resend-timer { font-variant-numeric: tabular-nums; }
.r button.ra-inline-link:disabled { opacity: 0.55; }

.ra-block { margin-top: 4px; }
.ra-block input { position: absolute; opacity: 0; inset: 0; width: 100% !important; height: 100% !important; margin: 0; cursor: pointer; }
.ra-block span::before { border-radius: 6px; }
.ra-block input:checked + span::before { background: var(--pink); }

.ra-toc ol { list-style: none; display: flex; flex-direction: column; gap: 4px; padding: 0; }
.ra-toc a { display: block; padding: 6px 0; font-size: 15px; font-weight: 600; }
.ra-prose h2 { scroll-margin-top: 16px; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .ra-settings, .ra-legal { padding-top: 32px; }
  .ra-page.ra-signin { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: center; padding-top: 56px; }
  .ra-signin .r-title-md { font-size: 44px; }
  .ra-center { max-width: 520px; }
  .ra-legal { max-width: 720px; }
  .ra-push-prompt { flex-wrap: nowrap; align-items: center; }
  .ra-push-prompt .ra-push-body { flex-basis: auto; }
  .ra-push-actions { flex-basis: auto; flex-direction: column; align-items: stretch; }
}

/* Send feedback (/feedback) */
.rf-page { display: flex; flex-direction: column; gap: 16px; }
.rf-kinds { border: 0; padding: 0; margin: 0; min-width: 0; }
.rf-kinds legend { padding: 0; margin-bottom: 10px; }
.rf-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-pill { position: relative; display: block; }
.rf-pill input { position: absolute; opacity: 0; inset: 0; width: 100% !important; height: 100% !important; margin: 0; cursor: pointer; }
.rf-pill span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 600; }
.rf-pill input:checked + span { border-color: var(--pink); background: var(--tile); font-weight: 800; }
.rf-pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.rf-page textarea { min-height: 140px; resize: vertical; }
.r-field > .rf-hint { font-weight: 400; font-size: 13px; }
.rf-details { padding: 4px 0; }
.rf-thanks { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 0 8px; }
.rf-badge { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%; background: var(--tile); border: 2px solid var(--pink); font-size: 48px; }
.rf-again { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; color: var(--link); }
@media (min-width: 768px) {
  .rf-page { max-width: 560px; }
}
