/*
 * Ascenthya client performance portal.
 *
 * The brief for this screen is narrower than it looks. A client opens it to
 * answer one question — how is my money doing — and the design should answer
 * it in the first second and then get out of the way. That means one dominant
 * number per tile, generous rules instead of boxes, and colour used only where
 * it carries meaning (gain, loss, unavailable). No gradients on cards, no
 * shadows, no accent for its own sake.
 *
 * Brand tokens mirror the Elementor global kit and the Discovery module so the
 * portal reads as part of the same firm rather than a bolted-on app.
 *
 * Everything is scoped under .ascp-portal; nothing leaks into the theme.
 */

.ascp-portal {
	--ascp-teal: #11676a;
	--ascp-teal-deep: #0a4143;
	--ascp-gold: #c9971a;
	--ascp-ink: #1f2933;
	--ascp-paper: #f7f9f9;
	--ascp-mist: #eaf3f2;

	--ascp-surface: #ffffff;
	--ascp-line: rgba(31, 41, 51, 0.12);
	--ascp-line-strong: rgba(31, 41, 51, 0.22);
	--ascp-muted: rgba(31, 41, 51, 0.6);

	--ascp-gain: #0d6b4a;
	--ascp-loss: #a12727;

	--ascp-font-display: "Poppins", "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--ascp-font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--ascp-font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 32px) 64px;

	font-family: var(--ascp-font-body);
	color: var(--ascp-ink);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;

	/* Tabular figures throughout. Percentages that jitter as digits change
	   look like a spreadsheet with a bug in it. */
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

.ascp-portal *,
.ascp-portal *::before,
.ascp-portal *::after {
	box-sizing: border-box;
}

.ascp-portal :focus-visible {
	outline: 2px solid var(--ascp-gold);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */

.ascp-header {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-end;
	justify-content: space-between;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--ascp-teal);
}

.ascp-title {
	margin: 0;
	font-family: var(--ascp-font-display);
	font-size: clamp(1.6rem, 3.2vw, 2.1rem);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.2;
	color: var(--ascp-teal-deep);
}

.ascp-subtitle {
	margin: 6px 0 0;
	font-size: 0.9rem;
	color: var(--ascp-muted);
}

.ascp-asof {
	display: flex;
	flex-direction: column;
	gap: 2px;
	text-align: right;
	font-size: 0.85rem;
}

.ascp-asof-label,
.ascp-basis {
	color: var(--ascp-muted);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	font-size: 0.68rem;
}

.ascp-asof strong {
	font-size: 1rem;
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Account switcher
 * ---------------------------------------------------------------------- */

.ascp-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
}

.ascp-chip {
	padding: 7px 14px;
	border: 1px solid var(--ascp-line);
	border-radius: 2px;
	font-size: 0.85rem;
	text-decoration: none;
	color: var(--ascp-ink);
	background: var(--ascp-surface);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.ascp-chip:hover {
	border-color: var(--ascp-line-strong);
	background: var(--ascp-paper);
}

.ascp-chip.is-current {
	background: var(--ascp-teal);
	border-color: var(--ascp-teal);
	color: #fff;
	font-weight: 500;
}

/* -------------------------------------------------------------------------
 * Headline tiles
 * ---------------------------------------------------------------------- */

.ascp-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1px;
	margin: 32px 0 0;
	background: var(--ascp-line);
	border: 1px solid var(--ascp-line);
}

/* A one-pixel grid gap over a tinted background draws the rules between
   tiles without any element needing its own border. */

.ascp-tile {
	background: var(--ascp-surface);
	padding: 18px 16px 16px;
}

.ascp-tile-label {
	margin: 0;
	font-size: 0.66rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--ascp-muted);
}

.ascp-tile-value {
	margin: 10px 0 4px;
	font-family: var(--ascp-font-display);
	font-size: clamp(1.35rem, 2.4vw, 1.7rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1;
}

.ascp-tile.is-gain .ascp-tile-value {
	color: var(--ascp-gain);
}

.ascp-tile.is-loss .ascp-tile-value {
	color: var(--ascp-loss);
}

.ascp-tile.is-empty .ascp-tile-value {
	color: var(--ascp-muted);
	font-weight: 400;
}

.ascp-tile-note {
	margin: 0;
	font-size: 0.72rem;
	color: var(--ascp-muted);
}

/* -------------------------------------------------------------------------
 * Panels
 * ---------------------------------------------------------------------- */

.ascp-panel {
	margin: 40px 0 0;
}

.ascp-panel-title {
	margin: 0 0 4px;
	font-family: var(--ascp-font-display);
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--ascp-teal-deep);
}

.ascp-panel-note {
	margin: 0 0 18px;
	font-size: 0.82rem;
	color: var(--ascp-muted);
	max-width: 62ch;
}

/* -------------------------------------------------------------------------
 * Chart
 * ---------------------------------------------------------------------- */

.ascp-chart {
	display: block;
	width: 100%;
	height: auto;
	max-height: 340px;
	border: 1px solid var(--ascp-line);
	background: var(--ascp-surface);
}

.ascp-chart .ascp-grid {
	stroke: var(--ascp-line);
	stroke-width: 1;
}

.ascp-chart .ascp-grid-base {
	stroke: var(--ascp-line-strong);
	stroke-dasharray: 3 3;
}

.ascp-chart .ascp-line {
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}

.ascp-chart .ascp-axis {
	font-family: var(--ascp-font-body);
	font-size: 10px;
	fill: var(--ascp-muted);
}

.ascp-chart-empty {
	padding: 24px;
	border: 1px dashed var(--ascp-line-strong);
	color: var(--ascp-muted);
	font-size: 0.88rem;
}

/* -------------------------------------------------------------------------
 * Returns grid
 * ---------------------------------------------------------------------- */

.ascp-table-scroll {
	overflow-x: auto;
	border: 1px solid var(--ascp-line);
	background: var(--ascp-surface);
}

.ascp-grid {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
	min-width: 720px;
}

.ascp-grid th,
.ascp-grid td {
	padding: 9px 10px;
	text-align: right;
	border-bottom: 1px solid var(--ascp-line);
	white-space: nowrap;
}

.ascp-grid thead th {
	font-size: 0.66rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ascp-muted);
	border-bottom: 1px solid var(--ascp-line-strong);
}

.ascp-grid tbody th {
	text-align: left;
	font-weight: 600;
	color: var(--ascp-teal-deep);
}

.ascp-grid tbody tr:last-child td,
.ascp-grid tbody tr:last-child th {
	border-bottom: 0;
}

.ascp-grid td.is-gain {
	color: var(--ascp-gain);
}

.ascp-grid td.is-loss {
	color: var(--ascp-loss);
}

.ascp-grid td.is-empty {
	color: rgba(31, 41, 51, 0.3);
}

.ascp-grid-total {
	font-weight: 600;
	background: var(--ascp-paper);
	border-left: 1px solid var(--ascp-line);
}

.ascp-partial {
	color: var(--ascp-gold);
	cursor: help;
}

/* -------------------------------------------------------------------------
 * Actions, disclosure, gates
 * ---------------------------------------------------------------------- */

.ascp-actions {
	margin: 32px 0 0;
}

.ascp-button {
	display: inline-block;
	padding: 11px 22px;
	background: var(--ascp-teal);
	color: #fff;
	font-size: 0.88rem;
	font-weight: 500;
	text-decoration: none;
	border: 1px solid var(--ascp-teal);
	border-radius: 2px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ascp-button:hover,
.ascp-button:focus {
	background: var(--ascp-teal-deep);
	border-color: var(--ascp-teal-deep);
	color: #fff;
}

.ascp-disclosure {
	margin: 44px 0 0;
	padding: 20px 22px;
	background: var(--ascp-paper);
	border-left: 3px solid var(--ascp-line-strong);
	font-size: 0.78rem;
	line-height: 1.6;
	color: var(--ascp-muted);
	max-width: 78ch;
}

.ascp-disclosure p {
	margin: 0 0 10px;
}

.ascp-disclosure p:last-child {
	margin-bottom: 0;
}

.ascp-disclosure-missing {
	border-left-color: var(--ascp-gold);
	color: var(--ascp-ink);
}

.ascp-flag {
	margin: 20px 0 0;
	padding: 12px 16px;
	background: var(--ascp-mist);
	border-left: 3px solid var(--ascp-teal);
	font-size: 0.85rem;
}

.ascp-gate {
	max-width: 560px;
	margin: 0 auto;
	padding: clamp(28px, 5vw, 48px);
	background: var(--ascp-surface);
	border: 1px solid var(--ascp-line);
	border-top: 3px solid var(--ascp-teal);
}

.ascp-gate p {
	color: var(--ascp-muted);
	font-size: 0.92rem;
}

.ascp-steps {
	margin: 20px 0;
	padding-left: 20px;
	font-size: 0.9rem;
}

.ascp-steps li {
	margin-bottom: 12px;
}

.ascp-secret {
	display: block;
	margin: 10px 0 0;
	padding: 12px 14px;
	background: var(--ascp-paper);
	border: 1px solid var(--ascp-line);
	font-family: var(--ascp-font-mono);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	word-break: break-all;
	user-select: all;
}

.ascp-codes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 8px;
	margin: 20px 0;
	padding: 0;
	list-style: none;
}

.ascp-codes li {
	padding: 10px 12px;
	background: var(--ascp-paper);
	border: 1px solid var(--ascp-line);
	font-family: var(--ascp-font-mono);
	font-size: 0.9rem;
	text-align: center;
	user-select: all;
}

.ascp-form {
	margin: 24px 0 0;
}

.ascp-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--ascp-muted);
}

.ascp-form input[type="text"] {
	width: 160px;
	padding: 11px 14px;
	margin-right: 10px;
	border: 1px solid var(--ascp-line-strong);
	border-radius: 2px;
	font-family: var(--ascp-font-mono);
	font-size: 1.1rem;
	letter-spacing: 0.22em;
}

.ascp-error {
	padding: 11px 14px;
	background: rgba(161, 39, 39, 0.07);
	border-left: 3px solid var(--ascp-loss);
	color: var(--ascp-loss);
	font-size: 0.86rem;
}

/* Visually hidden, still read aloud. */
.ascp-portal .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media print {
	.ascp-switcher,
	.ascp-actions {
		display: none;
	}

	.ascp-portal {
		max-width: none;
		padding: 0;
	}
}
