/* Portrait UI 2: the modern layer for My Account (session UI, 16 Nov 2026).
 *
 * Ben, 16 Nov 2026: the look so far is dated; the target is a cutting-edge
 * large-corporate product (Octopus Energy, HSBC), and the secondary and hint
 * colours in particular have to move on.
 *
 * What this layer changes, and nothing else:
 *   - colour: cleaner secondary and hint text, one bright link colour, soft
 *     tinted states instead of dark washes, hairlines instead of grey rules;
 *   - shape: large-radius borderless cards on layered surfaces, pill buttons,
 *     filled fields with a clear focus ring;
 *   - type: bigger, calmer scale; sentence-case labels instead of tiny
 *     uppercase monospace; nothing under 13px;
 *   - motion: short, quiet transitions (off under reduced motion).
 * It loads last and only restyles; no markup, wording, route or behaviour
 * changes. Removing the one <link> in base.html and auth_base.html rolls the
 * whole thing back. Phone rules sit in the 1023.98px query at the end.
 */

/* ---- tokens ---------------------------------------------------------------- */
body.portal {
  --pos-bg: #071B2C;
  --pos-bg2: #0A2236;
  --pos-panel: #10293F;
  --pos-panel2: #16324B;
  --pos-panel3: #0C2438;
  --pos-line: rgba(255, 255, 255, 0.08);
  --pos-line2: rgba(255, 255, 255, 0.14);
  --pos-line3: rgba(255, 255, 255, 0.06);
  --pos-line-accent: rgba(255, 255, 255, 0.22);
  --pos-btn-border: rgba(255, 255, 255, 0.18);
  /* Solid, like the status tints below (17 Nov 2026). As a 9 per cent white wash it let the page show
     through anything filled with it: the Pixel button in Perspective is filled with this token ("the navigation
     item's dark blue") and went see-through. The value is that wash laid over the panel colour. */
  --pos-nav-active: #283E52;

  --pos-text: #EEF4F8;
  --pos-text-strong: #FFFFFF;
  --pos-text2: #D3DEE8;
  --pos-dim: #A9BDCF;
  --pos-dim2: #93A9BD;
  --pos-dim3: #8AA0B5;
  --pos-faint: #5B748A;

  --pos-gold: #FFBF00;
  --pos-gold-text: #FFC933;
  --pos-gold-ink: #081527;
  --pos-green: #2FD08C;
  --pos-green-text: #5BE3A8;
  --pos-coral: #FF6B6B;
  --pos-error-text: #FF8E8E;
  --pos-blue: #5CC2FF;
  --pos-blue-text: #7CD0FF;

  /* The three status tints are solid colours, as they are in portrait_os_tokens.css (17 Nov 2026). The first
     version of this layer made them 14 per cent see-through, and marks drawn over a line (the journey ribbon)
     showed the line through them. Each value is the old tint laid over the panel colour, so badges look the same. */
  --pos-held-bg: #14404A;
  --pos-miss-bg: #313245;
  --pos-warn-bg: #313E36;

  --pos-radius: 18px;
  --pos-radius-sm: 12px;
  --pos-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px rgba(2, 10, 20, 0.28);
  /* No monospace in the customer portal: figures stay aligned through tabular numerals. */
  --pos-font-mono: var(--pos-font-sans);
  --ptm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ptm-field: rgba(255, 255, 255, 0.06);
  --ptm-field-hover: rgba(255, 255, 255, 0.09);
  --ptm-soft: rgba(255, 255, 255, 0.07);
  --ptm-soft-hover: rgba(255, 255, 255, 0.12);
}
body.portal.theme-light {
  --pos-bg: #F4F6FA;
  --pos-bg2: #FFFFFF;
  --pos-panel: #FFFFFF;
  --pos-panel2: #F4F6FA;
  --pos-panel3: #EEF2F6;
  --pos-line: rgba(11, 32, 50, 0.08);
  --pos-line2: rgba(11, 32, 50, 0.14);
  --pos-line3: rgba(11, 32, 50, 0.06);
  --pos-line-accent: rgba(11, 32, 50, 0.24);
  --pos-btn-border: rgba(11, 32, 50, 0.18);
  --pos-nav-active: #EEF0F2;

  --pos-text: #0B2032;
  --pos-text-strong: #071B2C;
  --pos-text2: #24394D;
  --pos-dim: #4D6277;
  --pos-dim2: #5F7488;
  --pos-dim3: #5C7286;
  --pos-faint: #B9C6D2;

  --pos-gold-text: #8A6200;
  --pos-green: #0E9F63;
  --pos-green-text: #0B7A4C;
  --pos-coral: #D93838;
  --pos-error-text: #B42323;
  --pos-blue: #0B6BCB;
  --pos-blue-text: #0B5CAD;

  --pos-held-bg: #E7F5EF;
  --pos-miss-bg: #FCEDED;
  --pos-warn-bg: #FFF5D6;

  --pos-shadow: 0 1px 2px rgba(11, 32, 50, 0.05), 0 10px 28px rgba(11, 32, 50, 0.07);
  --ptm-field: #FFFFFF;
  --ptm-field-hover: #FFFFFF;
  --ptm-soft: rgba(11, 32, 50, 0.05);
  --ptm-soft-hover: rgba(11, 32, 50, 0.09);
}

/* ---- base ------------------------------------------------------------------ */
body.portal { background: var(--pos-bg); color: var(--pos-text); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.portal a { color: var(--pos-blue-text); text-decoration: none; font-weight: 500; transition: color .15s var(--ptm-ease); }
body.portal a:hover { color: var(--pos-text-strong); text-decoration: underline; text-underline-offset: 3px; }
body.portal :focus-visible { outline: 2px solid var(--pos-gold); outline-offset: 2px; }
body.portal ::selection { background: rgba(255, 191, 0, 0.35); }

/* ---- header and navigation -------------------------------------------------- */
body.portal .pt-header { background: color-mix(in srgb, var(--pos-bg) 86%, transparent); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--pos-line); padding-top: 12px; padding-bottom: 6px; gap: 8px 14px; }
body.portal .pt-logo { height: 28px; }
body.portal .pt-nav { gap: 2px; }
body.portal .pt-nav a, body.portal .pt-dd > summary { color: var(--pos-dim); font-size: 15px; font-weight: 600; padding: 8px 14px; border-radius: 999px; text-decoration: none; transition: background-color .15s var(--ptm-ease), color .15s var(--ptm-ease); }
body.portal .pt-nav a:hover { color: var(--pos-text-strong); background: var(--ptm-soft); text-decoration: none; }
body.portal .pt-nav a.active { color: var(--pos-gold-ink); background: var(--pos-gold); }
body.portal.theme-light .pt-nav a.active { color: #071B2C; }
body.portal .pt-company { background: var(--ptm-soft); border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; font-weight: 600; color: var(--pos-text-strong); transition: background-color .15s var(--ptm-ease); }
body.portal .pt-company:hover { background: var(--ptm-soft-hover); }
body.portal .pt-iconbtn, body.portal .pt-bell, body.portal .pt-schedule { background: var(--ptm-soft); border: 0; border-radius: 999px; color: var(--pos-text2); transition: background-color .15s var(--ptm-ease), color .15s var(--ptm-ease); }
body.portal .pt-iconbtn:hover, body.portal .pt-bell:hover, body.portal .pt-schedule:hover { background: var(--ptm-soft-hover); color: var(--pos-text-strong); }
body.portal .pt-user, body.portal .pt-logout { font-size: 14px; color: var(--pos-dim); }

/* ---- page frame and type ----------------------------------------------------- */
body.portal .pt-page { max-width: 1120px; padding-top: 36px; }
body.portal .pt-page h1, body.portal .pt-page-title { font-size: 34px; line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; margin: 0 0 8px; }
body.portal .pt-page h1::before, body.portal .pt-page-title::before { display: none; }
body.portal .pt-page-sub, body.portal .pt-page h1 + p { color: var(--pos-dim); font-size: 17px; line-height: 1.5; max-width: 68ch; margin: 0 0 28px; }
body.portal .pt-footer { border-top: 0; color: var(--pos-dim2); font-size: 14px; padding-top: 28px; }
body.portal .pt-footer a { color: var(--pos-dim); text-decoration: underline; text-underline-offset: 3px; }

/* ---- cards ------------------------------------------------------------------ */
body.portal .pt-card { background: var(--pos-panel); border: 0; border-radius: var(--pos-radius); padding: 28px; margin-bottom: 20px; box-shadow: var(--pos-shadow); }
body.portal .pt-card h2 { font-size: 21px; line-height: 1.25; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.005em; }
body.portal .pt-card h3 { font-size: 17px; font-weight: 700; color: var(--pos-text-strong); }
body.portal .pt-card .pt-card-sub, body.portal .pt-card > h2 + p { color: var(--pos-dim); font-size: 15px; margin: 0 0 18px; }
body.portal .pt-card p { font-size: 15.5px; }
body.portal .pt-card .pt-card { background: var(--ptm-soft); box-shadow: none; border-radius: 14px; padding: 20px; }
body.portal details.pt-card > summary { font-weight: 600; color: var(--pos-text-strong); }

/* ---- buttons ----------------------------------------------------------------- */
body.portal .pt-btn, body.portal .pt-contact-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.005em; text-decoration: none; cursor: pointer; background: var(--pos-gold); color: var(--pos-gold-ink); transition: transform .15s var(--ptm-ease), box-shadow .15s var(--ptm-ease), background-color .15s var(--ptm-ease), filter .15s var(--ptm-ease); }
body.portal.theme-light .pt-btn, body.portal.theme-light .pt-contact-btn.primary { color: #071B2C; }
body.portal .pt-btn:hover, body.portal .pt-contact-btn.primary:hover { filter: none; background: #FFCC33; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255, 191, 0, 0.28); text-decoration: none; color: var(--pos-gold-ink); }
body.portal .pt-btn:active, body.portal .pt-contact-btn:active { transform: translateY(0); box-shadow: none; }
body.portal .pt-btn.ghost, body.portal .pt-contact-btn:not(.primary) { background: var(--ptm-soft); color: var(--pos-text-strong); border: 0; font-weight: 600; }
body.portal .pt-btn.ghost:hover, body.portal .pt-contact-btn:not(.primary):hover { background: var(--ptm-soft-hover); box-shadow: none; color: var(--pos-text-strong); }
body.portal .pt-btn.danger { background: var(--pos-miss-bg); color: var(--pos-error-text); border: 0; }
body.portal .pt-btn.danger:hover { background: color-mix(in srgb, var(--pos-coral) 24%, transparent); box-shadow: none; color: var(--pos-error-text); }
body.portal .pt-btn[disabled], body.portal .pt-btn[aria-disabled="true"] { opacity: .45; transform: none; box-shadow: none; cursor: default; }
body.portal .pt-btn, body.portal .pt-contact-btn { border-radius: 24px; padding-top: 10px; padding-bottom: 10px; text-align: center; line-height: 1.25; }
body.portal .pt-btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
body.portal .pt-btn.on { background: var(--pos-gold); color: var(--pos-gold-ink); }
body.portal .pt-toggle { border: 0; background: var(--ptm-soft); padding: 4px; border-radius: 999px; }
body.portal .pt-toggle button { border-radius: 999px; padding: 9px 18px; font-size: 14px; color: var(--pos-dim); transition: background-color .15s var(--ptm-ease), color .15s var(--ptm-ease); }
body.portal .pt-toggle button.on { background: var(--pos-text-strong); color: var(--pos-bg); }
body.portal.theme-light .pt-toggle button.on { background: #071B2C; color: #FFFFFF; }

/* ---- fields ------------------------------------------------------------------ */
body.portal .pt-field { margin-bottom: 18px; }
body.portal .pt-field label, body.portal .pt-page label { font-size: 14.5px; font-weight: 600; color: var(--pos-text2); margin-bottom: 7px; }
body.portal .pt-field input[type=text], body.portal .pt-field input[type=search], body.portal .pt-field input[type=email],
body.portal .pt-field input[type=tel], body.portal .pt-field input[type=date], body.portal .pt-field input[type=number],
body.portal .pt-field input[type=url], body.portal .pt-field input[type=password], body.portal .pt-field select,
body.portal .pt-field textarea, body.portal .pt-input,
body.portal .pt-page input[type=text], body.portal .pt-page input[type=search], body.portal .pt-page input[type=email],
body.portal .pt-page input[type=tel], body.portal .pt-page input[type=date], body.portal .pt-page input[type=number],
body.portal .pt-page input[type=url], body.portal .pt-page input[type=password], body.portal .pt-page select,
body.portal .pt-page textarea {
  background: var(--ptm-field); color: var(--pos-text-strong); border: 1px solid var(--pos-btn-border);
  border-radius: 12px; min-height: 52px; padding: 12px 16px; font-size: 16px; font-family: var(--pos-font-sans);
  transition: border-color .15s var(--ptm-ease), background-color .15s var(--ptm-ease), box-shadow .15s var(--ptm-ease);
}
body.portal .pt-page select { padding-right: 40px; }
body.portal .pt-page input[type=date] { min-width: 170px; }

/* Drop-downs (Ben, 17 Nov 2026: "the drop down tabs look ugly ... any others that don't have styling").
   Desktop only: phones keep the system picker, which is the better control for a thumb. Where the browser can
   style the open list (appearance: base-select) the list is a rounded panel in the theme with a gold tick on the
   chosen row; elsewhere the closed control still gets the Portrait chevron. Sizes and padding are not touched. */
@media (min-width: 1024px) {
  @supports (appearance: base-select) {
    body.portal select:not([multiple]):not([size]), body.portal select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
    /* The chevron is a background on the control and the text clips at the content edge, so a control narrower
       than its chosen text keeps its chevron (18 Nov 2026; the icon used to be pushed out of view). */
    body.portal select:not([multiple]):not([size]) { align-items: center; cursor: pointer; line-height: normal; white-space: nowrap; overflow: clip; overflow-clip-margin: content-box; padding-right: 32px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.3 6 8.1l3.8-3.8' fill='none' stroke='%237F93A6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 11px 11px !important; }
    body.portal select:not([multiple]):not([size]):open { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 7.7 6 3.9l3.8 3.8' fill='none' stroke='%237F93A6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; }
    body.portal select:not([multiple]):not([size])::picker-icon { content: ""; flex: none; width: 0; height: calc(1lh + 2px); visibility: hidden; }
    body.portal select:not([multiple]):not([size])::picker(select) { margin: 6px 0; padding: 6px; min-width: anchor-size(width); max-height: min(60vh, 420px); overflow-y: auto; background: var(--pos-panel); color: var(--pos-text); border: 1px solid var(--pos-line2); border-radius: 12px; box-shadow: 0 16px 40px rgba(2, 10, 20, .32); font: 500 14px/1.3 var(--pos-font-sans); scrollbar-width: thin; scrollbar-color: var(--pos-line2) transparent; }
    body.portal select:not([multiple]):not([size]) option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 12px; border-radius: 8px; color: var(--pos-text); background: transparent; cursor: pointer; white-space: nowrap; }
    body.portal select:not([multiple]):not([size]) option:hover, body.portal select:not([multiple]):not([size]) option:focus-visible { background: var(--ptm-soft); color: var(--pos-text-strong); outline: 0; }
    body.portal select:not([multiple]):not([size]) option:checked { background: var(--ptm-soft-hover); color: var(--pos-text-strong); font-weight: 600; }
    body.portal select:not([multiple]):not([size]) option:disabled { color: var(--pos-dim3, var(--pos-dim)); cursor: default; background: transparent; }
    body.portal select:not([multiple]):not([size]) option::checkmark { order: 1; margin-left: auto; padding-left: 12px; color: var(--pos-gold-text, var(--pos-gold)); font-weight: 700; }
    body.portal select:not([multiple]):not([size]) optgroup { padding: 6px 0 2px; font: 700 11px/1.3 var(--pos-font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--pos-dim); }
    body.portal select:not([multiple]):not([size]) optgroup option { font: 500 14px/1.3 var(--pos-font-sans); letter-spacing: 0; text-transform: none; }
  }
  @supports not (appearance: base-select) {
    body.portal select:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 32px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.3 6 8.1l3.8-3.8' fill='none' stroke='%237F93A6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 11px 11px !important; }
  }
}
body.portal .pt-page form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), body.portal .pt-page form select, body.portal .pt-page form textarea, body.portal #pt-users-body input:not([type=hidden]), body.portal #pt-users-body select { background: var(--ptm-field); border: 1px solid var(--pos-btn-border); border-radius: 12px; min-height: 52px; padding: 12px 16px; color: var(--pos-text-strong); }
body.portal .pt-field input:hover, body.portal .pt-field select:hover, body.portal .pt-field textarea:hover, body.portal .pt-input:hover,
body.portal .pt-page input:not([type=checkbox]):not([type=radio]):not([type=file]):hover, body.portal .pt-page select:hover, body.portal .pt-page textarea:hover { background: var(--ptm-field-hover); border-color: var(--pos-line-accent); }
body.portal .pt-field input:focus, body.portal .pt-field select:focus, body.portal .pt-field textarea:focus, body.portal .pt-input:focus,
body.portal .pt-page input:not([type=checkbox]):not([type=radio]):not([type=file]):focus, body.portal .pt-page select:focus, body.portal .pt-page textarea:focus { outline: 0; border-color: var(--pos-gold); box-shadow: 0 0 0 4px rgba(255, 191, 0, 0.22); }
body.portal ::placeholder { color: var(--pos-dim3); opacity: 1; }
body.portal .pt-field .hint, body.portal .hint { font-size: 14px; color: var(--pos-dim2); margin-top: 6px; }
body.portal input[type=checkbox], body.portal input[type=radio] { accent-color: var(--pos-gold); width: 20px; height: 20px; }
body.portal input[type=file] { color: var(--pos-dim); font-size: 15px; }
body.portal input[type=file]::file-selector-button { margin-right: 12px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--ptm-soft-hover); color: var(--pos-text-strong); font: 600 14px var(--pos-font-sans); cursor: pointer; }
body.portal .pt-check { font-size: 15px; color: var(--pos-text2); gap: 12px; }

/* ---- messages, badges and chips ------------------------------------------------ */
body.portal .pt-error, body.portal .pt-ok, body.portal .pt-notice { border-radius: 14px; padding: 14px 18px; font-size: 15px; font-weight: 500; border: 0; }
body.portal .pt-badge, body.portal .pt-stagechip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; letter-spacing: 0; }
body.portal .pt-badge.info, body.portal .pt-stagechip { background: color-mix(in srgb, var(--pos-blue) 16%, transparent); color: var(--pos-blue-text); }
body.portal .pt-stagechip.saved { background: var(--pos-held-bg); color: var(--pos-green-text); }
body.portal .pt-role { font-family: var(--pos-font-sans); font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--pos-dim); }
body.portal .pt-chips { gap: 14px; }
body.portal .pt-chip { background: var(--ptm-soft); border: 0; border-radius: 16px; padding: 18px 20px; min-width: 160px; flex: 1 1 160px; }
body.portal .pt-chip .v { font-size: 30px; line-height: 1.1; letter-spacing: -0.01em; }
body.portal .pt-chip .k { font-size: 14px; color: var(--pos-dim); margin-top: 6px; }
body.portal .pt-empty { border: 0; border-radius: 14px; background: var(--ptm-soft); color: var(--pos-dim); font-size: 15px; padding: 18px 20px; }
body.portal .pt-linkbox { font-family: var(--pos-font-sans); font-size: 14px; border: 0; background: var(--ptm-soft); border-radius: 12px; padding: 14px 16px; }
body.portal .pt-headline { font-size: 15px; }
body.portal .pt-prop-head .addr { font-size: 19px; font-weight: 700; letter-spacing: -0.005em; }
body.portal .pt-prop-head .rv, body.portal .pt-case .ctype, body.portal .pt-table td.num { font-family: var(--pos-font-sans); font-variant-numeric: tabular-nums; font-size: 14.5px; }
body.portal .pt-case { font-size: 15px; }
body.portal .pt-case .cnext { font-size: 14px; }
body.portal .pt-billing-note { font-size: 14px; }

/* Small uppercase monospace captions become plain, readable captions. */
body.portal .pt-wordmark .sub, body.portal .pt-contact-eyebrow, body.portal .pt-grouphead,
body.portal .pt-savings .label, body.portal .pt-kicker, body.portal .pt-card .k, body.portal .pt-cal-month {
  font-family: var(--pos-font-sans); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--pos-dim);
}

body.portal .pt-tl .tlk, body.portal .pt-tl .tld, body.portal .pt-thread-row .meta, body.portal .pt-notif .nd, body.portal .pt-cal-ev .d,
body.portal .pt-calhead div, body.portal .pt-calday .n, body.portal .pt-agday .d, body.portal .pt-agday .k, body.portal .pt-daypanel .k, body.portal .pt-hits .m {
  font-size: 13.5px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; color: var(--pos-dim);
}
body.portal .pt-cal-ev .d, body.portal .pt-agday .d { font-weight: 700; color: var(--pos-text2); font-size: 14.5px; }
body.portal #pt-company-profile input:not([type=checkbox]):not([type=radio]):not([type=hidden]), body.portal #pt-company-profile select, body.portal #pt-company-profile textarea { background: var(--ptm-field); border: 1px solid var(--pos-btn-border); border-radius: 12px; min-height: 52px; padding: 12px 16px; color: var(--pos-text-strong); font-size: 16px; }

/* ---- tables ------------------------------------------------------------------ */
body.portal .pt-tablewrap { border: 0; border-radius: 16px; background: var(--ptm-soft); }
body.portal table.pt-table { background: transparent; font-size: 15px; }
body.portal .pt-table th { font-family: var(--pos-font-sans); font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--pos-dim); padding: 14px 18px; border-bottom: 1px solid var(--pos-line2); }
body.portal .pt-table td { padding: 14px 18px; border-bottom: 1px solid var(--pos-line3); color: var(--pos-text); }
body.portal .pt-table tbody tr { transition: background-color .12s var(--ptm-ease); }
body.portal .pt-table tbody tr:hover td { background: var(--ptm-soft); }

/* ---- sign-in pages (restyle only) ---------------------------------------------- */
body.portal .pt-authcard { border: 0; border-radius: 24px; padding: 40px; box-shadow: var(--pos-shadow); max-width: 440px; }
body.portal .pt-authcard h1 { font-size: 26px; line-height: 1.2; font-weight: 700; margin: 22px 0 22px; }
body.portal .pt-authcard .pt-btn { width: 100%; min-height: 52px; font-size: 16px; }

/* ---- account manager card and overlays ------------------------------------------ */
body.portal .pt-contact { border: 0; border-radius: 22px; box-shadow: var(--pos-shadow); overflow: hidden; background: var(--pos-panel); color: var(--pos-text); min-height: 200px; }
body.portal .pt-contact-photo { background: linear-gradient(150deg, #FFBF00 0%, #FFD45C 100%); flex-basis: 260px; }
body.portal .pt-contact-initials { background: #071B2C; color: #FFBF00; width: 108px; height: 108px; font-size: 36px; letter-spacing: 0.01em; }
body.portal .pt-contact-body { padding: 30px clamp(20px, 3vw, 40px); gap: 10px; }
body.portal .pt-contact h2 { font-size: 24px; line-height: 1.2; color: var(--pos-text-strong); }
body.portal .pt-contact-eyebrow { color: var(--pos-gold-text); }
body.portal .pt-contact-text { font-size: 16px; color: var(--pos-text2); }
body.portal .pt-contact-details dt { color: var(--pos-gold-text); }
body.portal .pt-contact-details dd, body.portal .pt-contact-details dd a { color: var(--pos-text-strong); text-decoration-color: var(--pos-gold); }
body.portal .pt-contact-actions { gap: 10px; margin-top: 10px; }
body.portal .pt-modal-panel, body.portal .pt-drawer { border: 0; border-radius: 24px; box-shadow: 0 24px 64px rgba(2, 10, 20, 0.5); }
body.portal .pt-drawer { border-radius: 24px 0 0 24px; }
body.portal .pt-toast { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 600; box-shadow: 0 12px 32px rgba(2, 10, 20, 0.4); }
body.portal .pt-progress { height: 8px; border-radius: 999px; background: var(--ptm-soft-hover); overflow: hidden; }

/* ---- savings hero ------------------------------------------------------------- */
body.portal .pt-savings { border: 0; border-radius: 22px; padding: 32px; gap: 20px 48px; margin-bottom: 20px; align-items: center;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 191, 0, 0.16) 0%, rgba(255, 191, 0, 0) 55%), linear-gradient(135deg, #14344F 0%, #0E2A42 100%);
  box-shadow: var(--pos-shadow); }
body.portal.theme-light .pt-savings { background: radial-gradient(120% 140% at 0% 0%, rgba(255, 191, 0, 0.22) 0%, rgba(255, 191, 0, 0) 55%), #FFFFFF; }
body.portal .pt-savings .label { font-family: var(--pos-font-sans); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--pos-text2); margin-bottom: 8px; }
body.portal .pt-savings .amount { font-size: 52px; line-height: 1; letter-spacing: -0.02em; }
body.portal .pt-savings .note { font-size: 14px; color: var(--pos-dim); margin-top: 10px; max-width: 46ch; }

/* ---- journey ------------------------------------------------------------------ */
body.portal .pt-jstrip { margin: 18px 0 14px; }
body.portal .pt-jmark, body.portal .pt-journey .dot { width: 32px; height: 32px; font-family: var(--pos-font-sans); font-size: 13.5px; font-weight: 700; background: var(--pos-panel2); border: 2px solid var(--pos-line2); color: var(--pos-dim); }
body.portal .pt-jstep::before, body.portal .pt-journey .step::before { top: 15px; height: 3px; border-radius: 3px; background: var(--pos-line2); }
body.portal .pt-jstep.complete::before, body.portal .pt-journey .step.done::before { background: var(--pos-green); }
body.portal .pt-jstep.complete .pt-jmark, body.portal .pt-journey .done .dot { background: var(--pos-green); border-color: var(--pos-green); color: #052A1B; }
body.portal .pt-jstep.active .pt-jmark, body.portal .pt-jstep.due .pt-jmark, body.portal .pt-journey .active .dot { background: var(--pos-gold); border-color: var(--pos-gold); color: var(--pos-gold-ink); }
body.portal .pt-jstep.yours .pt-jmark { box-shadow: 0 0 0 5px rgba(255, 191, 0, 0.20); }
body.portal .pt-jname, body.portal .pt-journey .name { font-size: 14px; line-height: 1.3; font-weight: 600; color: var(--pos-text); }
body.portal .pt-jstep.pending .pt-jname, body.portal .pt-journey .upcoming .name { color: var(--pos-dim2); font-weight: 500; }
body.portal .pt-jstep.active .pt-jname, body.portal .pt-jstep.due .pt-jname, body.portal .pt-journey .active .name { color: var(--pos-gold-text); }
body.portal .pt-jturn { font-family: var(--pos-font-sans); font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; padding: 3px 10px; margin-top: 6px; }
body.portal .pt-jturn::first-letter { text-transform: uppercase; }
body.portal .pt-journey .when, body.portal .pt-ribbon .rwhen { font-family: var(--pos-font-sans); font-size: 13px; }
body.portal .pt-jd { border-bottom: 1px solid var(--pos-line3); }
body.portal .pt-jd > summary { padding: 16px 12px; border-radius: 12px; gap: 6px 16px; transition: background-color .12s var(--ptm-ease); }
body.portal .pt-jd > summary:hover { background: var(--ptm-soft); }
body.portal .pt-jd .s-name { font-size: 16px; color: var(--pos-text); }
body.portal .pt-jd.complete .s-name { color: var(--pos-text-strong); }
body.portal .pt-jd.active .s-name, body.portal .pt-jd.due .s-name { color: var(--pos-gold-text); }
body.portal .pt-jd .s-note { font-size: 14.5px; color: var(--pos-dim); }
body.portal .pt-jd-body { padding: 4px 12px 20px; }
body.portal .pt-jd-body p { font-size: 15.5px; max-width: 68ch; }
body.portal .pt-j-actions { gap: 10px; }
body.portal .pt-j-code { font-size: 16px; border: 0; border-radius: 10px; background: var(--pos-warn-bg); padding: 6px 12px; }

/* ---- property progress --------------------------------------------------------- */
body.portal .pt-ribbon .rdot { width: 22px; height: 22px; background: var(--pos-panel2); }
body.portal .pt-ribbon .done .rdot { background: var(--pos-green); border-color: var(--pos-green); color: #052A1B; }
body.portal .pt-ribbon .active .rdot { background: var(--pos-gold); border-color: var(--pos-gold); color: var(--pos-gold-ink); }
body.portal .pt-ribbon .rstep::before { top: 10px; height: 3px; border-radius: 3px; }
body.portal .pt-ribbon .rname { font-size: 14px; }
body.portal .pt-ribbon .rdetail { font-size: 13px; }
body.portal .pt-prop > div > a[style], body.portal .pt-prop a[data-pt-overlay], body.portal .pt-prop a[data-pt-drawer] { font-size: 15px !important; font-weight: 600; }
body.portal .pt-prop details.pt-card { background: var(--ptm-soft); }
body.portal .pt-notice { background: var(--ptm-soft); }
body.portal .pt-notice .t { font-size: 16px; }
body.portal .pt-tl, body.portal .pt-msg, body.portal .pt-notif { font-size: 15px; }

/* Two existing behaviours this layer must not disturb: the header call link is
   hidden on narrow screens (the page carries its own), and a relief radar
   cell never lets its button push past the cell. */
@media (max-width: 620px) { body.portal .pt-header .pt-schedule { display: none; } }
body.portal .pt-relief-radar .pt-btn { white-space: normal; padding-left: 16px; padding-right: 16px; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  body.portal *, body.portal *::before, body.portal *::after { transition: none !important; }
  body.portal .pt-btn:hover { transform: none; }
}

@media (max-width: 1023.98px) {
  /* No frosted header on a phone (16 Nov 2026, evening gate). backdrop-filter
     makes the header the containing block for fixed children, so the landlord
     dropdown, which portal_mobile.css lifts out as a fixed bottom sheet, was
     pinned inside the header and clipped by the scrolling nav: its links could
     not be reached. A solid header keeps the sheet on the viewport. */
  body.portal .pt-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--pos-bg); }
  body.portal .pt-page { padding-top: 24px; }
  body.portal .pt-page h1, body.portal .pt-page-title { font-size: 28px; }
  body.portal .pt-page-sub, body.portal .pt-page h1 + p { font-size: 16px; margin-bottom: 22px; }
  body.portal .pt-card { padding: 20px; border-radius: 16px; margin-bottom: 16px; }
  body.portal .pt-card h2 { font-size: 19px; }
  body.portal .pt-card .pt-card { padding: 16px; }
  body.portal .pt-authcard { padding: 28px 22px; border-radius: 20px; }
  body.portal .pt-chip .v { font-size: 26px; }
  body.portal .pt-drawer { border-radius: 20px 20px 0 0; }
  body.portal .pt-btn { padding: 0 20px; }
  body.portal .pt-savings { padding: 24px 20px; border-radius: 18px; }
  body.portal .pt-savings .amount { font-size: 40px; }
  body.portal .pt-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  body.portal .pt-toolbar::-webkit-scrollbar { display: none; }
  body.portal .pt-toolbar .pt-btn, body.portal .pt-toolbar a { flex: 0 0 auto; white-space: nowrap; }
  body.portal .pt-toggle button { padding: 9px 14px; }
  body.portal form.pt-toolbar { flex-wrap: wrap; overflow: visible; }
  body.portal form.pt-toolbar .pt-field { flex: 1 1 140px; min-width: 0; }
  body.portal .pt-page input[type=date] { min-width: 0; width: 100%; }
  body.portal .pt-contact-photo { min-height: 132px; flex-basis: auto; }
  body.portal .pt-contact-initials { width: 76px; height: 76px; font-size: 26px; }
  body.portal .pt-contact-body { padding: 22px 20px; }
  body.portal .pt-contact h2 { font-size: 21px; }
  body.portal .pt-jd > summary { padding: 14px 4px; }
  body.portal .pt-jd-body { padding: 4px 4px 18px; }
}

/* ---- second pass, 16 Nov 2026 ------------------------------------------------ */
/* The not-found and not-yours page (error.html) is the one page built from the
   .ui-* foundation components. The link colour above outranked .ui-btn, so its
   amber button read pale blue on amber. Buttons take the same inks and pill
   shape as .pt-btn, and the card loses its hairline like every other card. */
body.portal a.ui-btn { border-radius: 999px; font-weight: 700; text-decoration: none; padding-left: 20px; padding-right: 20px; }
body.portal a.ui-btn--primary, body.portal a.ui-btn--primary:hover { color: var(--pos-gold-ink); text-decoration: none; }
body.portal.theme-light a.ui-btn--primary, body.portal.theme-light a.ui-btn--primary:hover { color: #071B2C; }
body.portal a.ui-btn--secondary { color: var(--pos-text-strong); background: var(--ptm-soft); border-color: transparent; }
body.portal a.ui-btn--secondary:hover { color: var(--pos-text-strong); text-decoration: none; }
body.portal .ui-card.ui-state { border: 0; border-radius: 18px; box-shadow: var(--pos-shadow); }

/* Your properties: the rating-list buttons and the view buttons share one line
   on desktop (Ben, 16 Nov 2026: button groups on one line, no unnecessary
   spacing). Only when the two toolbars are adjacent: with a list chosen, the
   sentence about that list sits between them and both keep their own rows.
   From 1200 wide, where all three groups fit; narrower desktops keep two rows. */
@media (min-width: 1200px) {
  body.portal .pt-toolbar:has(+ .pt-toolbar [data-prop-mode]) { float: left; margin: 0 12px 0 0 !important; }
}

/* Phone: the three rating-list buttons stay on screen together, on one row (Ben, 16 Nov 2026: tab titles are one
   row only). The words "rating list" hide, leaving "Both lists", "2026-2029" and "2023-2026"; the group is
   labelled "Rating list". A sideways-scrolling row was tried and hid the 2023 list off screen.
   The id is needed: properties.css sizes these with #pt-properties. */
@media (max-width: 600px) {
  body.portal #pt-properties .pt-toggle > a.pt-btn { flex: 1 1 0; padding: 6px 8px; font-size: 14px; white-space: nowrap; text-align: center; justify-content: center; }
  body.portal #pt-properties .pt-toggle > a.pt-btn .pt-cycle-word { display: none; }
  body.portal #pt-properties .pt-toggle:has(> a.pt-btn) { flex-wrap: nowrap; gap: 6px; }
  /* Add a property: "Search the rating list" and "Enter the address" side by side, one row each. */
  body.portal .pt-addprop .pt-tabs, body.portal #pt-properties .pt-addprop .pt-tabs { flex-wrap: nowrap; gap: 0; }
  body.portal .pt-addprop .pt-tabs button, body.portal #pt-properties .pt-addprop .pt-tabs > button { flex: 1 1 auto; padding: 9px 8px; font-size: 13.5px; white-space: nowrap; }
}
/* Your cases on a phone: the action under each property stays on one row ("Questions and evidence for this
   property" broke in two at 390). */
@media (max-width: 600px) {
  body.portal .pt-j-actions > a.pt-btn { white-space: nowrap; font-size: clamp(12px, 3.7vw, 14px); padding-left: 10px; padding-right: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: block; text-align: center; align-content: center; }
}
/* Below 340px the two labels cannot share a row at a readable size, so they may break rather than clip. */
@media (max-width: 339.98px) {
  body.portal .pt-addprop .pt-tabs button, body.portal #pt-properties .pt-addprop .pt-tabs > button { white-space: normal; line-height: 1.2; }
  body.portal .pt-j-actions > a.pt-btn { white-space: normal; line-height: 1.2; }
}
}

/* ---- third pass, 17 Nov 2026 --------------------------------------------------
   Ben, 17 Nov: "the main menu items should be on the same row as where the logo
   is and schedule a call. You can remove the my account text under the logo,
   making the logo have more space to be a bit larger in size."
   One header row on desktop: logo, menu, then the account controls. The menu
   takes the room between them; when the screen is too narrow for every title it
   scrolls inside itself with the fade base.html already manages (is-overflowing),
   so no title wraps and none is removed. One row from 1280 wide. The "My Account" line is hidden, not
   deleted from base.html: test_lm1_flag_off forbids removing header lines, and
   the sign-in pages keep it. Phones keep their own header (portal_mobile.css). */
@media (min-width: 1280px) {
  body.portal .pt-header { flex-wrap: nowrap; align-items: center; column-gap: 8px; padding-top: 8px; padding-bottom: 8px; min-height: 60px; }
  body.portal .pt-header > .pt-nav { order: 0; flex: 1 1 auto; width: auto; margin-left: 6px; }
  body.portal .pt-header > .pt-spacer { display: none; }
  :where(body.portal) .pt-header .pt-nav a, :where(body.portal) .pt-header .pt-dd > summary { padding: 6px 9px; font-size: 14px; }
  /* The controls give width to the menu: same 44px height, less padding. */
  :where(body.portal) .pt-header > .pt-schedule { padding-left: 14px; padding-right: 14px; }
  :where(body.portal) .pt-header > .pt-company { max-width: 170px; }
}
/* Up to 1800 wide the signed-in name gives its room to the menu; the company
   switcher beside it already says whose account this is. */
@media (min-width: 1280px) and (max-width: 1799.98px) {
  body.portal .pt-header > .pt-user { display: none; }
}
/* Laptops under 1280 keep the menu on its own row: on one row only three or four
   of the fourteen titles would show. The logo change applies at every desktop width. */
@media (min-width: 1024px) {
  body.portal .pt-header > .pt-wordmark .sub { display: none; }
  body.portal .pt-header .pt-logo { height: 36px; }
}

/* Your properties, phone: the progress steps read dot then label again. A phone
   script (portal_mobile.js, collapseNarrowGrids) forces any grid with a column
   under its minimum to a single column, inline and important, and the 18px dot
   column tripped it: labels fell to the right-hand edge, a card's width from their
   dots. A step is therefore not a grid here: the dot is placed, the text is padded. */
@media (max-width: 720px) {
  body.portal #pt-cards .pt-ribbon .rstep { display: block !important; position: relative; padding-left: 36px; }
  body.portal #pt-cards .pt-ribbon .rdot { position: absolute; left: 0; top: 0; margin: 0; }
  body.portal #pt-cards .pt-ribbon .rstep:not(:last-child)::after { left: 10px; top: 22px; }
}

/* Your onboarding journey: the round marks are whole (Ben, 17 Nov: "some round
   icons that are cut off at the top"). The strip clips its overflow to hide the
   connector's reach on a wrapped row, and that also cut the 5px ring this layer
   puts round a "Your turn" mark. The strip gets room for the ring on every side. */
body.portal .pt-jstrip { padding: 7px 7px 0; margin-left: -7px; margin-right: -7px; }
@media (max-width: 1023.98px) {
  body.portal .pt-jstep .pt-jmark { flex: 0 0 auto; }
}

/* Nothing moves when a page or a filter changes (Ben, 17 Nov: "no vertical
   sliding", "the page judders"). The window keeps room for its scroll bar whether
   or not the page is long enough to need one, so content no longer shifts
   sideways between a short page and a long one; strips that scroll sideways
   cannot also be dragged up and down. portal.js
   keeps the menu and the reading position in place (same date). */
/* Desktop only: on a phone the assistant sheet is sized from the viewport width, and a reserved gutter put it 3px off the left edge (test_portal_assistant_placement). Phones use overlay scroll bars anyway. */
@media (min-width: 1024px) { html { scrollbar-gutter: stable; } }
/* Selected and unselected buttons in a toggle are the same width: one weight, colour alone marks the choice.
   A 600 and a 700 label differ by a pixel or two, enough to nudge everything to their right on each press. */
body.portal .pt-toggle > .pt-btn, body.portal .pt-toggle > .pt-btn.ghost { font-weight: 700; }
/* Your properties: the intro keeps to one line on desktop whichever list is chosen ("Showing the
   2026-2029 rating list only." used to wrap to a second line and push the buttons down). */
@media (min-width: 1200px) { body.portal #pt-properties > .pt-page-sub:first-of-type { max-width: none; } }
body.portal .pt-nav { overflow-y: hidden; }
@media (max-width: 1023.98px) { body.portal .pt-toolbar { overflow-y: hidden; } }
body.portal .pt-nav.pt-nav--grouped { overflow-y: visible; }

/* A page fits the screen where it can (Ben, 17 Nov: "vertical scroll bar (make sure the content just fits
   the page where possible)"). On desktop the first version of this layer spent about 170px of every page on
   air: a 34px title, 28px under the intro, 28px card padding, 64px under the last card and a 40px footer.
   With the one-row header these values bring the short pages (Book a call, Invoices, Cases, the estimator
   with nothing entered) inside a 1440 by 900 window; long pages still scroll, as they must. Phones keep
   their own spacing. */
@media (min-width: 1024px) {
  body.portal .pt-page { padding-top: 18px; padding-bottom: 20px; }
  body.portal .pt-page h1, body.portal .pt-page-title { font-size: 28px; margin-bottom: 4px; }
  body.portal .pt-page-sub, body.portal .pt-page h1 + p { font-size: 16px; margin-bottom: 14px; }
  body.portal .pt-card { padding: 20px 22px; margin-bottom: 14px; }
  body.portal .pt-card h2 { font-size: 19px; }
  body.portal .pt-card .pt-card-sub, body.portal .pt-card > h2 + p { margin-bottom: 12px; }
  body.portal .pt-card .pt-card { padding: 16px; }
  body.portal .pt-footer { padding-top: 8px; padding-bottom: 14px; font-size: 13px; }
}

/* ---- Account manager standing in the amber panel (Ben, 17 Nov 2026) --------------------------------------
   A manager with a studio cut-out (fixed lookup in _manager_card.html) stands in the panel with the amber as
   the background. The panel keeps its shape, curve and gradient; the picture is a layer inside it, so the
   panel's own clip-path and the card's rounded corners do all the cropping and no box, circle or cut edge
   shows. Ben's reference: panel 340px high, picture 300px wide, 17px from the left, 34px from the top. All
   three scale with the panel's height (container units), because the card grows with its text.
   Two rules decide the placing. The file is cut straight on its left below 83 per cent of its height and on
   its right below 67 per cent. So (1) the card's bottom edge crosses the picture at 82 per cent, above the
   left cut; and (2) the picture's right edge is never left of the panel's right edge less 2px, which is
   outside the curve everywhere below the 67 per cent line, so the right shoulder tucks under the curve. On
   a short card rule 2 moves him right of the 17px mark; Ben allowed for that.
   The picture is absolutely placed, so the page does not move while it loads. */
body.portal .pt-contact-photo--standing { container-type: size; align-items: stretch; }
body.portal .pt-contact-photo--standing .pt-contact-initials { display: none; }
body.portal .pt-contact-photo .pt-contact-standing {
  position: absolute; display: block; margin: 0; max-width: none; width: auto; aspect-ratio: var(--pt-photo-ratio, 1124 / 1399); object-fit: contain;
  top: 23px; left: 53px; height: 253px;                               /* browsers without container units: a 230px card */
  filter: drop-shadow(0 6px 10px rgba(11, 29, 48, .22));
}
@supports (container-type: size) {
  /* Placing from the photo's own numbers (staff photo field, 17 Nov 2026): the card's bottom edge crosses the
     figure one per cent above its left cut line, and the panel's curve hides the right cut. A photo with no cut
     line fills the panel height. Dominic's numbers (0.83, 600 / 747) give the same placing as before. */
  body.portal .pt-contact-photo .pt-contact-standing {
    --pt-stand-h: calc(90cqh / (var(--pt-cut-left, 1) - .01));
    top: 10cqh; height: var(--pt-stand-h);
    left: max(5cqh, calc(100cqw - var(--pt-stand-h) * var(--pt-photo-ratio, 1124 / 1399) - 2px));
  }
}
/* Phone: the amber area is a band across the top of the card with a curved bottom edge, and no edge of it can
   hide the picture's right-hand cut. So the bottom edge crosses him at 66 per cent, just above that cut and
   below his collar, which hides both cuts wherever he stands. 16px of amber above his hair, centred. */
@media (max-width: 720px) {
  body.portal .pt-contact-photo--standing { min-height: 216px; height: 216px; flex: 0 0 216px; }
  /* Fixed sizes here: the band's height is set, not grown from text, and container units read 0 against a
     height that comes from min-height. For Dominic (0.67) this is 303px: (216 - 16) / 0.66. */
  body.portal .pt-contact-photo .pt-contact-standing { top: 16px; left: 50%; transform: translateX(-50%); height: calc(200px / (var(--pt-cut-right, 1) - .01)); }
}

/* UI, 19 Nov 2026: the buttons under an onboarding step sit on one line (Ben, 16 Nov: button groups on one line).
   Text, upload forms and notes keep the full width; each button form and action group sits beside the next. */
body.portal .pt-jd-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body.portal .pt-jd-body > :is(p, .pt-upload-form, .pt-j-waiting, div:not(.pt-j-actions)) { flex: 1 1 100%; margin-bottom: 0; }
body.portal .pt-jd-body > form:not(.pt-upload-form), body.portal .pt-jd-body > .pt-j-actions { flex: 0 1 auto; min-width: 0; margin: 0; }
@media (max-width: 1023.98px) {
  body.portal .pt-jd-body > form:not(.pt-upload-form), body.portal .pt-jd-body > .pt-j-actions { flex: 1 1 0; }
  body.portal .pt-jd-body > form:not(.pt-upload-form) > .pt-btn, body.portal .pt-jd-body > .pt-j-actions > .pt-btn { width: 100%; padding-inline: 10px; white-space: nowrap; }
}
@media (max-width: 359.98px) {
  body.portal .pt-jd-body > form:not(.pt-upload-form) > .pt-btn, body.portal .pt-jd-body > .pt-j-actions > .pt-btn { white-space: normal; line-height: 1.2; }
}
