/* ==========================================================================
   33. SIMULATION BANNER + SCENARIO STATES

   Appended for the scenario explorer upgrade. Everything here is inert until
   the script adds .is-scenario-active to the report root.
   ========================================================================== */

/* ---- Hidden attribute enforcement -------------------------------------- */

.cayk-report [hidden],
.cayk-report .cayk-btn[hidden],
.cayk-report .cayk-btn-ghost[hidden],
.cayk-report .cayk-btn-quiet[hidden] {
	display: none !important;
}


/* Same enforcement for the bar, which is relocated outside the report. */

.cayk-simbar[hidden],
.cayk-simbar [hidden],
.cayk-simbar .cayk-btn[hidden] {
	display: none !important;
}


/* The bar supplies its own button baseline for the same reason. */

.cayk-simbar .cayk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	font-family: inherit;

	cursor: pointer;

	border: 2px solid transparent;
	border-radius: var(--cayk-radius);

	text-decoration: none;

	transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}


.cayk-simbar .cayk-btn-quiet {
	background: transparent;

	border-color: var(--cayk-border-hi);

	color: var(--cayk-text-dim);

	padding: 10px 20px;

	font-size: 13.5px;
	font-weight: 650;
}


.cayk-simbar .cayk-btn-quiet:hover,
.cayk-simbar .cayk-btn-quiet:focus-visible {
	border-color: var(--cayk-sim);

	color: var(--cayk-text);
}


/* ---- Scenario section -------------------------------------------------
   Always rendered. Only the controls depend on the script, so a script
   failure degrades to a visible explanation rather than a vanished feature.
   ------------------------------------------------------------------------ */

.cayk-scenario-nojs {
	margin: 0 0 14px;

	color: var(--cayk-text-faint);

	font-size: 13px;
	font-style: italic;
}


/* ---- Simulation accent -------------------------------------------------
   Purple is reserved exclusively for simulated values, so nothing in the
   report can be mistaken for a real reading.
   ------------------------------------------------------------------------ */

.cayk-report {
	--cayk-sim: #B18CFF;
	--cayk-sim-bright: #CDB4FF;
	--cayk-sim-deep: #6D45C9;
	--cayk-sim-soft: rgba(177, 140, 255, 0.13);
	--cayk-sim-line: rgba(177, 140, 255, 0.48);
}


/* ---- Fixed banner pinned to the top of the window ----------------------

   The script relocates this element to <body>. The report root sets
   isolation:isolate, which creates a stacking context that traps a fixed
   child inside it no matter how high its z-index. Living on <body> is the
   only reliable way to sit above page chrome.

   Because it is outside .cayk-report it cannot inherit the report's design
   tokens, so the ones it needs are redeclared here.
   ------------------------------------------------------------------------ */

.cayk-simbar {
	--cayk-sim: #B18CFF;
	--cayk-sim-bright: #CDB4FF;
	--cayk-sim-deep: #6D45C9;
	--cayk-sim-soft: rgba(177, 140, 255, 0.13);
	--cayk-sim-line: rgba(177, 140, 255, 0.48);

	--cayk-text: #EBFDFE;
	--cayk-text-dim: #9FB6C4;
	--cayk-text-faint: #6E8796;
	--cayk-border-hi: #33475A;
	--cayk-panel-hi: #142433;
	--cayk-radius: 8px;

	--cayk-font-display: 'Inter', system-ui, -apple-system, sans-serif;

	font-family: 'Inter', system-ui, -apple-system, sans-serif;

	position: fixed;
	z-index: 2147482000;

	top: var(--cayk-simbar-top, 0px);
	right: 0;
	left: 0;

	margin: 0;
	padding: 14px 24px 12px;

	background: linear-gradient( 180deg, #1B0E37 0%, #150B2B 100% );

	border: 0;
	border-bottom: 2px solid var(--cayk-sim);
	border-radius: 0;

	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);

	animation: cayk-simbar-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}


@keyframes cayk-simbar-in {
	from { transform: translateY(-100%); }
	to   { transform: translateY(0); }
}


/* Keep the report clear of the fixed bar while it is on screen. */

.cayk-report.is-scenario-active {
	padding-top: 132px;
}


.cayk-simbar-inner {
	max-width: var(--cayk-content-max);

	margin: 0 auto;
}


.cayk-simbar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;

	gap: 18px 24px;
}


.cayk-simbar-lead {
	flex: 1 1 320px;

	min-width: 0;
}


.cayk-simbar-tag {
	display: inline-flex;
	align-items: center;

	gap: 7px;

	margin: 0 0 7px;
	padding: 4px 11px;

	background: var(--cayk-sim);

	border-radius: 30px;

	color: #1B0E37;

	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}


.cayk-simbar-tag::before {
	content: "";

	width: 7px;
	height: 7px;

	background: #1B0E37;

	border-radius: 50%;

	animation: cayk-pulse 1.8s ease-in-out infinite;
}


@keyframes cayk-pulse {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.25; }
}


.cayk-simbar-copy {
	margin: 0;

	color: var(--cayk-text);

	font-size: 14px;
	line-height: 1.55;
}


.cayk-simbar-copy strong {
	color: var(--cayk-sim-bright);

	font-weight: 750;
}


.cayk-simbar-move {
	color: var(--cayk-text-dim);

	font-size: 12.5px;
	font-variant-numeric: tabular-nums;

	white-space: nowrap;
}


.cayk-simbar-deltas {
	display: flex;
	flex-wrap: wrap;

	gap: 22px;
}


.cayk-simbar-delta {
	display: flex;
	flex-direction: column;

	gap: 3px;
}


.cayk-simbar-dlabel {
	color: var(--cayk-text-faint);

	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;

	white-space: nowrap;
}


.cayk-simbar-dvalue {
	display: flex;
	align-items: baseline;

	gap: 7px;

	font-variant-numeric: tabular-nums;
}


.cayk-simbar-dvalue s {
	color: var(--cayk-text-faint);

	font-size: 14px;
	text-decoration: line-through;
}


.cayk-simbar-dvalue b {
	color: var(--cayk-text);

	font-family: var(--cayk-font-display);
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
}


.cayk-simbar-dvalue i {
	font-size: 12px;
	font-style: normal;
	font-weight: 800;
}


.cayk-simbar-dvalue i.is-up,
.cayk-exec-delta.is-up {
	color: var(--cayk-sim-bright);
}


.cayk-simbar-dvalue i.is-down,
.cayk-exec-delta.is-down {
	color: var(--cayk-tier-2);
}


.cayk-simbar-dsuffix {
	color: var(--cayk-text-faint);

	font-size: 12px;
}


.cayk-simbar-reset {
	flex: 0 0 auto;

	min-width: 0 !important;
	min-height: 42px !important;

	padding: 10px 20px !important;
}


.cayk-simbar-note {
	margin: 12px 0 0;
	padding-top: 12px;

	border-top: 1px solid color-mix(in srgb, var(--cayk-sim) 26%, transparent);

	color: var(--cayk-text-faint);

	font-size: 11.5px;
	font-style: italic;
	line-height: 1.5;
}


/* ---- Executive delta chips --------------------------------------------- */

.cayk-exec-valuewrap {
	display: flex;
	align-items: baseline;

	gap: 9px;
}


.cayk-exec-delta {
	font-family: var(--cayk-font-display);
	font-size: 15px;
	font-weight: 800;

	font-variant-numeric: tabular-nums;

	animation: cayk-delta-in 0.4s ease both;
}


@keyframes cayk-delta-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}


/* ---- Category cards in the raised set ---------------------------------- */

.cayk-cat {
	position: relative;
}


.cayk-cat-simflag {
	position: absolute;
	top: -10px;
	right: 14px;

	padding: 3px 10px;

	background: var(--cayk-sim);

	border-radius: 20px;

	color: #1B0E37;

	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;

	font-variant-numeric: tabular-nums;
}


.cayk-cat.is-scenario {
	border-color: color-mix(in srgb, var(--cayk-sim) 65%, transparent);

	background: var(--cayk-sim-soft);

	box-shadow:
		0 0 0 1px var(--cayk-sim),
		0 10px 32px rgba(0, 0, 0, 0.14);
}


.cayk-cat.is-scenario .cayk-cat-badge,
.cayk-cat.is-scenario .cayk-cat-fill,
.cayk-cat.is-scenario .cayk-pip.is-on {
	background: var(--cayk-sim) !important;
}


.cayk-cat.is-scenario .cayk-cat-tier {
	color: var(--cayk-sim-bright) !important;
}


.is-scenario-active .cayk-cat:not(.is-scenario) {
	opacity: 0.82;
}


/* ---- Heatmap rows in the raised set ------------------------------------ */

.cayk-heat-cells {
	position: relative;
}


.cayk-heat-veil {
	position: absolute;
	inset: 0;
	z-index: 5;

	display: none;
	align-items: center;
	justify-content: center;

	padding: 0 14px;

	background: color-mix(in srgb, var(--cayk-panel-hi) 92%, transparent);

	border: 1px dashed color-mix(in srgb, var(--cayk-tier-4) 60%, transparent);
	border-radius: 5px;

	color: var(--cayk-text-dim);

	font-size: 11.5px;
	font-style: italic;
	text-align: center;
}


.cayk-heat-row.is-simulated .cayk-heat-veil {
	display: flex;
}


.cayk-heat-row.is-simulated .cayk-heat-cat-score {
	color: var(--cayk-tier-4);

	font-weight: 700;
}


.cayk-heat-row.is-simulated {
	border-color: color-mix(in srgb, var(--cayk-tier-4) 45%, transparent);
}


/* ---- Simulated focus section ------------------------------------------- */

.cayk-report-focus.is-simulated {
	border: 1px dashed var(--cayk-sim-line);
	border-radius: var(--cayk-radius-signature);

	padding: 26px;
}


.cayk-sim-flag {
	display: inline-block;

	margin-right: 10px;
	padding: 4px 11px;

	background: var(--cayk-sim-soft);

	border: 1px solid var(--cayk-sim-line);
	border-radius: 20px;

	color: var(--cayk-sim-bright);

	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;

	vertical-align: middle;
}


.cayk-sim-resolved {
	margin: 16px 0 0;
	padding: 14px 16px;

	background: var(--cayk-sim-soft);

	border-left: 2px solid var(--cayk-sim);
	border-radius: 0 5px 5px 0;

	color: var(--cayk-text-dim);

	font-size: 13px;
	line-height: 1.6;
}


/* ---- Compound signals the scenario would address ----------------------- */

.cayk-signal-resolved {
	display: inline-block;

	margin: 0 0 8px;
	padding: 3px 10px;

	background: color-mix(in srgb, var(--cayk-tier-4) 18%, transparent);

	border-radius: 20px;

	color: var(--cayk-tier-4);

	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}


.cayk-signal-list li.is-resolved {
	border-left-color: var(--cayk-tier-4);

	opacity: 0.72;
}


.cayk-signal-list li.is-resolved h3 {
	text-decoration: line-through;
	text-decoration-color: var(--cayk-text-faint);
	text-decoration-thickness: 1px;
}


/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 860px) {

	.cayk-simbar {
		padding: 16px 18px 12px;
	}

	.cayk-simbar-inner {
		gap: 14px;
	}

	.cayk-simbar-deltas {
		gap: 16px;
	}

	.cayk-simbar-dvalue b {
		font-size: 20px;
	}

	.cayk-simbar-reset {
		width: 100%;
	}
}


@media (max-width: 560px) {

	.cayk-simbar {
		position: static;
	}

	.cayk-heat-veil {
		font-size: 10.5px;
	}
}


/* ---- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	.cayk-simbar-tag::before {
		animation: none;
	}

	.cayk-exec-delta {
		animation: none;
	}
}


/* ---- Print --------------------------------------------------------------
   The printed report is always the respondent's real result. Simulation
   chrome is removed entirely so a saved PDF can never be mistaken for it.
   ------------------------------------------------------------------------ */

@media print {

	.cayk-simbar,
	.cayk-scenario,
	.cayk-cat-simflag,
	.cayk-heat-veil,
	.cayk-signal-resolved,
	.cayk-exec-delta,
	[data-cayk-focus-sim] {
		display: none !important;
	}

	[data-cayk-focus-real] {
		display: block !important;
	}

	.cayk-cat,
	.cayk-signal-list li {
		opacity: 1 !important;
	}
}


/* ==========================================================================
   34. BEFORE / AFTER FIGURES IN THE EXECUTIVE STRIP
   ========================================================================== */

.cayk-exec-valuewrap {
	flex-wrap: wrap;
}


.cayk-exec-was {
	color: var(--cayk-text-faint);

	font-family: var(--cayk-font-display);
	font-size: 26px;
	font-weight: 700;
	line-height: 1;

	font-variant-numeric: tabular-nums;

	text-decoration: line-through;
	text-decoration-thickness: 2px;
}


.cayk-exec-arrow {
	color: var(--cayk-sim);

	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}


.is-scenario-active .cayk-exec-value {
	color: var(--cayk-sim-bright);
}


.is-scenario-active .cayk-exec-item {
	border-color: var(--cayk-sim-line);

	background: var(--cayk-sim-soft);
}


/* The strongest-foundation tile does not change, so it should not read as
   though it did. */

.is-scenario-active .cayk-exec-item:last-child .cayk-exec-value {
	color: var(--cayk-teal);
}

.is-scenario-active .cayk-exec-item:last-child {
	background: var(--cayk-panel-soft);

	border-color: var(--cayk-border);
}


/* ==========================================================================
   35. SIMULATED SECTION EYEBROW AND OMISSION NOTE
   ========================================================================== */

.cayk-sim-eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;

	gap: 4px 2px;

	margin: 0 0 10px;

	color: var(--cayk-sim-bright);

	font-size: 13px;
	font-weight: 650;
	letter-spacing: 0.01em;
}


.cayk-sim-omitted {
	margin: 18px 0 0;
	padding: 13px 15px;

	background: rgba(235, 253, 254, 0.03);

	border-left: 2px solid var(--cayk-border-hi);
	border-radius: 0 5px 5px 0;

	color: var(--cayk-text-faint);

	font-size: 12.5px;
	font-style: italic;
	line-height: 1.6;
}


/* Simulated focus list uses the purple accent rather than tier colours,
   because the ordering is a projection rather than a measured reading. */

.cayk-report-focus.is-simulated .cayk-focus-list li {
	--cayk-accent: var(--cayk-sim);
}


/* ==========================================================================
   36. FIXED BANNER OFFSETS
   ========================================================================== */

@media (max-width: 1080px) {

	.cayk-report.is-scenario-active {
		padding-top: 168px;
	}
}


@media (max-width: 640px) {

	.cayk-simbar {
		padding: 12px 16px 10px;
	}

	.cayk-report.is-scenario-active {
		padding-top: 232px;
	}

	.cayk-exec-was {
		font-size: 20px;
	}
}


@media print {

	.cayk-report.is-scenario-active {
		padding-top: 0 !important;
	}

	.cayk-exec-was,
	.cayk-exec-arrow,
	.cayk-sim-eyebrow,
	.cayk-sim-omitted {
		display: none !important;
	}

	[data-cayk-hide-on-sim] {
		display: block !important;
	}
}


/* ==========================================================================
   37. BAR APPEARS ONLY WHILE THE SCENARIO RUNS

   The bar is deliberately absent until the reader runs the scenario. A
   persistent strip competes with the report itself, and the control already
   lives in the scenario section further down the page.
   ========================================================================== */

.cayk-report.is-scenario-active {
	scroll-margin-top: var(--cayk-simbar-top, 0px);
}


@media print {

	.cayk-simbar {
		display: none !important;
	}
}


/* ==========================================================================
   38. SIMULATED CARD, REPLACEMENT NOTE

   The five underlying answers are hidden on a raised card, because they are
   real and unchanged and would contradict the simulated category score.
   ========================================================================== */

.cayk-cat-simnote {
	margin: 4px 0 0;
	padding: 12px 14px;

	background: var(--cayk-sim-soft);

	border-left: 2px solid var(--cayk-sim);
	border-radius: 0 5px 5px 0;

	color: var(--cayk-text-dim);

	font-size: 12px;
	font-style: italic;
	line-height: 1.55;
}


@media print {

	.cayk-cat-simnote {
		display: none !important;
	}

	.cayk-cat-details {
		display: block !important;
	}
}
