/* Posluchačská část aplikace podle návrhu design/app.pen (obrazovky 00–10,
   mobil a desktop A, stylguide). Tokeny jsou v tokens.css.

   Pořadí: základ → prvky (sdílené napříč obrazovkami) → obrazovky (mobil)
   → tmavý režim → desktop A → omezený pohyb. Pravidlo prvku patří k prvku,
   ne na konec souboru; obrazovka jen upravuje, co je jí vlastní.
   Velikost ikony určuje proměnná --icon na rodiči (výchozí 20 px). */

/* ==========================================================================
   Základ
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.app {
  position: relative;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

/* Na mobilu jsou obsah i jeho hlavní blok jen průchozí: jejich děti se řadí
   přímo do sloupce obrazovky a tlačítka sednou dolů. Desktop z nich dělá
   pravou polovinu dělené obrazovky (split.html, viz Desktop A). */
.content, .main { display: contents; }
.panel { display: none; }
@media (max-width: 1023px) { .d-only { display: none !important; } }

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  animation: enter .45s ease both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
}

/* Rozostřená skvrna v tónu aktuálního stavu — rozhraní „vnímá stav". */
.glow {
  position: absolute;
  z-index: -1;
  top: -160px;
  right: -110px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: var(--c);
  opacity: .2;
  filter: blur(90px);
  pointer-events: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.header .end { margin-left: auto; }
.header-actions { display: flex; gap: 10px; }

.wordmark {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: .2px;
}

.title-block { display: flex; flex-direction: column; gap: 8px; }

.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
}

.muted { margin: 0; font-size: 16px; color: var(--text-2); }
.hint { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text-3); }
.sentence { margin: 0; font-size: 18px; line-height: 1.45; }

.footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Prvky
   ========================================================================== */

/* --- Ikony ------------------------------------------------------------ */
svg.icon {
  width: var(--icon, 20px);
  height: var(--icon, 20px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
svg.icon.filled { fill: currentColor; }

/* Přehrát/pauza v jednom tlačítku (makro play_pause): pauza, když hraje. */
.i-pause { display: none; }
:is(.on, .playing [data-action="toggle"]) > .i-play { display: none; }
:is(.on, .playing [data-action="toggle"]) > .i-pause { display: block; }

/* --- Tlačítka --------------------------------------------------------- */
.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 60px;
  padding: 0 24px;
  border-radius: 30px;
  font-size: 17px;
  font-weight: 600;
  border: 0;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: transparent; border: 1.5px solid var(--border); font-weight: 500; }
.btn-danger { background: var(--danger); color: var(--on-state); }
.link-btn.danger { color: var(--danger-text); }
.btn-s { --icon: 18px; height: 48px; font-size: 15px; font-weight: 500; }
.btn-s .icon { color: var(--text-2); }
/* Menší tlačítko ve tvaru pilulky v hlavičce (desktop). */
.pill-btn { width: auto; padding: 0 22px 0 18px; border-radius: 999px; }

.link-btn {
  --icon: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
}
.link-btn .icon { color: var(--text-2); }
.link-btn:disabled { cursor: default; }

a.btn, a.link-btn, a.icon-btn, a.card { color: inherit; text-decoration: none; }
a.btn-primary { color: var(--on-accent); }
form.inline { display: contents; }

/* --- Pilulky: štítek přechodu, čip cíle, souhrn check-inu ------------- */
.chip, .goal-chip, .summary {
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Štítek přechodu „Stres — Klid“. Výchozí stav se nezkracuje; dlouhý cíl
   se v úzké hlavičce zkrátí. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  max-width: 100%;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
}
.header .chip { align-self: auto; min-width: 0; }
.chip .chip-from { flex: none; }
.chip .chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip .dot { width: 14px; height: 14px; }
.chip .dot.unknown { background: var(--surface-2); border: 1.5px solid var(--text-3); }
.chip .line {
  flex: none;
  width: 28px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--from), var(--to));
}
.chip .unknown-label { color: var(--text-3); }

/* --- Karty, barevné kruhy, texty -------------------------------------- */
.card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  transition: transform .15s ease, border-color .15s ease;
}
.card:active { transform: scale(.98); }
@media (hover: hover) {
  .card:hover { border-color: var(--text-3); }
}

.orb, .dot { flex: none; border-radius: 50%; background: var(--c); }
.dot { width: 10px; height: 10px; }

.texts { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-name { display: block; font-size: 18px; font-weight: 600; }
.card-desc {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-2);
}

.stack { display: flex; flex-direction: column; gap: 12px; }

/* Karta volby, která vede dál (cíl, varianta) */
.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 20px;
}
.goal-card .orb { width: 44px; height: 44px; }
.goal-card .icon { color: var(--text-3); }

/* --- Volby s rádiem uvnitř: rádio je skryté, zvýrazní se celá volba ---- */
:is(.choice, .custom-form label) > input:is([type="radio"], [type="checkbox"]) {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
:is(.choice, .custom-form label):has(> input:focus-visible) { outline: 2px solid var(--text); outline-offset: 3px; }
.choice { position: relative; cursor: pointer; }
.choice:has(input:checked) { border: 1.5px solid var(--text); }

/* Přepínač na celou šířku: délka (06), záložky Moje nahrávky (08). */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.segmented > :is(label, a) {
  --icon: 16px;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
}
.segmented > :is(label:has(input:checked), [aria-current="page"]) {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* --- Formulářová pole a chyby ----------------------------------------- */
.form { display: flex; flex-direction: column; gap: 10px; }
.form label, .form .form-label { font-size: 15px; font-weight: 600; }

.field {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
}
.field::placeholder { color: var(--text-3); }
.field:focus { outline: none; border: 1.5px solid var(--text); }
.form .field { height: 60px; padding: 0 20px; border-radius: 18px; font-size: 18px; }
.form .field[aria-invalid="true"] { border: 1.5px solid var(--danger); }
.form .field.readonly {
  --icon: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
}
.field.readonly .icon { color: var(--text-3); }
textarea.field {
  display: block;
  height: auto;
  min-height: 96px;
  padding: 14px 16px 28px;
  border-radius: 18px;
  font-size: 16px;
  color: var(--text);
  resize: vertical;
}

.error {
  --icon: 18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}
.error .icon { margin-top: 1px; color: var(--danger); }

/* --- Srdíčko ---------------------------------------------------------- */
.favorite-form { display: contents; }
.heart .icon { transition: fill .15s ease; }
.heart.on .icon { fill: currentColor; }
.icon-btn.heart { color: var(--text); }
.card-heart {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
}
.card-heart.on { color: var(--text); }

/* --- Prázdný stav ----------------------------------------------------- */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.empty .title { font-size: 32px; }
.empty .muted { max-width: 300px; font-size: 15px; line-height: 1.45; }
.empty-mark { --icon: 22px; position: relative; width: 120px; height: 120px; margin-bottom: 12px; }
.empty-mark span { position: absolute; border-radius: 50%; border: 1.5px solid var(--border); }
.empty-mark span:nth-child(1) { inset: 0; }
.empty-mark span:nth-child(2) { inset: 22px; }
.empty-mark span:nth-child(3) {
  inset: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
}

/* ==========================================================================
   Obrazovky
   ========================================================================== */

/* --- 00 Oslovení ------------------------------------------------------ */
.onboarding .glow { opacity: .35; filter: blur(80px); width: 340px; height: 340px; }
.onboarding .glow.from { top: 40px; left: -120px; right: auto; }
.onboarding .glow.to { top: -60px; right: -120px; }
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.tagline { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 56px; line-height: 1; }
.intro { margin: 0; font-size: 17px; line-height: 1.45; color: var(--text-2); }

/* --- 01 Jak se cítíš: mřížka 2 × 3 ------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.state-card {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 20px 18px;
}
.state-card .orb { width: 30px; height: 30px; }
.create-own { margin-top: -12px; }

/* --- 03 Doporučení ---------------------------------------------------- */
.recommend-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.visual {
  position: relative;
  height: 240px;
  border-radius: 32px;
  overflow: hidden;
  /* Safari na iPhonu neořízne rozmazané kruhy (filter: blur) podle zaoblení
     přes overflow; roh přečníval (poslech na mobilu 2026-10-13). */
  clip-path: inset(0 round 32px);
  background: linear-gradient(90deg, var(--from), var(--to));
}
.visual .blob {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(40px);
}
.visual .blob.from { left: -40px; top: 40px; background: var(--from); }
.visual .blob.to { right: -60px; top: -30px; background: var(--to); }
.visual .light {
  position: absolute;
  left: 110px;
  top: 60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #FFFFFF;
  opacity: .28;
  filter: blur(50px);
}
.visual .label {
  position: absolute;
  bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-state);
}
.visual .label.now { left: 24px; }
.visual .label.later { right: 24px; }
.visual.missing { background: linear-gradient(90deg, var(--from), var(--surface-2) 85%); }
.visual.missing .blob.to { background: var(--surface-2); }
.visual.missing .light { opacity: .15; }
.visual.missing .label.later { color: var(--text-2); }

.text-block { display: flex; flex-direction: column; gap: 14px; }

.transition-title {
  --icon: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.transition-title .icon { color: var(--text-3); }

.meta { --icon: 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: 15px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Varianta pod doporučením (Energie → Motivace) */
.variant { display: flex; flex-direction: column; gap: 8px; }

/* --- 04 Přehrávač ----------------------------------------------------- */
.player { justify-content: space-between; align-items: center; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.player .header { width: 100%; }

.stage {
  position: relative;
  width: min(320px, 82vw);
  aspect-ratio: 1;
}
.stage > * { position: absolute; border-radius: 50%; }
.stage .ring { inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2; }
.ring .track { stroke: var(--border); }
.ring .progress { stroke: var(--text); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }

.stage .orb-glow {
  inset: 9%;
  background: linear-gradient(135deg, var(--from), var(--to));
  opacity: .55;
  filter: blur(50px);
}
.stage .orb-base,
.stage .orb-to { inset: 12.5%; }
.stage .orb-base { background: linear-gradient(135deg, var(--from), var(--to)); }
/* S postupem poslechu převládne cílová barva — přechod stavů v čase. */
.stage .orb-to {
  background: radial-gradient(circle at 60% 65%, var(--to), color-mix(in srgb, var(--to) 70%, var(--from)));
  opacity: calc(var(--p, 0) * .85);
  transition: opacity .3s linear;
}
.stage .orb-light {
  left: 25%;
  top: 22%;
  width: 34%;
  height: 34%;
  background: #FFFFFF;
  opacity: .25;
  filter: blur(30px);
}
.stage .breath { inset: 0; animation: breathe 10s ease-in-out infinite; animation-play-state: paused; }
.stage .breath > * { position: absolute; border-radius: 50%; }
.playing .stage .breath { animation-play-state: running; }

@keyframes breathe {
  50% { transform: scale(1.04); }
}

/* Světlo uvnitř koule se pomalu toulá. Vodorovný a svislý pohyb mají různé,
   nesoudělné délky (19 s a 29 s), takže se dráha dlouho neopakuje a působí
   nahodile. Rozsah drží střed světla uvnitř koule; běží jen při poslechu. */
@property --light-x { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --light-y { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.stage .orb-light {
  translate: var(--light-x) var(--light-y);
  animation: light-x 19s ease-in-out infinite, light-y 29s ease-in-out infinite;
  animation-play-state: paused;
}
.playing .stage .orb-light { animation-play-state: running; }
@keyframes light-x {
  0%, 100% { --light-x: 0%; }
  20% { --light-x: 28%; }
  45% { --light-x: 62%; }
  70% { --light-x: 18%; }
  85% { --light-x: -14%; }
}
@keyframes light-y {
  0%, 100% { --light-y: 0%; }
  25% { --light-y: 34%; }
  50% { --light-y: 68%; }
  75% { --light-y: 22%; }
}

.guide { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.time { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.time strong { font-size: 20px; font-weight: 500; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.time span { font-size: 14px; color: var(--text-3); }

.controls { display: flex; align-items: center; gap: 40px; }
.ctl, .play-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
}
.ctl { --icon: 24px; width: 56px; height: 56px; background: none; color: var(--text-2); }
.ctl.off { opacity: .45; }
.play-btn { --icon: 30px; width: 84px; height: 84px; background: var(--accent); color: var(--on-accent); }
.play-btn .icon.filled { stroke: none; }

/* --- 05 Check-in ------------------------------------------------------ */
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  --icon: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 68px;
  padding: 0 20px 0 14px;
  border-radius: 20px;
  font-size: 17px;
  font-weight: 500;
}
.option .icon-wrap {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
}
.option:has(input:checked) .icon-wrap { background: var(--c); color: var(--on-state); }

.optional { display: flex; flex-direction: column; gap: 12px; }
.optional-label { margin: 0; font-size: 14px; color: var(--text-2); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 12px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 500;
}
.pill:has(input:checked) { background: var(--surface); }
.checkin-form:not(:has(input[name="helped"]:checked)) .btn-primary { opacity: .35; pointer-events: none; }

/* --- 05b Zapsáno ------------------------------------------------------ */
.done-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
}
.done-orb { --icon: 40px; position: relative; width: 200px; height: 200px; }
.done-orb .orb-glow {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: var(--to);
  opacity: .5;
  filter: blur(40px);
}
.done-orb .orb-core {
  position: absolute;
  inset: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--on-state);
  background: linear-gradient(135deg, var(--from), var(--to) 55%);
}
.done-body .sentence { max-width: 300px; color: var(--text-2); }
.summary {
  --icon: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}
.summary .icon { color: var(--to); }

/* --- 06 Vlastní nahrávka ---------------------------------------------- */
.custom-form .group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.custom-form legend {
  display: flex; justify-content: space-between; width: 100%;
  padding: 0; margin-bottom: 12px; font-size: 15px; font-weight: 600;
}
.custom-form legend .aside { font-size: 13px; font-weight: 400; color: var(--text-3); }

.goal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.goal-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.goal-chip:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.switch {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer;
}
.switch[hidden] { display: none; }
.switch .texts, .voice-card .texts { gap: 2px; }
.switch .card-name { font-size: 16px; }
.switch .card-desc { font-size: 13px; }
.switch-track {
  flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: var(--surface-2); transition: background .2s ease;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.switch:has(input:checked) .switch-track { background: var(--accent); }
.switch:has(input:checked) .switch-track::after { transform: translateX(18px); }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card {
  position: relative; display: flex; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.choice-card:has(input:checked) { border: 1.5px solid var(--text); }
.voice-card { align-items: center; gap: 10px; padding: 14px 12px 14px 16px; }
.voice-card .card-name { font-size: 17px; }
.voice-card .card-desc { font-size: 13px; }
.preview {
  --icon: 14px;
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text);
}
.preview.on, .choice-card:has(input:checked) .preview { background: var(--accent); color: var(--on-accent); }

.sound-row {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px;
  scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.sound-row::-webkit-scrollbar { display: none; }
.sound-card {
  flex: none; width: 124px; flex-direction: column; gap: 28px;
  padding: 14px 12px 16px 16px; scroll-snap-align: start;
}
.sound-card .top { --icon: 22px; display: flex; justify-content: space-between; align-items: flex-start; }
.sound-card .top > .icon { color: var(--text-2); }
.sound-card .preview { width: 32px; height: 32px; }
.sound-card .card-name { font-size: 15px; }

.note-field { position: relative; }
.note-field .counter { position: absolute; right: 14px; bottom: 10px; font-size: 12px; color: var(--text-3); }

/* Na mobilu je tlačítko přilepené dole, formulář pod ním roluje. */
.custom-footer {
  position: sticky; bottom: 0; z-index: 1;
  margin: 0 calc(-1 * var(--gutter)) calc(-24px - env(safe-area-inset-bottom));
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.custom-footer .hint { text-align: center; font-size: 13px; }

/* --- 07 Připravujeme / 07b / 07c -------------------------------------- */
.preparing { align-items: center; text-align: center; }
.preparing .header { width: 100%; }
.preparing .header .chip { flex: none; margin: 0 auto; }
.icon-spacer { width: 48px; flex: none; }
.prep-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.prep-orb { position: relative; width: 260px; height: 260px; }
.prep-orb > span { position: absolute; border-radius: 50%; }
.prep-orb .ring { inset: 0; border: 1.5px solid var(--border); animation: ripple 6s ease-out infinite; }
.prep-orb .ring.r2 { animation-delay: -3s; }
.prep-orb .orb-glow { inset: 40px; background: linear-gradient(135deg, var(--from), var(--to)); opacity: .45; filter: blur(30px); }
.prep-orb .orb-core {
  --icon: 44px;
  inset: 55px; display: grid; place-items: center; color: var(--on-state);
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--from) 80%, #fff), var(--from) 45%, var(--to));
}
.working .prep-orb .orb-core { animation: breathe 6s ease-in-out infinite; }
.failed .prep-orb .orb-core { background: radial-gradient(circle at 35% 35%, var(--surface), var(--text-3)); }
.failed .prep-orb .orb-glow { opacity: .15; }
.ready .prep-orb .ring, .failed .prep-orb .ring { animation: none; opacity: .5; }
.ready .prep-orb .ring.r2 { inset: 20px; }
@keyframes ripple {
  0% { transform: scale(.72); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: scale(1); opacity: 0; }
}
.preparing .text-block { gap: 8px; }
.preparing .title { font-size: 34px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--text); }
.steps .mark {
  --icon: 14px;
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--border); color: var(--on-accent);
}
.steps .mark .icon { stroke-width: 3; }
.steps .done .mark { background: var(--accent); border-color: var(--accent); }
.steps .current { font-weight: 600; }
.steps .current .mark { border: 2px solid var(--text); border-right-color: transparent; animation: spin 1s linear infinite; }
.steps .pending { color: var(--text-3); }
.steps .failed .mark { background: var(--danger); border-color: var(--danger); color: var(--on-state); }
.steps .failed { font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
.preparing .footer { width: 100%; }
.preparing .footer .hint { text-align: center; margin-bottom: 8px; }

/* --- 08 Moje nahrávky ------------------------------------------------- */
.mine .title { font-size: 42px; }
.mine .title + .segmented { margin-top: -8px; }
/* Hotová nahrávka: celá karta pouští poslech, srdíčko leží nad tím. */
.recording-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 16px 12px 16px 16px;
}
.recording-card .orb { width: 36px; height: 36px; }
.recording-card > .orb { margin-right: 8px; }
.recording-card .card-name { font-size: 17px; line-height: 1.25; }
.recording-card .card-desc { font-size: 13px; }
.recording-card .play {
  --icon: 18px;
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2); color: inherit;
}
.recording-card .play::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.recording-card .card-heart { position: relative; z-index: 1; }
/* Nahrávka ve výrobě nebo nepovedená: řádek, pod ním postup. */
.recording-card:is(.working, .failed) { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 18px 18px; }
.recording-card .row { display: flex; align-items: center; gap: 14px; }
.recording-card.working .orb { opacity: .5; }
.recording-card .tag { flex: none; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); }
.recording-card.failed .tag { color: var(--danger-text); }
.recording-card .progress { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.recording-card .bar { display: block; height: 100%; background: var(--accent); }
.recording-card .caption { font-size: 13px; color: var(--text-3); }

/* --- 09–10 Přihlášení, kód, účet -------------------------------------- */
.auth .muted { font-size: 17px; line-height: 1.45; }
.auth .title-block { gap: 10px; padding-top: 24px; }
.auth .footer { gap: 10px; }
.auth .footer .hint { font-size: 13px; text-align: center; }

/* 09b: jedno skryté pole přes šest políček */
.code { display: flex; flex-direction: column; gap: 12px; }
.code-box { position: relative; }
.code-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-cells span {
  display: grid; place-items: center; height: 64px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 28px; font-weight: 500;
}
.code-cells span.active { border: 1.5px solid var(--text); }
.code-cells span.active:empty::after {
  content: ""; width: 2px; height: 28px; border-radius: 1px; background: var(--klid);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.code.invalid .code-cells span { border-color: var(--danger); }
.code-input {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0;
  border: 0; background: transparent; color: transparent; caret-color: transparent;
  font-size: 16px; letter-spacing: 40px; outline: none;
}
.code-input:disabled { cursor: default; }
.code-links { display: flex; justify-content: space-between; align-items: center; margin: -8px -16px 0; }
.code-links a.link-btn { color: var(--text-2); }
.code-links .link-btn:disabled { color: var(--text-3); font-weight: 400; }
.code-links + .hint { margin-top: -20px; }

/* --- Podmínky a ochrana soukromí (text z docs/legal/*.md) ------------- */
.legal { gap: 20px; }
.prose { font-size: 16px; line-height: 1.6; color: var(--text); }
.prose h2 { margin: 32px 0 8px; font-size: 19px; font-weight: 600; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose a, .legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Tabulka se na mobilu posouvá do strany, ne rozjíždí stránku. */
.prose table { display: block; overflow-x: auto; margin: 0 0 16px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; min-width: 120px; }
.prose th { font-weight: 600; color: var(--text-2); }
.prose code { font-size: .92em; }
.legal-links { text-align: center; font-size: 13px; }

/* ==========================================================================
   Tmavý režim — v noci nesmí nic oslňovat
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .play-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
  .stage .orb-base, .stage .orb-to { filter: brightness(.82); }
  .stage .orb-glow { opacity: .35; }
  .ring .progress { stroke: var(--text-2); }
  .onboarding .glow { opacity: .22; }
}

/* ==========================================================================
   Desktop A: dělená obrazovka
   Vlevo panel stavu (barva výchozího stavu, nebo přechod do cílového),
   vpravo obsah. Přehrávač, potvrzení, příprava a Moje nahrávky jsou
   vystředěné přes celou šířku.
   ========================================================================== */

.panel {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  border-radius: 28px;
  clip-path: inset(0 round 28px);  /* viz .visual — Safari a filter: blur */
  color: var(--on-state);
  background: var(--c);
}
.panel > * { position: relative; }
.panel .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
.panel .wordmark { font-size: 32px; }
.panel .eyebrow { margin: 0 0 8px; font-size: 15px; font-weight: 500; opacity: .8; }
.panel .label { margin: 0; font-family: var(--font-display); font-size: 88px; line-height: 1; }
.panel .hint-text { margin: 8px 0 0; max-width: 380px; font-size: 18px; line-height: 1.45; opacity: .8; }

/* Úvod: neutrální plocha se dvěma skvrnami — odkud a kam. */
.panel--intro { color: var(--text); background: var(--surface-2); }
.panel--intro .blob { width: 520px; height: 520px; opacity: .35; filter: blur(120px); }
.panel--intro .blob.from { left: -160px; bottom: -120px; background: var(--stres); }
.panel--intro .blob.to { right: -160px; top: -140px; background: var(--klid); }
.panel--intro .tagline { font-size: 80px; line-height: .98; }
.panel--intro .intro { max-width: 400px; margin-top: 20px; font-size: 18px; }

/* Výchozí stav: plná barva stavu. */
.panel--state .blob.light { right: -60px; top: -120px; width: 460px; height: 460px; background: #FFFFFF; opacity: .25; }
.panel--state .blob.deep {
  left: -200px; bottom: -160px; width: 520px; height: 520px; opacity: .25;
  background: color-mix(in srgb, var(--c) 55%, #000000);
}

/* Přechod: shora výchozí, dole cílová barva. */
.panel--transition { background: linear-gradient(180deg, var(--from), var(--to)); }
.panel--transition .blob { width: 500px; height: 500px; filter: blur(90px); }
.panel--transition .blob.from { left: -160px; top: -120px; background: var(--from); }
.panel--transition .blob.to { right: -160px; bottom: -120px; background: var(--to); }
.panel--transition .blob.light { left: 140px; top: 300px; width: 300px; height: 300px; background: #FFFFFF; opacity: .28; }
.panel--missing { background: linear-gradient(180deg, var(--from), var(--surface-2) 80%); }
.panel--missing .blob.to, .panel--missing .blob.light { display: none; }
.panel--missing .later { color: var(--text-2); }
.panel--missing .later .eyebrow { opacity: 1; }

@media (min-width: 1024px) {
  .app { max-width: none; }
  .m-only { display: none !important; }

  .screen.split {
    display: grid;
    grid-template-columns: minmax(420px, 600px) 1fr;
    gap: 0;
    padding: 16px;
  }
  .split .glow { display: none; }
  .split .panel { display: flex; min-height: calc(100dvh - 32px); }
  .split .content {
    display: flex;
    flex-direction: column;
    gap: 44px;
    min-width: 0;
    padding: 16px 64px 32px;
  }
  .split .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    max-width: 680px;
    padding-bottom: 48px;
  }
  .split .header { justify-content: flex-start; }

  .title { font-size: 60px; }
  .split .muted { font-size: 18px; }
  .split .sentence { font-size: 22px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .state-card { gap: 28px; padding: 24px 22px; }

  .split .recommend-body { flex: none; }
  .split .footer { flex-direction: row; justify-content: flex-start; margin-top: 0; gap: 16px; }
  .split .btn, .done .btn, .preparing .btn, .mine .footer .btn { width: 320px; }
  .split .optional { max-width: 620px; }
  .split .form { max-width: 480px; }
  .split .options { max-width: 620px; }

  /* Vystředěné obrazovky přes celou šířku */
  .player, .done, .preparing { max-width: 1100px; margin: 0 auto; padding: 32px 64px 48px; }
  .player .stage { width: min(380px, 42vh); }
  .done .footer { margin-top: 0; }
  .done .done-body { flex: none; margin-top: auto; }
  .done { justify-content: center; gap: 40px; }
  .done .footer + * { margin-bottom: auto; }

  .custom-screen .main { justify-content: flex-start; gap: 28px; padding-top: 8px; }
  .custom-screen .title { font-size: 48px; }
  .custom-footer { position: static; margin: 0; padding: 0; background: none; flex-direction: row; align-items: center; gap: 20px; }
  .custom-footer .hint { text-align: left; }
  .sound-row { margin: 0; padding: 2px 0 6px; }
  .choice-row { max-width: 420px; }
  .create-own { align-self: flex-start; width: 320px; margin-top: 0; }
  .preparing .footer { flex-direction: column; align-items: center; }
  .mine .main { justify-content: flex-start; padding-top: 8px; }
  .mine .stack { max-width: 640px; }
  .mine .footer { align-items: center; }
  .mine .segmented { max-width: 360px; }
  .mine .header-actions { margin-left: auto; }
  .split .header .pill-btn { width: auto; }  /* ne šířka hlavních tlačítek */
  .legal { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; }

  .auth .muted { font-size: 17px; }
  .auth .title-block { padding-top: 0; }
  .auth .footer { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
  .auth .footer .hint { text-align: left; max-width: 200px; }
  /* Odkazy na podmínky na vlastním řádku pod tlačítkem, na šířku formuláře. */
  .auth .footer .legal-links { flex-basis: 100%; max-width: 480px; text-align: left; }
  .auth .code, .auth .code-links, .auth .form { max-width: 480px; }
  .auth .main > .hint { margin-top: -20px; }
}

/* ==========================================================================
   Omezený pohyb
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .screen, .stage .breath, .stage .orb-light, .prep-orb .ring, .working .prep-orb .orb-core,
  .steps .current .mark { animation: none; }
}
