/* Scale Command showcase: the Partner Portal mock (Tool D) and the portal-style cards.
   Every screen rule is scoped to :is(#portal, .app-card), so the same .pcard markup reads the same
   inside the phone frame and in a static .app-card visual on any page (SITE-MAP section 5).
   The frame chrome (top bar, name, bell, body, tab bar) lives here too, under #portal only: there is
   no chip, no dim or boot state and no sheet in version 2.
   Tokens: reads the shell's :root tokens and falls back to the brief's values. */
:root {
  --pt-bg: var(--bg, #0A0A0C);
  --pt-card: var(--card, #141418);
  --pt-raised: var(--raised, #1B1B21);
  --pt-hair: var(--hair, rgba(200, 168, 78, 0.15));
  --pt-gold: var(--gold, #C8A84E);
  --pt-gold-light: var(--gold-light, #DFC06A);
  --pt-gold-dark: var(--gold-dark, #8F7A32);
  --pt-on-gold: var(--on-gold, #121212);
  --pt-text: var(--text, #EDEBE3);
  --pt-text-2: var(--text-2, #A7A5A0);
  --pt-muted: var(--muted, #8A8A93);
  --pt-series-gold: var(--series-gold, #AC8C36);
  --pt-series-blue: var(--series-blue, #4A8FD4);
  --pt-green: var(--green, #3FBF7F);
  --pt-amber: var(--amber, #E0A63A);
  --pt-red: var(--red, #E05A4F);
  --pt-money: var(--money, #4ADE80);
  --pt-font-display: var(--font-display, 'Manrope', system-ui, sans-serif);
  --pt-font-body: var(--font-body, 'Manrope', system-ui, sans-serif);
  --pt-font-mono: var(--font-mono, 'Manrope', system-ui, sans-serif);
  --pt-radius: var(--radius-card, 10px);
  --pt-radius-chip: var(--radius-chip, 6px);
  --pt-ease: var(--ease, cubic-bezier(.2, .7, .2, 1));
}

/* ---------- screen body ---------- */
:is(#portal, .app-card) .pscreen { font-family: var(--pt-font-body); color: var(--pt-text); font-size: 13px; line-height: 1.4; box-sizing: border-box; max-width: 100%; overflow-x: hidden; }
:is(#portal, .app-card) .pscreen * { box-sizing: border-box; min-width: 0; }
:is(#portal, .app-card) .pscreen p, :is(#portal, .app-card) .pscreen ul, :is(#portal, .app-card) .pscreen ol { margin: 0; }
:is(#portal, .app-card) .pscreen ul, :is(#portal, .app-card) .pscreen ol { padding: 0; list-style: none; }
:is(#portal, .app-card) .p-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:is(#portal, .app-card) .pscreen-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 10px; }
:is(#portal, .app-card) .pscreen-title { font-family: var(--pt-font-display); font-weight: 700; font-size: 15px; letter-spacing: .02em; color: var(--pt-text); }
:is(#portal, .app-card) .psection { font-family: var(--pt-font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--pt-muted); padding: 14px 2px 6px; }
:is(#portal, .app-card) .pempty, :is(#portal, .app-card) .pcard-line { padding: 8px 2px; color: var(--pt-text-2); border-top: 1px solid var(--pt-hair); border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pcard-line { font-family: var(--pt-font-mono); color: var(--pt-text); }

/* ---------- cards ---------- */
:is(#portal, .app-card) .pcard { background: var(--pt-card); border: 1px solid var(--pt-hair); border-radius: var(--pt-radius); padding: 12px; margin-bottom: 10px; position: relative; transition: border-color .35s var(--pt-ease), box-shadow .35s var(--pt-ease); }
:is(#portal, .app-card) .pcard:last-child { margin-bottom: 0; }
:is(#portal, .app-card) .pcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
:is(#portal, .app-card) .pcard-title { font-family: var(--pt-font-body); font-weight: 600; font-size: 12px; color: var(--pt-text-2); letter-spacing: .01em; }
:is(#portal, .app-card) .pcard-meta { font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); white-space: nowrap; }
:is(#portal, .app-card) .pcard-sub { font-size: 12px; color: var(--pt-text-2); }
:is(#portal, .app-card) .pcard-sub:empty { display: none; }
:is(#portal, .app-card) .pcard-actions { margin: 10px 0 8px; }
:is(#portal, .app-card) .pbig { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
:is(#portal, .app-card) .pbig-sub { font-size: 12px; color: var(--pt-muted); }
:is(#portal, .app-card) .pmoney { font-family: var(--pt-font-mono); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; color: var(--pt-money); font-variant-numeric: tabular-nums; }
:is(#portal, .app-card) .pmoney.is-plain { color: var(--pt-text); font-size: 20px; }

/* hairline pulse: the card a slider just changed */
:is(#portal, .app-card) .pcard.pulse { animation: pt-pulse .7s var(--pt-ease) 1; }
@keyframes pt-pulse {
  0% { border-color: var(--pt-gold); box-shadow: 0 0 0 0 rgba(200, 168, 78, .35); }
  60% { border-color: var(--pt-gold-light); box-shadow: 0 0 0 6px rgba(200, 168, 78, 0); }
  100% { border-color: var(--pt-hair); box-shadow: 0 0 0 0 rgba(200, 168, 78, 0); }
}

/* ---------- 8-week bars ---------- */
:is(#portal, .app-card) .pbars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; align-items: end; height: 74px; margin-top: 10px; padding-top: 4px; border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pbar-slot { display: grid; grid-template-rows: minmax(0, 1fr) auto; align-items: end; height: 74px; padding: 0 2px; border-radius: 4px 4px 0 0; cursor: pointer; }
:is(#portal, .app-card) .pbar-slot:focus-visible { outline: 2px solid var(--pt-gold); outline-offset: 2px; }
:is(#portal, .app-card) .pbar { height: 0; min-height: 0; align-self: end; background: var(--pt-series-gold); border-radius: 3px 3px 0 0; transition: height .45s var(--pt-ease), background-color .2s; }
:is(#portal, .app-card) .pbar-slot.is-empty .pbar { min-height: 2px; background: var(--pt-hair); }
:is(#portal, .app-card) .pbar-slot.is-selected .pbar { background: var(--pt-gold-light); }
:is(#portal, .app-card) .pbar-slot:hover .pbar { background: var(--pt-gold); }
:is(#portal, .app-card) .pbar-label { font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); text-align: center; line-height: 1; padding-top: 4px; }
:is(#portal, .app-card) .pbars-note { font-family: var(--pt-font-mono); font-size: 11px; color: var(--pt-muted); padding-top: 6px; min-height: 20px; }

/* ---------- stage tracker ---------- */
:is(#portal, .app-card) .pstage-name { font-family: var(--pt-font-display); font-weight: 700; font-size: 20px; letter-spacing: .03em; color: var(--pt-text); line-height: 1.15; }
:is(#portal, .app-card) .pstage-name:empty::before { content: '\2026'; color: var(--pt-muted); }
:is(#portal, .app-card) .ptrack { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin-top: 12px; position: relative; overflow: hidden; }
:is(#portal, .app-card) .ptrack::before { content: ''; position: absolute; left: 8%; right: 8%; top: 7px; height: 2px; background: var(--pt-hair); }
:is(#portal, .app-card) .pstep { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
:is(#portal, .app-card) .pstep-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--pt-raised); border: 2px solid var(--pt-hair); position: relative; z-index: 1; transition: background-color .35s var(--pt-ease), border-color .35s var(--pt-ease), box-shadow .35s var(--pt-ease); }
:is(#portal, .app-card) .pstep-label { font-size: 10px; line-height: 1.1; letter-spacing: -.02em; color: var(--pt-muted); white-space: nowrap; max-width: 100%; }
:is(#portal, .app-card) .pstep.is-lit .pstep-dot { background: var(--pt-gold-dark); border-color: var(--pt-gold); }
:is(#portal, .app-card) .pstep.is-lit .pstep-label { color: var(--pt-text-2); }
:is(#portal, .app-card) .pstep.is-current .pstep-dot { background: var(--pt-gold); border-color: var(--pt-gold-light); box-shadow: 0 0 0 4px rgba(200, 168, 78, .18); }
:is(#portal, .app-card) .pstep.is-current .pstep-label { color: var(--pt-gold-light); font-weight: 600; }
:is(#portal, .app-card) .ptrack.is-paused .pstep.is-lit .pstep-dot { background: var(--pt-raised); border-color: var(--pt-amber); box-shadow: none; }
:is(#portal, .app-card) .ptrack.is-paused .pstep.is-current .pstep-label { color: var(--pt-amber); }
/* The Home thumbnail (.app-card-thumb) under 620px: six labels do not fit a 250px card, so only the current stage is named. */
@media (max-width: 619.98px) {
  :is(#portal, .app-card).app-card-thumb .pstep-label { display: none; }
  :is(#portal, .app-card).app-card-thumb .pstep.is-current .pstep-label { display: block; }
}

/* ---------- chips, tags, buttons, switches ---------- */
:is(#portal, .app-card) .pchips { display: flex; gap: 6px; flex-wrap: wrap; }
:is(#portal, .app-card) .pchips-range { padding: 0 2px 10px; }
:is(#portal, .app-card) .pchip { position: relative; font-family: var(--pt-font-mono); font-size: 11px; font-weight: 600; line-height: 1; padding: 0 10px; min-height: 28px; min-width: 32px; border-radius: var(--pt-radius-chip); border: 1px solid var(--pt-hair); background: transparent; color: var(--pt-text-2); cursor: pointer; }
/* 44px tap targets on the 28px chips and the 26px switches: a transparent hit box, the visual unchanged */
:is(#portal, .app-card) .pchip::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
:is(#portal, .app-card) .pswitch::after { content: ''; position: absolute; top: -9px; bottom: -9px; left: -8px; right: -8px; }
:is(#portal, .app-card) .pchip.is-on { background: var(--pt-raised); border-color: var(--pt-gold); color: var(--pt-gold-light); }
:is(#portal, .app-card) .pchip:focus-visible, :is(#portal, .app-card) .pswitch:focus-visible, :is(#portal, .app-card) .pbtn:focus-visible { outline: 2px solid var(--pt-gold); outline-offset: 2px; }
:is(#portal, .app-card) .ptag { display: inline-block; font-family: var(--pt-font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: var(--pt-radius-chip); border: 1px solid var(--pt-hair); color: var(--pt-text-2); line-height: 1; vertical-align: middle; }
:is(#portal, .app-card) .is-booked .ptag, :is(#portal, .app-card) .ptag.is-paid { color: var(--pt-green); border-color: rgba(63, 191, 127, .35); }
:is(#portal, .app-card) .is-addon .ptag { color: var(--pt-series-blue); border-color: rgba(74, 143, 212, .4); }
:is(#portal, .app-card) .is-canceled .ptag { color: var(--pt-red); border-color: rgba(224, 90, 79, .4); }
:is(#portal, .app-card) .pbtn { font-family: var(--pt-font-body); font-weight: 600; font-size: 13px; min-height: 44px; width: 100%; border-radius: 8px; border: 1px solid var(--pt-hair); background: var(--pt-raised); color: var(--pt-text-2); cursor: default; }
:is(#portal, .app-card) .pbtn[aria-disabled="true"] { opacity: .6; }
:is(#portal, .app-card) .pswitches { border-top: 1px solid var(--pt-hair); margin-top: 8px; }
:is(#portal, .app-card) .pswitch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pswitch-label { font-size: 13px; color: var(--pt-text); }
:is(#portal, .app-card) .pswitch { position: relative; width: 44px; height: 26px; border-radius: 13px; border: 1px solid var(--pt-hair); background: var(--pt-raised); cursor: pointer; padding: 0; flex: none; transition: background-color .2s; }
:is(#portal, .app-card) .pswitch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--pt-muted); transition: transform .2s var(--pt-ease), background-color .2s; }
:is(#portal, .app-card) .pswitch[aria-checked="true"] { background: var(--pt-gold-dark); border-color: var(--pt-gold); }
:is(#portal, .app-card) .pswitch[aria-checked="true"] .pswitch-knob { transform: translateX(18px); background: var(--pt-gold-light); }

/* ---------- ledger rows (the one grammar) ---------- */
:is(#portal, .app-card) .pledger { margin-top: 8px; }
:is(#portal, .app-card) .pl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; border-top: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pl-row:first-child { border-top: 0; }
:is(#portal, .app-card) .pl-label { font-size: 12px; color: var(--pt-text-2); }
:is(#portal, .app-card) .pl-val { font-family: var(--pt-font-mono); font-size: 12px; font-weight: 600; color: var(--pt-text); font-variant-numeric: tabular-nums; }
:is(#portal, .app-card) .pl-row.is-strong .pl-label { color: var(--pt-text); font-weight: 600; }
:is(#portal, .app-card) .pl-row.is-money .pl-val { color: var(--pt-money); }
/* The sources table (the attribution-table partial): one column per source, so each figure's label sits
   over its value and neither wraps, in two columns on a phone and six across in a wide row. The rank is
   the shell's stage-strip counter. */
:is(#portal, .app-card) .psources .pl-row { display: grid; gap: 1px; padding: 6px 0; }
:is(#portal, .app-card) .psources .pl-label { font-size: 11px; line-height: 1.3; }
:is(#portal, .app-card) .psources .pl-val { white-space: nowrap; font-size: 13px; }
:is(#portal, .app-card) .psources .stage-strip-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
:is(#portal, .app-card) .pads-ratio { font-family: var(--pt-font-mono); font-size: 12px; font-weight: 600; color: var(--pt-text); padding-top: 8px; }
:is(#portal, .app-card) .pads-ratio:empty { display: none; }
:is(#portal, .app-card) .ptotals { font-family: var(--pt-font-mono); font-size: 11px; color: var(--pt-text-2); padding: 0 2px 8px; }

/* ---------- next 30 days ---------- */
:is(#portal, .app-card) .pcard.is-empty .pmoney { font-family: var(--pt-font-body); font-weight: 500; font-size: 14px; color: var(--pt-text-2); }
:is(#portal, .app-card) .pnext-chart { margin-top: 8px; }
:is(#portal, .app-card) .pnext-chart:empty { display: none; }
:is(#portal, .app-card) .pnext-chart svg { display: block; width: 100%; height: 84px; overflow: visible; }
:is(#portal, .app-card) .pchart-band { fill: var(--pt-series-blue); fill-opacity: .14; stroke: none; }
:is(#portal, .app-card) .pchart-solid { fill: none; stroke: var(--pt-series-gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
:is(#portal, .app-card) .pchart-dashed { fill: none; stroke: var(--pt-series-blue); stroke-width: 2; stroke-dasharray: 4 4; stroke-linejoin: round; stroke-linecap: round; }
:is(#portal, .app-card) .plegend { display: flex; gap: 12px; margin-top: 6px; font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); }
:is(#portal, .app-card) .plegend[hidden] { display: none; }
:is(#portal, .app-card) .plg::before { content: ''; display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--pt-series-gold); }
:is(#portal, .app-card) .plg-proj::before { background: repeating-linear-gradient(90deg, var(--pt-series-blue) 0 3px, transparent 3px 5px); }
:is(#portal, .app-card) .plg-band::before { height: 8px; background: var(--pt-series-blue); opacity: .3; }

/* ---------- billing ---------- */
:is(#portal, .app-card) .pbill-status { font-family: var(--pt-font-mono); font-weight: 700; font-size: 18px; color: var(--pt-text); }
:is(#portal, .app-card) .pinv, :is(#portal, .app-card) .ppay { padding: 8px 2px; border-top: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pinvoices, :is(#portal, .app-card) .ppayments { border-bottom: 1px solid var(--pt-hair); margin-top: 0; }
:is(#portal, .app-card) .pinv { display: flex; align-items: center; gap: 8px; }
:is(#portal, .app-card) .pinv-id { font-family: var(--pt-font-mono); font-size: 12px; color: var(--pt-text); flex: 1; }
:is(#portal, .app-card) .pinv-amt { font-family: var(--pt-font-mono); font-size: 12px; font-weight: 600; color: var(--pt-text); font-variant-numeric: tabular-nums; }

/* ---------- sales ---------- */
:is(#portal, .app-card) .psale { padding: 10px 2px; border-top: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .psales { border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .psale-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
:is(#portal, .app-card) .psale-name { font-weight: 600; font-size: 13px; color: var(--pt-text); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
:is(#portal, .app-card) .psale-amt { font-family: var(--pt-font-mono); font-weight: 700; font-size: 14px; color: var(--pt-money); font-variant-numeric: tabular-nums; white-space: nowrap; }
:is(#portal, .app-card) .is-canceled .psale-amt { color: var(--pt-muted); text-decoration: line-through; }
:is(#portal, .app-card) .is-addon .psale-amt { color: var(--pt-text); }
:is(#portal, .app-card) .psale-sub { font-size: 11px; color: var(--pt-text-2); margin-top: 3px; }
:is(#portal, .app-card) .psale-when { font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); white-space: nowrap; }
:is(#portal, .app-card) .psale-more { padding: 10px 2px; font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); border-top: 1px solid var(--pt-hair); }

/* ---------- connections (the Connections list partial) ---------- */
:is(#portal, .app-card) .pconn { border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pconn-row { padding: 10px 2px; border-top: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .ptag.is-on { color: var(--pt-green); border-color: rgba(63, 191, 127, .35); }

/* ---------- ads screen ---------- */
:is(#portal, .app-card) .pweek .pledger { margin-top: 4px; }
:is(#portal, .app-card) .pcard-month { background: var(--pt-raised); }

/* ---------- bell ---------- */
:is(#portal, .app-card) .pbell-item { display: flex; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pbell { border-bottom: 1px solid var(--pt-hair); }
:is(#portal, .app-card) .pbell-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--pt-gold); }
:is(#portal, .app-card) .pbell-item.is-stage .pbell-dot { background: var(--pt-series-blue); }
:is(#portal, .app-card) .pbell-item.is-payment .pbell-dot { background: var(--pt-green); }
:is(#portal, .app-card) .pbell-item.is-invoice .pbell-dot { background: var(--pt-amber); }
:is(#portal, .app-card) .pbell-text { font-size: 13px; color: var(--pt-text); }
:is(#portal, .app-card) .pbell-when { font-family: var(--pt-font-mono); font-size: 10px; color: var(--pt-muted); margin-top: 2px; }
:is(#portal, .app-card) .pbell-line { padding: 0 2px 6px; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :is(#portal, .app-card) .pbar, :is(#portal, .app-card) .pcard, :is(#portal, .app-card) .pstep-dot, :is(#portal, .app-card) .pswitch, :is(#portal, .app-card) .pswitch-knob { transition: none; }
  :is(#portal, .app-card) .pcard.pulse { animation: none; border-color: var(--pt-gold); }
}

/* ---------- the static card visuals outside the phone (.app-card) ---------- */
.app-card { font-family: var(--pt-font-body); color: var(--pt-text); font-size: 13px; line-height: 1.4; min-width: 0; }
.app-card * { box-sizing: border-box; min-width: 0; }
.app-card p, .app-card ul, .app-card ol { margin: 0; }
.app-card ul, .app-card ol { padding: 0; list-style: none; }
.app-card .pcard { margin-bottom: 10px; }
.app-card .pcard:last-child { margin-bottom: 0; }

/* ---------- the frame chrome (no chip, no sheet; in the page flow on every width) ---------- */
#portal-tool { display: flex; justify-content: center; max-width: 100%; min-width: 0; }
#portal {
  position: relative;
  width: var(--phone-w, 360px);
  max-width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  background: rgba(6, 6, 8, 0.96);
  border: 1px solid var(--pt-hair);
  border-radius: var(--radius-phone, 20px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  color: var(--pt-text);
  overflow: hidden;
}
#portal .portal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--pt-hair);
  background: rgba(10, 10, 12, 0.9);
}
#portal .portal-mark { flex: none; width: 24px; height: 20px; }
#portal .portal-name {
  min-width: 0;
  font-family: var(--pt-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--pt-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#portal .portal-bell {
  position: relative;
  margin-left: auto;
  flex: none;
  width: var(--tap, 44px);
  height: var(--tap, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-btn, 8px);
  color: var(--pt-text-2);
  cursor: pointer;
}
#portal .portal-bell:hover, #portal .portal-bell.is-active, #portal .portal-bell[aria-pressed="true"] { color: var(--pt-text); }
#portal .portal-bell:focus-visible { outline: 2px solid var(--pt-gold-light); outline-offset: 2px; }
#portal .portal-bell-count {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--pt-text);
  color: var(--pt-bg);
  font-family: var(--pt-font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
#portal .portal-bell-count:empty, #portal .portal-bell-count[data-count="0"] { display: none; }
#portal .portal-body {
  position: relative;
  height: min(var(--phone-body-h, 620px), 72vh);
  min-height: 420px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto; /* the page scroll takes over once the screen ends */
  scrollbar-width: thin;
  scrollbar-color: rgba(237, 235, 227, 0.2) transparent;
}
/* Under 940 the row is stacked and the visitor is on a thumb: the frame grows with its active screen and is plain
   page flow (SITE-MAP section 3), so nothing inside it captures the scroll. The inner scroller is desktop only. */
@media (max-width: 939.98px) {
  #portal .portal-body { height: auto; min-height: 0; overflow: visible; }
}
#portal .pscreen { display: none; padding: 12px 12px 20px; }
#portal .pscreen.active { display: block; }
#portal .portal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 56px;
  border-top: 1px solid var(--pt-hair);
  background: rgba(10, 10, 12, 0.92);
}
#portal .portal-tabs button {
  min-height: var(--tap, 44px);
  padding: 0 4px;
  background: transparent;
  border: 0;
  border-top: 2px solid transparent;
  color: var(--pt-muted);
  font-family: var(--pt-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 160ms var(--pt-ease), border-color 160ms var(--pt-ease);
}
#portal .portal-tabs button:hover { color: var(--pt-text-2); }
#portal .portal-tabs button[aria-pressed="true"] { color: var(--pt-text); border-top-color: var(--pt-gold); }
#portal .portal-tabs button:focus-visible { outline: 2px solid var(--pt-gold-light); outline-offset: -3px; }

@media (prefers-reduced-motion: reduce) {
  #portal .portal-tabs button { transition: none; }
}
