/*
 * Resident Portal — signed-in and account pages (log in, registration, overview, requests, profile, help, QR check).
 * Loaded after portal-v2.css. The public home page keeps its own V2 components and is not restyled here.
 * Sizes favour older readers: 18px fields, 56px main buttons, one clear action per step.
 */
:root {
    --rp-radius: 16px;
    --rp-radius-sm: 12px;
    --rp-shadow: 0 1px 2px rgba(16, 32, 24, .05), 0 10px 30px rgba(16, 32, 24, .07);
    --rp-field-height: 48px;
    --rp-gap: 24px;
}
body.dark-mode { --rp-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .4); }

/* Workspace page header: a white band that names the page and offers one way back */
.page-band, body.dark-mode .page-band { border-bottom: 1px solid var(--v2-line); background: var(--v2-card); }
.page-band-inner { padding-block: 32px 30px; }
.page-band h1 { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.025em; }
.page-band-lead, .page-band-lead p { font-size: 16px; }
.page-band + .container { padding-top: 32px; }
.v2-page-eyebrow { color: var(--v2-brand-strong); font-size: 15px; letter-spacing: .02em; }

/* Forms: big, calm and forgiving */
.form-group { margin-bottom: var(--rp-gap); }
.form-label { margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.form-input, body.dark-mode .form-input { min-height: var(--rp-field-height); padding: 10px 14px; border-radius: 8px; font-size: 16px; }
select.form-input { padding-right: 44px; }
textarea.form-input { min-height: 120px; }
.form-note { margin-top: 8px; color: var(--v2-muted); }
.field-error { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; font-size: 15px; font-weight: 600; }
.field-error:not([hidden])::before { content: ""; flex: 0 0 20px; height: 20px; margin-top: 2px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.form-input[aria-invalid="true"] { border-color: var(--v2-danger); box-shadow: 0 0 0 1px var(--v2-danger); }
input[type="file"].form-input { padding: 10px; }
input[type="file"]::file-selector-button { min-height: 40px; margin-right: 14px; padding: 6px 16px; border: 2px solid var(--v2-brand); border-radius: 8px; background: var(--v2-brand-tint); color: var(--v2-brand-strong); font: 700 16px var(--v2-font-body); cursor: pointer; }
.btn:not(.btn-small):not(.btn-link) { min-height: var(--rp-field-height); padding-inline: 20px; border-radius: 8px; font-size: 16px; font-weight: 600; }
.btn-full { width: 100%; }
.rp-photo-preview { display: flex; align-items: center; gap: 14px; margin: 12px 0 0; }
.rp-photo-preview[hidden] { display: none; }
.rp-photo-preview img { width: 96px; height: 96px; border: 2px solid var(--v2-line); border-radius: 12px; object-fit: cover; }
.rp-photo-preview figcaption { color: var(--v2-success); font-weight: 700; }

/* Messages: one summary for every error, linked to its field */
.rp-error-summary, body.dark-mode .rp-error-summary { margin: 0 0 24px; padding: 18px 22px; border: 2px solid var(--v2-danger); border-left-width: 8px; border-radius: var(--rp-radius-sm); background: var(--v2-danger-subtle); color: var(--v2-ink); }
.rp-error-summary:focus { outline: 3px solid var(--v2-danger); outline-offset: 3px; }
.rp-error-summary h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--v2-danger); font: 700 17px/1.3 var(--v2-font-display); }
.rp-error-summary h2 svg { width: 24px; height: 24px; flex: 0 0 auto; }
.rp-error-summary ul { margin: 0; padding-left: 34px; }
.rp-error-summary a { color: var(--v2-danger); font-weight: 700; text-decoration: underline; }
.rp-flash, body.dark-mode .rp-flash { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 24px; padding: 16px 20px; border: 2px solid var(--v2-success); border-radius: var(--rp-radius-sm); background: var(--v2-success-subtle); color: var(--v2-ink); font-size: 16px; font-weight: 600; }
.rp-flash svg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--v2-success); }

/* Sign-in pages: what the portal is for, beside one simple form */
.rp-auth { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 24px; }
.rp-auth-brand { position: sticky; top: 108px; display: grid; gap: 14px; padding: 32px; border-radius: 20px; background: var(--v2-forest-950); border-top: 4px solid var(--v2-gold); color: #fff; }
.rp-auth-brand img { width: 72px; height: 72px; padding: 3px; border: 3px solid var(--v2-seal-ring); border-radius: 50%; background: #fff; object-fit: contain; }
.rp-auth-brand-eyebrow { margin: 6px 0 0; color: var(--v2-green-200); font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rp-auth-brand h2 { margin: 0; color: #fff; font-size: 23px; }
.rp-auth-benefits { display: grid; gap: 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.rp-auth-benefits li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; font-size: 15px; }
.rp-auth-benefits svg { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .12); box-sizing: border-box; }
.rp-auth-privacy { display: flex; gap: 10px; margin: 12px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); color: var(--v2-on-dark); font-size: 15px; }
.rp-auth-privacy svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; }
.rp-auth-main { min-width: 0; max-width: 720px; }
.rp-auth-main > h1 { margin: 0 0 6px; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.025em; }
.rp-auth-lead { margin: 0 0 24px; color: var(--v2-muted); font-size: 16px; }
.rp-form-card, body.dark-mode .rp-form-card { border: 1px solid var(--v2-line); border-radius: var(--rp-radius); background: var(--v2-card); box-shadow: var(--rp-shadow); }
.rp-form-card > .card-body, .rp-form-card > form.card-body { padding: 32px; }
.rp-auth-help { margin-top: 32px; }
.rp-paths { display: grid; gap: 14px; }
.rp-paths h2, .rp-help-sections h2 { margin: 0; font-size: 19px; }
.rp-path { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: start; padding: 20px; border: 2px solid var(--v2-line); border-radius: var(--rp-radius-sm); background: var(--v2-card); color: var(--v2-ink); text-decoration: none; }
.site-main a.rp-path { color: var(--v2-ink); text-decoration: none; }
.rp-path:hover, .rp-path:focus-visible { border-color: var(--v2-brand); background: var(--v2-brand-tint); }
.rp-path-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--v2-brand-subtle); color: var(--v2-brand-strong); }
.rp-path-icon svg { width: 28px; height: 28px; }
.rp-path > span:last-child { display: grid; gap: 4px; }
.rp-path strong { font-size: 16px; }
.rp-path > span:last-child > span:not(.rp-path-action) { color: var(--v2-muted); font-size: 15px; }
.rp-path-action { margin-top: 4px; color: var(--v2-brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.rp-help-sections { display: grid; gap: 20px; padding: 24px; border-radius: var(--rp-radius); background: var(--v2-subtle); }
.rp-help-sections section { display: grid; gap: 8px; }
.rp-help-sections section + section { padding-top: 20px; border-top: 1px solid var(--v2-line); }
.rp-help-sections :is(p, ul, ol) { margin: 0; }
.rp-help-sections .new-resident-next-steps { padding-left: 24px; }
@media (max-width: 1080px) {
    .rp-auth { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 8px; }
    .rp-auth-brand { display: none; }
    .rp-auth-main { max-width: 760px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
    .rp-form-card > .card-body, .rp-form-card > form.card-body { padding: 22px 18px; }
    .rp-help-sections { padding: 20px 18px; }
    .rp-path { grid-template-columns: 44px minmax(0, 1fr); padding: 16px; }
    .rp-path-icon { width: 44px; height: 44px; }
}

/* Registration stepper inside the card */
.rp-form-card .progress-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: rpstep; }
.rp-form-card .progress-steps li { position: relative; display: grid; justify-items: center; gap: 8px; padding: 0; border: 0; color: var(--v2-muted); font-size: 15px; text-align: center; counter-increment: rpstep; }
.rp-form-card .progress-steps li::before { content: counter(rpstep); display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--v2-line-strong); border-radius: 50%; background: var(--v2-card); color: var(--v2-muted); font: 700 17px/1 var(--v2-font-body); }
.rp-form-card .progress-steps li::after { content: ""; position: absolute; top: 19px; left: calc(50% + 24px); right: calc(-50% + 24px); height: 3px; border-radius: 3px; background: var(--v2-line); transform: none; }
.rp-form-card .progress-steps li:last-child::after { display: none; }
.rp-form-card .progress-steps li.done { color: var(--v2-ink); }
.rp-form-card .progress-steps li.done::before { content: "\2713"; border-color: var(--v2-brand-fill); background: var(--v2-brand-fill); color: var(--v2-on-brand); }
.rp-form-card .progress-steps li.done::after { background: var(--v2-brand-fill); }
.rp-form-card .progress-steps li[aria-current="step"] { color: var(--v2-ink); font-weight: 700; }
.rp-form-card .progress-steps li[aria-current="step"]::before { border-color: var(--v2-brand-fill); background: var(--v2-brand-fill); color: var(--v2-on-brand); box-shadow: 0 0 0 5px var(--v2-brand-subtle); }
.rp-form-card .step-count { margin: 0; color: var(--v2-brand-strong); font-weight: 700; }
.rp-form-card .registration-step-title { margin: 4px 0 6px; font-size: clamp(21px, 2.2vw, 26px); }
.rp-form-card .step-guidance { margin: 0 0 24px; padding: 0; border: 0; color: var(--v2-muted); font-size: 16px; }
.rp-form-card .registration-path-option { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 28px; padding: 16px 18px; border: 1px solid var(--v2-line); border-radius: var(--rp-radius-sm); background: var(--v2-subtle); }
.rp-form-card .v2-checklist { margin: 0 0 24px; }
.rp-form-card details.more { margin-top: 24px; padding: 6px 18px; border: 1px solid var(--v2-line); border-radius: var(--rp-radius-sm); }
.rp-form-card details.more[open] { padding-bottom: 18px; }
.rp-form-card details.more summary { display: flex; align-items: center; min-height: 52px; color: var(--v2-brand); font-weight: 700; cursor: pointer; }
.rp-form-card .next-note { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--v2-line); color: var(--v2-muted); }
.rp-form-card .auth-links { margin-top: 24px; }
.rp-form-card .alert { margin-bottom: 22px; }
@media (max-width: 640px) {
    .rp-form-card .progress-steps li { font-size: 0; }
    .rp-form-card .progress-steps li::before { width: 36px; height: 36px; font-size: 16px; }
    .rp-form-card .progress-steps li::after { top: 17px; left: calc(50% + 22px); right: calc(-50% + 22px); }
}

/* New resident application */
.new-resident-card .new-resident-section { margin-top: 28px; }
.new-resident-card .new-resident-section legend { margin-bottom: 16px; font-size: 19px; }
.new-resident-card .new-resident-section-number { width: 32px; height: 32px; background: var(--v2-brand-fill); color: var(--v2-on-brand); font-size: 15px; }
.new-resident-card .new-resident-fields { gap: 20px 22px; }
.new-resident-card .new-resident-upload { padding: 20px; border: 2px dashed var(--v2-line-strong); border-radius: var(--rp-radius-sm); background: var(--v2-subtle); }
.new-resident-card .new-resident-form-actions .btn { min-width: 260px; }
.new-resident-status { gap: 16px; }
.new-resident-status-badge { padding: 8px 14px; border-radius: 999px; font-size: 16px; }
.new-resident-reference { font-family: var(--v2-font-mono); font-size: 28px; letter-spacing: .04em; }
@media (max-width: 640px) { .new-resident-card .new-resident-form-actions .btn { width: 100%; min-width: 0; } }

/* Overview */
.rp-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.rp-dashboard-main, .rp-dashboard-side { display: grid; gap: 24px; min-width: 0; }
.rp-alert-ready { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: center; padding: 18px 22px; border: 2px solid var(--v2-success); border-radius: var(--rp-radius); background: var(--v2-success-subtle); color: var(--v2-ink); text-decoration: none; }
.site-main a.rp-alert-ready { color: var(--v2-ink); text-decoration: none; }
.rp-alert-ready svg { width: 32px; height: 32px; color: var(--v2-success); }
.rp-alert-ready strong { color: var(--v2-success); }
.rp-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.rp-action { position: relative; display: grid; gap: 8px; align-content: start; min-height: 0; padding: 22px; border: 2px solid var(--v2-line); border-radius: var(--rp-radius); background: var(--v2-card); color: var(--v2-ink); text-decoration: none; box-shadow: var(--rp-shadow); transition: transform .15s ease, border-color .15s ease; }
.site-main a.rp-action { color: var(--v2-ink); text-decoration: none; }
.rp-action:hover, .rp-action:focus-visible { border-color: var(--v2-brand); transform: translateY(-2px); }
.rp-action-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; background: var(--v2-brand-subtle); color: var(--v2-brand-strong); }
.rp-action-icon svg { width: 26px; height: 26px; }
.rp-action-title { font: 700 19px/1.3 var(--v2-font-display); }
.rp-action-text { color: var(--v2-muted); font-size: 15px; }
.rp-action::after { content: "\203A"; position: absolute; top: 22px; right: 24px; color: var(--v2-brand); font-size: 34px; line-height: 1; }
.rp-action-primary, .site-main a.rp-action-primary { border-color: var(--v2-brand-fill); background: var(--v2-brand-fill); color: #fff; }
body.dark-mode .rp-action-primary { background: var(--v2-brand-fill); color: var(--v2-on-brand); }
.rp-action-primary .rp-action-icon { background: #fff; color: var(--v2-green-700); }
.rp-action-primary .rp-action-text { color: inherit; opacity: .92; }
.rp-action-primary::after { color: inherit; }
.rp-panel, body.dark-mode .rp-panel { padding: 24px; border: 1px solid var(--v2-line); border-radius: var(--rp-radius); background: var(--v2-card); box-shadow: var(--rp-shadow); }
.rp-panel > h2, .rp-panel-head h2 { margin: 0 0 14px; font-size: 18px; }
.rp-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.rp-panel-head a { font-weight: 700; }
.rp-panel-info { border-color: var(--v2-info-line); background: var(--v2-info-subtle); box-shadow: none; }
.rp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.rp-stats li { display: grid; gap: 4px; padding: 16px; border-radius: var(--rp-radius-sm); background: var(--v2-subtle); border-top: 5px solid var(--v2-brand); }
.rp-stats li[data-status="ready_for_release"] { border-top-color: var(--v2-success); background: var(--v2-success-subtle); }
.rp-stats li[data-status="released"] { border-top-color: var(--v2-line-strong); }
.rp-stats li[data-status="rejected"] { border-top-color: var(--v2-danger); }
.rp-stat-number { font: 700 28px/1 var(--v2-font-display); font-variant-numeric: tabular-nums; }
.rp-stat-label { color: var(--v2-muted); font-size: 14px; font-weight: 600; }
.rp-mini-list { display: grid; margin: 0; padding: 0; list-style: none; }
.rp-mini-list li + li { border-top: 1px solid var(--v2-line); }
.rp-mini-list a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 72px; padding: 12px 4px; color: var(--v2-ink); text-decoration: none; }
.site-main .rp-mini-list a { color: var(--v2-ink); text-decoration: none; }
.rp-mini-list a:hover strong { color: var(--v2-brand-strong); text-decoration: underline; }
.rp-mini-doc { display: grid; gap: 2px; }
.rp-mini-doc strong { font-size: 16px; }
.rp-mini-doc .v2-ref { color: var(--v2-muted); }
.rp-mini-list .status { margin: 0; }
.rp-profile-card { display: grid; justify-items: start; gap: 10px; }
.rp-profile-card h2 { margin: 6px 0 0; font-size: 18px; }
.rp-profile-card .v2-links { width: 100%; margin-top: 4px; border-top: 1px solid var(--v2-line); }
.rp-note-warning { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--v2-warning-subtle); color: var(--v2-warning); font-weight: 700; font-size: 15px; }
.rp-logout { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 6px; }
.rp-logout svg { width: 22px; height: 22px; }
.rp-empty { display: grid; justify-items: center; gap: 6px; padding: 24px 12px; text-align: center; color: var(--v2-muted); }
.rp-empty svg { width: 52px; height: 52px; color: var(--v2-brand); }
.rp-empty p { margin: 0; max-width: 46ch; }
.rp-empty strong { color: var(--v2-ink); font-size: 19px; }
@media (max-width: 1080px) {
    .rp-dashboard { grid-template-columns: minmax(0, 1fr); }
    .rp-dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
    .rp-dashboard-side { grid-template-columns: minmax(0, 1fr); }
    .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .rp-actions { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .rp-action { min-height: 0; padding: 20px; }
    .rp-action-title { font-size: 21px; }
    .rp-panel { padding: 18px; }
}

/* My requests and request status */
.request-table { border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.request-item { min-height: 92px; }
.request-row-document h2 { font-size: 17px; }
.v2-tracker .v2-card, .v2-tracker-state { border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.v2-collect { box-shadow: none; }
.v2-empty { padding: 32px; border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }

/* Request flow */
.v2-request .screen > .card > .card-header h2 { font-size: clamp(23px, 2.4vw, 28px); }
.v2-request .v2-request-aside .v2-card { border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.cert-btn, body.dark-mode .cert-btn { min-height: 92px; border-radius: var(--rp-radius-sm); }
.cert-btn .label { font-size: 17px; }
.tnc-box { border-radius: var(--rp-radius-sm); }
#screen-review .summary-list, #screen-confirm .summary-list { padding: 4px 20px; border: 1px solid var(--v2-line); border-radius: var(--rp-radius-sm); background: var(--v2-card); }
#screen-review .summary-list > dt:first-of-type, #screen-review .summary-list > dt:first-of-type + dd,
#screen-confirm .summary-list > dt:first-of-type, #screen-confirm .summary-list > dt:first-of-type + dd { border-top: 0; }
/* Request submitted: a compact success badge beside the heading, in line with the content below, and the reference
   number as the most prominent text on the screen. Scoped to #screen-confirm so the general .site-main text sizes
   do not shrink the reference number to body size. */
#screen-confirm .confirm-head { display: flex; align-items: center; gap: 16px; text-align: left; }
#screen-confirm .confirm-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 26px); line-height: 1.25; }
#screen-confirm .confirm-head p { margin: 4px 0 0; color: var(--v2-muted); font-size: 16px; line-height: 1.45; }
.confirm-mark, body.dark-mode .confirm-mark { position: relative; display: block; flex: none; width: 48px; height: 48px; margin-left: 6px; border-radius: 50%; background: var(--v2-success); box-shadow: 0 0 0 6px color-mix(in srgb, var(--v2-success) 16%, transparent); }
.confirm-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 21px; border: solid #fff; border-width: 0 3.5px 3.5px 0; transform: translate(-50%, -60%) rotate(45deg); }
/* The dark theme's success green is light: a dark tick keeps the contrast, as on the dark-mode toasts. */
body.dark-mode .confirm-mark::after { border-color: var(--v2-forest-950); }
#screen-confirm .confirm-ticket { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin: 0 0 12px; padding: 20px 24px; border-radius: var(--rp-radius); }
#screen-confirm .confirm-ticket-label { margin: 0; color: var(--v2-muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#screen-confirm .confirm-code { margin: 4px 0 0; color: var(--v2-ink); font-size: clamp(26px, 5vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
#screen-confirm .confirm-hint { margin: 0; color: var(--v2-muted); font-size: 16px; line-height: 1.55; }
.confirm-steps { display: grid; gap: 10px; padding-left: 24px; }
#loader { position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; flex-direction: column; gap: 16px; background: rgba(248, 251, 253, .88); color: var(--v2-ink); font-size: 16px; font-weight: 600; }
body.dark-mode #loader { background: rgba(11, 22, 34, .9); }
#loader .spinner { width: 56px; height: 56px; border: 6px solid var(--v2-brand-subtle); border-top-color: var(--v2-brand); border-radius: 50%; animation: rp-spin .9s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
#toast-wrap { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 210; display: grid; gap: 10px; max-width: min(440px, calc(100vw - 32px)); }
#toast-wrap .toast { padding: 16px 20px; border-radius: var(--rp-radius-sm); background: var(--v2-forest-950); color: #fff; font-size: 15px; font-weight: 600; box-shadow: var(--rp-shadow); }
#toast-wrap .toast.green { background: var(--v2-success); color: #fff; }
#toast-wrap .toast.red { background: var(--v2-danger); color: #fff; }
body.dark-mode #toast-wrap .toast.green, body.dark-mode #toast-wrap .toast.red { color: var(--v2-forest-950); }
@media (max-width: 640px) {
    /* The step's main button stays in reach of the thumb. */
    .v2-request .screen:not(#screen-confirm):not(#screen-status) .btn-row { position: sticky; bottom: 0; z-index: 5; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--v2-line); background: var(--v2-card); box-shadow: 0 -6px 18px rgba(11, 26, 43, .08); }
    .v2-request .btn-row > .btn { flex: 1 1 0; min-width: 0; }
    #screen-confirm .confirm-ticket { padding: 18px; }
    #screen-confirm .confirm-head { gap: 14px; }
    .confirm-mark, body.dark-mode .confirm-mark { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    #loader .spinner { animation-duration: 3s; }
    .rp-action { transition: none; }
    .rp-action:hover { transform: none; }
}

/* Profile */
.v2-profile .v2-card, .v2-profile .v2-record { border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.v2-profile .corrections-panel { box-shadow: none; }

/* Help: topics first, then plain answers */
.rp-topics, .jump-links.rp-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rp-topics a, .jump-links.rp-topics a { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 18px; border: 2px solid var(--v2-line); border-radius: var(--rp-radius-sm); background: var(--v2-card); color: var(--v2-ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.rp-topics a:hover, .rp-topics a:focus-visible { border-color: var(--v2-brand); background: var(--v2-brand-tint); }
.rp-topic-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--v2-brand-subtle); color: var(--v2-brand-strong); }
.rp-topic-icon svg { width: 24px; height: 24px; }
.rp-faq { display: grid; gap: 10px; max-width: 880px; }
.rp-faq details { border: 1px solid var(--v2-line); border-radius: var(--rp-radius-sm); background: var(--v2-card); }
.rp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 10px 18px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
.rp-faq summary::-webkit-details-marker { display: none; }
.rp-faq summary::after { content: "+"; flex: 0 0 auto; color: var(--v2-brand); font: 800 28px/1 var(--v2-font-display); }
.rp-faq details[open] summary::after { content: "\2212"; }
.rp-faq details[open] summary { border-bottom: 1px solid var(--v2-line); }
.rp-faq details p { margin: 0; padding: 12px 18px 16px; font-size: 16px; }
@media (max-width: 960px) { .rp-topics, .jump-links.rp-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .rp-topics, .jump-links.rp-topics { grid-template-columns: minmax(0, 1fr); } }

/* QR verification result */
.v2-verify-result { border-radius: var(--rp-radius); }
.v2-verify .v2-details { border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }

/* Tablet: two columns only where both stay readable */
@media (min-width: 641px) and (max-width: 1080px) {
    .container { padding-inline: 32px; }
    .page-band-inner { padding-inline: 32px; }
}
.rp-profile-card .v2-summary-note .v2-ref { display: block; white-space: nowrap; color: var(--v2-ink); font-size: 16px; }

/* Document options on phones: one column of text beside the radio, nothing squeezed */
@media (max-width: 640px) {
    .cert-btn, body.dark-mode .cert-btn { grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto; align-items: start; row-gap: 2px; min-height: 0; padding: 16px; }
    .cert-btn::before { grid-column: 1; grid-row: 1 / span 4; margin: 2px 14px 0 0; }
    .cert-btn .label { grid-column: 2; grid-row: 1; }
    .cert-btn .fee { grid-column: 2; grid-row: 2; white-space: normal; }
    .cert-btn .cert-validity { grid-column: 2; grid-row: 3; }
    .cert-btn .cert-validity::before { content: none; }
    .cert-btn .cert-selected { grid-column: 2; grid-row: 4; margin: 4px 0 0; }
}
.office-section.v2-office { margin-top: 44px; }
@media (max-width: 640px) {
    .cert-grid { grid-auto-rows: auto; }
    .cert-grid .cert-btn { height: auto; align-content: start; }
}
.container > :is(.rp-error-summary, .rp-flash):first-child { margin-top: 20px; }

/* Public home page: restored to its original design (body.has-hero-header is set only there). These rules undo the resident portal sizes inside its content. */
body.has-hero-header .site-main { font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif; font-size: 15px; }
body.has-hero-header .site-main .btn:not(.btn-link) { min-height: 48px; padding: 11px 17px; border-radius: 6px; font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif; font-size: 14px; }
body.has-hero-header .site-main .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
body.has-hero-header .site-main .portal-hero .eyebrow { margin-bottom: 17px; padding: 9px 13px; }
body.has-hero-header .site-main .portal-hero-account a { color: var(--v2-green-200); }
body.has-hero-header .site-main .hotline-panel a:not(.btn) { color: #fff; }
body.has-hero-header .site-main .hotline-head a { color: var(--v2-green-200); }
body.has-hero-header .site-main .container { padding-bottom: 80px; }

/* Type scale for resident pages: readable without looking oversized. The public home page keeps its own sizes. */
body:not(.has-hero-header) .site-main :is(h1, h2, h3, h4) { font-weight: 700; letter-spacing: -.015em; }
body:not(.has-hero-header) .site-main .btn { font-weight: 600; }
.card-header h2 { font-size: 21px; }
.v2-card > h2, .v2-card-head h2, .v2-section-title { font-size: 18px; }
.v2-ref-row .v2-ref { font-size: 17px; }
.section-head h2 { font-size: 23px; }
.two-column > .v2-card h3, .service-item h3 { font-size: 17px; }
.v2-verify-result h2 { font-size: 21px; }
.status, .v2-status { font-size: 14px; font-weight: 600; min-height: 30px; }
.tag-unconfirmed { font-size: 13px; font-weight: 600; }
.steps-summary, .step-count { font-size: 14px; }
.v2-summary-note, .form-note, .list-caption { font-size: 14px; }

/* Account page: requests first, then who you are and account actions */
.rp-dashboard { grid-template-columns: minmax(0, 1fr) 360px; }
.rp-subhead { margin: 22px 0 6px; color: var(--v2-muted); font: 600 14px/1.3 var(--v2-font-body); letter-spacing: .02em; text-transform: uppercase; }
.rp-mini-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 20px; }
.rp-mini-date { color: var(--v2-muted); font-size: 15px; white-space: nowrap; }
.rp-profile-head { display: flex; align-items: center; gap: 14px; }
.rp-profile-head div { display: grid; gap: 2px; min-width: 0; }
.rp-profile-head strong { font-size: 17px; overflow-wrap: anywhere; }
.rp-profile-head .v2-ref { color: var(--v2-muted); font-size: 15px; }
.rp-profile-card .v2-avatar { width: 64px; height: 64px; flex: 0 0 auto; }
.rp-info-list { display: grid; width: 100%; margin: 8px 0 4px; }
.rp-info-list > div { padding: 10px 0; border-top: 1px solid var(--v2-line); }
.rp-info-list dt { color: var(--v2-muted); font-size: 14px; }
.rp-info-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.rp-profile-card .btn-full { margin-top: 4px; }
.rp-account-actions { display: grid; gap: 10px; }
.rp-account-actions .btn { width: 100%; }
.rp-account-actions .rp-logout { color: var(--v2-danger); }
@media (max-width: 1080px) { .rp-dashboard { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .rp-mini-list a { grid-template-columns: minmax(0, 1fr) auto; }
    .rp-mini-date { display: none; }
    .page-band-actions, .page-band-actions .btn { width: 100%; }
}

/* Resident dashboard: what needs attention, the two main actions, recent progress and help */
.rp-home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.rp-home-main, .rp-home-side { display: grid; gap: 24px; min-width: 0; }
.rp-attention { padding: 20px 22px; border: 1px solid #e7cf9b; border-left: 6px solid #c79a3a; border-radius: var(--rp-radius); background: var(--v2-warning-subtle); }
.rp-attention h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--v2-warning); font-size: 18px; }
.rp-attention h2::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.rp-attention ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rp-attention a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--v2-line); border-left: 5px solid var(--v2-brand); border-radius: var(--rp-radius-sm); background: var(--v2-card); color: var(--v2-ink); text-decoration: none; }
.site-main .rp-attention a { color: var(--v2-ink); text-decoration: none; }
.rp-attention li[data-status="ready_for_release"] a { border-left-color: var(--v2-success); }
.rp-attention li[data-status="rejected"] a { border-left-color: var(--v2-danger); }
.rp-attention li[data-status="photo"] a { border-left-color: #c79a3a; }
.rp-attention a:hover, .rp-attention a:focus-visible { background: var(--v2-brand-tint); }
.rp-attention-doc { grid-column: 1; }
.rp-attention-doc .v2-ref { margin-left: 6px; color: var(--v2-muted); font-size: 14px; }
.rp-attention-message { grid-column: 1; color: var(--v2-muted); font-size: 15px; }
.rp-attention-link { grid-column: 2; grid-row: 1 / span 2; color: var(--v2-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.rp-recent { display: grid; margin: 0; padding: 0; list-style: none; }
.rp-recent li + li { border-top: 1px solid var(--v2-line); }
.rp-recent a { display: grid; gap: 8px; padding: 16px 4px; color: var(--v2-ink); text-decoration: none; }
.site-main .rp-recent a { color: var(--v2-ink); text-decoration: none; }
.rp-recent a:hover .rp-recent-doc strong, .rp-recent a:focus-visible .rp-recent-doc strong { color: var(--v2-brand-strong); text-decoration: underline; }
.rp-recent-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.rp-recent-doc { display: grid; gap: 2px; }
.rp-recent-doc strong { font-size: 16px; }
.rp-recent-doc .v2-ref { color: var(--v2-muted); font-size: 14px; }
.rp-recent .status { margin: 0; }
.rp-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 320px; }
.rp-progress span { height: 6px; border-radius: 6px; background: var(--v2-line); }
.rp-progress span.is-done { background: var(--v2-brand-fill); }
.rp-recent li[data-status="ready_for_release"] .rp-progress span.is-done { background: var(--v2-success); }
.rp-recent-next { font-size: 15px; }
.rp-recent-date { color: var(--v2-muted); font-size: 14px; }
.rp-first-time { display: grid; gap: 14px; justify-items: start; }
.rp-first-time-lead { margin: 0; }
.rp-first-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: rpfirst; }
.rp-first-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px 12px; counter-increment: rpfirst; }
.rp-first-steps li::before { content: counter(rpfirst); grid-row: 1 / span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--v2-brand-subtle); color: var(--v2-brand-strong); font-weight: 700; }
.rp-first-steps strong { font-size: 16px; }
.rp-first-steps span { color: var(--v2-muted); font-size: 15px; }
.rp-account-page { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; max-width: 960px; }
@media (max-width: 1080px) {
    .rp-home { grid-template-columns: minmax(0, 1fr); }
    .rp-home-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
    .rp-home-side, .rp-account-page { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .rp-attention { padding: 16px; }
    .rp-attention a { grid-template-columns: minmax(0, 1fr); }
    .rp-attention-link { grid-column: 1; grid-row: auto; margin-top: 4px; }
    .rp-attention-doc .v2-ref { display: block; margin: 2px 0 0; }
}
.rp-recent li[data-status], .rp-attention li[data-status] { background: transparent; color: var(--v2-ink); }

/* One account page: who you are on the left, photo and security on the right */
.rp-account { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.rp-account-col { display: grid; gap: 24px; align-content: start; min-width: 0; }
.rp-account .rp-panel > h2 { margin-bottom: 8px; }
.rp-account-identity { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; }
.rp-account-identity h2 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.rp-account-avatar { width: 88px; height: 88px; flex: 0 0 auto; }
.rp-account-avatar svg { width: 40px; height: 40px; }
.rp-account-number { margin: 4px 0 0; color: var(--v2-muted); font-size: 15px; }
.rp-account-number .v2-ref { display: block; color: var(--v2-ink); font-size: 16px; }
.rp-account .rp-info-list { margin: 0; }
.rp-account .record-lock { margin: 14px 0 0; font-weight: 600; }
.rp-corrections { margin-top: 16px; border-top: 1px solid var(--v2-line); }
.rp-corrections summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--v2-brand); font-weight: 600; cursor: pointer; list-style: none; }
.rp-corrections summary::-webkit-details-marker { display: none; }
.rp-corrections summary::after { content: "+"; font: 700 22px/1 var(--v2-font-display); }
.rp-corrections[open] summary::after { content: "\2212"; }
.rp-corrections .numbered-list { display: grid; gap: 8px; margin: 0 0 12px; padding-left: 22px; }
.rp-account .rp-note-warning { margin: 4px 0 16px; }
.rp-account form .form-group { margin-bottom: 18px; }
@media (max-width: 860px) { .rp-account { grid-template-columns: minmax(0, 1fr); } }

/* Barangay announcements on the dashboard */
.rp-news { display: grid; margin: 0; padding: 0; list-style: none; }
.rp-news li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--v2-line); }
.rp-news li:first-child { padding-top: 0; border-top: 0; }
.rp-news time { color: var(--v2-muted); font-size: 14px; }
.rp-news h3 { margin: 0; font-size: 16px; }
.rp-news p { margin: 0; color: var(--v2-muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-news a { justify-self: start; font-weight: 600; }
.rp-account form { margin-top: 14px; }

/* Anabu green theme for the homepage and older shared layers: colour only, layout untouched. */
.portal-band, body.dark-mode .portal-band { background-color: var(--v2-forest-950); }
.portal-hero-photo::after { background: linear-gradient(90deg, rgba(19, 40, 28, .92) 0%, rgba(19, 40, 28, .78) 38%, rgba(19, 40, 28, .35) 68%, rgba(19, 40, 28, .1) 100%), linear-gradient(0deg, rgba(19, 40, 28, .45) 0%, transparent 35%); }
.portal-hero-photo figcaption { background: rgba(19, 40, 28, .86); }
.portal-hero .eyebrow, body.dark-mode .portal-hero .eyebrow { border-left-color: var(--v2-gold); }
body.has-hero-header:not(.hero-header-scrolled) .site-brand-portal { color: var(--v2-green-200); }
.howto, body.dark-mode .howto { border-color: var(--v2-forest-950); background: var(--v2-forest-950); color: var(--v2-on-dark); }
.howto > p:not(.eyebrow), .howto-note { color: var(--v2-on-dark-muted); }
.howto .eyebrow { color: var(--v2-green-200); }
.howto-steps li { border-color: rgba(255, 255, 255, .14); color: var(--v2-on-dark); }
.howto-steps li::before { background: rgba(255, 255, 255, .1); color: var(--v2-green-200); }
.howto-note { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); }
.doc-rates-table thead, .doc-rates-table thead th { background: var(--v2-subtle); }
.hotline-panel, body.dark-mode .hotline-panel { background: var(--v2-forest-950); }
.hotline-head p, .hotline-list span { color: var(--v2-on-dark); }
.hotline-list li { border-color: rgba(255, 255, 255, .16); border-left-color: var(--v2-gold); }
@media (max-width: 700px) {
    .portal-hero-photo::after, body.has-hero-header .portal-hero-photo::after { background: linear-gradient(180deg, rgba(19, 40, 28, .45) 0%, rgba(19, 40, 28, .62) 38%, rgba(19, 40, 28, .92) 100%); }
}

/* The government bar (language and theme) and the main navigation stay together at the top while scrolling. */
:root { --rp-gov-bar-height: 43px; }
.gov-bar, body.dark-mode .gov-bar { position: sticky; top: 0; z-index: 61; }
.gov-bar-inner { height: 40px; min-height: 0; }
.site-header, body.dark-mode .site-header { top: var(--rp-gov-bar-height); }
html { scroll-padding-top: calc(var(--rp-gov-bar-height) + 96px); }
.gov-actions .theme-toggle:hover { background: rgba(255, 255, 255, .1); }
@media (max-width: 700px) {
    :root { --rp-gov-bar-height: 51px; }
    .gov-bar-inner { height: 48px; }
}

/* Dark mode: charcoal surfaces with green accents rather than green panels. */
body.dark-mode .howto, body.dark-mode .hotline-panel { border: 1px solid var(--v2-line); background: var(--v2-card); }
body.dark-mode .howto-steps li::before { background: var(--v2-brand-subtle); color: var(--v2-brand); }
body.dark-mode .portal-hero-photo::after { background: linear-gradient(90deg, rgba(15, 20, 18, .94) 0%, rgba(15, 20, 18, .8) 38%, rgba(15, 20, 18, .4) 68%, rgba(15, 20, 18, .12) 100%), linear-gradient(0deg, rgba(15, 20, 18, .5) 0%, transparent 35%); }
body.dark-mode .portal-hero-photo figcaption { background: rgba(15, 20, 18, .88); }
@media (max-width: 700px) {
    body.dark-mode .portal-hero-photo::after, body.dark-mode.has-hero-header .portal-hero-photo::after { background: linear-gradient(180deg, rgba(15, 20, 18, .5) 0%, rgba(15, 20, 18, .66) 38%, rgba(15, 20, 18, .94) 100%); }
}

/* Dark mode surface hierarchy. Light mode resolves these tokens to its existing values. */
body.dark-mode .site-header { border-bottom: 1px solid var(--v2-line); background: var(--v2-header); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
body.dark-mode .page-band { border-bottom-color: var(--v2-line); background: var(--v2-subtle); }
body.dark-mode :is(.v2-card, .rp-panel, .rp-form-card, .card, .rp-action:not(.rp-action-primary), .request-table, .doc-rates, .notice-callout, .service-table, .office-details, .map-panel, .rp-attention li a) { border-color: var(--v2-line); box-shadow: var(--rp-shadow); }
body.dark-mode :is(.v2-terms-summary, .rp-account-list, .resident-logout-dialog, dialog, .doc-rates-table thead, .doc-rates-table thead th, .request-table thead th, .confirm-ticket) { background: var(--v2-elevated); }
body.dark-mode .v2-terms-summary { border: 1px solid var(--v2-line-elevated); border-left: 4px solid var(--v2-brand); }
body.dark-mode :is(.rp-account-list, .resident-logout-dialog, dialog) { border: 1px solid var(--v2-line-elevated); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
body.dark-mode .v2-steps li.is-current::before { border-color: var(--v2-brand-fill); background: var(--v2-brand-fill); color: #fff; box-shadow: 0 0 0 4px var(--v2-brand-subtle); }
body.dark-mode .v2-steps li.is-current { color: var(--v2-brand-strong); }
body.dark-mode .form-input:hover:not(:focus):not([readonly]) { border-color: var(--v2-ink); }
body.dark-mode .form-input[readonly] { border-color: var(--v2-line); background: var(--v2-subtle); }
body.dark-mode :is(.form-input, select, textarea):disabled, body.dark-mode .btn:disabled { border-color: var(--v2-line); background: var(--v2-subtle); color: var(--v2-muted); opacity: 1; }
body.dark-mode .request-item + .request-item { border-top: 1px solid var(--v2-line); }
body.dark-mode .request-item:hover { background: var(--v2-brand-tint); }

/* Data Privacy Notice before a new resident application. Modal with JavaScript; inline (not modal) without it. */
.rp-privacy-dialog { width: min(640px, calc(100% - 32px)); max-height: min(88dvh, 760px); padding: 0; border: 1px solid var(--v2-line); border-radius: var(--rp-radius-sm, 12px); background: var(--v2-card); color: var(--v2-ink); box-shadow: 0 24px 60px rgba(9, 19, 28, .28); }
.rp-privacy-dialog:not(:modal) { position: static; width: auto; max-height: none; margin: 0 0 24px; box-shadow: none; }
.rp-privacy-dialog::backdrop { background: rgba(9, 19, 28, .6); }
.rp-privacy-dialog-inner { display: flex; flex-direction: column; gap: 14px; max-height: inherit; padding: 24px; }
.rp-privacy-dialog-header h2 { margin: 2px 0 6px; font-size: 22px; }
.rp-privacy-dialog-header p { margin: 0; color: var(--v2-muted); }
.rp-privacy-dialog-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--v2-brand) !important; }
.rp-privacy-dialog-body { flex: 1 1 auto; min-height: 140px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 12px; border: 1px solid var(--v2-line); border-radius: 8px; background: color-mix(in srgb, var(--v2-card) 92%, var(--v2-green-50)); line-height: 1.6; }
.rp-privacy-dialog:not(:modal) .rp-privacy-dialog-body { max-height: 320px; }
.rp-privacy-dialog-body:focus-visible { outline: 3px solid var(--v2-brand); outline-offset: 2px; }
.rp-privacy-dialog-body h3 { margin: 14px 0 4px; font-size: 16px; }
.rp-privacy-dialog-body p { margin: 0; }
.rp-privacy-dialog-hint { margin: 0; font-size: 14px; color: var(--v2-muted); }
.rp-privacy-dialog-consent { align-items: flex-start; gap: 10px; }
.rp-privacy-dialog-consent input { flex: none; width: 20px; height: 20px; margin-top: 3px; }
.rp-privacy-dialog-consent input:disabled + label { opacity: .6; }
.rp-privacy-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.rp-privacy-dialog-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 520px) {
  .rp-privacy-dialog-inner { padding: 18px; }
  .rp-privacy-dialog-actions .btn { flex: 1 1 140px; }
}
body.dark-mode .rp-privacy-dialog { border-color: var(--v2-line-elevated); background: var(--v2-elevated); }
body.dark-mode .rp-privacy-dialog-body { border-color: var(--v2-line-elevated); background: var(--v2-card); }
.new-resident-privacy-review { margin-right: auto; }
.new-resident-card .new-resident-form-actions { flex-wrap: wrap; align-items: center; gap: 12px; }
.rp-privacy-dialog:modal { display: flex; flex-direction: column; overflow: hidden; }
.rp-privacy-dialog:modal .rp-privacy-dialog-inner { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
.rp-privacy-dialog:modal .rp-privacy-dialog-body { min-height: 120px; }
@media (max-width: 520px) { .rp-privacy-dialog:modal { width: calc(100% - 20px); max-height: calc(100dvh - 20px); } }

/* Emergency hotlines: one card per service, which may have several numbers, a note and a Pending verification tag. */
ul.rp-hotlines > li { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; min-width: 0; }
.rp-hotlines .rp-hotline-label { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.rp-hotlines .rp-hotline-note { font-size: 13px; font-weight: 500; opacity: .85; }
.rp-hotlines .rp-hotline-numbers { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.rp-hotlines .rp-hotline-numbers a { white-space: nowrap; }
.rp-hotlines .tag-unconfirmed { color: var(--v2-warning); white-space: nowrap; }
.rp-hotlines .tag-unconfirmed span { color: inherit; }
.rp-office-days { font-size: .9em; opacity: .85; }
