/* =============================================================
   CLIENT PORTAL SHELL (v4 layout)
   Dashboard ([bsa_portal_dashboard]) and My Account ([bsa_account_page]).
   Markup: bluesilver-advisory-core/includes/portal/portal-shell.php
           + includes/shortcodes/portal-dashboard.php
   Behaviour: bluesilver-advisory-core/assets/js/portal/portal.js

   The page scrolls normally — no viewport height locks. Only the resource
   viewer on wide screens is a sticky, fixed-height pane.

   Breakpoints (keep in sync with portal.js):
     < 600px      phone   — bottom tab bar, single pane
     600–1023px   tablet  — top nav, single pane (list OR viewer)
     ≥ 1024px     laptop  — list + viewer side by side
     ≥ 1280px     wide    — roomier columns
   ============================================================= */

.bsa-p4 {
	--p4-font: inherit;            /* body font follows the website (PT Serif) */
	--p4-ls: 0.03em;               /* letter spacing: PT Serif reads cramped at the portal's smaller sizes */
	--p4-navy: #0F1F38;
	--p4-navy-2: #1A2E44;
	--p4-navy-line: #2B425C;
	--p4-primary: #2C5F8A;
	--p4-sky: #A8C4DE;
	--p4-text: #0F1F38;
	--p4-body: #3A5068;
	--p4-muted: #5B6B7C;
	--p4-border: #DDE4EC;
	--p4-bg: #F4F5F7;
	--p4-card: #FFFFFF;
	--p4-header-h: 102px;          /* same as the website header */
	--p4-tabbar-h: 0px;
	--p4-gutter: clamp(16px, 3.3vw, 48px);
	--p4-admin-h: var(--wp-admin--admin-bar--height, 0px);
	--p4-sticky-top: calc(var(--p4-admin-h) + var(--p4-header-h));
	--p4-gap-top: 48px;            /* space between the header and every page's content */

	/* Type scale matching the website: PT Serif, 16px body on desktop easing down to
	   ~14px on phones (same curve as the site's fluid body text). Headings stay bold. */
	--p4-fs-xs:   clamp(12.5px, 12.1px + 0.11vw, 14px);
	--p4-fs-sm:   clamp(13.5px, 12.97px + 0.15vw, 15px);
	--p4-fs-base: clamp(14px, 13.46px + 0.176vw, 16px);
	--p4-fs-lg:   clamp(15px, 13.9px + 0.29vw, 18px);
	--p4-fs-h3:   clamp(17px, 16.2px + 0.26vw, 20px);
	--p4-fs-h2:   clamp(20px, 18.5px + 0.35vw, 24px);
	--p4-fs-h1:   clamp(24px, 21.6px + 0.62vw, 32px);
	/* Website header: menu links (nav block setting) and the Client Login button */
	--p4-fs-nav:  clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.417), 18px);
	--p4-fs-hbtn: clamp(14px, 13.34px + 0.207vw, 16px);
}

/* ---- Hide marketing chrome and undo page wrappers ---- */
body:has(.bsa-p4) .bsa-header,
body:has(.bsa-p4) .bsa-footer,
body:has(.bsa-p4) .bsa-whatsapp-btn,
body:has(.bsa-p4) .bsa-page-hero {
	display: none !important;
}

html:has(.bsa-p4),
body:has(.bsa-p4) {
	overflow-x: clip;
	background: #F4F5F7;
}

body:has(.bsa-p4) .wp-site-blocks {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	row-gap: 0 !important;
}

body:has(.bsa-p4) .bsa-section,
body:has(.bsa-p4) .bsa-section--light {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

body:has(.bsa-p4) main.wp-block-group,
body:has(.bsa-p4) .wp-block-post-content {
	background: #F4F5F7;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* Full-bleed: --bsa-sbw (scrollbar width) is set inline before paint. */
.bsa-p4 {
	box-sizing: border-box;
	width: calc(100vw - var(--bsa-sbw, 0px));
	max-width: none !important;
	margin-left: calc(50% - (100vw - var(--bsa-sbw, 0px)) / 2) !important;
	margin-right: 0 !important;
	margin-top: 0 !important;
	min-height: calc(100dvh - var(--p4-admin-h));
	display: flex;
	flex-direction: column;
	background: var(--p4-bg);
	color: var(--p4-text);
	font-family: var(--p4-font);
	font-size: var(--p4-fs-base);
	font-weight: 300;              /* website body weight */
	letter-spacing: var(--p4-ls);
	line-height: 1.65;             /* website body line height */
	padding-bottom: var(--p4-tabbar-h);
}

.bsa-p4 *,
.bsa-p4 *::before,
.bsa-p4 *::after { box-sizing: border-box; }

.bsa-p4 [hidden] { display: none !important; }

/* Form controls reset letter spacing in the browser's own styles; take the portal's */
.bsa-p4 :where(input, select, textarea, button) { letter-spacing: inherit; }

/* Zero specificity so component link colours (buttons, account cards) still win */
:where(.bsa-p4) a { color: var(--p4-primary); }
:where(.bsa-p4) a:hover { color: var(--p4-navy); }

.bsa-p4 :focus-visible {
	outline: 3px solid #4A7FA5;
	outline-offset: 2px;
}

/* The parent theme outlines anything focused in its text colour, which leaves a white
   box on header links after a click. Clicks get no outline; keyboard focus keeps a ring. */
.bsa-p4 :focus:not(:focus-visible) { outline: none; }

.bsa-p4-header :focus-visible {
	outline: 2px solid var(--p4-sky);
	outline-offset: 3px;
}

.bsa-p4 h1, .bsa-p4 h2, .bsa-p4 h3 {
	font-family: 'PT Serif', Georgia, serif;
	font-weight: 700;   /* site global styles make headings light; the portal uses bold */
	color: var(--p4-text);
	margin: 0;
	line-height: 1.25;
}

/* =============================================================
   HEADER
   ============================================================= */

.bsa-p4-header {
	position: sticky;
	top: var(--p4-admin-h);
	z-index: 900;
	background: var(--p4-navy);
	color: #FFFFFF;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 16px rgba(3, 18, 43, 0.18);
}

.bsa-p4-header__inner {
	position: relative;
	max-width: 1440px;
	height: var(--p4-header-h);
	margin: 0 auto;
	padding: 0 var(--p4-gutter);
	display: flex;
	align-items: center;
	gap: 24px;
}

.bsa-p4-brand {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	border-radius: var(--bsa-radius, 10px);
	text-decoration: none;
	color: #FFFFFF !important;
}

/* Website logo image, shown as-is and at the website header's size (221 × 70) */
.bsa-p4-brand__logo img {
	display: block;
	width: auto !important;
	height: 70px !important;
	max-width: none;
	object-fit: contain;
}

/* Logo height; header.js trims its empty margins (style.css, "SITE LOGO") */
.bsa-p4-brand__logo { --bsa-logo-h: 52px; }

@media (max-width: 767.98px) {
	.bsa-p4-brand__logo { --bsa-logo-h: 40px; }
}

/* Portal logo (Settings → Portal Logo): notebook icon + wordmark, already trimmed.
   Full logo on laptops, tablets and phones; on 600–767px, where the menu sits
   beside it, only the notebook shows (the box crops the image to the icon). */
.bsa-p4-brand__logo.bsa-p4-brand__logo--portal { display: block; overflow: hidden; }
.bsa-p4-brand__logo.bsa-p4-brand__logo--portal img { height: 46px !important; width: auto !important; max-width: none; }

@media (max-width: 1023.98px) {
	.bsa-p4-brand__logo.bsa-p4-brand__logo--portal img { height: 38px !important; }
}

@media (min-width: 600px) and (max-width: 767.98px) {
	.bsa-p4-brand__logo.bsa-p4-brand__logo--portal { width: 34px; }
	.bsa-p4-brand__logo.bsa-p4-brand__logo--portal img { height: 42px !important; }
}

@media (max-width: 599.98px) {
	.bsa-p4-brand__logo.bsa-p4-brand__logo--portal img { height: 36px !important; }
}

/* Fallback when no logo is set in Site Identity */
.bsa-p4-brand__text {
	font-family: 'PT Serif', Georgia, serif;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	color: #FFFFFF;
	display: flex;
	flex-direction: column;
	white-space: nowrap;
}

.bsa-p4-brand__text small {
	font-family: var(--p4-font);
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.42em;
	color: var(--p4-sky);
	margin-top: 4px;
	text-transform: uppercase;
}

.bsa-p4-nav {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.bsa-p4-nav__item {
	display: flex;
	align-items: center;
	gap: 0;
	min-height: 44px;
	padding: 0 14px;
	border-radius: var(--bsa-radius, 10px);
	color: rgba(255, 255, 255, 0.85) !important;   /* website header links */
	text-decoration: none;
	font-size: var(--p4-fs-nav);
	font-weight: 400;
	letter-spacing: 0.02em;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}

.bsa-p4-nav__item:hover { background: var(--p4-navy-2); color: #FFFFFF !important; }

.bsa-p4-nav__item[aria-current="page"] {
	background: var(--p4-navy-2);
	color: #FFFFFF !important;
}

.bsa-p4-search {
	position: relative;
	flex: 1 1 auto;
	max-width: 420px;
	min-width: 0;
	height: 42px;
	padding: 0 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-radius: var(--bsa-radius, 10px);
	background: var(--p4-navy-2);
	border: 1px solid var(--p4-navy-line);
	color: var(--p4-sky);
}

.bsa-p4-search:focus-within {
	border-color: #4A7FA5;
	box-shadow: 0 0 0 3px rgba(74, 127, 165, 0.35);
}

.bsa-p4-search__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	color: #FFFFFF !important;
	font: inherit;
	font-size: var(--p4-fs-hbtn);
	padding: 0 !important;
	-webkit-appearance: none;
	appearance: none;
}

.bsa-p4-search__input::placeholder { color: #8FA6BD; }
.bsa-p4-search__input::-webkit-search-cancel-button { display: none; }

.bsa-p4-search__close {
	display: none;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: var(--bsa-radius, 10px);
	background: transparent;
	color: #C9D6E3;
	cursor: pointer;
	align-items: center;
	justify-content: center;
}

.bsa-p4-search .bsa-resource-suggestions {
	top: calc(100% + 8px);
	border-radius: var(--bsa-radius, 10px);
	padding: 6px;
	max-height: min(60vh, 380px);
	color: var(--p4-text);
}

.bsa-p4-search .bsa-resource-suggestion { min-height: 44px; border-radius: var(--bsa-radius, 10px); }
.bsa-p4-search .bsa-resource-suggestion__title { font-size: var(--p4-fs-base); }
.bsa-p4-search .bsa-resource-suggestion__type { font-size: var(--p4-fs-xs); }

.bsa-p4-header__end {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.bsa-p4-account {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 2px 12px 2px 2px;
	border-radius: var(--bsa-radius, 10px);
	color: #FFFFFF !important;
	text-decoration: none;
	font-size: var(--p4-fs-hbtn);
	font-weight: 500;
	letter-spacing: 0.02em;
}

.bsa-p4-account:hover,
.bsa-p4-account[aria-current="page"] { background: var(--p4-navy-2); }

.bsa-p4-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #4A7FA5;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	flex-shrink: 0;
}

.bsa-p4-icon-btn {
	width: 44px;
	height: 44px;
	border-radius: var(--bsa-radius, 10px);
	border: 1px solid var(--p4-navy-line);
	background: transparent;
	color: #C9D6E3 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s;
}

.bsa-p4-icon-btn:hover { background: var(--p4-navy-2); color: #FFFFFF !important; }

.bsa-p4-search-toggle { display: none; }

/* =============================================================
   MAIN + VIEWS
   ============================================================= */

.bsa-p4-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: var(--p4-gap-top) var(--p4-gutter) 40px;
}

.bsa-p4-view { display: none; }
.bsa-p4-view.is-active { display: block; animation: bsa-p4-fade 0.18s ease-out; }

@keyframes bsa-p4-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.bsa-p4-view.is-active { animation: none; }
}

/* ---- Shared bits ---- */
.bsa-p4-card {
	background: var(--p4-card);
	border: 1px solid var(--p4-border);
	border-radius: var(--bsa-radius, 10px);
}

.bsa-p4-eyebrow {
	margin: 0;
	font-size: var(--p4-fs-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--p4-muted);
	display: flex;
	align-items: center;
	gap: 8px;
}

.bsa-p4-muted { margin: 0; font-size: var(--p4-fs-base); color: var(--p4-body); line-height: 1.5; }
.bsa-p4-empty { margin: 0; padding: 24px; font-size: var(--p4-fs-base); color: var(--p4-muted); background: var(--p4-card); border: 1px dashed var(--p4-border); border-radius: var(--bsa-radius, 10px); }

.bsa-p4-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.bsa-p4-section-head h2 { font-size: var(--p4-fs-h2); }
.bsa-p4-section-head a { font-size: var(--p4-fs-base); font-weight: 600; text-decoration: none; white-space: nowrap; }

.bsa-p4-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border-radius: var(--bsa-radius, 10px);
	font: inherit;
	font-size: var(--p4-fs-base);
	font-weight: 500;   /* website button weight */
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.bsa-p4-btn--dark { background: var(--p4-navy); color: #FFFFFF !important; border: 1px solid var(--p4-navy); }
.bsa-p4-btn--dark:hover { background: var(--p4-primary); border-color: var(--p4-primary); }
.bsa-p4-btn--outline { background: #FFFFFF; color: var(--p4-navy) !important; border: 1px solid #C9D3DE; }
.bsa-p4-btn--outline:hover { border-color: var(--p4-primary); color: var(--p4-primary) !important; }
/* WhatsApp: a deeper WhatsApp green, brightening to the floating button's #25D366 on hover */
.bsa-p4-btn--whatsapp { background: #1EBE5D; color: #FFFFFF !important; border: 1px solid #1EBE5D; }
.bsa-p4-btn--whatsapp:hover { background: #25D366; border-color: #25D366; }
.bsa-p4-btn--block { width: 100%; }

.bsa-p4-tile-icon {
	width: 44px;
	height: 44px;
	border-radius: var(--bsa-radius, 10px);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: #E3EDF6;
	color: var(--p4-primary);
}

.bsa-p4-tile-icon svg { width: 22px; height: 22px; }
.bsa-p4-tile-icon--calc       { background: #E5F1EA; color: #2F6B4F; }
.bsa-p4-tile-icon--diagnostic { background: #FCEFE2; color: #8A4A0F; }
.bsa-p4-tile-icon--video      { background: #EEE8F6; color: #5B3E8A; }
.bsa-p4-tile-icon--url        { background: #E8EDF2; color: var(--p4-navy-2); }

/* =============================================================
   HOME
   ============================================================= */

.bsa-p4-home-top {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.bsa-p4-home-top > * { flex: 1 1 300px; min-width: 0; }
.bsa-p4-home-top > .bsa-p4-welcome { flex: 1.4 1 380px; }

.bsa-p4-welcome {
	background: linear-gradient(115deg, #050E1A 0%, var(--p4-navy) 55%, #1A3A5C 100%);
	border-radius: var(--bsa-radius, 10px);
	padding: 24px 28px;
	color: #FFFFFF;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
}

.bsa-p4-welcome__date { margin: 0; font-size: var(--p4-fs-sm); font-weight: 600; letter-spacing: 0.04em; color: var(--p4-sky); }
.bsa-p4-welcome__title { margin-top: 6px !important; font-size: var(--p4-fs-h1); color: #FFFFFF !important; }

.bsa-p4-welcome__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	font-size: var(--p4-fs-base);
	color: #DCE7F2;
}

.bsa-p4-welcome__meta strong { color: #FFFFFF; }

.bsa-p4-score {
	padding: 20px 24px;
	display: flex;
	align-items: center;
	gap: 20px;
}

.bsa-p4-ring {
	--pct: 0;
	position: relative;
	width: 104px;
	height: 104px;
	flex-shrink: 0;
	border-radius: 50%;
	background: conic-gradient(var(--p4-primary) calc(var(--pct) * 1%), #E3EDF6 0);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.bsa-p4-ring::before {
	content: '';
	position: absolute;
	inset: 10px;
	border-radius: 50%;
	background: #FFFFFF;
}

.bsa-p4-ring__value,
.bsa-p4-ring__label { position: relative; }
.bsa-p4-ring__value { font-family: 'PT Serif', Georgia, serif; font-size: 28px; font-weight: 700; line-height: 1; }
.bsa-p4-ring__label { margin-top: 3px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--p4-muted); text-transform: uppercase; }

.bsa-p4-score__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.bsa-p4-score__body h2 { font-size: var(--p4-fs-h3); }
.bsa-p4-score__body p { margin: 0; font-size: var(--p4-fs-base); color: var(--p4-body); line-height: 1.45; }
.bsa-p4-score__body > a:not(.bsa-p4-btn) { font-size: var(--p4-fs-base); font-weight: 600; text-decoration: none; }

.bsa-p4-band { padding: 3px 10px; border-radius: var(--bsa-radius, 10px); font-size: var(--p4-fs-xs); font-weight: 700; }
.bsa-p4-band--5 { background: #E3F3E9; color: #1E6B3C; }
.bsa-p4-band--4 { background: #E1F2EC; color: #0D5E41; }
.bsa-p4-band--3 { background: #FDF3DC; color: #7A4A06; }
.bsa-p4-band--2 { background: #FCEFE2; color: #8A4A0F; }
.bsa-p4-band--1 { background: #FBE6E6; color: #8E1F1F; }

.bsa-p4-continue {
	padding: 20px 24px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 14px;
}

.bsa-p4-continue__row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bsa-p4-continue__title { font-family: 'PT Serif', Georgia, serif; font-size: var(--p4-fs-lg); font-weight: 700; line-height: 1.3; }
.bsa-p4-continue .bsa-p4-btn { align-self: flex-start; }

.bsa-p4-home-grid {
	margin-top: 28px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	align-items: start;
}

.bsa-p4-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.bsa-p4-res-card {
	background: var(--p4-card);
	border: 1px solid var(--p4-border);
	border-radius: var(--bsa-radius, 10px);
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.bsa-p4-res-card:hover {
	border-color: #B8C8D8;
	box-shadow: 0 8px 22px rgba(15, 31, 56, 0.08);
}

.bsa-p4-res-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

.bsa-p4-flag {
	padding: 3px 9px;
	border-radius: var(--bsa-radius, 10px);
	background: #E8EDF2;
	color: var(--p4-navy-2);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.bsa-p4-res-card__kind { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--p4-primary); }
.bsa-p4-res-card[data-ct="calc"] .bsa-p4-res-card__kind { color: #2F6B4F; }
.bsa-p4-res-card[data-ct="diagnostic"] .bsa-p4-res-card__kind { color: #8A4A0F; }
.bsa-p4-res-card[data-ct="video"] .bsa-p4-res-card__kind { color: #5B3E8A; }

.bsa-p4-res-card__title { font-size: var(--p4-fs-lg); line-height: 1.3; }
.bsa-p4-res-card__desc { margin: 0; font-size: var(--p4-fs-sm); color: var(--p4-muted); line-height: 1.45; }

.bsa-p4-res-card__foot {
	margin-top: auto;
	padding-top: 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.bsa-p4-res-card__foot > a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: var(--p4-fs-base);
	font-weight: 700;
	text-decoration: none;
}

/* Favourite star as a square button inside cards */
.bsa-p4-res-card .bsa-resource-favorite {
	position: static;
	width: 44px;
	height: 44px;
	border-radius: var(--bsa-radius, 10px);
	border: 1px solid var(--p4-border);
	background: #FFFFFF;
}

.bsa-p4-res-card .bsa-resource-favorite svg { width: 19px; height: 19px; }

.bsa-p4-upgrade {
	grid-column: 1 / -1;
	background: #EEF3F8;
	border: 1px dashed #8FA9C2;
	border-radius: var(--bsa-radius, 10px);
	padding: 18px 22px;
	display: flex;
	align-items: center;
	gap: 18px;
}

.bsa-p4-upgrade__icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #FFFFFF;
	color: var(--p4-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bsa-p4-upgrade > div { flex: 1; min-width: 0; }
.bsa-p4-upgrade h3 { font-size: var(--p4-fs-lg); }
.bsa-p4-upgrade p { margin: 4px 0 0; font-size: var(--p4-fs-base); color: var(--p4-body); }

.bsa-p4-home-aside { display: flex; flex-direction: column; gap: 16px; }

.bsa-p4-aside-card {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bsa-p4-aside-card h2 { font-size: var(--p4-fs-h3); }
.bsa-p4-aside-card h3 { font-size: var(--p4-fs-lg); }

.bsa-p4-saved-mini { display: flex; flex-direction: column; gap: 4px; }
.bsa-p4-saved-mini:empty { display: none; }

.bsa-p4-saved-mini__item {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 6px 8px;
	margin: 0 -8px;
	border-radius: var(--bsa-radius, 10px);
	color: var(--p4-text) !important;
	text-decoration: none;
	font-size: var(--p4-fs-base);
	font-weight: 600;
	line-height: 1.3;
}

.bsa-p4-saved-mini__item:hover { background: #EFF4F9; }
.bsa-p4-saved-mini__item .bsa-resource-item__type-icon svg { width: 16px; height: 16px; }
.bsa-p4-saved-mini__more { font-size: var(--p4-fs-base); font-weight: 600; text-decoration: none; padding-top: 4px; }

/* =============================================================
   RESOURCES (list + viewer)
   ============================================================= */

.bsa-p4-res {
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.bsa-p4-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.bsa-p4-chip {
	min-height: 40px;
	padding: 0 14px;
	border-radius: var(--bsa-radius, 10px);
	border: 1px solid #C9D3DE;
	background: #FFFFFF;
	color: var(--p4-navy-2);
	font: inherit;
	font-size: var(--p4-fs-sm);
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.bsa-p4-chip:hover { border-color: var(--p4-primary); }
.bsa-p4-chip[aria-pressed="true"] { background: var(--p4-navy); border-color: var(--p4-navy); color: #FFFFFF; }

/* Lists: natural height, card look (overrides portal.css column rules) */
.bsa-p4 .bsa-resource-list {
	flex: none;
	min-height: 0;
	overflow: visible;
	display: block;
}

.bsa-p4 .bsa-p4-list {
	background: var(--p4-card);
	border: 1px solid var(--p4-border);
	border-radius: var(--bsa-radius, 10px);
	overflow: hidden;
}

.bsa-p4 .bsa-p4-list:empty { display: none; }

.bsa-p4 button.bsa-resource-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 64px;
	padding: 14px 56px 14px 16px;
	background: #FFFFFF;
	border: 0;
	border-bottom: 1px solid #EEF1F4;
	border-left: 3px solid transparent;
	font: inherit;
	color: inherit;
}

.bsa-p4 button.bsa-resource-item:last-child { border-bottom: 0; }
.bsa-p4 button.bsa-resource-item:hover { background: #F4F8FB; border-left-color: var(--p4-sky); }
.bsa-p4 button.bsa-resource-item.is-active { background: #E9F1F8; border-left-color: var(--p4-primary); }

.bsa-p4 .bsa-resource-item__meta { margin: 0; flex-wrap: wrap; }
.bsa-p4 .bsa-resource-item__title { font-size: var(--p4-fs-base); font-weight: 600; }
.bsa-p4 .bsa-resource-item__badge { font-size: 12px; }
.bsa-p4 .bsa-resource-item__period { font-size: var(--p4-fs-xs); }

.bsa-p4 .bsa-resource-list .bsa-resource-favorite {
	top: 50%;
	right: 8px;
	width: 44px;
	height: 44px;
	transform: translateY(-50%);
}

.bsa-p4 .bsa-resource-list .bsa-resource-favorite svg { width: 19px; height: 19px; }

/* Viewer: sticky pane beside the list on laptops */
.bsa-p4 .bsa-portal-col3.bsa-p4-viewer {
	display: flex;
	flex-direction: column;
	position: sticky;
	top: calc(var(--p4-sticky-top) + 16px);
	height: calc(100dvh - var(--p4-sticky-top) - 32px);
	min-height: 460px;
	background: #F8F9FB;
	border: 1px solid var(--p4-border);
	border-radius: var(--bsa-radius, 10px);
	overflow: hidden;
	animation: none;
	/* Calculators and the diagnostic size themselves to the space beside the list. */
	container: p4viewer / inline-size;
}

/* Nothing open yet: a normal-height card, so the page doesn't scroll for nothing. */
.bsa-p4 .bsa-p4-view[data-view="resources"]:not(.is-viewing) .bsa-portal-col3.bsa-p4-viewer {
	position: static;
	height: auto;
	min-height: 0;
}

.bsa-p4 .bsa-p4-view[data-view="resources"]:not(.is-viewing) .bsa-viewer-placeholder { padding: 56px 24px; }

.bsa-p4 .bsa-viewer-placeholder__types { display: none; }

/* PDF reader */
.bsa-p4-pdf { background: #E9ECEF; }

.bsa-p4-pdf__pages {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	/* Room at the bottom for the floating tools */
	padding: 16px 16px 84px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	touch-action: pan-x pan-y;
}

/* Zoomed in: pages wider than the pane scroll sideways */
.bsa-p4-pdf__pages.is-zoomed { overflow-x: auto; }

/* Width set by the zoom (--pdf-page-w, from portal.js); centred while it fits */
.bsa-p4-pdf__page {
	position: relative;
	width: var(--pdf-page-w, 100%);
	max-width: none;
	margin: 0 auto;
	background: #FFFFFF;
	box-shadow: 0 2px 10px rgba(15, 31, 56, 0.12);
	flex-shrink: 0;
}

/* Zoom and download: a floating bar at the bottom of the reader */
.bsa-p4-pdf__tools {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 2;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	border-radius: var(--bsa-radius, 10px);
	background: #000000;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
	color: #FFFFFF;
	white-space: nowrap;
}

.bsa-p4-pdf__tools[hidden] { display: none; }

.bsa-p4-pdf__tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 0;
	border-radius: var(--bsa-radius, 10px);
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: var(--p4-fs-sm);
	cursor: pointer;
	transition: background-color 0.15s;
}

.bsa-p4-pdf__tool:hover:not(:disabled),
.bsa-p4-pdf__tool:focus-visible { background: #262626; }

.bsa-p4-pdf__tool:disabled { opacity: 0.4; cursor: default; }

.bsa-p4-pdf__tool--download { padding: 0 14px; background: #2C5F8A; }
.bsa-p4-pdf__tool--download:hover:not(:disabled),
.bsa-p4-pdf__tool--download:focus-visible { background: #4A7FA5; }

.bsa-p4-pdf__zoom {
	min-width: 48px;
	text-align: center;
	font-size: var(--p4-fs-sm);
	font-variant-numeric: tabular-nums;
}

.bsa-p4-pdf__sep {
	width: 1px;
	height: 24px;
	margin: 0 6px;
	background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 480px) {
	.bsa-p4-pdf__tool--download .bsa-p4-pdf__tool-label { display: none; }
	.bsa-p4-pdf__tool--download { padding: 0 10px; }
}

.bsa-p4-pdf__page canvas { display: block; width: 100%; height: 100%; }

.bsa-p4-pdf__status {
	position: absolute;
	top: 40%;
	left: 0;
	right: 0;
	margin: 0;
	text-align: center;
	font-size: var(--p4-fs-base);
	color: var(--p4-muted);
	z-index: 1;
	pointer-events: none;
}


.bsa-p4 .bsa-pdf-mobile-link { display: flex; top: 55%; bottom: auto; }
.bsa-p4 .bsa-pdf-mobile-link[hidden] { display: none !important; }

/* Back button only matters when list and viewer don't sit side by side */
.bsa-p4 .bsa-viewer__back { display: none; }

/* =============================================================
   SAVED
   ============================================================= */

.bsa-p4-saved {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.bsa-p4-saved__col { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bsa-p4-saved__col h2 { font-size: var(--p4-fs-h3); }
.bsa-p4-saved__col .bsa-p4-list { border-radius: var(--bsa-radius, 10px); }
.bsa-p4 .bsa-resource-list-empty { padding: 16px; text-align: left; font-style: normal; font-size: var(--p4-fs-base); color: var(--p4-muted); background: var(--p4-bg); border-radius: var(--bsa-radius, 10px); }

/* =============================================================
   BOOK A CALL
   ============================================================= */

.bsa-p4-book {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 28px;
	align-items: start;
}

.bsa-p4-book__main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bsa-p4-page-title { font-size: var(--p4-fs-h1); }
.bsa-p4-lead { margin: 6px 0 0; font-size: var(--p4-fs-lg); color: var(--p4-body); }
.bsa-p4-book__step { display: flex; flex-direction: column; gap: 10px; }

.bsa-p4-step-title {
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--p4-muted) !important;
}

.bsa-p4-topics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 10px;
}

.bsa-p4-topic {
	text-align: left;
	min-height: 64px;
	padding: 12px 14px;
	border-radius: var(--bsa-radius, 10px);
	border: 1px solid #C9D3DE;
	background: #FFFFFF;
	font: inherit;
	color: var(--p4-text);
	display: flex;
	flex-direction: column;
	gap: 4px;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.bsa-p4-topic:hover { border-color: var(--p4-primary); }
.bsa-p4-topic[aria-checked="true"] { border-color: var(--p4-navy); box-shadow: inset 0 0 0 1px var(--p4-navy); }
.bsa-p4-topic__title { font-size: var(--p4-fs-base); font-weight: 700; }
.bsa-p4-topic__sub { font-size: var(--p4-fs-xs); color: var(--p4-muted); }

/* "Which report?" — shown under the topics while "Reports" is chosen */
.bsa-p4-topic-pick { display: none; flex-direction: column; gap: 6px; margin-top: 12px; max-width: 560px; }
.bsa-p4-topic-pick.is-active { display: flex; }
.bsa-p4-topic-pick label { font-size: var(--p4-fs-xs); font-weight: 700; color: var(--p4-muted); letter-spacing: 0.04em; }
.bsa-p4-topic-pick select {
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid #C9D3DE;
	border-radius: var(--bsa-radius, 10px);
	background: #FFFFFF;
	font: inherit;
	color: var(--p4-text);
	cursor: pointer;
	transition: border-color 0.15s;
}
.bsa-p4-topic-pick select:hover { border-color: var(--p4-primary); }
.bsa-p4-topic-pick select:focus-visible { outline: 2px solid var(--p4-primary); outline-offset: 2px; }

.bsa-p4-calendly {
	position: relative;
	height: 720px;
	background: #FFFFFF;
	border: 1px solid var(--p4-border);
	border-radius: var(--bsa-radius, 10px);
	overflow: hidden;
}

.bsa-p4-calendly iframe { display: block; width: 100%; height: 100%; border: 0; }
.bsa-p4-calendly__loading { margin: 0; padding: 32px; text-align: center; color: var(--p4-muted); font-size: var(--p4-fs-base); }
.bsa-p4-calendly__fallback { font-size: var(--p4-fs-sm); }

.bsa-p4-book__aside {
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: sticky;
	top: calc(var(--p4-sticky-top) + 16px);
}

.bsa-p4-prefill {
	background: var(--p4-navy);
	border-radius: 14px;
	padding: 18px 20px;
	color: #FFFFFF;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bsa-p4-prefill .bsa-p4-eyebrow { color: var(--p4-sky); font-size: 12px; }

.bsa-p4-prefill dl {
	margin: 0;
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 8px;
	font-size: var(--p4-fs-base);
}

.bsa-p4-prefill dt { color: var(--p4-sky); }
.bsa-p4-prefill dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.bsa-p4-prefill p { margin: 0; font-size: var(--p4-fs-sm); color: #DCE7F2; line-height: 1.45; }

.bsa-p4-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: var(--p4-fs-base); color: var(--p4-body); line-height: 1.45; }

.bsa-p4-wa { padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.bsa-p4-wa__icon { width: 40px; height: 40px; border-radius: 50%; background: #E5F1EA; color: #2F6B4F; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-p4-wa p { margin: 0; flex: 1; font-size: var(--p4-fs-base); color: var(--p4-body); }
.bsa-p4-wa a { font-size: var(--p4-fs-base); font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* =============================================================
   FOOTER + TAB BAR
   ============================================================= */

.bsa-p4-footer {
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 20px var(--p4-gutter) 24px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 20px;
	border-top: 1px solid var(--p4-border);
	font-size: var(--p4-fs-sm);
	color: var(--p4-muted);
}

.bsa-p4-footer__links { display: flex; gap: 20px; }
.bsa-p4-footer a { font-weight: 600; text-decoration: none; }

.bsa-p4-tabbar { display: none; }

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (min-width: 1280px) {
	.bsa-p4-res { grid-template-columns: 380px minmax(0, 1fr); }
}

/* Reading a report on a laptop: the reader takes the full width; its
   "Show list" button (.show-list) brings the resource list back */
.bsa-p4 .bsa-viewer__list-toggle { display: none; }

@media (min-width: 1024px) {
	.bsa-p4-view[data-view="resources"].is-reading:not(.show-list) .bsa-p4-res { grid-template-columns: minmax(0, 1fr); }
	.bsa-p4-view[data-view="resources"].is-reading:not(.show-list) .bsa-p4-res__list { display: none; }

	.bsa-p4 .bsa-viewer__list-toggle {
		display: inline-flex;
		align-items: center;
		flex-shrink: 0;
		min-height: 36px;
		padding: 0 14px;
		border: 1px solid rgba(255, 255, 255, 0.3);
		border-radius: var(--bsa-radius, 10px);
		background: transparent;
		color: #FFFFFF;
		font: inherit;
		font-size: var(--p4-fs-sm);
		white-space: nowrap;
		cursor: pointer;
		position: relative;
		z-index: 1;
		transition: background-color 0.15s, border-color 0.15s;
	}

	.bsa-p4 .bsa-viewer__list-toggle:hover,
	.bsa-p4 .bsa-viewer__list-toggle:focus-visible {
		background: rgba(255, 255, 255, 0.1);
		border-color: rgba(255, 255, 255, 0.55);
	}
}

/* Laptops: a report, video or link fills the window exactly. Only the reader
   scrolls, not the page; the list scrolls on its own if it's taller. */
@media (min-width: 1024px) {
	.bsa-p4:has(.bsa-p4-view[data-view="resources"].is-active.is-viewing:not(.is-wide)) {
		height: calc(100dvh - var(--p4-admin-h));
		min-height: 560px;
	}

	.bsa-p4:has(.bsa-p4-view[data-view="resources"].is-active.is-viewing:not(.is-wide)) .bsa-p4-main {
		flex: 1 1 auto;
		min-height: 0;
		display: flex;
		flex-direction: column;
		padding-bottom: 20px;
	}

	.bsa-p4-view[data-view="resources"].is-active.is-viewing:not(.is-wide) {
		flex: 1 1 auto;
		min-height: 0;
		display: flex;
		flex-direction: column;
	}

	.bsa-p4-view[data-view="resources"].is-viewing:not(.is-wide) .bsa-p4-res {
		flex: 1 1 auto;
		min-height: 0;
		align-items: stretch;
	}

	.bsa-p4-view[data-view="resources"].is-viewing:not(.is-wide) .bsa-p4-res__list {
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.bsa-p4 .bsa-p4-view[data-view="resources"].is-viewing:not(.is-wide) .bsa-portal-col3.bsa-p4-viewer {
		position: static;
		height: auto;
		min-height: 0;
	}
}

/* Laptops with short browser windows (e.g. 1366×657): tighten vertical rhythm */
@media (min-width: 1024px) and (max-height: 760px) {
	.bsa-p4 { --p4-gap-top: 36px; }
	.bsa-p4-welcome, .bsa-p4-score, .bsa-p4-continue { padding-top: 18px; padding-bottom: 18px; }
	.bsa-p4-ring { width: 92px; height: 92px; }
	.bsa-p4-ring__value { font-size: 24px; }
	.bsa-p4-home-grid { margin-top: 22px; }
	.bsa-p4-calendly { height: calc(100dvh - var(--p4-sticky-top) - 140px); min-height: 560px; }
}

@media (max-width: 1279.98px) {
	.bsa-p4-header__inner { gap: 16px; }
	.bsa-p4-search { max-width: 300px; }
	.bsa-p4-nav__item { padding: 0 12px; }
	/* Room between the logo and the menu: 24px, as on larger screens */
	.bsa-p4-nav { margin-left: 8px; }
}

/* 1024–1279px: keep the website-size logo and links; search moves behind its button */
@media (min-width: 1024px) and (max-width: 1279.98px) {
	.bsa-p4-account__name { display: none; }
	.bsa-p4-account { padding: 3px; }
	.bsa-p4-search { display: none; }
	.bsa-p4-search-toggle { display: inline-flex; }

	.bsa-p4-header.is-search-open .bsa-p4-search {
		display: flex;
		position: absolute;
		left: var(--p4-gutter);
		right: var(--p4-gutter);
		top: calc((var(--p4-header-h) - 44px) / 2);
		height: 44px;
		max-width: none;
		z-index: 3;
		background: var(--p4-navy-2);
	}

	.bsa-p4-header.is-search-open .bsa-p4-search__close { display: inline-flex; }
}

/* ---- Tablet and below: single pane ---- */
@media (max-width: 1023.98px) {
	.bsa-p4-account__name { display: none; }
	.bsa-p4-account { padding: 3px; }

	/* Search collapses to a button; opening it overlays the header row */
	.bsa-p4-search { display: none; }
	.bsa-p4-search-toggle { display: inline-flex; }

	.bsa-p4-header.is-search-open .bsa-p4-search {
		display: flex;
		position: absolute;
		left: var(--p4-gutter);
		right: var(--p4-gutter);
		top: calc((var(--p4-header-h) - 44px) / 2);
		height: 44px;
		max-width: none;
		z-index: 3;
		background: var(--p4-navy-2);
	}

	.bsa-p4-header.is-search-open .bsa-p4-search__close { display: inline-flex; }

	.bsa-p4-home-grid { grid-template-columns: minmax(0, 1fr); }
	.bsa-p4-home-aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

	.bsa-p4-res { display: block; }
	.bsa-p4-view[data-view="resources"]:not(.is-viewing) .bsa-p4-viewer { display: none !important; }
	.bsa-p4-view[data-view="resources"].is-viewing .bsa-p4-res__list { display: none; }

	.bsa-p4 .bsa-portal-col3.bsa-p4-viewer {
		position: static;
		height: auto;
		min-height: calc(100dvh - var(--p4-sticky-top) - var(--p4-tabbar-h) - 48px);
	}

	.bsa-p4 .bsa-viewer__back { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; }

	/* Fixed-height readers; calculators and the diagnostic grow with the page */
	.bsa-p4 #bsa-viewer-pdf .bsa-viewer__content {
		flex: none;
		height: calc(100dvh - var(--p4-sticky-top) - var(--p4-tabbar-h) - 110px);
		min-height: 380px;
	}

	.bsa-p4 #bsa-viewer-video .bsa-viewer__content { flex: none; aspect-ratio: 16 / 9; }

	.bsa-p4 .bsa-portal-col3 .bsa-calc-panel.is-active,
	.bsa-p4 .bsa-portal-col3 .bsa-viewer-state.is-active { flex: 1 0 auto; }

	.bsa-p4-saved { grid-template-columns: minmax(0, 1fr); }

	.bsa-p4-book { grid-template-columns: minmax(0, 1fr); }
	.bsa-p4-book__aside { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* ---- Tablets: text-only nav so everything fits from 768px ---- */
@media (min-width: 768px) and (max-width: 1023.98px) {
	/* Tablet sizes from the Tablet-Dashboard mockup */
	.bsa-p4 { --p4-header-h: 88px; --p4-gap-top: 36px; }
	.bsa-p4-nav__item { min-height: 44px; padding: 0 10px; border-radius: var(--bsa-radius, 10px); }
	.bsa-p4-brand__text { font-size: 21px; }
	.bsa-p4-brand__text small { font-size: 9px; }
	.bsa-p4-brand__logo img { height: 52px !important; }
	.bsa-p4-header__inner { gap: 12px; }
	.bsa-p4-header__end { gap: 8px; }
	/* Logo to menu: 32px, so "Home" doesn't sit against the wordmark */
	.bsa-p4-nav { margin-left: 20px; }
}

/* ---- Small tablets / large phones in landscape: compact text nav ---- */
@media (min-width: 600px) and (max-width: 767.98px) {
	.bsa-p4 { --p4-header-h: 80px; --p4-gap-top: 32px; }
	.bsa-p4-nav__item { padding: 0 8px; }
	.bsa-p4-nav__extra { display: none; }
	.bsa-p4-brand__text { font-size: 19px; }
	.bsa-p4-brand__text small { font-size: 8px; letter-spacing: 0.36em; }
	.bsa-p4-brand__logo img { height: clamp(34px, 6vw, 46px) !important; }
	.bsa-p4-header__inner { gap: 12px; }
	.bsa-p4-header__end { gap: 8px; }
	/* Logo to menu: 20px (space is tight here) */
	.bsa-p4-nav { margin-left: 8px; }
}

/* ---- Phones ---- */
@media (max-width: 599.98px) {
	.bsa-p4 {
		--p4-header-h: 72px;
		--p4-tabbar-h: calc(64px + env(safe-area-inset-bottom, 0px));
		--p4-gutter: 16px;
	}

	/* WordPress' admin bar scrolls away on phones */
	body.admin-bar .bsa-p4 { --p4-admin-h: 0px; }

	.bsa-p4-nav { display: none; }
	.bsa-p4-header__inner { gap: 8px; }
	.bsa-p4-header__end { gap: 6px; }
	.bsa-p4-brand__text { font-size: 19px; }
	.bsa-p4-brand__text small { font-size: 8px; margin-top: 3px; }
	/* Largest logo that still fits beside search, account and log out */
	.bsa-p4-brand__logo img { height: clamp(44px, 13vw, 56px) !important; max-width: none; }
	.bsa-p4-avatar { width: 36px; height: 36px; }

	.bsa-p4 { --p4-gap-top: 24px; }
	.bsa-p4-main { padding-bottom: 28px; }

	.bsa-p4-home-top { gap: 12px; }
	.bsa-p4-home-top > *,
	.bsa-p4-home-top > .bsa-p4-welcome { flex-basis: 100%; }
	.bsa-p4-welcome { padding: 20px; }
	.bsa-p4-score, .bsa-p4-continue { padding: 16px; }
	.bsa-p4-ring { width: 88px; height: 88px; }
	.bsa-p4-ring__value { font-size: 23px; }

	.bsa-p4-home-grid { margin-top: 20px; }
	.bsa-p4-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.bsa-p4-upgrade { flex-wrap: wrap; }
	.bsa-p4-upgrade .bsa-p4-btn { width: 100%; }
	.bsa-p4-home-aside { grid-template-columns: minmax(0, 1fr); }

	.bsa-p4-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin: 0 calc(-1 * var(--p4-gutter)) 12px;
		padding: 0 var(--p4-gutter) 2px;
		scrollbar-width: none;
	}
	.bsa-p4-chips::-webkit-scrollbar { display: none; }

	/* Reports and videos run edge to edge on phones… */
	.bsa-p4 .bsa-portal-col3.bsa-p4-viewer {
		margin: -16px calc(-1 * var(--p4-gutter)) 0;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}

	/* …calculators and the diagnostic keep the normal side gutter. */
	.bsa-p4 .bsa-p4-view.is-wide .bsa-portal-col3.bsa-p4-viewer { margin: 0; }

	.bsa-p4-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bsa-p4-topic { padding: 10px 12px; }
	.bsa-p4-calendly { height: 760px; margin: 0 calc(-1 * var(--p4-gutter)); border-radius: 0; border-left: 0; border-right: 0; }
	/* "Loading available times" near the top, where it is on screen (the calendar is taller than a phone) */
	.bsa-p4 .bsa-cal-loading { justify-content: flex-start; padding-top: 56px; border-radius: 0; border-left: 0; border-right: 0; }

	.bsa-p4-footer { flex-direction: column; align-items: flex-start; padding-bottom: 20px; }

	.bsa-p4-tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 900;
		height: var(--p4-tabbar-h);
		padding-bottom: env(safe-area-inset-bottom, 0px);
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		background: #FFFFFF;
		border-top: 1px solid var(--p4-border);
		box-shadow: 0 -4px 16px rgba(15, 31, 56, 0.06);
	}

	.bsa-p4-tabbar__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		color: var(--p4-muted) !important;
		text-decoration: none;
		font-size: 12px;
		font-weight: 600;
		position: relative;
	}

	.bsa-p4-tabbar__item[aria-current="page"] { color: var(--p4-navy) !important; font-weight: 700; }

	.bsa-p4-tabbar__item[aria-current="page"]::before {
		content: '';
		position: absolute;
		top: 0;
		left: 28%;
		right: 28%;
		height: 3px;
		border-radius: 0 0 3px 3px;
		background: var(--p4-primary);
	}

	.bsa-exit-overlay { padding-bottom: var(--p4-tabbar-h); }
}

/* =============================================================
   MY ACCOUNT (portal style)
   Markup: bluesilver-advisory-core/includes/shortcodes/account-page.php
   ============================================================= */

.bsa-p4-account__head { margin-bottom: 20px; }

.bsa-p4-account__grid {
	display: grid;
	grid-template-columns: 380px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.bsa-p4-account__col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Plan card (navy, like Home's welcome card) */
.bsa-p4-account__plan {
	background: linear-gradient(115deg, #050E1A 0%, var(--p4-navy) 55%, #1A3A5C 100%);
	border-radius: var(--bsa-radius, 10px);
	padding: 24px;
	color: #FFFFFF;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bsa-p4-account__plan .bsa-p4-eyebrow { color: var(--p4-sky); }
.bsa-p4 .bsa-p4-account__plan h2 { color: #FFFFFF; font-size: var(--p4-fs-h1); }

.bsa-p4-account__plan-list {
	margin: 4px 0 0;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 8px 16px;
	font-size: var(--p4-fs-base);
}

.bsa-p4-account__plan-list dt { color: var(--p4-sky); }
.bsa-p4-account__plan-list dd { margin: 0; font-weight: 600; text-align: right; }

.bsa-p4-status { display: inline-block; padding: 2px 10px; border-radius: var(--bsa-radius, 10px); font-size: var(--p4-fs-xs); font-weight: 700; }
.bsa-p4-status--active   { background: #E3F3E9; color: #1E6B3C; }
.bsa-p4-status--expiring { background: #FDF3DC; color: #7A4A06; }
.bsa-p4-status--expired  { background: #FBE6E6; color: #8E1F1F; }

.bsa-p4-account__plan-note { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: var(--p4-fs-sm); color: #DCE7F2; line-height: 1.5; }
.bsa-p4 .bsa-p4-account__plan-note a { color: #FFFFFF; font-weight: 600; }

/* Readiness card reuses the Home score card */
.bsa-p4-account__score-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.bsa-p4-account__score-actions .bsa-p4-btn { min-height: 40px; padding: 0 14px; font-size: var(--p4-fs-sm); }
.bsa-p4-account__score-actions a:not(.bsa-p4-btn) { font-size: var(--p4-fs-base); font-weight: 600; text-decoration: none; }

/* Personal details form */
.bsa-p4-account__form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.bsa-p4 .bsa-p4-account__form h2 { font-size: var(--p4-fs-h3); }

.bsa-p4-form { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.bsa-p4-form__grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.bsa-p4-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bsa-p4-field--full { grid-column: 1 / -1; }
.bsa-p4-field label { font-size: var(--p4-fs-sm); font-weight: 600; color: var(--p4-text); }
.bsa-p4-required { color: #A3342B; }

.bsa-p4 .bsa-p4-field input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid #C9D3DE;
	border-radius: var(--bsa-radius, 10px);
	background: #FFFFFF;
	color: var(--p4-text);
	font: inherit;
	font-size: 16px;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.bsa-p4 .bsa-p4-field input:focus { outline: none; border-color: var(--p4-primary); box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.18); }
.bsa-p4 .bsa-p4-field input::placeholder { color: #8FA0B2; }

.bsa-p4-notice { padding: 12px 14px; border-radius: var(--bsa-radius, 10px); font-size: var(--p4-fs-base); line-height: 1.45; }
.bsa-p4-notice--ok    { background: #E3F3E9; color: #1E6B3C; }
.bsa-p4-notice--error { background: #FBE6E6; color: #8E1F1F; }
/* Subscription ending soon (bsa_portal_renewal_notice): top of every portal page */
.bsa-p4-notice--renew { margin: 0 0 20px; background: #E3EDF6; color: var(--p4-navy); border: 1px solid #C9DAEA; }
.bsa-p4-notice--renew a { color: var(--p4-primary); font-weight: 700; }

/* Need help */
.bsa-p4-account__help-btns { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1023.98px) {
	.bsa-p4-account__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599.98px) {
	.bsa-p4-account__plan,
	.bsa-p4-account__form { padding: 18px; }
	.bsa-p4-form__grid { grid-template-columns: minmax(0, 1fr); }
	.bsa-p4-form .bsa-p4-btn,
	.bsa-p4-account__help-btns .bsa-p4-btn { width: 100%; }
}
