/* The Lab: map, machine, level HUD, result card. Colours come from base.css tokens. */
.lab-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  padding: calc(8px + env(safe-area-inset-top)) 16px 0;
}

.lab-screen > .hud, .lab-screen > .topbar { flex: none; }
.lab-map { gap: 8px; }
.lab-map > .topbar { min-height: 48px; }
.lab-total { min-height: 36px; padding: 0 12px; font-weight: 800; font-size: var(--fs-s); font-variant-numeric: tabular-nums; white-space: nowrap; gap: 2px; }
.lab-total-star { color: var(--ch-accent, var(--t-good)); font-size: var(--fs-m); }
.lab-total .quiet { color: var(--quiet); font-weight: 700; }

/* ---- chapter hero card ---- */
.lab-hero { flex: none; display: grid; gap: 6px; width: 100%; min-height: 113px; padding: 12px 14px; overflow: hidden; text-align: left; color: inherit; font: inherit; }
button.lab-hero { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lab-hero-art { position: absolute; right: 14px; top: 4px; display: grid; place-items: center; pointer-events: none; }
.lab-hero-art > * { display: block; }
.lab-hero-top, .lab-hero-bar { position: relative; }
.lab-hero-top { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-right: 92px; }
.lab-hero-tile {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #E6D9FF;
  background: linear-gradient(160deg, rgba(124, 77, 255, .3), rgba(255, 255, 255, .06)); box-shadow: 0 0 16px rgba(155, 107, 255, .3), inset 0 0 0 1px rgba(201, 168, 255, .45);
}
.lab-hero-title { min-width: 0; font-size: var(--fs-l); font-weight: 800; letter-spacing: .05em; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-sealed { flex: none; min-height: 24px; padding: 0 8px; color: var(--gold, #FCD34D); }
.lab-hero-meta { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.lab-hero-ch { position: absolute; right: 14px; top: 70px; }
.lab-hero-label { font-size: var(--fs-s); color: var(--quiet); }
.lab-hero-ch { min-height: 24px; padding: 0 10px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; }
.lab-hero-bar { display: flex; align-items: center; gap: 10px; }
.lab-bar { position: relative; flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.lab-bar b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, #8458FF, #5CE1E6); box-shadow: 0 0 12px rgba(92, 225, 230, .55); }
.lab-bar i { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -6px; border-radius: 50%; background: #241A60; box-shadow: 0 0 0 1.5px rgba(201, 168, 255, .6); }
.lab-bar i.on { background: #FFE08A; box-shadow: 0 0 0 1.5px #FFF3B0, 0 0 8px #FFB36B; }
.lab-hero-pct { min-width: 40px; text-align: right; font-size: var(--fs-s); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- lit props over the backdrop (mascot, dome, pedestals); static, never under a node ---- */
.lab-path-wrap { position: relative; }
.lab-path { position: relative; z-index: 1; }
.lab-props { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lab-props > .lab-prop { position: absolute; transform: translate(-50%, -100%); }
.lab-prop-one { display: block; }
.lab-prop-stack { position: relative; display: flex; flex-direction: column; align-items: center; }
.lab-prop-top { position: relative; z-index: 1; display: flex; justify-content: center; }
.lab-prop-stack > .gfx-pedestal { display: block; width: 100%; height: auto; }
.lab-prop-glow { position: absolute; left: 50%; top: 40%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g) 38%, transparent), transparent 65%); }

/* ---- map ---- */
.lab-scroll { -webkit-mask-image: linear-gradient(transparent, #000 20px); mask-image: linear-gradient(transparent, #000 20px); flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -16px; padding: 0 16px 100px; scrollbar-width: none; }
.lab-scroll::-webkit-scrollbar { display: none; }
.lab-machine {
  position: relative; padding: 8px 0 4px;
  background: radial-gradient(ellipse 70% 60% at 50% 55%, rgba(155, 107, 255, .16), transparent 70%);
}
.machine { display: block; width: 100%; height: auto; overflow: visible; }
.lab-machine-sheet { display: grid; gap: 8px; }
.lab-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 36px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(11, 8, 32, .9) 60%);
  pointer-events: none;
}
.lab-bottom > * { pointer-events: auto; }

/* ---- machine parts ---- */
.machine .lit { opacity: 0; transition: opacity .9s ease .3s; }
.machine .mv {
  transform-box: fill-box; transform-origin: center;
  transition: transform 1.2s cubic-bezier(.34, 1.4, .5, 1);
}
.machine .spin { transform-box: fill-box; transform-origin: center; }
.machine .seam { opacity: 0; transition: opacity .9s ease .6s; }
.machine .m-threshold { font-size: var(--fs-xs, 12px); font-weight: 700; fill: var(--quiet); letter-spacing: .08em; }
.machine .halo { transform-box: fill-box; transform-origin: center; }
.machine .light .lit .halo { animation: m-breathe 3.2s ease-in-out infinite; }

.machine.on1 [data-g="1"] .lit, .machine.on2 [data-g="2"] .lit, .machine.on3 [data-g="3"] .lit,
.machine.on3 .seam { opacity: 1; }
.machine:not(.on1) [data-g="1"] .mv, .machine:not(.on2) [data-g="2"] .mv, .machine:not(.on3) [data-g="3"] .mv {
  transform: translate(var(--dx), var(--dy)) rotate(var(--r));
}
.machine.on1 [data-g="1"] .spin { animation: m-spin 16s linear infinite; }
.machine.on2 [data-g="2"] .spin { animation: m-spin 16s linear infinite; }
.machine.on3 [data-g="3"] .spin { animation: m-spin 40s linear infinite; }
.machine .spin.rev { animation-direction: reverse !important; }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-breathe { 50% { transform: scale(1.18); opacity: .8; } }

/* ---- path ---- */
.lab-path-wrap { padding-top: 4px; }
.lab-path { display: block; overflow: visible; }
.lab-scenery { opacity: .8; pointer-events: none; }
.lab-path .seg { fill: none; stroke: rgba(178, 140, 255, .26); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 12; }
.lab-path .seg.open { stroke: url(#path-grad); stroke-width: 6; stroke-dasharray: none; }
.lab-path .seg.glow { fill: none; stroke: url(#path-grad); stroke-width: 16; stroke-linecap: round; opacity: .22; }
.node { cursor: pointer; outline: none; }
.node .disc { fill: url(#orb-fill); stroke: rgba(201, 168, 255, .85); stroke-width: 2.5; transition: transform .12s; }
.node .rim { fill: none; stroke: url(#orb-rim); stroke-width: 2; }
.node .sheen { fill: rgba(255, 255, 255, .3); }
.node .num { fill: var(--text); font-weight: 800; font-size: var(--fs-l, 22px); text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: rgba(30, 10, 70, .45); stroke-width: 3px; }
.node.done .disc { stroke: rgba(200, 170, 255, .8); stroke-width: 2; }
.node.open .disc { stroke: #7DF3FF; }
.node.current .disc { fill: url(#orb-cur); stroke: rgba(255, 255, 255, .92); stroke-width: 3; }
.node.current .rim { stroke: rgba(255, 255, 255, .7); }
.node.current .num { font-size: var(--fs-xl, 32px); stroke: rgba(150, 30, 60, .5); }
.node .orbit { fill: none; stroke: url(#orb-ring); stroke-width: 2.6; stroke-linecap: round; }
.node .orbit.back { opacity: .45; }
.node .pointer { fill: rgba(255, 255, 255, .14); stroke: #D9C2FF; stroke-width: 2; stroke-linejoin: round; }
.node .stage-glow { fill: url(#stage-g); }
.node .stage-rim { fill: none; stroke: rgba(255, 130, 220, .8); stroke-width: 1.6; }
.node.current .pulse { fill: none; stroke: #FFB36B; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: node-pulse 1.8s ease-out infinite; }
.node.locked { cursor: default; color: #8C84C8; }
.node.locked .disc { fill: rgba(30, 22, 70, .78); stroke: rgba(178, 140, 255, .26); }
.node.locked .rim { opacity: .35; }
.node.locked .sheen { opacity: .3; }
.node.boss .disc { stroke: #FCD34D; stroke-width: 3.5; }
.node.boss.locked .disc { stroke: rgba(252, 211, 77, .3); }
.node:focus-visible .disc { stroke: var(--mint); stroke-width: 4; }
.node:active .disc { transform: scale(.94); }
.node .star { fill: rgba(255, 255, 255, .2); stroke: rgba(255, 255, 255, .12); stroke-width: 1; stroke-linejoin: round; }
.node .star.on { fill: var(--t-good); stroke: #FFF3B0; }

/* ---- chapter tabs: four glass tiles in one row, always visible (outside the scroller) ---- */
.lab-chapters { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.lab-chapters .lab-ch.tile { min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; min-width: 44px; min-height: 44px; padding: 6px 2px 7px; color: inherit; font: inherit; text-align: center; -webkit-tap-highlight-color: transparent; }
.lab-island { display: block; width: 56px; max-width: 100%; height: 40px; margin: 0 auto -2px; }
.lab-ch.locked { opacity: .62; box-shadow: none; }
.lab-ch.locked .lab-island { filter: saturate(.5); opacity: .7; }
.lab-ch-num { font-size: var(--fs-xs, 12px); font-weight: 800; letter-spacing: .08em; color: var(--text); line-height: 1.2; }
.lab-ch.active .lab-ch-num { color: var(--ch-accent, #7DF3FF); }
.lab-ch-name { font-size: var(--fs-xs, 12px); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.lab-ch.locked .lab-ch-num, .lab-ch.locked .lab-ch-name { color: var(--quiet); }
.lab-ch-soon { display: grid; font-size: var(--fs-xs, 12px); font-weight: 600; line-height: 1.15; color: var(--quiet); }
.lab-ch-lock { display: inline-flex; align-items: center; justify-content: center; gap: 1px; white-space: nowrap; }
.lab-ch.pick { cursor: pointer; }
.lab-ch.pick:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
@keyframes node-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }

/* ---- current objective (the bell on ch.1; the next lamp or level elsewhere) ---- */
.lab-objective {
  flex: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 8px 14px;
  text-align: left; color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.lab-objective:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.lab-obj-tile {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #E6D9FF;
  background: linear-gradient(160deg, rgba(124, 77, 255, .3), rgba(255, 255, 255, .06)); box-shadow: 0 0 16px rgba(155, 107, 255, .3), inset 0 0 0 1px rgba(201, 168, 255, .45);
}
.lab-bell-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.lab-obj-label { font-size: var(--fs-xs, 12px); letter-spacing: .16em; }
.lab-obj-title { font-size: var(--fs-m, 17px); font-weight: 800; line-height: 1.15; }
.lab-obj-title.long { font-size: var(--fs-s, 14px); }
.lab-obj-chev { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: #E6D9FF; }

/* ---- level ---- */
.lab-pause { display: grid; gap: 12px; }
.lab-pause .title { margin-bottom: 4px; }
.lab-stage-wrap { position: relative; flex: 1; min-height: 0; margin: 0 -16px; }
.lab-stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.lab-result {
  touch-action: none;
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11, 8, 32, .55), rgba(11, 8, 32, .92));
  animation: lab-fade .25s ease-out;
}
.lab-card {
  touch-action: none;
  width: 100%; text-align: center; padding: 18px 16px 14px; border-radius: var(--r-hero, 28px); overflow: hidden; animation: slide-up .3s ease-out;
  background: linear-gradient(rgba(38, 23, 86, .96), rgba(20, 12, 54, .97));
  box-shadow: 0 0 28px rgba(255, 106, 213, .35), 0 0 60px rgba(124, 77, 255, .25), 0 18px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.lab-card::before { padding: 2px; background: linear-gradient(135deg, #FF6AD5, #B28CFF 50%, #5CE1E6); }
.lab-card[data-pass="yes"] .lab-stars { position: relative; }
.lab-card[data-pass="yes"] .lab-stars::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 72%; height: 8px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(255, 200, 87, .85), rgba(255, 154, 92, .3) 45%, transparent 72%); pointer-events: none; }
.lab-card-label { letter-spacing: .2em; }
.lab-avg-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 6px; }
.lab-avg-row .gfx-laurel { width: 22px; height: 52px; flex: none; }
.lab-avg { margin: 0; font-size: var(--fs-score, var(--fs-hero, 48px)); color: var(--tier, var(--text)); text-shadow: 0 0 22px var(--tier, transparent); }
.lab-card[data-pass="yes"] .lab-avg { background: linear-gradient(180deg, #FFF0B8, #FF9A5C); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 0 14px rgba(255, 154, 92, .55)); }
.lab-chips { display: flex; justify-content: center; gap: 8px; }
.lab-chip { padding: 2px 12px; border-radius: 999px; font-size: var(--fs-s, 14px); font-weight: 800; font-variant-numeric: tabular-nums; background: var(--tier); color: var(--ink); box-shadow: 0 0 12px color-mix(in srgb, var(--tier) 45%, transparent); }
.lab-stars { display: flex; justify-content: center; gap: 8px; margin: 22px 0 12px; }
.lab-star { width: 52px; height: 52px; }
.lab-star polygon { fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; stroke-linejoin: round; }
.lab-star { transform-box: fill-box; transform-origin: center; }
.lab-star.on { animation: star-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.lab-star.on polygon { fill: url(#lab-star-grad); stroke: #FFF3B0; }
.lab-star.on { filter: drop-shadow(0 0 8px rgba(252, 211, 77, .75)); }
.lab-msg { min-height: 22px; margin: 0 0 4px; font-weight: 600; }
.lab-wave { height: 40px; margin: 6px -13px 20px; pointer-events: none; overflow: hidden; }
.lab-wave .gfx-wave { height: 56px; margin-top: -8px; }
.lab-actions { position: relative; display: grid; gap: 10px; }
.lab-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lab-actions .btn-quiet:only-child { width: 100%; }
@keyframes star-pop { from { transform: scale(.3) rotate(-30deg); } to { transform: none; } }
@keyframes lab-fade { from { opacity: 0; } }

@media (max-width: 360px) { .lab-avg { font-size: var(--fs-hero, 48px); } .lab-star { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  .lab-star.on, .lab-result, .lab-card { animation: none !important; }
  .machine .lit, .machine .mv { transition: none !important; }
  .node.current .pulse { animation: none !important; opacity: .6; }
}

/* ---- order bubble (customers) ---- */
.lab-order {
  position: absolute; left: 16px; right: 16px; top: 16px; z-index: 1; display: flex; align-items: flex-end; gap: 12px;
  animation: lab-fade .2s ease-out; pointer-events: none;
}
.lab-order[hidden] { display: none; }
.lab-customer { display: inline-flex; position: relative; font-size: var(--fs-hero, 48px); line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.lab-react { position: absolute; right: -14px; top: -14px; font-size: var(--fs-l, 22px); animation: star-pop .35s cubic-bezier(.34, 1.56, .64, 1); }
.lab-bubble {
  position: relative; flex: 1; padding: 10px 14px; border-radius: 20px 20px 20px 6px;
  background: rgba(255, 241, 230, .95); color: var(--ink);
  box-shadow: 0 0 22px rgba(255, 154, 92, .35);
}
.lab-bubble .label { color: #8A4B2A; font-size: var(--fs-xs, 12px); }
.lab-say { font-weight: 800; font-size: var(--fs-m, 17px); line-height: 1.2; }
@media (prefers-reduced-motion: reduce) { .lab-order, .lab-react { animation: none !important; } }

/* ---- call your cut ---- */
.lab-calls { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; padding: 4px 0 8px; min-height: 44px; }
.lab-calls[hidden] { display: none; }
.lab-call-note { white-space: nowrap; margin-right: 4px; font-size: var(--fs-xs, 12px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lab-call-note.hit { color: var(--mint); }
.lab-call-note.near { color: var(--text); }
.lab-call { min-height: 44px; min-width: 44px; padding: 0 12px; font-size: var(--fs-xs, 12px); letter-spacing: .08em; color: var(--tier); }
.lab-call[aria-pressed="true"] { background: var(--tier); color: #0E0B22; box-shadow: none; }
.lab-calls.locked .lab-call { opacity: .55; pointer-events: none; }
.lab-calls.locked .lab-call[aria-pressed="true"] { opacity: 1; }

/* ---- first launch (#/lab/1?first=1): the eraser alone until the first cut lands ---- */
.lab-screen.first .hud { visibility: hidden; }
.lab-screen.first .lab-calls { display: none; }
.lab-intro { flex: none; display: grid; justify-items: center; gap: 8px; padding: 4px 0 8px; text-align: center; }
.lab-intro[hidden] { display: none; }
.lab-caption { margin: 0; font-size: var(--fs-l, 22px); font-weight: 800; }
.lab-sockets { display: flex; gap: 8px; min-height: 28px; opacity: 0; }
.lab-sockets.on { opacity: 1; animation: lab-fade .35s ease-out; }
.lab-screen.first .lab-sockets:not(.on) { visibility: hidden; }
.lab-socket { font-size: var(--fs-xl, 32px); line-height: 28px; color: rgba(255, 255, 255, .12); }

/* ---- the Lab bell: first repaired component (12 stars), shown as the objective card ---- */
.lab-bell-note { font-size: var(--fs-s, 14px); color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-obj-tile svg { width: 34px; height: 30px; overflow: visible; }
.lab-bell .bell-body .shell, .lab-bell .bell-body .top, .lab-bell .clapper { fill: rgba(130, 110, 230, .16); stroke: rgba(178, 140, 255, .4); stroke-width: 2; }
.lab-bell.on .bell-body .shell { fill: url(#bell-grad); stroke: rgba(255, 255, 255, .8); }
.lab-bell.on .bell-body .top, .lab-bell.on .clapper { fill: #FFD27A; stroke: rgba(255, 255, 255, .8); }
.lab-bell.on .lab-obj-tile { box-shadow: 0 0 18px rgba(255, 180, 107, .5), inset 0 0 0 1px rgba(255, 210, 122, .6); }
.lab-bell.locked { cursor: default; }
.lab-bell.locked .lab-obj-chev { opacity: .35; }

/* ---- per-chapter backdrop motif (CSS only, static) and accent ---- */
.lab-screen[data-ch] { isolation: isolate; }
.lab-screen[data-ch]::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lab-screen[data-ch="1"] { --ch-accent: #7DF3FF; }
.lab-screen[data-ch="2"] { --ch-accent: #FFC48A; }
.lab-screen[data-ch="3"] { --ch-accent: #B28CFF; }
.lab-screen[data-ch="4"] { --ch-accent: #FFC857; }
.lab-screen[data-ch="1"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97'%3E%3Cpath d='M28 0 56 16v32L28 64 0 48V16Zm0 64v33M0 48 L-28 64M56 48l28 16' fill='none' stroke='%237DF3FF' stroke-opacity='.09' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 56px 97px;
  -webkit-mask-image: linear-gradient(#000, transparent 85%); mask-image: linear-gradient(#000, transparent 85%);
}
.lab-screen[data-ch="2"]::before {
  background: radial-gradient(circle at 20% 22%, rgba(255, 196, 138, .22) 0 3px, transparent 4px), radial-gradient(circle at 78% 36%, rgba(255, 154, 92, .2) 0 4px, transparent 5px),
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(255, 154, 92, .16), transparent 70%);
}
.lab-screen[data-ch="3"]::before {
  background: linear-gradient(115deg, transparent 0 30%, rgba(184, 77, 255, .08) 30% 55%, transparent 55%), linear-gradient(65deg, transparent 0 60%, rgba(107, 91, 255, .1) 60% 80%, transparent 80%),
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(184, 77, 255, .2), transparent 70%);
}
.lab-screen[data-ch="4"]::before {
  background: repeating-linear-gradient(135deg, rgba(255, 200, 87, .07) 0 10px, transparent 10px 28px), radial-gradient(ellipse 90% 40% at 50% 0%, rgba(255, 138, 61, .14), transparent 70%);
  -webkit-mask-image: linear-gradient(#000, transparent 80%); mask-image: linear-gradient(#000, transparent 80%);
}
.lab-caption.quiet { font-size: var(--fs-s, 14px); font-weight: 600; }
.lab-swipe { margin: 12px 0 0; font-size: var(--fs-xs, 12px); }

/* ---- short phones (360x640): compress the map head so three level orbs stay visible ---- */
@media (max-height: 700px) {
  .lab-map { gap: 6px; }
  .lab-map > .topbar { min-height: 44px; }
  .lab-hero { gap: 4px; padding: 8px 12px 10px; }
  .lab-hero-top { min-height: 40px; padding-right: 64px; }
  .lab-hero-tile { width: 40px; height: 40px; border-radius: 12px; }
  .lab-hero-art { right: 8px; top: 6px; transform: scale(.62); transform-origin: top right; }
  .lab-hero-label { display: none; }
  .lab-hero-ch { display: none; }
  .lab-chapters .lab-ch.tile { padding: 4px 2px 5px; }
  .lab-island { max-width: 34px; }
  .lab-objective { min-height: 48px; padding: 4px 12px; gap: 10px; }
  .lab-obj-tile { width: 38px; height: 38px; border-radius: 12px; }
  .lab-bell-note { display: none; }
  .lab-card { padding: 12px 14px 10px; }
  .lab-star { width: 40px; height: 40px; }
  .lab-stars { margin: 8px 0 2px; }
  .lab-msg { margin: 0; min-height: 20px; }
  .lab-wave { height: 28px; margin: 2px -11px 12px; }
  .lab-stars { margin: 14px 0 8px; }
  .lab-actions { gap: 8px; }
  .lab-swipe { margin-top: 6px; }
}

/* ---- large text: short forms, no ellipsis ---- */
html[data-text="large"] .lab-ch-name { white-space: normal; overflow: visible; }
html[data-text="large"] .lab-ch.locked .lab-ch-num { opacity: .8; }

/* ---- level: keep the stage as tall as before Visual v3 (old HUD 92 px) ---- */
.lab-level { padding-top: calc(2px + env(safe-area-inset-top)); }
.lab-level .hud { gap: 2px; }
.lab-level .hud-mode { min-height: 24px; }
.lab-level .hud-mode .chip { min-height: 24px; }
@media (max-height: 700px) { .lab-level .hud-mode { display: none; } }
.lab-wave { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
