/* Reddit marketing deck: shared scene styles. Tokens come from /assets/tokens.css, runtime from /deck/deck.css.
 * Chapter styles live in ch-*.css and prefix every selector with their own class prefix (oa-, ob-, oc-, od-).
 * Shared prefixes here: rm- (shell, copy, labels), rd- (Reddit mocks), g- (Google results), ai- (AI answer), br- (browser).
 * Layouts (FORMAT section 7): desktop by default; compact = (max-width: 959px), (max-height: 599px);
 * phone = (max-width: 759px) and (orientation: portrait). No monospace anywhere; every text is at least 14 px. */

/* ---------- extra worlds ---------- */
.theme-reddit { --s-bg: #EDEFF1; --s-fg: #0F1A1C; --s-muted: #576F76; --s-line: #DFE4E7; --s-accent: #D93900; background: var(--s-bg); color: var(--s-fg); }
.theme-google { --s-bg: #fff; --s-fg: #202124; --s-muted: #4D5156; --s-line: #DFE1E5; --s-accent: #1A0DAB; background: var(--s-bg); color: var(--s-fg); }
.theme-claude { --s-bg: #F5F4EE; --s-fg: #1f1e1d; --s-muted: #6b6a66; --s-line: #E3E0D6; --s-accent: #D97757; background: var(--s-bg); color: var(--s-fg); }
.theme-paper { --s-muted: var(--ink-2, #555); }
.deck[data-theme="reddit"], .deck[data-theme="google"], .deck[data-theme="claude"] { --hud-fg: #111; }

/* ---------- the shell: every scene is built with shell() ---------- */
.scene .rm { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: clamp(14px, 2.6vh, 32px); align-items: start;
  padding: calc(var(--hud-top, 64px) + clamp(8px, 2.6vh, 36px)) clamp(24px, 5.5vw, 104px) calc(var(--hud-bottom, 100px) + clamp(4px, 1.4vh, 18px)); }
.rm-t { grid-column: 1 / -1; grid-row: 1; max-width: min(100%, 23em); font-size: clamp(28px, 2.9vw, 48px); line-height: 1.08; letter-spacing: -.028em; font-weight: 500; color: var(--s-fg); text-wrap: balance; position: relative; z-index: 2; margin: 0; }
.rm-vis { position: relative; min-width: 0; min-height: 0; }
.rm-side { position: relative; z-index: 2; display: grid; gap: 16px; align-content: start; min-width: 0; }

/* split: side text left, visual right */
.scene .rm--split { grid-template-columns: minmax(0, .36fr) minmax(0, .64fr); grid-template-rows: auto minmax(0, 1fr); column-gap: clamp(24px, 4vw, 72px); }
.rm--split .rm-t { grid-row: 1; }
.rm--split .rm-side { grid-column: 1; grid-row: 2; align-self: start; max-width: 25em; }
.rm--split .rm-vis { grid-column: 2; grid-row: 2; align-self: stretch; height: 100%; }
/* stage: side text directly under the title, the visual full width below it */
.rm--stage .rm-vis { grid-row: 3; align-self: stretch; height: 100%; }
.rm--stage .rm-side { grid-row: 2; grid-auto-flow: row; gap: 8px; align-items: start; max-width: 46em; }
/* full and right: the visual is a full-bleed layer behind the text (3D worlds) */
.scene > .rm-vis { position: absolute; inset: 0; z-index: 0; }
.scene .rm--full, .scene .rm--right { pointer-events: none; z-index: 1; }
.rm--full > *, .rm--right > * { pointer-events: auto; }
.rm--full .rm-t, .rm--right .rm-t { max-width: min(100%, 18.5em); }
.rm--full .rm-side { grid-row: 2; max-width: min(27em, 100%); align-self: start; }
.scene .rm--right { grid-template-columns: minmax(0, 1fr) minmax(0, 24em); }
.rm--right .rm-side { grid-column: 2; grid-row: 2 / 4; align-self: start; }

/* scrim so text stays readable over 3D (append with scrim(vis) after the canvas) */
.rm-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--s-bg) 86%, transparent) 0, color-mix(in srgb, var(--s-bg) 55%, transparent) 30%, transparent 50%),
    linear-gradient(0deg, color-mix(in srgb, var(--s-bg) 70%, transparent) 0, transparent 22%),
    linear-gradient(90deg, color-mix(in srgb, var(--s-bg) 62%, transparent) 0, transparent 42%); }
.rm-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.scene canvas { display: block; }
/* a DOM label over 3D, positioned with place(); never in perspective */
.rm-label { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; white-space: nowrap; font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--s-fg);
  text-shadow: 0 1px 2px rgb(0 0 0 / .55), 0 0 14px rgb(0 0 0 / .45); will-change: transform; }
.rm-label--pill { padding: 5px 10px; border-radius: 6px; background: rgb(8 8 10 / .72); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); text-shadow: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.rm-label--orange { color: #FFB07A; }
.rm-label--rose { color: #F2C9BD; }
.rm-label--muted { color: rgb(255 255 255 / .72); }

/* ---------- copy blocks ---------- */
.scene .rm-note { font-size: clamp(16px, 1.3vw, 20px); line-height: 1.48; color: var(--s-muted); max-width: 30em; margin: 0; }
.theme-night .rm-note, .theme-ink .rm-note { color: rgb(255 255 255 / .78); }
.rm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rm-steps li { position: relative; padding-left: 22px; font-size: clamp(16px, 1.26vw, 19px); line-height: 1.4; color: var(--s-fg); }
.rm-steps li::before { content: ""; position: absolute; left: 2px; top: .52em; width: 8px; height: 8px; border-radius: 50%; background: var(--cta, #FF7F32); }
.scene .rm-pit { display: flex; gap: 10px; align-items: flex-start; font-size: clamp(15px, 1.18vw, 18px); line-height: 1.45; color: var(--c-rose-t, #85503F); max-width: 30em; margin: 0; }
.rm-pit__i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border-radius: 4px; background: color-mix(in srgb, var(--c-rose, #E1B5A8) 45%, transparent); color: var(--c-rose-t, #85503F); }
.theme-ink .rm-pit, .theme-night .rm-pit { color: #F2C9BD; }
.theme-ink .rm-pit__i, .theme-night .rm-pit__i { background: rgb(225 181 168 / .16); color: #F2C9BD; }
.rm-src { display: inline-block; font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--s-muted); opacity: .86; }
.theme-night .rm-src, .theme-ink .rm-src { color: rgb(255 255 255 / .62); opacity: 1; }
.rm-src--line { display: block; margin-top: 4px; }
.rm-stat { display: grid; gap: 4px; align-content: start; }
.rm-stat__v { font-size: clamp(36px, 4.4vw, 76px); line-height: 1; letter-spacing: -.035em; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--s-fg); }
.rm-stat--sm .rm-stat__v { font-size: clamp(28px, 2.7vw, 44px); }
.rm-stat--xl .rm-stat__v { font-size: clamp(52px, 7.6vw, 132px); }
.rm-stat--orange .rm-stat__v { color: var(--cta, #FF7F32); }
.rm-stat--rose .rm-stat__v { color: var(--c-rose-t, #85503F); }
.theme-ink .rm-stat--rose .rm-stat__v, .theme-night .rm-stat--rose .rm-stat__v { color: #F2C9BD; }
.rm-stat__l { font-size: clamp(15px, 1.12vw, 18px); line-height: 1.4; color: var(--s-fg); max-width: 26em; }
.rm-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 4px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.rm-tag--line { box-shadow: inset 0 0 0 1px var(--s-line); color: var(--s-fg); }
.rm-tag--orange { background: var(--cta, #FF7F32); color: #fff; }
.rm-tag--rose { background: var(--c-rose, #E1B5A8); color: var(--c-rose-t, #85503F); }
.rm-tag--aqua { background: var(--c-aqua, #9CE7DD); color: var(--c-aqua-t, #1C6A60); }
.rm-tag--ink { background: #111; color: #fff; }
/* the Example tag on every illustrative mock */
.rm-example { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; color: #576F76; background: rgb(255 255 255 / .86); box-shadow: inset 0 0 0 1px #DFE4E7; white-space: nowrap; }
.theme-night .rm-example, .theme-ink .rm-example { color: rgb(255 255 255 / .72); background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16); }
.rm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* surfaces */
.rm-card { position: relative; background: #fff; border-radius: 8px; color: var(--ink, #111); box-shadow: inset 0 0 0 1px var(--ll-line, #E4E2DD), 0 1px 2px rgba(17,17,17,.04), 0 8px 22px -14px rgba(17,17,17,.12); }
.rm-dark { position: relative; background: #111; color: #fff; border-radius: 8px; box-shadow: 0 18px 40px -26px rgba(28,106,96,.4); }
.rm-stroke::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; background: var(--accent-stroke);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }

/* halftone bars: --v from 0 to 1 */
.rm-ht { position: relative; height: 18px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--s-line); overflow: hidden; --dot: #A9A6A0; }
.rm-ht i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(100% - 6px); background: radial-gradient(circle, var(--dot) 1.5px, transparent 1.9px) 0 0 / 5px 5px; clip-path: inset(0 calc((1 - var(--v, 0)) * 100%) 0 0); transition: clip-path 1.2s var(--ease, cubic-bezier(.2,.8,.2,1)); }
.rm-ht--v { width: 22px; height: auto; }
.rm-ht--v i { left: 3px; right: 3px; top: 3px; bottom: 3px; width: auto; clip-path: inset(calc((1 - var(--v, 0)) * 100%) 0 0 0); }
.rm-ht--orange { --dot: var(--cta, #FF7F32); }
.rm-ht--rose { --dot: var(--c-rose-d, #C79586); }
.rm-ht--aqua { --dot: var(--c-aqua-d, #66CDBF); }
.rm-ht--lilac { --dot: #A996D8; }
.rm-ht--grey { --dot: #A9A6A0; }
.theme-ink .rm-ht--grey, .theme-night .rm-ht--grey { --dot: rgb(255 255 255 / .42); }

/* departure board: Satoshi with tabular numbers (no monospace) */
.flap { display: inline-flex; gap: 2px; font: 600 clamp(18px, 1.8vw, 28px)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.flap__c { position: relative; display: inline-block; width: .74em; height: 1.32em; overflow: hidden; background: #0a0a0b; color: #fff; border-radius: 3px; text-align: center; box-shadow: inset 0 -1px 0 rgb(255 255 255 / .05); }
.flap__c::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .7); }
.flap__s { display: flex; flex-direction: column; transition: transform 1.3s cubic-bezier(.2, .8, .2, 1); }
.flap__s span { display: block; height: 1.32em; line-height: 1.32em; }

/* typing caret */
.rm-typing::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: currentColor; animation: rm-blink 1s steps(1) infinite; }
@keyframes rm-blink { 50% { opacity: 0; } }

/* sliders */
.scene input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --trk: rgb(0 0 0 / .16); }
.theme-ink input[type="range"], .theme-night input[type="range"] { --trk: rgb(255 255 255 / .3); }
.scene input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--trk); }
.scene input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--trk); }
.scene input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cta, #FF7F32), 0 4px 10px rgb(0 0 0 / .25); }
.scene input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cta, #FF7F32), 0 4px 10px rgb(0 0 0 / .25); }
.scene input[type="range"]:focus-visible { outline: 2px solid var(--cta, #FF7F32); outline-offset: 4px; border-radius: 4px; }

.scene [data-show]:not(.is-on), .scene [data-hide]:not(.is-on) { pointer-events: none; }
/* round 5: supporting text that belongs to another beat takes no room, so the current beat's text sits right under the title */
.scene .rm-side [data-show]:not(.is-on), .scene .rm-side [data-hide]:not(.is-on) { display: none; }
/* beat texts stacked in one cell start at its top edge */
.scene .rm-side [data-show], .scene .rm-side [data-hide] { align-self: start; }

/* ================================================================ Reddit kit (rd-) */
.rd-page, .rd-post, .rd-cm, .rd-side, .rd-prof, .rd-pcard, .g-serp, .ai, .br { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.rd-page { --rd-fg: #0F1A1C; --rd-mut: #576F76; --rd-line: #DFE4E7; --rd-pill: #E5EBEE; --rd-up: #D93900; --rd-blue: #0045AC;
  position: relative; container-type: inline-size; display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; color: var(--rd-fg); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 26 28 / .06), 0 30px 60px -34px rgb(15 26 28 / .35), inset 0 0 0 1px var(--rd-line); }
.rd-post, .rd-cm, .rd-side, .rd-prof, .rd-pcard { --rd-fg: #0F1A1C; --rd-mut: #576F76; --rd-line: #DFE4E7; --rd-pill: #E5EBEE; --rd-up: #D93900; --rd-blue: #0045AC; color: var(--rd-fg); }
.rd-bar { display: block; height: 8px; border-radius: 4px; background: #E2E7EA; }
.rd-bars { display: grid; gap: 9px; padding: 4px 0; }
.rd-bars--t { gap: 10px; }
.rd-bars--t .rd-bar { height: 12px; background: #CFD7DB; }
.rd-bar--n { width: 22px !important; height: 8px; }
.rd-bar--age { width: 52px !important; height: 7px; }
.rd-bar--user { width: 84px !important; height: 9px; background: #CFD7DB; }
.rd-bar--name { width: 110px !important; height: 10px; background: #CFD7DB; }
.rd-mark { display: inline-block; flex: none; border-radius: 50%; }
.rd-mark svg { display: block; }
.rd-av { position: relative; display: inline-block; flex: none; border-radius: 50%; overflow: hidden; background: #d5e2e6; }
.rd-av canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* top bar */
.rd-top { flex: none; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; box-shadow: inset 0 -1px 0 var(--rd-line); background: #fff; }
.rd-top__logo { display: inline-flex; align-items: center; gap: 8px; }
.rd-top__word { width: 54px; } .rd-top__word .rd-bar { height: 10px; background: #FF4500; opacity: .85; }
.rd-top__search { flex: 1; max-width: 420px; height: 36px; margin: 0 auto; border-radius: 999px; background: var(--rd-pill); color: var(--rd-mut); display: flex; align-items: center; padding: 0 12px; }
.rd-top__ic { color: var(--rd-mut); display: grid; }
.rd-page__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 20px; padding: 16px 20px 0; overflow: hidden; }
.rd-page__main { min-width: 0; min-height: 0; display: grid; align-content: start; gap: 12px; }
.rd-page__side { min-width: 0; display: grid; align-content: start; gap: 12px; }
@container (max-width: 640px) { .rd-page__body { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 0; } .rd-page__side { display: none; } .rd-top__search { max-width: none; } }
@container (max-width: 420px) { .rd-top { height: 46px; gap: 10px; padding: 0 12px; } .rd-top__word { display: none; } }

/* posts */
.rd-post { display: grid; gap: 8px; align-content: start; min-width: 0; }
.rd-post__h { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 20px; color: var(--rd-mut); }
.rd-post__sub { font-weight: 700; color: var(--rd-fg); white-space: nowrap; }
.rd-post__user, .rd-post__age { white-space: nowrap; }
.rd-post__promo { font-size: 14px; color: var(--rd-mut); }
.rd-post__more { margin-left: auto; display: grid; color: var(--rd-mut); }
.rd-post__t { margin: 0; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: var(--rd-fg); text-wrap: pretty; }
.rd-post__b { font-size: 15px; line-height: 1.5; color: var(--rd-fg); }
.rd-post__b p { margin: 0 0 6px; }
.rd-flair { justify-self: start; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--rd-pill); font-size: 14px; display: inline-flex; align-items: center; }
.rd-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.rd-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--rd-pill); color: var(--rd-fg); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rd-pill .rd-bar--n { width: 20px !important; background: #C9D2D6; }
.rd-pill--icon { padding: 0 10px; color: var(--rd-mut); }
.rd-pill > span[aria-hidden] { display: grid; }
.rd-vote { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px; border-radius: 999px; background: var(--rd-pill); color: var(--rd-fg); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .3s, color .3s; }
.rd-vote__up, .rd-vote__dn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--rd-mut); }
.rd-vote__n { min-width: 2ch; text-align: center; }
.rd-vote--up { background: var(--rd-up); color: #fff; }
.rd-vote--up .rd-vote__up, .rd-vote--up .rd-vote__dn { color: #fff; }
.rd-vote--dim { opacity: .5; filter: grayscale(1); }
.rd-op { font-size: 14px; font-weight: 700; color: var(--rd-blue); }

/* comments with thread lines */
.rd-cm { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; min-width: 0; padding-left: calc(var(--depth, 0) * 0px); }
.rd-cm__rail { display: grid; grid-template-rows: 32px 1fr; justify-items: center; }
.rd-cm__line { width: 1px; background: var(--rd-line); margin-top: 4px; }
.rd-cm__main { min-width: 0; display: grid; gap: 6px; align-content: start; padding-bottom: 6px; }
.rd-cm__h { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 14px; color: var(--rd-mut); }
.rd-cm__user { font-weight: 700; color: var(--rd-fg); }
.rd-cm__text { font-size: 15px; line-height: 1.5; color: var(--rd-fg); }
.rd-cm__text p { margin: 0 0 4px; }
.rd-cm__act { display: flex; align-items: center; gap: 4px; }
.rd-cm__act .rd-vote, .rd-cm__act .rd-pill { background: transparent; height: 30px; }
.rd-cm__act .rd-vote--up { background: var(--rd-up); }
.rd-cm__kids { display: grid; gap: 4px; }
.rd-cm--hi > .rd-cm__main { position: relative; }
.rd-cm--hi > .rd-cm__main::before { content: ""; position: absolute; inset: -6px -10px 0 -46px; border-radius: 12px; background: rgb(255 127 50 / .08); box-shadow: inset 0 0 0 1.5px rgb(255 127 50 / .5); z-index: -1; }

/* sidebar */
.rd-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.rd-side__card { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: #F6F8F9; }
.rd-side__head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.rd-side__stats { display: flex; gap: 24px; } .rd-side__stats .rd-bar { width: 64px !important; }
.rd-side__label { font-size: 14px; font-weight: 700; color: var(--rd-mut); }
.rd-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rd-rule { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; align-items: start; padding: 8px 8px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--rd-fg); transition: background .4s; }
.rd-rule__n { font-weight: 700; color: var(--rd-mut); font-variant-numeric: tabular-nums; }
.rd-rule .rd-bar { margin-top: 5px; }
.rd-rule.is-hi { background: rgb(255 127 50 / .14); box-shadow: inset 0 0 0 1px rgb(255 127 50 / .45); }

/* profile */
.rd-prof { display: grid; gap: 10px; min-width: 0; }
.rd-prof__banner { height: clamp(56px, 9vh, 96px); border-radius: 12px; background: linear-gradient(120deg, #CDBDEB, #8DD8F3 55%, #9CE7DD); }
.rd-prof__row { display: flex; align-items: flex-end; gap: 14px; margin-top: calc(-1 * clamp(30px, 4vh, 40px)); padding-left: 16px; }
.rd-prof__av { box-shadow: 0 0 0 4px #fff; }
.rd-prof__names { display: grid; padding-bottom: 4px; }
.rd-prof__name { font-size: clamp(20px, 1.7vw, 26px); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.rd-prof__user { font-size: 14px; color: var(--rd-mut); }
.rd-prof__bio { margin: 0; min-height: 1.5em; font-size: 15px; line-height: 1.5; color: var(--rd-fg); }
.rd-prof__tabs { display: flex; gap: 10px; padding: 4px 0 2px; }
.rd-prof__tabs .rd-tab { height: 30px; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 1px var(--rd-line); flex: none; width: 76px !important; }
.rd-prof__tabs .rd-tab.is-on { background: var(--rd-pill); box-shadow: none; }
.rd-pcard { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: #F6F8F9; }
.rd-pcard__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rd-pcard__k { display: grid; }
.rd-prof__k { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rd-pcard__kl { font-size: 14px; color: var(--rd-mut); }
.rd-pcard__cake { color: var(--rd-mut); display: grid; }
.rd-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: #E3EEFF; color: #0045AC; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ================================================================ Google results (g-) */
.g-serp { --g-fg: #202124; --g-mut: #4D5156; --g-line: #DFE1E5; --g-blue: #1A0DAB; position: relative; container-type: inline-size; display: grid; gap: 14px; align-content: start; padding: 18px clamp(16px, 3cqw, 28px) 12px; background: #fff; color: var(--g-fg); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(32 33 36 / .06), 0 30px 60px -34px rgb(32 33 36 / .32), inset 0 0 0 1px var(--g-line); }
.g-top { display: flex; align-items: center; gap: 18px; }
.g-logo { display: flex; gap: 3px; flex: none; }
.g-logo i { width: 12px; height: 12px; border-radius: 50%; background: #4285F4; }
.g-logo i:nth-child(2) { background: #EA4335; } .g-logo i:nth-child(3) { background: #FBBC05; } .g-logo i:nth-child(4) { background: #34A853; }
.g-q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 24px; box-shadow: 0 1px 6px rgb(32 33 36 / .18); font-size: 16px; }
.g-q__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-q__ic { color: #4285F4; display: grid; }
.g-tabs { display: flex; gap: 22px; padding: 0 0 8px 4px; box-shadow: inset 0 -1px 0 #EBEBEB; }
.g-tabs .rd-bar { width: 52px !important; height: 8px; } .g-tabs .is-on { background: #1A73E8; opacity: .7; }
.g-res { display: grid; gap: 22px; align-content: start; }
.g-r { display: grid; gap: 6px; max-width: 640px; }
.g-r__site { display: flex; align-items: center; gap: 10px; }
.g-r__fav { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #F1F3F4; color: #5f6368; }
.g-r__crumb { display: grid; gap: 1px; min-width: 0; font-size: 14px; line-height: 1.35; }
.g-r__crumb .rd-bar { height: 7px; }
.g-r__name { color: var(--g-fg); }
.g-r__sub { color: var(--g-mut); position: relative; }
.g-r__sub.is-hi { background: linear-gradient(transparent 55%, rgb(255 127 50 / .4) 55%) no-repeat 0 0 / 100% 100%; }
.g-r__t { margin: 0; font-size: clamp(18px, 1.45vw, 21px); line-height: 1.3; font-weight: 400; color: var(--g-blue); }
.g-r .rd-bars .rd-bar { height: 7px; background: #E8EAED; }

/* ================================================================ AI answer (ai-) */
.ai { position: relative; container-type: inline-size; display: grid; gap: 16px; align-content: start; padding: 20px clamp(16px, 3cqw, 28px); background: #fff; color: #0d0d0d; border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 30px 60px -34px rgb(0 0 0 / .3), inset 0 0 0 1px #E5E5E5; }
.ai__q { justify-self: end; max-width: 78%; padding: 10px 16px; border-radius: 18px; background: #F4F4F4; font-size: 16px; line-height: 1.45; }
.ai__q p, .ai__body p { margin: 0; }
.ai__a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.ai__mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px #E5E5E5; color: #0d0d0d; }
.ai__body { display: grid; gap: 8px; font-size: 16px; line-height: 1.55; }
.ai__body .rd-bar { height: 8px; background: #ECECEC; }
.ai__srcs { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-src { display: grid; gap: 6px; width: clamp(140px, 30cqw, 200px); padding: 10px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #E5E5E5; font-size: 14px; transition: box-shadow .4s, background .4s; }
.ai-src__h { display: flex; align-items: center; gap: 8px; color: #5d5d5d; }
.ai-src__fav { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #F1F1F1; color: #777; }
.ai-src__l { font-weight: 600; color: #0d0d0d; }
.ai-src .rd-bar { height: 7px; background: #ECECEC; }
.ai-src--neg { box-shadow: inset 0 0 0 1.5px #C79586; background: #FBF3F0; }

/* ================================================================ browser window (br-) */
.br { position: relative; container-type: inline-size; display: flex; flex-direction: column; min-height: 0; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 30px 60px -34px rgb(0 0 0 / .35), inset 0 0 0 1px #DADCE0; }
.br__bar { flex: none; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; background: #F1F3F4; box-shadow: inset 0 -1px 0 #DADCE0; color: #202124; font-size: 14px; font-weight: 500; }
.br__dots { display: flex; gap: 6px; } .br__dots i { width: 11px; height: 11px; border-radius: 50%; background: #D7D9DC; }
.br__tab { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 8px 8px 0 0; background: #fff; white-space: nowrap; }
.br__tab .rd-bar { width: 80px !important; }
.br__url { flex: 1; min-width: 0; height: 28px; border-radius: 999px; background: #fff; display: flex; align-items: center; padding: 0 12px; }
.br__url .rd-bar { height: 7px; }
.br__eye { display: grid; }
.br__body { flex: 1; min-height: 0; overflow: hidden; }
.br--dark { background: #202124; box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 30px 60px -30px rgb(0 0 0 / .55), inset 0 0 0 1px #3c4043; }
.br--dark .br__bar { background: #35363A; color: #E8EAED; box-shadow: inset 0 -1px 0 #4a4c50; }
.br--dark .br__tab, .br--dark .br__url { background: #202124; }
.br--dark .br__dots i { background: #5f6368; }
.br--dark .br__bar .rd-bar { background: #5a5d62; }
@container (max-width: 380px) { .br__url { display: none; } }

/* ---------- compact: short or narrow landscape ---------- */
@media (max-width: 959px), (max-height: 599px) {
  .scene .rm { row-gap: 10px; padding-left: clamp(20px, 4vw, 40px); padding-right: clamp(20px, 4vw, 40px); padding-top: calc(var(--hud-top, 52px) + 6px); padding-bottom: calc(var(--hud-bottom, 80px) + 2px); }
  .rm-t { font-size: clamp(22px, 3.1vw, 30px); line-height: 1.12; letter-spacing: -.02em; }
  .rm--full .rm-t, .rm--right .rm-t { max-width: min(100%, 20em); }
  .rm-side { gap: 10px; }
  .scene .rm-note { font-size: 15px; line-height: 1.42; }
  .rm-steps li { font-size: 15px; }
  .scene .rm-pit { font-size: 14px; }
  .rm-stat__v { font-size: clamp(28px, 4.4vw, 44px); }
  .rm-stat--xl .rm-stat__v { font-size: clamp(40px, 7vw, 64px); }
  .rm-stat__l { font-size: 14px; }
  .rm-label { font-size: 14px; }
  .rd-post__t { font-size: 17px; }
  .rd-post__b, .rd-cm__text, .rd-prof__bio { font-size: 14px; }
  .rd-top { height: 44px; }
  .g-r__t { font-size: 17px; }
  .g-q { height: 40px; font-size: 15px; }
  .ai__q, .ai__body { font-size: 15px; }
  .flap { font-size: 18px; }
}

/* ---------- phone: portrait and narrower than 760 ---------- */
@media (max-width: 759px) and (orientation: portrait) {
  .scene .rm { padding-left: 16px; padding-right: 16px; row-gap: 12px; padding-top: calc(var(--hud-top, 56px) + 10px); padding-bottom: calc(var(--hud-bottom, 96px) + 4px); }
  .rm-t { font-size: clamp(22px, 6.2vw, 27px); line-height: 1.15; letter-spacing: -.02em; }
  .scene .rm--split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: 12px; }
  .rm--split .rm-side { grid-column: 1; grid-row: 2; align-self: start; }
  .rm--split .rm-vis { grid-column: 1; grid-row: 3; }
  .rm--stage .rm-side { grid-auto-flow: row; gap: 10px; }
  .scene .rm--right { grid-template-columns: minmax(0, 1fr); }
  .rm--right .rm-side { grid-column: 1; grid-row: 2; align-self: start; }
  .rm--full .rm-side { max-width: 100%; }
  .rm-side { gap: 10px; }
  .scene .rm-note { font-size: 15px; }
  .rm-steps { gap: 8px; }
  .rm-steps li { font-size: 15px; padding-left: 18px; }
  .scene .rm-pit { font-size: 14px; }
  .rm-pit__i { width: 22px; height: 22px; }
  .rm-stat__v { font-size: clamp(30px, 9vw, 40px); }
  .rm-stat__l { font-size: 14px; }
  .rm-label { font-size: 14px; }
  .rd-post__t { font-size: 16px; }
  .rd-post__b, .rd-cm__text, .rd-prof__bio { font-size: 14px; }
  .g-r__t { font-size: 16px; }
  .ai__q, .ai__body { font-size: 14px; }
  .flap { font-size: 16px; }
}
/* round 5: a later beat's text never holds space in the column, even where a chapter rule forces its display */
.scene .rm-side [data-show]:not(.is-on).od-orb__goo { display: none !important; }
