/* QPE Assistant redesign: shared styles.
   Load after Bootstrap 4 (layout.html). Values come from the design boards in docs/redesign/.
   Use these classes instead of inline styles. Names are prefixed qpe- so they never clash with Bootstrap. */

/* ---------- Tokens ---------- */
:root {
  --qpe-ink: #10202E;            /* headings, body text, dark cards */
  --qpe-text: #3A4652;           /* secondary text */
  --qpe-muted: #56626E;          /* quiet text, captions */
  --qpe-page: #F6F5F1;           /* page background */
  --qpe-surface: #FFFFFF;        /* cards, inputs */
  --qpe-line: #E2E0D8;           /* card borders */
  --qpe-line-soft: #EEECE6;      /* rules inside cards */
  --qpe-input-line: #C9CDD2;     /* input and secondary button borders */

  --qpe-primary: #1C5991;
  --qpe-primary-dark: #0B3A63;
  --qpe-primary-tint: #E6EEF6;

  /* QPE timing buckets (derived from qpe_predicted / qpe_arrival) */
  --qpe-now: #0B3A63;            /* QPE now */
  --qpe-48h: #1F66A6;            /* within 48 h */
  --qpe-72h: #7FB2DE;            /* 48-72 h */
  --qpe-120h: #C9DFF1;           /* 72-120 h */
  --qpe-far: #EEF4FA;            /* beyond 120 h */
  --qpe-none-line: #9AA4AE;      /* no QPE in 7 days, forecast pending (dashed) */

  --qpe-pre: #E0A526;            /* 72-hour pre-inspection window */
  --qpe-pre-tint: #FDF1CF;
  --qpe-pre-line: #C98A0B;
  --qpe-pre-ink: #3D2A00;

  --qpe-danger: #B42318;
  --qpe-danger-tint: #FDECEA;
  --qpe-danger-line: #F1B5AE;
  --qpe-danger-ink: #7A1A12;
  --qpe-good: #1D6B3A;
  --qpe-good-tint: #E3F1E7;
  --qpe-admin: #C2410C;

  --qpe-font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --qpe-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --qpe-radius-control: 8px;
  --qpe-radius-card: 12px;
  --qpe-radius-panel: 14px;
  --qpe-touch: 44px;
}
/* Fonts: add to layout.html <head>
   <link href="https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..800&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet"> */

/* ---------- Base ---------- */
body.qpe { font-family: var(--qpe-font); background: var(--qpe-page); color: var(--qpe-ink); }
.qpe a { color: var(--qpe-primary); }
.qpe a:hover { color: var(--qpe-primary-dark); }
.qpe :focus-visible { outline: 3px solid var(--qpe-pre); outline-offset: 2px; }
.qpe-mono { font-family: var(--qpe-mono); }
.qpe-muted { color: var(--qpe-muted); }
.qpe-h1 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 700; font-stretch: 85%; letter-spacing: -0.015em; }
.qpe-subtitle { margin: 6px 0 0; font-size: 15px; color: var(--qpe-muted); }
.qpe-main { padding: 28px 40px 40px; }

/* ---------- Header (Bootstrap .navbar.navbar-expand-lg) ---------- */
.qpe-header { background: var(--qpe-surface); border-bottom: 1px solid var(--qpe-line); min-height: 64px; padding: 0 40px; }
.qpe-header .navbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; font-stretch: 87%; color: var(--qpe-ink); }
.qpe-header .nav-link { padding: 10px 14px !important; border-radius: var(--qpe-radius-control); color: var(--qpe-text); font-size: 15px; font-weight: 500; }
.qpe-header .nav-link.active { background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-weight: 600; }
.qpe-header .navbar-toggler { width: 48px; height: 48px; border: 0; border-radius: 10px; }
.qpe-header .navbar-toggler[aria-expanded="true"] { background: var(--qpe-primary-tint); }

/* ---------- Buttons ---------- */
.qpe-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--qpe-touch); padding: 0 18px; border-radius: var(--qpe-radius-control); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.qpe-btn-primary { background: var(--qpe-primary); color: #fff; }
.qpe-btn-primary:hover { background: var(--qpe-primary-dark); color: #fff; text-decoration: none; }
.qpe-btn-secondary { background: var(--qpe-surface); color: var(--qpe-ink); border-color: var(--qpe-input-line); }
.qpe-btn-danger { background: var(--qpe-danger); color: #fff; }
/* Buttons made from <a>: keep their text colour over the .qpe a link colour */
.qpe a.qpe-btn-primary, .qpe a.qpe-btn-primary:hover, .qpe a.qpe-btn-danger, .qpe a.qpe-btn-danger:hover { color: #fff; text-decoration: none; }
.qpe a.qpe-btn-secondary, .qpe a.qpe-btn-secondary:hover { color: var(--qpe-ink); text-decoration: none; }
.qpe-btn-block { display: flex; width: 100%; min-height: 50px; font-size: 16px; font-weight: 700; }

/* ---------- Segmented control (By grid point | By site, List | Map) ---------- */
.qpe-seg { display: inline-grid; grid-auto-flow: column; padding: 4px; border-radius: 10px; background: #ECEAE3; }
.qpe-seg button { height: 38px; padding: 0 16px; border: 0; border-radius: 7px; background: transparent; color: var(--qpe-text); font-size: 15px; font-weight: 500; }
.qpe-seg button[aria-pressed="true"] { background: var(--qpe-surface); color: var(--qpe-ink); font-weight: 700; box-shadow: 0 1px 3px rgba(16,32,46,.15); }

/* ---------- Filter chips ---------- */
.qpe-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.qpe-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid #D5D2C8; background: var(--qpe-surface); color: var(--qpe-ink); font-size: 14px; font-weight: 500; white-space: nowrap; }
.qpe-chip[aria-pressed="true"] { background: var(--qpe-ink); border-color: var(--qpe-ink); color: #fff; font-weight: 600; }
[data-qpe-sort][data-dir="asc"]::after { content: " ↑"; }
[data-qpe-sort][data-dir="desc"]::after { content: " ↓"; }

/* ---------- Status chip and swatch, one per timing bucket ---------- */
.qpe-status { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; font-weight: 600; white-space: nowrap; border: 1.5px solid transparent; }
.qpe-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid transparent; flex-shrink: 0; }
.qpe-b-active  { background: var(--qpe-now);  color: #fff; }
.qpe-b-lt48    { background: var(--qpe-48h);  color: #fff; }
.qpe-b-h72     { background: var(--qpe-72h);  color: #0B2540; }
.qpe-b-h120    { background: var(--qpe-120h); color: #0B2540; }
.qpe-b-far     { background: var(--qpe-far);  color: #33475B; border-color: #B9D2E8; }
.qpe-b-none    { background: #fff; color: #4A5663; border-style: dashed; border-color: var(--qpe-none-line); }
.qpe-b-pending { background: var(--qpe-page); color: var(--qpe-muted); border-style: dashed; border-color: var(--qpe-none-line); }
.qpe-b-invalid { background: var(--qpe-danger-tint); color: var(--qpe-danger); border-color: var(--qpe-danger); }

/* ---------- Cards ---------- */
.qpe-card { background: var(--qpe-surface); border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); }
.qpe-panel { background: var(--qpe-surface); border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); padding: 24px 28px; }
.qpe-card-dark { background: var(--qpe-ink); color: #fff; border-radius: 16px; padding: 24px; }

/* ---------- Site card (Sites page) ---------- */
.qpe-site { display: grid; grid-template-columns: 36px minmax(0,1fr) 196px 78px 40px; gap: 14px; align-items: center; padding: 14px 12px 14px 16px; }
.qpe-site-name { font-weight: 700; font-size: 16px; color: var(--qpe-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qpe-site-addr { font-size: 13px; color: var(--qpe-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qpe-num { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--qpe-mono); font-weight: 600; font-size: 14px; }

/* 7-day bars: 28 six-hour blocks (prob6hr), height = chance, colour = state */
.qpe-bars { display: grid; grid-template-columns: repeat(28, minmax(0,1fr)); gap: 1.5px; align-items: end; height: 46px; border-bottom: 1px solid var(--qpe-line); }
.qpe-bars span { display: block; border-radius: 2px 2px 0 0; background: #B8C4CE; }
.qpe-bars span.is-qpe { background: var(--qpe-now); }
.qpe-bars span.is-pre { background: var(--qpe-pre); }
.qpe-bars span.is-past { height: 0 !important; }
.qpe-days { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); font-size: 10.5px; color: var(--qpe-muted); text-align: center; }

/* ---------- Report grid: one markup for desktop and phone ----------
   Cells are in day-major order (index = day*4 + block). Desktop: 28 columns in one row under a day header.
   Phone: a day label (.qpe-grid-day, hidden on desktop) + 4 cells per row, so the grid wraps into 7 days. */
.qpe-grid { display: grid; grid-template-columns: repeat(28, minmax(0,1fr)); }
.qpe-grid-day { display: none; }
.qpe-cell { display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; color: var(--qpe-ink); font-size: 12px; }
.qpe-cell .p { font-family: var(--qpe-mono); font-weight: 600; }
.qpe-cell .q { font-family: var(--qpe-mono); color: var(--qpe-muted); }
.qpe-cell.is-qpe { background: var(--qpe-now); color: #fff; }
.qpe-cell.is-qpe .q { color: var(--qpe-120h); }
.qpe-cell.is-pre { background: var(--qpe-pre-tint); }
.qpe-cell.is-past { color: #9AA4AE; background: #F1EFE9; }

/* ---------- Banners and toast ---------- */
.qpe-banner { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 10px 40px; font-size: 14px; line-height: 1.45; }
.qpe-banner a { font-weight: 700; color: inherit; }
.qpe-banner-warn { background: var(--qpe-pre-tint); border-bottom: 1px solid #EBCF86; color: var(--qpe-pre-ink); }
.qpe-banner-error { background: var(--qpe-danger-tint); border-bottom: 1px solid var(--qpe-danger-line); color: var(--qpe-danger-ink); }
.qpe-banner-good { background: var(--qpe-good-tint); border-bottom: 1px solid #A9D5B6; color: #14452A; }
.qpe-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1080; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 10px; background: var(--qpe-ink); color: #fff; font-size: 14px; box-shadow: 0 10px 28px rgba(16,32,46,.3); }

/* ---------- Forms ---------- */
.qpe-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.qpe-input { height: 50px; padding: 0 14px; border: 1px solid var(--qpe-input-line); border-radius: var(--qpe-radius-control); font-size: 17px; font-weight: 400; background: #fff; }
.qpe-input.is-invalid { border: 2px solid var(--qpe-danger); }
.qpe-error { display: flex; gap: 6px; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--qpe-danger); }
.qpe-error-summary { padding: 12px 14px; background: var(--qpe-danger-tint); border: 1px solid var(--qpe-danger-line); border-radius: 10px; font-size: 14px; color: var(--qpe-danger-ink); }

/* ---------- Phone sheets ---------- */
.qpe-sheet-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(16,32,46,.45); }
.qpe-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(16,32,46,.25); padding: 8px 0 calc(24px + env(safe-area-inset-bottom)); }
.qpe-sheet a, .qpe-sheet button { display: flex; align-items: center; min-height: 52px; padding: 0 20px; width: 100%; border: 0; background: none; font-size: 16px; color: var(--qpe-ink); text-align: left; }
.qpe-sticky-bar { position: sticky; bottom: 0; z-index: 10; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--qpe-line); }

/* ---------- Layout: header parts, account menu, page banners, flash alerts (PR 1) ---------- */
body.qpe { margin-top: 0; }                          /* main.css pushed the page down for the old fixed navbar */
.qpe-layout-main { padding-top: 24px; }
.qpe-header .navbar-brand:hover { color: var(--qpe-ink); text-decoration: none; }
.qpe-header .qpe-logo { color: var(--qpe-primary); }
.qpe-header .nav-link:hover { color: var(--qpe-ink); background: #F1EFE9; }
.qpe-header .navbar-toggler { margin-left: auto; color: var(--qpe-ink); }
.qpe-header .qpe-header-login + .navbar-toggler { margin-left: 0; }
.qpe-header .navbar-toggler .qpe-icon-close,
.qpe-header .navbar-toggler[aria-expanded="true"] .qpe-icon-open { display: none; }
.qpe-header .navbar-toggler[aria-expanded="true"] .qpe-icon-close { display: block; }
.qpe-header-login { display: inline-flex; align-items: center; min-height: var(--qpe-touch); padding: 0 12px; font-size: 15px; font-weight: 600; }
.qpe .qpe-header-login { color: var(--qpe-ink); }
.qpe-header-login.d-lg-none { margin-left: auto; }

.qpe-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--qpe-primary); color: #fff; font-size: 13px; font-weight: 700; object-fit: cover; }
.qpe-account { margin-left: auto; }
.qpe-account-btn { display: inline-flex; align-items: center; gap: 10px; height: var(--qpe-touch); padding: 0 14px 0 5px; border: 1px solid var(--qpe-line); border-radius: 22px; background: var(--qpe-surface); color: var(--qpe-ink); font-size: 15px; font-weight: 500; }
.qpe-account-btn .qpe-chevron { color: var(--qpe-muted); transition: transform .15s; }
.qpe-account-btn[aria-expanded="true"] { border-color: var(--qpe-primary); }
.qpe-header .navbar-toggler:focus:not(:focus-visible),
.qpe-account-btn:focus:not(:focus-visible) { outline: none; }
.qpe-account-btn[aria-expanded="true"] .qpe-chevron { transform: rotate(180deg); }
.qpe-account-who strong { display: block; font-size: 16px; color: var(--qpe-ink); }
.qpe-account-who strong + span { display: block; font-size: 13px; color: var(--qpe-muted); }
.qpe-account-menu { min-width: 272px; margin-top: 8px; padding: 0 0 6px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); box-shadow: 0 12px 28px rgba(16,32,46,.14); }
.qpe-account-menu .qpe-account-who { padding: 14px 16px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--qpe-line-soft); }
.qpe-account-menu .dropdown-item { padding: 10px 16px; font-size: 15px; color: var(--qpe-ink); }
.qpe-account-menu .dropdown-item:hover, .qpe-account-menu .dropdown-item:focus { background: #F1EFE9; }
.qpe-account-menu .dropdown-divider { margin: 6px 0; border-color: var(--qpe-line-soft); }

/* "Home" menu (logged-in nav): same card look as the account menu, no header/who row */
.qpe-home-menu { min-width: 200px; margin-top: 8px; padding: 6px 0; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); box-shadow: 0 12px 28px rgba(16,32,46,.14); }
.qpe-home-menu .dropdown-item { padding: 10px 16px; font-size: 15px; color: var(--qpe-ink); }
.qpe-home-menu .dropdown-item:hover, .qpe-home-menu .dropdown-item:focus { background: #F1EFE9; }
.qpe-home-menu .dropdown-divider { margin: 6px 0; border-color: var(--qpe-line-soft); }
.qpe .qpe-admin-link { color: var(--qpe-admin); font-weight: 600; }
.qpe-nav-public { display: flex; align-items: center; gap: 16px; margin-left: auto; }

.qpe-banner-admin { background: var(--qpe-admin); color: #fff; font-weight: 600; }
.qpe-banner-action { margin-left: auto; flex-shrink: 0; text-decoration: underline; }

.qpe-alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid; border-radius: 10px; font-size: 15px; line-height: 1.45; }
.qpe-alert > span { flex: 1; }
.qpe-alert-warn { background: var(--qpe-pre-tint); border-color: #EBCF86; color: var(--qpe-pre-ink); }
.qpe-alert-error { background: var(--qpe-danger-tint); border-color: var(--qpe-danger-line); color: var(--qpe-danger-ink); }
.qpe-alert-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--qpe-touch); height: var(--qpe-touch); margin: -10px -12px -10px 0; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }

.qpe-toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1080; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.qpe-toast-stack .qpe-toast { position: static; transform: none; pointer-events: auto; transition: opacity .25s; }
.qpe-toast.is-leaving { opacity: 0; }

@media (min-width: 992px) {
  .qpe-header .qpe-nav-links { margin-left: 32px; gap: 4px; }
}

/* ---------- Responsive (see docs/redesign/responsive-rules.md) ---------- */
@media (max-width: 991.98px) {
  .qpe-header { padding: 0 6px 0 16px; min-height: 56px; }
  .qpe-header .navbar-collapse .nav-link { min-height: 48px; display: flex; align-items: center; padding: 0 20px !important; border-radius: 0; font-size: 16px; }
  .qpe-header .navbar-collapse .nav-link.active { box-shadow: inset 4px 0 0 var(--qpe-primary); }
  .qpe-header .navbar-toggler { display: inline-flex; align-items: center; justify-content: center; }   /* shown only below lg */
  .qpe-header .navbar-collapse { margin: 0 -6px 0 -16px; padding-bottom: 8px; border-top: 1px solid var(--qpe-line-soft); }
  .qpe-nav-account { margin: 8px 20px 0; padding-top: 4px; border-top: 1px solid var(--qpe-line); }
  .qpe-nav-account .qpe-account-who { display: flex; align-items: center; gap: 12px; padding: 12px 0 6px; }
  .qpe-header .qpe-nav-account .nav-link { margin: 0 -20px; }
  .qpe-nav-account .qpe-admin-link small { margin-left: auto; font-family: var(--qpe-mono); font-size: 11px; font-weight: 600; color: var(--qpe-muted); }
  .qpe-nav-public { display: block; margin: 8px 0 0; padding: 0 20px 8px; }
  .qpe-nav-public .qpe-start-free { display: flex; width: 100%; min-height: 50px; font-size: 16px; font-weight: 700; }
}
@media (max-width: 767.98px) {
  .qpe-main { padding: 18px 16px 40px; }
  .qpe-h1 { font-size: 32px; }
  .qpe-banner { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 16px; }
  .qpe-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .qpe-chip { flex-shrink: 0; }
  .qpe-site { grid-template-columns: 32px minmax(0,1fr) 36px; }
  .qpe-bars { height: 34px; }
  .qpe-grid { grid-template-columns: 76px repeat(4, minmax(0,1fr)); gap: 3px; }
  .qpe-grid-day { display: flex; flex-direction: column; justify-content: center; font-size: 13px; font-weight: 700; }
  .qpe-cell { height: 48px; justify-content: center; border-radius: 6px; border: 1px solid var(--qpe-line); font-size: 15px; }
  .qpe-cell .q { font-size: 11px; }
  .qpe-cell.is-pre { border: 1.5px solid var(--qpe-pre-line); }
  .qpe-toast { left: 16px; right: 16px; transform: none; }
  .qpe-toast-stack { left: 16px; right: 16px; transform: none; align-items: stretch; }
  .qpe-layout-main { padding-top: 16px; }
  /* Bootstrap 4 has no .modal-fullscreen: make modals full-screen sheets on phones */
  .modal-dialog { margin: 0; max-width: none; min-height: 100%; }
  .modal-content { min-height: 100vh; border: 0; border-radius: 0; }
}


/* ==============================================================================   PR 6: Account and sign-in
   blueprints/account/templates/account/_auth_layout.html, login, register (+ Check your email), reset_request
   (+ sent), reset_token, link_expired, account_settings, subscription_confirmed; subscription/registration_confirmed
   Screens: Auth-*, Acct-B-OnePage, Auth-E-CheckEmail, System-States, M-Login*, M-Signup, M-CheckEmail, M-Forgot*,
   M-Reset, M-Expired, M-Account
   ===================================================================================== */
/* ---- Split layout: dark panel (lg and up) + form column ---- */
.qpe-auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 992px) { .qpe-auth-split { grid-template-columns: 1fr 1fr; } }
.qpe-auth-panel { flex-direction: column; gap: 24px; padding: 56px 72px; background: var(--qpe-ink); color: #fff; }
.qpe .qpe-auth-panel-brand, .qpe .qpe-auth-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; font-stretch: 87%; text-decoration: none; }
.qpe .qpe-auth-panel-brand, .qpe .qpe-auth-panel-brand:hover { color: #fff; text-decoration: none; }
.qpe-auth-panel-brand .qpe-logo { color: #9CC4E8; }
.qpe-auth-grow { flex-grow: 1; }
.qpe .qpe-auth-panel-title { max-width: 540px; margin: 0; font-size: 52px; line-height: 1.02; font-weight: 750; font-stretch: 80%; letter-spacing: -0.02em; color: #fff; }
.qpe-auth-panel-text { max-width: 520px; margin: 0; font-size: 18px; line-height: 1.55; color: #C9D2DA; }
.qpe-auth-panel-foot { font-size: 13px; color: #8FA0AF; }
.qpe .qpe-auth-panel-foot a { color: #C9D2DA; text-decoration: underline; }
.qpe-auth-sample { max-width: 520px; padding: 18px 20px; border-radius: 12px; background: #1A2C3D; }
.qpe-auth-sample-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 16px; }
.qpe-auth-sample-head .qpe-status { height: 22px; padding: 0 9px; font-size: 12.5px; }
.qpe-auth-sample-bars { display: grid; grid-template-columns: repeat(27, minmax(0,1fr)); gap: 3px; align-items: end; height: 36px; }
.qpe-auth-sample-bars span { display: block; border-radius: 2px 2px 0 0; background: #3A4E60; }
.qpe-auth-sample-bars span.is-pre { background: var(--qpe-pre); }
.qpe-auth-sample-bars span.is-qpe { background: #9CC4E8; }

.qpe-auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--qpe-page); }
.qpe-auth-col { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 440px; }
.qpe .qpe-auth-brand, .qpe .qpe-auth-brand:hover { color: var(--qpe-ink); text-decoration: none; }
.qpe-auth-brand .qpe-logo { color: var(--qpe-primary); }
.qpe .qpe-auth-title { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; font-stretch: 86%; color: var(--qpe-ink); }
.qpe-auth-sub { margin: -12px 0 0; font-size: 16px; color: var(--qpe-text); }
.qpe-auth-sub a { text-decoration: underline; }
.qpe-auth-lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--qpe-text); }
.qpe-auth-lead b { color: var(--qpe-ink); }
.qpe-auth-note { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--qpe-muted); }
.qpe-auth-note a { font-weight: 600; text-decoration: underline; }
.qpe-auth-form { display: flex; flex-direction: column; gap: 16px; }
.qpe-auth-form .qpe-alert { margin-bottom: 0; }
.qpe-auth-alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.qpe-auth-col > .qpe-alert { margin-bottom: 0; }
.qpe-auth-form .qpe-field label, .qpe-acct-card .qpe-field > label { margin: 0; color: var(--qpe-ink); }
.qpe-auth-form .qpe-input { width: 100%; }
.qpe-error a { color: inherit; text-decoration: underline; }
.qpe-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qpe .qpe-auth-strong-link { font-size: 15px; font-weight: 700; text-decoration: underline; }
.qpe-auth-switch { margin: 0; padding-top: 20px; border-top: 1px solid var(--qpe-line); text-align: center; font-size: 15px; color: var(--qpe-text); }
.qpe-auth-switch a { font-weight: 700; text-decoration: underline; }
.qpe-auth-links { display: flex; justify-content: center; gap: 16px; padding-top: 8px; font-size: 13px; }
.qpe .qpe-auth-links a { color: var(--qpe-muted); text-decoration: underline; }
.qpe-auth-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; }
.qpe-auth-icon-mail { background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-auth-icon-clock { background: var(--qpe-pre-tint); color: var(--qpe-pre-line); }
.qpe-auth-icon-good { background: var(--qpe-good-tint); color: var(--qpe-good); }
.qpe-link-btn { padding: 0; border: 0; background: none; color: var(--qpe-primary); font-weight: 600; text-decoration: underline; cursor: pointer; }
.qpe-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Password with Show / Hide */
.qpe-password { position: relative; }
.qpe-password .qpe-input { padding-right: 72px; }
.qpe-password-toggle { position: absolute; top: 0; right: 0; height: 100%; min-width: var(--qpe-touch); padding: 0 16px; border: 0; background: none; color: var(--qpe-primary); font-size: 14px; font-weight: 700; cursor: pointer; }

/* Checkbox row */
.qpe-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; min-height: var(--qpe-touch); padding: 10px 0; font-size: 15px; font-weight: 400; color: var(--qpe-ink); cursor: pointer; }
.qpe-check input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--qpe-primary); }
.qpe-auth-row .qpe-check { padding: 0; align-items: center; }
.qpe-auth-row .qpe-check input { margin: 0; }

/* Check your email: centred card on desktop */
.qpe-auth-card .qpe-auth-main { padding: 48px 24px; }
.qpe-check-email { display: flex; flex-direction: column; gap: 16px; }
.qpe-check-email-actions { display: flex; flex-direction: column; gap: 12px; }
.qpe-check-email-resend .qpe-btn { width: 100%; min-height: 48px; }
.qpe-check-email-done { min-height: 48px; }
@media (min-width: 768px) {
  .qpe-auth-card .qpe-auth-col { max-width: 520px; }
  .qpe-auth-card .qpe-auth-brand, .qpe-auth-card .qpe-auth-links { display: none; }
  .qpe-check-email { align-items: center; padding: 44px 44px 40px; border: 1px solid var(--qpe-line); border-radius: 16px; background: var(--qpe-surface); text-align: center; }
  .qpe-check-email .qpe-auth-title { font-size: 30px; }
  .qpe-check-email-actions { align-items: center; gap: 16px; }
  .qpe-check-email-resend .qpe-btn { width: auto; padding: 0 22px; }
  .qpe-check-email-done { padding: 0 22px; }
}
@media (max-width: 767.98px) {
  .qpe-check-email-done { order: -1; }
  .qpe-check-email .qpe-auth-icon { width: 56px; height: 56px; }
}

/* Phones: form only, brand on top */
@media (max-width: 991.98px) {
  .qpe-auth-main { align-items: flex-start; }
}
@media (max-width: 767.98px) {
  .qpe-auth-main { padding: 24px 20px 32px; }
  .qpe-auth-col { gap: 16px; max-width: none; }
  .qpe-auth-brand { margin-bottom: 28px; }
  .qpe-auth-card .qpe-auth-main { padding: 24px 20px 32px; }
  .qpe .qpe-auth-title { font-size: 34px; }
  .qpe-auth-form .qpe-input { height: 52px; }
  .qpe-auth-form .qpe-btn-block { min-height: 52px; font-size: 17px; }
  .qpe-auth-forgot { display: block; margin: 4px 0 20px; text-align: center; }
}

/* ---- Confirmation states (registration_confirmed, subscription_confirmed) ---- */
.qpe-page-confirm main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; }
body.qpe-page-confirm > .row { margin-left: 0; margin-right: 0; }
.qpe-confirm { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 656px; margin: 24px auto 40px; padding: 40px 48px; border: 1px solid var(--qpe-line); border-radius: 16px; background: var(--qpe-surface); }
.qpe .qpe-confirm-title { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; font-stretch: 86%; color: var(--qpe-ink); }
.qpe-confirm-lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--qpe-text); }
.qpe-confirm-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--qpe-muted); }
.qpe-confirm-list { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--qpe-text); }
.qpe-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 767.98px) {
  .qpe-confirm { margin: 0 0 24px; padding: 24px 20px; }
  .qpe .qpe-confirm-title { font-size: 28px; }
  .qpe-confirm-actions { flex-direction: column; align-self: stretch; }
}

/* ---- One-page Account ---- */
.qpe-account-page { max-width: 860px; margin: 12px auto 120px; }
body.qpe:has(.qpe-account-page) .footer, body.qpe:has(.qpe-confirm) .footer { display: none; }   /* no old footer in the designs */
.qpe .qpe-account-title { margin-bottom: 28px; font-size: 44px; color: var(--qpe-ink); }
.qpe-acct-card { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; padding: 24px 28px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
.qpe .qpe-acct-h2 { margin: 0; font-size: 21px; font-weight: 700; color: var(--qpe-ink); }
.qpe .qpe-acct-h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 700; color: var(--qpe-ink); }
.qpe-acct-small { margin: 2px 0 0; font-size: 13.5px; color: var(--qpe-muted); }
.qpe-acct-card .qpe-field { font-size: 13.5px; font-weight: 700; }
.qpe-acct-card .qpe-input { width: 100%; height: 44px; font-size: 16px; }
.qpe-acct-card .qpe-input[readonly] { background: #FAFAF8; color: var(--qpe-text); }
.qpe-select { padding-right: 10px; }
.qpe-textarea { height: auto; min-height: 88px; padding: 10px 12px; font-size: 16px; resize: vertical; }
.qpe .qpe-acct-link { margin: 0; font-size: 14px; font-weight: 700; color: var(--qpe-primary); text-decoration: underline; cursor: pointer; }

.qpe-acct-profile { flex-direction: row; gap: 28px; }
.qpe-acct-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.qpe-acct-avatar { display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 50%; background: var(--qpe-primary); color: #fff; font-size: 30px; font-weight: 700; object-fit: cover; }
.qpe-acct-photo-text { display: flex; flex-direction: column; align-items: center; }
.qpe-acct-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.qpe-acct-file:focus-visible + .qpe-acct-file-name, .qpe-acct-photo label:focus-within { outline: 3px solid var(--qpe-pre); }
.qpe-acct-file-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--qpe-muted); }
.qpe-acct-profile-grid { flex-grow: 1; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.qpe-acct-profile-grid > h2, .qpe-acct-span { grid-column: span 2; }
.qpe-acct-times { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; font-size: 13px; color: var(--qpe-muted); }
.qpe-acct-times strong { color: var(--qpe-ink); font-weight: 700; }
.qpe-acct-password { align-self: center; }

.qpe-acct-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.qpe-acct-email-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.qpe-acct-card .qpe-check { padding: 6px 0; min-height: 0; }

/* Switch (UpdateAccount.get_notification) */
.qpe-switch { position: relative; display: inline-flex; align-items: center; margin: 0; min-width: var(--qpe-touch); min-height: var(--qpe-touch); cursor: pointer; }
.qpe-switch input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.qpe-switch-track { position: relative; width: 52px; height: 30px; border-radius: 15px; background: #B8C1CA; transition: background .15s; }
.qpe-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,32,46,.3); transition: transform .15s; }
.qpe-switch input:checked + .qpe-switch-track { background: var(--qpe-primary); }
.qpe-switch input:checked + .qpe-switch-track::after { transform: translateX(22px); }
.qpe-switch input:focus-visible + .qpe-switch-track { outline: 3px solid var(--qpe-pre); outline-offset: 2px; }

.qpe-acct-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
.qpe-acct-row-text { min-width: 0; flex: 1; }
.qpe-acct-plan-line { margin: 6px 0 0; font-size: 16px; color: var(--qpe-ink); }
.qpe-acct-plan-bar { max-width: 360px; height: 6px; margin-top: 10px; border-radius: 3px; }
.qpe-acct-actions { display: flex; gap: 24px; flex-shrink: 0; }
.qpe-acct-version { padding: 1px 7px; border-radius: 10px; background: var(--qpe-primary-tint); font-family: var(--qpe-mono); font-size: 12px; font-weight: 600; color: var(--qpe-primary-dark); }
.qpe-acct-news { padding-top: 18px; padding-bottom: 18px; }
.qpe-acct-news-link { display: inline-flex; align-items: center; justify-content: center; width: var(--qpe-touch); height: var(--qpe-touch); margin: -10px -14px -10px 0; color: var(--qpe-primary); }
.qpe-acct-delete { background: #FFFBFA; border-color: var(--qpe-danger-line); }
.qpe-acct-btn-danger-outline { background: #fff; border-color: var(--qpe-danger); color: var(--qpe-danger); white-space: nowrap; }
.qpe-acct-btn-danger-outline:hover { background: var(--qpe-danger-tint); color: var(--qpe-danger); }

.qpe-acct-dialog form { display: block !important; }
.qpe .qpe-acct-dialog h2 { color: var(--qpe-ink); }
.qpe-acct-dialog .qpe-field { font-size: 14px; }
.qpe-acct-dialog .qpe-textarea { width: 100%; }
.qpe-acct-dialog .qpe-dialog-foot { margin-top: 18px; }

/* Save bar: fixed to the bottom after a change */
.qpe-save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; background: var(--qpe-ink); padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.qpe-save-bar[hidden] { display: none; }
.qpe-save-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 860px; margin: 0 auto; color: #DCE4EB; font-size: 15px; }
.qpe-save-bar-actions { display: flex; gap: 10px; }
.qpe-save-bar-discard { border-color: #3A4E60; background: transparent; color: #fff; font-size: 14px; }
.qpe-save-bar-discard:hover { color: #fff; background: #1A2C3D; }
.qpe-save-bar-save { background: #fff; color: var(--qpe-ink); font-size: 14px; font-weight: 700; }

@media (max-width: 767.98px) {
  .qpe-account-page { margin: 0 0 100px; }
  .qpe .qpe-account-title { margin-bottom: 14px; font-size: 32px; }
  .qpe-acct-card { margin-bottom: 16px; padding: 18px 16px; border-radius: 14px; }
  .qpe-acct-profile { flex-direction: column; gap: 16px; }
  .qpe-acct-photo { flex-direction: row; gap: 14px; }
  .qpe-acct-avatar { width: 56px; height: 56px; font-size: 19px; }
  .qpe-acct-photo-text { align-items: flex-start; }
  .qpe-acct-profile-grid { grid-template-columns: 1fr; gap: 14px; }
  .qpe-acct-profile-grid > h2, .qpe-acct-span { grid-column: auto; }
  .qpe-acct-card .qpe-input { height: 50px; font-size: 17px; }
  .qpe-acct-times { flex-direction: row; justify-content: space-between; min-height: 0; font-size: 14px; }
  .qpe-acct-times strong { font-weight: 400; color: var(--qpe-muted); }
  .qpe-acct-times .qpe-phone-only { font-weight: 700; color: var(--qpe-ink); }
  .qpe-acct-password { align-self: flex-start; font-size: 16px; }
  .qpe-acct-email-grid { grid-template-columns: 1fr; gap: 14px; }
  .qpe-acct-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .qpe-acct-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 8px; }
  .qpe-acct-actions .qpe-btn { padding: 0 8px; }
  .qpe-acct-plan-bar { max-width: none; }
  .qpe-acct-news { flex-direction: row; align-items: center; }
  .qpe-acct-delete .qpe-btn { width: 100%; }
  .qpe-save-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .qpe-save-bar-actions > .qpe-btn { flex: 1; }
  /* Deletion request opens full screen on phones */
  .qpe-acct-dialog { top: 0; left: 0; width: 100%; height: 100%; transform: none; border-radius: 0; overflow-y: auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .qpe-acct-dialog .qpe-dialog-foot { flex-direction: column-reverse; align-items: stretch; }
}

/* Generic responsive text-swap utility (first defined in PR 3, used throughout later PRs --
   pulled in on its own since register.html/_auth_layout.html need it and it's pure CSS,
   no dependency on any of PR-3's actual report-page work). */
@media (min-width: 768px) { .qpe-phone-only { display: none !important; } }
@media (max-width: 767.98px) { .qpe-desktop-only { display: none !important; } }

/* =====================================================================================
   PR 8: Public pages. Home, How it works, Pricing, ROI calculator, About, Terms, Privacy, Contact, What's new.
   blueprints/general/templates/general/*.html, blueprints/subscription/templates/subscription/pricing.html,
   roi_calculator.html. Screens: Home-B-Photo, HowItWorks, Price-A-TwoPlans, Price-B-Slider, Public-*, and
   their M-* phone versions. Pages set body.qpe-public (wide_layout.html's body_class block).
   ===================================================================================== */
body.qpe-public { --qpe-pub-gutter: 80px; }
body.qpe-public > .row { margin: 0; }
.qpe-public main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 0; }  /* overrides wide_layout's inline 90% */
.qpe-public main[role="main"] > .col { padding: 0; }
body.qpe-public > br, .qpe-public main[role="main"] > br,
.qpe-public footer.fixed-bottom { display: none; }                  /* the pages carry their own footer */
.qpe-public main[role="main"] > .col > .qpe-alert { margin: 16px var(--qpe-pub-gutter) 0; }
@media (min-width: 1200px) { body.qpe-public:not(.qpe-page-notes) .qpe-header { padding: 0 80px; min-height: 72px; } }

.qpe-pub h1, .qpe-pub h2, .qpe-pub h3 { color: var(--qpe-ink); }
.qpe-pub-wrap { max-width: 1440px; margin: 0 auto; padding-left: var(--qpe-pub-gutter); padding-right: var(--qpe-pub-gutter); }
.qpe-pub-page { padding-top: 64px; padding-bottom: 80px; }
.qpe-pub-kicker { display: block; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--qpe-primary); }
.qpe-pub-label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qpe-muted); }
.qpe-pub-h1 { margin: 6px 0 0; font-size: 64px; line-height: 1; font-weight: 750; font-stretch: 80%; letter-spacing: -0.02em; }
.qpe-pub-h2 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 700; font-stretch: 84%; }
.qpe-pub-lead { margin: 16px 0 0; font-size: 19px; line-height: 1.5; color: var(--qpe-text); }
.qpe .qpe-pub-btn-light { min-height: 54px; padding: 0 24px; background: #fff; color: var(--qpe-ink); font-size: 17px; font-weight: 700; }
.qpe .qpe-pub-btn-light:hover { background: #EEF2F6; color: var(--qpe-ink); text-decoration: none; }
.qpe .qpe-pub-btn-ghost { min-height: 54px; padding: 0 22px; border: 1.5px solid rgba(255,255,255,.6); background: transparent; color: #fff; font-size: 17px; font-weight: 600; }
.qpe .qpe-pub-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* Footer */
.qpe-pub-footer { border-top: 1px solid var(--qpe-line); background: var(--qpe-surface); }
.qpe-pub-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding-top: 20px; padding-bottom: 20px; }
.qpe-pub-footer-copy { margin: 0; font-size: 14px; color: var(--qpe-muted); }
.qpe-pub-footer-links { display: flex; gap: 24px; font-size: 14px; }
.qpe .qpe-pub-footer-links a { color: var(--qpe-text); text-decoration: underline; white-space: nowrap; }

/* Footer: newsletter signup (restored from the old sidebar, every public page via pub.footer()) */
.qpe-pub-footer-news { padding-top: 40px; padding-bottom: 32px; border-top: 1px solid var(--qpe-line); text-align: center; }
.qpe-pub-footer-news h2 { margin: 0; font-size: 20px; font-weight: 700; }
.qpe-pub-footer-news p { max-width: 480px; margin: 8px auto 20px; font-size: 14.5px; color: var(--qpe-muted); }
.qpe-pub-footer-news .newsletter-form-container { max-width: 300px; margin: 0 auto; }

/* ---------- Home (Home-B-Photo, M-Home, M-Home-Menu) ---------- */
.qpe-home-hero { position: relative; overflow: hidden; background: var(--qpe-ink); }
.qpe-home-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; }
.qpe-home-hero::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(16,32,46,.55) 0, rgba(16,32,46,0) 160px),
              linear-gradient(90deg, rgba(16,32,46,.88) 0%, rgba(16,32,46,.6) 40%, rgba(16,32,46,.05) 72%); }
.qpe-home-hero-text { position: relative; z-index: 2; padding-top: 200px; padding-bottom: 118px; }
.qpe-home-hero-text > * { max-width: 600px; }
.qpe .qpe-home-kicker { color: #9CC4E8; letter-spacing: .1em; }
.qpe-pub .qpe-home-h1 { max-width: 640px; margin: 18px 0 0; font-size: 88px; line-height: .93; font-weight: 800; font-stretch: 85%; letter-spacing: -0.02em; color: #fff; }
.qpe-home-h1 span { white-space: nowrap; }
.qpe-home-lead { margin: 26px 0 0; max-width: 580px; font-size: 20px; line-height: 1.55; color: #E6EDF3; }
.qpe-home-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; max-width: none; }
.qpe .qpe-home-btn-light { min-height: 54px; padding: 0 26px; background: #fff; color: var(--qpe-ink); font-size: 17px; font-weight: 700; }
.qpe .qpe-home-btn-light:hover { background: #EEF2F6; color: var(--qpe-ink); text-decoration: none; }
.qpe .qpe-home-btn-ghost { min-height: 54px; padding: 0 22px; border: 1px solid rgba(255,255,255,.7); background: rgba(16,32,46,.2); color: #fff; font-size: 17px; font-weight: 700; }
.qpe .qpe-home-btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.qpe-home-note { margin: 22px 0 0; font-size: 14px; color: #C9D2DA; }
.qpe-home-points { padding-top: 72px; padding-bottom: 48px; }
.qpe-home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.qpe-home-big { display: block; font-family: var(--qpe-mono); font-size: 36px; line-height: 1.1; color: var(--qpe-primary-dark); }
.qpe-pub .qpe-home-point h2 { margin: 16px 0 10px; font-size: 22px; font-weight: 700; }
.qpe-home-point p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--qpe-text); }
.qpe .qpe-home-more { display: inline-block; margin-top: 56px; font-size: 18px; font-weight: 700; text-decoration: underline; }
@media (min-width: 768px) {
  .qpe-page-home .qpe-pub-footer { border-top: 0; background: var(--qpe-ink); }
  .qpe-page-home .qpe-pub-footer-row { min-height: 110px; }
  .qpe-page-home .qpe-pub-footer-copy { color: #C9D2DA; }
  .qpe.qpe-page-home .qpe-pub-footer-links a { color: #fff; }
}
/* Signed out: the shared header sits transparent over the photo */
.qpe-home-overlay .qpe-header { position: absolute; top: 0; left: 0; right: 0; z-index: 20; background: transparent; border-bottom: 0; }
.qpe-home-overlay .qpe-header .navbar-brand, .qpe-home-overlay .qpe-header .navbar-brand:hover,
.qpe-home-overlay .qpe-header .qpe-logo, .qpe.qpe-home-overlay .qpe-header-login,
.qpe-home-overlay .qpe-header .navbar-toggler { color: #fff; }
@media (min-width: 992px) {
  .qpe-home-overlay .qpe-header { min-height: 80px; }
  .qpe-home-overlay .qpe-header .nav-link { color: rgba(255,255,255,.92); }
  .qpe-home-overlay .qpe-header .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
  .qpe.qpe-home-overlay .qpe-start-free { background: #fff; color: var(--qpe-ink); font-weight: 700; }
}
@media (max-width: 991.98px) {
  .qpe-home-overlay .qpe-header .navbar-toggler[aria-expanded="true"] { background: rgba(255,255,255,.18); }
  .qpe-home-overlay .qpe-header .navbar-collapse { position: absolute; top: 60px; left: 12px; right: 12px; margin: 0; padding: 8px 0 12px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(16,32,46,.35); }
  .qpe-home-overlay .qpe-header .navbar-collapse .nav-link { color: var(--qpe-ink); padding: 0 18px !important; }
  .qpe-home-overlay .qpe-nav-public { padding: 0 12px; }
}

/* ---------- How it works (HowItWorks, M-HowItWorks) ---------- */
.qpe-how-hero { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 64px; align-items: end; padding-top: 80px; padding-bottom: 56px; }
.qpe-how-h1 { max-width: 780px; margin-top: 18px; font-size: 68px; line-height: .98; font-stretch: 78%; }
.qpe-how-hero .qpe-pub-lead { max-width: 720px; margin-top: 18px; font-size: 20px; }
.qpe-how-toc { display: flex; flex-direction: column; gap: 2px; padding: 20px 22px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-how-toc .qpe-pub-label { padding-bottom: 6px; font-size: 12px; }
.qpe-how-toc a { display: flex; align-items: center; min-height: 40px; font-size: 16px; font-weight: 600; }
.qpe-how-chips { margin-top: 20px; }
.qpe .qpe-how-chips .qpe-chip:hover { text-decoration: none; background: #F1EFE9; }
.qpe-how-section { padding-top: 72px; padding-bottom: 72px; scroll-margin-top: 16px; }
.qpe-how-steps { padding-top: 24px; }
.qpe-how-step-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 28px 0 0; padding: 0; list-style: none; }
.qpe-how-step { display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 26px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-how-step-top { display: flex; align-items: center; justify-content: space-between; }
.qpe-how-step-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--qpe-primary); color: #fff; font-size: 17px; font-weight: 700; }
.qpe-how-step-when { font-family: var(--qpe-mono); font-size: 12px; color: var(--qpe-muted); }
.qpe-pub .qpe-how-step h3 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 700; font-stretch: 90%; }
.qpe-how-step p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe-how-step-ex { margin-top: auto; padding: 10px 12px; border-radius: 8px; background: var(--qpe-page); font-family: var(--qpe-mono); font-size: 12.5px; line-height: 1.5; color: #33475B; }
.qpe-how-band { background: #fff; border-top: 1px solid var(--qpe-line); border-bottom: 1px solid var(--qpe-line); scroll-margin-top: 16px; }
.qpe-how-rule { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 56px; padding-top: 72px; padding-bottom: 72px; }
.qpe-how-rule-text > p { margin: 18px 0; font-size: 17px; line-height: 1.55; color: var(--qpe-text); }
.qpe-how-rules { display: flex; flex-direction: column; gap: 12px; }
.qpe-how-rule-row { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--qpe-far); font-size: 15px; line-height: 1.5; }
.qpe-how-rule-key { font-family: var(--qpe-mono); font-size: 15px; font-weight: 600; color: var(--qpe-primary-dark); white-space: nowrap; }
.qpe-how-rule-row.is-pre { background: var(--qpe-pre-tint); color: var(--qpe-pre-ink); }
.qpe-how-rule-row.is-pre .qpe-how-rule-key { color: #6B4A00; }
.qpe-how-rule-text > .qpe-how-note, .qpe-how-note { margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--qpe-muted); }
.qpe-how-chart { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.qpe-how-chart figcaption, .qpe-how-mchart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.qpe-how-chart-title { font-size: 18px; font-weight: 700; }
.qpe-how-chart-sample { font-size: 13px; color: var(--qpe-muted); }
.qpe-how-plot { position: relative; height: 300px; margin-left: 56px; border-left: 1px solid var(--qpe-input-line); border-bottom: 1px solid var(--qpe-input-line); }
.qpe-how-plot svg, .qpe-how-probs svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.qpe-how-band-pre, .qpe-how-band-qpe { position: absolute; top: 0; bottom: 0; width: 28.5714%; }
.qpe-how-band-pre { left: 0; background: rgba(253,241,207,.7); }
.qpe-how-band-qpe { left: 28.5714%; border-left: 2px solid var(--qpe-48h); border-right: 2px solid var(--qpe-48h); background: rgba(31,102,166,.12); }
.qpe-how-band-pre span, .qpe-how-band-qpe span { position: absolute; top: 8px; left: 10px; font-size: 13px; font-weight: 700; color: var(--qpe-primary-dark); }
.qpe-how-band-pre span { color: #6B4A00; }
.qpe-how-line { position: absolute; left: 0; right: 0; }
.qpe-how-line span { position: absolute; right: 6px; top: -20px; font-family: var(--qpe-mono); font-size: 12px; font-weight: 600; }
.qpe-how-line-start { top: 150px; border-top: 2px dashed var(--qpe-primary-dark); }
.qpe-how-line-start span { color: var(--qpe-primary-dark); }
.qpe-how-line-cont { top: 225px; border-top: 2px dashed var(--qpe-72h); }
.qpe-how-line-cont span { color: var(--qpe-48h); }
.qpe-how-mark { position: absolute; z-index: 1; width: 160px; padding: 3px 0; border: 1px solid var(--qpe-input-line); border-radius: 6px; background: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.qpe-how-mark-1 { left: calc(30.357% - 80px); top: 70px; }
.qpe-how-mark-2 { left: calc(44.643% - 80px); top: 142px; }
.qpe-how-mark-3 { left: calc(58.929% - 80px); top: 214px; }
.qpe-how-axis { position: absolute; left: -56px; font-family: var(--qpe-mono); font-size: 12px; color: var(--qpe-muted); }
.qpe-how-axis-top { top: -6px; }
.qpe-how-axis-zero { bottom: -6px; }
.qpe-how-axis-50 { bottom: 28px; }
.qpe-how-probs { position: relative; height: 70px; margin-left: 56px; border-bottom: 1px solid var(--qpe-input-line); }
.qpe-how-probs-line { position: absolute; left: 0; right: 0; bottom: 35px; border-top: 1.5px dashed var(--qpe-48h); }
.qpe-how-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-left: 56px; font-size: 13px; color: var(--qpe-muted); text-align: center; }
.qpe-how-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: 56px; font-size: 13px; color: var(--qpe-text); }
.qpe-how-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.qpe-how-key-line { width: 22px; height: 3px; background: var(--qpe-ink); }
.qpe-how-key-bar { width: 10px; height: 14px; background: var(--qpe-72h); }
.qpe-how-key-sq { width: 12px; height: 12px; border-radius: 2px; }
.qpe-how-key-sq.is-qpe { background: var(--qpe-now); }
.qpe-how-key-sq.is-pre { background: var(--qpe-pre); }
.qpe-how-key-dash { width: 18px; border-top: 2px dashed var(--qpe-48h); }
.qpe-how-mchart { margin: 16px 0 0; padding: 16px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-how-mchart figcaption { justify-content: flex-start; }
.qpe-how-mchart .qpe-how-chart-title { font-size: 14px; }
.qpe-how-mchart svg { display: block; width: 100%; height: 110px; margin-top: 12px; border-bottom: 1px solid var(--qpe-input-line); }
.qpe-how-mchart .qpe-how-days, .qpe-how-mchart .qpe-how-legend { margin: 6px 0 0; font-size: 12px; }
.qpe-how-mchart .qpe-how-legend { margin-top: 10px; gap: 6px 14px; }
.qpe-how-mchart .qpe-how-note { margin-top: 10px; }
.qpe-how-expect { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; align-items: start; margin-top: 28px; }
.qpe-how-timeline { margin: 0; padding: 0; list-style: none; }
.qpe-how-tl-item { display: grid; grid-template-columns: 190px 28px minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 26px; }
.qpe-how-tl-when { padding-top: 2px; font-size: 15px; font-weight: 700; color: var(--qpe-primary); text-align: right; }
.qpe-how-tl-rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; margin-bottom: -26px; }
.qpe-how-tl-rail::after { content: ""; flex-grow: 1; width: 2px; margin-top: 4px; background: #D5D2C8; }
.qpe-how-tl-item:last-child .qpe-how-tl-rail { margin-bottom: 0; }
.qpe-how-tl-dot { flex-shrink: 0; width: 14px; height: 14px; margin-top: 3px; border: 3px solid var(--qpe-page); border-radius: 50%; }
.qpe-how-tl-dot.is-primary { background: var(--qpe-primary); box-shadow: 0 0 0 1.5px var(--qpe-primary); }
.qpe-how-tl-dot.is-qpe { background: var(--qpe-48h); box-shadow: 0 0 0 1.5px var(--qpe-48h); }
.qpe-how-tl-dot.is-pre { background: var(--qpe-pre-line); box-shadow: 0 0 0 1.5px var(--qpe-pre-line); }
.qpe-how-tl-dot.is-muted { background: var(--qpe-muted); box-shadow: 0 0 0 1.5px var(--qpe-muted); }
.qpe-how-tl-body { display: flex; flex-direction: column; gap: 4px; }
.qpe-how-tl-body strong { font-size: 18px; }
.qpe-how-tl-body > span { font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe-how-nots { padding: 24px 26px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-pub .qpe-how-nots h3 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.qpe-how-nots ul { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.qpe-how-nots li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.5; color: var(--qpe-text); }
.qpe-how-x { font-weight: 700; color: var(--qpe-danger); }
.qpe-how-faq-band { border-bottom: 0; }
.qpe-how-faq-band .qpe-how-section { padding-top: 64px; }
.qpe-how-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 20px; }
.qpe-how-q { border: 1px solid var(--qpe-line); border-radius: 12px; background: #fff; }
.qpe-how-q summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 20px; font-size: 17px; font-weight: 600; cursor: pointer; list-style: none; }
.qpe-how-q summary::-webkit-details-marker { display: none; }
.qpe-how-sign::before { content: "+"; font-size: 22px; font-weight: 400; color: var(--qpe-muted); }
.qpe-how-q[open] .qpe-how-sign::before { content: "−"; }
.qpe-how-q p { margin: 0; padding: 0 20px 20px; font-size: 15px; line-height: 1.6; color: var(--qpe-text); }
.qpe-how-cta { background: var(--qpe-ink); color: #fff; }
.qpe-how-cta-row { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-top: 64px; padding-bottom: 64px; }
.qpe-pub .qpe-how-cta h2 { margin: 0; font-size: 40px; font-weight: 750; font-stretch: 80%; color: #fff; }
.qpe-how-cta p { margin: 10px 0 0; font-size: 17px; color: #C9D2DA; }
.qpe-how-cta-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* ---------- Contact (Public-Contact, M-Contact) ---------- */
.qpe-contact-h1 { max-width: 900px; }
.qpe-contact-lead { max-width: 800px; }
.qpe-contact-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.qpe-contact-card { padding: 28px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-contact-card .qpe-pub-label { font-size: 13px; color: var(--qpe-text); }
.qpe .qpe-contact-link { display: inline-block; margin-top: 10px; font-size: 22px; font-weight: 700; text-decoration: underline; overflow-wrap: anywhere; }
.qpe-contact-card p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--qpe-text); }
.qpe-contact-foot { margin: 32px 0 0; font-size: 14.5px; color: var(--qpe-muted); }
.qpe .qpe-contact-foot a { text-decoration: underline; }

/* ---------- About (Public-About, M-About) ---------- */
.qpe-about { display: grid; grid-template-columns: minmax(0, 760px) 420px; justify-content: space-between; gap: 72px; align-items: start; }
.qpe-about-h1 { margin-bottom: 8px; }
.qpe-pub .qpe-about-sec h2 { margin: 36px 0 12px; font-size: 26px; font-weight: 700; }
.qpe-about-sec p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; color: var(--qpe-text); }
.qpe-about-sign { margin: 44px 0 0; font-size: 17px; line-height: 1.35; color: var(--qpe-text); }
.qpe-about-sign strong { color: var(--qpe-ink); }
.qpe-about-sign span { color: var(--qpe-muted); }
.qpe-about-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.qpe-about-try { padding: 28px; border-radius: 16px; background: var(--qpe-ink); color: #C9D2DA; }
.qpe-pub .qpe-about-try h2 { margin: 0; font-size: 24px; font-weight: 700; color: #fff; }
.qpe-about-try p { margin: 12px 0 20px; font-size: 15.5px; line-height: 1.5; }
.qpe .qpe-about-try .qpe-pub-btn-light { min-height: 48px; font-size: 16px; }
.qpe-about-more { display: flex; flex-direction: column; gap: 18px; padding: 24px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-pub .qpe-about-more h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.qpe .qpe-about-more a { font-size: 15.5px; text-decoration: underline; }

/* ---------- Terms and Privacy (Public-Terms, Public-Privacy, M-Terms, M-Privacy) ---------- */
.qpe-legal { display: grid; grid-template-columns: 280px minmax(0, 760px); gap: 72px; padding-top: 56px; padding-bottom: 80px; }
.qpe-legal-nav { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; }
.qpe-legal-nav .qpe-pub-label { padding: 6px 0 10px; font-size: 12px; }
.qpe-legal-nav a { display: flex; align-items: center; min-height: 36px; font-size: 14.5px; line-height: 1.2; }
.qpe .qpe-legal-nav .qpe-legal-other { margin-top: 18px; font-weight: 700; text-decoration: underline; }
.qpe-legal-text .qpe-pub-kicker { font-size: 14px; }
.qpe-legal-h1 { font-size: 56px; }
.qpe-legal-updated { margin: 8px 0 0; font-size: 15px; color: var(--qpe-muted); }
.qpe-legal-intro { margin: 28px 0 0; font-size: 17px; line-height: 1.6; color: var(--qpe-text); }
.qpe-legal-sec { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--qpe-line); scroll-margin-top: 16px; }
.qpe-pub .qpe-legal-sec h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; }
.qpe-legal-sec p, .qpe-legal-sec li { margin: 0 0 12px; font-size: 15.5px; line-height: 1.6; color: var(--qpe-text); }
.qpe-legal-sec ul { margin: 0; padding-left: 20px; }
.qpe-legal-sec strong { color: var(--qpe-ink); }
.qpe-legal-sec .qpe-legal-caps { font-size: 13.5px; letter-spacing: .01em; }
.qpe-legal-jump { margin: 20px 0 0; }
.qpe-legal-jump select { width: 100%; }

/* ---------- What's new (Public-ReleaseNotes, M-ReleaseNotes) ---------- */
.qpe-rn { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: 64px; padding-top: 56px; }
.qpe-rn-versions { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.qpe-rn-versions .qpe-pub-label { padding-bottom: 8px; font-size: 12px; }
.qpe .qpe-rn-versions a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--qpe-ink); font-size: 14px; text-decoration: none; }
.qpe .qpe-rn-versions a:hover { background: #F1EFE9; }
.qpe .qpe-rn-versions a.is-current { background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-weight: 700; }
.qpe-rn-versions .qpe-mono { font-size: 12px; font-weight: 400; color: var(--qpe-muted); }
.qpe-rn-crumb { display: flex; gap: 8px; font-size: 14px; color: var(--qpe-muted); }
.qpe .qpe-rn-crumb a { text-decoration: underline; }
.qpe-rn-crumb span:last-child { color: var(--qpe-ink); }
.qpe .qpe-rn-back { font-size: 15px; font-weight: 700; text-decoration: underline; }
.qpe-rn-h1 { margin-top: 8px; font-size: 44px; font-stretch: 82%; }
.qpe-rn-lead { margin-top: 10px; font-size: 17px; }
.qpe .qpe-rn-lead a { text-decoration: underline; }
.qpe-rn-card { margin-top: 28px; padding: 28px 32px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; scroll-margin-top: 16px; }
.qpe-rn-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; padding-bottom: 4px; }
.qpe-pub .qpe-rn-head h2 { margin: 0; font-size: 26px; font-weight: 700; font-stretch: 88%; }
.qpe-rn-date { font-family: var(--qpe-mono); font-size: 13px; color: var(--qpe-muted); }
.qpe-rn-latest { padding: 3px 8px; border-radius: 10px; background: #DCE8F3; font-size: 12px; font-weight: 700; color: var(--qpe-primary-dark); }
.qpe-rn-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--qpe-line-soft); }
.qpe-rn-tag { justify-self: start; padding: 4px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.qpe-rn-tag.is-new { background: var(--qpe-primary); color: #fff; }
.qpe-rn-tag.is-fix { background: #FBE3A1; color: #4A3200; }
.qpe-rn-tag.is-improved { background: #F0EFEA; color: var(--qpe-text); }
.qpe-rn-body { display: flex; flex-direction: column; gap: 4px; }
.qpe-rn-body strong { font-size: 16px; }
.qpe-rn-body > span { font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe .qpe-rn-more { margin-top: 28px; padding: 0; border: 0; background: none; color: var(--qpe-primary); font-size: 15px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.qpe-rn-older { padding-bottom: 40px; }
.qpe-rn-legacy { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--qpe-line-soft); font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe-rn-legacy ul { margin: 0; padding-left: 20px; }
.qpe-rn-legacy li { margin-bottom: 8px; }
.qpe-pub .qpe-rn-group { margin: 44px 0 0; font-size: 22px; font-weight: 700; }
.qpe-rn-select { margin-top: 18px; }
.qpe-rn-select select { width: 100%; }

/* ---------- Pricing (Price-A-TwoPlans, M-Pricing) ---------- */
.qpe-pricing { max-width: calc(1040px + 2 * var(--qpe-pub-gutter)); }
.qpe-pricing-head { text-align: center; }
.qpe-pricing-head .qpe-pub-h1 { font-size: 56px; }
.qpe-pricing-head .qpe-pub-lead { margin-top: 12px; }
.qpe-pricing-current { display: inline-block; margin: 16px 0 0; padding: 8px 14px; border-radius: 20px; background: var(--qpe-primary-tint); font-size: 15px; color: var(--qpe-primary-dark); }
.qpe-pricing-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.qpe-plan-card { display: flex; flex-direction: column; gap: 18px; padding: 36px; border: 1px solid var(--qpe-line); border-radius: 16px; background: #fff; }
.qpe-plan-card.is-featured { border: 2px solid var(--qpe-primary); padding: 35px; }
.qpe-pub .qpe-plan-card h2 { margin: 0; font-size: 22px; font-weight: 700; }
.qpe-plan-price { font-family: var(--qpe-mono); font-size: 48px; font-weight: 500; line-height: 1; }
.qpe-plan-price span { font-size: 18px; color: var(--qpe-muted); }
.qpe-plan-sub { font-size: 15px; color: var(--qpe-text); }
.qpe-plan-feats { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 15.5px; }
.qpe-plan-feats li { display: flex; align-items: center; gap: 10px; }
.qpe-plan-feats svg { flex-shrink: 0; color: var(--qpe-good); }
.qpe-plan-card .qpe-btn-block { margin-top: auto; }
.qpe .qpe-plan-cta-eval { border-color: var(--qpe-input-line); background: #fff; color: var(--qpe-ink); }
.qpe .qpe-plan-cta-paid { background: var(--qpe-primary); color: #fff; }
.qpe .qpe-plan-cta-eval:hover, .qpe .qpe-plan-cta-paid:hover { text-decoration: none; filter: brightness(.96); }
.qpe .qpe-plan-savings { align-self: center; font-size: 15px; font-weight: 700; text-decoration: underline; }
.qpe-pricing-faq { margin-top: 40px; }
.qpe-pub .qpe-pricing-faq h2 { margin: 0 0 12px; font-size: 28px; font-weight: 700; }
.qpe-pricing-qs details { padding: 16px 0; border-top: 1px solid var(--qpe-line); }
.qpe-pricing-qs summary { min-height: 28px; font-size: 18px; font-weight: 700; cursor: pointer; }
.qpe-pricing-qs p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--qpe-text); }

/* ---------- ROI calculator (Price-B-Slider, M-ROI) ---------- */
.qpe-page-roi .qpe-roi { padding-top: 44px; padding-bottom: 48px; }
@media (min-width: 1200px) { .qpe-page-roi .qpe-roi { padding-left: 120px; padding-right: 120px; } }
.qpe-roi-h1 { margin-top: 4px; font-size: 48px; line-height: 1.04; font-stretch: 82%; }
.qpe-roi-head .qpe-pub-lead { margin-top: 8px; font-size: 18px; }
.qpe-roi-grid { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 28px; align-items: start; margin-top: 28px; }
.qpe-roi-inputs { padding: 8px 28px 10px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-roi-sites { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.qpe-roi-row { display: flex; align-items: center; gap: 14px; }
.qpe-roi-inputs > .qpe-roi-row { padding: 18px 0; border-top: 1px solid var(--qpe-line-soft); }
.qpe-roi-label { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; margin: 0; font-weight: 400; }
.qpe-roi-label strong { font-size: 17px; }
.qpe-roi-label > span { font-size: 14px; color: var(--qpe-muted); }
.qpe-roi-step { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--qpe-input-line); border-radius: 50%; background: #fff; color: var(--qpe-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.qpe-roi-step:hover { background: #F1EFE9; }
.qpe-roi-value { display: inline-flex; align-items: center; justify-content: center; min-width: 72px; font-family: var(--qpe-mono); font-size: 24px; font-weight: 600; }
.qpe-roi-value input { width: 3.2ch; field-sizing: content; min-width: 1ch; padding: 0; border: 0; border-bottom: 1px dashed transparent; background: transparent; color: var(--qpe-ink); font: inherit; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.qpe-roi-value input:hover, .qpe-roi-value input:focus { border-bottom-color: var(--qpe-input-line); }
.qpe-roi-value input::-webkit-outer-spin-button, .qpe-roi-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qpe-roi-sites .qpe-roi-value { font-size: 30px; }
.qpe-roi-range { width: 100%; height: 28px; margin: 0; accent-color: var(--qpe-primary); }
.qpe-roi-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.qpe-roi-preset { height: 40px; padding: 0 16px; border: 1px solid var(--qpe-input-line); border-radius: 20px; background: #fff; color: var(--qpe-ink); font-size: 15px; cursor: pointer; white-space: nowrap; }
.qpe-roi-preset[aria-pressed="true"] { border-color: var(--qpe-ink); background: var(--qpe-ink); color: #fff; font-weight: 600; }
.qpe-roi-how { padding: 16px 0; border-top: 1px solid var(--qpe-line-soft); }
.qpe-roi-how summary { font-size: 16px; font-weight: 700; cursor: pointer; }
.qpe-roi-how > div { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe-roi-formula { padding: 10px 12px; border-radius: 8px; background: var(--qpe-page); font-family: var(--qpe-mono); font-size: 14px; color: var(--qpe-ink); }
.qpe-roi-result { display: flex; flex-direction: column; gap: 18px; padding: 30px 30px 28px; border-radius: 18px; background: var(--qpe-ink); color: #fff; }
.qpe-roi-result-label { font-size: 16px; color: #AFC0CF; }
.qpe-roi-save { display: flex; align-items: baseline; gap: 8px; }
.qpe-roi-save > span:first-child { font-size: 72px; line-height: .95; font-weight: 750; font-stretch: 78%; letter-spacing: -0.01em; }
.qpe-roi-save > span:last-child { font-size: 18px; color: #AFC0CF; }
.qpe-roi-summary { font-size: 17px; line-height: 1.5; color: #DCE4EB; }
.qpe-roi-summary b { color: #fff; }
.qpe-roi-bars { display: flex; flex-direction: column; gap: 12px; }
.qpe-roi-bar-row { display: flex; flex-direction: column; gap: 6px; }
.qpe-roi-bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #DCE4EB; }
.qpe-roi-bar-label .qpe-mono { font-weight: 600; color: #fff; }
.qpe-roi-track { display: block; height: 14px; border-radius: 7px; background: rgba(255,255,255,.12); }
.qpe-roi-fill { display: block; height: 14px; border-radius: 7px; transition: width .15s; }
.qpe-roi-fill.is-hand { background: var(--qpe-pre); }
.qpe-roi-fill.is-plan { background: #9CC4E8; }
.qpe-roi-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.08); }
.qpe-roi-plan > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.qpe-roi-plan-label { font-size: 13px; color: #AFC0CF; }
.qpe-roi-plan strong { font-size: 17px; }
.qpe-roi-price { font-size: 26px; font-weight: 750; font-stretch: 85%; white-space: nowrap; }
.qpe-roi-price > span:last-child { font-size: 14px; font-weight: 500; color: #AFC0CF; }
.qpe .qpe-roi-result .qpe-pub-btn-light { border-radius: 10px; }
.qpe .qpe-roi-compare { align-self: center; font-size: 15px; font-weight: 600; text-decoration: underline; }
.qpe .qpe-roi-result .qpe-roi-compare { color: #9CC4E8; }
.qpe-roi-sticky-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 14px; }

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
  body.qpe-public { --qpe-pub-gutter: 40px; }
  .qpe-how-hero { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
  .qpe-how-step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qpe-how-rule { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .qpe-how-expect { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .qpe-about { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
  .qpe-legal { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
  .qpe-rn { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .qpe-roi-grid { grid-template-columns: minmax(0, 1fr) 420px; }
}
@media (max-width: 991.98px) {
  body.qpe-public { --qpe-pub-gutter: 32px; }
  .qpe-pub .qpe-home-h1 { font-size: 72px; }
  .qpe-how-hero { grid-template-columns: minmax(0, 1fr); }
  .qpe-how-h1, .qpe-pub-h1 { font-size: 52px; }
  .qpe-how-cta-row { flex-direction: column; align-items: flex-start; }
  .qpe-contact-cards { grid-template-columns: minmax(0, 1fr); }
  .qpe-about { grid-template-columns: minmax(0, 1fr); }
  .qpe-about-side { position: static; flex-direction: row; }
  .qpe-about-side > * { flex: 1; }
  .qpe-roi-grid { grid-template-columns: minmax(0, 1fr); }
  .qpe-plan-card { padding: 28px; }
  .qpe-plan-card.is-featured { padding: 27px; }
}

/* ---------- Phone ---------- */
@media (max-width: 767.98px) {
  body.qpe-public { --qpe-pub-gutter: 16px; }
  .qpe-pub-page { padding-top: 24px; padding-bottom: 32px; }
  .qpe-pub-kicker { font-size: 13px; }
  .qpe-pub-h1, .qpe-how-h1, .qpe-legal-h1, .qpe-pricing-head .qpe-pub-h1 { font-size: 34px; line-height: 1.05; font-stretch: 85%; }
  .qpe-pub-h2 { font-size: 26px; }
  .qpe-pub-lead { font-size: 16.5px; }
  .qpe-pub-footer { background: var(--qpe-page); }
  .qpe-pub-footer-row { flex-direction: column-reverse; align-items: flex-start; gap: 14px; }
  .qpe-pub-footer-links { gap: 18px; }

  .qpe-home-hero::before { background: linear-gradient(180deg, rgba(16,32,46,.6) 0%, rgba(16,32,46,.72) 40%, rgba(16,32,46,.88) 100%); }
  .qpe-home-hero-text { padding-top: 296px; padding-bottom: 36px; }
  .qpe-pub .qpe-home-h1 { margin-top: 10px; font-size: 44px; line-height: 1; }
  .qpe-home-lead { margin-top: 12px; font-size: 17px; }
  .qpe-home-actions { flex-direction: column; gap: 14px; margin-top: 26px; }
  .qpe .qpe-home-btn-light, .qpe .qpe-home-btn-ghost { width: 100%; min-height: 50px; }
  .qpe-home-note { margin-top: 20px; font-size: 13px; line-height: 1.5; }
  .qpe-home-points { padding-top: 24px; padding-bottom: 24px; }
  .qpe-home-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .qpe-home-point { padding: 18px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
  .qpe-home-big { font-size: 28px; color: var(--qpe-primary); }
  .qpe-pub .qpe-home-point h2 { margin: 6px 0 4px; font-size: 20px; }
  .qpe-home-point p { font-size: 15px; }
  .qpe .qpe-home-more { margin-top: 20px; font-size: 16px; }

  .qpe-how-hero { padding-top: 20px; padding-bottom: 8px; gap: 0; }
  .qpe-how-h1 { margin-top: 8px; }
  .qpe-how-hero .qpe-pub-lead { margin-top: 12px; font-size: 16.5px; }
  .qpe-how-section { padding-top: 32px; padding-bottom: 32px; }
  .qpe-how-steps { padding-top: 24px; }
  .qpe-how-step-list { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 16px; }
  .qpe-how-step { gap: 8px; padding: 16px; }
  .qpe-how-step-num { width: 32px; height: 32px; font-size: 15px; }
  .qpe-pub .qpe-how-step h3 { font-size: 20px; }
  .qpe-how-step-ex { margin-top: 4px; background: var(--qpe-far); }
  .qpe-how-band { background: transparent; border: 0; }
  .qpe-how-rule { padding-top: 16px; padding-bottom: 16px; gap: 0; }
  .qpe-how-rule-text > p { margin: 12px 0 16px; font-size: 16px; }
  .qpe-how-rules { gap: 0; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; overflow: hidden; }
  .qpe-how-rule-row, .qpe-how-rule-row.is-pre { display: block; padding: 14px 16px; border-radius: 0; background: #fff; color: var(--qpe-ink); font-size: 16px; }
  .qpe-how-rule-row + .qpe-how-rule-row { border-top: 1px solid var(--qpe-line-soft); }
  .qpe-how-rule-key { display: block; margin-bottom: 2px; font-family: var(--qpe-font); font-size: 13px; font-weight: 700; color: var(--qpe-primary-dark); }
  .qpe-how-rule-row:nth-child(2) .qpe-how-rule-key { color: var(--qpe-48h); }
  .qpe-how-rule-row.is-pre .qpe-how-rule-key { color: #8A4B14; }
  .qpe-how-expect { margin-top: 16px; }
  .qpe-how-tl-item { grid-template-columns: 16px minmax(0, 1fr); grid-template-areas: "rail when" "rail body"; gap: 2px 14px; padding-bottom: 18px; }
  .qpe-how-tl-when { grid-area: when; padding: 0; font-family: var(--qpe-mono); font-size: 12px; font-weight: 400; color: var(--qpe-muted); text-align: left; }
  .qpe-how-tl-rail { grid-area: rail; margin-bottom: -18px; }
  .qpe-how-tl-body { grid-area: body; }
  .qpe-how-tl-body strong { font-size: 17px; }
  .qpe-how-tl-body > span { font-size: 14.5px; }
  .qpe-how-nots { padding: 18px 16px; background: #F1EFE9; border-color: #E2E0D8; }
  .qpe-how-faq-band { background: transparent; }
  .qpe-how-faq-band .qpe-how-section { padding-top: 8px; }
  .qpe-how-faq { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 12px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; overflow: hidden; }
  .qpe-how-q { border: 0; border-radius: 0; }
  .qpe-how-q + .qpe-how-q { border-top: 1px solid var(--qpe-line-soft); }
  .qpe-how-q summary { min-height: 56px; padding: 12px 16px; font-size: 16px; font-weight: 700; }
  .qpe-how-q p { padding: 0 16px 16px; }
  .qpe-how-cta { margin: 8px var(--qpe-pub-gutter) 32px; border-radius: 16px; }
  .qpe-how-cta-row { padding: 24px 20px; gap: 18px; align-items: stretch; }
  .qpe-pub .qpe-how-cta h2 { font-size: 30px; line-height: 1.05; }
  .qpe-how-cta p { font-size: 16px; }
  .qpe-how-cta-actions { flex-direction: column; }
  .qpe-how-cta-actions .qpe-btn { width: 100%; min-height: 50px; }
  .qpe-how-cta-actions .qpe-pub-btn-light { order: -1; }

  .qpe-contact-cards { gap: 14px; margin-top: 22px; }
  .qpe-contact-card { padding: 18px 16px; }
  .qpe-contact-card .qpe-pub-label { font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
  .qpe .qpe-contact-link { margin-top: 4px; font-size: 20px; }
  .qpe-contact-card p { margin-top: 8px; font-size: 15px; }
  .qpe-contact-foot { margin-top: 18px; font-size: 14px; line-height: 1.5; }

  .qpe-about-h1 { padding-bottom: 20px; border-bottom: 1px solid var(--qpe-line); }
  .qpe-about-sec + .qpe-about-sec { border-top: 1px solid var(--qpe-line); }
  .qpe-pub .qpe-about-sec h2 { margin: 20px 0 10px; font-size: 21px; }
  .qpe-about-sec p { font-size: 16px; line-height: 1.55; }
  .qpe-about-sign { margin: 20px 0 0; font-size: 16px; }

  .qpe-legal { display: block; padding-top: 24px; padding-bottom: 32px; }
  .qpe-legal-updated { font-size: 13.5px; }
  .qpe-legal-intro { margin-top: 16px; font-size: 16px; }
  .qpe-legal-sec { margin-top: 20px; padding-top: 20px; }
  .qpe-pub .qpe-legal-sec h2 { font-size: 20px; }
  .qpe-legal-sec p, .qpe-legal-sec li { font-size: 15.5px; }

  .qpe-rn { display: block; padding-top: 24px; padding-bottom: 32px; }
  .qpe-rn-h1 { margin-top: 8px; font-size: 34px; }
  .qpe-rn-lead { font-size: 16px; }
  .qpe-rn-card { margin-top: 14px; padding: 18px 16px; }
  .qpe-pub .qpe-rn-head h2 { font-size: 22px; }
  .qpe-rn-item { display: flex; flex-direction: column; gap: 6px; }
  .qpe-rn-body strong { font-size: 17px; }

  .qpe-pricing-head { text-align: left; }
  .qpe-pricing-plans { grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 20px; }
  .qpe-plan-card, .qpe-plan-card.is-featured { gap: 10px; padding: 20px; }
  .qpe-plan-price { font-family: var(--qpe-font); font-size: 42px; font-weight: 700; }
  .qpe-plan-price span { font-family: var(--qpe-font); font-size: 16px; font-weight: 400; }
  .qpe-plan-sub { font-size: 14px; color: var(--qpe-muted); }
  .qpe-plan-feats { display: block; margin: 0 0 12px; padding-left: 20px; list-style: disc; font-size: 16px; }
  .qpe-plan-feats li { display: list-item; }
  .qpe-plan-feats svg { display: none; }
  .qpe .qpe-plan-cta-eval { border-color: transparent; background: var(--qpe-primary); color: #fff; }
  .qpe .qpe-plan-cta-paid { border-color: var(--qpe-input-line); background: #fff; color: var(--qpe-ink); }
  .qpe-pricing-faq { margin-top: 24px; }
  .qpe-pub .qpe-pricing-faq h2 { font-size: 24px; margin-bottom: 8px; }
  .qpe-pricing-qs { padding: 4px 16px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
  .qpe-pricing-qs details:first-child { border-top: 0; }
  .qpe-pricing-qs details { border-color: var(--qpe-line-soft); }
  .qpe-pricing-qs summary { font-size: 16.5px; list-style: none; }
  .qpe-pricing-qs summary::-webkit-details-marker { display: none; }

  .qpe-page-roi .qpe-roi { padding-top: 24px; padding-bottom: 24px; }
  .qpe-roi-h1 { font-size: 32px; }
  .qpe-roi-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
  .qpe-roi-result { order: -1; gap: 12px; padding: 20px 18px; border-radius: var(--qpe-radius-panel); }
  .qpe-roi-result-label { font-size: 15px; }
  .qpe-roi-save > span:first-child { font-size: 48px; }
  .qpe-roi-summary { font-size: 15.5px; }
  .qpe-roi-bar-label { font-size: 13.5px; }
  .qpe-roi-track, .qpe-roi-fill { height: 10px; }
  .qpe-roi-inputs { width: 100%; padding: 4px 16px; }
  .qpe-roi-sites { padding: 16px 0; }
  .qpe-roi-presets { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .qpe-roi-preset { flex-shrink: 0; }
  .qpe-roi-inputs > .qpe-roi-row { padding: 14px 0; }
  .qpe-roi-row { gap: 10px; }
  .qpe-roi-label > span { font-size: 13px; }
  .qpe-roi-value { min-width: 56px; }
  .qpe-roi-how { margin: 0 -16px -4px; padding: 20px 16px; }
  .qpe .qpe-roi-compare { display: block; margin-top: 20px; text-align: center; }
  .qpe-roi-sticky { margin-top: 8px; }
}
.qpe-page-home:not(.qpe-home-overlay) .qpe-home-hero-text { padding-top: 128px; }   /* signed in: the header isn't over the photo */

/* Base dialog + plan bar (first defined in PR 2, Sites dashboard) -- pulled in early for Account
   settings' delete-account dialog and plan usage bar, which need them now. */
/* =====================================================================================
   Sites page (PR 2): blueprints/sitemanagement/templates/sitemanagement/qpe_map.html
   Screens: Sites-F-ListMapCards, Sites-P2-*, M-Sites, M-Sites-Map, M-Sites-Attention, M-Sites-Empty
   ===================================================================================== */
.qpe-page-sites main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 28px 40px 40px; }  /* overrides wide_layout's inline 90%; main is a flex item of .row */
.qpe-page-sites main[role="main"] > .col { padding: 0; }
body.qpe-page-sites > .row { margin-left: 0; margin-right: 0; }   /* wide_layout's .row adds -15px */
.qpe-page-sites h1, .qpe-page-sites h2, .qpe-page-sites h3 { color: var(--qpe-ink); }   /* main.css greys all headings */
.qpe-page-sites .footer { display: none; }

.qpe-sites-head { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: end; gap: 16px; margin-bottom: 20px; }
.qpe-sites-actions { display: flex; align-items: flex-end; gap: 8px; }
.qpe-plan { width: 160px; align-self: center; font-size: 13px; color: var(--qpe-muted); }
.qpe-plan-row { display: flex; justify-content: space-between; align-items: baseline; }
.qpe-plan-row .qpe-mono { color: var(--qpe-ink); font-size: 13px; }
.qpe-plan-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--qpe-line); overflow: hidden; }
.qpe-plan-bar span { display: block; height: 100%; border-radius: 2px; background: var(--qpe-primary); }
.qpe-plan.is-over .qpe-plan-bar span { background: var(--qpe-danger); }

.qpe-filters { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 20px; }
.qpe-filter { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--qpe-line); border-radius: 10px; background: var(--qpe-surface); color: var(--qpe-ink); text-align: left; cursor: pointer; }
.qpe-filter[aria-pressed="true"] { padding: 7px 9px; border: 2px solid var(--qpe-ink); }
.qpe-filter-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--qpe-text); white-space: nowrap; }
.qpe-filter-count { font-size: 18px; font-weight: 600; line-height: 1.25; }

.qpe-sites-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; align-items: start; }
.qpe-sites-list { display: flex; flex-direction: column; gap: 10px; }
.qpe-sort { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.qpe-sites-csv { align-self: center; padding: 12px; font-weight: 700; text-decoration: underline; }

/* Site card: desktop row = number | name, address, when | 7-day bars | total | menu */
.qpe-site-card { position: relative; display: grid; grid-template-columns: 36px minmax(0,1fr) 196px 78px 40px;
  grid-template-areas: "num main week amt menu" "num when week amt menu"; column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 14px 12px 14px 16px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
.qpe-site-card.is-selected { padding: 13px 11px 13px 15px; border: 2px solid var(--qpe-ink); }
.qpe-site-card[hidden] { display: none; }
.qpe-site-card .qpe-num { grid-area: num; border: 1.5px solid transparent; cursor: pointer; }
.qpe-num.qpe-b-none, .qpe-num.qpe-b-pending, .qpe-num.qpe-b-error { border-style: dashed; border-color: var(--qpe-none-line); background: #fff; color: var(--qpe-muted); }
.qpe-num.qpe-b-invalid { background: var(--qpe-danger-tint); color: var(--qpe-danger); border-color: var(--qpe-danger); font-family: var(--qpe-font); font-weight: 700; }
.qpe-site-main { grid-area: main; min-width: 0; align-self: end; }
.qpe-site-when { grid-area: when; min-width: 0; align-self: start; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qpe-site-when strong { font-weight: 700; }
.qpe-site-invalid .qpe-site-when, .qpe-site-pending .qpe-site-when, .qpe-site-error .qpe-site-when { white-space: normal; line-height: 1.25; }
.qpe-site-when .qpe-mono { margin-left: 6px; font-size: 12.5px; color: var(--qpe-muted); }
.qpe-site-week { grid-area: week; }
.qpe-site-week .qpe-days { margin-top: 3px; }
.qpe-site-note { grid-area: week; font-size: 13.5px; line-height: 1.4; color: var(--qpe-text); }
.qpe-site-note span { display: block; }
.qpe .qpe-site-note a { display: inline-block; margin-top: 4px; font-weight: 700; color: var(--qpe-danger); text-decoration: underline; }
.qpe-site-amt { grid-area: amt; text-align: right; }
.qpe-site-amt .qpe-mono { font-size: 15px; font-weight: 600; }
.qpe-site-amt small { display: block; font-size: 11px; color: var(--qpe-muted); }
.qpe-site-chev { display: none; }
.qpe-kebab { grid-area: menu; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--qpe-ink); cursor: pointer; }
.qpe-kebab[aria-expanded="true"], .qpe-kebab:hover { background: #F1EFE9; }

/* Card menu: dropdown on desktop, bottom sheet on phones */
.qpe-menu { position: absolute; top: calc(100% - 14px); right: 12px; z-index: 30; min-width: 228px; padding: 6px 0; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: #fff; box-shadow: 0 12px 28px rgba(16,32,46,.16); }
.qpe-menu[hidden] { display: none; }
.qpe-menu-head, .qpe-menu-phone { display: none !important; }
.qpe-menu a, .qpe-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--qpe-touch); padding: 0 16px; border: 0; background: none; color: var(--qpe-ink); font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.qpe-menu a:hover, .qpe-menu button:hover { background: #F1EFE9; color: var(--qpe-ink); text-decoration: none; }
.qpe-menu svg { flex-shrink: 0; color: var(--qpe-text); }
.qpe-menu-count { margin-left: auto; font-family: var(--qpe-mono); font-size: 12px; color: var(--qpe-muted); }
.qpe .qpe-menu .qpe-menu-danger { margin-top: 6px; border-top: 1px solid var(--qpe-line-soft); color: var(--qpe-danger); font-weight: 600; }
.qpe-menu .qpe-menu-danger svg { color: var(--qpe-danger); }

/* Map */
.qpe-sites-map { position: sticky; top: 16px; height: calc(100vh - 32px); min-height: 480px; max-height: 760px; overflow: hidden; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #ECEAE3; }
.qpe-map-canvas { position: absolute; inset: 0; }
.qpe-map-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: 15px; color: var(--qpe-muted); }
.qpe-sites-map.is-ready .qpe-map-placeholder { display: none; }
.qpe-map-toggle { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--qpe-surface); border: 1px solid var(--qpe-line); border-radius: 8px; font-size: 13px; color: var(--qpe-ink); cursor: pointer; }
.qpe-map-toggle[hidden] { display: none; }
.qpe-pop-history { display: inline-block; margin-top: 10px; font-size: 13px; }
.qpe-map-note { position: absolute; top: 16px; left: 16px; z-index: 2; max-width: calc(100% - 100px); padding: 6px 12px; border: 1px solid var(--qpe-danger-line); border-radius: 8px; background: #fff; font-size: 13.5px; color: var(--qpe-danger-ink); }
.qpe .qpe-map-note a { font-weight: 700; color: var(--qpe-danger); text-decoration: underline; }
.qpe-map-legend { position: absolute; left: 16px; bottom: 16px; z-index: 2; display: grid; grid-template-columns: repeat(3, auto); gap: 4px 18px; padding: 10px 14px; border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(16,32,46,.12); font-size: 12.5px; color: var(--qpe-ink); }
.qpe-map-legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.qpe-dot.qpe-b-pending, .qpe-dot.qpe-b-none { border-style: dashed; }
.qpe-map-card { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; padding: 16px; border-radius: var(--qpe-radius-card); background: #fff; box-shadow: 0 10px 28px rgba(16,32,46,.25); }
.qpe-map-card[hidden] { display: none; }
.qpe-map-card .qpe-pop-where { display: none; }   /* phone card (M-Sites-Map) leaves out the grid line */
.qpe-map-card .qpe-pop-actions .qpe-btn { flex: 1; min-height: 44px; font-size: 15px; }

/* Map popup (Google InfoWindow on desktop, .qpe-map-card on phones) */
.qpe-pop { position: relative; min-width: 240px; max-width: 280px; padding: 4px 6px 6px; font-family: var(--qpe-font); color: var(--qpe-ink); }
.qpe-map-card .qpe-pop { max-width: none; }
.qpe-pop-name { margin: 0 28px 2px 0; font-size: 17px; font-weight: 700; }
.qpe-pop-addr { font-size: 12.5px; color: var(--qpe-muted); }
.qpe-pop .qpe-status { height: 26px; margin: 10px 0 8px; font-size: 13px; }
.qpe-pop-stats { font-size: 13.5px; color: var(--qpe-text); }
.qpe-pop-where { margin-top: 6px; font-size: 12.5px; color: var(--qpe-muted); }
.qpe-pop-actions { display: flex; gap: 8px; margin-top: 12px; }
.qpe-pop-actions .qpe-btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.qpe-pop-close { position: absolute; top: -6px; right: -6px; width: 36px; height: 36px; border: 0; background: none; color: var(--qpe-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.qpe-sites-map .gm-style-iw-chr { display: none; }   /* our own close button */

/* Delete confirmation */
.qpe-dialog-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(16,32,46,.45); }
.qpe-dialog { position: fixed; top: 50%; left: 50%; z-index: 1070; width: min(508px, calc(100% - 32px)); transform: translate(-50%, -50%); padding: 26px 28px 24px; border-radius: var(--qpe-radius-panel); background: #fff; box-shadow: 0 24px 60px rgba(16,32,46,.35); }
.qpe-dialog[hidden], .qpe-dialog-backdrop[hidden] { display: none; }
.qpe-dialog h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; font-stretch: 88%; }
.qpe-dialog p { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--qpe-text); }
.qpe-plan-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--qpe-line); overflow: hidden; }
.qpe-plan-bar span { display: block; height: 100%; border-radius: 2px; background: var(--qpe-primary); }
.qpe-plan-bar.is-over span { background: var(--qpe-danger); }
.qpe-dialog form[data-qpe-delete-form], .qpe-dialog form.qpe-sf-delete-form { display: flex; justify-content: flex-end; gap: 10px; }

.qpe-btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
/* Viewing as a user (Admin-C-Banner): eye icon, white Return to admin button, orange frame round the window */
.qpe-banner-admin .qpe-banner-icon { flex-shrink: 0; }
.qpe-banner-admin > span { font-weight: 400; }
.qpe .qpe-banner-admin .qpe-banner-action { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--qpe-radius-control);
  background: #fff; color: #7A2506; font-weight: 700; text-decoration: none; }
.qpe .qpe-banner-admin .qpe-banner-action:hover { background: #FBEAE1; color: #7A2506; }
body.qpe:has(.qpe-banner-admin)::after { content: ""; position: fixed; inset: 0; z-index: 1070; border: 6px solid var(--qpe-admin); pointer-events: none; }

/* Admin: View as a user (Admin-B-Dashboard, account/impersonate_user.html) */
body.qpe-admin-body { min-height: 100vh; }
.qpe-admin-head { display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 40px; background: var(--qpe-ink); color: #fff; }
.qpe .qpe-admin-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; font-stretch: 87%; color: #fff; text-decoration: none; }
.qpe-admin-brand .qpe-logo { color: #9CC4E8; }
.qpe-admin-tag { padding: 4px 8px; border-radius: 6px; background: var(--qpe-admin); font-size: 12px; font-weight: 700; }
.qpe .qpe-admin-back { margin-left: auto; font-size: 14px; font-weight: 600; color: #DCE4EB; text-decoration: none; }
.qpe .qpe-admin-back:hover { color: #fff; text-decoration: underline; }
.qpe-admin-main { display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: 28px; align-items: start; padding: 40px 80px; }
.qpe-admin-card { padding: 32px 34px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); }
.qpe-admin-intro { margin-bottom: 18px; }
.qpe-admin-title { margin: 0 0 6px; font-size: 36px; font-weight: 700; font-stretch: 86%; line-height: 1.1; color: var(--qpe-ink); }
.qpe-admin-intro p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--qpe-text); }
.qpe-admin-card .qpe-field { margin: 0 0 6px; color: var(--qpe-ink); }
.qpe-admin-row { display: flex; gap: 10px; }
.qpe-admin-row .qpe-input { flex: 1; min-width: 0; }
.qpe .qpe-admin-go { min-height: 50px; padding: 0 22px; background: var(--qpe-admin); color: #fff; font-size: 16px; font-weight: 700; }
.qpe .qpe-admin-go:hover { background: #9A330A; color: #fff; }
.qpe-admin-error { margin: 10px 0 0; font-size: 14px; }
.qpe-admin-how { padding: 26px 28px; }
.qpe-admin-how h2 { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: var(--qpe-ink); }
.qpe-admin-how ol { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--qpe-text); }
.qpe-admin-how p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--qpe-muted); }
.qpe-admin-quick { padding: 26px 28px; }
.qpe-admin-matches { margin-top: 18px; }
.qpe-admin-quick h2 { margin: 0 0 2px; font-size: 18px; font-weight: 700; color: var(--qpe-ink); }
.qpe-admin-quick-sub { margin: 0 0 12px; font-size: 13px; color: var(--qpe-muted); }
.qpe-admin-quick-list { margin: 0; padding: 0; list-style: none; }
.qpe-admin-quick-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--qpe-line); }
.qpe-admin-quick-list form { margin: 0; }
.qpe-admin-quick-who { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 14px; color: var(--qpe-text); }
.qpe-admin-quick-who strong { color: var(--qpe-ink); }
.qpe-admin-quick-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--qpe-muted); }
.qpe-admin-quick-count { font-family: var(--qpe-mono); font-size: 13px; color: var(--qpe-muted); white-space: nowrap; }
.qpe .qpe-admin-quick-go { border: 1px solid var(--qpe-admin); background: var(--qpe-surface); color: var(--qpe-admin); font-weight: 700; }
.qpe .qpe-admin-quick-go:hover { background: var(--qpe-admin); color: #fff; }
@media (max-width: 991.98px) {
  .qpe-admin-main { grid-template-columns: minmax(0,1fr); padding: 28px 24px; }
  .qpe-banner.qpe-banner-admin { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; }   /* banners stack below 992 px; this one keeps the icon beside the text */
  .qpe-banner-admin > span { flex: 1 1 220px; }
}
@media (max-width: 767.98px) {
  .qpe-admin-head { gap: 12px; padding: 0 16px; }
  .qpe-admin-main { gap: 16px; padding: 20px 16px 32px; }
  .qpe-admin-card { padding: 22px 18px; }
  .qpe-admin-how { padding: 20px 18px; }
  .qpe-admin-title { font-size: 28px; }
  .qpe .qpe-admin-go { padding: 0 16px; }
}

/* === PR 5: Inspectors =========================================================   Page: blueprints/inspectormanagement/templates/inspectormanagement/inspectors.html
   Screens: Insp-A-TablePanel, Insp-P2-Empty, M-Insp, M-Insp-Edit, M-Insp-Empty
   1200 px and up: table + side panel. 768-1199 px: table, panel opens as a drawer.
   Phones: cards, full-screen form. Everything is scoped to .qpe-insp* / .qpe-page-insp.
   ===================================================================================== */
.qpe-page-insp main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 0; }
.qpe-page-insp main[role="main"] > .col { padding: 0; }
body.qpe-page-insp > .row { margin-left: 0; margin-right: 0; }
.qpe-page-insp main[role="main"] > .col > br { display: none; }
.qpe-page-insp .footer { display: none; }
.qpe-page-insp h1, .qpe-page-insp h2, .qpe-page-insp h3 { color: var(--qpe-ink); }
.qpe-page-insp main[role="main"] > .col > .qpe-alert { margin: 16px 40px 0; }   /* flash banners */

.qpe-insp { display: grid; grid-template-columns: minmax(0, 1fr) 480px; min-height: calc(100vh - 64px); }
.qpe-insp-main { min-width: 0; padding: 28px 40px 40px; }
.qpe-insp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.qpe-insp-head .qpe-subtitle { margin-top: 4px; font-size: 16px; color: var(--qpe-text); }
.qpe-insp-add { flex-shrink: 0; font-size: 16px; font-weight: 700; }
.qpe-insp-unassigned { margin-bottom: 20px; }

/* Table */
.qpe-insp-table { overflow: hidden; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
.qpe-insp-rows { margin: 0; padding: 0; list-style: none; }
.qpe-insp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr) 110px; gap: 14px; align-items: center;
  min-height: 68px; padding: 0 20px; border-top: 1px solid var(--qpe-line-soft); color: var(--qpe-ink); text-decoration: none; }
.qpe .qpe-insp-row { color: var(--qpe-ink); }
.qpe .qpe-insp-row:hover { background: #FAF9F6; color: var(--qpe-ink); text-decoration: none; }
.qpe-insp-row.is-selected, .qpe .qpe-insp-row.is-selected:hover { background: #EEF4FA; box-shadow: inset 4px 0 0 var(--qpe-primary); }
.qpe-insp-row-head { min-height: 44px; border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qpe-text); }
.qpe-insp-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qpe-insp-who strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qpe-insp-av { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-size: 13px; font-weight: 700; }
.qpe-insp-row.is-selected .qpe-insp-av, .qpe-insp-av-lg { background: var(--qpe-primary); color: #fff; }
.qpe-insp-av-lg { width: 52px; height: 52px; font-size: 18px; }
.qpe-insp-av-lg.is-new { background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-weight: 500; font-size: 20px; }
.qpe-insp-contact { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.qpe-insp-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qpe-insp-contact .qpe-mono { font-size: 12.5px; color: var(--qpe-text); }
.qpe-insp-sites { font-size: 13.5px; line-height: 1.25; color: var(--qpe-ink); }
.qpe-insp-added { font-size: 13.5px; color: var(--qpe-text); }

/* No inspectors yet */
.qpe-insp-empty { padding: 36px 36px 32px; border: 1px dashed var(--qpe-input-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
.qpe-insp-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 50%; background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-insp-empty h2 { margin: 0 0 14px; font-size: 28px; font-weight: 700; }
.qpe-insp-empty p { max-width: 600px; margin: 0 0 18px; font-size: 16.5px; line-height: 1.55; color: var(--qpe-ink); }
.qpe-insp-empty .qpe-insp-empty-hint { margin: 0; font-size: 14px; color: var(--qpe-text); }

/* Side panel */
.qpe-insp-panel { position: sticky; top: 0; height: calc(100vh - 64px); overflow-y: auto; border-left: 1px solid var(--qpe-line); background: var(--qpe-surface); }
.qpe-insp-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 28px; text-align: center; font-size: 15px; color: var(--qpe-text); }
.qpe-insp-pick strong { color: var(--qpe-ink); }
.qpe-insp-form { display: flex; flex-direction: column; min-height: 100%; padding: 28px 28px 24px; }
.qpe-insp-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.qpe-insp-panel-title { flex: 1; min-width: 0; }
.qpe-insp-panel-title h2 { margin: 0; font-size: 26px; font-weight: 700; font-stretch: 88%; line-height: 1.1; }
.qpe-insp-panel-title span { display: block; font-size: 13.5px; line-height: 1.25; color: var(--qpe-text); }
.qpe-insp-x { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 8px; font-size: 26px; line-height: 1; text-decoration: none; }
.qpe .qpe-insp-x { color: var(--qpe-ink); }
.qpe .qpe-insp-x:hover { background: var(--qpe-page); text-decoration: none; }
.qpe-insp-fields { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.qpe-insp-field label { margin: 0; font-size: 14px; font-weight: 700; color: var(--qpe-ink); }
.qpe-insp-opt { display: block; font-size: 13px; font-weight: 400; color: var(--qpe-text); }
.qpe-insp-field .qpe-input { height: 44px; font-size: 15px; }
.qpe-insp-picks { margin: 6px 0 0; padding: 0; border: 0; min-width: 0; }
.qpe-insp-picks legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--qpe-ink); }
.qpe-insp-count { font-size: 14px; font-weight: 400; color: var(--qpe-text); }
.qpe-insp-picks ul { margin: 0; padding: 0; list-style: none; }
.qpe-insp-picks label { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.qpe-insp-picks input { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--qpe-primary); }
.qpe-insp-pick-name { flex: 1; min-width: 0; }
.qpe-insp-chip { flex-shrink: 0; padding: 2px 8px; border-width: 1.5px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.qpe-insp-chip.qpe-b-far, .qpe-insp-chip.qpe-b-invalid { border-style: solid; }
.qpe-insp-nosite { margin: 4px 0 0; font-size: 14px; color: var(--qpe-text); }
.qpe-insp-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--qpe-line); }
.qpe-insp-test { margin-right: auto; }
.qpe-insp-foot .qpe-btn { font-weight: 700; }
.qpe-insp-remove { align-self: flex-start; min-height: var(--qpe-touch); margin: 10px 0 0; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 700; color: var(--qpe-danger); cursor: pointer; }
.qpe-insp-remove:hover { text-decoration: underline; }
.qpe-insp-fields { order: 0; }
.qpe-insp-foot { order: 1; }
.qpe-insp-remove { order: 2; }

/* Remove confirmation */
.qpe-insp-dialog h2 { margin: 0 0 10px; }
.qpe-insp-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.qpe-insp-dialog-actions .qpe-btn { font-weight: 700; }

/* Tablet: the panel is a drawer, opened by its URL; the empty state's form sits under the empty card */
@media (max-width: 1199.98px) {
  .qpe-insp { display: block; min-height: 0; }
  .qpe-insp-main { padding: 24px 24px 40px; }
  .qpe-page-insp main[role="main"] > .col > .qpe-alert { margin: 16px 24px 0; }
  .qpe-insp-panel { display: none; }
  .qpe-insp.is-empty:not(.is-explicit) .qpe-insp-panel { display: block; position: static; height: auto; margin: 0 24px 40px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); }
  .qpe-insp.is-empty .qpe-insp-main { padding-bottom: 16px; }
  .qpe-insp-empty-hint { display: none; }
  .qpe-insp.is-empty:not(.is-explicit) .qpe-insp-panel .qpe-insp-x, .qpe-insp.is-empty:not(.is-explicit) .qpe-insp-cancel { display: none; }
  .qpe-insp.is-explicit::before { content: ""; position: fixed; inset: 0; z-index: 1040; background: rgba(16,32,46,.45); }
  .qpe-insp.is-explicit .qpe-insp-panel { display: block; position: fixed; top: 0; right: 0; bottom: 0; z-index: 1050; width: min(480px, 100%); height: auto;
    border-left: 0; box-shadow: -12px 0 32px rgba(16,32,46,.2); }
  .qpe-insp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 96px; gap: 12px; padding: 0 16px; }
}

/* Phones: cards; the form is full screen with the main button in a sticky bar */
@media (max-width: 767.98px) {
  .qpe-insp-main { padding: 18px 16px 32px; }
  .qpe-page-insp main[role="main"] > .col > .qpe-alert { margin: 12px 16px 0; }
  .qpe-insp-head { align-items: flex-start; margin-bottom: 14px; }
  .qpe-insp-head .qpe-subtitle { margin-top: 10px; font-size: 15px; color: var(--qpe-muted); }
  .qpe-insp-add { min-height: 44px; padding: 0 16px; }
  .qpe-insp-unassigned { margin-bottom: 14px; font-size: 15px; }

  .qpe-insp-cards { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
  .qpe-insp-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 0 14px; align-items: center; padding: 16px 14px 16px 14px;
    border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); text-decoration: none; }
  .qpe .qpe-insp-card, .qpe .qpe-insp-card:hover { color: var(--qpe-ink); text-decoration: none; }
  .qpe-insp-card .qpe-insp-av { width: 44px; height: 44px; font-size: 15px; }
  .qpe-insp-card-who { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--qpe-text); }
  .qpe-insp-card-who strong { font-size: 19px; line-height: 1.25; color: var(--qpe-ink); }
  .qpe-insp-card-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qpe-insp-chev { color: var(--qpe-primary-dark); }
  .qpe-insp-sitechips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .qpe-insp-sitechip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid #D5D2C8; border-radius: 16px; background: var(--qpe-page); font-size: 14px; font-weight: 500; color: var(--qpe-ink); }
  .qpe-insp .qpe-dot { width: 10px; height: 10px; }
  .qpe-insp-nosites { grid-column: 1 / -1; margin-top: 10px; font-size: 13.5px; color: #8A5A00; }

  .qpe-insp-empty-phone { padding: 22px 20px 20px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
  .qpe-insp-empty-phone h2 { margin: 0 0 12px; font-size: 26px; font-weight: 700; line-height: 1.15; }
  .qpe-insp-empty-phone p { margin: 0 0 18px; font-size: 16px; line-height: 1.5; color: var(--qpe-text); }

  .qpe-insp.is-empty:not(.is-explicit) .qpe-insp-panel { display: none; }
  .qpe-insp.is-explicit::before { display: none; }
  .qpe-insp.is-explicit .qpe-insp-panel { display: block; position: fixed; inset: 0; z-index: 1050; width: 100%; height: auto; box-shadow: none; }
  body.qpe-page-insp:has(.qpe-insp.is-explicit) { overflow: hidden; }
  .qpe-insp-form { padding: 0; }
  .qpe-insp-phone-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px 0 6px; border-bottom: 1px solid var(--qpe-line); background: #fff; }
  .qpe-insp-phone-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
  .qpe-insp-fields { gap: 16px; padding: 18px 20px 8px; }
  .qpe-insp-opt { display: inline; font-size: 14px; }
  .qpe-insp-field .qpe-input { height: 50px; font-size: 17px; }
  .qpe-insp-picks legend { margin-bottom: 4px; font-size: 14px; }
  .qpe-insp-picks li + li { border-top: 1px solid var(--qpe-line-soft); }
  .qpe-insp-picks label { min-height: 52px; font-size: 16px; }
  .qpe-insp-picks input { width: 22px; height: 22px; }
  .qpe-insp-fields, .qpe-insp-remove, .qpe-insp-foot { order: 0; }
  .qpe-insp-remove { margin: 12px 20px 16px; }
  .qpe-insp-foot { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); background: #fff; }
  .qpe-insp-test, .qpe-insp-cancel { display: none; }
  .qpe-insp-save { flex: 1; min-height: 50px; font-size: 16px; }

  .qpe-insp-dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .qpe-insp-dialog-actions .qpe-btn { min-height: 48px; }
}

/* =====================================================================================
   PR 4: Add and edit site. blueprints/sitemanagement/templates/sitemanagement/create_site.html, site.html,
   _site_form.html; static/qpe-site-form.js. Screens: Site-A-SinglePage, Site-Edit, Site-B-Wizard, M-SiteNew, M-SiteEdit
   ===================================================================================== */
.qpe-page-site main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 24px 40px 32px; }
.qpe-page-site main[role="main"] > .col { padding: 0; }
body.qpe-page-site > .row { margin-left: 0; margin-right: 0; }
.qpe-page-site h1, .qpe-page-site h2, .qpe-page-site h3, .qpe-page-site legend { color: var(--qpe-ink); }
.qpe-page-site .footer { display: none; }
body.qpe-page-site > br { display: none; }   /* wide_layout's spacer <br>s under the page */
.qpe-sf [hidden], .qpe-guide [hidden] { display: none !important; }

.qpe-crumbs { display: flex; gap: 8px; margin-bottom: 14px; font-size: 15px; color: var(--qpe-ink); }
.qpe .qpe-crumbs a { text-decoration: underline; }
.qpe-sf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.qpe-sf-head-actions { display: flex; align-items: center; gap: 10px; }
.qpe-sf-remaining { margin-right: 6px; font-size: 15px; color: var(--qpe-text); }
.qpe .qpe-sf-remaining a { text-decoration: underline; }
.qpe-sf-head-actions .qpe-btn { min-height: 40px; padding: 0 14px; }
.qpe-sf-guide-btn { border-radius: 20px; font-weight: 700; }

.qpe-sf-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.qpe-sf-card { display: flex; flex-direction: column; gap: 22px; min-height: max(640px, calc(100vh - 230px)); padding: 26px 28px 26px;
  border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); }
.qpe-sf-summary { margin: 0; }
.qpe-sf-field { display: flex; flex-direction: column; gap: 6px; }
.qpe-sf-field > label, .qpe-sf-label-row label { margin: 0; font-size: 15px; font-weight: 700; color: var(--qpe-ink); }
.qpe-sf-label-row { display: flex; align-items: baseline; justify-content: space-between; }
.qpe-sf-count { font-size: 12px; color: var(--qpe-muted); }
.qpe-sf-field .qpe-input { width: 100%; height: 44px; font-size: 17px; color: var(--qpe-ink); }
.qpe-sf-field textarea.qpe-input { height: 66px; padding: 10px 14px; line-height: 1.4; resize: none; }
.qpe-sf-hint { font-size: 13px; font-weight: 400; color: var(--qpe-muted); }
.qpe-sf-linkbtn { padding: 0; border: 0; background: none; color: var(--qpe-primary); font-weight: 700; text-decoration: underline; cursor: pointer; }
.qpe-sf-addr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.qpe-sf-find { min-height: 48px; border: 1.5px solid var(--qpe-primary); background: var(--qpe-surface); color: var(--qpe-primary); font-weight: 700; white-space: nowrap; }
.qpe-sf-find:hover { background: var(--qpe-primary-tint); }
.qpe-sf-find[disabled] { opacity: .6; cursor: progress; }

.qpe-sf-loc { padding: 14px 16px; border-radius: 10px; background: #F4F3EF; font-size: 14px; }
.qpe-sf-loc-title { display: block; margin-bottom: 6px; font-size: 15px; }
.qpe-sf-dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 0; margin: 0; }
.qpe-sf-dl dt { font-weight: 400; color: var(--qpe-muted); }
.qpe-sf-dl dd { margin: 0; color: var(--qpe-ink); }
.qpe-sf-shared { margin: 8px 0 0; font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--qpe-good); }
.qpe-sf-small { margin: 6px 0 0; font-size: 12.5px; color: var(--qpe-text); }
.qpe-sf-gridwarn { margin: 0; }
.qpe-sf-gridwarn svg { flex-shrink: 0; margin-top: 2px; }

.qpe-sf-insp { margin: 0; padding: 0; border: 0; min-width: 0; }
.qpe-sf-insp legend { width: auto; margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.qpe-sf-optional { font-weight: 400; color: var(--qpe-muted); }
.qpe-sf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qpe-sf-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; margin: 0; padding: 0 14px; border: 1px solid var(--qpe-input-line);
  border-radius: 21px; background: var(--qpe-surface); font-size: 15px; font-weight: 400; color: var(--qpe-ink); cursor: pointer; }
.qpe-sf-chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--qpe-primary); }
.qpe .qpe-sf-newinsp { padding: 0 8px; font-weight: 700; text-decoration: underline; }

.qpe-sf-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--qpe-line); }
.qpe-sf-spacer { flex: 1; }
.qpe-sf-savebar { display: contents; }
.qpe-sf-save.is-waiting { background: #8BA8C4; }
.qpe-sf-delete { min-height: var(--qpe-touch); padding: 0; border: 0; background: none; color: var(--qpe-danger); font-size: 16px; font-weight: 700; cursor: pointer; }
.qpe-sf-delete-form { display: flex; justify-content: flex-end; gap: 10px; }

/* Map panel */
.qpe-map-canvas { position: absolute; inset: 0; }
.qpe-sf-map { position: relative; min-height: 480px; overflow: hidden; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #ECEAE3; }
.qpe-sf-placeholder span { padding: 10px 16px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(16,32,46,.12); color: var(--qpe-text); }
.qpe-sf-placeholder { z-index: 1; pointer-events: none; }
.qpe-sf-map.is-ready[data-found="true"] .qpe-sf-placeholder { display: none; }
.qpe-sf-mini { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 2; padding: 16px 18px 12px; border-radius: var(--qpe-radius-card);
  background: #fff; box-shadow: 0 6px 20px rgba(16,32,46,.16); }
.qpe-sf-mini-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 16px; }
.qpe-sf-mini-head .qpe-status { height: 26px; font-size: 13px; font-weight: 700; }
.qpe-sf-mini .qpe-bars { height: 40px; }
.qpe-sf-mini .qpe-days { margin-top: 6px; }
.qpe-sf-mini-note { margin: 0; font-size: 14px; color: var(--qpe-text); }
.qpe-sf-maptools { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.qpe-sf-maptools > * { pointer-events: auto; }
.qpe-sf-maptip { padding: 8px 12px; border-radius: 8px; background: var(--qpe-ink); color: #fff; font-size: 14px; font-weight: 700; }
.qpe-sf-undo { min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 700; }
.qpe-sf-celllabel { position: absolute; right: 16px; bottom: 16px; z-index: 1; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,.8);
  font-family: var(--qpe-mono); font-size: 11px; color: var(--qpe-primary); pointer-events: none; }
.qpe-sf-map:has(.qpe-sf-mini:not([hidden])) .qpe-sf-celllabel { bottom: 150px; }

/* ---------- First-site guide (Site-B-Wizard) ---------- */
.qpe-page-guide .qpe-header { display: none; }
.qpe-page-guide main[role="main"] { padding: 0; }
.qpe-page-guide main[role="main"] > .col > .qpe-alert { margin: 16px 40px 0; }
.qpe-guide-head { display: flex; align-items: center; gap: 20px; min-height: 64px; padding: 0 40px; border-bottom: 1px solid var(--qpe-line); background: var(--qpe-surface); }
.qpe-guide-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; font-stretch: 87%; }
.qpe-guide-brand .qpe-logo { color: var(--qpe-primary); }
.qpe-guide-sub { font-size: 15px; color: var(--qpe-text); }
.qpe .qpe-guide-switch { margin-left: auto; font-size: 16px; font-weight: 700; }
.qpe .qpe-guide-close { display: inline-flex; align-items: center; gap: 8px; min-height: var(--qpe-touch); padding: 0 12px; font-size: 16px; font-weight: 700; color: var(--qpe-ink); }
.qpe-guide-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.qpe-guide-steps { display: flex; flex-direction: column; gap: 10px; padding: 44px 20px 0 32px; border-right: 1px solid var(--qpe-line); background: var(--qpe-surface); }
.qpe-guide-stepbtn { display: flex; align-items: flex-start; gap: 14px; padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.qpe-guide-stepbtn[disabled] { cursor: default; }
.qpe-guide-dot { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; margin-top: 2px; border: 1.5px solid #C4CBD2;
  border-radius: 50%; background: #fff; color: var(--qpe-muted); font-size: 14px; font-weight: 700; }
.qpe-guide-stepbtn[aria-current="step"] .qpe-guide-dot { border: 2px solid var(--qpe-primary); color: var(--qpe-primary); }
.qpe-guide-stepbtn.is-done .qpe-guide-dot { border-color: var(--qpe-primary); background: var(--qpe-primary); color: #fff; }
.qpe-guide-steptext { display: flex; flex-direction: column; }
.qpe-guide-steplabel { font-size: 17px; font-weight: 500; color: var(--qpe-muted); }
.qpe-guide-stepbtn[aria-current="step"] .qpe-guide-steplabel { font-weight: 700; color: var(--qpe-ink); }
.qpe-guide-stepbtn.is-done .qpe-guide-steplabel { font-weight: 600; color: var(--qpe-ink); }
.qpe-guide-stepsub { font-size: 13.5px; color: var(--qpe-text); }
.qpe-guide-form { min-width: 0; }
.qpe-guide-step { padding: 84px 40px 60px; }
.qpe-guide-inner { max-width: 580px; margin: 0 auto; }
.qpe-guide-eyebrow { display: block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--qpe-primary); }
.qpe-guide-title { margin: 12px 0 14px; font-size: 42px; font-weight: 700; font-stretch: 85%; line-height: 1.1; outline: none; }
.qpe-guide-lead { margin: 0 0 22px; font-size: 17px; line-height: 1.5; color: var(--qpe-text); }
.qpe-guide .qpe-sf-field textarea.qpe-input { height: 72px; }
.qpe-guide .qpe-sf-field .qpe-input { height: 50px; }
.qpe-guide-namelabel { display: flex; justify-content: space-between; }
.qpe-guide-namelabel span { font-size: 13px; font-weight: 400; color: var(--qpe-muted); }
.qpe-guide-actions { display: flex; gap: 10px; margin-top: 18px; }
.qpe-guide-actions .qpe-btn { min-height: 50px; padding: 0 22px; font-size: 16px; }
.qpe-guide-actions .qpe-btn-primary { font-weight: 700; }

.qpe-guide-step.qpe-guide-pin { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 64px); padding: 0; }
.qpe-guide-map { min-height: 520px; border: 0; border-radius: 0; }
.qpe-guide-pincard { position: absolute; top: 24px; left: 24px; z-index: 2; max-width: 420px; padding: 16px 20px; border-radius: var(--qpe-radius-card); background: #fff;
  box-shadow: 0 6px 20px rgba(16,32,46,.16); font-size: 14px; line-height: 1.35; color: var(--qpe-text); }
.qpe-guide-pintitle { margin: 0 0 4px; font-size: 26px; font-weight: 700; font-stretch: 88%; color: var(--qpe-ink); outline: none; }
.qpe-guide-aside { display: flex; flex-direction: column; gap: 22px; padding: 36px 28px 32px; border-left: 1px solid var(--qpe-line); background: var(--qpe-surface); }
.qpe-guide-fact { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.qpe-guide-fact > span:first-child, .qpe-guide-source > span:first-child { font-size: 13px; color: var(--qpe-text); }
.qpe-guide-fact strong { font-size: 17px; line-height: 1.25; }
.qpe-guide-coords { font-size: 15px; color: var(--qpe-ink); }
.qpe-guide-link { padding: 0; border: 0; background: none; color: var(--qpe-primary); font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.qpe-guide-source { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 10px; background: #EEF4FA; font-size: 13.5px; color: var(--qpe-text); }
.qpe-guide-source strong { font-size: 17px; color: var(--qpe-ink); }
.qpe-guide-source .qpe-mono { font-size: 13px; color: var(--qpe-ink); }
.qpe-guide-aside-actions { justify-content: flex-end; margin-top: auto; }

.qpe-guide-email { margin-top: 26px; padding: 20px 22px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: #fff; }
.qpe-guide-check { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 17px; font-weight: 600; }
.qpe-guide-check input { width: 20px; height: 20px; accent-color: var(--qpe-primary); }
.qpe-guide-email-row { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 18px 28px; margin: 14px 0 0 32px; }
.qpe-guide-when { flex: 1; min-width: 0; }
.qpe-guide-hour { font-size: 14px; font-weight: 700; }
.qpe-guide-hour select.qpe-input { width: auto; min-width: 110px; height: 44px; padding: 0 10px; font-size: 16px; }
.qpe-guide-when { margin: 0; padding: 0; border: 0; }
.qpe-guide-when legend { width: auto; margin-bottom: 4px; font-size: 14px; font-weight: 700; }
.qpe-guide-when label { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 26px; font-size: 15px; }
.qpe-guide-when input { accent-color: var(--qpe-primary); }
.qpe-guide-note { margin-top: 20px; padding: 16px 20px; border-radius: 10px; background: #EEF4FA; font-size: 15px; line-height: 1.45; color: var(--qpe-text); }

@media (max-width: 1199.98px) {
  .qpe-sf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* Tablet: form and map stack below lg (responsive-rules.md: .col-lg-5 / .col-lg-7) */
@media (max-width: 991.98px) {
  .qpe-sf-grid { grid-template-columns: minmax(0, 1fr); }
  .qpe-sf-card { min-height: 0; }
  .qpe-sf-map { min-height: 440px; }
  .qpe-page-site main[role="main"] { padding: 18px 16px 32px; }
  .qpe-sf-head { flex-wrap: wrap; }
  .qpe-guide-head { padding: 0 16px; }
  .qpe-guide-body { grid-template-columns: 240px minmax(0, 1fr); }
  .qpe-guide-steps { padding: 32px 12px 0 16px; }
  .qpe-guide-step.qpe-guide-pin { grid-template-columns: minmax(0, 1fr) 320px; }
}

/* Phones: stacked form (M-SiteNew, M-SiteEdit). The form's children join the page column (display: contents)
   so the small map sits between the address and the inspectors, and Save goes in the sticky bar. */
@media (max-width: 767.98px) {
  body.qpe-page-site .qpe-header { display: none; }       /* the page has its own back bar (M-SiteNew) */
  .qpe-page-site main[role="main"] { padding: 0 16px; }
  .qpe-page-site main[role="main"] > .col > .qpe-alert { margin-top: 12px; }
  .qpe-sf-phonebar { display: flex; align-items: center; gap: 8px; min-height: 56px; margin: 0 -16px 16px; padding: 0 16px 0 8px;
    border-bottom: 1px solid var(--qpe-line); background: var(--qpe-surface); }
  .qpe-sf-phonebar h1 { margin: 0; overflow: hidden; font-size: 20px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
  .qpe .qpe-sf-back { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--qpe-touch); height: var(--qpe-touch); color: var(--qpe-ink); }
  .qpe-sf-grid { display: flex; flex-direction: column; gap: 16px; }
  .qpe-sf-card, .qpe-sf-foot { display: contents; }
  .qpe-sf-intro { order: 1; margin: 0; font-size: 15px; line-height: 1.45; color: var(--qpe-text); }
  .qpe-sf-summary { order: 2; }
  .qpe-sf-name { order: 3; }
  .qpe-sf-address { order: 4; }
  .qpe-sf-map { order: 5; }
  .qpe-sf-gridwarn { order: 6; }
  .qpe-sf-insp { order: 7; }
  .qpe-sf-delete { order: 8; align-self: flex-start; min-height: 32px; margin-top: -4px; text-decoration: underline; }
  .qpe-sf-savebar { order: 9; display: block; position: sticky; bottom: 0; z-index: 10; margin: 8px -16px 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--qpe-line); background: #fff; }
  .qpe-sf-save { display: flex; width: 100%; min-height: 50px; font-size: 17px; font-weight: 700; }
  .qpe-sf-field .qpe-input, .qpe-sf-field textarea.qpe-input { height: 50px; }
  .qpe-sf-field textarea.qpe-input { padding-top: 12px; white-space: nowrap; overflow: hidden; }
  .qpe-sf-addr-row { display: block; }
  .qpe-sf-find { display: flex; width: 100%; margin-top: 12px; }
  .qpe-sf-map { min-height: 0; border-radius: var(--qpe-radius-card); background: #fff; }
  .qpe-sf-map[data-found="false"] { display: none; }
  .qpe-sf-map .qpe-map-canvas { position: relative; height: 190px; background: #ECEAE3; }
  .qpe-sf-map .qpe-sf-placeholder { bottom: auto; height: 190px; }
  .qpe-sf-maphint { position: absolute; top: 154px; left: 10px; z-index: 2; padding: 4px 10px; border-radius: 8px; background: #fff; font-size: 13px; color: var(--qpe-ink); }
  .qpe-sf-mapcap { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; }
  .qpe-sf-mapcap strong { font-size: 17px; }
  .qpe-sf-mapcap .qpe-mono { font-size: 13px; color: var(--qpe-text); }
  .qpe-sf-mapcap span:last-child { font-size: 14px; line-height: 1.3; }
  .qpe-sf-insp legend { margin-bottom: 8px; }
  .qpe-sf-chip { min-height: var(--qpe-touch); border-radius: 22px; font-size: 16px; }
  .qpe-sf-chip input { width: 20px; height: 20px; }
  .qpe-sf-chip:has(input:checked) { border: 1.5px solid var(--qpe-primary); background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-weight: 600; }
  .qpe-dialog .qpe-sf-delete-form { flex-direction: column-reverse; }

  /* Guide on a phone: no step list, map above the facts */
  .qpe-page-guide main[role="main"] { padding: 0; }
  .qpe-guide-head { flex-wrap: wrap; gap: 4px 12px; padding: 8px 8px 8px 16px; }
  .qpe-guide-sub, .qpe-guide-brand .qpe-logo { display: none; }
  .qpe .qpe-guide-switch { font-size: 15px; }
  .qpe .qpe-guide-close { padding: 0 8px; }
  .qpe-guide-body { display: block; min-height: 0; }
  .qpe-guide-steps { display: none; }
  .qpe-guide-step { padding: 28px 16px 40px; }
  .qpe-guide-title { font-size: 32px; }
  .qpe-guide-step.qpe-guide-pin { display: block; min-height: 0; }
  .qpe-guide-map { min-height: 0; height: 52vh; }
  .qpe-guide-map .qpe-map-canvas { position: absolute; height: auto; }
  .qpe-guide-map .qpe-sf-placeholder { height: auto; bottom: 0; }
  .qpe-guide-pincard { top: 12px; left: 12px; right: 12px; padding: 12px 14px; }
  .qpe-guide-pintitle { font-size: 21px; }
  .qpe-guide-aside { padding: 20px 16px 32px; border-left: 0; }
  .qpe-guide-email-row { flex-wrap: wrap; margin-left: 0; }
  .qpe-guide-actions .qpe-btn { flex: 1; }
}

/* =====================================================================================
   QPE report (PR 3): blueprints/sitemanagement/templates/sitemanagement/report.html
   Screens: Report-Live, Report-P2-*, M-Report, M-Report-Site, M-Report-Attention, M-Report-Quiet
   ===================================================================================== */
@media (min-width: 768px) { .qpe-phone-only { display: none !important; } }
@media (max-width: 767.98px) { .qpe-desktop-only { display: none !important; } }

.qpe-page-report main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 28px 40px 40px; }
.qpe-page-report main[role="main"] > .col { padding: 0; }
body.qpe-page-report > .row { margin-left: 0; margin-right: 0; }
.qpe-page-report .footer { display: none; }
.qpe-page-report h1, .qpe-page-report h2, .qpe-page-report h3 { color: var(--qpe-ink); }
.qpe-btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }

.qpe-report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.qpe-report-actions { display: flex; align-items: center; gap: 12px; }
.qpe-report[data-view="grid"] [data-qpe-panel="site"], .qpe-report[data-view="site"] [data-qpe-panel="grid"],
.qpe-report[data-view="site"] [data-qpe-grid-only] { display: none; }
.qpe-popover-wrap { position: relative; }
.qpe-download-menu { top: calc(100% + 6px); right: 0; min-width: 280px; }
.qpe-download-menu a, .qpe-download-menu button { min-height: 60px; }
.qpe-download-menu strong { display: block; font-size: 15px; }
.qpe-download-menu small { display: block; font-size: 12.5px; color: var(--qpe-muted); }

.qpe-report-tools { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.qpe-report-sort { display: flex; align-items: center; gap: 8px; }
.qpe-tools-label { font-size: 13px; font-weight: 700; color: var(--qpe-text); }
.qpe-report-key { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--qpe-text); }
.qpe-report-key a { text-decoration: underline; }
.qpe-key-box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--qpe-pre-line); border-radius: 3px; background: #fff; }
.qpe-key-box.is-on { background: var(--qpe-pre); }
.qpe-key-box.is-qpe { border-color: var(--qpe-now); background: var(--qpe-now); }
.qpe-key-qpe { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.qpe-report-expand { display: flex; gap: 8px; margin-left: auto; }

.qpe-jump { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qpe-jump .qpe-tools-label { margin-right: 4px; }
.qpe .qpe-jump .qpe-chip { color: var(--qpe-ink); text-decoration: none; }
.qpe-chip .qpe-dot { width: 10px; height: 10px; }

.qpe-quiet { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 18px 22px; border: 1px dashed var(--qpe-none-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-quiet-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-quiet strong { display: block; font-size: 18px; }
.qpe-quiet span { font-size: 14px; color: var(--qpe-text); }

/* Groups (one per grid point) */
.qpe-groups { display: flex; flex-direction: column; gap: 12px; }
.qpe-group { border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-group[open] { border-color: #B9CDE2; }
.qpe-group-invalid[open] { border-color: var(--qpe-danger-line); }
.qpe-group-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 20px 20px 20px 22px; cursor: pointer; list-style: none; }
.qpe-group-head::-webkit-details-marker { display: none; }
.qpe-group-chev { color: var(--qpe-ink); transform: rotate(-90deg); transition: transform .15s; }
.qpe-group[open] .qpe-group-chev { transform: none; }
.qpe-group-name { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.qpe-group-title { margin: 0; font-size: 20px; font-weight: 700; white-space: nowrap; }
.qpe-group-grid { font-size: 12.5px; color: var(--qpe-muted); white-space: nowrap; }
.qpe-group-sites { font-size: 15px; color: var(--qpe-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qpe-group-body { padding: 0 20px 22px 60px; }
.qpe-group-sitesrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.qpe-siteboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.qpe-sitebox { display: flex; flex-direction: column; min-width: 280px; padding: 10px 14px; border: 1px solid var(--qpe-line); border-radius: 8px; text-decoration: none; }
.qpe .qpe-sitebox:hover { border-color: var(--qpe-primary); text-decoration: none; }
.qpe-sitebox strong { font-size: 16px; color: var(--qpe-primary); }
.qpe-sitebox span { font-size: 13px; color: var(--qpe-muted); }
.qpe-group-updated { font-size: 13px; color: var(--qpe-muted); white-space: nowrap; }
.qpe-group-note { margin: 0 0 16px; font-size: 15px; color: var(--qpe-text); }
.qpe-group-alert { align-items: center; }
.qpe .qpe-alert-action { flex-shrink: 0; font-weight: 700; color: var(--qpe-danger); text-decoration: underline; }

.qpe-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 0 0 16px; }
.qpe-facts dt { font-size: 13px; font-weight: 400; color: var(--qpe-muted); }
.qpe-facts dd { margin: 0; font-size: 16px; font-weight: 700; }
.qpe-facts dd.qpe-mono { font-weight: 500; }
.qpe-facts .is-total dd { font-size: 17px; font-weight: 700; color: var(--qpe-primary-dark); }

/* Report grid: labels column + 28 cells under day headers (desktop); 7 day rows of 4 (phone) */
.qpe-rgrid { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
.qpe-rgrid-labels { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 6px; font-size: 12px; color: var(--qpe-muted); text-align: right; }
.qpe-rgrid-labels .t { margin-bottom: auto; padding-top: 38px; }
.qpe-rgrid-labels .c { margin-bottom: 8px; }
.qpe-rgrid-labels .p, .qpe-rgrid-labels .q { line-height: 20px; }
.qpe-rgrid-main { border: 1px solid var(--qpe-line); border-radius: 6px; overflow: hidden; }
.qpe-rgrid-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #F4F2EC; border-bottom: 1px solid var(--qpe-line); }
.qpe-rgrid-days span { padding: 7px 4px; font-size: 13px; font-weight: 700; text-align: center; border-left: 1px solid var(--qpe-line); }
.qpe-rgrid-days span:first-child { border-left: 0; }
.qpe-rgrid-days span.has-qpe { background: var(--qpe-now); color: #fff; }
.qpe-rgrid-slots { display: none; }
.qpe-rgrid .qpe-cell { padding: 6px 0 4px; }
.qpe-rgrid .qpe-cell:nth-child(5n + 2) { border-left: 1px solid var(--qpe-line); }   /* first cell of each day: 1 day label + 4 cells */
.qpe-cell .t { font-size: 11.5px; color: var(--qpe-muted); }
.qpe-cell .bar { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 56px; margin: 4px 0 6px; }
.qpe-cell .bar i { display: block; width: 58%; min-height: 2px; border-radius: 2px 2px 0 0; background: #8797A6; }
.qpe-cell .u { display: none; }
.qpe-cell.is-qpe .t { color: #fff; }
.qpe-cell.is-qpe .bar i { background: #A8C8EA; }
.qpe-cell.is-pre .bar i { background: var(--qpe-pre-line); }
.qpe-cell.is-past .bar i { background: #C6CDD3; }
.qpe-grid-help { margin: 10px 0 0; font-size: 13px; color: var(--qpe-muted); }

/* By site */
.qpe-bysite { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 20px; align-items: start; }
.qpe-bysite-list { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: #fff; }
.qpe-bysite-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 20px; border: 0; border-top: 1px solid var(--qpe-line-soft); background: none; text-align: left; cursor: pointer; }
.qpe-bysite-list button:first-child { border-top: 0; }
.qpe-bysite-list button[aria-pressed="true"] { background: var(--qpe-primary-tint); box-shadow: inset 4px 0 0 var(--qpe-primary); }
.qpe-bysite-who { flex: 1; min-width: 0; }
.qpe-bysite-who strong { display: block; font-size: 15px; color: var(--qpe-ink); }
.qpe-bysite-who span { font-size: 13px; color: var(--qpe-muted); }
.qpe-bysite-list .qpe-mono { font-size: 13px; color: var(--qpe-text); }
.qpe-bysite-panel { display: flex; flex-direction: column; gap: 18px; }
.qpe-bysite-panel[hidden] { display: none; }
.qpe-bysite-top { display: flex; justify-content: space-between; gap: 16px; }
.qpe-bysite-name { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 32px; font-weight: 700; font-stretch: 88%; }
.qpe-bysite-name .qpe-status { font-stretch: 100%; }
.qpe-bysite-addr { font-size: 15px; color: var(--qpe-text); }
.qpe-bysite-where { font-size: 13px; color: var(--qpe-muted); }
.qpe-bysite-actions { display: flex; align-items: flex-start; gap: 10px; flex-shrink: 0; }
.qpe-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.qpe-tile { padding: 16px 18px; border: 1px solid var(--qpe-line); border-radius: 10px; background: #fff; }
.qpe-tile span { display: block; font-size: 13px; color: var(--qpe-muted); }
.qpe-tile strong { font-size: 19px; }
.qpe-tile strong.qpe-mono { font-weight: 600; }
.qpe-tile.is-pre { border-color: #EBCF86; background: var(--qpe-pre-tint); }
.qpe-tile.is-pre span { color: #6B4A00; }
.qpe-tile.is-pre strong { color: var(--qpe-pre-ink); }
.qpe-panel-card { padding: 20px 22px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-card-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.qpe-changes-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--qpe-muted); }
.qpe-changes-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.qpe-changes-table th { padding: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--qpe-muted); text-align: left; border-bottom: 1px solid var(--qpe-line); }
.qpe-changes-table td { padding: 14px 0; border-bottom: 1px solid var(--qpe-line-soft); }
.qpe-changes-list { margin: 0; padding: 0; list-style: none; }
.qpe-changes-list li { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-top: 1px solid var(--qpe-line-soft); font-size: 13px; color: var(--qpe-muted); }
.qpe-changes-list .qpe-changes-note { text-align: right; }
.qpe-changes-list strong { grid-column: 1 / -1; font-size: 15px; color: var(--qpe-ink); }
.qpe-history { margin-top: 24px; }
.qpe-report[data-view="grid"] .qpe-history { display: none; }
.qpe-history-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.qpe-history-results { overflow-x: auto; }

/* Send dialog */
.qpe-send-dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.qpe-dialog-head { display: flex; justify-content: space-between; gap: 12px; }
.qpe-dialog-head p { margin: 4px 0 14px; font-size: 14px; }
.qpe-dialog-x { width: 44px; height: 44px; flex-shrink: 0; border: 0; background: none; font-size: 24px; color: var(--qpe-text); cursor: pointer; }
.qpe-send-list { margin: 0 0 14px; padding: 0; list-style: none; }
.qpe-send-list li { border-bottom: 1px solid var(--qpe-line-soft); }
.qpe-send-list label { display: flex; align-items: center; gap: 14px; min-height: 64px; margin: 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.qpe-send-list input { width: 20px; height: 20px; flex-shrink: 0; }
.qpe-send-list small { display: block; font-size: 13px; color: var(--qpe-muted); }
.qpe-send-list li.is-off label { color: var(--qpe-muted); cursor: default; }
.qpe-assign-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.qpe-assign-dialog .qpe-send-list li:last-child { border-bottom: 0; }
.qpe-assign-dialog .qpe-error[hidden], .qpe-assign-dialog [data-qpe-assign-none][hidden] { display: none; }
.qpe-dialog .qpe-dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.qpe-dialog-foot > a { margin-right: auto; font-weight: 600; text-decoration: underline; }
.qpe-send-dialog .qpe-alert { margin-bottom: 0; }
.qpe-send-dialog .qpe-alert a { font-weight: 700; color: inherit; text-decoration: underline; }
.qpe-share-sheet[hidden], .qpe-sheet-backdrop[hidden] { display: none; }

@media (max-width: 991.98px) {
  .qpe-page-report main[role="main"] { padding: 18px 16px 40px; }
  .qpe-bysite { grid-template-columns: minmax(0, 1fr); }
  .qpe-bysite-list { position: static; max-height: none; overflow: visible; }
  .qpe-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .qpe-report-head { align-items: flex-start; margin-bottom: 12px; }
  .qpe-report-head .qpe-subtitle { font-size: 14px; }
  .qpe-report-actions { position: static; }
  .qpe-report-viewseg { position: absolute; left: 0; right: 0; }
  .qpe-report-head { position: relative; padding-bottom: 60px; }
  .qpe-report-viewseg { bottom: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .qpe-report-tools { gap: 10px 12px; }
  .qpe-report-sort .qpe-chip { height: 36px; }
  .qpe-report-key { order: 3; flex-basis: 100%; font-size: 13px; }
  .qpe-report-expand { margin-left: auto; }
  .qpe-report-expand .qpe-btn { min-height: 36px; border: 0; background: none; padding: 0; color: var(--qpe-primary); font-weight: 700; }

  .qpe-group-head { grid-template-columns: 22px minmax(0, 1fr); grid-template-areas: "chev name" ". chip" ". sites"; gap: 6px 10px; padding: 16px 14px; }
  .qpe-group-chev { grid-area: chev; align-self: start; margin-top: 4px; }
  .qpe-group-name { grid-area: name; flex-wrap: wrap; }
  .qpe-group-title { font-size: 19px; white-space: normal; }
  .qpe-group .qpe-status { grid-area: chip; justify-self: start; }
  .qpe-group-sites { grid-area: sites; font-size: 13.5px; white-space: normal; }
  .qpe-group[open] .qpe-group-sites { display: none; }
  .qpe-group-body { padding: 0 14px 16px; }
  .qpe-group-alert { flex-direction: column; align-items: flex-start; gap: 6px; }
  .qpe-group-sitesrow { margin-bottom: 12px; }
  .qpe-siteboxes { width: 100%; }
  .qpe-sitebox { position: relative; width: 100%; min-width: 0; padding-right: 36px; }
  .qpe-sitebox svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--qpe-primary); }
  .qpe-facts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .qpe-facts > div { padding: 10px 12px; border-radius: 8px; background: #F4F2EC; }
  .qpe-facts dd { font-size: 17px; }
  .qpe-facts .is-total dd { color: var(--qpe-ink); }

  .qpe-rgrid { display: block; }
  .qpe-rgrid-labels, .qpe-rgrid-days { display: none; }
  .qpe-rgrid-main { border: 0; overflow: visible; }
  .qpe-rgrid-slots { display: grid; grid-template-columns: 76px repeat(4, minmax(0, 1fr)); gap: 3px; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--qpe-text); text-align: center; }
  .qpe-rgrid-slots span:first-child { text-align: left; }
  .qpe-rgrid .qpe-cell { padding: 0; }
  .qpe-rgrid .qpe-cell:nth-child(5n + 2) { border-left: 1px solid var(--qpe-line); }
  .qpe-cell .t, .qpe-cell .bar { display: none; }
  .qpe-cell .u { display: inline; }
  .qpe-cell .p { font-size: 16px; }
  .qpe-cell .q .u { font-size: 11px; }
  .qpe-cell.is-past { background: #F1EFE9; }
  .qpe-grid-day strong { display: block; font-size: 14px; }
  .qpe-grid-day span { font-size: 11.5px; font-weight: 400; color: var(--qpe-muted); }

  .qpe-site-picker { margin-bottom: 12px; }
  .qpe-bysite-panel { padding: 16px 14px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; gap: 14px; }
  .qpe-bysite-name { font-size: 24px; }
  .qpe-bysite-top .qpe-status { margin-top: 10px; }
  .qpe-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .qpe-tile { padding: 10px 12px; border: 0; background: #F4F2EC; }
  .qpe-tile.is-pre { border: 1px solid #EBCF86; }
  .qpe-tile strong { font-size: 17px; }
  .qpe-panel-card { padding: 0; border: 0; }
  .qpe-bysite-phone-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .qpe-dialog-foot { flex-wrap: wrap; }
  .qpe-dialog-foot > a { flex-basis: 100%; margin-bottom: 6px; }
}

@media print {
  .qpe-header, .qpe-banner, .qpe-report-actions, .qpe-report-tools, .qpe-jump, [data-qpe-panel="site"], .qpe-history,
  .qpe-dialog, .qpe-dialog-backdrop, .qpe-sheet, .qpe-sheet-backdrop, .qpe-toast-stack { display: none !important; }
  .qpe-report[data-view] [data-qpe-panel="grid"] { display: block !important; }
  .qpe-page-report main[role="main"] { padding: 0; }
  .qpe-group { break-inside: avoid; }
  .qpe-print-paginate .qpe-group { break-after: page; }
  .qpe-cell.is-qpe, .qpe-rgrid-days span.has-qpe, .qpe-cell.is-pre { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Empty state */
.qpe-empty { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 20px; min-height: 620px; }
.qpe-empty-main { display: flex; flex-direction: column; justify-content: center; padding: 52px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 50%; background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-empty-title { margin: 0 0 14px; font-size: 40px; font-weight: 700; font-stretch: 88%; }
.qpe-empty-text { max-width: 560px; margin: 0 0 22px; font-size: 17px; line-height: 1.55; color: var(--qpe-text); }
.qpe-empty-actions { display: flex; gap: 12px; }
.qpe-empty-csv { margin: 16px 0 0; font-size: 14px; color: var(--qpe-muted); }
.qpe .qpe-empty-csv a { text-decoration: underline; }
.qpe-empty-next { display: flex; flex-direction: column; padding: 28px 30px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: #fff; }
.qpe-empty-next h3 { margin: 0 0 18px; font-size: 20px; font-weight: 700; }
.qpe-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.qpe-steps li { display: flex; gap: 16px; }
.qpe-steps strong { display: block; font-size: 16px; }
.qpe-steps li span:not(.qpe-step-num) { font-size: 14px; line-height: 1.5; color: var(--qpe-text); }
.qpe-step-num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--qpe-primary-tint); font-family: var(--qpe-mono); font-size: 13px; font-weight: 600; color: var(--qpe-primary-dark); }
.qpe-empty-more { margin-top: auto; padding-top: 24px; font-weight: 700; text-decoration: underline; }

/* Tablet and phone: List / Map toggle (the menu also collapses below 992 px) */
@media (max-width: 991.98px) {
  .qpe-page-sites main[role="main"] { padding: 18px 16px 40px; }
  .qpe-sites-toggle { display: grid; width: 100%; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
  /* Filters become scrolling chips below 992 px (7 cards don't fit a tablet) */
  .qpe-filters { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .qpe-filter { flex-direction: row; align-items: center; flex-shrink: 0; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; border-color: #D5D2C8; font-weight: 500; }
  .qpe-filter[aria-pressed="true"] { padding: 0 14px; border: 1px solid var(--qpe-ink); background: var(--qpe-ink); color: #fff; }
  .qpe-filter[aria-pressed="true"] .qpe-filter-label { color: #fff; }
  .qpe-filter.is-empty { display: none; }
  .qpe-filter-label { font-size: 14px; color: var(--qpe-ink); }
  .qpe-filter-count { font-size: 14px; font-weight: 700; line-height: 1; }
  .qpe-sites-body { display: block; }
  .qpe-sites[data-view="list"] .qpe-sites-map { display: none; }
  .qpe-sites[data-view="map"] .qpe-sites-list { display: none; }
  .qpe-sites-map { position: relative; top: 0; height: 62vh; min-height: 380px; margin: 0 -16px; border-width: 1px 0; border-radius: 0; }
  .qpe-sites-map .qpe-map-legend { position: static; margin: 0; grid-template-columns: repeat(3, auto); border-radius: 0; box-shadow: none; background: var(--qpe-page); }
  .qpe-sites[data-view="map"] .qpe-sites-map { overflow: visible; height: auto; }
  .qpe-sites[data-view="map"] .qpe-map-canvas { position: relative; height: 62vh; min-height: 380px; }
  .qpe-sites[data-view="map"] .qpe-map-card { bottom: auto; top: calc(62vh - 190px); }
}

@media (max-width: 767.98px) {
  .qpe-sites-head { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "title new" "plan plan"; gap: 10px 12px; }
  .qpe-sites-title { grid-area: title; }
  .qpe-sites-new { grid-area: new; align-self: start; }
  .qpe-sites-bulk { display: none; }
  .qpe-plan { grid-area: plan; width: auto; display: flex; align-items: center; gap: 10px; }
  .qpe-plan-row { flex-shrink: 0; gap: 6px; }
  .qpe-plan-bar { flex: 1; margin-top: 0; }


  /* Card: name + address, bars full width, then when + total */
  .qpe-site-card { grid-template-columns: 32px minmax(0,1fr) auto 24px; grid-template-areas: "num main main menu" "week week week week" "when when amt chev";
    row-gap: 10px; padding: 14px 12px 12px 14px; }
  .qpe-site-card.is-selected { padding: 13px 11px 11px 13px; }
  .qpe-site-card .qpe-num { width: 32px; height: 32px; font-size: 13px; }
  .qpe-site-main { align-self: center; }
  .qpe-site-week { padding-bottom: 10px; border-bottom: 1px solid var(--qpe-line-soft); }
  .qpe-site-when { align-self: center; white-space: normal; }
  .qpe-site-amt { align-self: center; }
  .qpe-site-chev { grid-area: chev; display: inline-flex; align-items: center; justify-content: flex-end; color: var(--qpe-ink); }
  .qpe-kebab { justify-self: end; width: 36px; height: 36px; margin: -6px -6px 0 0; }
  .qpe-site-invalid { grid-template-areas: "num main main menu" "note note note note"; border-color: var(--qpe-danger-line); }
  .qpe-site-invalid .qpe-site-when, .qpe-site-invalid .qpe-site-amt, .qpe-site-invalid .qpe-site-chev { display: none; }
  .qpe-site-invalid .qpe-site-note { grid-area: note; }
  .qpe-site-pending .qpe-site-note, .qpe-site-error .qpe-site-note { padding-bottom: 10px; border-bottom: 1px solid var(--qpe-line-soft); }

  .qpe-menu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1050; min-width: 0; padding: 8px 0 calc(24px + env(safe-area-inset-bottom)); border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(16,32,46,.25); }
  .qpe-menu-head { display: block !important; padding: 10px 20px 12px; border-bottom: 1px solid var(--qpe-line-soft); }
  .qpe-menu-head strong { display: block; font-size: 18px; }
  .qpe-menu-head span { display: block; font-size: 13px; color: var(--qpe-muted); }
  .qpe-menu-phone { display: flex !important; }
  .qpe-menu a, .qpe-menu button { min-height: 52px; padding: 0 20px; font-size: 16px; }
  .qpe-menu svg { display: none; }
  .qpe .qpe-menu .qpe-menu-danger { margin-top: 0; border-top: 0; }

  .qpe-empty { display: block; min-height: 0; }
  .qpe-empty-main { padding: 28px 20px; margin-bottom: 16px; }
  .qpe-empty-title { font-size: 30px; }
  .qpe-empty-text { font-size: 16px; }
  .qpe-empty-actions .qpe-btn { flex: 1; min-height: 50px; }
  .qpe-empty-next { padding: 22px 20px; }
}

   Result banners on Sites: qpe_map.html (.qpe-bulk-banners). Forecast history: _history.html in report.html.
   Behaviour: static/qpe-bulk-history.js. Screens: Bulk-Upload, Bulk-Review, Sites-P3-BulkDone, History-A-EventLog,
   History-B-Calendar, History-P2-New, M-Bulk, M-BulkReview, M-Sites-BulkDone, M-History, M-History-New */
.qpe-page-bulk main[role="main"] { flex: 0 0 100%; width: 100% !important; max-width: 100%; min-width: 0; padding: 24px 40px 32px; }
.qpe-page-bulk main[role="main"] > .col { padding: 0; }
body.qpe-page-bulk > .row { margin-left: 0; margin-right: 0; }
body.qpe-page-bulk > br, .qpe-page-bulk .footer { display: none; }
.qpe-page-bulk h1, .qpe-page-bulk h2, .qpe-page-bulk summary { color: var(--qpe-ink); }

.qpe-bulk-back, .qpe-hist-back { display: inline-block; margin-bottom: 10px; font-size: 15px; font-weight: 700; text-decoration: underline; }
.qpe-bulk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.qpe-bulk-steps { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.qpe-bulk-steps li { display: flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--qpe-input-line); border-radius: 18px; color: var(--qpe-muted); white-space: nowrap; }
.qpe-bulk-steps li.is-on { border-color: var(--qpe-ink); background: var(--qpe-ink); color: #fff; font-weight: 700; }
.qpe-bulk-steps li.is-done { border-color: var(--qpe-primary-tint); background: var(--qpe-primary-tint); color: var(--qpe-primary-dark); font-weight: 700; }

.qpe-bulk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 20px; align-items: stretch; }
.qpe-bulk-review .qpe-bulk-grid { grid-template-columns: minmax(0, 1fr) 440px; }
.qpe-bulk-card { display: flex; flex-direction: column; gap: 18px; min-height: max(520px, calc(100vh - 260px)); padding: 28px;
  border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); }
.qpe-bulk-drop { position: relative; flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  margin: 0; padding: 40px; border: 2px dashed #C4CBD2; border-radius: 12px; background: #FAFAF8; text-align: center; cursor: pointer; }
.qpe-bulk-drop.is-picked, .qpe-bulk-drop.is-over { border-color: var(--qpe-primary); background: #EEF4FA; }
.qpe-bulk-drop.is-error { border-color: var(--qpe-danger); background: #FFF8F7; }
.qpe-bulk-drop-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-bulk-drop-title { font-size: 22px; font-weight: 700; color: var(--qpe-ink); overflow-wrap: anywhere; }
.qpe-bulk-drop-sub { font-size: 15px; font-weight: 400; color: var(--qpe-text); }
.qpe-bulk-file { max-width: 100%; font-size: 14px; }
.qpe-bulk-error { padding: 12px 14px; border: 1px solid var(--qpe-danger-line); border-radius: 10px; background: var(--qpe-danger-tint); font-size: 14px; line-height: 1.5; color: var(--qpe-danger-ink); }
.qpe-bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.qpe-bulk-card .qpe-bulk-actions .qpe-btn { min-height: 46px; }

.qpe-bulk-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qpe-bulk-needs, .qpe-bulk-example, .qpe-bulk-when { padding: 22px 24px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); }
.qpe-bulk-needs summary { margin-bottom: 12px; font-size: 18px; font-weight: 700; list-style: none; cursor: pointer; }
.qpe-bulk-needs summary::-webkit-details-marker { display: none; }
.qpe-bulk-needs:not([open]) summary { margin-bottom: 0; }
.qpe-bulk-cols { display: grid; grid-template-columns: 110px 90px minmax(0, 1fr); gap: 8px 12px; align-items: baseline; margin: 0 0 12px; font-size: 14px; }
.qpe-bulk-cols dt { font-family: var(--qpe-mono); font-weight: 600; }
.qpe-bulk-cols dd { margin: 0; color: var(--qpe-text); }
.qpe-bulk-cols dd.is-req { font-size: 12px; font-weight: 700; color: var(--qpe-danger); }
.qpe-bulk-cols dd.is-opt { font-size: 12px; color: var(--qpe-muted); }
.qpe-bulk-note { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--qpe-muted); }
.qpe-bulk-example .qpe-bulk-note { margin: 10px 0 0; }
.qpe .qpe-bulk-template { font-size: 14px; font-weight: 700; text-decoration: underline; }
.qpe-bulk-example h2, .qpe-bulk-when h2 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.qpe-bulk-example pre { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--qpe-page); font-family: var(--qpe-mono); font-size: 12.5px; line-height: 1.6; color: var(--qpe-ink); white-space: pre-wrap; }

/* Review */
.qpe-bulk-ready { min-width: 0; min-height: max(520px, calc(100vh - 260px)); border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); overflow: hidden; }
.qpe-bulk-ready-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--qpe-line); font-size: 13px; color: var(--qpe-muted); }
.qpe-bulk-ready-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.qpe-bulk-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.qpe-bulk-table th { padding: 10px 22px; border-bottom: 1px solid var(--qpe-line-soft); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qpe-muted); text-align: left; }
.qpe-bulk-table td { padding: 11px 22px; border-bottom: 1px solid var(--qpe-line-soft); vertical-align: top; }
.qpe-bulk-row { width: 70px; font-size: 14px; color: var(--qpe-text); }
.qpe-bulk-name { font-weight: 700; }
.qpe-bulk-loc { font-size: 13.5px; color: var(--qpe-muted); white-space: nowrap; }
.qpe-bulk-loc .qpe-mono { color: var(--qpe-ink); }
.qpe-bulk-none { margin: 0; padding: 24px 22px; font-size: 15px; color: var(--qpe-muted); }
.qpe-bulk-skipped { padding: 20px 22px; border: 1px solid var(--qpe-danger-line); border-radius: var(--qpe-radius-panel); background: var(--qpe-surface); }
.qpe-bulk-skipped h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--qpe-danger-ink); }
.qpe-bulk-skipped p { margin: 0 0 8px; font-size: 13px; line-height: 1.3; color: var(--qpe-text); }
.qpe-bulk-skipped ul { margin: 0; padding: 0; list-style: none; }
.qpe-bulk-skipped li { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 16px; padding: 10px 0; border-top: 1px solid var(--qpe-line-soft); font-size: 15px; line-height: 1.4; }
.qpe-bulk-skip-row { font-family: var(--qpe-mono); font-size: 14px; color: var(--qpe-danger-ink); }
.qpe-bulk-when p { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--qpe-text); }
.qpe-bulk-when p:last-child { margin-bottom: 0; }
.qpe-bulk-when h2 { font-size: 17px; }
.qpe-bulk-review-actions { margin-top: auto; }
.qpe-bulk-review-actions .qpe-btn { min-height: 50px; padding: 0 34px; font-size: 17px; font-weight: 700; }


@media (max-width: 1199.98px) {
  .qpe-bulk-grid, .qpe-bulk-review .qpe-bulk-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .qpe-bulk-loc { white-space: normal; }
}
@media (max-width: 991.98px) {
  .qpe-bulk-grid, .qpe-bulk-review .qpe-bulk-grid { grid-template-columns: minmax(0, 1fr); }
  .qpe-bulk-card, .qpe-bulk-ready { min-height: 0; }
  .qpe-bulk-drop { min-height: 320px; }
}
@media (max-width: 767.98px) {
  .qpe-page-bulk main[role="main"] { padding: 18px 16px 110px; }
  .qpe-bulk-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 14px; }
  .qpe-bulk-head .qpe-h1 { font-size: 32px; }
  .qpe-bulk-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; }
  .qpe-bulk-steps li { justify-content: center; height: 30px; border: 0; border-radius: 8px; background: #ECEAE3; font-weight: 700; color: var(--qpe-text); }
  .qpe-bulk-card { padding: 0; border: 0; background: none; gap: 14px; }
  .qpe-bulk-drop { flex-grow: 0; min-height: 0; padding: 20px 16px; gap: 6px; }
  .qpe-bulk-drop-title { font-size: 18px; }
  .qpe-bulk-drop-sub { font-size: 14px; }
  .qpe-bulk-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .qpe-bulk-choose { display: inline-flex; align-items: center; margin-top: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--qpe-primary); border-radius: 8px; background: #fff; font-size: 16px; font-weight: 700; color: var(--qpe-primary); }
  .qpe-bulk-drop:focus-within .qpe-bulk-choose { outline: 3px solid var(--qpe-pre); outline-offset: 2px; }
  .qpe-bulk-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--qpe-line); background: #fff; }
  .qpe-bulk-actions .qpe-btn-primary { flex: 1; min-height: 50px; font-size: 17px; font-weight: 700; }
  .qpe-bulk-grid { gap: 14px; }
  .qpe-bulk-needs { padding: 18px; }
  .qpe-bulk-needs summary { font-size: 17px; }
  .qpe-bulk-cols { grid-template-columns: 86px minmax(0, 1fr); }
  .qpe-bulk-cols dd.is-req, .qpe-bulk-cols dd.is-opt { display: none; }
  /* Review: skipped first, then ready, then the note and the Add button */
  .qpe-bulk-review .qpe-bulk-grid { display: flex; flex-direction: column; }
  .qpe-bulk-review .qpe-bulk-side { display: contents; }
  .qpe-bulk-skipped { order: 1; padding: 14px 16px; background: var(--qpe-danger-tint); }
  .qpe-bulk-skipped h2 { font-size: 17px; }
  .qpe-bulk-skipped li { display: block; padding: 3px 0; border: 0; font-size: 15px; }
  .qpe-bulk-skip-row { font-family: inherit; font-size: 15px; color: var(--qpe-ink); margin-right: 4px; }
  .qpe-bulk-ready { order: 2; }
  .qpe-bulk-review .qpe-bulk-side > .qpe-bulk-note { order: 3; margin: 0; }
  .qpe-bulk-review-actions { order: 4; }
  .qpe-bulk-ready { border-radius: 12px; }
  .qpe-bulk-ready-head { margin: 0 16px; padding: 16px 0 10px; }
  .qpe-bulk-ready-head h2 { font-size: 17px; }
  .qpe-bulk-table, .qpe-bulk-table tbody { display: block; }
  .qpe-bulk-table tr { display: grid; grid-template-columns: 38px minmax(0, 1fr); margin: 0 16px; padding: 9px 0; border-bottom: 1px solid var(--qpe-line-soft); }
  .qpe-bulk-table tr:last-child { border-bottom: 0; }
  .qpe-bulk-table td { display: block; padding: 0; border: 0; }
  .qpe-bulk-row { grid-row: 1 / span 3; width: auto; padding-top: 3px !important; font-size: 12px; }
  .qpe-bulk-name { font-size: 16px; }
  .qpe-bulk-addr { font-size: 13px; color: var(--qpe-muted); }
  .qpe-bulk-loc { font-size: 12.5px; color: var(--qpe-ink); }
  .qpe-bulk-banners { margin: -18px -16px 16px; }
}

/* ---------- Forecast history (on /qpe_site_report/<id>; alone at #history) ---------- */
.qpe-hist { margin-top: 32px; }
.qpe-hist[hidden], .qpe-hist [hidden] { display: none !important; }
.qpe-hist-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.qpe-hist-title { min-width: 0; }
.qpe-hist-actions, .qpe-hist-for-list, .qpe-hist-for-cal { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qpe-hist-seg { margin-right: 6px; }
.qpe-hist-seg button { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.qpe-hist-seg button[disabled] { color: #9AA4AE; cursor: default; }
.qpe-hist[data-view="list"] .qpe-hist-for-cal, .qpe-hist[data-view="calendar"] .qpe-hist-for-list,
.qpe-hist[data-view="list"] [data-qpe-hist-for="calendar"], .qpe-hist[data-view="calendar"] [data-qpe-hist-for="list"] { display: none !important; }
.qpe-hist-year { padding: 0 6px; font-size: 15px; font-weight: 600; }
.qpe-hist-year-btn { width: 44px; padding: 0; font-size: 18px; }
.qpe-hist-year-btn[disabled] { opacity: .45; cursor: default; }

.qpe-hist-filters { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.qpe-hist-range { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; min-width: 0; }
.qpe-hist-date { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 700; color: var(--qpe-ink); }
.qpe-hist-date .qpe-input { width: 160px; height: 44px; padding: 0 10px; font-size: 14px; }
.qpe-hist-date .qpe-input.is-invalid { border-color: var(--qpe-danger); }
.qpe-hist-quick { display: flex; gap: 6px; padding-bottom: 2px; }
.qpe-hist-quick .qpe-chip { height: 36px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.qpe-hist.is-js .qpe-hist-apply { display: none !important; }
.qpe-hist-kinds button { height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.qpe-hist-range-error { flex-basis: 100%; margin: -8px 0 0; }

/* List */
.qpe-hist-list { border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); overflow: hidden; }
.qpe-hist-cols, .qpe-hist-row { display: grid; grid-template-columns: 40px 230px 170px 150px 150px 110px minmax(0, 1fr) 40px; gap: 12px; align-items: center; padding: 0 16px; }
.qpe-hist-cols { height: 44px; border-bottom: 1px solid var(--qpe-line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--qpe-muted); }
.qpe-hist-ev + .qpe-hist-ev { border-top: 1px solid var(--qpe-line-soft); }
.qpe-hist-ev[open] { background: #FAFBFC; }
.qpe-hist-row { min-height: 64px; list-style: none; cursor: pointer; }
.qpe-hist-row::-webkit-details-marker { display: none; }
.qpe-hist-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--qpe-now); justify-self: center; }
.qpe-hist-ev.is-upcoming .qpe-hist-dot { background: var(--qpe-48h); }
.qpe-hist-ev.is-dropped .qpe-hist-dot { border: 2px dashed #6B7580; background: #fff; }
.qpe-hist-when strong { display: block; font-size: 15px; }
.qpe-hist-when small, .qpe-hist-flag small { display: block; font-size: 12px; color: var(--qpe-muted); }
.qpe-hist-flag { font-size: 14px; }
.qpe-hist-flag small { font-family: var(--qpe-mono); }
.qpe-hist-last { font-size: 14px; }
.qpe-hist-peak .qpe-mono { font-size: 14px; font-weight: 600; }
.qpe-hist-snaps .qpe-mono { font-size: 14px; }
.qpe-hist-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1.5px solid transparent; border-radius: 13px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.qpe-hist-chip.is-held { background: var(--qpe-primary-tint); color: #0B2540; }
.qpe-hist-chip.is-upcoming { background: var(--qpe-48h); color: #fff; }
.qpe-hist-chip.is-dropped { border-style: dashed; border-color: #9AA4AE; color: #4A5663; }
.qpe-hist-chev { display: flex; justify-content: center; color: var(--qpe-muted); transition: transform .15s; }
.qpe-hist-ev[open] .qpe-hist-chev { transform: rotate(180deg); }
.qpe-hist-body { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 32px; padding: 4px 16px 22px 68px; }
.qpe-hist-chart { display: flex; flex-direction: column; gap: 8px; }
.qpe-hist-chart strong { font-size: 13px; }
.qpe-hist-chart small { font-size: 12px; color: var(--qpe-text); }
.qpe-hist-bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 90px; border-bottom: 1px solid var(--qpe-line); }
.qpe-hist-bars span { flex: 1 1 0; min-width: 2px; max-width: 30px; border-radius: 2px 2px 0 0; background: #A9C0D4; }
.qpe-hist-bars span.is-over { background: var(--qpe-now); }
.qpe-hist-thr { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--qpe-admin); pointer-events: none; }
.qpe-hist-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--qpe-muted); }
.qpe-hist-snap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qpe-hist-snap-table th { padding: 4px 16px 4px 0; border-bottom: 1px solid var(--qpe-line); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--qpe-muted); text-align: left; }
.qpe-hist-snap-table td { padding: 7px 16px 7px 0; border-bottom: 1px solid var(--qpe-line-soft); }
.qpe-hist-snap-table .is-num { text-align: right; }
.qpe-hist-none { margin: 0; padding: 28px 20px; font-size: 15px; color: var(--qpe-muted); }

/* Calendar (desktop only) */
@media (min-width: 768px) {
  .qpe-hist[data-view="list"] [data-qpe-hist-panel="calendar"], .qpe-hist[data-view="calendar"] [data-qpe-hist-panel="list"],
  .qpe-hist[data-view="calendar"] .qpe-hist-kinds { display: none !important; }
}
.qpe-hist-cal { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.qpe-hist-cal-card, .qpe-hist-selected { border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
.qpe-hist-cal-card { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; }
.qpe-hist-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--qpe-text); }
.qpe-hist-legend li { display: flex; align-items: center; gap: 6px; }
.qpe-hist-sw { width: 16px; height: 16px; border-radius: 4px; }
.qpe-hist-sw.is-qpe { background: var(--qpe-now); }
.qpe-hist-sw.is-pre { background: #FBE3A1; }
.qpe-hist-sw.is-drop { border: 2px dashed #6B7580; }
.qpe-hist-sw.is-up { background: var(--qpe-48h); }
.qpe-hist-sw.is-before { background: #F0EFEA; }
.qpe-hist-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; }
.qpe-hist-month h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.qpe-hist-month h3 span { font-size: 12px; font-weight: 400; color: var(--qpe-muted); }
.qpe-hist-wk, .qpe-hist-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.qpe-hist-wk { margin-bottom: 3px; font-size: 10px; color: var(--qpe-muted); text-align: center; }
.qpe-hist-day { display: flex; align-items: center; justify-content: center; height: 28px; padding: 0; border: 0; border-radius: 5px; background: var(--qpe-page); font-family: var(--qpe-mono); font-size: 11px; color: var(--qpe-text); }
button.qpe-hist-day { cursor: pointer; }
.qpe-hist-day.is-blank { background: none; }
.qpe-hist-day.is-qpe { background: var(--qpe-now); color: #fff; font-weight: 600; }
.qpe-hist-day.is-up { background: var(--qpe-48h); color: #fff; font-weight: 600; }
.qpe-hist-day.is-drop { border: 2px dashed #6B7580; background: #fff; color: var(--qpe-ink); font-weight: 600; }
.qpe-hist-day.is-pre { background: #FBE3A1; color: var(--qpe-pre-ink); }
.qpe-hist-day.is-before { background: #F0EFEA; color: #9AA4AE; }
.qpe-hist-day.is-future { background: none; color: #9AA4AE; }
.qpe-hist-day[aria-pressed="true"] { outline: 3px solid var(--qpe-admin); outline-offset: 1px; }
.qpe-hist-selected { display: flex; flex-direction: column; padding: 22px; }
.qpe-hist-sel { display: flex; flex-direction: column; gap: 4px; }
.qpe-hist-sel > .qpe-muted { font-size: 13px; }
.qpe-hist-sel h2 { margin: 0; font-size: 24px; font-weight: 700; font-stretch: 88%; }
.qpe-hist-sel-chip { align-self: flex-start; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1.5px solid transparent; border-radius: 13px; background: var(--qpe-now); color: #fff; font-size: 12px; font-weight: 700; }
.qpe-hist-sel-chip.is-upcoming { background: var(--qpe-48h); }
.qpe-hist-sel-chip.is-dropped { border-style: dashed; border-color: #9AA4AE; background: #fff; color: #4A5663; }
.qpe-hist-sel p { margin: 10px 0 12px; font-size: 14px; line-height: 1.5; color: var(--qpe-text); }
.qpe-hist-sel-snaps { margin: 0 0 14px; padding: 0; list-style: none; }
.qpe-hist-sel-snaps li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--qpe-line-soft); font-size: 13px; }
.qpe-hist-sel .qpe-link-btn { align-self: flex-start; font-size: 14px; }

/* New site, no history */
.qpe-hist-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: max(440px, calc(100vh - 290px)); padding: 40px 24px;
  border: 1px dashed #C9D3DC; border-radius: var(--qpe-radius-card); background: var(--qpe-surface); text-align: center; }
.qpe-hist-empty-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--qpe-primary-tint); color: var(--qpe-primary); }
.qpe-hist-empty h2 { margin: 0; font-size: 32px; font-weight: 700; font-stretch: 88%; }
.qpe-hist-empty p { max-width: 600px; margin: 0; font-size: 17px; line-height: 1.55; color: var(--qpe-text); }
.qpe-hist-empty-actions { display: flex; gap: 10px; margin-top: 10px; }

@media (max-width: 1199.98px) {
  .qpe-hist-cols, .qpe-hist-row { grid-template-columns: 28px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .7fr) minmax(0, 1.4fr) 28px; gap: 10px; }
  .qpe-hist-body { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-left: 54px; }
  .qpe-hist-cal { grid-template-columns: minmax(0, 1fr); }
  .qpe-hist-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qpe-hist-head { flex-wrap: wrap; }
}
@media (max-width: 991.98px) {
  .qpe-hist-cols, .qpe-hist-row { grid-template-columns: 24px minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.3fr) 24px; }
  .qpe-hist-cols span:nth-child(4), .qpe-hist-last { display: none; }
  .qpe-hist-cols { font-size: 11px; letter-spacing: .03em; }
  .qpe-hist-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qpe-hist-chip { white-space: normal; height: auto; min-height: 26px; padding: 3px 10px; }
}
@media (max-width: 767.98px) {
  .qpe-hist-head { margin-bottom: 14px; }
  .qpe-hist-head .qpe-subtitle { font-size: 13.5px; line-height: 1.4; }
  .qpe-hist-filters { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .qpe-hist-kinds { order: -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  .qpe-hist-kinds button { padding: 0 6px; font-size: 14px; }
  .qpe-hist-range { flex-wrap: nowrap; overflow-x: auto; min-width: 0; margin: 0 -16px; padding: 0 16px; }
  .qpe-hist-quick { flex-shrink: 0; }
  .qpe-hist-quick .qpe-chip { height: 40px; padding: 0 14px; font-size: 15px; }
  .qpe-hist-list { border: 0; background: none; overflow: visible; }
  .qpe-hist-ev { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--qpe-line); border-radius: var(--qpe-radius-card); background: var(--qpe-surface); }
  .qpe-hist-ev + .qpe-hist-ev { border-top: 1px solid var(--qpe-line); }
  .qpe-hist-ev[open] { border-color: var(--qpe-primary); background: var(--qpe-surface); }
  .qpe-hist-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; min-height: 0; padding: 0; }
  .qpe-hist-row::after { content: ''; order: 4; flex-basis: 100%; height: 8px; }
  .qpe-hist-dot { order: 1; margin: 5px 10px 0 0; }
  .qpe-hist-when { order: 2; flex: 1 1 0; min-width: 0; }
  .qpe-hist-when strong { font-size: 17px; line-height: 1.2; }
  .qpe-hist-out { order: 3; margin-left: 8px; }
  .qpe-hist-chip { white-space: nowrap; }
  .qpe-hist-flag, .qpe-hist-peak, .qpe-hist-snaps { order: 5; flex: 0 0 33.333%; min-width: 0; display: flex; flex-direction: column; padding-right: 8px; font-size: 15px; }
  .qpe-hist-k { font-size: 13px; color: var(--qpe-text); }
  .qpe-hist-flag small { font-family: inherit; font-size: 15px; font-weight: 700; color: var(--qpe-ink); }
  .qpe-hist-peak .qpe-mono, .qpe-hist-snaps .qpe-mono { font-size: 15px; font-weight: 700; }
  .qpe-hist-body { display: block; padding: 12px 0 0; }
  .qpe-hist-sum { margin: 0 0 10px; font-size: 14px; color: var(--qpe-text); }
  .qpe-hist-chart { margin-bottom: 8px; }
  .qpe-hist-chart strong { font-size: 14px; color: var(--qpe-text); }
  .qpe-hist-snap-list { margin: 0; padding: 0; list-style: none; }
  .qpe-hist-snap-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 11px 0; border-top: 1px solid var(--qpe-line-soft); font-size: 13.5px; }
  .qpe-hist-snap-list li span { color: var(--qpe-muted); }
  .qpe-hist-snap-list li strong { text-align: right; font-size: 14px; }
  .qpe-hist-none { padding: 20px 0; }
  .qpe-hist-phone-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
  .qpe-hist-phone-foot .qpe-btn { min-height: 48px; font-size: 16px; font-weight: 700; }
  .qpe-hist-phone-foot p { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; color: var(--qpe-text); }
  .qpe-hist-empty { display: block; min-height: 0; padding: 20px; border-color: #B9C1C9; border-radius: 12px; background: #F8F8F6; text-align: left; }
  .qpe-hist-empty h2 { margin-bottom: 8px; font-size: 20px; }
  .qpe-hist-empty p { font-size: 16px; }
}
@media print {
  .qpe-hist-actions, .qpe-hist-filters, .qpe-hist-back, .qpe-hist .qpe-crumbs, .qpe-hist-phone-foot, .qpe-hist-cal, .qpe-hist-chev { display: none !important; }
  .qpe-hist .qpe-hist-list { display: block !important; }
  .qpe-hist-ev { break-inside: avoid; }
  .qpe-hist-bars span, .qpe-hist-dot, .qpe-hist-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
