/* Client portal v2 (PORTAL_V2=on). Style A: light, airy, TherioTech red. Large type and tap targets.
   Loaded after portal.css on client pages ([data-pv2]) and by Views/portal_v2/layout.php (.pv2). */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --pv-bg: #f6f7f9; --pv-card: #fff; --pv-line: #e5e8ee; --pv-line-2: #eef0f4; --pv-text: #0f172a; --pv-text-2: #334155; --pv-muted: #5b6678;
  --pv-red: #c81e2c; --pv-red-2: #a8141f; --pv-red-soft: #fdecee; --pv-ok: #0b7a43; --pv-ok-soft: #e4f5ec; --pv-warn: #8a5a00; --pv-warn-soft: #fdf2dc;
  --pv-info: #1d4ed8; --pv-info-soft: #e7eefd; --pv-grey: #f1f3f6; --pv-r: 16px; --pv-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 20px rgba(15,23,42,.06);
}
body[data-pv2], body.pv2 { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 18px; line-height: 1.55; color: var(--pv-text); background: var(--pv-bg); -webkit-font-smoothing: antialiased; }
[data-pv2] a, .pv2 a { color: var(--pv-red); }
[data-pv2] :focus-visible, .pv2 :focus-visible { outline: 3px solid var(--pv-red); outline-offset: 2px; }

/* Header */
.pv2-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--pv-line); position: sticky; top: 0; z-index: 20; }
.pv2-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pv-text) !important; min-height: 48px; }
.pv2-brand img { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; }
.pv2-brand b { display: block; font-size: 15px; letter-spacing: .12em; font-weight: 780; }
.pv2-brand small { display: block; color: var(--pv-muted); font-size: 14px; }
.pv2-grow { flex: 1; }
/* AA7 monitoring account number(s): first row of the header, monitoring clients only. */
.pv2-top.pv2-has-acct { flex-wrap: wrap; row-gap: 8px; }
.pv2-acct { order: -1; flex: 1 0 100%; display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 10px; background: var(--pv-grey); color: var(--pv-text-2); font-size: 15px; line-height: 1.35; }
.pv2-acct svg { width: 18px; height: 18px; fill: none; stroke: var(--pv-red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.pv2-acct b { color: var(--pv-text); font-weight: 750; letter-spacing: .03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv2-acct-n { white-space: nowrap; }
.pv2-acct-sep { color: var(--pv-muted); }
@media (max-width: 640px) { .pv2-acct { font-size: 14px; padding: 5px 10px; gap: 6px; } .pv2-acct b { letter-spacing: .01em; } }
.pv2-nav { display: flex; gap: 4px; margin-left: 16px; }
.pv2-nav a { padding: 12px 16px; border-radius: 12px; font-weight: 640; color: var(--pv-text-2) !important; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; }
.pv2-nav a[aria-current="page"] { background: var(--pv-red-soft); color: var(--pv-red) !important; }
/* Desktop menu on one line (1280 / 1440): labels never break inside; French, with longer words, gets a little less padding. */
@media (min-width: 1100px) {
  .pv2-nav a { white-space: nowrap; }
  html[lang^="fr"] .pv2-nav { gap: 2px; }
  html[lang^="fr"] .pv2-nav a { padding-left: 13px; padding-right: 13px; }
}
.pv2-lang { display: inline-flex; border: 1px solid var(--pv-line); border-radius: 12px; overflow: hidden; }
.pv2-lang a, .pv2-lang button { min-width: 52px; min-height: 48px; display: inline-grid; place-items: center; font: 700 16px "Inter", system-ui, sans-serif; color: var(--pv-muted) !important; text-decoration: none; background: #fff; border: 0; cursor: pointer; }
.pv2-lang [aria-current="true"] { background: var(--pv-text); color: #fff !important; }
.pv2-call { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--pv-line); background: #fff; font-weight: 700; color: var(--pv-text) !important; text-decoration: none; white-space: nowrap; }
.pv2-call svg, .pv2-trust svg, .pv2-ico svg, .pv2-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.pv2-call svg { color: var(--pv-red); }

/* Trust */
.pv2-trust { order: 99; margin: 28px 0 0; padding: 18px 20px; border-radius: var(--pv-r); background: var(--pv-grey); border: 1px solid var(--pv-line-2); font-size: 16px; color: var(--pv-text-2); display: grid; gap: 10px; }
.pv2-trust p { display: flex; gap: 10px; margin: 0; align-items: flex-start; }
.pv2-trust svg { color: var(--pv-ok); margin-top: 3px; width: 20px; height: 20px; }
.pv2-trust strong { color: var(--pv-text); }

/* ---- Restyled tokenized pages (invoice, quote, receipt, enrol, contract, setup, error) ---- */
[data-pv2] main.portal { max-width: 760px; padding: 28px 20px 56px; display: flex; flex-direction: column; }
[data-pv2] main.portal > * { order: 10; }
[data-pv2] main.portal > .kicker, [data-pv2] main.portal > h1 { order: 0; }
[data-pv2] main.portal > .banner, [data-pv2] main.portal > .state-box { order: 1; }
[data-pv2] main.portal > #pay { order: 2; }                                    /* invoice: pay first */
[data-pv2] main.portal > section[aria-labelledby="enroll-summary-h"] { order: 2; } /* enrol: what you sign up for first */
[data-pv2] main.portal > .doc-head { order: 3; }
[data-pv2] .kicker { color: var(--pv-red); font-weight: 700; font-size: 15px; letter-spacing: .06em; }
[data-pv2] h1 { font-size: 32px; letter-spacing: -.02em; line-height: 1.15; margin: 6px 0 10px; font-weight: 760; }
[data-pv2] h2 { font-size: 22px; letter-spacing: -.01em; font-weight: 720; }
[data-pv2] h3 { font-size: 19px; }
[data-pv2] .sheet { border: 1px solid var(--pv-line); border-radius: var(--pv-r); padding: 22px; margin-top: 18px; box-shadow: var(--pv-shadow); }
[data-pv2] .label, [data-pv2] .fine { color: var(--pv-muted); font-size: 16px; }
[data-pv2] label { font-size: 17px; margin: 16px 0 8px; }
[data-pv2] input, [data-pv2] select, [data-pv2] textarea { min-height: 58px; font-size: 18px; border: 1.5px solid #cfd5de; border-radius: 14px; padding: 12px 16px; background: #fff; }
[data-pv2] input:focus, [data-pv2] select:focus, [data-pv2] textarea:focus { border-color: var(--pv-red); box-shadow: 0 0 0 4px var(--pv-red-soft); outline: none; }
[data-pv2] input[type="checkbox"], [data-pv2] input[type="radio"] { width: 28px; height: 28px; min-height: 0; accent-color: var(--pv-red); }
[data-pv2] label.check { display: flex; gap: 14px; align-items: flex-start; font-weight: 560; font-size: 17px; }
[data-pv2] .pay-btn, [data-pv2] button[type="submit"]:not(.lang-btn):not(.linkish):not(.print-btn) { min-height: 62px; border-radius: 16px; font-size: 20px; font-weight: 750; background: linear-gradient(180deg, var(--pv-red), var(--pv-red-2)); color: #fff; border: 0; box-shadow: 0 10px 24px -12px rgba(200,30,44,.8); width: 100%; cursor: pointer; }
[data-pv2] .print-btn { min-height: 52px; border-radius: 14px; font-size: 17px; padding: 12px 18px; border: 1px solid var(--pv-line); background: #fff; color: var(--pv-text); font-weight: 650; display: inline-flex; align-items: center; text-decoration: none; }
[data-pv2] .print-btn.primary { background: var(--pv-text); color: #fff; border-color: transparent; }
[data-pv2] .banner { border-radius: 14px; padding: 16px 18px; font-size: 17px; margin-top: 14px; }
[data-pv2] .banner.bad { background: var(--pv-red-soft); color: #7f1019; border: 1px solid #f5c2c7; }
[data-pv2] .banner.ok { background: var(--pv-ok-soft); color: #064e2b; border: 1px solid #b7e4cb; }
[data-pv2] .banner.wait { background: var(--pv-warn-soft); color: #5c3c00; border: 1px solid #f1d9a6; }
[data-pv2] .sums { max-width: none; font-size: 17px; }
[data-pv2] .sums .due { background: var(--pv-text); border-radius: 12px; padding: 12px 14px; font-size: 20px; font-weight: 760; }
[data-pv2] th { border-bottom: 2px solid var(--pv-text); font-size: 13px; }
[data-pv2] td { font-size: 16px; padding: 12px 4px; }
[data-pv2] .status, [data-pv2] .q-chip { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--pv-grey); font-size: 16px; }
/* Pay choices: two big options, fee shown in dollars */
[data-pv2] #pay { border: 2px solid var(--pv-red); }
[data-pv2] #pay > h2 { font-size: 24px; }
[data-pv2] .pay-choices { display: grid; gap: 12px; grid-template-columns: 1fr; }
[data-pv2] .pay-choice { text-align: left; min-height: 84px; padding: 18px 20px 18px 58px; border-radius: 16px; border: 2px solid var(--pv-line); background: #fff; position: relative; font: inherit; cursor: pointer; }
[data-pv2] .pay-choice::before { content: ""; position: absolute; left: 20px; top: 22px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #b7bfcb; }
[data-pv2] .pay-choice[aria-pressed="true"] { border-color: var(--pv-red); background: #fff7f8; }
[data-pv2] .pay-choice[aria-pressed="true"]::before { border-color: var(--pv-red); background: radial-gradient(circle, var(--pv-red) 0 45%, transparent 50%); }
[data-pv2] .pay-choice strong { font-size: 19px; display: block; color: var(--pv-text); }
[data-pv2] .pay-choice small { font-size: 15.5px; color: var(--pv-muted); display: block; margin-top: 4px; }
[data-pv2] .pay-choice[data-pay-choice="bank"] strong { color: var(--pv-ok); }
[data-pv2] .fee-line { font-size: 16px; background: var(--pv-grey); border-radius: 12px; padding: 10px 14px; }
[data-pv2] .etransfer-line { font-size: 16px; color: var(--pv-text-2); }
[data-pv2] .pad-terms { border-radius: 12px; font-size: 15px; }
[data-pv2] .sig-pad { border-radius: 16px; border: 2px dashed #cfd5de; background: #fafbfc; }
[data-pv2] .step-h .num { background: var(--pv-red); }
[data-pv2] details.decline summary { min-height: 52px; display: flex; align-items: center; color: var(--pv-muted); font-size: 17px; cursor: pointer; }
[data-pv2] .enroll-pick label, [data-pv2] .methods .method { min-height: 72px; border-radius: 16px; padding: 14px 16px; border: 2px solid var(--pv-line); display: flex; gap: 14px; align-items: flex-start; }
[data-pv2] .enroll-pick label:has(input:checked), [data-pv2] .methods .method:has(input:checked) { border-color: var(--pv-red); background: #fff7f8; }
[data-pv2] .portal-invite { order: 12; border-radius: var(--pv-r); }
[data-pv2] .lang-switch:not(.pv2-lang) { margin-top: 18px; }
[data-pv2] .lang-btn { min-height: 48px; min-width: 52px; font-size: 16px; }

/* ---- Signed-in portal (Views/portal_v2/layout.php) ---- */
.pv2 main.pv2-main { max-width: 860px; margin: 0 auto; padding: 30px 22px 60px; }
.pv2 h1 { font-size: 34px; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 6px; font-weight: 760; }
.pv2 .pv2-lede { color: var(--pv-muted); font-size: 19px; margin: 0 0 22px; }
.pv2 h2 { font-size: 21px; letter-spacing: -.01em; margin: 30px 0 12px; font-weight: 720; }
.pv2-card { background: var(--pv-card); border: 1px solid var(--pv-line); border-radius: var(--pv-r); box-shadow: var(--pv-shadow); }
.pv2-due { padding: 24px; display: grid; gap: 14px; }
.pv2-due .amt { font-size: 46px; font-weight: 790; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pv2-due .what { color: var(--pv-muted); font-size: 17px; margin: 0; }
.pv2-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 680; border-radius: 999px; padding: 5px 12px; background: var(--pv-grey); color: var(--pv-text-2); white-space: nowrap; }
.pv2-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pv2-badge.warn { background: var(--pv-warn-soft); color: var(--pv-warn); } .pv2-badge.bad { background: var(--pv-red-soft); color: var(--pv-red); }
.pv2-badge.ok { background: var(--pv-ok-soft); color: var(--pv-ok); } .pv2-badge.info { background: var(--pv-info-soft); color: var(--pv-info); }
.pv2-big { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 62px; border-radius: 16px; font-size: 20px; font-weight: 750; padding: 14px 22px; text-decoration: none; background: linear-gradient(180deg, var(--pv-red), var(--pv-red-2)); color: #fff !important; box-shadow: 0 10px 24px -12px rgba(200,30,44,.8); border: 0; }
.pv2-big svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.pv2-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 20px; border-radius: 14px; border: 1px solid var(--pv-line); background: #fff; font-weight: 680; font-size: 17px; color: var(--pv-text) !important; text-decoration: none; white-space: nowrap; }
.pv2-list { list-style: none; margin: 0; padding: 0; }
.pv2-doc { display: flex; align-items: center; gap: 16px; padding: 18px 20px; min-height: 88px; text-decoration: none; color: var(--pv-text) !important; }
.pv2-list li + li .pv2-doc { border-top: 1px solid var(--pv-line-2); }
.pv2-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--pv-grey); color: var(--pv-text-2); flex: 0 0 auto; }
.pv2-ico.red { background: var(--pv-red-soft); color: var(--pv-red); }
.pv2-doc .t { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.pv2-doc .s { color: var(--pv-muted); font-size: 15.5px; overflow-wrap: anywhere; }
.pv2-doc .mid { min-width: 0; flex: 1; }
.pv2-doc .r { text-align: right; flex: 0 0 auto; display: grid; gap: 6px; justify-items: end; }
.pv2-doc .amt { font-weight: 760; font-size: 19px; font-variant-numeric: tabular-nums; }
.pv2-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pv2-tile { display: flex; flex-direction: column; gap: 10px; padding: 20px; min-height: 128px; text-decoration: none; color: var(--pv-text) !important; }
.pv2-tile .tt { display: grid; gap: 2px; } .pv2-tile b { font-size: 18px; } .pv2-tile .sub { color: var(--pv-muted); font-size: 15.5px; }
.pv2-tile .pv2-ico { background: var(--pv-red-soft); color: var(--pv-red); }
.pv2-empty { padding: 28px 22px; text-align: center; color: var(--pv-muted); font-size: 17px; }
.pv2-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.pv2-chips a { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--pv-line); background: #fff; font-weight: 650; font-size: 16px; color: var(--pv-text-2) !important; text-decoration: none; }
.pv2-chips a[aria-current="true"] { background: var(--pv-text); color: #fff !important; border-color: transparent; }
.pv2-foot { text-align: center; color: var(--pv-muted); font-size: 15px; padding: 8px 20px 40px; }
.pv2-foot form { display: inline; }
.pv2-foot button { background: none; border: 0; color: var(--pv-red); font: inherit; font-weight: 650; min-height: 48px; cursor: pointer; text-decoration: underline; }
.pv2-tabs { display: none; }
/* Existing views inside the v2 layout (help, article, account, alarm) */
.pv2 .page-head h1 { font-size: 32px; } .pv2 .panel { background: #fff; border: 1px solid var(--pv-line); border-radius: var(--pv-r); padding: 20px; margin: 16px 0; box-shadow: var(--pv-shadow); }
.pv2 .pv2-main input, .pv2 .pv2-main textarea, .pv2 .pv2-main select { min-height: 56px; font-size: 18px; border-radius: 14px; border: 1.5px solid #cfd5de; padding: 12px 16px; width: 100%; font-family: inherit; }
.pv2 .pv2-main textarea { min-height: 120px; }
.pv2 .pv2-main button.btn, .pv2 .pv2-main .btn-primary, .pv2 .pv2-main button[type="submit"] { min-height: 56px; border-radius: 14px; font-size: 18px; font-weight: 720; padding: 12px 22px; background: var(--pv-red); color: #fff; border: 0; cursor: pointer; }
.pv2 .pv2-main a.btn { min-height: 52px; display: inline-flex; align-items: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 760px) {
  .pv2-top { padding: 8px 12px; gap: 8px; }
  .pv2-brand small, .pv2-nav, .pv2-call span { display: none; }
  .pv2-brand b { font-size: 13.5px; }
  .pv2-call { padding: 0; width: 48px; justify-content: center; }
  [data-pv2] main.portal { padding: 20px 16px 48px; }
  [data-pv2] h1, .pv2 h1 { font-size: 28px; }
  .pv2 main.pv2-main { padding: 20px 16px 120px; }
  .pv2-due .amt { font-size: 40px; }
  .pv2-tiles { grid-template-columns: 1fr; gap: 10px; }
  .pv2-tile { flex-direction: row; align-items: center; min-height: 76px; padding: 14px 16px; }
  .pv2-tile .sub { display: none; }
  .pv2-doc { flex-wrap: wrap; }
  .pv2-doc .mid { flex: 1 1 calc(100% - 60px); }
  .pv2-doc .r { flex: 1 1 100%; display: flex; justify-content: space-between; align-items: center; padding-left: 56px; }
  .pv2-doc { padding: 16px; gap: 12px; }
  .pv2-doc .pv2-ico { width: 44px; height: 44px; }
  .pv2-tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--pv-line); }
  .pv2-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; font-size: 13.5px; font-weight: 680; color: var(--pv-muted) !important; text-decoration: none; }
  .pv2-tabs svg { width: 26px; height: 26px; }
  .pv2-tabs a[aria-current="page"] { color: var(--pv-red) !important; }
  .pv2-tabs.n5 { grid-template-columns: repeat(5, 1fr); } .pv2-tabs.n5 a { font-size: 12.5px; }
  [data-pv2] .row { grid-template-columns: 1fr 1fr; }
}
/* Phone status bar: the Android app (Capacitor SystemBars, insetsHandling "css") and an installed PWA with
   viewport-fit=cover draw the page edge to edge, so the clock/battery bar sits over the top of the page. Capacitor puts
   the bar height in --safe-area-inset-top (env() is the fallback). The sticky header (account strip + brand row, also on the
   tokenized invoice/quote pages) grows by that height so the AA7 account number sits below the bar; the content follows the header in the flow, so it moves
   down with it. A normal browser tab or desktop gives 0, so the header there is unchanged.
   The staff preview (.pv2-preview) keeps its own sticky bar on top and is left as is. */
body.pv2:not(.pv2-preview), body[data-pv2] { --pv2-inset-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); --pv2-inset-l: var(--safe-area-inset-left, env(safe-area-inset-left, 0px)); --pv2-inset-r: var(--safe-area-inset-right, env(safe-area-inset-right, 0px)); }
body.pv2:not(.pv2-preview) .pv2-top, body[data-pv2] .pv2-top { padding-top: calc(12px + var(--pv2-inset-top)); padding-left: max(20px, var(--pv2-inset-l)); padding-right: max(20px, var(--pv2-inset-r)); }
@media (max-width: 760px) { body.pv2:not(.pv2-preview) .pv2-top, body[data-pv2] .pv2-top { padding-top: calc(8px + var(--pv2-inset-top)); padding-left: max(12px, var(--pv2-inset-l)); padding-right: max(12px, var(--pv2-inset-r)); } }
.pv2-callcard { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px; margin-bottom: 8px; }
.pv2-callcard .mid { flex: 1; min-width: 180px; }
.pv2-callcard .ph { font-size: 30px; font-weight: 780; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pv2-muted { color: var(--pv-muted); }
.pv2-help-old .page-head { display: none; }
@media (max-width: 760px) { .pv2-callcard .pv2-big { width: 100%; } }
.pv2 h2.pv2-h0 { margin: 0; }
.pv2-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pv2-sublede { margin: -4px 0 14px; font-size: 17px; }

/* Monitoring certificate card (CERTIFICATE switch) */
.pv2-cert .pv2-cert-row { display: flex; gap: .8rem; align-items: center; list-style: none; padding-top: .4rem; }
.pv2-cert .pv2-cert-row .tt { display: flex; flex-direction: column; }
.pv2-cert .pv2-cert-row .sub { color: #555; font-size: .95em; }
.pv2-cert .pv2-cert-actions { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; padding: .8rem 0 .4rem; }
.pv2-cert .pv2-link { font-weight: 600; }

/* Staff portal preview (PORTAL_PREVIEW) */
.pv2-preview-bar{position:sticky;top:0;z-index:50;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding:.6rem 1rem;background:#fff4d6;border-bottom:2px solid #c98a00;color:#3d2a00;font-size:.95rem}
.pv2-preview-bar strong{font-weight:800}
.pv2-preview-bar a{color:#3d2a00;font-weight:700}
.pv2-preview-bar a[aria-current="true"]{text-decoration:none;background:#3d2a00;color:#fff;border-radius:6px;padding:.1rem .45rem}
.pv2-preview-exit{margin-left:.5rem}
.pv2-preview [data-preview-disabled]{cursor:not-allowed;opacity:.55;pointer-events:none}

/* Contrast fix (Oct 21 2026): the staff app.css is loaded first and is a DARK theme (:root color-scheme: dark;
   --card/--field dark, --ink/--muted light). Staff parts the portal reuses (.panel, error card, inputs, .muted,
   .eyebrow, buttons) leaked through: dark cards with dark portal text, dark inputs, grey/mint text on white,
   and form controls drawn for dark mode (white text) on iPhone Safari. Re-map the staff variables to the light
   portal palette, scoped to portal pages only. The portal has no dark mode, so this applies in both schemes. */
body.pv2, body[data-pv2] {
  color-scheme: light;
  --bg: var(--pv-bg); --bg-raise: #fff; --card: #fff; --ink: var(--pv-text); --muted: var(--pv-muted);
  --line: var(--pv-line); --accent: var(--pv-ok); --accent-ink: #fff; --amber: var(--pv-warn); --blue: var(--pv-info);
  --danger: #b42318; --danger-bg: var(--pv-red-soft); --ok-bg: var(--pv-ok-soft);
  --field: #fff; --field-line: #cfd5de; --shadow: var(--pv-shadow);
}
html:has(> body.pv2), html:has(> body[data-pv2]) { color-scheme: light; background: var(--pv-bg); }
.pv2 input, .pv2 textarea, .pv2 select, [data-pv2] input, [data-pv2] textarea, [data-pv2] select {
  background-color: #fff; color: var(--pv-text); -webkit-text-fill-color: var(--pv-text);
}
.pv2 input::placeholder, .pv2 textarea::placeholder, [data-pv2] input::placeholder, [data-pv2] textarea::placeholder {
  color: #6b7280; -webkit-text-fill-color: #6b7280; opacity: 1;
}
.pv2 .muted, .pv2 .fine, [data-pv2] .muted, [data-pv2] .fine { color: var(--pv-muted); }
.pv2 .eyebrow, [data-pv2] .eyebrow { color: var(--pv-red); }
.pv2 .back-link, [data-pv2] .back-link { background: #fff; border-color: var(--pv-line); color: var(--pv-red); }
.pv2 .back-link .back-ico, [data-pv2] .back-link .back-ico { color: var(--pv-muted); }
.pv2 .back-link:hover, .pv2 .back-link:focus-visible, [data-pv2] .back-link:hover, [data-pv2] .back-link:focus-visible { background: var(--pv-red-soft); border-color: var(--pv-red); color: var(--pv-red-2); }
/* Emphasis and prose (Help answers, articles) always use the portal's dark text, whatever the staff sheet says. */
.pv2 .ph-prose :is(p, strong, b, em, i, code, mark, h1, h2, h3, h4, h5, h6, ul, ol, li, blockquote, td, th),
[data-pv2] .ph-prose :is(p, strong, b, em, i, code, mark, h1, h2, h3, h4, h5, h6, ul, ol, li, blockquote, td, th) { color: var(--pv-text); }
.pv2 .ph-prose code, [data-pv2] .ph-prose code { background: var(--pv-grey); border-radius: 4px; padding: 0 4px; }
.pv2 .price-note, [data-pv2] .price-note { color: var(--pv-warn); }
.pv2 h2.ppm-small-h { font-size: 15px; color: var(--pv-muted); margin: 0 0 10px; }

/* Portal home link to "Past invoices / Factures antérieures" (old Jobber invoices; PORTAL_JOBBER_INVOICES). */
.pji-home { margin-top: 14px; }
.pji-home .pv2-doc { flex-wrap: nowrap; }
.pji-home .pv2-doc .mid { flex: 1 1 auto; }
.pji-home .pv2-doc .r { flex: 0 0 auto; padding-left: 0; }
.pji-home .r svg { width: 22px; height: 22px; fill: none; stroke: var(--pv-muted); stroke-width: 2; }
