/* ---------------------------------------------------------------------------
   The user dashboard: the admin console's kit (admin/assets/style.css, linked
   before this file by sg_portal_stylesheets()) with the portal's own pages on
   top. The palette, the sidebar, the page margins, cards, tiles, tables,
   notices, buttons and fields are the kit's and are not restyled here, so the
   two dashboards cannot drift apart; this file holds only what the portal has
   and the console has not (the shell's grid, sign-in, the settings rows, the
   reviewer application). Light or dark (lib/theme.php), like the extension.
   --------------------------------------------------------------------------- */
/* Colours, edges, corners and type are the kit's (admin/assets/style.css), one definition for the console
   and the portal: nothing here redefines them. tests/portal_theme_test.php holds that line. */
body.sgo { min-width: 320px; }

/* ---- Shell: floating sidebar + page ----------------------------------------- */
/* The extension's settings pages: only when the extension marked the page. */
.ext-nav { display: none; }
html[data-siteguard-extension] .ext-nav { display: contents; }
.ext-nav .nav-label:first-child { margin-top: 16px; }
.settings-nav .ext-open { width: 13px; height: 13px; margin-left: auto; opacity: 0; transition: opacity .15s; }
.settings-nav a:hover .ext-open, .settings-nav a:focus-visible .ext-open { opacity: .6; }

.options-main { max-width: 1680px; animation: page-in .5s var(--spring); }   /* its margins are the kit's (.main, .options-main) */

@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-3px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .options-main { animation: none; } }


/* Sign-in and registration: a centred card on a quiet background. */
/* In the extension's sign-in dialog style: the logo, then one white card.
   Centred in the window rather than hung from the top; a form taller than the
   window (registration on a phone) simply scrolls. */
body.sgo-auth { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; padding: 40px 0; }
.sgo-auth .auth-card { width: 100%; max-width: 420px; margin: 0 auto; box-sizing: border-box; }
.auth-logo { display: block; width: auto; height: 56px; margin: 0 auto 24px; }
/* The logo with a small pill saying which page this is (Setup, Password reset). */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto 24px; }
.auth-brand .auth-logo { margin: 0; }
.auth-role { background: var(--surface); box-shadow: var(--pill-shadow, 0 0 0 1px rgba(0, 0, 0, .08)); color: var(--muted); letter-spacing: .02em; font-weight: 600; display: inline-flex; align-items: center; height: var(--pill-h); padding: 0 10px; border-radius: 999px; font-size: var(--fs-small); line-height: 1; white-space: nowrap; }
/* A hint beside a field's label ("at least 8 characters"), and one under its input. */
.sgo-auth .auth-card label > span small { margin-left: 4px; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }
.sgo-auth .auth-card .field-hint { margin: 0; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; line-height: 1.45; }
.sgo-auth .auth-card code { padding: 1px 5px; border-radius: 6px; background: var(--chip, rgba(0, 0, 0, .06)); font-size: var(--fs-caption); }
@media (max-width: 480px) { body.sgo-auth { justify-content: flex-start; padding: 40px 20px 28px; } .auth-logo { height: 40px; margin-bottom: 18px; } .auth-card h1 { font-size: var(--fs-h1); } .auth-card .auth-lede { margin-bottom: 18px; font-size: var(--fs-small); } }
/* A field whose label has a link beside it ("Forgot password?"). */
.sgo-auth .auth-field { display: grid; gap: 6px; }
.sgo-auth .auth-field label { display: block; }
.sgo-auth .auth-field input { margin: 0; }
.sgo-auth .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--fs-small); }
.sgo-auth .label-row a { font-size: var(--fs-small); font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.sgo-auth .label-row a:hover { text-decoration: underline; }
/* The other way in, under the card: one line, its link in the accent (a second
   card with a full-width button made a phone's screen a stack of boxes). A form
   there (the extension sign-in's "Not you?") keeps its button. */
.sgo-auth div.auth-alt { display: block; margin-top: 20px; padding: 0; background: none !important; box-shadow: none; color: var(--muted); font-size: var(--fs-body); text-align: center; }
.sgo-auth div.auth-alt a { display: inline; min-height: 0; margin-left: 6px; padding: 0; border-radius: 0; background: none !important; box-shadow: none !important; color: var(--accent-ink); font-weight: 600; text-decoration: none; --jelly: 0; }
.sgo-auth div.auth-alt a:hover { text-decoration: underline; text-underline-offset: 2px; filter: none; }
/* Under every sign-in card, the way to the other page: a line of text, then a full-width button. */
.sgo-auth .auth-alt { display: grid; gap: 10px; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: var(--fs-body); text-align: center; }
.sgo-auth .auth-alt a { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
/* The other way in is the kit's neutral raised face (admin/assets/style.css), in the accent's ink: it lights up under the pointer and gives under a press, like every button (press.js). */
.sgo-auth .auth-alt :is(a, button[type=submit]) { transition: transform .35s var(--spring), box-shadow .2s; }
.sgo-auth .auth-alt :is(a, button[type=submit]) { --jelly: 1; }
.sgo-auth .auth-alt :is(a, button[type=submit]):hover { text-decoration: none; background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .17), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); }
.sgo-auth .auth-alt :is(a, button[type=submit]):active { transform: scale(var(--tap)); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .14); transition-duration: .08s; }
:root[data-theme="dark"] .sgo-auth .auth-alt :is(a, button[type=submit]) { background: linear-gradient(180deg, #363639 0%, #2d2d30 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .09), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .sgo-auth .auth-alt :is(a, button[type=submit]):hover { background: linear-gradient(180deg, #3d3d41 0%, #333337 100%); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .14), 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .sgo-auth .auth-alt :is(a, button[type=submit]):active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .sgo-auth .auth-alt :is(a, button[type=submit]) { transition: none; transform: none !important; } }
.sgo-auth .auth-note { margin: 14px 0 0; color: var(--faint); font-size: var(--fs-small); text-align: center; }
/* A full-width button inside a sign-in card (the SSO and extension pages' way out). */
.sgo-auth .auth-card .btn-block { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; margin-top: 16px; }
.sgo-auth .auth-card h1 { font-size: calc(var(--fs-h1) * .875); font-weight: 600; letter-spacing: -.02em; }
.sgo-auth .auth-card .card { padding: 26px; border-radius: 12px; box-shadow: var(--pop-shadow); }
@media (max-width: 380px) {
  /* Narrow phones: a little more room for the fields and the robot check. */
  .sgo-auth .auth-card { padding: 0 12px; }
  .sgo-auth .auth-card .card { padding: 20px 16px; }
}
.sgo-auth .auth-card label { display: grid; gap: 6px; font-size: var(--fs-small); }
.sgo-auth .auth-card label > small { display: inline; margin-left: 4px; }
.sgo-auth .auth-card label:has(> small) { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 0; }
.sgo-auth .auth-card label:has(> small) > :not(small) { grid-column: 1 / -1; }
.sgo-auth .auth-card button[type=submit] { min-height: 36px; }
/* "Use another account" signs out with a POST: a button that looks like the bar's link. */
.sgo-auth .auth-card .auth-alt button[type=submit] { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 0 14px; border-radius: 10px; background: linear-gradient(180deg, #ffffff 0%, #f4f4f7 100%); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .05), 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06); color: var(--accent-ink); font-size: var(--fs-body); font-weight: 600; }
.sgo-auth .auth-card .auth-alt button[type=submit]:hover { color: var(--accent-ink); filter: none; }
/* The header's sign-out icon, over this design's own button look. */
.sgo .sign-out-button { min-height: 0; padding: 0; background: none; box-shadow: none; color: var(--muted); }
.sgo .sign-out-button:hover, .sgo .sign-out-button:focus-visible { background: var(--hover); color: var(--red); }
.sgo-auth .legal-page .card { border-radius: 12px; }
.auth-card { max-width: 400px; margin: 72px auto; padding: 0 16px; }
.auth-card .card { padding: 26px 26px 22px; }
.auth-card h1 { margin: 0 0 6px; font-size: var(--fs-figure-sm); text-align: center; }
/* "Resend verification email" under the sign-in page's notice. */
.sgo-auth .verify-resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: -4px 0 16px; color: var(--muted); font-size: var(--fs-small); }
.auth-card .auth-lede { margin: 0 0 20px; color: var(--muted); font-size: var(--fs-body); text-align: center; }
.auth-card .brand-dot { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 12px; background: var(--accent); box-shadow: 0 6px 18px rgba(31, 122, 87, .28); color: #fff; }
.auth-card .brand-dot svg { width: 26px; height: 26px; }
.auth-card button[type=submit] { width: 100%; min-height: 40px; }
.auth-card .switch { margin-top: 16px; color: var(--muted); font-size: var(--fs-body); text-align: center; }

/*
 * Reviewer application form
 * --------------------------------------------------------------------------
 * The application asks for a date of birth, a country, an occupation and three
 * pieces of writing. As one flat stack that reads as a wall of inputs and gives
 * no sense of how much is left, so it is split into numbered steps, the short
 * facts share a row, and the follow-up questions an answer unlocks appear as an
 * indented panel attached to the answer that opened them.
 */
.apply-form { padding-bottom: 20px; }
.apply-intro { margin: -6px 0 0; max-width: 62ch; font-size: var(--fs-small); line-height: 1.65; color: var(--muted); }

.apply-step { padding: 18px 0 0; }
.apply-step + .apply-step { margin-top: 18px; border-top: 1px solid var(--border); }
.apply-step > h3 {
  display: flex; align-items: center; gap: 9px; margin: 0 0 14px;
  font-size: var(--fs-body); font-weight: 600;
}
/* Numbered rather than just bold, so the three steps read as a sequence with an
   end to it instead of three unrelated headings. */
.apply-step .step-num {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: var(--fs-caption); font-weight: 700;
}

/* Short answers pair up on one row; anything that needs room to be searched or
   typed into gets its own. Both collapse to a single column well before the
   sidebar does, because these sit in the narrower of two page columns. */
.apply-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.apply-grid.apply-grid-lead { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
@media (max-width: 620px) {
  .apply-grid, .apply-grid.apply-grid-lead { grid-template-columns: 1fr; }
}

.apply-field { min-width: 0; }
.apply-field + .apply-field,
.apply-grid + .apply-field { margin-top: 14px; }
.apply-grid .apply-field + .apply-field { margin-top: 0; }

/*
 * A follow-up question, shown only once the answer above asks for it. Indented
 * and rule-marked so it reads as belonging to that answer rather than as another
 * top-level question. [hidden] is the toggle, so the panel is genuinely removed
 * from the tab order and the accessibility tree while it does not apply.
 */
.sub-panel {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.sub-panel[hidden] { display: none; }
.sub-panel-title {
  margin: 0 0 10px;
  font-size: var(--fs-micro); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}

/* The minimum lengths the server enforces, shown while typing instead of as a
   validation bubble after the writing is finished. */
.counter { font-variant-numeric: tabular-nums; }
.counter.is-short, .field-hint.is-short { color: var(--warn); font-weight: 600; }
.counter.is-ok, .field-hint.is-ok { color: var(--ok); }

.apply-agree {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft);
  font-size: var(--fs-small); font-weight: 400; line-height: 1.6;
}
.apply-agree input { margin: 2px 0 0; flex: 0 0 auto; align-self: flex-start; }

.apply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.apply-note { font-size: var(--fs-caption); color: var(--muted); }

/*
 * Shared small pieces on this page
 * --------------------------------------------------------------------------
 * These replace the inline font-size/colour attributes the page used to repeat
 * on nearly every paragraph.
 */

.note-card h2 { margin-bottom: 8px; }
.note-card p { margin: 0 0 12px; font-size: var(--fs-small); line-height: 1.6; }
.note-card.note-warn { border-left-color: var(--warn); }
.note-card.note-muted { border-left-color: var(--muted); }
.note-card.note-muted p { color: var(--muted); }

.status-note { margin: 0 0 12px; font-size: var(--fs-small); line-height: 1.6; }

.steps-list { margin: 0; padding-left: 20px; font-size: var(--fs-small); line-height: 1.7; }
.steps-list li + li { margin-top: 3px; }

.checklist { margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); line-height: 1.55; }
.checklist li { display: flex; gap: 8px; padding: 4px 0; }
.checklist li::before { content: "✓"; flex: 0 0 auto; color: var(--ok); font-weight: 700; }

.stats.stats-compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats.stats-compact .stat { padding: 12px 14px; }
.stats.stats-compact .stat .label { font-size: var(--fs-micro); }
.stats.stats-compact .stat .value { font-size: var(--fs-figure-sm); margin-top: 4px; }

dl.kv.kv-tight { grid-template-columns: 82px 1fr; gap: 7px 12px; margin-bottom: 14px; }

/* Applications and status changes, newest first, as one dated thread. */
.timeline { margin: 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid var(--border); }
.timeline > li { position: relative; padding: 0 0 16px 14px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -23px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: #fff;
  border: 2px solid var(--border);
}
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-small); }
.timeline-meta { margin-top: 3px; font-size: var(--fs-caption); color: var(--muted); }
.timeline-body { margin-top: 5px; font-size: var(--fs-caption); line-height: 1.6; }

/*
 * A pending reviewer application
 * --------------------------------------------------------------------------
 * The card is the applicant's status while they wait: where the application is
 * in the process, what they sent, and what they can still do. It replaces the
 * one-line note plus a separate status card that said the same thing.
 */
.app-pending-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.app-pending-head h2 { margin: 0 0 4px; }
.app-pending-head .badge { flex: none; margin-top: 2px; }

.app-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 6px; padding: 0; list-style: none; }
.app-track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 6px; text-align: center; }
/* The connector runs from each step's dot to the next one's. */
.app-track li + li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); }
.app-track li.is-done + li::before { background: var(--ok); }
.app-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 6px;
  border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface);
  color: var(--muted); font-size: var(--fs-caption); font-weight: 700;
}
.app-track li.is-done .app-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.app-track li.is-current .app-dot { border-color: var(--warn); color: var(--warn); box-shadow: 0 0 0 4px var(--amber-soft); }
.app-track strong { color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.app-track li:not(.is-done):not(.is-current) strong { color: var(--muted); font-weight: 600; }
.app-track small { color: var(--muted); font-size: var(--fs-caption); }
.app-track li.is-current small { color: var(--warn); font-weight: 600; }

.app-section { margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: var(--fs-small); font-weight: 600; }
.app-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0; }
.app-summary > div { min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.app-summary dt { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; }
.app-summary dd { margin: 2px 0 0; color: var(--ink); font-size: var(--fs-small); font-weight: 600; overflow-wrap: anywhere; }

.app-answers { margin-top: 10px; }
.app-answers > summary { display: inline-block; cursor: pointer; color: var(--accent-ink); font-size: var(--fs-small); font-weight: 600; }
.app-answer { margin-top: 12px; }
.app-answer span { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; }
.app-answer p { margin: 4px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); font-size: var(--fs-small); line-height: 1.6; overflow-wrap: anywhere; }

.app-wait { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.app-wait strong { color: var(--accent-ink); font-size: var(--fs-small); }
.app-wait p { margin: 3px 0 0; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.6; }

.app-withdraw { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; }

.steps-list li.is-current { color: var(--ink); font-weight: 600; }
.steps-list li.is-current .badge { margin-left: 4px; font-size: var(--fs-micro); vertical-align: 1px; }

@media (max-width: 480px) {
  .app-track small { display: none; }
}

/* Sign-up agreement and the public Disclaimer & privacy page. */
.consent-check { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 8px; align-items: flex-start; font-size: var(--fs-small); font-weight: 400; color: var(--muted); }
.consent-check > span { flex: 1; min-width: 0; }
/* Its error under the words, not beside them. */
.consent-check > .field-error { flex-basis: 100%; margin: 0; }
.consent-check input { width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.legal-page { max-width: 760px; margin: 48px auto; padding: 0 16px; }
.legal-page h1 { margin: 0 0 6px; font-size: var(--fs-h1); }
.legal-page .card { padding: 8px 26px 20px; }
.legal-page h2 { margin: 18px 0 6px; font-size: var(--fs-h2); }
.legal-page p, .legal-page li { color: var(--ink-soft, #3a3a3e); font-size: var(--fs-body); line-height: 1.6; }
.legal-page ul { padding-left: 20px; }

/* My logs: the log sharing line above the stats (user/index.php). */
.sgo .log-sharing-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.sgo .log-sharing-line .btn { flex: none; }

/* ---- Privacy & reporting (user/reporting.php) --------------------------------
   The settings rows are the kit's (admin/assets/style.css, "Settings rows"). Here: the page's two
   columns and what only this page has. */
.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; } /* the same split as the admin's detail pages */
.rp .rp-scope { padding: 5px 11px; border-radius: 8px; background: var(--fill-strong); color: var(--ink); font-size: var(--fs-small); font-weight: 600; }
.rp .rp-device { flex-wrap: wrap; }
.rp .rp-device-name { flex: 1 1 220px; min-width: 0; }
.rp .rp-device-mode { flex: 0 1 260px; width: auto; }
.rp .rp-device .log-why { flex: 1 1 100%; margin: 4px calc(var(--row-x) * -1) -12px; padding: 12px var(--row-x); }
/* Signed out: the notice alone, one readable column. */
.rp-grid.single { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
/* The notice in a dialog over the sign-up form, so reading it doesn't leave the page. */
.legal-dialog { width: min(680px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0; border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 24px 60px rgba(29, 29, 31, .28); color: var(--ink); }
.legal-dialog::backdrop { background: rgba(24, 24, 26, .45); }
.legal-dialog[open] { display: flex; flex-direction: column; }
.legal-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.legal-dialog header h2 { margin: 0; font-size: var(--fs-h2); }
.legal-dialog header small { display: block; color: var(--muted); font-size: var(--fs-caption); font-weight: 400; }
.legal-dialog .legal-x { display: grid; place-items: center; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--muted); }
.legal-dialog .legal-x:hover { background: var(--accent-soft); color: var(--accent-ink); }
.legal-dialog .legal-x svg { width: 18px; height: 18px; }
.legal-dialog .legal-body { overflow-y: auto; padding: 4px 20px 12px; font-size: var(--fs-body); line-height: 1.6; }
.legal-dialog .legal-body h3 { margin: 16px 0 6px; font-size: var(--fs-body); }
.legal-dialog .legal-body ul { padding-left: 20px; }
.legal-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.legal-dialog footer button { min-height: 40px; }
@media (max-width: 480px) { .legal-dialog footer button { flex: 1; } }
.rp .rp-log-list, .rp .rp-history { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rp .rp-log-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-small); }
.rp .rp-history .label { font-size: var(--fs-small); }
.rp .mono { font-family: var(--mono); font-size: var(--fs-caption); }
.rp .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1080px) {
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
  .rp .page-aside { position: static; }
}
@media (max-width: 560px) {
  .rp .page-header { flex-direction: column; align-items: flex-start; }
  .rp .rp-device-mode { flex-basis: 100%; }
}
.rp .text-input::placeholder { font-weight: 400; }

/* ---- Disclaimer & privacy (user/privacy.php): the extension's notice card ---- */
.rp .legal-notice { padding: 6px var(--row-x) 16px; }
.rp .legal-notice h3 { margin: 16px 0 6px; color: var(--ink); font-size: var(--fs-h3); font-weight: 600; }
.rp .legal-notice p { margin: 0 0 8px; color: var(--ink-soft); font-size: var(--fs-body); line-height: 1.6; }
.rp .legal-notice ul { margin: 0 0 8px; padding-left: 20px; color: var(--ink-soft); font-size: var(--fs-body); line-height: 1.6; }
.rp .legal-notice li + li { margin-top: 3px; }
/* Signed out: the same page, without the sidebar. */
.sgo-public { background: var(--canvas); }
.public-page { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }
.public-brand { display: inline-flex; margin-bottom: 28px; }
.public-brand img { display: block; height: 34px; width: auto; }
@media (max-width: 560px) { .public-page { padding: 20px 16px 48px; } }

/* A newer Disclaimer and Privacy notice than the account agreed to: a line on
   every page (partials/header.php), and on privacy.php what changed and the
   button to agree. */
.legal-banner { margin: 0 0 18px; }
.legal-banner a { margin-left: 6px; font-weight: 600; }
.rp .legal-update { margin-bottom: 20px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--amber-line, #f3d19c), var(--pop-shadow, none); }
.rp .legal-update h2 { margin: 0 0 6px; font-size: var(--fs-h2); }
.rp .legal-update p { margin: 0 0 8px; }
.rp .legal-update ul { margin: 0 0 12px; padding-left: 20px; }

/* The language switch (lib/i18n.php sg_lang_switch): Auto, EN, BM, 中文. Under
   the theme switch at the foot of the sidebar, as wide as it (admin/assets/style.css,
   with the console's); under the card on the sign-in pages. */
@media (max-width: 860px) { .settings-sidebar > .lang-switch { margin: 0; } }
.lang-pick { position: relative; display: flex; align-items: center; margin: 0; }
/* The kit's select, with the globe inside its left end. Its list opens under it, as wide as the
   longest language and lined up on the right, so it never runs off the page's edge. */
.lang-pick select:not([multiple]):not([size]) { width: auto; min-width: 0; margin: 0; padding-left: 34px; }
.lang-pick select::picker(select) { min-width: max(anchor-size(width), max-content); position-area: bottom span-left; transform-origin: top right; }
.lang-pick option { white-space: nowrap; }
.lang-pick-icon { position: absolute; left: 12px; z-index: 1; width: 16px; height: 16px; pointer-events: none; }


/* ---- Dark mode (lib/theme.php) ------------------------------------------------ */
:root[data-theme="dark"] .sgo-auth .auth-alt { background: rgba(255, 255, 255, .03); }
:root[data-theme="dark"] .timeline > li::before { background: var(--surface); }
:root[data-theme="dark"] .app-track li.is-done .app-dot { color: var(--canvas); }
:root[data-theme="dark"] .legal-dialog::backdrop { background: rgba(0, 0, 0, .6); }




/* ---- Sign-in pages: the foot, and the wide screen's two halves --------------------------------- */
/* Theme and language under the form, small and quiet, as a sign-in page's foot. */
.sgo-auth .auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 28px auto 0; padding: 0 16px; }
.sgo-auth .auth-foot .theme-switch { margin: 0; }
.sgo-auth .auth-foot .lang-switch { flex: none; }
.sgo-auth .auth-foot .lang-switch a { padding-inline: 10px; font-size: var(--fs-caption); }

/* The aside: hidden until there is room for it beside the form. */
.auth-aside { display: none; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } }
@media (min-width: 1000px) {
  body.sgo-auth:has(> .auth-aside) { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(460px, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: center; padding: 0; background: var(--surface); }
  body.sgo-auth:has(> .auth-aside) > .auth-card { grid-column: 2; grid-row: 1; margin: 56px auto 0; animation: auth-rise .7s var(--spring) .05s both; }
  body.sgo-auth:has(> .auth-aside) > .auth-foot { grid-column: 2; grid-row: 2; margin: 24px auto 32px; }
  /* On the white half the form needs no card of its own. */
  body.sgo-auth:has(> .auth-aside) > .auth-card > .card { padding: 4px 0 0; background: none; box-shadow: none; }
  .auth-aside { position: relative; display: grid; grid-column: 1; grid-row: 1 / span 2; align-self: stretch; place-items: center; overflow: hidden; padding: 64px 56px; background: var(--canvas); border-right: 1px solid var(--line); }
  :root[data-theme="dark"] .auth-aside { background: #161618; }
  .auth-aside .sgd { --sgd-fade: var(--canvas); }
  :root[data-theme="dark"] .auth-aside .sgd { --sgd-fade: #161618; }
  .auth-aside-in { width: 100%; max-width: 520px; }
  .auth-aside-in > * { animation: auth-rise .8s var(--spring) both; }
  .auth-aside-in > :nth-child(2) { animation-delay: .06s; } .auth-aside-in > :nth-child(3) { animation-delay: .14s; } .auth-aside-in > :nth-child(4) { animation-delay: .24s; }
  .auth-aside-title { margin: 0; color: var(--ink); font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
  .auth-aside-sub { margin: 12px 0 32px; max-width: 30em; color: var(--muted); font-size: var(--fs-body); line-height: 1.55; }
}
@media (prefers-reduced-motion: reduce) {
  body.sgo-auth > .auth-card, .auth-aside-in > * { animation: none !important; }
}
