/* The public Investments page's stages (pi-*): the parts a PublicStage panel needs to draw the Investments area that the
   shared kit in public-stage.css (ps-*) does not have: a price chart with candles and volume, line charts with a
   benchmark, a measured stretch and a read-out, a heat grid of months, tiles, range sliders, a score ring, a radar
   table and a rule editor. Every scene is in Components/Pages/PageComponents/PublicStageIv*.razor and is driven by
   wwwroot/js/public-stage.js like every other stage (data-from / data-to / data-v / data-n / data-cls / data-click).
   Neutral on purpose: lines, bars, rings and selections are ink, the field is the calm slate every stage uses, and
   colour only agrees with a value (green for a gain, red for a loss, amber for caution). Linked after public-skin.css. */

/* ---- Tokens -------------------------------------------------------------------------------------------------------- */
.ps-stage { --ps-loss: #c2312f; --pi-card: #fff; --pi-soft: color-mix(in srgb, var(--ps-ink) 40%, transparent); --pi-span: color-mix(in srgb, var(--ps-ink) 7%, transparent); }
[data-bs-theme="dark"] .ps-stage { --ps-loss: #f87171; --pi-card: #151a27; }
.ps-card .pi-up { color: var(--ps-good); }
.ps-card .pi-down { color: var(--ps-loss); }
.ps-card .pi-warn { color: var(--ps-warn); }
.ps-pill.is-loss { color: var(--ps-loss); }
.ps-card .pi-sub { color: var(--ps-sub); font-weight: 500; }

/* A line of figures under a panel's head: a ticker or a date, then labelled values. Stacked read-outs take turns. */
.pi-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: 20px; color: var(--ps-sub); font-size: 12px; white-space: nowrap; }
.pi-read b { color: var(--ps-ink); font-weight: 600; }
.pi-read em { color: var(--ps-ink); font-style: normal; font-weight: 600; }
.pi-read.ps-swap { display: grid; }
.pi-read.ps-swap > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }

/* A chart: the plot (stacked SVG layers, one per series, all 600 wide) with marks placed over it in percent, a column
   of value ticks and tags on the right, and the dates under it. */
.pi-chart { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; margin: 8px 0 2px; }
.pi-plot { position: relative; display: grid; min-width: 0; }
.pi-plot > svg { grid-area: 1 / 1; display: block; width: 100%; height: clamp(124px, 30cqw, 196px); overflow: visible; }
.pi-chart.is-price .pi-plot > svg { height: clamp(150px, 36cqw, 230px); }
.pi-plot path, .pi-plot line { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.pi-plot .pi-grid { stroke: var(--ps-rule); stroke-width: 1; }
.pi-plot .pi-zero { stroke: var(--pi-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.pi-plot .pi-ln { stroke: var(--ps-ink); stroke-width: 1.7; }
.pi-plot .pi-ln.is-quiet { stroke: var(--pi-soft); stroke-width: 1.4; }
.pi-plot .pi-ln.is-dash { stroke: var(--pi-soft); stroke-width: 1.4; stroke-dasharray: 4 4; }
.pi-plot .pi-ln.is-level { stroke: var(--ps-warn); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .85; }
.pi-plot .pi-fill { fill: var(--pi-span); stroke: none; }
.pi-plot .pi-band { fill: color-mix(in srgb, var(--ps-ink) 9%, transparent); stroke: var(--pi-soft); stroke-width: 1; }
.pi-axis { position: relative; min-width: 34px; color: var(--ps-sub); font-size: 10.5px; }
.pi-axis > i { position: absolute; left: 0; top: calc(var(--y) * 1%); font-style: normal; line-height: 1; white-space: nowrap; transform: translateY(-50%); }
.pi-axis > b { position: absolute; left: 0; top: calc(var(--y) * 1%); display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px; background: var(--ps-ink); color: var(--pi-card); font-size: 10.5px; font-weight: 600; line-height: 1; white-space: nowrap; translate: 0 -50%; }
.pi-axis > b.is-quiet { background: var(--pi-card); box-shadow: inset 0 0 0 1px var(--ps-rule); color: var(--ps-sub); }
.pi-axis > b.is-good { background: var(--ps-good); }
.pi-x { position: relative; grid-column: 1; height: 16px; margin-top: 4px; color: var(--ps-sub); font-size: 10.5px; }
.pi-x > span { position: absolute; top: 0; left: calc(var(--x) * 1%); white-space: nowrap; transform: translateX(-50%); }
.pi-x > span:first-child:not([style]) { left: 0; transform: none; }

/* Layers that draw from left to right: with data-from they draw at that step; is-first draws the first time the stage
   runs (data-paused appears on the stage then). A layer is a whole SVG, so the reveal runs across the full width. */
.ps-stage[data-ps-live] .pi-draw:is([data-from], [data-to]):not(.is-on) { clip-path: inset(0 100% 0 0); }
.ps-stage[data-ps-live] .pi-draw.is-on { clip-path: inset(0 0 0 0); transition: clip-path 1.3s cubic-bezier(.4, .1, .2, 1) .12s; }
.ps-stage[data-ps-live]:not([data-paused], [data-ps-still]) .pi-draw.is-first { clip-path: inset(0 100% 0 0); }
.ps-stage[data-paused] .pi-draw.is-first { animation: pi-draw 1.5s cubic-bezier(.4, .1, .2, 1) .2s both; }
.ps-stage[data-paused] .pi-draw.is-first:is([data-from], [data-to]):not(.is-on) { animation: none; clip-path: inset(0 100% 0 0); }
@keyframes pi-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* Bars that grow from their base the first time the stage runs (volume, income months). */
.ps-stage[data-ps-live]:not([data-paused], [data-ps-still]) .pi-grow { transform: scaleY(.04); }
.ps-stage[data-paused] .pi-grow { transform-origin: 50% 100%; animation: pi-grow .9s cubic-bezier(.3, .7, .2, 1) .5s both; }
@keyframes pi-grow { from { transform: scaleY(.04); } }

/* Candles and volume (the security's price chart). Up days are a quiet green, down days a quiet red; the volume under
   them is ink. Buys are small ink triangles under the day. */
.pi-plot .pi-c-up { fill: var(--ps-good); stroke: none; opacity: .82; }
.pi-plot .pi-c-dn { fill: var(--ps-loss); stroke: none; opacity: .82; }
.pi-plot .pi-w-up { stroke: var(--ps-good); stroke-width: 1; opacity: .82; }
.pi-plot .pi-w-dn { stroke: var(--ps-loss); stroke-width: 1; opacity: .82; }
.pi-plot .pi-vol, .pi-vols .pi-vol { fill: color-mix(in srgb, var(--ps-ink) 14%, transparent); stroke: none; transform-origin: 50% 100%; transform-box: fill-box; }
.pi-plot .pi-buy { fill: var(--ps-ink); stroke: var(--pi-card); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pi-vols { grid-column: 1; margin-top: 6px; }
.pi-vols > svg { display: block; width: 100%; height: clamp(30px, 7cqw, 44px); }

/* Marks over a plot, placed in percent of it: a dot on a line, a label above a point, a vertical rule at a day, and a
   measured stretch with its two handles (the span is neutral; only the handles carry the gain or loss colour). */
.pi-dot { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; background: var(--ps-ink); box-shadow: 0 0 0 2px var(--pi-card); }
.pi-dot.is-ring { background: var(--pi-card); box-shadow: inset 0 0 0 2px var(--ps-ink), 0 0 0 2px var(--pi-card); }
.pi-flag { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; background: var(--pi-card); box-shadow: 0 0 0 1px var(--ps-rule), 0 6px 14px -8px rgba(11, 15, 25, .45); color: var(--ps-ink); font-size: 11px; font-style: normal; font-weight: 600; line-height: 1; white-space: nowrap; translate: -50% calc(-100% - 9px); }
.pi-flag.is-below { translate: -50% 9px; }
.pi-flag.is-left { translate: calc(-100% - 8px) -50%; }
.pi-flag.is-right { translate: 8px -50%; }
.pi-rule { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: 1px; background: color-mix(in srgb, var(--ps-ink) 38%, transparent); }
.pi-span { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: calc(var(--w) * 1%); background: var(--pi-span); box-shadow: inset 1.5px 0 0 var(--ps-good), inset -1.5px 0 0 var(--ps-good); transform-origin: 0 50%; }
.pi-span.is-loss { box-shadow: inset 1.5px 0 0 var(--ps-loss), inset -1.5px 0 0 var(--ps-loss); }
.ps-stage[data-ps-live] .pi-span.ps-keep:not(.is-on) { opacity: 0; transform: scaleX(0); }
.ps-stage[data-ps-live] .pi-span.ps-keep.is-on { opacity: 1; transform: none; transition: transform .9s cubic-bezier(.3, .7, .2, 1) .15s, opacity .2s ease .15s; }
/* A card that floats over the plot with what was read or measured. */
.pi-pop { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y, 4) * 1%); z-index: 2; min-width: 168px; padding: 9px 11px 10px; border-radius: 12px; background: var(--pi-card); box-shadow: 0 0 0 1px var(--ps-rule), 0 14px 26px -16px rgba(11, 15, 25, .55); color: var(--ps-ink); font-size: 12px; line-height: 1.35; translate: -50% 0; }
.pi-pop > small { margin-bottom: 3px; }
.pi-pop > b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.pi-pop > span { display: block; color: var(--ps-sub); font-size: 11.5px; }

/* Tiles: a label, a value and a line under it, in a row of two to five. */
.pi-tiles { display: grid; grid-template-columns: repeat(var(--c, 3), minmax(0, 1fr)); gap: 6px; }
.pi-tiles > div { min-width: 0; padding: 8px 10px 9px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--ps-rule); }
.pi-tiles small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-tiles b { display: block; margin-top: 1px; font-size: 15px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; white-space: nowrap; }
.pi-tiles em { display: block; overflow: hidden; color: var(--ps-sub); font-size: 11px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.pi-tiles > div.is-picked { background: linear-gradient(180deg, var(--ps-well), color-mix(in srgb, var(--ps-ink) 9%, transparent)); box-shadow: none; }
.ps-card .pi-tiles + .pi-tiles, .ps-card .pi-tiles + .ps-rows, .ps-card .pi-chart + .pi-tiles, .ps-card .pi-x + .pi-tiles { margin-top: 8px; }

/* A figure with its label over it and a bar under it (day range, 52-week range, volume against average): the bar
   fills to --v and a thumb sits there. */
.pi-ranges { display: grid; gap: 10px; }
.pi-range { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12px; }
.pi-range > span { color: var(--ps-sub); }
.pi-range > b { text-align: right; white-space: nowrap; }
.pi-range > i { position: relative; grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--ps-track); }
.pi-range > i::before { content: ""; display: block; width: var(--v, 0%); height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--ps-ink) 45%, transparent); transition: width .9s cubic-bezier(.3, .7, .2, 1); }
.pi-range > i::after { content: ""; position: absolute; left: var(--v, 0%); top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ps-ink); box-shadow: 0 0 0 2px var(--pi-card); transition: left .9s cubic-bezier(.3, .7, .2, 1); }
.pi-range > i.is-bar::after { content: none; }
.pi-range > small { grid-column: 1 / -1; margin-top: -1px; }
.pi-range > i.is-ends { margin-bottom: 2px; }

/* Rows of label and value with a hairline between (a quote, a snapshot, a profile). */
.pi-kv > li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 28px; padding: 5px 0; font-size: 12.5px; }
.pi-kv > li + li { border-top: 1px solid var(--ps-rule); }
.pi-kv > li > span { color: var(--ps-sub); }
.pi-kv > li > b { text-align: right; white-space: nowrap; }
.pi-kv.is-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.pi-kv.is-two > li:nth-child(2) { border-top: 0; }

/* A big value with its change beside it. */
.pi-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 10px; }
.pi-big > b { font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.pi-big > span { font-size: 12.5px; font-weight: 600; }
.pi-big > small { flex-basis: 100%; }

/* Months by year: square cells, a total for each year and an average for each month. Gains are green and losses red,
   stronger with the size of the move; a month still running is hatched. Each year is its own row so it can arrive. */
.pi-heat { display: grid; gap: 1px; font-size: 10.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.pi-heat > div { display: grid; grid-template-columns: 2.7em repeat(12, minmax(0, 1fr)) 3.4em; gap: 1px; }
.pi-heat > div > * { display: grid; place-items: center; min-width: 0; height: 25px; overflow: hidden; white-space: nowrap; }
.pi-heat em { color: var(--ps-sub); font-style: normal; font-weight: 600; }
.pi-heat b { justify-items: start; font-weight: 600; }
.pi-heat strong { justify-items: end; font-weight: 600; }
.pi-heat span { --a: 30; background: color-mix(in srgb, var(--ps-good) calc(var(--a) * 1%), transparent); color: var(--ps-ink); font-weight: 600; transition: box-shadow .3s; }
.pi-heat span.d { background-color: color-mix(in srgb, var(--ps-loss) calc(var(--a) * 1%), transparent); }
.pi-heat span.is-now { background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--pi-card) 55%, transparent) 4px 7px); }
.pi-heat span.is-empty { background: none; box-shadow: inset 0 0 0 1px var(--ps-rule); }
.pi-heat span.is-picked { box-shadow: inset 0 0 0 2px var(--ps-ink); }
.pi-heat > .is-avg { padding-top: 4px; border-top: 1px solid var(--ps-rule); }
.pi-heat > .is-avg > * { height: 18px; color: var(--ps-sub); font-weight: 600; }
.pi-heat > .is-avg > .u { color: var(--ps-good); }
.pi-heat > .is-avg > .d { color: var(--ps-loss); }

/* A score ring with its number in the middle. --pi-ring follows --v so the ring turns as the number counts. */
@property --pi-ring { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.pi-ring { --pi-ring: var(--v, 0%); position: relative; flex: none; display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; background: conic-gradient(var(--ps-ink) var(--pi-ring), var(--ps-track) 0); -webkit-mask: radial-gradient(circle, transparent 0 34px, #000 34.5px); mask: radial-gradient(circle, transparent 0 34px, #000 34.5px); transition: --pi-ring 1.1s cubic-bezier(.3, .7, .2, 1); }
.pi-score { position: relative; flex: none; display: grid; place-items: center; width: 86px; height: 86px; }
.pi-score > .pi-ring { position: absolute; inset: 0; }
.pi-score > span { display: grid; justify-items: center; line-height: 1.05; }
.pi-score b { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.pi-score small { margin-top: 2px; font-size: 10.5px; }
.pi-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.pi-hero > div { min-width: 0; }
.pi-hero h4 { margin: 6px 0 3px; color: var(--ps-ink); font-size: 15.5px; font-weight: 600 !important; letter-spacing: -.015em; line-height: 1.3; }
.pi-hero p { font-size: 12px; }
.pi-hero .ps-chips { margin-top: 8px; }
.pi-hero .ps-chips > li { height: 24px; padding: 0 9px; font-size: 11.5px; }

/* The radar: a table of holdings, one row each (so a row can arrive), with their place in the 52-week range as a
   small slider. */
.pi-table { display: grid; font-size: 12px; }
.pi-table > div { display: grid; grid-template-columns: minmax(0, 1.2fr) 3.6em minmax(0, 1fr) 5.4em minmax(0, 1.5fr); align-items: center; gap: 0 10px; min-height: 40px; padding: 4px 6px; margin-inline: -6px; border-top: 1px solid var(--ps-rule); border-radius: 0; transition: background-color .3s; }
.pi-table > div > * { min-width: 0; }
.pi-table > div > :nth-child(2), .pi-table > div > :nth-child(4), .pi-table > div > :nth-child(5) { text-align: right; white-space: nowrap; }
.pi-table > .is-th { min-height: 22px; padding-block: 0 4px; border-top: 0; color: var(--ps-sub); font-size: 10.5px; font-weight: 600; }
.pi-table b { display: block; font-weight: 600; white-space: nowrap; }
.pi-table b > em { font-size: 11px; font-style: normal; }
.pi-table small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-table .ps-pill { height: 20px; font-size: 11px; }
.pi-table > div.is-picked { border-top-color: transparent; border-radius: 9px; background: var(--ps-well); }
.pi-table > div.is-picked + div { border-top-color: transparent; }
.pi-sig { display: flex; justify-content: flex-end; overflow: hidden; }
.pi-mini { position: relative; display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--ps-track); }
.pi-mini::after { content: ""; position: absolute; left: var(--v, 0%); top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ps-ink); box-shadow: 0 0 0 2px var(--pi-card); }

/* Nine checks in a grid: the check, its result, and the figure behind it. A result starts as "Checking". */
.pi-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pi-checks > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; min-height: 62px; padding: 8px 9px 9px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--ps-rule); transition: background-color .3s, box-shadow .3s; }
.pi-checks > li > b { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pi-checks > li > b > i { flex: none; color: var(--ps-sub); font-size: 15px; }
.pi-checks > li > strong { grid-column: 1 / -1; font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.pi-checks .ps-pill { height: 20px; padding: 0 7px 0 6px; font-size: 10.5px; }
.pi-checks > li.is-picked { background: linear-gradient(180deg, var(--ps-well), color-mix(in srgb, var(--ps-ink) 9%, transparent)); box-shadow: none; }

/* The rule editor: a field, the alert type, the presets, and the preview that reads the rule back. A picked preset gets
   a slight gradient and a check, never a coloured border. */
.pi-field { display: flex; align-items: center; gap: 8px; height: 34px; margin: 4px 0 10px; padding: 0 11px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--ps-rule); font-size: 12.5px; }
.pi-field > i { color: var(--ps-sub); font-size: 15px; }
.pi-label { display: block; margin: 0 0 2px; color: var(--ps-sub); font-size: 11.5px; font-weight: 600; }
.pi-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.pi-presets > li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--ps-rule); font-size: 11.5px; font-weight: 600; line-height: 1.3; transition: background-color .3s, box-shadow .3s; }
.pi-presets > li > em { flex: none; color: var(--ps-sub); font-style: normal; }
.pi-presets > li.is-picked { background: linear-gradient(180deg, var(--ps-well), color-mix(in srgb, var(--ps-ink) 10%, transparent)); box-shadow: none; }
.pi-presets > li.is-picked > em { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ps-ink); color: var(--pi-card); font-size: 0; }
.pi-presets > li.is-picked > em::before { content: ""; width: 9px; height: 5px; margin-top: -2px; border-left: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); }
.pi-preview { padding: 11px 12px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--ps-rule); }
.pi-preview > b { display: block; min-height: 2.7em; margin: 4px 0 6px; font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.pi-preview > small + .pi-kv { margin-top: 4px; }
.pi-preview .pi-kv > li { min-height: 24px; padding: 3px 0; font-size: 12px; }
.pi-preview .pi-kv > li > span { display: inline-flex; align-items: center; gap: 7px; }
.pi-preview .pi-kv i { font-size: 14px; }

/* Two or three short facts on one line, under a heading (a section of a panel). */
.pi-section { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 0 6px; }
.pi-section > b { font-size: 12.5px; }
.pi-section > span { color: var(--ps-sub); font-size: 11.5px; white-space: nowrap; }
.ps-card .pi-section + .ps-rows > li:first-child { border-top: 1px solid var(--ps-rule); }

/* An insight line at the top of a panel. */
.pi-say { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; padding: 8px 10px; border-radius: 10px; background: var(--ps-well); font-size: 12.5px; line-height: 1.45; }
.pi-say > i { flex: none; margin-top: 1px; color: var(--ps-sub); font-size: 16px; }
.pi-say.ps-swap { display: grid; }
.pi-say.ps-swap > span { display: flex; align-items: flex-start; gap: 8px; }

/* ---- Joins and small parts ------------------------------------------------------------------------------------------ */
.ps-card .pi-tiles .ps-swap, .ps-card .pi-hero h4.ps-swap { display: grid; }
.ps-card .ps-chips + .pi-read, .ps-card .pi-read + .pi-heat, .ps-card .pi-tiles + .pi-table, .ps-card .pi-tiles + .ps-cols { margin-top: 10px; }
.ps-card :is(.pi-tiles, .pi-kv, .pi-hero) + .pi-section, .ps-card .pi-section.pi-todos { margin-top: 12px; }
.ps-card .pi-range + .pi-tiles, .ps-card .pi-big + .pi-kv, .ps-card .pi-ranges + .pi-kv { margin-top: 12px; }
.ps-card .pi-hero + .pi-tiles { margin-top: 2px; }
.ps-card .ps-amt > small { margin-top: 1px; font-size: 11px; }
.ps-card p.pi-about { margin: 0 0 8px; color: var(--ps-ink); font-size: 12.5px; line-height: 1.5; }
.ps-card .pi-label.pi-whatif { margin-top: 12px; }
.ps-card .pi-label + .ps-chips { margin-top: 4px; }
.ps-card .pi-cover { margin-bottom: 2px; }
.ps-card .pi-cover + .pi-tiles + .ps-strip { margin-top: 8px; }
/* Volume bars rise from the base when they arrive. */
.pi-rise { transform-box: fill-box; transform-origin: 50% 100%; }
.ps-stage[data-ps-live] .pi-rise.ps-keep:not(.is-on) { transform: scaleY(.04); }
.ps-stage[data-ps-live] .pi-rise.ps-keep.is-on { transform: none; transition: transform .9s cubic-bezier(.3, .7, .2, 1) .15s; }
/* The ring fills from empty the first time the stage runs. */
.ps-stage[data-ps-live]:not([data-paused], [data-ps-still]) .pi-ring { --pi-ring: 0%; }
/* Twelve months of income as columns, the opened month in full ink. */
.ps-cols.pi-months { height: 96px; margin-bottom: 4px; }
.ps-cols.pi-months > li > i { opacity: .26; }
.ps-cols.pi-months > li.is-top > i { opacity: 1; }
/* The rule editor beside its preview, and the alert's two actions. */
.pi-editor { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: 12px; }
.pi-presets.is-one { grid-template-columns: minmax(0, 1fr); }
.pi-presets.is-one > li { min-height: 34px; }
.pi-preview .ps-btn { margin-top: 10px; }
.pi-preview > small.pi-up { color: var(--ps-good); }
.pi-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.ps-card .pi-big > b + small { margin-top: 2px; }
.pi-big.is-text > b { font-size: 18px; letter-spacing: -.015em; }

/* ---- Smaller panels ------------------------------------------------------------------------------------------------ */
@container (max-width: 520px) {
    .pi-tiles { --c: 2 !important; }
    .pi-tiles > div.is-extra { display: none; }
    .pi-heat { font-size: 9.5px; }
    .pi-heat > div { grid-template-columns: 2.4em repeat(12, minmax(0, 1fr)) 2.9em; }
    .pi-heat > div > * { height: 22px; }
    .pi-table > div { grid-template-columns: minmax(0, 1.1fr) 3.4em minmax(0, .9fr) minmax(0, 1.3fr); }
    .pi-table > div > :nth-child(4) { display: none; }
    .pi-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pi-editor { grid-template-columns: minmax(0, 1fr); }
    .pi-kv.is-two { grid-template-columns: minmax(0, 1fr); }
    .pi-kv.is-two > li:nth-child(2) { border-top: 1px solid var(--ps-rule); }
    .pi-presets > li:nth-child(n + 5) { display: none; }
    .pi-pop { min-width: 0; padding: 7px 9px 8px; }
    .pi-pop > b { font-size: 15px; }
    .pi-axis { min-width: 30px; }
}
@container (max-width: 400px) {
    .pi-table > div { grid-template-columns: minmax(0, 1fr) 3.4em minmax(0, 1.2fr); }
    .pi-table > div > :nth-child(3) { display: none; }
    .pi-heat > div { grid-template-columns: 2.2em repeat(12, minmax(0, 1fr)); }
    .pi-heat strong { display: none; }
    .pi-heat span { font-size: 0; }
    .pi-hero { gap: 12px; }
    .pi-big > b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .ps-stage .pi-draw, .ps-stage .pi-grow { clip-path: none !important; transform: none !important; animation: none !important; }
    .pi-ring { transition: none; }
}
