/* styles/views/social.css: crew, share, settings, Lab (.crew-*, .shr-*, .set-*, .lab-*) (owner E5, UX spec §13.1). Tokens only, no hex values.
   Animate transform and opacity only; every keyframe ends in the resting state so reduced motion (which collapses durations) lands correctly. */

/* =========================================================================
   Crew: shared
   ========================================================================= */
.crew-page { display: flex; flex-direction: column; padding-top: var(--s-2); }
.crew-page > .ui-h1 { margin: var(--s-2) 0 var(--s-4); }
.crew-cta-col { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; max-width: 360px; }
.crew-cta-row { display: grid; grid-template-columns: 1fr; gap: var(--s-2); margin: var(--s-4) 0 var(--s-3); }
.crew-cta-row .ui-btn { white-space: nowrap; }
@media (min-width: 560px) { .crew-cta-row { grid-template-columns: 1fr 1fr; } }
.crew-empty-line { color: var(--muted); font-size: var(--fs-small); text-align: center; padding: var(--s-4) var(--s-2); }
.crew-skel-row { display: flex; gap: 8px; margin: var(--s-4) 0; }
.crew-skel-stack { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-4); }
.crew-privacy { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-micro); line-height: 1.45; color: var(--muted); margin: var(--s-3) 0 var(--s-2); }
.crew-privacy .ui-icon { flex: none; margin-top: 1px; }

/* Emblem */
.crew-emblem { position: relative; display: inline-grid; place-items: center; width: var(--sz); height: var(--sz); flex: none; color: var(--av); }
.crew-emblem svg { width: 100%; height: 100%; overflow: visible; }
.crew-emblem-rays line { stroke: currentColor; stroke-width: 7; }
.crew-emblem-core { fill: currentColor; }
.crew-emblem-ini { fill: var(--av-ink); font-family: var(--font-num); font-weight: 700; font-size: 29px; letter-spacing: .03em; }

/* Empty state art: three athletes mid-jump */
.crew-empty .ui-empty-art { width: 240px; height: auto; border-radius: 0; background: none; margin-bottom: 0; }
.crew-empty-art { width: 240px; height: auto; overflow: visible; }
.crew-empty-floor path { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; fill: none; }
.crew-fig circle { fill: var(--c); }
.crew-fig path { stroke: var(--c); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.crew-fig { animation: crew-float 1.7s var(--ease-inout) var(--d) infinite alternate; }
.crew-fig-shadow { fill: var(--ink); opacity: .1; transform-box: fill-box; transform-origin: center; animation: crew-shadow 1.7s var(--ease-inout) infinite alternate; }
.crew-fig-trails path { stroke: var(--av-1); stroke-width: 2; stroke-linecap: round; opacity: .45; }
@keyframes crew-float { from { translate: 0 0; } to { translate: 0 calc(-7px * var(--motion)); } }
@keyframes crew-shadow { from { transform: scaleX(1); } to { transform: scaleX(calc(1 - .18 * var(--motion))); } }

/* =========================================================================
   Crew home
   ========================================================================= */
.crew-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0 var(--s-3); }
.crew-head-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.crew-name { font-family: var(--font-num); font-weight: 700; font-size: clamp(22px, 7.2vw, 30px); line-height: 1; letter-spacing: .03em; text-transform: uppercase; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.crew-name--sm { font-size: 24px; }
.crew-head-count { position: relative; display: inline-flex; align-items: center; gap: 2px; min-height: 28px; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
.crew-head-count::before { content: ""; position: absolute; inset: -10px -6px; }
.crew-invite-btn { flex: none; padding: 0 var(--s-4); }

.crew-pulse-wrap { display: flex; flex-direction: column; gap: var(--s-2); }
/* The row never overflows: items shrink together (square via aspect-ratio) when 6 rings + "+N" don't fit (320 px phones). */
.crew-pulse { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; max-width: 100%; }
.crew-pulse-item { position: relative; flex: 0 1 var(--pulse, 48px); width: auto; height: auto; min-width: 28px; aspect-ratio: 1; display: grid; place-items: center; }
.crew-pulse.is-small { gap: 4px; }
.crew-pulse.is-small .crew-pulse-more { flex-basis: 32px; font-size: 14px; }
.crew-teaser .crew-pulse { overflow: hidden; }
.crew-pulse-item > .crew-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.crew-pulse-item > .ui-avatar { width: 79%; height: 79%; }
.crew-ring-seg { fill: none; stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.crew-ring-seg.is-on { stroke: var(--brand-strong); animation: crew-seg-in var(--dur-5) var(--ease-out) both; animation-delay: calc(var(--i) * 70ms + var(--j) * 110ms + 120ms); }
@keyframes crew-seg-in { from { opacity: .12; } }
.crew-pulse-more { flex: 0 1 44px; width: auto; height: auto; min-width: 28px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-family: var(--font-num); font-weight: 700; font-size: 17px; position: relative; }
.crew-pulse-more::before { content: ""; position: absolute; inset: -4px; }
.crew-pulse-line { font-size: var(--fs-small); color: var(--muted); }
.crew-pulse-line b { color: var(--ink); font-family: var(--font-num); font-size: 19px; font-weight: 700; margin-right: 1px; }

/* Goal card + GoalBar */
.crew-goal { display: flex; flex-direction: column; gap: 10px; margin-top: var(--s-4); }
.crew-goal-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.crew-goal-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.crew-goal-chip.is-on { background: var(--brand-soft); color: var(--brand-strong); }
.crew-goal-chip.is-done { background: var(--good-soft); color: var(--good); }
.crew-goal-target { font-size: var(--fs-small); color: var(--ink-2); display: flex; align-items: baseline; gap: 6px; }
.crew-goal-n { font-family: var(--font-num); font-weight: 700; font-size: 36px; line-height: .9; color: var(--ink); }
.crew-goal-nums { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-small); color: var(--muted); flex-wrap: wrap; }
.crew-goal-progress { font-family: var(--font-num); font-weight: 700; font-size: 24px; color: var(--ink); }
.crew-goal-pct { color: var(--brand-strong); font-weight: 650; }
.crew-goal-head { font-size: var(--fs-micro); color: var(--brand-strong); font-weight: 600; }
.crew-goal--none { flex-direction: column; align-items: flex-start; }
.crew-goal-empty { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink-2); }
.crew-goal-chev { position: absolute; right: var(--s-4); top: 50%; margin-top: -9px; color: var(--faint); }
.crew-goal-share { align-self: flex-start; }
.crew-goal.is-done { border-color: var(--brand-line); }

.crew-goalbar { position: relative; padding-top: 16px; }
.crew-goalbar-ticks { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; height: 24px; align-items: end; }
.crew-goalbar-tick { height: 16px; border-radius: 2px; background: var(--surface-3); transform-origin: 50% 100%; }
.crew-goalbar-tick.is-mile { height: 24px; background: var(--line-strong); }
.crew-goalbar-tick.is-on { background: var(--brand-strong); animation: crew-tick-in 380ms var(--ease-out) both; animation-delay: calc(var(--i) * 14ms + 160ms); }
[data-theme="dark"] .crew-goalbar-tick.is-on { background: var(--brand); }
.crew-goalbar-tick.is-on.is-mile { background: var(--brand-hi); }
[data-theme="light"] .crew-goalbar-tick.is-on.is-mile { background: var(--brand-deep); }
@keyframes crew-tick-in { from { opacity: .2; transform: scaleY(.45); } }
.crew-goalbar-pace { position: absolute; top: 12px; bottom: -4px; left: calc(var(--pace) * 1%); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: .75; }
.crew-goalbar-pace-lbl { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 12px; line-height: 1; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }

/* Board */
.crew-board-head { margin-bottom: var(--s-1); }
.crew-board-sub { font-size: var(--fs-micro); color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.crew-board-seg { margin-bottom: var(--s-3); }
.crew-board { display: flex; flex-direction: column; gap: 6px; }
.crew-row {
  position: relative; display: grid; grid-template-columns: 24px 36px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 12px 8px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; contain: layout paint; animation: crew-row-in var(--dur-4) var(--ease-out) both; animation-delay: calc(var(--i) * 40ms);
}
[data-theme="light"] .crew-row { border-color: transparent; box-shadow: var(--shadow-1); }
@keyframes crew-row-in { from { opacity: 0; transform: translateY(calc(10px * var(--motion))); } }
.crew-row-bar { position: absolute; inset: 0; background: linear-gradient(90deg, var(--brand-soft), transparent 92%); transform-origin: 0 50%; transform: scaleX(var(--g)); animation: crew-bar-in 760ms var(--ease-out) both; animation-delay: calc(var(--i) * 40ms + 220ms); pointer-events: none; }
@keyframes crew-bar-in { from { transform: scaleX(0); } }
.crew-row > :not(.crew-row-bar) { position: relative; }
.crew-row.is-me { border-color: var(--brand-line); box-shadow: inset 0 0 0 1px var(--brand-line); }
[data-theme="light"] .crew-row.is-me { box-shadow: var(--glow-brand); }
.crew-row.is-skel { animation: none; }
.crew-row-rank { font-family: var(--font-num); font-weight: 700; font-size: 22px; line-height: 1; color: var(--muted); text-align: center; }
.crew-row.is-first .crew-row-rank { color: var(--gold); }
.crew-row-name { display: flex; flex-direction: column; min-width: 0; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-row-name small { font-size: var(--fs-micro); color: var(--muted); font-weight: 500; }
.crew-row-val { font-family: var(--font-num); font-weight: 700; font-size: 24px; line-height: 1; text-align: right; white-space: nowrap; }
.crew-row-val small { font-size: 13px; color: var(--muted); margin-left: 3px; letter-spacing: .04em; font-weight: 600; }
.crew-row-val.is-up { color: var(--brand-strong); }
.crew-row-none { font-family: var(--font-ui); font-size: var(--fs-micro); color: var(--muted); font-weight: 500; white-space: nowrap; }
.crew-row-tier { display: inline-flex; align-items: center; gap: 4px; min-width: 22px; }
.crew-row-tier-name { font-size: var(--fs-micro); color: var(--ink-2); font-weight: 650; }
@media (max-width: 420px) { .crew-row-tier-name { display: none; } }
.crew-board-avg { font-size: var(--fs-micro); color: var(--muted); margin-top: var(--s-2); }
.crew-board-avg b { color: var(--brand-strong); font-weight: 700; }

/* Moments + reactions */
.crew-moments { display: flex; flex-direction: column; gap: var(--s-3); }
.crew-moment {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 12px 4px;
  box-shadow: inset 0 1px 0 var(--highlight); contain: layout paint; content-visibility: auto; contain-intrinsic-size: auto 132px;
}
[data-theme="light"] .crew-moment { border-color: transparent; box-shadow: var(--shadow-1); }
.crew-moment.is-compact { padding-bottom: 12px; }
.crew-moment-row { display: flex; align-items: flex-start; gap: 12px; }
.crew-moment-glyph { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--mt); background: color-mix(in srgb, var(--mt) 14%, transparent); }
.crew-moment-text { flex: 1 1 auto; min-width: 0; }
/* long generated handles wrap (two balanced lines) and the tag drops under them, never cut off */
.crew-moment-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.crew-moment-who { min-width: 0; font-weight: 700; white-space: normal; text-wrap: balance; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.crew-moment-tag {
  flex: none; display: inline-block; padding: 3px 8px 2px 6px; transform: skewX(var(--skew)); border-left: 3px solid var(--mt);
  background: color-mix(in srgb, var(--mt) 12%, transparent); color: var(--mt-ink, var(--mt));
  font-family: var(--font-num); font-weight: 700; font-size: 13px; line-height: 1.1; letter-spacing: var(--track-chyron); text-transform: uppercase;
}
.crew-moment-what { font-size: var(--fs-small); color: var(--ink-2); margin-top: 3px; }
.crew-moment-sub { color: var(--brand-strong); font-weight: 700; white-space: nowrap; }
.crew-moment-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.crew-moment-time { font-size: var(--fs-micro); color: var(--muted); white-space: nowrap; }

.crew-react { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; margin-top: 8px; padding-top: 2px; border-top: 1px solid var(--line); }
.crew-react-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border-radius: var(--r-sm);
  color: var(--muted); transition: color var(--dur-2) var(--ease-standard), background-color var(--dur-2) var(--ease-standard), transform var(--dur-1) var(--ease-standard);
}
button.crew-react-btn:active { transform: scale(.9); }
.crew-react-btn.has-n { color: color-mix(in srgb, var(--rt) 55%, var(--muted)); }
.crew-react-btn.is-on { color: var(--rt); background: color-mix(in srgb, var(--rt) 13%, transparent); }
.crew-react-ic { display: block; }
.crew-react-n { min-width: 1ch; font-family: var(--font-num); font-weight: 700; font-size: 16px; line-height: 1; color: var(--ink-2); }
.crew-react-btn.is-on .crew-react-n { color: var(--ink); }
.crew-react.is-self .crew-react-btn { cursor: default; }
.crew-react.is-self .crew-react-btn:not(.has-n) { opacity: .7; }

/* Two columns on wide screens: crew + board | moments */
.crew-col-main, .crew-col-side { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 960px) {
  .crew-home { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "main side" "foot side"; column-gap: var(--s-7); align-items: start; }
  .crew-home .crew-col-main { grid-area: main; }
  .crew-home .crew-col-side { grid-area: side; }
  .crew-home .crew-col-side > .ui-section-head { margin-top: var(--s-2); }
  .crew-home .crew-foot { grid-area: foot; }
}

/* Footer, switcher */
.crew-foot { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.crew-foot-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 var(--s-4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: left; }
[data-theme="light"] .crew-foot-row { border-color: transparent; box-shadow: var(--shadow-1); }
.crew-foot-row > span { flex: 1 1 auto; font-weight: 650; }
.crew-foot-row small { color: var(--muted); font-weight: 500; }
.crew-foot-row .ui-icon:last-child { color: var(--faint); }
.crew-switch { display: flex; flex-direction: column; gap: 6px; margin-top: var(--s-2); }
.crew-switch-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.crew-switch-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px 0 8px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; }
.crew-foot-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }

/* List cards + teaser */
.crew-list { display: flex; flex-direction: column; gap: var(--s-3); }
.crew-card { display: flex; flex-direction: column; gap: var(--s-3); }
.crew-card-top, .crew-teaser-top { display: flex; align-items: center; gap: var(--s-3); }
.crew-card-text, .crew-teaser-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crew-card-name { font-family: var(--font-num); font-weight: 700; font-size: 24px; line-height: 1; text-transform: uppercase; letter-spacing: .03em; }
.crew-card-sub { font-size: var(--fs-small); color: var(--muted); }
.crew-card-chev { color: var(--faint); flex: none; }
.crew-card-goal, .crew-teaser-goal { display: flex; flex-direction: column; gap: 6px; }
.crew-card-goal .crew-goalbar, .crew-teaser-goal .crew-goalbar { padding-top: 14px; }
.crew-card-goal-l { font-size: var(--fs-micro); color: var(--muted); }
.crew-teaser { display: flex; flex-direction: column; gap: var(--s-3); }
.crew-teaser-name { font-family: var(--font-num); font-weight: 700; font-size: 22px; line-height: 1; text-transform: uppercase; letter-spacing: .03em; }
.crew-teaser-pulse { display: flex; flex-direction: column; gap: 6px; }
.crew-latest { display: flex; flex-direction: column; gap: var(--s-2); }
.crew-latest-head { display: flex; align-items: center; justify-content: space-between; }

/* Members */
.crew-members-head { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4); }
.crew-mlist { display: flex; flex-direction: column; }
.crew-mrow { display: flex; align-items: center; gap: var(--s-3); min-height: 68px; padding: 6px 0; border-bottom: 1px solid var(--line); animation: crew-row-in var(--dur-4) var(--ease-out) both; animation-delay: calc(var(--i) * 30ms); }
.crew-mrow-av { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.crew-mrow-av > .crew-ring { position: absolute; inset: 0; }
.crew-mrow-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crew-mrow-name { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.crew-mrow-sub { font-size: var(--fs-micro); color: var(--muted); }
.crew-role { padding: 2px 8px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-strong); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.crew-mrow.is-me .crew-mrow-name { color: var(--brand-strong); }
.crew-mrow-x { color: var(--muted); }
.crew-danger { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-4); }
.crew-delete { color: var(--bad); }

/* Create + join (full shell) */
.crew-new, .crew-join { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--safe-bottom) + var(--s-6)); }
.crew-new-bar { position: sticky; top: 0; z-index: var(--z-sticky); display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; height: calc(var(--bar-h) + var(--safe-top)); padding: var(--safe-top) 8px 0; background: var(--bg); }
.crew-join .crew-new-bar { background: transparent; }
.crew-new-title { text-align: center; font-size: var(--fs-body); font-weight: 650; }
.crew-new-body { width: 100%; max-width: 520px; margin: 0 auto; padding: var(--s-2) var(--gutter); display: flex; flex-direction: column; gap: var(--s-5); }
.crew-new-hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-3); padding: var(--s-6) var(--s-4) var(--s-5); border-radius: var(--r-xl); border: 1px solid var(--line); overflow: hidden; }
.crew-new-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 42%, var(--brand-soft), transparent 70%); pointer-events: none; }
.crew-new-emblem { position: relative; }
.crew-new-name { position: relative; font-family: var(--font-num); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: .03em; text-transform: uppercase; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.crew-swatch { aspect-ratio: 1; min-height: 40px; border-radius: 50%; background: var(--av); color: var(--av-ink); display: grid; place-items: center; position: relative; transition: transform var(--dur-2) var(--spring-pop); }
.crew-swatch::before { content: ""; position: absolute; inset: -4px; }
.crew-swatch.is-on { transform: scale(1.08); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--av); }
.crew-new-vis { display: flex; flex-direction: column; gap: 10px; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.crew-new-vis p { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-small); color: var(--ink-2); }
.crew-new-vis .ui-icon { flex: none; color: var(--brand-strong); margin-top: 1px; }
.crew-new-vis b { color: var(--ink); }

.crew-join-body { width: 100%; max-width: 440px; margin: 0 auto; padding: var(--s-4) var(--gutter); }
.crew-join-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-6) var(--s-5) var(--s-5); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.crew-join-emblem { position: relative; margin-bottom: var(--s-2); }
.crew-join-emblem::before { content: ""; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent), transparent 65%); pointer-events: none; }
.crew-join-kicker { color: var(--brand-strong); }
.crew-join-name { font-family: var(--font-num); font-weight: 800; font-size: 44px; line-height: .95; letter-spacing: .02em; text-transform: uppercase; }
.crew-join-h { font-size: var(--fs-h2); line-height: 1.3; font-weight: 700; }
.crew-join-p { font-size: var(--fs-small); color: var(--muted); }
.crew-join-icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.crew-join-perks { display: flex; flex-direction: column; gap: 10px; align-self: stretch; text-align: left; margin: var(--s-2) 0; }
.crew-join-perks li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); color: var(--ink-2); }
.crew-join-perks .ui-icon { flex: none; color: var(--brand-strong); margin-top: 1px; }

/* Invite + join sheets */
.crew-invite, .crew-join-sheet, .crew-goal-sheet { display: flex; flex-direction: column; gap: var(--s-4); }
.crew-invite-top { display: flex; align-items: center; gap: var(--s-3); }
.crew-invite-lede { color: var(--ink-2); font-size: var(--fs-small); }
.crew-code-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); border: 1.5px dashed var(--brand-line); }
.crew-code { font-family: var(--font-num); font-weight: 700; font-size: 50px; line-height: 1; letter-spacing: .08em; color: var(--ink); -webkit-user-select: all; user-select: all; -webkit-touch-callout: default; }
.crew-code.is-wait { color: var(--faint); }
.crew-code--sm { font-size: 22px; color: var(--muted); letter-spacing: .12em; }
.crew-code-copy { min-height: 40px; }
.crew-invite-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.crew-invite-more { display: flex; flex-direction: column; gap: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.crew-invite-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); align-items: end; }
.crew-invite-field .ui-btn { min-height: var(--tap-md); }
.crew-invite-sent { display: flex; align-items: center; gap: 6px; color: var(--good); font-size: var(--fs-small); font-weight: 600; }
.crew-code-input { font-family: var(--font-num); font-weight: 700; font-size: 30px; letter-spacing: .14em; text-transform: uppercase; text-align: center; height: 72px; }
.crew-goal-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.crew-goal-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 96px; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid var(--line); text-align: left; color: var(--ink-2); transition: border-color var(--dur-2), background-color var(--dur-2), transform var(--dur-1); }
.crew-goal-preset:active { transform: scale(.97); }
.crew-goal-preset.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.crew-goal-preset-l { font-weight: 650; color: var(--ink); }
.crew-goal-preset-n { font-family: var(--font-num); font-weight: 700; font-size: 26px; line-height: 1; color: var(--ink); }

/* =========================================================================
   Share: QR, composer, ShareSheet
   ========================================================================= */
.shr-qr { display: inline-grid; place-items: center; width: var(--qr); height: var(--qr); padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); flex: none; animation: shr-pop-in var(--dur-5) var(--ease-out) both; }
.shr-qr svg { width: 100%; height: 100%; display: block; }
.shr-qr-bg { fill: var(--surface); }
.shr-qr-mod { fill: var(--ink); }
.shr-qr-mark circle { fill: var(--brand-strong); }
.shr-qr-mark line { stroke: var(--brand-strong); }
.shr-qr.is-loading { animation: none; }
.shr-qr-skel { width: 100%; height: 100%; border-radius: var(--r-sm); background: var(--surface-2); }
@keyframes shr-pop-in { from { opacity: 0; transform: scale(.94); } }
.shr-hint { font-size: var(--fs-micro); color: var(--muted); text-align: center; }
.shr-hint:empty { display: none; }

.shr-comp { display: flex; flex-direction: column; gap: var(--s-3); }
.shr-comp-tabs { align-self: center; width: 220px; }
.shr-preview { display: grid; place-items: center; padding: var(--s-1) 0; }
.shr-card-frame { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--stage); box-shadow: var(--shadow-2); }
.shr-card-img { width: 100%; height: 100%; display: block; animation: shr-pop-in 380ms var(--ease-out) both; }
.shr-card-wait { position: absolute; inset: 0; display: grid; place-items: center; }
.shr-card-wait > .ui-skel { position: absolute; inset: 0; }
.shr-card-wait-mark { position: relative; color: var(--brand); animation: boot-pulse 1s var(--ease-inout) infinite alternate; }
.shr-text-preview { width: 300px; max-width: 100%; min-height: 200px; margin: 0; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.shr-toggles { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px 0; }
.shr-shows { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; color: var(--ink-2); font-size: var(--fs-small); text-align: left; }
.shr-shows > span { flex: 1 1 auto; }
.shr-shows .ui-icon:last-child { color: var(--faint); }
.shr-note { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-small); color: var(--muted); }
.shr-note .ui-icon { flex: none; margin-top: 2px; }
.shr-send { position: relative; overflow: hidden; }
.shr-send-ring { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--brand-ink) 30%, transparent); border-top-color: var(--brand-ink); animation: ui-spin .8s linear infinite; }

.shr-sheet { display: flex; flex-direction: column; gap: var(--s-3); }
.shr-sheet-lede { color: var(--ink-2); font-size: var(--fs-small); }
.shr-link { font-family: var(--font-mono); font-size: 16px; line-height: 1.4; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px dashed var(--line-strong); color: var(--ink); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; -webkit-touch-callout: default; }
.shr-textblock { margin: 0; font-family: var(--font-mono); font-size: 15px; line-height: 1.5; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px dashed var(--line-strong); white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.shr-sheet-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: var(--s-2) 0; }
.shr-sheet-actions { display: flex; flex-direction: column; gap: var(--s-2); }
.shr-sheet-actions:empty { display: none; }
.shr-crew { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.shr-crew-row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.shr-crew-name { flex: 1 1 auto; font-weight: 650; }

/* Share landing (#/s/:id) */
.shr-land { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--safe-bottom) + var(--s-6)); }
.shr-land-bar { display: flex; align-items: center; justify-content: center; height: calc(var(--bar-h) + var(--safe-top)); padding-top: var(--safe-top); }
.shr-land-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); }
.shr-land-word { font-family: var(--font-num); font-weight: 800; font-size: 24px; letter-spacing: .04em; transform: skewX(var(--skew)); color: var(--ink); line-height: 1; }
.shr-land-by { font-size: 12px; font-weight: 600; color: var(--muted); }
.shr-land-body { width: 100%; max-width: 460px; margin: 0 auto; padding: var(--s-2) var(--gutter); display: flex; flex-direction: column; gap: var(--s-3); }
.shr-land-card { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-3); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); overflow: hidden; }
.shr-land-card--gone { align-items: center; text-align: center; padding: var(--s-6) var(--s-5); }
.shr-land-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-lg); display: block; animation: shr-pop-in 420ms var(--ease-out) both; }
.shr-land-hero { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); min-height: 320px; padding: var(--s-5) var(--s-4) var(--s-4); border-radius: var(--r-lg); background-color: var(--stage); overflow: hidden; }
.shr-land-chy .ui-chyron-txt { font-size: 16px; }
.shr-land-rays { position: absolute; right: -86px; top: 10px; color: var(--brand); opacity: .09; pointer-events: none; }
.shr-land-hero > :not(.shr-land-rays) { position: relative; }
[data-demo] .crew-new-bar, [data-demo] .shr-land-bar { height: calc(var(--bar-h) + var(--safe-top) + 14px); padding-top: calc(var(--safe-top) + 14px); }
.shr-land-num { padding: var(--s-2) 0; }
.shr-land-mystery { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3) 0; }
.shr-land-bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.shr-land-bars i { display: block; width: 34px; height: 120px; border-radius: 6px; background: var(--brand-strong); opacity: .55; transform-origin: 50% 100%; transform: scaleY(var(--h)); animation: shr-bar-up 700ms var(--ease-out) both; }
.shr-land-bars i:nth-child(2) { animation-delay: 90ms; opacity: .75; }
.shr-land-bars i.is-best { background: var(--gold); opacity: 1; animation-delay: 180ms; }
@keyframes shr-bar-up { from { transform: scaleY(0); } }
.shr-land-q { font-family: var(--font-num); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: .02em; }
.shr-land-who { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.shr-land-name { font-family: var(--font-num); font-weight: 700; font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .04em; }
.shr-land-where, .shr-land-date { font-size: var(--fs-small); color: var(--muted); }
.shr-land-cta { display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-1) var(--s-1); }
.shr-land-sub { font-size: var(--fs-small); color: var(--muted); text-align: center; }

/* =========================================================================
   Settings + Me
   ========================================================================= */
.set-page { display: flex; flex-direction: column; gap: var(--s-1); padding-top: var(--s-2); max-width: 720px; }
.set-group { margin-top: var(--s-4); }
.set-group-h { font-size: var(--fs-label); font-weight: 650; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-2) var(--s-1); }
.set-card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--highlight); overflow: hidden; }
[data-theme="light"] .set-card { border-color: transparent; box-shadow: var(--shadow-1); }
.set-foot { font-size: var(--fs-micro); line-height: 1.5; color: var(--muted); margin: var(--s-2) var(--s-1) 0; }
.set-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px var(--s-4); text-align: left; }
.set-row + .set-row { border-top: 1px solid var(--line); }
button.set-row { transition: background-color var(--dur-2) var(--ease-standard); }
button.set-row:active { background: var(--highlight); }
.set-row-ic { flex: none; width: 24px; display: grid; place-items: center; color: var(--brand-strong); }
.set-row-ic--bad { color: var(--bad); }
.set-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-row-label { font-weight: 600; }
.set-row-sub { font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.set-row-val { flex: none; max-width: 48%; font-size: var(--fs-small); color: var(--ink-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row-chev { flex: none; color: var(--faint); display: grid; }
.set-row--seg { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 12px; padding-bottom: 14px; }
.set-row-top { display: flex; align-items: center; gap: 12px; }
.set-seg { width: 100%; }
.set-row--toggle { padding-top: 4px; padding-bottom: 4px; }
.set-row--toggle .ui-toggle { width: 100%; }
.set-row-grow { flex: 1 1 auto; min-width: 0; }
.set-row--actions { padding-top: 12px; padding-bottom: 14px; }
.set-row--two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.set-row--action .ui-btn, .set-row--share .ui-btn { flex: none; }
.set-revoke { min-height: 40px; padding: 0 14px; }
.set-sheet { display: flex; flex-direction: column; gap: var(--s-4); }
.set-sheet-lede { color: var(--ink-2); font-size: var(--fs-small); }
.set-area-preview { font-family: var(--font-num); font-weight: 700; font-size: 22px; letter-spacing: .02em; color: var(--brand-strong); }
.set-flow { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-4); }
.set-consent { display: flex; gap: 12px; align-items: flex-start; padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.set-consent input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--brand-strong); }

.set-me-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: var(--s-5) var(--s-4) var(--s-4); border-radius: var(--r-xl); border: 1px solid var(--line); background-color: var(--surface); }
[data-theme="light"] .set-me-hero { border-color: transparent; box-shadow: var(--shadow-1); }
.set-me-av { display: inline-grid; padding: 4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--brand-line); margin-bottom: var(--s-2); }
.set-me-name { font-family: var(--font-num); font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.set-me-where { font-size: var(--fs-small); color: var(--muted); }
.set-me-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--s-2); }
.set-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.set-stat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s-3) 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: center; min-width: 0; }
[data-theme="light"] .set-stat { border-color: transparent; box-shadow: var(--shadow-1); }
.set-stat-emb { height: 28px; display: grid; place-items: center; margin-bottom: 2px; }
.set-stat-flame { color: var(--flame); }
.set-stat-star { color: var(--violet); }
.set-stat-v { font-family: var(--font-num); font-weight: 700; font-size: 32px; line-height: 1; }
.set-stat-l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-stat-s { font-size: var(--fs-micro); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.set-who { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); margin-top: var(--s-2); border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.set-who-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-who-line { font-size: var(--fs-body); color: var(--ink-2); }
.set-who-line b { color: var(--ink); }
.set-who-sub { font-size: var(--fs-micro); color: var(--muted); }
.set-privacy .ui-banner { margin-top: var(--s-2); }

/* =========================================================================
   Lab
   ========================================================================= */
.lab-page { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--safe-bottom) + var(--s-6)); }
.lab-bar { position: sticky; top: 0; z-index: var(--z-sticky); display: grid; grid-template-columns: var(--tap) 1fr var(--tap); align-items: center; height: calc(var(--bar-h) + var(--safe-top)); padding: var(--safe-top) 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
[data-demo] .lab-bar { height: calc(var(--bar-h) + var(--safe-top) + 14px); padding-top: calc(var(--safe-top) + 14px); }
.lab-bar-title { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; }
.lab-badge { display: inline-block; padding: 3px 8px 2px 7px; transform: skewX(var(--skew)); border-left: 3px solid var(--violet); background: var(--violet-soft); color: var(--violet); font-family: var(--font-num); font-weight: 800; font-size: 14px; letter-spacing: var(--track-chyron); line-height: 1.1; }
.lab-body { width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s-4) var(--gutter); display: flex; flex-direction: column; gap: var(--s-4); }
.lab-h2 { font-size: var(--fs-h2); line-height: 1.3; font-weight: 700; margin-top: var(--s-3); }
.lab-lede { color: var(--ink-2); font-size: var(--fs-small); }
.lab-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.lab-off { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-lg); background: var(--violet-soft); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); }
.lab-off-h { font-weight: 700; color: var(--violet); }

.lab-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@media (min-width: 720px) { .lab-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lab-tool { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 108px; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: left; color: var(--brand-strong); transition: transform var(--dur-1) var(--ease-standard), border-color var(--dur-2); }
[data-theme="light"] .lab-tool { border-color: transparent; box-shadow: var(--shadow-1); }
.lab-tool:active:not(:disabled) { transform: scale(.97); }
.lab-tool:disabled { opacity: .5; }
.lab-tool-h { margin-top: auto; font-weight: 700; color: var(--ink); line-height: 1.2; }
.lab-tool-s { font-size: var(--fs-micro); color: var(--muted); line-height: 1.3; min-height: 2.6em; }
.lab-flashes { display: flex; flex-direction: column; gap: 4px; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.lab-flash { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-small); color: var(--ink-2); }
.lab-run { display: flex; flex-direction: column; gap: var(--s-2); }
.lab-run-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.lab-run-row .ui-btn { padding: 0 8px; font-size: var(--fs-small); }

.lab-progress { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: var(--s-3); align-items: baseline; }
.lab-progress-n { font-family: var(--font-num); font-weight: 700; font-size: 34px; line-height: 1; }
.lab-progress-n small { font-size: 20px; color: var(--muted); }
.lab-progress-l { font-size: var(--fs-small); color: var(--muted); }
.lab-progress-bar { grid-column: 1 / -1; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.lab-progress-bar i { display: block; height: 100%; background: var(--violet); transform-origin: 0 50%; transform: scaleX(var(--p)); transition: transform var(--dur-5) var(--ease-out); }
.lab-filter { margin: var(--s-1) 0; }
.lab-session { display: flex; flex-direction: column; gap: 6px; }
.lab-session-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-label); font-weight: 650; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; margin-top: var(--s-2); }
.lab-list { display: flex; flex-direction: column; gap: 6px; }
.lab-item { border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
[data-theme="light"] .lab-item { border-color: transparent; box-shadow: var(--shadow-1); }
.lab-item.is-open { border-color: color-mix(in srgb, var(--violet) 45%, transparent); }
.lab-item-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 12px; text-align: left; }
.lab-item-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-strong); }
.lab-item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lab-item-v { font-family: var(--font-num); font-weight: 700; font-size: 20px; line-height: 1.1; }
.lab-item-v small { font-family: var(--font-ui); font-size: var(--fs-micro); color: var(--muted); font-weight: 600; }
.lab-bad { color: var(--warn-ink) !important; }
.lab-item-t { font-size: var(--fs-micro); color: var(--muted); }
.lab-item-chev { flex: none; color: var(--faint); }
.lab-tag { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); }
.lab-tag--done { background: var(--good-soft); color: var(--good); }
.lab-tag--todo { background: var(--warn-soft); color: var(--warn-ink); }
.lab-tag--invalid, .lab-tag--muted { background: var(--surface-3); color: var(--muted); }
.lab-tag--lab { background: var(--violet-soft); color: var(--violet); }

/* Panel (also inside the run screen) */
bw-lab-panel { display: block; }
.lab-panel { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.lab-item .lab-panel { animation: shr-pop-in var(--dur-3) var(--ease-out) both; }
.lab-panel--empty { border-top: 0; }
.lab-panel-head { display: flex; align-items: center; gap: 8px; }
.lab-panel-ic { color: var(--violet); display: grid; }
.lab-panel-title { flex: 1 1 auto; font-weight: 600; color: var(--ink-2); }
.lab-panel-title b { font-family: var(--font-num); font-size: 19px; color: var(--ink); }
.lab-field { display: flex; flex-direction: column; gap: 6px; }
.lab-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.lab-num-wrap { position: relative; display: block; }
.lab-num-wrap .ui-input { padding-right: 44px; font-family: var(--font-num); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.lab-num-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: var(--fs-label); font-weight: 650; color: var(--muted); pointer-events: none; }
.lab-num.is-error .ui-input { border-color: var(--bad); }
.lab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 6px; align-self: center; padding: 6px; border-radius: var(--r-lg); background: var(--surface-2); }
.lab-pad-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line); color: var(--ink-2); transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-1); }
.lab-pad-btn:active { transform: scale(.94); }
.lab-pad-arrow { display: grid; }
.lab-pad-lbl { font-family: var(--font-mono); font-size: 11px; line-height: 1; letter-spacing: .04em; }
.lab-pad-btn.is-measured { border-style: dashed; border-color: var(--brand-line); }
.lab-pad-btn.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.lab-pad-x { display: grid; place-items: center; color: var(--muted); }
.lab-mismatch { color: var(--warn-ink); }
.lab-gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--tap); gap: var(--s-2); align-items: center; }
.lab-gate-l { font-size: 16px; }
.lab-gate-sel { position: relative; display: block; min-width: 0; }
.lab-gate-sel .ui-select { padding-right: 36px; cursor: pointer; }
.lab-gate-chev { position: absolute; right: 12px; top: 50%; margin-top: -9px; color: var(--muted); pointer-events: none; }
.lab-invalid { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lab-textarea { height: auto; min-height: 72px; padding: 12px var(--s-4); line-height: 1.4; resize: vertical; }
.lab-actions { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.lab-save { flex: 1 1 200px; }
.lab-save-msg { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-small); font-weight: 600; color: var(--good); }
.lab-save-msg.is-error { color: var(--warn-ink); }
.lab-save-ok { display: inline-grid; }

/* Stomp sheet */
.lab-stomp { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-4); text-align: center; }
.lab-stomp-dial { position: relative; align-self: center; width: 200px; height: 200px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--brand-strong); }
.lab-dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.lab-dial-track { fill: none; stroke: var(--line); stroke-width: 6; }
.lab-dial-fill { fill: none; stroke: var(--brand); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; transition: stroke-dashoffset 100ms linear; }
.lab-stomp-big { position: relative; font-family: var(--font-num); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: .04em; color: var(--ink); }
.lab-stomp-dial.is-live .lab-stomp-big { color: var(--brand-strong); }
.lab-stomp-sub { position: relative; font-size: var(--fs-small); color: var(--muted); }
.lab-stomp-dial.is-done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.lab-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s-3); text-align: left; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); margin: 0; }
.lab-kv dt { font-size: var(--fs-label); color: var(--muted); font-weight: 650; }
.lab-kv dd { margin: 0; text-align: right; }

/* Layout diagram */
.lab-diagram { margin: 0; align-self: center; width: 100%; max-width: 520px; }
.lab-diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.lab-floor { fill: var(--stage); stroke: var(--line-strong); stroke-width: .4; }
.lab-grid-minor { stroke: var(--grid-minor); stroke-width: .25; }
.lab-grid-major { stroke: var(--grid-major); stroke-width: .35; }
.lab-ring { fill: none; stroke: var(--line-strong); stroke-width: .3; stroke-dasharray: .8 1.6; }
.lab-ring--in { stroke: var(--line); }
.lab-ray { fill: none; stroke: var(--ink-2); stroke-width: 1.1; stroke-linecap: round; stroke-dasharray: 1; opacity: .8; animation: lab-draw 560ms var(--ease-out) both; animation-delay: calc(var(--i) * 60ms + 120ms); }
.lab-ray.is-fwd { stroke: var(--brand-strong); opacity: 1; }
@keyframes lab-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.lab-x path { fill: none; stroke: var(--brand-strong); stroke-width: 2.2; stroke-linecap: round; }
.lab-cone { stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 80%; animation: lab-cone-in 420ms var(--ease-snap) both; animation-delay: calc(var(--i) * 45ms + 520ms); }
.lab-cone--out { fill: var(--warn); stroke: var(--warn-ink); stroke-width: .35; }
.lab-cone--in { fill: var(--warn); stroke: var(--warn-ink); stroke-width: .3; opacity: .9; }
@keyframes lab-cone-in { from { transform: scale(0); opacity: 0; } }
.lab-dir { font-family: var(--font-mono); font-size: 4px; font-weight: 600; letter-spacing: .3px; fill: var(--ink-2); animation: lab-fade 400ms var(--ease-out) both; animation-delay: calc(var(--i) * 40ms + 800ms); }
.lab-dir.is-fwd { fill: var(--brand-strong); font-weight: 700; }
@keyframes lab-fade { from { opacity: 0; } }
.lab-dims { animation: lab-fade 500ms var(--ease-out) 1100ms both; }
.lab-dim { fill: none; stroke: var(--violet); stroke-width: .6; stroke-dasharray: 1.4 1.2; }
.lab-dim--sq { stroke: var(--info); }
.lab-leader { fill: none; stroke: var(--muted); stroke-width: .4; }
.lab-dim-t { font-family: var(--font-mono); font-size: 3.2px; font-weight: 600; fill: var(--ink); }
.lab-dim-t--in { fill: var(--ink-2); font-size: 3px; }
.lab-dim-pill { fill: var(--surface); stroke: var(--violet); stroke-width: .4; }
.lab-dim-pill--sq { stroke: var(--info); }
.lab-stick-a { fill: var(--ink); }
.lab-stick-b { fill: var(--surface); stroke: var(--ink); stroke-width: .2; }
.lab-cam-cone { fill: var(--brand-soft); stroke: var(--brand-line); stroke-width: .3; }
.lab-cam-body { fill: var(--ink); }
.lab-cam-lens { fill: var(--brand); }
.lab-cam-t { fill: var(--brand-strong); }
.lab-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4); font-size: var(--fs-micro); color: var(--muted); }
.lab-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lab-key { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.lab-key--tape { background: var(--ink-2); }
.lab-key--cone { width: 10px; height: 10px; background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.lab-key--dim { background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 7px); }

.lab-table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-small); }
.lab-table th, .lab-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.lab-table thead th { border-top: 0; font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lab-table th small, .lab-table td small { display: block; font-size: var(--fs-micro); color: var(--muted); font-weight: 500; }
.lab-table th[scope="row"] { font-weight: 650; }
.lab-table td b { font-family: var(--font-num); font-size: 20px; font-weight: 700; }
.lab-steps { display: flex; flex-direction: column; gap: 10px; padding: 0; counter-reset: lab; list-style: none; }
.lab-steps li { position: relative; padding-left: 40px; font-size: var(--fs-small); color: var(--ink-2); counter-increment: lab; min-height: 28px; }
.lab-steps li::before { content: counter(lab); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-family: var(--font-num); font-weight: 700; font-size: 16px; }
.lab-steps b { color: var(--ink); }
.lab-cams { display: grid; grid-template-columns: 1fr; gap: var(--s-2); }
@media (min-width: 600px) { .lab-cams { grid-template-columns: 1fr 1fr; } }
.lab-cam-card { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
[data-theme="light"] .lab-cam-card { border-color: transparent; box-shadow: var(--shadow-1); }
.lab-cam-art { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; }
.lab-cam-art svg { width: 44px; height: 44px; }
.lab-cam-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-micro); color: var(--muted); line-height: 1.4; }
.lab-cam-text b { font-size: var(--fs-small); color: var(--ink); }
.lab-art-floor { fill: var(--surface-3); }
.lab-art-cone { fill: var(--brand-soft); stroke: var(--brand-line); stroke-width: 1; }
.lab-art-cam { fill: var(--ink); }
.lab-art-t { font-family: var(--font-num); font-weight: 800; font-size: 11px; fill: var(--surface); }
.lab-art-flash { fill: var(--sync-flash); stroke: var(--line-strong); stroke-width: 1; }
.lab-art-wave { fill: none; stroke: var(--brand-strong); stroke-width: 2; stroke-linecap: round; }
