/* ==========================================================================
   LuckyWheel — wheel app UI (owner: Wheel). Spec §9 (tokens, layouts, micro-interactions), §10 (a11y).
   Uses the app.css tokens (ARCHITECTURE §8) with safe fallbacks. Logical properties only (RTL by dir).
   ========================================================================== */

/* ---------- Tokens (fallbacks when app.css is not loaded) ---------- */
.lh-app {
  --lh-bg: var(--bg, #F7F7FB);
  --lh-surface: var(--surface, #FFFFFF);
  --lh-surface-2: var(--surface-2, #EFEFF6);
  --lh-border: var(--border, #E3E4EC);
  --lh-border-strong: var(--border-strong, #8A8FA0);
  --lh-text: var(--text, #14151A);
  --lh-muted: var(--text-muted, #5B6070);
  --lh-brand: var(--brand, #5B3DF5);
  --lh-brand-ink: var(--brand-ink, #FFFFFF);
  --lh-brand-soft: var(--brand-soft, #ECE8FF);
  --lh-brand-soft-ink: var(--brand, #5B3DF5);
  --lh-accent: var(--accent, #FFB800);
  --lh-success: var(--success, #12805C);
  --lh-danger: var(--danger, #C62828);
  --lh-warning: var(--warning, #B45309);
  --lh-focus: var(--focus, #5B3DF5);
  --lh-shadow-sm: var(--shadow-sm, 0 1px 2px rgba(20, 21, 26, .08));
  --lh-shadow-md: var(--shadow-md, 0 4px 16px rgba(20, 21, 26, .10));
  --lh-shadow-lg: var(--shadow-lg, 0 12px 40px rgba(20, 21, 26, .18));
  --lh-ease: var(--ease-out, cubic-bezier(.2, .8, .2, 1));
  --lh-toast-bg: #1F2230;
  --lh-toast-ink: #FFFFFF;
  --lh-toast-act: #C9BFFF;
  --lh-sep: var(--lh-surface);
  --lh-pointer: var(--lh-text);
  --lh-hub-core: var(--lh-brand);
  --lh-extra: 0px;
  /* wheel diameter (spec §9.4): width-limited, then height-limited so wheel + Spin fit at 360×640 */
  --lh-notes: 0px; /* height of the banners above the wheel, measured by app.js */
  --lh-size: max(220px, min(680px, calc(100svh - 270px - var(--lh-extra) - var(--lh-notes))));
  position: relative;
  color: var(--lh-text);
  margin-block: 4px 32px;
  font-size: 1rem;
}
@supports not (height: 100svh) {
  .lh-app { --lh-size: max(220px, min(680px, calc(100vh - 270px - var(--lh-extra) - var(--lh-notes)))); }
}
.lh-app--chips { --lh-extra: 50px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lh-app {
    --lh-bg: var(--bg, #0E0F13); --lh-surface: var(--surface, #171922); --lh-surface-2: var(--surface-2, #1F2230);
    --lh-border: var(--border, #2A2D3A); --lh-border-strong: var(--border-strong, #737891); --lh-text: var(--text, #ECEDF2);
    --lh-muted: var(--text-muted, #A3A8B8); --lh-brand: var(--brand, #8F7BFF); --lh-brand-ink: var(--brand-ink, #0E0F13);
    --lh-brand-soft: var(--brand-soft, #2A2350); --lh-brand-soft-ink: #C9BFFF; --lh-success: var(--success, #3DD68C);
    --lh-danger: var(--danger, #FF6B6B); --lh-warning: var(--warning, #FBBF24); --lh-focus: var(--focus, #8F7BFF);
    --lh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .32); --lh-shadow-md: 0 4px 16px rgba(0, 0, 0, .4); --lh-shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
    --lh-toast-bg: #ECEDF2; --lh-toast-ink: #14151A; --lh-toast-act: #4934A3; --lh-hub-core: #6F57FF;
  }
}
:root[data-theme="dark"] .lh-app {
  --lh-bg: var(--bg, #0E0F13); --lh-surface: var(--surface, #171922); --lh-surface-2: var(--surface-2, #1F2230);
  --lh-border: var(--border, #2A2D3A); --lh-border-strong: var(--border-strong, #737891); --lh-text: var(--text, #ECEDF2);
  --lh-muted: var(--text-muted, #A3A8B8); --lh-brand: var(--brand, #8F7BFF); --lh-brand-ink: var(--brand-ink, #0E0F13);
  --lh-brand-soft: var(--brand-soft, #2A2350); --lh-brand-soft-ink: #C9BFFF; --lh-success: var(--success, #3DD68C);
  --lh-danger: var(--danger, #FF6B6B); --lh-warning: var(--warning, #FBBF24); --lh-focus: var(--focus, #8F7BFF);
  --lh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .32); --lh-shadow-md: 0 4px 16px rgba(0, 0, 0, .4); --lh-shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  --lh-toast-bg: #ECEDF2; --lh-toast-ink: #14151A; --lh-toast-act: #4934A3; --lh-hub-core: #6F57FF;
}

.lh-app *, .lh-app *::before, .lh-app *::after { box-sizing: border-box; }
:where(.lh-app) [hidden] { display: none !important; }
:where(.lh-app) :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.lh-app) :where(button) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lh-app :focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.lh-ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.lh-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lh-muted { color: var(--lh-muted); }

/* ---------- Layout ---------- */
.lh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; }
.lh-main { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lh-grid > .lh-panel { display: none; }
@media (scripting: none) { .lh-grid > .lh-panel { display: flex; } .lh-quick, .lh-bar__entries, .lh-bar__more, .lh-tools, .lh-seg, .lh-tabs, .lh-done, .lh-panel__close { display: none !important; } }

/* desktop: header + H1 + subtitle (+ breadcrumbs on inner pages) above, readout + Spin below */
.lh-app { --lh-top: 330px; }
.lh-app--crumbs { --lh-top: 390px; }
@media (min-width: 768px) {
  .lh-app { --lh-size: max(260px, min(640px, calc(100svh - var(--lh-top) - var(--lh-extra) - var(--lh-notes)), calc(100vw - 360px - 64px))); }
  .lh-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
  .lh-grid > .lh-panel { display: flex; }
}
@media (min-width: 1024px) {
  .lh-app { --lh-size: max(300px, min(640px, calc(100svh - var(--lh-top) - var(--lh-extra) - var(--lh-notes)), calc(100vw - 400px - 120px))); }
  .lh-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; }
}

/* ---------- Notices, chips, slots ---------- */
.lh-notices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; max-width: 680px; }
.lh-notices:empty { display: none; }
.lh-notices:not(:empty) { margin-block-end: 10px; }
.lh-notice {
  display: flex; align-items: center; gap: 10px; flex: 1 1 100%; min-height: 48px; padding: 6px 8px 6px 14px;
  background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: 16px; font-size: .9375rem; box-shadow: var(--lh-shadow-sm);
}
.lh-notice { flex-wrap: wrap; }
.lh-notice__txt { flex: 1 1 200px; min-width: 0; }
.lh-notice > .lh-btn { margin-inline-start: auto; }
.lh-notice__ic { color: var(--lh-brand); }
.lh-notice--brand { background: var(--lh-brand-soft); border-color: transparent; }
.lh-notice--warn { border-color: var(--lh-warning); }
.lh-notice--warn .lh-notice__ic { color: var(--lh-warning); }
.lh-notice--soft { background: transparent; box-shadow: none; border-style: dashed; color: var(--lh-muted); font-size: .875rem; min-height: 40px; }
.lh-notice--pill { flex: 0 0 auto; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--lh-muted); gap: 8px; }
.lh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lh-warning); }
.lh-notice__x { margin-inline-start: auto; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; color: var(--lh-muted); }
.lh-notice__x:hover { background: var(--lh-surface-2); }
.lh-slot { width: 100%; max-width: 680px; }
.lh-slot--above { margin-block-end: 10px; }
.lh-slot--below { margin-block-start: 12px; }

.lh-chips { display: flex; gap: 8px; width: 100%; max-width: 680px; padding-block: 4px 10px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.lh-chips::-webkit-scrollbar { display: none; }
.lh-chips__group { display: flex; gap: 8px; }
.lh-chip {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--lh-border); border-radius: 999px; background: var(--lh-surface); font-size: .875rem; font-weight: 600;
  white-space: nowrap; color: var(--lh-text); transition: background-color .12s, border-color .12s, color .12s;
}
.lh-chip::after { content: ""; position: absolute; inset: -6px -2px; } /* 48 px touch target */
.lh-chip:hover { background: var(--lh-surface-2); }
.lh-chip[aria-pressed="true"], .lh-chip[aria-checked="true"] { background: var(--lh-brand-soft); border-color: transparent; color: var(--lh-brand-soft-ink); }
.lh-chip .lh-ic { width: 18px; height: 18px; }

/* ---------- Stage: wheel, rim, pointer, hub ---------- */
.lh-stage-wrap { position: relative; display: flex; justify-content: center; width: 100%; }
.lh-stage {
  position: relative; inline-size: var(--lh-size); max-inline-size: 100%; aspect-ratio: 1; flex: none;
  container: lhwheel / inline-size; border-radius: 50%; outline-offset: 6px;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
.lh-stage:focus-visible { outline: 3px solid var(--lh-focus); outline-offset: 6px; }
.lh-stage::before { /* rim (does not rotate) */
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lh-surface);
  box-shadow: 0 0 0 1px var(--lh-border), 0 2px 4px rgba(20, 21, 26, .06), 0 18px 40px -12px rgba(20, 21, 26, .28);
}
.lh-disc { position: absolute; inset: 0; border-radius: 50%; }
.lh-disc > svg, .lh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lh-canvas { touch-action: none; transform-origin: 50% 50%; will-change: transform; cursor: grab; }
.lh-app.is-spinning .lh-canvas { cursor: default; }
.lh-svg { overflow: visible; }
.lh-svg .lh-sl path, .lh-svg .lh-sl circle { stroke: var(--lh-sep); stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lh-svg--thin .lh-sl path { stroke-width: 1px; }
.lh-svg--dense .lh-sl path, .lh-svg .lh-sl circle:only-child { stroke: none; }
.lh-svg .lh-wl { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif; }
.lh-svg--empty .lh-svg-dash { stroke: var(--lh-border-strong); }
/* SVG labels hidden below 9 px (same rule as the canvas; buckets computed by svg_wheel.php) */
@container lhwheel (max-width: 279.98px) { .lh-lmin-280 .lh-wl { display: none; } }
@container lhwheel (max-width: 319.98px) { .lh-lmin-320 .lh-wl { display: none; } }
@container lhwheel (max-width: 359.98px) { .lh-lmin-360 .lh-wl { display: none; } }
@container lhwheel (max-width: 399.98px) { .lh-lmin-400 .lh-wl { display: none; } }
@container lhwheel (max-width: 439.98px) { .lh-lmin-440 .lh-wl { display: none; } }
@container lhwheel (max-width: 479.98px) { .lh-lmin-480 .lh-wl { display: none; } }
@container lhwheel (max-width: 519.98px) { .lh-lmin-520 .lh-wl { display: none; } }
@container lhwheel (max-width: 559.98px) { .lh-lmin-560 .lh-wl { display: none; } }
@container lhwheel (max-width: 599.98px) { .lh-lmin-600 .lh-wl { display: none; } }
@container lhwheel (max-width: 639.98px) { .lh-lmin-640 .lh-wl { display: none; } }
@container lhwheel (max-width: 679.98px) { .lh-lmin-680 .lh-wl { display: none; } }

.lh-pointer {
  /* tip at ≈ 0.95 R (labels end at 0.90 R); overhang = 4 % of the diameter, so that the pointer stays
     inside the 16 px gutter of a 100vw − 32px wheel (no horizontal scroll) */
  --lh-pw: clamp(28px, 8.6%, 64px);
  position: absolute; z-index: 2; top: 50%; inset-inline-end: calc(4.6% - var(--lh-pw)); width: var(--lh-pw); aspect-ratio: 1; height: auto;
  margin-block-start: calc(var(--lh-pw) / -2); transform-origin: 70% 50%; pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)) drop-shadow(0 4px 8px rgba(0, 0, 0, .18));
}
[dir="rtl"] .lh-pointer { transform-origin: 30% 50%; }
.lh-pointer__body { fill: var(--lh-pointer); stroke: var(--lh-surface); stroke-width: 3.5; stroke-linejoin: round; }
.lh-pointer__pin { fill: var(--lh-accent); stroke: var(--lh-surface); stroke-width: 2; }

.lh-hub {
  position: absolute; z-index: 2; top: 50%; left: 50%; width: max(64px, 19%); aspect-ratio: 1; padding: 0; border: 0;
  transform: translate(-50%, -50%); border-radius: 50%; background: var(--lh-surface); display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(20, 21, 26, .06), 0 2px 4px rgba(20, 21, 26, .18), 0 8px 18px -6px rgba(20, 21, 26, .35);
  transition: scale .12s var(--lh-ease);
}
.lh-hub__core {
  width: 76%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #FFFFFF;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--lh-hub-core) 55%, #FFFFFF) 0, var(--lh-hub-core) 52%, color-mix(in srgb, var(--lh-hub-core) 70%, #000000) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -2px 4px rgba(0, 0, 0, .22);
}
.lh-hub__core .lh-ic { width: 46%; height: 46%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.lh-hub:hover .lh-hub__core { filter: brightness(1.08); }
.lh-hub:active { scale: .94; }
.lh-hub:focus-visible { outline-offset: 3px; }
.lh-app:not(.has-spun) .lh-hub { animation: lh-pulse 2s ease-in-out infinite; }
@keyframes lh-pulse { 50% { scale: 1.03; } }

/* empty / edge states (§9.8) */
.lh-stage.is-empty::before { background: var(--lh-surface-2); box-shadow: none; border: 3px dashed var(--lh-border-strong); }
.lh-stage.is-empty .lh-hub, .lh-stage.is-empty .lh-pointer { display: none; }
.lh-empty { position: absolute; z-index: 3; inset: 14%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.lh-empty__title { margin: 0; font-weight: 800; font-size: clamp(1.0625rem, 4.6cqi, 1.5rem); line-height: 1.25; text-wrap: balance; }
.lh-empty__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* live readout + info badges (one row, fixed height: no layout shift) */
.lh-readrow { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 680px; min-height: 44px; margin-block-start: 12px; }
.lh-readout {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 40px; margin: 0; padding: 6px 16px 6px 12px;
  border-radius: 999px; background: var(--lh-surface); border: 1px solid var(--lh-border); box-shadow: var(--lh-shadow-sm);
  font-weight: 750; font-size: 1.0625rem; line-height: 1.2;
}
.lh-readout__txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.lh-readout__dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); transition: background-color 60ms linear; }
.lh-readout.is-empty { visibility: hidden; }
.lh-readout--result { padding-inline: 18px; background: var(--lh-brand-soft); border-color: transparent; font-size: 1.25rem; }
.lh-readout--result .lh-readout__k { font-weight: 600; color: var(--lh-muted); font-size: 1rem; }
.lh-readout--error { color: var(--lh-danger); font-size: 1rem; }
.lh-info { display: contents; margin: 0; }
.lh-badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px;
  background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); font-size: .8125rem; font-weight: 650; white-space: nowrap; border: 0;
}
.lh-badge .lh-ic { width: 16px; height: 16px; }
.lh-badge--info { background: var(--lh-surface-2); color: var(--lh-muted); white-space: normal; max-width: 60%; }
.lh-badge--btn { position: relative; min-height: 36px; }
.lh-badge--btn::after { content: ""; position: absolute; inset: -6px 0; }
.lh-badge--btn:hover { filter: brightness(.97); }
.lh-badge--resume { background: var(--lh-surface); color: var(--lh-brand-soft-ink); box-shadow: inset 0 0 0 1px var(--lh-brand); }
.lh-readrow > .lh-badge, .lh-info > .lh-badge { min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Action bar ---------- */
.lh-bar { display: flex; gap: 8px; align-items: stretch; width: 100%; max-width: 680px; margin-block-start: 12px; }
.lh-spin {
  position: relative; flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 24px; overflow: hidden; border: 0; border-radius: 999px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  color: var(--lh-brand-ink); font-weight: 800; font-size: 1.1875rem; letter-spacing: .01em;
  background: linear-gradient(180deg, color-mix(in srgb, var(--lh-brand) 84%, #FFFFFF), var(--lh-brand) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 0 color-mix(in srgb, var(--lh-brand) 70%, #000000), 0 10px 22px -10px color-mix(in srgb, var(--lh-brand) 75%, transparent);
  transition: scale .12s var(--lh-ease), filter .12s;
}
.lh-spin:hover { filter: brightness(1.06); }
.lh-spin:active { scale: .96; }
.lh-spin__in { display: inline-flex; align-items: center; gap: 10px; }
.lh-spin.is-alt { font-size: 1rem; line-height: 1.15; }
.lh-spin.is-alt .lh-spin__label { text-wrap: balance; }
.lh-spin__ic { width: 22px; height: 22px; }
.lh-spin__kbd { display: none; font-size: .75rem; font-weight: 600; opacity: .8; letter-spacing: .02em; }
.lh-spin__prog { position: absolute; inset-inline: 14px; bottom: 6px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .7); transform: scaleX(0); transform-origin: left center; opacity: 0; transition: opacity .2s; }
[dir="rtl"] .lh-spin__prog { transform-origin: right center; }
.lh-spin.is-spinning .lh-spin__prog { opacity: 1; }
.lh-spin[aria-disabled="true"] { cursor: progress; filter: saturate(.85); }
.lh-spin.is-stop { background: linear-gradient(180deg, #E0483F, var(--lh-danger)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 0 #8E1C1C; color: #FFFFFF; }
.lh-app.is-spinning .lh-spin__ic { animation: lh-rot 1s linear infinite; }
.lh-app.is-spinning .lh-spin.is-stop .lh-spin__ic { animation: none; }
@keyframes lh-rot { to { rotate: 360deg; } }

.lh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border: 1px solid var(--lh-border); border-radius: 14px; background: var(--lh-surface); color: var(--lh-text);
  font-weight: 650; font-size: .9375rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, scale .12s var(--lh-ease), filter .12s;
}
.lh-btn:hover { background: var(--lh-surface-2); }
.lh-btn:active { scale: .97; }
.lh-btn[disabled], .lh-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.lh-btn--primary { background: var(--lh-brand); border-color: transparent; color: var(--lh-brand-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(20, 21, 26, .15); }
.lh-btn--primary:hover { background: var(--lh-brand); filter: brightness(1.08); }
.lh-btn--ghost { background: transparent; border-color: transparent; }
.lh-btn--sm { min-height: 40px; padding: 0 12px; font-size: .875rem; border-radius: 12px; gap: 6px; }
.lh-btn--sm .lh-ic { width: 18px; height: 18px; }
.lh-btn--lg { min-height: 56px; padding: 0 28px; font-size: 1.0625rem; border-radius: 999px; }
.lh-btn--icon { width: 48px; min-width: 48px; padding: 0; }
.lh-btn--sm.lh-btn--icon { width: 40px; min-width: 40px; }
.lh-count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--lh-surface-2); color: var(--lh-muted); font-size: .75rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.lh-count.is-bump { animation: lh-bump .3s var(--lh-ease); }
@keyframes lh-bump { 40% { scale: 1.22; } }
.lh-bar__entries { flex: none; border-radius: 999px; height: 56px; padding: 0 14px 0 16px; gap: 8px; }
.lh-bar__more { flex: none; border-radius: 50%; width: 56px; min-width: 56px; height: 56px; }

/* desktop quick actions */
.lh-quick { display: none; }
.lh-qbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
  background: transparent; color: var(--lh-muted); font-weight: 600; font-size: .9375rem; transition: background-color .12s, color .12s;
}
.lh-qbtn:hover { background: var(--lh-surface-2); color: var(--lh-text); }
.lh-qbtn--icon { width: 44px; padding: 0; justify-content: center; }

@media (max-width: 767.98px) {
  html:has(#lh-app) { scroll-padding-block-end: 96px; } /* WCAG 2.4.11: focus never hidden by the sticky bar */
  .lh-bar {
    position: sticky; z-index: 20; bottom: max(8px, env(safe-area-inset-bottom)); padding: 6px; margin-block-start: 10px;
    background: color-mix(in srgb, var(--lh-surface) 92%, transparent); border: 1px solid var(--lh-border); border-radius: 999px;
    box-shadow: var(--lh-shadow-md); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .lh-spin { height: 52px; }
  .lh-bar__entries { height: 52px; border-color: transparent; background: var(--lh-surface-2); }
  .lh-bar__more { height: 52px; width: 52px; min-width: 52px; border-color: transparent; background: var(--lh-surface-2); }
}
/* phones: the Entries button keeps its accessible name but shows only the icon and the count, so Spin stays the widest */
@media (max-width: 439.98px) {
  .lh-bar__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lh-bar__entries { padding: 0 14px; }
}
@media (min-width: 768px) {
  .lh-bar { max-width: 400px; margin-block-start: 14px; }
  .lh-bar__entries, .lh-bar__more { display: none; }
  .lh-spin { height: 60px; }
  .lh-spin__kbd { display: block; }
  .lh-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-block-start: 10px; }
}

/* ---------- Panel (desktop side panel / mobile bottom sheet content) ---------- */
.lh-panel {
  flex-direction: column; min-width: 0; min-height: 0; background: var(--lh-surface); border: 1px solid var(--lh-border);
  border-radius: 20px; box-shadow: var(--lh-shadow-sm); overflow: hidden;
}
@media (min-width: 768px) {
  /* as tall as the wheel column (size containment: a long list never stretches the row), at least 520 px;
     the tab panels scroll inside */
  .lh-grid > .lh-panel { align-self: stretch; contain: size; min-height: 520px; }
}
.lh-panel__grab, .lh-sheet__grab { display: none; }
.lh-panel__head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.lh-title {
  flex: 1; min-width: 0; height: 40px; padding: 0 10px; margin-inline-start: -10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; font-weight: 800; font-size: 1.125rem; text-overflow: ellipsis;
}
.lh-title:hover { background: var(--lh-surface-2); }
.lh-title:focus { background: var(--lh-surface); border-color: var(--lh-border-strong); outline: 2px solid var(--lh-focus); outline-offset: 1px; }
.lh-title[readonly] { pointer-events: none; }
.lh-saved { display: inline-flex; align-items: center; gap: 4px; color: var(--lh-success); font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.lh-saved .lh-ic { width: 16px; height: 16px; }
.lh-saved.is-on { animation: lh-fade-in .2s; }
.lh-panel__close { display: none; }
.lh-tabs { display: flex; gap: 4px; margin: 0 12px; padding: 4px; border-radius: 14px; background: var(--lh-surface-2); }
.lh-tab {
  flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--lh-muted); font-weight: 650; font-size: .9375rem; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.lh-tab .lh-ic { width: 18px; height: 18px; }
.lh-tab:hover { color: var(--lh-text); }
.lh-tab[aria-selected="true"] { background: var(--lh-surface); color: var(--lh-text); box-shadow: var(--lh-shadow-sm), 0 0 0 1px var(--lh-border); }
.lh-tab[aria-selected="true"] .lh-count { background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); }
.lh-tp { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; padding: 12px 16px 16px; overflow: auto; overscroll-behavior: contain; }
.lh-tp__empty { margin: 24px 0; text-align: center; }

/* entries tab */
.lh-ed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lh-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--lh-surface-2); }
.lh-seg__btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--lh-muted); font-weight: 650; font-size: .875rem; }
.lh-seg__btn .lh-ic { width: 16px; height: 16px; }
.lh-seg__btn[aria-pressed="true"] { background: var(--lh-surface); color: var(--lh-text); box-shadow: var(--lh-shadow-sm); }
.lh-counter { color: var(--lh-muted); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
/* the editor shrinks with the panel down to 168 px, never below (the tab scrolls instead: no overlap) */
.lh-ed { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 168px; }
.lh-app--list .lh-ed { flex: none; min-height: 0; }
.lh-ed.is-drop::after { content: ""; position: absolute; inset: 0; border: 2px dashed var(--lh-brand); border-radius: 12px; background: color-mix(in srgb, var(--lh-brand) 8%, transparent); pointer-events: none; }
.lh-text, .lh-field {
  width: 100%; border: 1px solid var(--lh-border-strong); border-radius: 10px; background: var(--lh-surface); color: var(--lh-text);
  font-size: 1rem; transition: border-color .12s, box-shadow .12s;
}
.lh-text { flex: 1 1 auto; min-height: 0; padding: 12px 14px; line-height: 1.6; resize: vertical; background: var(--lh-surface-2); border-color: transparent; box-shadow: inset 0 0 0 1px var(--lh-border); }
.lh-text:focus, .lh-field:focus { outline: 2px solid var(--lh-focus); outline-offset: 0; border-color: transparent; background: var(--lh-surface); }
.lh-text[readonly] { opacity: .75; }
.lh-field { min-height: 44px; padding: 8px 12px; }
.lh-field--area { min-height: 88px; line-height: 1.5; resize: vertical; }
.lh-hint { margin: 0; color: var(--lh-muted); font-size: .8125rem; line-height: 1.45; }
.lh-warn { margin: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--lh-warning) 12%, transparent); color: var(--lh-text); font-size: .8125rem; }
.lh-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lh-tools__sep { display: none; }
.lh-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px;
  border: 1px solid var(--lh-border); border-radius: 12px; background: var(--lh-surface); color: var(--lh-text); font-size: .75rem; font-weight: 650;
  transition: background-color .12s, scale .12s var(--lh-ease);
}
.lh-tool span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-tool:hover { background: var(--lh-surface-2); }
.lh-tool:active { scale: .96; }
.lh-tool[aria-disabled="true"] { opacity: .45; cursor: default; }
.lh-tool--icon { min-height: 52px; }
[dir="rtl"] .lh-tool[data-tool="undo"] .lh-ic, [dir="rtl"] .lh-tool[data-tool="redo"] .lh-ic,
[dir="rtl"] .lh-tool[data-tool="shuffle"] .lh-ic, [dir="rtl"] .lh-tool[data-tool="sort"] .lh-ic { scale: -1 1; }
.lh-done { display: none; }
.lh-app--ro .lh-tp--entries .lh-ed, .lh-app--ro .lh-tools, .lh-app--ro .lh-seg, .lh-app--ro .lh-hint { display: none; }
.lh-ro-note { display: none; }
.lh-app--ro .lh-ro-note { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--lh-brand-soft); }
.lh-ro-note p { margin: 0; font-size: .9375rem; }

/* list mode */
.lh-list { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-height: 0; }
.lh-list__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lh-list__optl { color: var(--lh-muted); font-size: .8125rem; font-weight: 650; margin-inline-end: 2px; }
.lh-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lh-check--chip { position: relative; min-height: 32px; padding: 0 10px; border: 1px solid var(--lh-border); border-radius: 999px; font-size: .8125rem; font-weight: 600; }
.lh-check--chip:has(input:checked) { background: var(--lh-brand-soft); border-color: transparent; color: var(--lh-brand-soft-ink); }
.lh-check--chip:has(:focus-visible) { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-check--chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lh-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lh-row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 4px 6px;
  padding: 6px; border: 1px solid var(--lh-border); border-radius: 12px; background: var(--lh-surface);
}
.lh-row__meta { grid-column: 3 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lh-row.is-off .lh-row__t { color: var(--lh-muted); text-decoration: line-through; }
.lh-row.is-x { background: var(--lh-surface-2); }
.lh-row.is-drag { box-shadow: var(--lh-shadow-md); border-color: var(--lh-brand); position: relative; z-index: 2; }
.lh-row__grip { display: grid; place-items: center; width: 24px; height: 40px; color: var(--lh-muted); cursor: grab; touch-action: none; }
.lh-row__on { width: 22px; height: 22px; margin: 0 4px; accent-color: var(--lh-brand); flex: none; cursor: pointer; }
.lh-row__t { min-width: 0; min-height: 40px; padding: 6px 10px; }
.lh-row__l { flex: 1 1 100px; min-height: 40px; padding: 6px 10px; }
.lh-row__q { width: 76px; min-height: 40px; padding: 6px 8px; }
.lh-row__pct { padding-inline: 4px; color: var(--lh-muted); font-size: .8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.lh-row__color { position: relative; display: inline-flex; align-items: center; }
.lh-row__color input { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--lh-border); border-radius: 10px; background: var(--lh-surface); cursor: pointer; }
.lh-row__color.is-low input { border-color: var(--lh-warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lh-warning) 35%, transparent); }
.lh-row__creset { position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--lh-text); color: var(--lh-surface); display: grid; place-items: center; }
.lh-row__creset .lh-ic { width: 12px; height: 12px; }
.lh-row__x { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); font-size: .75rem; font-weight: 700; }
.lh-row__x .lh-ic { width: 14px; height: 14px; }
.lh-row__x--out { background: var(--lh-surface-2); color: var(--lh-muted); }
.lh-row__mv { display: inline-flex; margin-inline-start: auto; }
.lh-row__b { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--lh-muted); }
.lh-row__b:hover { background: var(--lh-surface-2); color: var(--lh-text); }
.lh-row__del:hover { color: var(--lh-danger); }
.lh-step { display: inline-flex; align-items: center; border: 1px solid var(--lh-border-strong); border-radius: 10px; overflow: hidden; background: var(--lh-surface); }
.lh-step__b { width: 36px; height: 40px; border: 0; background: transparent; font-size: 1.125rem; font-weight: 700; color: var(--lh-muted); }
.lh-step__b:hover { background: var(--lh-surface-2); color: var(--lh-text); }
.lh-step__v, .lh-step .lh-num { width: 52px; height: 40px; border: 0; border-inline: 1px solid var(--lh-border); text-align: center; background: transparent; font-variant-numeric: tabular-nums; font-weight: 650; -moz-appearance: textfield; }
.lh-step .lh-num::-webkit-inner-spin-button, .lh-step .lh-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lh-step__v:focus, .lh-step .lh-num:focus { outline: 2px solid var(--lh-focus); outline-offset: -2px; }
.lh-list__foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* results tab */
.lh-res__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lh-res__h { margin: 0; font-size: .9375rem; font-weight: 750; }
.lh-res__tools { display: flex; gap: 4px; flex-wrap: wrap; }
.lh-res__scores { display: flex; flex-direction: column; gap: 10px; padding-block-end: 12px; margin-block-end: 4px; border-block-end: 1px solid var(--lh-border); }
.lh-res__seq { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--lh-surface-2); font-size: .875rem; font-weight: 600; }
.lh-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lh-bars__i { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 8fr) auto; align-items: center; gap: 10px; font-size: .875rem; }
.lh-bars__l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lh-bars__track { height: 12px; border-radius: 6px; background: var(--lh-surface-2); overflow: hidden; }
.lh-bars__fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--lh-brand), color-mix(in srgb, var(--lh-brand) 60%, var(--lh-accent))); }
[dir="rtl"] .lh-bars__fill { background: linear-gradient(-90deg, var(--lh-brand), color-mix(in srgb, var(--lh-brand) 60%, var(--lh-accent))); }
.lh-bars__n { min-width: 28px; text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.lh-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lh-hist__i { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 4px; border-block-end: 1px solid var(--lh-border); }
.lh-hist__i:last-child { border-block-end: 0; }
.lh-hist__time { flex: none; color: var(--lh-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; direction: ltr; }
.lh-hist__w { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 650; overflow-wrap: anywhere; }
.lh-hist__t { color: var(--lh-brand-soft-ink); font-size: .75rem; font-weight: 700; }
.lh-hist__m { color: var(--lh-muted); }
.lh-hist__m .lh-ic { width: 16px; height: 16px; }

/* settings tab */
.lh-set { display: flex; flex-direction: column; gap: 14px; }
.lh-set__g { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--lh-border); border-radius: 16px; }
.lh-set__gh { margin: 0 0 4px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lh-muted); }
.lh-set__row { display: flex; flex-direction: column; gap: 6px; padding-block: 8px; }
.lh-set__row + .lh-set__row { border-block-start: 1px solid var(--lh-border); }
.lh-set__row--sw { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.lh-set__row--sw .lh-set__help { grid-column: 1 / -1; }
.lh-set__row--inline { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; }
.lh-set__row--inline .lh-set__help { grid-column: 1 / -1; }
.lh-set__l { font-weight: 650; font-size: .9375rem; padding: 0; }
.lh-set__lr { display: flex; justify-content: space-between; align-items: baseline; }
.lh-set__out { font-variant-numeric: tabular-nums; font-weight: 750; color: var(--lh-brand-soft-ink); }
.lh-set__help { margin: 0; color: var(--lh-muted); font-size: .8125rem; line-height: 1.45; }
.lh-set__fs { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lh-set__fs legend { margin-block-end: 8px; }
.lh-set > .lh-set__help { align-self: flex-start; }
.lh-sw { appearance: none; -webkit-appearance: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: 999px; background: var(--lh-border-strong); cursor: pointer; transition: background-color .15s; flex: none; }
.lh-sw::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: inset-inline-start .15s var(--lh-ease); }
.lh-sw:checked { background: var(--lh-brand); }
.lh-sw:checked::before { inset-inline-start: 23px; }
.lh-sw:disabled { opacity: .45; cursor: default; }
.lh-sw:focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-segr { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--lh-surface-2); }
.lh-segr__o { position: relative; flex: 1 1 0; min-width: max-content; }
.lh-segr__o input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lh-segr__o span { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 10px; border-radius: 9px; font-size: .875rem; font-weight: 650; color: var(--lh-muted); text-align: center; }
.lh-segr__o input:checked + span { background: var(--lh-surface); color: var(--lh-text); box-shadow: var(--lh-shadow-sm); }
.lh-segr__o input:focus-visible + span { outline: 2px solid var(--lh-focus); outline-offset: 1px; }
.lh-select { min-width: 140px; min-height: 44px; padding-inline-end: 32px; }
.lh-num { -moz-appearance: textfield; }
.lh-range { width: 100%; accent-color: var(--lh-brand); height: 28px; }
.lh-pals { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.lh-pal { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--lh-border); border-radius: 12px; cursor: pointer; }
.lh-pal input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lh-pal:has(input:checked) { border-color: var(--lh-brand); box-shadow: 0 0 0 1px var(--lh-brand); }
.lh-pal:has(:focus-visible) { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-pal__sw { display: flex; height: 18px; border-radius: 6px; overflow: hidden; }
.lh-pal__sw i { flex: 1; }
.lh-pal__n { font-size: .8125rem; font-weight: 650; }
.lh-set__help.lh-btn, .lh-btn.lh-set__help { align-self: flex-start; margin-block-start: 6px; color: var(--lh-text); }

/* ---------- Dialogs: bottom sheets (mobile) / cards (desktop) ---------- */
.lh-sheet {
  position: fixed; inset: auto 0 0 0; bottom: var(--lh-kb, 0px); width: 100%; max-width: 100%; margin: 0; padding: 0;
  max-height: calc(var(--lh-vvh, 100dvh) * .92); border: 0; border-radius: 20px 20px 0 0; overflow: hidden;
  background: var(--lh-surface); color: var(--lh-text); box-shadow: 0 -10px 40px rgba(0, 0, 0, .22); overscroll-behavior: contain;
  flex-direction: column;
}
.lh-sheet[open] { display: flex; animation: lh-sheet-in .24s var(--lh-ease); }
.lh-sheet::backdrop { background: rgba(14, 15, 19, .55); animation: lh-fade-in .2s; }
.lh-sheet__grab, .lh-sheet > .lh-panel > .lh-panel__grab { display: block; flex: none; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--lh-border-strong); opacity: .6; }
.lh-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px 6px 20px; }
.lh-sheet__title { margin: 0; font-size: 1.125rem; font-weight: 800; }
.lh-sheet__body { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 20px 16px; overscroll-behavior: contain; }
.lh-sheet__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-block-start: 1px solid var(--lh-border); }
.lh-sheet--sm .lh-sheet__body { padding-block-end: calc(20px + env(safe-area-inset-bottom)); }
@keyframes lh-sheet-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes lh-fade-in { from { opacity: 0; } }
@media (min-width: 768px) {
  .lh-sheet { inset: 0; margin: auto; width: min(560px, calc(100% - 48px)); height: fit-content; max-height: min(86vh, 780px); border-radius: 24px; box-shadow: var(--lh-shadow-lg); } /* centred card */
  .lh-sheet[open] { animation: lh-pop-in .2s var(--lh-ease); }
  .lh-sheet__grab, .lh-sheet > .lh-panel > .lh-panel__grab { display: none; }
  .lh-sheet--sm { width: min(480px, calc(100% - 48px)); }
}
@keyframes lh-pop-in { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* the panel inside the mobile sheet */
.lh-sheet--panel > .lh-panel { display: flex; flex: 1 1 auto; min-height: 0; max-height: inherit; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.lh-sheet--panel { height: calc(var(--lh-vvh, 100dvh) * .9); }
.lh-sheet--panel .lh-panel__close { display: inline-flex; }
.lh-sheet--panel .lh-done { display: flex; flex: none; margin-block-start: 4px; min-height: 52px; border-radius: 999px; font-size: 1rem; }
.lh-sheet--panel .lh-ed { min-height: 160px; }
.lh-sheet--panel .lh-tp { padding-block-end: calc(16px + env(safe-area-inset-bottom)); }

/* menu ⋯ */
.lh-menu__list { display: flex; flex-direction: column; padding: 4px 8px calc(12px + env(safe-area-inset-bottom)); }
.lh-menu__item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; font-weight: 650; font-size: 1rem; text-align: start; }
.lh-menu__item:hover { background: var(--lh-surface-2); }
.lh-menu__item > span:not(.lh-switch) { flex: 1; display: flex; flex-direction: column; }
.lh-menu__item small { color: var(--lh-muted); font-size: .8125rem; font-weight: 500; }
.lh-menu__item--switch { padding-block: 8px; min-height: 64px; border-block-start: 1px solid var(--lh-border); border-radius: 0 0 12px 12px; margin-block-start: 4px; }
.lh-switch { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--lh-border-strong); transition: background-color .15s; }
.lh-switch::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: inset-inline-start .15s var(--lh-ease); }
[aria-checked="true"] > .lh-switch { background: var(--lh-brand); }
[aria-checked="true"] > .lh-switch::before { inset-inline-start: 23px; }
@media (min-width: 768px) { .lh-menu { width: min(400px, calc(100% - 48px)); } }

/* My wheels drawer: side panel on desktop */
.lh-mw__top { display: flex; flex-direction: column; gap: 10px; }
.lh-mw__search { position: relative; }
.lh-mw__search > .lh-ic { position: absolute; top: 50%; inset-inline-start: 12px; translate: 0 -50%; color: var(--lh-muted); pointer-events: none; }
.lh-mw__q { padding-inline-start: 40px; }
.lh-mw__new { display: flex; gap: 8px; flex-wrap: wrap; }
.lh-mw__note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--lh-surface-2); color: var(--lh-muted); font-size: .8125rem; }
.lh-mw__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lh-mw__i { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0; border: 1px solid var(--lh-border); border-radius: 14px; background: var(--lh-surface); }
.lh-mw__i.is-current { border-color: var(--lh-brand); box-shadow: 0 0 0 1px var(--lh-brand); }
.lh-mw__main { flex: 1; min-width: 0; padding-inline-start: 4px; }
.lh-mw__open { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; text-align: start; }
.lh-mw__open:hover { background: var(--lh-surface-2); }
.lh-mw__t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lh-mw__meta { display: inline-flex; gap: 6px; align-items: center; color: var(--lh-muted); font-size: .8125rem; }
.lh-mw__cur { padding: 0 8px; border-radius: 999px; background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.lh-mw__acts { display: flex; flex: none; }
.lh-mw__acts .lh-btn--icon { width: 40px; min-width: 40px; min-height: 40px; color: var(--lh-muted); }
.lh-mw__acts .lh-btn--icon:hover { color: var(--lh-text); }
.lh-mw__rename { margin: 4px 0; }
.lh-mw__empty { padding: 24px 8px; text-align: center; color: var(--lh-muted); border: 1px dashed var(--lh-border); border-radius: 14px; list-style: none; }
.lh-mw__empty p { margin: 0; }
.lh-mw__trash { display: flex; flex-direction: column; gap: 8px; }
.lh-mw__ttoggle { align-self: flex-start; color: var(--lh-muted); }
.lh-mw__list--trash .lh-mw__i { opacity: .85; padding: 6px; }
.lh-mw__list--trash .lh-mw__main { display: flex; flex-direction: column; padding-inline-start: 8px; }
.lh-mw__privacy { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; margin: 0; color: var(--lh-muted); font-size: .75rem; }
.lh-mw__privacy .lh-ic { width: 16px; height: 16px; }
@media (min-width: 768px) {
  .lh-drawer { inset: 0; inset-inline-start: auto; margin: 0; width: min(440px, 100%); height: 100dvh; max-height: 100dvh; border-radius: 24px 0 0 24px; }
  [dir="rtl"] .lh-drawer { border-radius: 0 24px 24px 0; }
  .lh-drawer[open] { animation: lh-drawer-in .24s var(--lh-ease); }
  [dir="rtl"] .lh-drawer[open] { animation-name: lh-drawer-in-rtl; }
}
@keyframes lh-drawer-in { from { transform: translateX(32px); opacity: 0; } }
@keyframes lh-drawer-in-rtl { from { transform: translateX(-32px); opacity: 0; } }

/* share dialog */
.lh-share .lh-sheet__body { gap: 14px; }
.lh-tabs--share { margin: 0; }
.lh-share .lh-tp { padding: 4px 0 0; overflow: visible; }
.lh-share__lead { margin: 0; color: var(--lh-muted); font-size: .9375rem; }
.lh-share__url { font-size: .875rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; text-overflow: ellipsis; }
.lh-share__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lh-share__acts .lh-btn { flex: 1 1 auto; }
.lh-share__warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--lh-warning) 12%, transparent); font-size: .875rem; }
.lh-share__warn > .lh-ic { color: var(--lh-warning); }
.lh-share__warn > span { flex: 1 1 200px; }
.lh-share__privacy { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--lh-muted); font-size: .8125rem; }
.lh-share__privacy .lh-ic { width: 16px; height: 16px; margin-block-start: 2px; }
.lh-share__extra:empty { display: none; }
.lh-tabs--share .lh-tab { gap: 6px; }
@media (max-width: 379.98px) { .lh-tabs--share .lh-tab .lh-ic { display: none; } }
/* QR code (Link tab): always dark on white, whatever the theme (scanners) */
.lh-share__qr { min-height: 132px; }
.lh-qr { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--lh-border); border-radius: 16px; }
.lh-qr__code { flex: none; width: 108px; height: 108px; padding: 0; border: 0; border-radius: 10px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(20, 21, 26, .12); cursor: zoom-in; }
.lh-qr__code svg { display: block; width: 100%; height: 100%; border-radius: 10px; }
.lh-qr__txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lh-qr__t { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 750; }
.lh-qr__t .lh-ic { width: 18px; height: 18px; color: var(--lh-brand-soft-ink); }
.lh-qr__l { margin: 0; color: var(--lh-muted); font-size: .8125rem; line-height: 1.4; }
.lh-qr__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.lh-qr--off { gap: 10px; color: var(--lh-muted); border-style: dashed; }
.lh-qrbig { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: transparent; align-items: center; justify-content: center; }
.lh-qrbig[open] { display: flex; }
.lh-qrbig::backdrop { background: rgba(14, 15, 19, .72); animation: lh-fade-in .2s; }
.lh-qrbig__card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(560px, 100%, 100dvh - 64px); padding: 20px 20px 24px; border-radius: 24px; background: #FFFFFF; color: #14151A; box-shadow: var(--lh-shadow-lg); animation: lh-pop-in .2s var(--lh-ease); }
.lh-qrbig__x { position: absolute; top: 8px; inset-inline-end: 8px; color: #14151A; }
.lh-qrbig__t { margin: 0; max-width: calc(100% - 96px); font-size: 1.25rem; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.lh-qrbig__code { width: 100%; aspect-ratio: 1; }
.lh-qrbig__code svg { display: block; width: 100%; height: 100%; }
.lh-qrbig__l { margin: 0; font-weight: 650; color: #5B6070; }
/* Image of the result */
.lh-img__fmt { align-self: flex-start; }
.lh-img__shape { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-radius: 3px; }
.lh-img__shape--story { width: 10px; height: 16px; }
.lh-img { position: relative; display: flex; justify-content: center; align-items: center; margin: 0; height: min(46vh, 380px); border-radius: 16px; background: var(--lh-surface-2); overflow: hidden; }
.lh-img__pic { display: block; max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--lh-shadow-md); }
.lh-img__pic:not([src]) { visibility: hidden; }
.lh-img__status { margin: -4px 0 0; min-height: 1.25em; color: var(--lh-muted); font-size: .875rem; text-align: center; }
.lh-img__status:empty { display: none; }
.lh-img-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 12px; text-align: center; color: var(--lh-muted); border: 2px dashed var(--lh-border); border-radius: 16px; }
.lh-img-empty > .lh-ic { width: 40px; height: 40px; }
.lh-img-empty p { margin: 0; max-width: 32ch; font-weight: 600; }
/* Embed code */
.lh-embed__opts { display: flex; flex-direction: column; padding: 4px 14px; border: 1px solid var(--lh-border); border-radius: 16px; }
.lh-embed__opts .lh-set__row { padding-block: 6px; }
.lh-embed__code { min-height: 150px; font: .75rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; text-align: left; }
.lh-embed__dev { font-size: .875rem; color: var(--lh-muted); }
.lh-embed__dev summary { padding-block: 10px; cursor: pointer; font-weight: 650; color: var(--lh-text); }
.lh-embed__dev p { margin: 4px 0 8px; }
.lh-embed__dev pre { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--lh-surface-2); color: var(--lh-text); overflow-x: auto; font: .75rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: left; }

/* classroom: absent pupils (one checkbox per pupil) */
.lh-abs__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lh-abs__l {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--lh-border); border-radius: 12px;
  background: var(--lh-surface); font-weight: 650; cursor: pointer; overflow-wrap: anywhere;
}
.lh-abs__l input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--lh-brand); cursor: pointer; }
.lh-abs__l:has(:focus-visible) { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-abs__i.is-absent .lh-abs__l { background: var(--lh-surface-2); color: var(--lh-muted); text-decoration: line-through; border-style: dashed; }
.lh-abs__count { flex: 1 1 auto; margin: 0; color: var(--lh-muted); font-size: .875rem; font-weight: 650; }
.lh-classroom .lh-abs__l { font-size: 1.0625rem; }

/* help */
.lh-help { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.lh-help th { text-align: start; color: var(--lh-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 6px 4px; }
.lh-help td { padding: 10px 4px; border-block-start: 1px solid var(--lh-border); vertical-align: top; }
.lh-help td small { display: block; color: var(--lh-muted); font-size: .8125rem; }
.lh-keys { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; direction: ltr; }
.lh-keys__plus { color: var(--lh-muted); font-size: .75rem; }
.lh-help kbd, .lh-keys kbd { display: inline-block; min-width: 28px; padding: 2px 8px; border: 1px solid var(--lh-border-strong); border-block-end-width: 2px; border-radius: 6px; background: var(--lh-surface-2); font: 600 .8125rem/1.5 inherit; text-align: center; }

/* anchored menu (export) */
.lh-pop { position: absolute; z-index: 60; min-width: 220px; padding: 6px; display: flex; flex-direction: column; border: 1px solid var(--lh-border); border-radius: 14px; background: var(--lh-surface); box-shadow: var(--lh-shadow-lg); animation: lh-pop-in .14s var(--lh-ease); }
.lh-pop__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: .9375rem; text-align: start; }
.lh-pop__item:hover, .lh-pop__item:focus-visible { background: var(--lh-surface-2); }

/* ---------- Winner dialog (§4.6, §9.7) ---------- */
.lh-win {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 16px;
  border: 0; background: transparent; color: var(--lh-text); overflow: auto; overscroll-behavior: contain;
  align-items: center; justify-content: center;
}
.lh-win[open] { display: flex; }
.lh-win::backdrop { background: rgba(14, 15, 19, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: lh-fade-in .2s; }
.lh-win__card {
  position: relative; z-index: 1; width: min(520px, 100%); margin: auto; overflow: hidden; border-radius: 24px; background: var(--lh-surface);
  box-shadow: var(--lh-shadow-lg), 0 30px 80px -20px color-mix(in srgb, var(--lh-win, #5B3DF5) 55%, transparent);
  text-align: center; animation: lh-spring .32s linear;
}
@keyframes lh-spring { 0% { transform: scale(.82); opacity: 0; } 35% { opacity: 1; } 55% { transform: scale(1.04); } 75% { transform: scale(.985); } 100% { transform: scale(1); } }
.lh-win__band { height: 12px; background: var(--lh-win, var(--lh-brand)); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08); }
.lh-win__x { position: absolute; top: 18px; inset-inline-end: 10px; }
.lh-win__body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 24px 8px; }
.lh-win__title { margin: 0; max-width: calc(100% - 48px); color: var(--lh-muted); font-size: .8125rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lh-win__name {
  margin: 0; max-width: 100%; padding: .22em .6em .26em; border-radius: 24px; background: var(--lh-win, var(--lh-brand)); color: var(--lh-win-ink, #FFFFFF);
  font-size: clamp(2rem, 9vw, 4.5rem); font-weight: 850; line-height: 1.08; overflow-wrap: anywhere; text-wrap: balance; unicode-bidi: plaintext;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -8px color-mix(in srgb, var(--lh-win, #5B3DF5) 70%, transparent);
}
.lh-win__name.is-long { font-size: clamp(1.5rem, 6.4vw, 2.75rem); }
.lh-win.is-multi .lh-win__name { font-size: clamp(1.5rem, 6vw, 2.25rem); }
.lh-win__full { margin: 0; font-size: 1.0625rem; line-height: 1.45; max-width: 40ch; overflow-wrap: anywhere; }
.lh-win__meta { margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--lh-surface-2); color: var(--lh-text); font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.lh-win__rank { list-style: none; counter-reset: lhr; margin: 4px 0 0; padding: 0; width: 100%; max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; text-align: start; }
.lh-win__ri { counter-increment: lhr; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; background: var(--lh-surface-2); }
.lh-win__ri::before { content: counter(lhr); flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--lh-text); color: var(--lh-surface); font-weight: 800; font-size: .8125rem; }
.lh-win__ri:first-child::before { background: var(--lh-accent); color: #14151A; }
.lh-win__dot { width: 12px; height: 12px; flex: none; border-radius: 50%; }
.lh-win__rt { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.lh-win__rt small { color: var(--lh-muted); font-size: .75rem; font-weight: 700; }
.lh-win__rt strong { font-size: 1.0625rem; }
.lh-win__extra:empty { display: none; }
.lh-win__extra { width: 100%; }
.lh-win__acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 18px 24px 6px; }
.lh-win__acts .lh-btn--primary { flex: 1 1 100%; }
.lh-win__acts .lh-btn:not(.lh-btn--primary) { flex: 1 1 0; }
.lh-win__more { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 4px 16px 16px; }
.lh-win__more .lh-btn { color: var(--lh-muted); padding-inline: 10px; }
.lh-win.is-halo .lh-win__card { animation: lh-fade-in .15s; box-shadow: 0 0 0 6px color-mix(in srgb, var(--lh-win) 45%, transparent), 0 0 70px 18px color-mix(in srgb, var(--lh-win) 55%, transparent); }
.lh-confetti { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; pointer-events: none; } /* behind the card: the name stays readable */

/* ---------- Toasts / snackbar (§9.6) ---------- */
.lh-toasts { position: fixed; z-index: 70; inset-inline: 0; bottom: calc(92px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; padding-inline: 16px; pointer-events: none; }
.lh-toasts:empty { display: none; }
/* ≥ 768 px the wheel fits the viewport, so its bottom edge holds Spin and the editor tools: toasts go to the top */
@media (min-width: 768px) {
  /* centred over the wheel column (the side panel is 360 / 400 px + gap), never over Spin or the editor tools */
  .lh-toasts { top: 80px; bottom: auto; inset-inline-end: 384px; flex-direction: column-reverse; }
  .lh-toast { animation-name: lh-toast-down; }
  .lh-app--fs .lh-toasts, .lh-app--embed .lh-toasts, dialog .lh-toasts { inset-inline-end: 0; }
}
@media (min-width: 1024px) { .lh-toasts { inset-inline-end: 432px; } }
@keyframes lh-toast-down { from { opacity: 0; transform: translateY(-12px); } }
.lh-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(560px, 100%); min-height: 48px; padding: 6px 6px 6px 16px;
  border-radius: 14px; background: var(--lh-toast-bg); color: var(--lh-toast-ink); box-shadow: var(--lh-shadow-lg); font-size: .9375rem; font-weight: 550;
  animation: lh-toast-in .22s var(--lh-ease);
}
.lh-toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s; }
@keyframes lh-toast-in { from { opacity: 0; transform: translateY(12px); } }
.lh-toast__ic { width: 18px; height: 18px; color: var(--lh-toast-act); }
.lh-toast--error .lh-toast__ic { color: #FF8A8A; }
.lh-toast__msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lh-toast__act { min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--lh-toast-act); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .8125rem; }
.lh-toast__act:hover { background: rgba(255, 255, 255, .1); }
.lh-toast__x { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: inherit; opacity: .7; }
.lh-toast__x .lh-ic { width: 18px; height: 18px; }
.lh-toast__x:hover { opacity: 1; }

/* ---------- Full screen / presentation (§4.11) ---------- */
.lh-fs-exit { display: none; }
.lh-app.lh-app--fs {
  position: fixed; inset: 0; z-index: 1000; margin: 0; width: 100vw; height: 100vh; height: 100dvh; padding: 12px;
  background: var(--lh-bg); overflow: hidden; display: flex; align-items: center; justify-content: center;
  --lh-size: min(92vw, 100dvh - 24px - 150px); /* 92vw: room for the pointer (4 % of the diameter) */
}
.lh-app--fs:fullscreen { width: 100%; height: 100%; }
.lh-app--fs .lh-grid { display: block; width: 100%; }
.lh-app--fs .lh-panel, .lh-app--fs .lh-chips, .lh-app--fs .lh-notices, .lh-app--fs .lh-quick, .lh-app--fs .lh-bar__entries,
.lh-app--fs .lh-bar__more, .lh-app--fs .lh-slot { display: none !important; }
.lh-app--fs .lh-bar { position: static; max-width: 420px; box-shadow: none; background: none; border: 0; backdrop-filter: none; padding: 0; }
.lh-app--fs .lh-fs-exit {
  position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); inset-inline-end: 12px; display: inline-flex; align-items: center; gap: 8px;
  min-width: 48px; height: 48px; padding: 0 14px; border: 1px solid var(--lh-border); border-radius: 999px; background: var(--lh-surface); color: var(--lh-text); font-weight: 650; box-shadow: var(--lh-shadow-md);
}
.lh-app--fs .lh-readout { font-size: clamp(1.125rem, 3vmin, 2rem); min-height: 52px; }
@media (orientation: landscape) {
  .lh-app.lh-app--fs { --lh-size: min(100dvh - 24px, 100vw - 24px - 320px); }
  .lh-app--fs .lh-main { display: grid; grid-template-columns: auto minmax(260px, 340px); grid-template-rows: 1fr auto auto 1fr; column-gap: 32px; align-items: center; justify-content: center; }
  .lh-app--fs .lh-stage-wrap { grid-row: 1 / -1; grid-column: 1; }
  .lh-app--fs .lh-readrow { grid-column: 2; grid-row: 2; margin: 0; flex-direction: column; }
  .lh-app--fs .lh-bar { grid-column: 2; grid-row: 3; margin-block-start: 16px; }
}

/* ---------- Compact landscape phones (§9.4: wheel left, controls right) ---------- */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023.98px) {
  .lh-app { --lh-size: max(200px, min(100svh - 32px, 56vw)); }
  .lh-grid { grid-template-columns: minmax(0, 1fr); }
  .lh-grid > .lh-panel { display: none; }
  .lh-main { display: grid; grid-template-columns: auto minmax(200px, 1fr); grid-template-areas: "notices notices" "chips chips" "above above" "stage readrow" "stage bar" "stage quick" "stage below"; column-gap: 24px; align-items: center; }
  .lh-notices { grid-area: notices; } .lh-chips { grid-area: chips; } .lh-slot--above { grid-area: above; } .lh-slot--below { grid-area: below; }
  .lh-stage-wrap { grid-area: stage; }
  .lh-readrow { grid-area: readrow; flex-direction: column; align-self: end; }
  .lh-bar { grid-area: bar; position: static; align-self: start; }
  .lh-bar__entries, .lh-bar__more { display: inline-flex; }
  .lh-quick { display: none; }
  .lh-spin__kbd { display: none; }
}

/* ---------- Classroom mode (§4.11) ---------- */
.lh-classroom [data-act="share"], .lh-classroom .lh-win__more [data-act="share"] { display: none !important; }
.lh-classroom .lh-readout { font-size: 1.375rem; min-height: 48px; }
.lh-classroom .lh-text { font-size: 1.125rem; }
.lh-classroom .lh-win__name { font-size: clamp(2.5rem, 11vw, 5.5rem); }

/* ---------- Embed ---------- */
.lh-app--embed { margin: 0; --lh-size: min(92vw, 100svh - 150px); }
.has-title .lh-app--embed { --lh-size: min(92vw, 100svh - 204px); }
@media (min-width: 768px) { /* + the full-screen quick action under Spin */
  .lh-app--embed { --lh-size: min(92vw, 100svh - 214px); }
  .has-title .lh-app--embed { --lh-size: min(92vw, 100svh - 268px); }
}
.lh-embed-title {
  margin: 4px auto 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
  font-size: clamp(1rem, 4.4vw, 1.375rem); font-weight: 800; line-height: 1.4;
}
html.js .c-main--embed:not(.is-ready) .lh-embed-title { visibility: hidden; } /* the wheel's title replaces the page's */
.lh-app--embed .lh-confetti { z-index: 30; }
.lh-embed-res {
  position: absolute; z-index: 40; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: max-content; max-width: min(86%, calc(var(--lh-size) * .86)); padding: 16px 18px 18px; border: 0; border-block-start: 8px solid var(--lh-win, var(--lh-brand));
  border-radius: 20px; background: var(--lh-surface); color: var(--lh-text); box-shadow: var(--lh-shadow-lg), 0 24px 60px -18px color-mix(in srgb, var(--lh-win, #5B3DF5) 60%, transparent);
  text-align: center; cursor: pointer; animation: lh-spring .32s linear;
}
.lh-embed-res__k { color: var(--lh-muted); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lh-embed-res__name {
  max-width: 100%; padding: .18em .55em .22em; border-radius: 16px; background: var(--lh-win, var(--lh-brand)); color: var(--lh-win-ink, #FFFFFF);
  font-size: clamp(1.375rem, 7vw, 2.5rem); font-weight: 850; line-height: 1.1; overflow-wrap: anywhere; unicode-bidi: plaintext;
}
.lh-embed-res__list { display: flex; flex-direction: column; gap: 4px; max-height: calc(var(--lh-size) * .5); overflow: auto; font-weight: 750; font-size: 1.0625rem; }
.lh-reduced .lh-embed-res { animation: lh-fade-in .15s; }

/* ---------- Reduced motion (system or forced by the setting) ---------- */
@media (prefers-reduced-motion: reduce) {
  .lh-app *, .lh-app *::before, .lh-app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .lh-app .lh-win__card { animation: lh-fade-in .15s !important; }
}
.lh-reduced .lh-app *, .lh-reduced .lh-app *::before, .lh-reduced .lh-app *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.lh-reduced .lh-app .lh-win__card { animation: lh-fade-in .15s !important; }
.lh-reduced .lh-app .lh-hub { animation: none !important; }

/* ---------- Print: just the wheel ---------- */
@media print {
  .lh-bar, .lh-quick, .lh-panel, .lh-notices, .lh-chips, .lh-toasts, .lh-hub { display: none !important; }
  .lh-stage::before { box-shadow: none; }
}
