/* ============================================================
   UNDER THE HOLO — portfolio.css   (/portfolio/ only)
   Session 10. The page is built from the Porcelain kit; this file
   adds only what the kit has no component for — the total card,
   the holdings rows, the plot and the three sheets' forms.

   Rules kept from the kit: no colour literals, no literal
   gradients, one accent moment (the total), semantics carry
   colour (up/down), never decoration.

   Loaded on this page alone (inc/uth-portfolio.php), after the
   main bundle, so it is not in main.min.css and costs nothing
   anywhere else.
   ============================================================ */

.uth-pf { padding-top: var(--pc-sp-8); padding-bottom: var(--pc-section); }

/* ---------- header ---------- */
.pf-head {
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
	gap: var(--pc-sp-5); margin-bottom: var(--pc-sp-7);
}
.pf-head__id { min-width: 0; }
.pf-head__id h1 { margin: var(--pc-sp-2) 0 0; font-size: var(--pc-t-h1); line-height: var(--pc-lh-h1); }
.pf-head__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pc-sp-2); }

/* A select that reads as a control, not as a form field. */
.pf-picker { position: relative; display: inline-flex; min-width: 0; }
.pf-picker select {
	appearance: none; font-family: var(--pc-font-ui); font-size: .9375rem; font-weight: 500;
	color: var(--pc-ink); background: var(--pc-surface);
	border: 1px solid var(--pc-hairline); border-radius: var(--pc-r-pill);
	padding: 9px 34px 9px 15px; min-height: 42px; max-width: 100%;
	cursor: pointer; box-shadow: var(--pc-shadow-1);
}
.pf-picker::after {
	content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px;
	margin-top: -5px; pointer-events: none;
	border-right: 1.6px solid var(--pc-ink-3); border-bottom: 1.6px solid var(--pc-ink-3);
	transform: rotate(45deg);
}
.pf-picker select:focus-visible { outline: none; border-color: var(--pc-focus); box-shadow: 0 0 0 4px var(--pc-focus-halo); }

/* ---------- the total: the page's single accent ---------- */
.pf-total { margin-bottom: var(--pc-sp-5); }
.pf-total__lead { display: flex; flex-direction: column; gap: 2px; }
.pf-total__lead h2 { margin: 0; font-family: var(--pc-font-ui); }
.pf-total__val {
	margin: 4px 0 0; font-family: var(--pc-font-display); font-weight: 600;
	font-size: clamp(2.25rem, 1.5rem + 3vw, 3.25rem); line-height: 1.05;
	color: var(--pc-accent-ink); font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
/* When there is nothing to value, the figure stops being the accent: an
   unavailable total must not look like a headline number. */
.pf-total__val--none { color: var(--pc-ink-2); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem); }
.pf-total__delta { margin: var(--pc-sp-2) 0 0; font-family: var(--pc-font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-total__grid {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--pc-sp-5); margin: var(--pc-sp-6) 0 0;
	padding-top: var(--pc-sp-5); border-top: 1px solid var(--pc-hairline);
}
.pf-total__grid dt {
	font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro);
	text-transform: uppercase; color: var(--pc-ink-3);
}
.pf-total__grid dd {
	margin: 3px 0 0; font-family: var(--pc-font-display); font-size: 1.25rem; font-weight: 600;
	color: var(--pc-ink); font-variant-numeric: tabular-nums;
}

/* On a phone `minmax(140px, 1fr)` plus a --pc-sp-5 gap could only ever fit ONE
   column inside the card, so the four summary figures became four full-width
   bands and the headline card alone ran past a screen and a half. They are four
   short numbers; they belong two by two. */
@media (max-width: 620px) {
	.pf-total__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--pc-sp-4) var(--pc-sp-3);
		margin-top: var(--pc-sp-4); padding-top: var(--pc-sp-4);
	}
	.pf-total__grid dd { font-size: 1.0625rem; }
	.pf-total { margin-bottom: var(--pc-sp-4); }
}

/* ---------- import preview (S14) ----------
   A list of what will happen, grouped by the holding each row belongs to. The
   refused rows are not hidden or greyed into invisibility: a row that will not
   be imported is the most important thing on this screen, so it keeps full
   contrast and carries its reason in the same size as everything else. */
.pf-import__result { margin-top: var(--pc-sp-5); }
.pf-import__list { list-style: none; margin: var(--pc-sp-3) 0 0; padding: 0; display: grid; gap: var(--pc-sp-4); }
.pf-import__group > strong {
	display: block; font-family: var(--pc-font-display); font-size: .9375rem; color: var(--pc-ink);
}
.pf-import__group ul { list-style: none; margin: var(--pc-sp-2) 0 0; padding: 0; display: grid; gap: 2px; }
.pf-import__row {
	display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--pc-sp-2) var(--pc-sp-3);
	padding: 5px 9px; border-radius: var(--pc-r-sm); background: var(--pc-surface-2);
	font-size: var(--pc-t-sm);
}
.pf-import__what { font-variant-numeric: tabular-nums; color: var(--pc-ink); flex: 0 0 auto; }
.pf-import__verdict { color: var(--pc-ink-2); flex: 1 1 200px; min-width: 0; }
.pf-import__row.is-skip { background: var(--pc-down-soft); }
.pf-import__row.is-skip .pf-import__verdict { color: var(--pc-down); }

.pf-note { margin: var(--pc-sp-2) 0 0; font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-note--quiet { color: var(--pc-ink-3); }
.pf-status { margin: 0 0 var(--pc-sp-3); font-size: var(--pc-t-sm); color: var(--pc-ink-2); min-height: 1.2em; }
.pf-status:empty { margin: 0; min-height: 0; }
.pf-status.is-error { color: var(--pc-down); font-weight: 500; }

/* The two semantic states, used on every figure that is a gain or a loss. */
.is-up { color: var(--pc-up); }
.is-down { color: var(--pc-down); }
/* Restated at the end of this file as well — see the note there. */

/* ---------- blocks ---------- */
.pf-block { margin-top: var(--pc-sp-5); }
.pf-block__head {
	display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
	gap: var(--pc-sp-4); margin-bottom: var(--pc-sp-5);
}
.pf-block__head .pc-card__title { margin: 0; }
.pf-block__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pc-sp-2); }
.pf-block__foot {
	display: flex; flex-wrap: wrap; gap: var(--pc-sp-2);
	margin-top: var(--pc-sp-4); padding-top: var(--pc-sp-4); border-top: 1px solid var(--pc-hairline);
}

.pf-search { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.pf-search .uth-i { position: absolute; left: 13px; color: var(--pc-ink-3); pointer-events: none; }
.pf-search input {
	font-family: var(--pc-font-ui); font-size: .9375rem; color: var(--pc-ink);
	background: var(--pc-surface); border: 1px solid var(--pc-hairline);
	border-radius: var(--pc-r-pill); padding: 9px 15px 9px 38px; min-height: 42px;
	width: min(240px, 100%);
}
.pf-search input::placeholder { color: var(--pc-ink-3); opacity: 1; }
.pf-search input:focus-visible { outline: none; border-color: var(--pc-focus); box-shadow: 0 0 0 4px var(--pc-focus-halo); }

.pf-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--pc-t-sm); color: var(--pc-ink-2); cursor: pointer; }

/* ---------- holdings ---------- */
.pf-rows { list-style: none; margin: 0; padding: 0; }
.pf-rows:empty { display: none; }
/* ---------- the holdings table (S14) ----------
   A results table, in the shape a portfolio tracker uses: who, how much, how it
   has moved, what share of the whole it is, what it is worth. The header row and
   the data rows share ONE column definition through a custom property, which is
   the only way two separate elements can stay aligned — a header that drifts out
   of register with its column is worse than no header. */
.pf-cards {
	/* The actions column is a FIXED width, not `auto`, and that is the whole
	   reason the header lines up. Sized from content it resolved to 148px in the
	   data rows (four 34px buttons and their gaps) and to 0 in the header, which
	   has no buttons — and every `fr` column downstream then divided a different
	   remainder, so the two grids disagreed by up to 50px per column. Four icon
	   buttons are a known width; stating it makes both grids resolve the same. */
	--pf-cols: 46px minmax(0, 2.2fr) minmax(0, 1fr) 92px minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, 1fr) 148px;
	--pf-gap: var(--pc-sp-4);
}
.pf-row {
	display: grid; gap: var(--pc-sp-2) var(--pf-gap);
	grid-template-columns: var(--pf-cols);
	grid-template-areas: "thumb id hold spark alloc val pl actions";
	align-items: center;
	padding: var(--pc-sp-4) var(--pc-sp-2);
	border-bottom: 1px solid var(--pc-hairline);
}
.pf-row__thumb { grid-area: thumb; }
.pf-row__id { grid-area: id; }
.pf-cell--hold { grid-area: hold; }
.pf-cell--alloc { grid-area: alloc; }
.pf-cell--val { grid-area: val; }
.pf-cell--pl { grid-area: pl; }
.pf-row__actions { grid-area: actions; }
.pf-rows > .pf-row:last-child { border-bottom: 0; }

.pf-rowhead {
	display: grid; gap: var(--pf-gap);
	grid-template-columns: var(--pf-cols);
	grid-template-areas: "thumb id hold spark alloc val pl actions";
	padding: 0 var(--pc-sp-2) var(--pc-sp-2);
	border-bottom: 1px solid var(--pc-hairline-strong);
}
.pf-rowhead__c {
	font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro);
	text-transform: uppercase; color: var(--pc-ink-3);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-rowhead__c--id    { grid-area: id; }
.pf-rowhead__c--hold  { grid-area: hold; }
.pf-rowhead__c--spark { grid-area: spark; }
.pf-rowhead__c--alloc { grid-area: alloc; }
.pf-rowhead__c--val   { grid-area: val; }
.pf-rowhead__c--pl    { grid-area: pl; }
/* With the header carrying the column names, the per-cell labels are a second
   copy of the same word directly underneath it. They come back below the grid
   breakpoint, where there is no header to carry them. */
.pf-row .pf-cell__k { display: none; }

/* The allocation bar. A track that is always visible, so a small position reads
   as "small" rather than as "missing". */
.pf-alloc__bar {
	display: block; height: 6px; width: 100%; min-width: 40px;
	border-radius: var(--pc-r-pill); background: var(--pc-surface-2);
	border: 1px solid var(--pc-hairline); overflow: hidden;
}
.pf-alloc__bar i {
	display: block; height: 100%; border-radius: inherit;
	background: var(--pc-accent-grad);
}
.pf-alloc__pct { font-variant-numeric: tabular-nums; }
.pf-alloc__none { color: var(--pc-ink-3); }
.pf-row.is-sold .pf-alloc__bar i { background: var(--pc-ink-faint); }

.pf-row__thumb {
	width: 46px; height: 63px; border-radius: var(--pc-r-xs);
	background: var(--pc-surface-2); border: 1px solid var(--pc-hairline);
	display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 2px;
	color: var(--pc-ink-faint);
}
.pf-row__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.pf-row__id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-row__name {
	font-family: var(--pc-font-display); font-size: 1rem; font-weight: 600; color: var(--pc-ink);
	background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-row__name:hover { color: var(--pc-accent-ink); }
.pf-row__set { font-size: var(--pc-t-sm); color: var(--pc-ink-2); overflow: hidden; text-overflow: ellipsis; }
.pf-row__attrs {
	font-size: var(--pc-t-micro); letter-spacing: .02em; text-transform: uppercase; color: var(--pc-ink-3);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pf-cell { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-cell__k {
	font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro);
	text-transform: uppercase; color: var(--pc-ink-3);
}
/* A money figure is one word. `overflow-wrap: anywhere` was letting the browser
   break INSIDE it — the "EUR 60.0 0" the owner reported — so the wrap is refused
   outright and the type shrinks instead when the column gets tight. Made
   impossible by construction, not merely unlikely. */
.pf-cell__v {
	font-family: var(--pc-font-display); font-weight: 600; color: var(--pc-ink);
	font-variant-numeric: tabular-nums;
	white-space: nowrap; overflow-wrap: normal; word-break: keep-all;
	font-size: clamp(.8125rem, .62rem + 0.9vw, 1rem);
}
.pf-cell__s { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }

/* "No market data" is a control, not a dash: it is the way to fix it. */
.pf-nodata {
	appearance: none; border: 1px dashed var(--pc-hairline-strong); background: transparent;
	border-radius: var(--pc-r-sm); padding: 5px 10px; cursor: pointer; text-align: left;
	font-family: var(--pc-font-ui); font-size: var(--pc-t-sm); font-weight: 500; color: var(--pc-ink-2);
	line-height: 1.3;
}
.pf-nodata:hover { color: var(--pc-ink); border-color: var(--pc-accent-line); background: var(--pc-tint-1); }
.pf-nodata small { display: block; font-size: var(--pc-t-micro); color: var(--pc-ink-3); }

.pf-row__actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.pf-iconbtn {
	appearance: none; width: 34px; height: 34px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid transparent; border-radius: var(--pc-r-pill);
	background: transparent; color: var(--pc-ink-2); cursor: pointer;
	transition: background-color var(--pc-t-fast) var(--pc-ease), color var(--pc-t-fast) var(--pc-ease), border-color var(--pc-t-fast) var(--pc-ease);
}
.pf-iconbtn:hover { color: var(--pc-ink); background: var(--pc-tint-2); border-color: var(--pc-hairline); }
.pf-iconbtn--danger:hover { color: var(--pc-down); }
.pf-danger { color: var(--pc-down); }
.pf-danger:hover { color: var(--pc-down); background: var(--pc-down-soft); }

/* A sold-out position keeps its realised result but holds nothing. */
.pf-row.is-sold .pf-row__thumb, .pf-row.is-sold .pf-row__id { opacity: .68; }

/* Below the desktop grid the figures stop being columns and become a band of
   labelled facts under the card's identity. Nothing is dropped and nothing
   scrolls sideways — the row simply reflows, and the per-cell labels come back
   because there is no longer a header row carrying them. */
@media (max-width: 1000px) {
	.pf-rowhead { display: none; }
	.pf-row .pf-cell__k { display: block; }
	.pf-row {
		grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb id    id      actions"
			"thumb hold  alloc   val"
			"thumb spark spark   pl";
		row-gap: var(--pc-sp-3);
		align-items: start;
	}
}

/* ---------- the phone row (S14) ----------
   MEASURED before this existed: 396px per row at 375px wide, five cards making
   a 7,840px page. The old layout gave every figure its own full-width band, so
   one card cost more than half a screen and the list could not be scanned at
   all — which is what "non viene visualizzato bene" meant.

   Two lines and a bar, thumbnail spanning them. Same five facts, none dropped:
   identity and value on the first line, holdings and P&L on the second, the
   allocation bar under both, trend and actions sharing the last line. */
@media (max-width: 620px) {
	.pf-row {
		/* The money column is BOUNDED, not `auto`. Left to size itself it took
		   120px of a 285px row for figures that need ~86, and the identity block
		   got 97px — the widest column on the row went to the shortest strings. */
		grid-template-columns: 44px minmax(0, 1fr) clamp(78px, 28%, 100px);
		grid-template-areas:
			"thumb id      val"
			"thumb hold    pl"
			"thumb alloc   alloc"
			"spark spark   actions";
		gap: 4px var(--pc-sp-3);
		padding: var(--pc-sp-3) var(--pc-sp-1);
		align-items: start;
	}
	.pf-row__thumb { width: 44px; height: 60px; }

	/* The labels shrink to a caption above each figure rather than a row of
	   their own; on two lines of data, four full-size labels are the layout. */
	.pf-row .pf-cell__k { font-size: 9px; line-height: 1.4; }
	.pf-cell--val, .pf-cell--pl { text-align: right; align-items: flex-end; }
	.pf-cell--val .pf-cell__v { font-size: 1rem; }

	/* Value carries a status chip and a Cardmarket range underneath. On a phone
	   that is three lines in the tightest column on the page, so the extras
	   move to the detail sheet — where the same numbers are already shown in
	   full, with room to explain themselves. */
	.pf-cell--val .pc-chip, .pf-cell--val .pf-cell__ref { display: none; }

	/* The allocation row is the bar and the number on one line. */
	.pf-cell--alloc {
		flex-direction: row; align-items: center; gap: var(--pc-sp-2);
		margin-top: 2px;
	}
	.pf-cell--alloc .pf-cell__k { display: none; }
	.pf-cell--alloc .pf-alloc__bar { flex: 1 1 auto; min-width: 0; }
	.pf-cell--alloc .pf-alloc__pct { flex: 0 0 auto; font-size: var(--pc-t-micro); }

	.pf-cell--spark .pf-cell__k { display: none; }
	.pf-cell--spark .pf-spark, .pf-cell--spark .pf-spark--empty { width: 100%; height: 26px; }
	.pf-row__actions { justify-content: flex-end; gap: 0; }
	.pf-iconbtn { width: 30px; height: 30px; }

	/* Leading, which is where the rest of the height was hiding. Measured on the
	   first row: the identity block alone was 88px because "Base Set · 63/102"
	   was taking two lines' worth of box for one line of text, and every figure
	   carried desktop leading. These are short strings in a narrow column — they
	   get the line-height that fits them, and the set line refuses to wrap
	   outright rather than being allowed to and then clipped. */
	.pf-row__id { gap: 0; }
	.pf-row__name { line-height: 1.25; }
	/* The set line is allowed two lines and no more.
	   Measured: "Legendary Collection · 68/110" wants 196px in a 97px column, so
	   forcing it onto one line hid the collector number behind an ellipsis —
	   that is the card's identity, not a detail, and a row that cannot tell you
	   WHICH 68/110 you own is worth less than the 17px it saves. */
	.pf-row__set {
		white-space: normal; line-height: 1.3;
		display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
	}
	.pf-row__attrs { line-height: 1.3; }
	.pf-cell { gap: 0; }
	.pf-cell__v { line-height: 1.25; }
	.pf-cell__s { line-height: 1.3; }
}

/* ---------- returns strip (S13) ----------
   Five tiles on one line above the chart, wrapping to two columns on a phone
   rather than shrinking into unreadable thirds. The sub-line is what makes the
   em dash acceptable: a tile that cannot be computed says why underneath. */
.pf-returns {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--pc-sp-3);
	margin-bottom: var(--pc-sp-5);
}
.pf-returns__tile {
	min-width: 0;
	padding: var(--pc-sp-3) var(--pc-sp-4);
	border: 1px solid var(--pc-hairline);
	border-radius: var(--pc-r);
	background: var(--pc-surface-2);
}
.pf-returns__tile .pc-stat__val {
	display: block;
	font-family: var(--pc-font-display);
	font-size: clamp(1.05rem, .9rem + .5vw, 1.4rem);
	line-height: 1.15;
	color: var(--pc-ink);
	font-variant-numeric: tabular-nums;
}
.pf-returns__tile .pc-stat__val.is-up { color: var(--pc-up); }
.pf-returns__tile .pc-stat__val.is-down { color: var(--pc-down); }
.pf-returns__sub {
	display: block;
	margin-top: 2px;
	font-size: var(--pc-t-micro);
	line-height: 1.35;
	color: var(--pc-ink-3);
}
@media (max-width: 900px) { .pf-returns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .pf-returns { grid-template-columns: minmax(0, 1fr); } }

/* ---------- sparkline (S13) ----------
   Row-sized, axis-less, one path. It inherits the same series variable as the
   chart so a rising card and a rising portfolio are the same green. */
.pf-cell--spark { grid-area: spark; }
.pf-spark { display: block; width: 72px; height: 22px; overflow: visible; --pf-series: var(--pc-ink-3); }
.pf-spark.is-up { --pf-series: var(--pc-up-fill); }
.pf-spark.is-down { --pf-series: var(--pc-down-fill); }
.pf-spark__line { fill: none; stroke: var(--pf-series); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pf-spark__dot { fill: var(--pf-series); }
/* No line to draw: a hairline placeholder keeps the column aligned and carries
   the reason in its title rather than printing a fake flat line. */
.pf-spark--empty {
	width: 72px; height: 22px;
	background: linear-gradient(to right, var(--pc-hairline), var(--pc-hairline)) center / 100% 1px no-repeat;
	opacity: .7;
}

/* ---------- allocation (S13) ---------- */
.pf-alloclist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--pc-sp-3); }
.pf-allocrow {
	display: grid;
	grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 3.5rem;
	gap: var(--pc-sp-4);
	align-items: center;
}
.pf-allocrow__name { min-width: 0; font-size: var(--pc-t-sm); color: var(--pc-ink); }
.pf-allocrow__name small { display: block; font-size: var(--pc-t-micro); color: var(--pc-ink-3); }
.pf-allocrow.is-other .pf-allocrow__name { color: var(--pc-ink-2); }
/* The bar and its value share a row: the label sits at the bar's end, so the
   eye reads length and figure in one movement. */
.pf-allocrow__track {
	position: relative; display: flex; align-items: center; gap: var(--pc-sp-3);
	height: 10px;
}
.pf-allocrow__track i {
	display: block; height: 10px; min-width: 2px;
	border-radius: var(--pc-r-pill);
	/* ONE colour for every bar. Magnitude is the length; hue would be noise. */
	background: var(--pc-accent);
}
.pf-allocrow.is-other .pf-allocrow__track i { background: var(--pc-ink-faint); }
.pf-allocrow__val {
	font-size: var(--pc-t-sm); font-weight: 600; color: var(--pc-ink);
	font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pf-allocrow__pct {
	text-align: right; font-size: var(--pc-t-sm); color: var(--pc-ink-2);
	font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) {
	.pf-allocrow { grid-template-columns: minmax(0, 1fr) 3.5rem; }
	.pf-allocrow__track { grid-column: 1 / -1; }
}

/* ---------- plot ---------- */
.pf-plot { position: relative; width: 100%; }
/* The viewBox is rewritten to the element's own pixel box on every draw, so the
   scale is exactly 1 on both axes and nothing inside is stretched. Never give
   this a fixed viewBox: that is what made the old chart's numbers blurry. */
.pf-plot__svg { display: block; width: 100%; height: clamp(210px, 28vw, 300px); }
.pf-plot__grid-line { stroke: var(--pc-hairline); stroke-width: 1; }
.pf-plot__axis { fill: var(--pc-ink-3); font-family: var(--pc-font-ui); font-size: 11px; }
/* One variable drives the whole series, so the fill can never disagree with the
   line: accent until the chart knows, then green above your cost and red below
   it — the way every other portfolio is read. Session 12: the class lands on
   the PANEL too, so the legend key reads the same variable as the line. */
.pf-chart, .pf-plot__svg { --pf-series: var(--pc-accent); }
.pf-chart.is-up, .pf-plot__svg.is-up { --pf-series: var(--pc-up-fill); }
.pf-chart.is-down, .pf-plot__svg.is-down { --pf-series: var(--pc-down-fill); }

.pf-plot__area { stroke: none; }
/* The stops are coloured here rather than in the markup — tokens only, and the
   gradient stays theme-aware for free. */
.pf-plot__grad-top { stop-color: var(--pf-series); stop-opacity: .16; }
.pf-plot__grad-bottom { stop-color: var(--pf-series); stop-opacity: 0; }
.pf-plot__line { fill: none; stroke: var(--pf-series); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The draw-in. `to { stroke-dashoffset: 0 }` is also the RESTING state, and there
   is no fill-mode: if the animation never runs — reduced motion, a throttled tab,
   a browser that skips it — the line is simply already drawn. A keyframe that
   started from an inline offset would fail the other way and leave the chart
   blank, which is the Session 9 modal lesson applied to an SVG. */
@keyframes pf-draw { from { stroke-dashoffset: var(--pf-len); } to { stroke-dashoffset: 0; } }
@keyframes pf-fade-in { from { opacity: 0; } }
.pf-plot__line.is-drawing {
	stroke-dasharray: var(--pf-len);
	animation: pf-draw 900ms var(--pc-ease-out);
}
.pf-plot__line.is-drawing ~ .pf-plot__dot { animation: pf-fade-in 500ms 700ms backwards var(--pc-ease-out); }
.pf-plot__area { animation: pf-fade-in 700ms var(--pc-ease-out); }

@media (prefers-reduced-motion: reduce) {
	.pf-plot__line.is-drawing, .pf-plot__area, .pf-plot__line.is-drawing ~ .pf-plot__dot { animation: none; }
}
/* Cost basis is a threshold, not a second story — dashed, quiet, behind. */
.pf-plot__cost { fill: none; stroke: var(--pc-ink-faint); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .9; }
/* The market reference is a different kind of claim from the two above it — the
   catalogue's figure, not this portfolio's — so it gets its own colour and sits
   behind them. */
.pf-plot__ref { fill: none; stroke: var(--pc-info-fill); stroke-width: 1.5; opacity: .85; }

/* ---------- benchmark + card history (S13) ----------
   The indexed baseline: where both series started. Quieter than a grid line
   because it is a reference, not a reading. */
.pf-plot__base { stroke: var(--pc-ink-faint); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
/* The owner's average cost on a card's own chart: the same dashed treatment the
   portfolio's cost basis already uses, so the two charts speak one language. */
.pf-plot__threshold { stroke: var(--pc-ink-faint); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 1; }
.pf-plot__thresholdlabel { font-size: 10px; fill: var(--pc-ink-3); }
/* A purchase is a fact about a date, so it is marked on the axis rather than on
   the curve — the price paid is not what the market said that day. */
.pf-plot__buy { fill: var(--pc-accent-ink); }
.pf-plot__buy:hover { fill: var(--pc-accent); }
.pf-legend__key--buy {
	width: 0; height: 0; border-radius: 0; background: none;
	border-left: 5px solid transparent; border-right: 5px solid transparent;
	border-top: 8px solid var(--pc-accent-ink);
}
.pf-plot--sm .pf-plot__svg { height: clamp(150px, 20vw, 200px); }
.pf-plot--sm.is-empty .pf-plot__svg { height: 0; }
.pf-cardchart { margin: var(--pc-sp-6) 0 0; }
.pf-cardchart .pf-note { margin-bottom: var(--pc-sp-3); }
/* The raw money under an indexed reading, right-aligned under the index value. */
.pf-plot__tip em {
	display: block; margin-left: auto; font-style: normal;
	font-size: var(--pc-t-micro); color: var(--pc-ink-3); font-variant-numeric: tabular-nums;
}
/* Dots are filled with the series colour and ringed with the surface (2px), so
   they stay legible where they sit on the line. */
.pf-plot__dot { fill: var(--pf-series); stroke: var(--pc-surface); stroke-width: 2; cursor: pointer; }
.pf-plot__dot:hover, .pf-plot__dot:focus-visible { stroke: var(--pc-focus); outline: none; }
.pf-plot__costdot { fill: var(--pc-ink-faint); }
.pf-plot__guide { stroke: var(--pc-hairline-strong); stroke-width: 1; stroke-dasharray: 3 3; }
/* The crosshair — a solid hairline that follows the pointer and snaps to the
   nearest observation date. */
.pf-plot__cross { stroke: var(--pc-hairline-strong); stroke-width: 1; opacity: 0; pointer-events: none; transition: opacity var(--pc-t-fast) var(--pc-ease); }
.pf-plot__cross.is-on { opacity: 1; }
/* The one direct label the chart allows itself: the latest value, at the end
   of the line, in ink — text never wears the series colour. */
.pf-plot__endlabel {
	fill: var(--pc-ink); font-family: var(--pc-font-display);
	font-size: 12px; font-weight: 600;
	paint-order: stroke; stroke: var(--pc-surface); stroke-width: 3px; stroke-linejoin: round;
}

/* Pinned just under the top of the plot, centred on the crosshair. */
.pf-plot__tip {
	position: absolute; z-index: 2; pointer-events: none;
	transform: translate(-50%, 0);
	background: var(--pc-surface); border: 1px solid var(--pc-hairline);
	border-radius: var(--pc-r-sm); box-shadow: var(--pc-shadow-2);
	padding: 8px 11px; min-width: 148px;
	font-size: var(--pc-t-sm); color: var(--pc-ink-2); line-height: 1.5;
}
.pf-plot__tip strong { display: block; color: var(--pc-ink); font-family: var(--pc-font-display); margin-bottom: 2px; }
.pf-plot__tip span { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.pf-plot__tip b { margin-left: auto; color: var(--pc-ink); font-weight: 600; }
/* Line keys, not boxes: a short stroke of the series colour. */
.pf-tipkey { flex: none; width: 12px; height: 2px; border-radius: 1px; background: var(--pc-ink-faint); }
.pf-tipkey--value { background: var(--pf-series); }
.pf-tipkey--cost { background: var(--pc-ink-faint); }
.pf-tipkey--ref { background: var(--pc-info-fill); }

.pf-plot__empty {
	position: absolute; inset: 0; display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: 6px; text-align: center;
	padding: var(--pc-sp-5); border: 1px dashed var(--pc-hairline);
	border-radius: var(--pc-r); background: var(--pc-surface-2);
}
.pf-plot__empty strong { font-family: var(--pc-font-display); font-size: var(--pc-t-h3); color: var(--pc-ink); }
.pf-plot__empty span { font-size: var(--pc-t-sm); color: var(--pc-ink-2); max-width: 46ch; }

.pf-legend { display: flex; flex-wrap: wrap; gap: var(--pc-sp-5); margin-top: var(--pc-sp-4); font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-legend span { display: inline-flex; align-items: center; gap: 7px; }
.pf-legend__key { width: 18px; height: 3px; border-radius: 2px; background: var(--pc-ink-faint); }
.pf-legend__key--value { background: var(--pf-series, var(--pc-accent)); }
.pf-legend__key--cost { background: var(--pc-ink-faint); }
.pf-legend__key--ref { background: var(--pc-info-fill); }

.pf-datatable { margin-top: var(--pc-sp-5); }
.pf-datatable > summary {
	cursor: pointer; font-size: var(--pc-t-sm); font-weight: 600; color: var(--pc-ink-2);
	padding: 6px 0;
}
.pf-datatable > summary:hover { color: var(--pc-ink); }
.pf-scroll { overflow-x: auto; margin-top: var(--pc-sp-3); }
.pf-scroll table { width: 100%; border-collapse: collapse; font-size: var(--pc-t-sm); }
.pf-scroll th, .pf-scroll td {
	text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--pc-hairline);
	color: var(--pc-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pf-scroll th { color: var(--pc-ink-3); font-size: var(--pc-t-micro); text-transform: uppercase; letter-spacing: var(--pc-track-micro); }

/* ---------- sets ---------- */
.pf-setlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--pc-sp-3); }
.pf-setrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto; gap: var(--pc-sp-4); align-items: center; }
.pf-setrow__name { font-size: .9375rem; color: var(--pc-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-setrow__bar { height: 6px; border-radius: var(--pc-r-pill); background: var(--pc-tint-2); overflow: hidden; }
.pf-setrow__bar i { display: block; height: 100%; background: var(--pc-accent); border-radius: inherit; }
.pf-setrow__count { font-size: var(--pc-t-sm); color: var(--pc-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .pf-setrow { grid-template-columns: minmax(0, 1fr) auto; } .pf-setrow__bar { grid-column: 1 / -1; } }

/* ---------- activity & ledger ---------- */
.pf-feed, .pf-txlist { list-style: none; margin: 0; padding: 0; }
.pf-feed:empty, .pf-txlist:empty { display: none; }
.pf-feed > li, .pf-txlist > li { border-bottom: 1px solid var(--pc-hairline); }
.pf-feed > li:last-child, .pf-txlist > li:last-child { border-bottom: 0; }

.pf-event {
	width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
	gap: var(--pc-sp-3); align-items: center; text-align: left;
	background: transparent; border: 0; padding: var(--pc-sp-3) var(--pc-sp-2); cursor: pointer;
	border-radius: var(--pc-r-sm);
}
.pf-event:hover { background: var(--pc-tint-1); }
.pf-event[disabled] { cursor: default; }
.pf-event__sign {
	width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: var(--pc-tint-2); color: var(--pc-ink-2); font-family: var(--pc-font-display); font-weight: 600;
}
.pf-event__sign.is-up { background: var(--pc-up-soft); }
.pf-event__sign.is-down { background: var(--pc-down-soft); }
.pf-event__copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-event__copy strong { font-family: var(--pc-font-display); font-size: .9375rem; color: var(--pc-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-event__copy span, .pf-event__copy time { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-event__amt { font-family: var(--pc-font-display); font-weight: 600; color: var(--pc-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-event.is-void { opacity: .55; }

.pf-tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--pc-sp-3); align-items: center; padding: var(--pc-sp-3) var(--pc-sp-2); }
.pf-tx__type {
	font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro); text-transform: uppercase;
	padding: 3px 8px; border-radius: var(--pc-r-pill); background: var(--pc-tint-2); color: var(--pc-ink-2);
}
.pf-tx__copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-tx__copy strong { font-family: var(--pc-font-display); font-size: .9375rem; color: var(--pc-ink); font-variant-numeric: tabular-nums; }
.pf-tx__copy span, .pf-tx__copy small { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-tx__end { display: flex; align-items: center; gap: var(--pc-sp-2); }
.pf-tx__amt { font-family: var(--pc-font-display); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--pc-ink); }
.pf-tx.is-void { opacity: .55; }
.pf-tx__gone { font-size: var(--pc-t-sm); color: var(--pc-ink-3); }

/* ---------- health list (engine unavailable) ---------- */
.pf-health { list-style: none; margin: var(--pc-sp-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--pc-sp-2); justify-content: center; }
.pf-health li {
	display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px;
	border-radius: var(--pc-r-pill); background: var(--pc-tint-1); border: 1px solid var(--pc-hairline);
	font-size: var(--pc-t-sm); color: var(--pc-ink-2);
}
.pf-health li strong { font-weight: 600; color: var(--pc-ink); }
.pf-health li.is-missing { background: var(--pc-down-soft); border-color: transparent; }
.pf-health li.is-missing strong { color: var(--pc-down); }

/* ---------- detail sheet ---------- */
.pc-sheet--wide { max-width: min(860px, calc(100vw - 32px)); }

.pf-detail { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: var(--pc-sp-5); align-items: start; }
.pf-detail__media {
	margin: 0; border-radius: var(--pc-r-sm); overflow: hidden;
	background: var(--pc-surface-2); border: 1px solid var(--pc-hairline); padding: 6px;
}
.pf-detail__media img { display: block; width: 100%; height: auto; border-radius: var(--pc-r-xs); }
.pf-detail__body { min-width: 0; }
.pf-detail__attrs { margin: 0 0 var(--pc-sp-3); font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-detail__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--pc-sp-4); }
.pf-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: var(--pc-sp-4); }
.pf-metrics dt { font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro); text-transform: uppercase; color: var(--pc-ink-3); }
.pf-metrics dd { margin: 2px 0 0; font-family: var(--pc-font-display); font-size: 1.125rem; font-weight: 600; color: var(--pc-ink); font-variant-numeric: tabular-nums; }
.pf-metrics dd small { display: block; font-family: var(--pc-font-ui); font-size: var(--pc-t-sm); font-weight: 500; color: var(--pc-ink-2); }
.pf-evidence {
	margin: var(--pc-sp-5) 0 0; padding: var(--pc-sp-3) var(--pc-sp-4);
	background: var(--pc-surface-2); border-radius: var(--pc-r-sm);
	font-size: var(--pc-t-sm); color: var(--pc-ink-2);
}
.pf-evidence strong { color: var(--pc-ink); }
@media (max-width: 560px) { .pf-detail { grid-template-columns: 84px minmax(0, 1fr); gap: var(--pc-sp-4); } }

.pf-actionbar { display: flex; flex-wrap: wrap; gap: var(--pc-sp-2); margin: var(--pc-sp-6) 0; padding-top: var(--pc-sp-5); border-top: 1px solid var(--pc-hairline); }

/* ---------- market reference ---------- */
.pf-valueblock { margin-top: var(--pc-sp-6); padding-top: var(--pc-sp-5); border-top: 1px solid var(--pc-hairline); }
.pf-value { margin: var(--pc-sp-4) 0 0; display: flex; flex-direction: column; gap: var(--pc-sp-3); }
.pf-value__row {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--pc-sp-3);
	align-items: baseline; padding-bottom: var(--pc-sp-3); border-bottom: 1px solid var(--pc-hairline);
}
.pf-value__row:last-child { border-bottom: 0; padding-bottom: 0; }
.pf-value__row dt {
	font-size: var(--pc-t-micro); font-weight: 600; letter-spacing: var(--pc-track-micro);
	text-transform: uppercase; color: var(--pc-ink-3);
}
.pf-value__row dd { margin: 0; text-align: right; min-width: 0; }
.pf-value__fig {
	display: block; font-family: var(--pc-font-display); font-weight: 600; font-size: 1.0625rem;
	color: var(--pc-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pf-value__fig--none { color: var(--pc-ink-3); font-size: var(--pc-t-sm); font-weight: 500; }
.pf-value__row dd small { display: block; font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
/* The card's market range under this holding's own figure — quieter, because it
   is context and not the number the row is about. */
.pf-cell__ref { color: var(--pc-ink-3); font-variant-numeric: tabular-nums; }

/* ---------- eBay ---------- */
.pf-ebay { margin-top: var(--pc-sp-6); padding-top: var(--pc-sp-5); border-top: 1px solid var(--pc-hairline); }
.pf-ebay__actions { display: flex; flex-wrap: wrap; gap: var(--pc-sp-2); margin: var(--pc-sp-4) 0; }
.pf-ebay__list { list-style: none; margin: 0; padding: 0; }
.pf-ebay__list:empty { display: none; }
.pf-ebay__item {
	display: grid; grid-template-columns: 44px minmax(0, 1fr) auto;
	gap: var(--pc-sp-3); align-items: center;
	padding: var(--pc-sp-3) 0; border-bottom: 1px solid var(--pc-hairline);
}
.pf-ebay__item:last-child { border-bottom: 0; }
.pf-ebay__thumb {
	width: 44px; height: 44px; border-radius: var(--pc-r-xs); overflow: hidden;
	background: var(--pc-surface-2); border: 1px solid var(--pc-hairline);
	display: flex; align-items: center; justify-content: center; color: var(--pc-ink-faint);
}
.pf-ebay__thumb img { width: 100%; height: 100%; object-fit: contain; }
.pf-ebay__copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-ebay__copy a {
	color: var(--pc-ink); font-family: var(--pc-font-display); font-size: .9375rem; font-weight: 600;
	text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-ebay__copy a:hover { color: var(--pc-accent-ink); text-decoration: underline; }
.pf-ebay__meta { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-ebay__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.pf-ebay__price { font-family: var(--pc-font-display); font-weight: 600; color: var(--pc-ink); font-variant-numeric: tabular-nums; }
/* The appraiser's refusals are sentences ("Auction — a current bid, not an
   asking price"), and the kit's chip is nowrap by default. Let this one wrap:
   truncating the reason would leave the verdict looking like a verdict. */
.pf-ebay__end .pc-chip { white-space: normal; text-align: right; max-width: 22ch; }
@media (max-width: 520px) {
	.pf-ebay__item { grid-template-columns: 44px minmax(0, 1fr); }
	.pf-ebay__end { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; }
}

/* ---------- forms in sheets ---------- */
.pf-form { display: flex; flex-direction: column; gap: var(--pc-sp-4); margin-top: var(--pc-sp-5); }
.pf-form:first-child { margin-top: 0; }
.pf-form__title {
	margin: var(--pc-sp-2) 0 0; font-family: var(--pc-font-display); font-size: 1rem; font-weight: 600;
	color: var(--pc-ink); display: flex; align-items: center; gap: 8px;
}
.pf-step {
	width: 22px; height: 22px; flex: none; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--pc-tint-2); color: var(--pc-ink-2); font-size: var(--pc-t-micro); font-weight: 600;
}
.pf-form__foot { display: flex; flex-wrap: wrap; gap: var(--pc-sp-2); justify-content: flex-end; padding-top: var(--pc-sp-2); }

.pf-grid { display: grid; gap: var(--pc-sp-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pf-grid--2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pf-grid--3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.pf-grid--4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pf-grid__wide { grid-column: 1 / -1; }
.pf-form .pc-field small { font-weight: 400; color: var(--pc-ink-3); }

.pf-searchrow { display: flex; flex-wrap: wrap; gap: var(--pc-sp-2); align-items: flex-end; }
.pf-searchrow__field { flex: 1 1 220px; min-width: 0; }

.pf-results { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.pf-results p { margin: 0; padding: var(--pc-sp-3); font-size: var(--pc-t-sm); color: var(--pc-ink-2); }
.pf-result {
	display: flex; gap: var(--pc-sp-3); align-items: center; width: 100%; text-align: left;
	background: transparent; border: 1px solid transparent; border-radius: var(--pc-r-sm);
	padding: 8px; cursor: pointer; color: var(--pc-ink);
}
.pf-result:hover { background: var(--pc-tint-1); border-color: var(--pc-hairline); }
.pf-result img { width: 34px; height: 47px; object-fit: contain; flex: none; }
.pf-result span { min-width: 0; display: flex; flex-direction: column; }
.pf-result strong { font-family: var(--pc-font-display); font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-result small { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }

.pf-picked {
	display: flex; flex-direction: column; gap: 2px; padding: var(--pc-sp-3) var(--pc-sp-4);
	background: var(--pc-accent-soft); border-radius: var(--pc-r-sm);
}
.pf-picked strong { font-family: var(--pc-font-display); color: var(--pc-ink); }
.pf-picked span { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }

.pf-confirm { padding: var(--pc-sp-4); background: var(--pc-warn-soft); border-radius: var(--pc-r-sm); }
.pf-confirm strong { color: var(--pc-warn); font-family: var(--pc-font-display); }
.pf-check { display: flex; gap: 8px; align-items: flex-start; margin-top: var(--pc-sp-3); font-size: var(--pc-t-sm); color: var(--pc-ink-2); cursor: pointer; }

.pf-choices { display: grid; gap: var(--pc-sp-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pf-choice {
	display: flex; gap: var(--pc-sp-3); align-items: flex-start; cursor: pointer;
	padding: var(--pc-sp-3) var(--pc-sp-4); border: 1px solid var(--pc-hairline);
	border-radius: var(--pc-r-sm); background: var(--pc-surface-2);
}
.pf-choice:has(input:checked) { border-color: var(--pc-accent-line); background: var(--pc-accent-soft); }
.pf-choice span { display: flex; flex-direction: column; gap: 2px; }
.pf-choice strong { font-family: var(--pc-font-display); color: var(--pc-ink); }
.pf-choice small { font-size: var(--pc-t-sm); color: var(--pc-ink-2); }

.pf-pfrow {
	display: grid; gap: var(--pc-sp-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	align-items: end; padding: var(--pc-sp-4) 0; border-bottom: 1px solid var(--pc-hairline);
}
.pf-pfrow__actions { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }

/* ---------- toast ---------- */
.pf-toast {
	position: fixed; z-index: 200; left: 50%; transform: translateX(-50%);
	bottom: calc(var(--pc-sp-6) + env(safe-area-inset-bottom, 0px));
	background: var(--pc-scrim-strong); color: var(--pc-on-scrim);
	padding: 10px 18px; border-radius: var(--pc-r-pill); box-shadow: var(--pc-shadow-3);
	font-size: var(--pc-t-sm); font-weight: 500; max-width: calc(100vw - 32px);
}
@media (max-width: 1020px) { .pf-toast { bottom: calc(var(--pc-tabbar-h) + 26px + env(safe-area-inset-bottom, 0px)); } }


/* ============================================================
   SEMANTIC COLOUR, LAST WORD
   .is-up / .is-down are declared near the top for readability, but
   .pf-cell__v, .pf-value__fig and .pf-metrics dd all set `color`
   at the SAME specificity further down — so the neutral ink won on
   source order and a loss never went red. Restating them here, at
   the end, is the whole fix: same specificity, later position.
   ============================================================ */
.is-up { color: var(--pc-up); }
.is-down { color: var(--pc-down); }
.pf-cell__v.is-up, .pf-cell__s.is-up, .pf-metrics dd.is-up, .pf-total__grid dd.is-up { color: var(--pc-up); }
.pf-cell__v.is-down, .pf-cell__s.is-down, .pf-metrics dd.is-down, .pf-total__grid dd.is-down { color: var(--pc-down); }
