/* preview.css – stage, device simulation, generic modes and the six web contexts.
   The generated typography CSS (.tp-scope .tp-heading …) is inserted BEFORE this file, so equal-specificity rules here win. */

.stage { min-width: 0; display: flex; flex-direction: column; }
/* the canvas and its three overlays: label (top left), measure line (top right), readout chip (bottom right) */
.stage-frame { position: relative; }
.stage-canvas {
  padding: 52px 40px 68px; min-height: 280px; overflow-x: auto; background-color: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-l);
}
.stage-canvas.is-print { padding: 48px 24px 60px; }
.canvas-top { position: absolute; z-index: 1; top: 14px; left: 18px; right: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; pointer-events: none; }
.canvas-label { font-size: 9.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
:root[data-skin="modern"] .canvas-label { font-size: 12px; letter-spacing: 0; text-transform: none; }
.stage-meta { font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.canvas-chip {
  position: absolute; z-index: 1; right: 16px; bottom: 16px; margin: 0; padding: 7px 12px; max-width: calc(100% - 32px); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-family: var(--mono-font); font-size: 10px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root[data-skin="modern"] .canvas-chip { border-radius: var(--radius-pill); border-color: var(--border); box-shadow: var(--shadow-chip); padding-inline: 14px; }
.device-wrap { position: relative; margin: 0 auto; max-width: none; }
.device { transform-origin: 0 0; }
.device:not(.is-auto) { position: absolute; left: 0; top: 0; }
.device.is-auto { width: 100%; }
.tp-frame { container-type: inline-size; container-name: tpframe; width: 100%; }
@media (max-width: 640px) {
  .stage-canvas { padding: 44px 10px 60px; }
  .canvas-top { left: 12px; right: 12px; }
  .stage-meta { display: none; }
}

/* preview toolbar */
.pb-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pb-width { width: 84px; }
.pb-fit .switch-label { min-height: 28px; font-size: 12.5px; }
.pv-modes { flex-wrap: wrap; }

/* the scope = the typographic surface */
.tp-scope, .tp-print-scope, .tp-pgscope {
  --tp-line: color-mix(in srgb, var(--type-text-color) 16%, var(--type-bg-color));
  --tp-soft: color-mix(in srgb, var(--type-text-color) 6%, var(--type-bg-color));
  --tp-mute: color-mix(in srgb, var(--type-text-color) 62%, var(--type-bg-color));
  --tp-warn: #b42318;
}
.tp-scope { background: var(--type-bg-color); color: var(--type-text-color); padding: clamp(16px, 4cqi, 40px); min-height: 320px; box-shadow: 0 0 0 1px var(--text); border-radius: var(--radius); }
:root[data-skin="modern"] .tp-scope { box-shadow: 0 0 0 1px var(--border), var(--shadow-1); }
/* every context is one column of blocks (some override this with their own grid) */
.tp-scope .sc { display: flex; flex-direction: column; }
:is(.tp-scope, .tp-pgscope) [data-edit] { outline: none; border-radius: 2px; cursor: text; }
:is(.tp-scope, .tp-pgscope) [data-edit]:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--type-text-color) 14%, transparent); }
:is(.tp-scope, .tp-pgscope) [data-edit]:focus { box-shadow: 0 0 0 2px #1a56db; background: color-mix(in srgb, #1a56db 7%, transparent); }
.tp-scope p, .tp-scope blockquote, .tp-scope h2, .tp-scope h3 { margin: 0; }
.tp-scope .sc-center { text-align: center; }

/* ---------- shared components of the mock contexts ---------- */
.tp-scope .sc-btn { display: inline-flex; align-items: center; justify-content: center; padding: .62em 1.15em; border-radius: 6px; background: var(--type-text-color); color: var(--type-bg-color); border: 1px solid var(--type-text-color); white-space: normal; text-align: center; }
.tp-scope .sc-btn-ghost { background: transparent; color: var(--type-text-color); border-color: var(--tp-mute); }
.tp-scope .sc-btn-danger { background: transparent; color: var(--tp-warn); border-color: var(--tp-warn); }
.tp-scope .sc-btn-block { display: flex; width: 100%; }
.tp-scope .sc-tag { display: inline-flex; align-items: center; padding: .12em .65em; border-radius: 999px; background: var(--tp-soft); border: 1px solid var(--tp-line); white-space: nowrap; }
.tp-scope .sc-chip { display: inline-flex; padding: .3em .85em; border-radius: 999px; border: 1px solid var(--tp-line); }
.tp-scope .sc-chip.is-on { background: var(--type-text-color); color: var(--type-bg-color); border-color: var(--type-text-color); }
.tp-scope .sc-card { padding: 1em 1.1em; border: 1px solid var(--tp-line); border-radius: 10px; background: var(--type-bg-color); display: flex; flex-direction: column; gap: .5em; min-width: 0; }
.tp-scope .sc-h2 { font-size: calc(var(--type-heading-size) * .75); }
.tp-scope .sc-h3 { font-size: calc(var(--type-heading-size) * .62); }
.tp-scope .sc-h4 { font-size: calc(var(--type-heading-size) * .5); }
.tp-scope .sc-small { font-size: calc(var(--type-body-size) * .9); }
.tp-scope .sc-lead { font-size: calc(var(--type-body-size) * 1.22); }
.tp-scope .sc-kicker, .tp-scope .sc-meta { color: var(--tp-mute); }
.tp-scope .sc-deco { display: block; }
.tp-scope .sc-input { padding: .6em .8em; border: 1px solid var(--tp-mute); border-radius: 6px; min-height: 2.6em; display: flex; align-items: center; }
.tp-scope .sc-field { display: flex; flex-direction: column; gap: .35em; }
.tp-scope .sc-field + .sc-field { margin-top: .9em; }
.tp-scope .sc-field.is-error .sc-input { border-color: var(--tp-warn); box-shadow: 0 0 0 1px var(--tp-warn); }
.tp-scope .sc-err { color: var(--tp-warn); }
.tp-scope .sc-ok { color: var(--tp-mute); text-align: center; }
.tp-scope .sc-cta-row { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; }
.tp-scope .sc-scroll { overflow-x: auto; }
.tp-scope .sc-scroll:focus-visible { outline-offset: -2px; }
.tp-scope .sc-table { width: 100%; border-collapse: collapse; }
.tp-scope .sc-table th, .tp-scope .sc-table td { padding: .6em .75em; text-align: left; border-bottom: 1px solid var(--tp-line); vertical-align: middle; }
.tp-scope .sc-table th { color: var(--tp-mute); font-weight: 600; white-space: nowrap; }
.tp-scope .sc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tp-scope .sc-table.is-striped td:first-child { white-space: nowrap; }
/* data table: drop the less important date columns when the preview gets narrow instead of wrapping the invoice number */
@container tpframe (max-width: 860px) { .tp-scope .sc-table.is-striped :is(th, td):nth-child(3) { display: none; } }
@container tpframe (max-width: 560px) { .tp-scope .sc-table.is-striped :is(th, td):nth-child(4) { display: none; } }
.tp-scope .sc-table.is-striped tbody tr:nth-child(even) { background: var(--tp-soft); }
.tp-scope .sc-mono { font-variant-numeric: tabular-nums; }
.tp-scope .sc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8em; }
.tp-scope .sc-kpis.is-two { grid-template-columns: 1fr 1fr; margin-bottom: .6em; }
.tp-scope .sc-kpi-v { font-size: calc(var(--type-heading-size) * .9); }
.tp-scope .sc-delta { color: #17663a; }
.tp-scope .sc-delta.is-neg { color: var(--tp-warn); }
.tp-scope .sc-chart { width: 100%; height: 110px; color: var(--type-text-color); }

/* ---------- 1 · editorial ---------- */
.tp-scope .sc-editorial { max-width: 760px; margin: 0 auto; gap: 1.2em; }
.tp-scope .sc-ed-head { display: flex; flex-direction: column; gap: .7em; }
.tp-scope .sc-ed-body { display: flex; flex-direction: column; gap: 1em; }
.tp-scope .sc-figure { margin: 0; display: flex; flex-direction: column; gap: .5em; }
.tp-scope .sc-figure-art { position: relative; aspect-ratio: 16 / 7; border-radius: 10px; background: linear-gradient(135deg, var(--tp-soft), var(--tp-line)); overflow: hidden; }
.tp-scope .sc-figure-art .a { position: absolute; width: 46%; aspect-ratio: 1; left: 8%; top: 18%; border-radius: 50%; background: var(--type-text-color); opacity: .86; }
.tp-scope .sc-figure-art .b { position: absolute; width: 34%; height: 56%; right: 12%; bottom: 0; background: var(--tp-mute); opacity: .55; border-radius: 10px 10px 0 0; }
.tp-scope .sc-figure-art .c { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--type-text-color); }
.tp-scope .sc-quote { border-left: 3px solid var(--type-text-color); padding-left: 1em; font-size: calc(var(--type-heading-size) * .68); font-style: italic; }

/* ---------- 2 · mobile app ---------- */
.tp-scope .sc-mobile { max-width: 390px; margin: 0 auto; border: 1px solid var(--tp-line); border-radius: 26px; padding: 18px 16px 12px; gap: 14px; background: var(--type-bg-color); }
.tp-scope .sc-m-head { display: flex; flex-direction: column; gap: .2em; }
.tp-scope .sc-m-title { font-size: calc(var(--type-heading-size) * .9); }
.tp-scope .sc-m-list { display: flex; flex-direction: column; gap: 10px; }
.tp-scope .sc-m-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--tp-line); border-radius: 12px; }
.tp-scope .sc-m-thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--tp-line); }
.tp-scope .sc-m-thumb.t2 { background: var(--tp-mute); opacity: .6; border-radius: 50%; }
.tp-scope .sc-m-thumb.t3 { background: var(--type-text-color); opacity: .85; }
.tp-scope .sc-m-card-text { display: flex; flex-direction: column; gap: .15em; min-width: 0; }
.tp-scope .sc-m-nav { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--tp-line); padding-top: 8px; margin-top: 2px; }
.tp-scope .sc-m-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--tp-mute); }
.tp-scope .sc-m-nav-item.is-on { color: var(--type-text-color); }
.tp-scope .sc-m-ico { width: 18px; height: 18px; border-radius: 5px; border: 2px solid currentColor; }
.tp-scope .sc-m-nav-item.is-on .sc-m-ico { background: currentColor; }

/* ---------- 2a · web (PC): classic company website ---------- */
.tp-scope .sc-desktop { max-width: 1180px; margin: 0 auto; gap: 2.4em; }
.tp-scope .sc-w-nav { display: flex; align-items: center; gap: 1.6em; padding-bottom: 1.1em; border-bottom: 1px solid var(--tp-line); }
.tp-scope .sc-w-brand { display: flex; align-items: center; gap: .6em; margin-right: auto; }
.tp-scope .sc-w-links { display: flex; align-items: center; gap: 1.6em; color: var(--tp-mute); }
.tp-scope .sc-w-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3em; align-items: center; }
.tp-scope .sc-w-hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1em; min-width: 0; }
.tp-scope .sc-w-title { font-size: calc(var(--type-heading-size) * 1.5); overflow-wrap: anywhere; }
.tp-scope .sc-w-art { position: relative; aspect-ratio: 5 / 4; border-radius: 14px; background: linear-gradient(135deg, var(--tp-soft), var(--tp-line)); overflow: hidden; }
.tp-scope .sc-w-art .a { position: absolute; width: 38%; aspect-ratio: 1; left: 10%; top: 14%; border-radius: 50%; background: var(--type-text-color); opacity: .86; }
.tp-scope .sc-w-art .b { position: absolute; width: 42%; height: 48%; right: 8%; bottom: 0; background: var(--tp-mute); opacity: .5; border-radius: 12px 12px 0 0; }
.tp-scope .sc-w-art .c { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--type-text-color); }
.tp-scope .sc-w-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2em; }
.tp-scope .sc-w-card { padding: 1.4em; gap: .7em; }
.tp-scope .sc-w-ico { width: 2.2em; height: 2.2em; border-radius: 10px; background: var(--tp-soft); border: 1px solid var(--tp-line); margin-bottom: .4em; }
.tp-scope .sc-w-link { margin-top: auto; padding-top: .3em; text-decoration: underline; text-underline-offset: .22em; }
.tp-scope .sc-w-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6em 1.5em; padding-top: 1.2em; border-top: 1px solid var(--tp-line); }
@container tpframe (max-width: 900px) {
  .tp-scope .sc-w-hero { grid-template-columns: 1fr; gap: 1.6em; }
  .tp-scope .sc-w-art { aspect-ratio: 16 / 7; }
}
@container tpframe (max-width: 700px) {
  .tp-scope .sc-w-cards { grid-template-columns: 1fr; }
  .tp-scope .sc-w-nav .sc-w-links { display: none; }
}

/* ---------- 2b · tablet: two-pane notes app ---------- */
.tp-scope .sc-tablet { align-items: center; }
.tp-scope .sc-t-device { width: min(100%, 880px); padding: 12px; border: 1px solid var(--tp-mute); border-radius: 28px; background: var(--type-bg-color); }
.tp-scope .sc-t-screen { display: grid; grid-template-columns: minmax(150px, 30%) minmax(0, 1fr); border: 1px solid var(--tp-line); border-radius: 18px; overflow: hidden; }
.tp-scope .sc-t-side { display: flex; flex-direction: column; gap: .9em; padding: 1.3em 1em; background: var(--tp-soft); border-right: 1px solid var(--tp-line); min-width: 0; }
.tp-scope .sc-t-list { display: flex; flex-direction: column; gap: 6px; }
.tp-scope .sc-t-item { display: flex; flex-direction: column; gap: .15em; padding: .7em .8em; border-radius: 10px; min-width: 0; }
.tp-scope .sc-t-item.is-on { background: var(--type-bg-color); box-shadow: 0 0 0 1px var(--tp-line); }
.tp-scope .sc-t-main { display: flex; flex-direction: column; align-items: flex-start; gap: .95em; padding: clamp(18px, 4cqi, 32px); min-width: 0; }
.tp-scope .sc-t-title { font-size: calc(var(--type-heading-size) * 1.15); overflow-wrap: anywhere; }
.tp-scope .sc-t-checks { display: flex; flex-direction: column; gap: .55em; }
.tp-scope .sc-t-check { display: flex; align-items: center; gap: .7em; }
.tp-scope .sc-box.is-off { background: transparent; }
@container tpframe (max-width: 620px) {
  .tp-scope .sc-t-screen { grid-template-columns: 1fr; }
  .tp-scope .sc-t-side { display: none; }
}

/* ---------- 3 · dashboard ---------- */
.tp-scope .sc-dashboard { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; flex-direction: row; }
.tp-scope .sc-d-side { display: flex; flex-direction: column; gap: 4px; padding-right: 16px; border-right: 1px solid var(--tp-line); }
.tp-scope .sc-d-logo { padding: 4px 0 14px; color: var(--type-text-color); }
.tp-scope .sc-d-nav { display: flex; align-items: center; gap: 10px; padding: .45em .6em; border-radius: 8px; color: var(--tp-mute); }
.tp-scope .sc-d-nav.is-on { background: var(--tp-soft); color: var(--type-text-color); }
.tp-scope .sc-d-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tp-scope .sc-d-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tp-scope .sc-d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-scope .sc-d-actions .sc-btn { padding: .4em .9em; }
.tp-scope .sc-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: .4em; }
@container tpframe (max-width: 680px) {
  .tp-scope .sc-dashboard { grid-template-columns: 1fr; }
  .tp-scope .sc-d-side { display: none; }
}

/* ---------- 4 · e-commerce ---------- */
.tp-scope .sc-shop { gap: 14px; }
.tp-scope .sc-shop-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.tp-scope .sc-gallery { display: flex; flex-direction: column; gap: 10px; }
.tp-scope .sc-gallery-main { position: relative; aspect-ratio: 1; border-radius: 12px; background: linear-gradient(160deg, var(--tp-soft), var(--tp-line)); overflow: hidden; }
.tp-scope .sc-gallery-main .a { position: absolute; left: 22%; top: 24%; width: 46%; height: 52%; border-radius: 8px 8px 34% 34%; background: var(--type-text-color); opacity: .88; }
.tp-scope .sc-gallery-main .b { position: absolute; left: 62%; top: 36%; width: 18%; height: 24%; border: 8px solid var(--type-text-color); border-left: 0; border-radius: 0 40px 40px 0; opacity: .88; }
.tp-scope .sc-gallery-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tp-scope .sc-gallery-thumbs .sc-deco { aspect-ratio: 1; border-radius: 8px; background: var(--tp-line); }
.tp-scope .sc-gallery-thumbs .t2 { background: var(--tp-soft); outline: 1px solid var(--tp-line); }
.tp-scope .sc-shop-info { display: flex; flex-direction: column; gap: .8em; min-width: 0; }
.tp-scope .sc-shop-title { font-size: calc(var(--type-heading-size) * .95); }
.tp-scope .sc-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: .7em; }
.tp-scope .sc-price { font-size: calc(var(--type-heading-size) * .8); }
.tp-scope .sc-old { text-decoration: line-through; color: var(--tp-mute); }
.tp-scope .sc-rating { display: flex; align-items: center; gap: .6em; }
.tp-scope .sc-stars { letter-spacing: .12em; }
.tp-scope .sc-opt { display: flex; flex-direction: column; gap: .4em; }
.tp-scope .sc-chips { display: flex; gap: .5em; flex-wrap: wrap; }
.tp-scope .sc-stock { color: #17663a; }
.tp-scope .sc-crumb { color: var(--tp-mute); }
@container tpframe (max-width: 620px) { .tp-scope .sc-shop-grid { grid-template-columns: 1fr; } }

/* ---------- 5 · form ---------- */
.tp-scope .sc-form { align-items: center; }
.tp-scope .sc-form-card { width: min(100%, 460px); display: flex; flex-direction: column; gap: .5em; padding: clamp(14px, 4cqi, 28px); border: 1px solid var(--tp-line); border-radius: 14px; }
.tp-scope .sc-form-card .sc-field { margin-top: .5em; }
.tp-scope .sc-check { display: flex; gap: .7em; align-items: center; margin: .8em 0 .4em; }
.tp-scope .sc-box { width: 1.15em; height: 1.15em; border: 2px solid var(--type-text-color); border-radius: 4px; background: var(--type-text-color); flex: none; }
.tp-scope .sc-form-card .sc-cta-row { margin-top: .5em; }

/* ---------- 6 · data table ---------- */
.tp-scope .sc-data { gap: 16px; }
.tp-scope .sc-table-card { padding-inline: .4em; }
.tp-scope .sc-table-card > .sc-h4 { padding-inline: .7em; }
.tp-scope .sc-th { text-transform: uppercase; }

/* ---------- Specimen ---------- */
.tp-scope .sc-spec { display: flex; flex-direction: column; gap: clamp(22px, 5cqi, 40px); }
.tp-scope .sp-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--tp-line); }
.tp-scope .sp-hero-text { font-size: calc(var(--type-heading-size) * 3.4); line-height: 1; overflow-wrap: anywhere; max-width: none; }
.tp-scope .sp-meta { display: flex; flex-direction: column; gap: .5em; min-width: 0; }
.tp-scope .sp-name { font-size: 22px; line-height: 1.15; font-weight: 600; }
.tp-scope .sp-roletag { color: var(--tp-mute); font-family: var(--ui-font); }
.tp-scope .sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-scope .sp-chip { font-family: var(--ui-font); font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--tp-line); background: var(--tp-soft); color: var(--type-text-color); }
.tp-scope .sp-cz[data-state="ok"] { border-color: #17663a; color: #17663a; background: transparent; }
.tp-scope .sp-cz[data-state="bad"], .tp-scope .sp-cz[data-state="warn"] { border-color: var(--tp-warn); color: var(--tp-warn); background: transparent; }
.tp-scope .sp-block { display: flex; flex-direction: column; gap: 12px; }
.tp-scope .sp-block-title { font-family: var(--ui-font); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tp-mute); }
.tp-scope .sp-pangram { max-width: none; }
.tp-scope .sp-pangram-en { max-width: none; color: var(--tp-mute); font-size: calc(var(--type-body-size) * 1.5); }
.tp-scope .sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px 28px; }
.tp-scope .sp-set { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--tp-line); }
.tp-scope .sp-set-label { color: var(--tp-mute); font-family: var(--ui-font); }
.tp-scope .sp-glyph { font-size: max(26px, calc(var(--sp-size) * 2)); max-width: none; overflow-wrap: anywhere; }
.tp-scope .sp-ladder { display: flex; flex-direction: column; }
.tp-scope .sp-w-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--tp-line); }
.tp-scope .sp-w-num { color: var(--tp-mute); font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.tp-scope .sp-w-sample { font-size: max(18px, calc(var(--sp-size) * 1.5)); max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-scope .sp-roles { display: flex; flex-direction: column; gap: 14px; }
.tp-scope .sp-role { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.tp-scope .sp-role-tag { font-family: var(--ui-font); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tp-mute); }
@container tpframe (max-width: 620px) {
  .tp-scope .sp-hero { grid-template-columns: 1fr; }
  .tp-scope .sp-hero-text { font-size: min(calc(var(--type-heading-size) * 3.4), 19cqi); }
  .tp-scope .sp-w-row { grid-template-columns: 38px minmax(0, 1fr); }
  .tp-scope .sp-w-row > :nth-child(3) { grid-column: 2; }
  .tp-scope .sp-role { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Headings / paragraph / UI ---------- */
.tp-scope .hd-scale { display: flex; flex-direction: column; margin-bottom: 28px; }
.tp-scope .hd-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--tp-line); }
.tp-scope .hd-row > p { max-width: none; overflow-wrap: anywhere; }
.tp-scope .hd-tag { color: var(--tp-mute); font-family: var(--ui-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-scope .hd-article { display: flex; flex-direction: column; gap: .7em; margin-top: 10px; }
.tp-scope .sc-headings .sp-block-title + .hd-article { margin-top: 12px; }
.tp-scope .sc-paragraph { display: flex; flex-direction: column; gap: 14px; }
.tp-scope .pm-measure { color: var(--tp-mute); font-family: var(--ui-font); }
.tp-scope .pm-flow { display: flex; flex-direction: column; gap: 1em; }
.tp-scope .ui-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.tp-scope .ui-card { align-self: start; gap: .9em; }
