/* Poslechová stránka sboru /choir/listen (balík LISTEN): starý a nový hlas s přepínačem A/B.
   Obyčejná responzivní stránka bez přepínače zařízení (jako hub), 320 až 1440 px a víc. Stojí na
   tokenech lab.css (--ink, --paper, --h1 až --h4, --display, --sans, --mono, --gutter, --ease);
   lištu kreslí shell.css. Starý hlas má fialovou (--h4), nový oranžovou (--h1). Dotykové cíle
   aspoň 44 px. Žádná nekonečná animace: hýbe se jen ukazatel pozice ve frázi, když hraje. */

.ls {
  --old-rgb: 180 136 255;
  --new-rgb: 255 78 38;
  --line: rgba(244, 239, 230, 0.1);
  position: relative;
  isolation: isolate;
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 36px) var(--gutter) 40px;
}
/* Dvě měkká světla v barvách hlasů, statická */
.ls::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 620px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 42% at 12% 6%, rgb(var(--old-rgb) / 0.1), transparent 72%),
    radial-gradient(44% 40% at 88% 14%, rgb(var(--new-rgb) / 0.11), transparent 72%);
}
.ls h1, .ls h2, .ls h3 { font-weight: 400; }
/* Dělení slov (lab.css pod :lang(cs)) jen v běžných odstavcích, ne v popiscích a stavu */
.ls :is(.ls-hint, .ls-status, .ls-info, .ls-voice-sub) { -webkit-hyphens: manual; hyphens: manual; }

/* ---------------------------------------------------------------- hlavička */
.ls-back {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--paper-mute);
  transition: color 0.2s;
}
.ls-arrow { position: relative; width: 14px; height: 1px; background: currentColor; }
.ls-arrow::before {
  content: ""; position: absolute; left: 0; top: -3px;
  width: 7px; height: 7px;
  border-left: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-0.5px) rotate(45deg); transform-origin: 0 50%;
  box-sizing: border-box;
}
@media (hover: hover) { .ls-back:hover { color: var(--paper); } }
.ls-title {
  margin-top: 6px;
  font-family: var(--display);
  font-size: clamp(36px, 6.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.ls-title em { font-style: italic; color: var(--h2); }
.ls-intro {
  margin-top: 14px;
  max-width: 62ch;
  font-size: clamp(16px, 1.7vw, 18px);
  color: var(--paper-mute);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- přepínač A/B a doprava */
.ls-ab {
  margin-top: clamp(20px, 3.4vw, 32px);
  padding: clamp(12px, 2.6vw, 22px);
  border-radius: 22px;
  border: 1px solid rgba(244, 239, 230, 0.09);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(244, 239, 230, 0.05), transparent 70%),
    var(--ink-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ls-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ls-voice {
  --rgb: var(--old-rgb);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
  min-width: 0;
  min-height: 92px;
  padding: 14px clamp(12px, 2.2vw, 20px);
  border-radius: 16px;
  border: 1px solid rgb(var(--rgb) / 0.28);
  background: rgb(var(--rgb) / 0.04);
  color: var(--paper-mute);
  text-align: left;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s, color 0.2s;
}
.ls-voice.ls-new { --rgb: var(--new-rgb); }
@media (hover: hover) { .ls-voice:hover { border-color: rgb(var(--rgb) / 0.6); color: var(--paper); } }
.ls-voice[aria-pressed="true"] {
  color: var(--paper);
  border-color: rgb(var(--rgb));
  background: rgb(var(--rgb) / 0.18);
  box-shadow: inset 0 0 0 1px rgb(var(--rgb)), 0 18px 44px -24px rgb(var(--rgb) / 0.8);
}
.ls-voice:focus-visible { outline-offset: 4px; border-radius: 16px; }
.ls-voice-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ls-voice-name {
  font-family: var(--display);
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.ls-voice-sub {
  font-family: var(--mono); font-size: 11px; line-height: 1.4; letter-spacing: 0.03em;
  color: var(--paper-mute);
}
.ls-dot {
  --rgb: var(--old-rgb);
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgb(var(--rgb) / 0.55);
}
.ls-new .ls-dot { --rgb: var(--new-rgb); }
.ls-voice[aria-pressed="true"] .ls-dot { background: rgb(var(--rgb)); }
/* Když hraje, vybraný hlas svítí */
.ls[data-playing] .ls-voice[aria-pressed="true"] .ls-dot { box-shadow: 0 0 0 4px rgb(var(--rgb) / 0.22), 0 0 14px rgb(var(--rgb) / 0.9); }

.ls-transport {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 18px;
  margin-top: 14px;
}
.ls .btn { --accent: var(--h2); }
.ls-play { min-height: 48px; min-width: 128px; justify-content: center; }
.ls-check {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: var(--paper);
  cursor: pointer;
}
.ls-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--h2); cursor: pointer; }
.ls-hint { font-size: 13px; line-height: 1.45; color: var(--paper-mute); text-wrap: pretty; }
.ls-ab > .ls-hint { margin-top: 2px; }
.ls-silent { margin-top: 6px; color: var(--paper); }

/* Akordy fráze s ukazatelem pozice (sloupce v poměru délek akordů 0-3,3-5,3-7,3-9,1-12,4 s) */
.ls-strip {
  --pos: 0;
  position: relative;
  display: grid;
  grid-template-columns: 33fr 20fr 20fr 18fr 33fr;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.ls-strip > span {
  min-width: 0;
  padding: 10px 4px;
  border-left: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(13px, 2.2vw, 19px);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  color: var(--paper-mute);
  transition: color 0.2s, background 0.2s;
}
.ls-strip > span:first-child { border-left: 0; }
.ls-strip > span.on { color: var(--paper); background: rgba(244, 239, 230, 0.07); }
.ls-strip::after {
  content: "";
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--pos) * 100%);
  width: 2px; margin-left: -1px;
  background: var(--h2);
  opacity: 0;
}
.ls-strip.run::after { opacity: 1; }
.ls-status {
  min-height: 3em;
  margin-top: 12px;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: 0.02em;
  color: var(--paper);
}

/* ---------------------------------------------------------------- panely */
.ls-panel {
  margin-top: clamp(18px, 3vw, 28px);
  padding: clamp(14px, 3vw, 28px);
  border-radius: 22px;
  border: 1px solid rgba(244, 239, 230, 0.09);
  background: var(--ink-soft);
}
.ls-panel h2 {
  font-family: var(--display);
  font-size: clamp(25px, 3.6vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.ls-note { margin-top: 8px; max-width: 64ch; font-size: 15px; color: var(--paper-mute); text-wrap: pretty; }

.ls-props { margin-top: 16px; }
.ls-prop {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 8px 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ls-prop > .ls-hint { grid-column: 2; }
.ls-label {
  font-family: var(--mono); font-size: 11px; line-height: 1.35;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-mute);
}
.ls-seg { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ls-seg button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid rgba(244, 239, 230, 0.16);
  background: rgba(244, 239, 230, 0.03);
  font-family: var(--mono); font-size: 12px; line-height: 1.2; letter-spacing: 0.02em;
  color: var(--paper-mute);
  text-align: left;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
@media (hover: hover) { .ls-seg button:hover { color: var(--paper); border-color: rgba(244, 239, 230, 0.4); } }
.ls-seg button[aria-pressed="true"], .ls-seg button[aria-pressed="true"]:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.ls-num { opacity: 0.55; font-variant-numeric: tabular-nums; }
.ls-range { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ls-range input[type="range"] {
  flex: 1 1 auto; min-width: 0; max-width: 380px;
  height: 44px; margin: 0;
  accent-color: var(--h2);
  cursor: pointer;
}
.ls-range output {
  flex: none; min-width: 7ch;
  font-family: var(--mono); font-size: 12px;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.ls-reset { margin-top: 16px; }

/* ---------------------------------------------------------------- WAV */
.ls-renders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-top: 16px;
}
.ls-render {
  --rgb: var(--old-rgb);
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgb(var(--rgb) / 0.28);
  background: rgb(var(--rgb) / 0.04);
}
.ls-render.ls-new { --rgb: var(--new-rgb); }
.ls-render-name {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 22px; line-height: 1.1;
}
.ls-render-name .ls-dot { background: rgb(var(--rgb)); }
.ls-render .btn { min-height: 44px; }
.ls-info {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--paper-mute);
  font-variant-numeric: tabular-nums;
}
.ls-render audio { display: block; width: 100%; height: 40px; }
.ls-dl {
  max-width: 100%;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--paper);
  text-decoration: underline; text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- telefon */
@media (max-width: 640px) {
  .ls-prop { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ls-prop > .ls-hint { grid-column: 1; }
  .ls-voice { min-height: 84px; }
  .ls-voice-top { gap: 8px; }
  .ls-seg button { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ls-voice, .ls-seg button, .ls-strip > span { transition: none; }
}
