/* BezKlikání.cz – renderer formulářů
   Tokeny: design systém BezKlikání.cz 2.0, téma Noc. */

/* ---------- Fonty (lokálně, žádné CDN) ---------- */
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokeny ---------- */
:root {
  color-scheme: dark;

  --paper: #0b0d14;
  --surface: #13161f;
  --sunken: #07090e;
  --ink: #eef0f6;
  --ink-hover: #ffffff;
  --on-ink: #0b0d14;
  --muted: #a1a7b8;
  --line: #ffffff14;
  --line-strong: #6b7186;
  --accent: #9aa2ff;
  --accent-soft: #1b2040;
  --pink: #ff6bb5;
  --positive: #3fd0bf;
  --negative: #ff8a7a;
  --negative-soft: #3a1614;

  /* Sklo a záře: jediné odchylky od plochého systému, vyžádané pro formuláře. */
  --glass: rgba(19, 22, 31, 0.62);
  --glass-selected: rgba(27, 32, 64, 0.78);
  --glow-accent: 0 0 0 1px var(--accent), 0 0 28px rgba(154, 162, 255, 0.28);
  --glow-button: 0 0 32px rgba(154, 162, 255, 0.34);
  --grid-line: rgba(255, 255, 255, 0.045);

  --font-display: "Figtree", system-ui, sans-serif;
  --font-sans: "DM Sans", system-ui, sans-serif;
  /* Jen pro „gramatiku“ příkazové řádky: prompt, kurzory, klávesy, stavové řádky. */
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration-view: 400ms;
  --content-max: 720px;
}

/* ---------- Základ ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
p {
  margin: 0;
}

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

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

/* Atribut hidden musí vyhrát i nad display z tříd (např. textové pole během nahrávání). */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Pozadí: mřížka, signály po ní, pomalá polární záře a světlo pod myší ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--paper);
}

.backdrop__aurora {
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 35% at 30% 20%, rgba(154, 162, 255, 0.14), transparent 70%),
    radial-gradient(35% 30% at 75% 15%, rgba(255, 107, 181, 0.07), transparent 70%);
  animation: aurora-drift 38s var(--ease) infinite alternate;
}

@keyframes aurora-drift {
  to {
    transform: translate3d(6%, 4%, 0) rotate(8deg);
  }
}

.backdrop__signals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 100%);
}

.backdrop__glow {
  position: absolute;
  left: -420px;
  top: -420px;
  width: 840px;
  height: 840px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(154, 162, 255, 0.07), transparent);
  opacity: 0;
  transition: opacity 600ms var(--ease);
}

.backdrop--pointer .backdrop__glow {
  opacity: 1;
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 0%, transparent 100%);
}

/* ---------- Progress ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 3px;
  background: var(--line);
}

.progress__fill {
  position: relative;
  width: 0;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(154, 162, 255, 0.55);
  transition: width 600ms var(--ease);
}

/* Podpis značky: růžový uzel na čele postupu. */
.progress__fill::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: var(--radius-pill);
  background: var(--pink);
  box-shadow: 0 0 10px rgba(255, 107, 181, 0.6);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.progress.is-active .progress__fill::after {
  opacity: 1;
}

/* ---------- Horní lišta ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: min(1120px, 100% - 2rem);
  margin: 0 auto;
  padding-top: calc(var(--space-5) + env(safe-area-inset-top, 0px));
  min-height: var(--space-16);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
}

/* Světlá dlaždice jako na hlavním webu: tmavě modrá část loga by na tmavém pozadí zanikla.
   Barva --ink odpovídá hlavnímu tlačítku. */
.brand__icon {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.counter {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
  text-align: right;
}

/* ---------- Scéna a přechody ---------- */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  align-content: start;
  width: min(var(--content-max), 100% - 2rem);
  margin: 0 auto;
  padding: var(--space-8) 0 calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  /* Vodorovný tah obsluhuje swipe, svislý posun a přiblížení zůstávají prohlížeči. */
  touch-action: pan-y pinch-zoom;
}

.stage textarea {
  touch-action: pan-y pinch-zoom;
}

.stage--zoomed,
.stage--zoomed textarea {
  touch-action: auto;
}

/* V klidu bez filtru: rozostření předka by vypnulo backdrop-filter skla uvnitř. */
.view {
  grid-area: 1 / 1;
  min-width: 0;
  transition:
    opacity var(--duration-view) var(--ease),
    transform var(--duration-view) var(--ease),
    filter var(--duration-view) var(--ease);
}

.view--from-right,
.view--to-right {
  opacity: 0;
  transform: translateX(48px);
  filter: blur(6px);
}

.view--from-left,
.view--to-left {
  opacity: 0;
  transform: translateX(-48px);
  filter: blur(6px);
}

.view--to-left,
.view--to-right {
  pointer-events: none;
}

.view--dragging {
  transition: none;
}

/* ---------- Úvod ---------- */
.intro__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.intro__text {
  margin-top: var(--space-6);
  max-width: 640px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-line;
}

/* ---------- Otázka ---------- */
.view__back {
  margin-bottom: var(--space-4);
  margin-left: calc(var(--space-3) * -1);
}

.question + .question {
  margin-top: var(--space-8);
}

.question__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.625rem, 1.25rem + 2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.question__label:focus {
  outline: none;
}

/* ---------- Prompt: nadpis se vypisuje za ›, na konci blikající blokový kurzor ---------- */
.type {
  position: relative;
}

.type__rest {
  visibility: hidden;
}

/* Mimo tok: kurzor nemění zalomení řádků. */
.caret {
  position: absolute;
  width: 0.46em;
  height: 0.9em;
  margin: 0.13em 0 0 0.07em;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(154, 162, 255, 0.45);
  animation: caret-blink 1.06s steps(1) infinite;
  transition: opacity var(--duration-fast) var(--ease);
}

/* Během výpisu kurzor nebliká, jako v terminálu. */
.type:not(.type--done) .caret {
  animation: none;
}

/* Kurzor předá slovo poli, do kterého se odpovídá. */
.screen:has(.question__field :focus) .caret {
  animation: none;
  opacity: 0.25;
  box-shadow: none;
}

.view[aria-hidden="true"] .caret {
  display: none;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.question__label:not(.question__label--secondary) .type__out::before {
  content: "›";
  margin-right: 0.35em;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent);
}

/* Na širší obrazovce visí prompt › i kurzor ❯ ve stejném levém sloupci mimo text. */
@media (min-width: 820px) {
  .question__label:not(.question__label--secondary) .type__out::before {
    display: inline-block;
    width: 28px;
    margin: 0 0 0 -28px;
  }
}

.question__label--secondary {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.question__optional {
  display: inline-block;
  margin-bottom: var(--space-3);
  padding: 2px var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.question__help {
  margin-top: var(--space-3);
  max-width: 640px;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
}

.question__field {
  margin-top: var(--space-8);
}

.question__hint {
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

.question__error {
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--negative);
}

.question__error:empty {
  display: none;
}

.question__error::before {
  content: "✗";
  content: "✗" / "";
  margin-right: 0.5em;
  font-family: var(--font-mono);
}

.question--shake {
  animation: shake 320ms ease-in-out;
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

/* ---------- Vstupy ---------- */
.input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--ink);
  transition:
    border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

textarea.input {
  min-height: 132px;
  max-height: 50vh;
  resize: none;
  overflow-y: auto;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.input:hover {
  border-color: var(--muted);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.input[aria-invalid="true"] {
  border-color: var(--negative);
}

.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 1px var(--negative), 0 0 24px rgba(255, 138, 122, 0.22);
}

.contact {
  display: grid;
  gap: var(--space-4);
}

.contact__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .contact {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Volby ---------- */
.options {
  position: relative;
  display: grid;
  gap: var(--space-3);
}

.options__cursor {
  position: absolute;
  left: -28px;
  top: 0;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(154, 162, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms var(--ease),
    opacity 120ms var(--ease);
}

.options__cursor--jump {
  transition: opacity 120ms var(--ease);
}

.options--cursor .options__cursor {
  opacity: 1;
}

@media (max-width: 819px) {
  .options__cursor {
    display: none;
  }
}

.option {
  position: relative;
  overflow: hidden;
  animation: option-in 360ms var(--ease) backwards;
  animation-delay: calc(120ms + var(--i, 0) * 35ms);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 1.0625rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease),
    opacity var(--duration-fast) var(--ease);
}

.option:hover {
  border-color: var(--accent);
}

.option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--glass-selected);
  box-shadow: var(--glow-accent);
}

.option[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.option[aria-disabled="true"]:hover {
  border-color: var(--line-strong);
}

/* Jen „from“: po doběhnutí nic nedrží, takže platí i opacity zakázané možnosti. */
@keyframes option-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}

.option--picked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(154, 162, 255, 0.22), transparent);
  transform: translateX(-100%);
  animation: option-sweep 420ms var(--ease) forwards;
  pointer-events: none;
}

@keyframes option-sweep {
  to {
    transform: translateX(100%);
  }
}

.option__key {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  transition:
    border-color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.option[aria-checked="true"] .option__key {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-ink);
}

.option__label {
  flex: 1;
  min-width: 0;
}

.option__check {
  flex: none;
  display: grid;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.option[aria-checked="true"] .option__check {
  opacity: 1;
}

/* ---------- Hlasová odpověď ---------- */
.voice {
  margin-top: var(--space-4);
}

/* Stav i ovládání v jednom řádku: na svisle centrované obrazovce by změna výšky posunula otázku. */
.voice__main,
.voice__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.voice__main {
  min-height: 48px;
}

.voice--prompt .voice__body {
  flex-basis: 100%;
}

/*
 * Nahrávání, ukládání a uložená nahrávka zaujmou místo textového pole. Výška = pole + mezera + řádek
 * s tlačítkem, takže se při přepnutí nic neposune.
 */
.voice--boxed {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(132px + var(--space-4) + 48px);
  margin-top: 0;
  padding: var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.voice--boxed .voice__main {
  flex-direction: column;
  align-items: stretch;
}

.voice--boxed .voice__body {
  flex-direction: column;
  align-items: stretch;
}

.voice--recording {
  border-color: var(--accent);
  background: var(--glass-selected);
  box-shadow: var(--glow-accent);
}

.voice__line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

/* Prázdný stavový řádek mimo tok (bez mezery v řádku), ale pořád vykreslený, aby čtečky hlásily změny. */
.voice__line--empty {
  position: absolute;
}

.voice__status {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.voice__status--error {
  color: var(--negative);
}

.voice__status--error::before {
  content: "✗";
  content: "✗" / "";
  margin-right: 0.5em;
  font-family: var(--font-mono);
}

.voice--saved .voice__status,
.voice--attached .voice__status {
  color: var(--ink);
}

.voice__check {
  font-family: var(--font-mono);
  color: var(--positive);
}

.voice__duration {
  margin-left: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.voice__spinner {
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.125rem;
  line-height: 1;
  color: var(--accent);
}

.voice__row,
.voice__actions,
.voice__choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.voice__row {
  column-gap: var(--space-4);
}

.voice__start[aria-disabled="true"],
.voice__prompt [aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.voice__hint {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Souhlas jako dotaz v příkazové řádce ---------- */
.voice__prompt {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--glass-selected);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.voice__question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.voice__prompt-mark {
  margin-right: 0.5em;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent);
}

.voice__detail {
  margin-top: var(--space-1);
  max-width: 64ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.voice__choices {
  margin-top: var(--space-3);
}

.voice__keys {
  display: none;
  margin-left: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: pre;
}

/* Tlačítko se „rozbalí“ do dotazu: velikost, rámeček i sklo plynule, obsah se objeví až potom. */
.voice__prompt--morph {
  overflow: hidden;
  transition:
    width 260ms var(--ease),
    height 260ms var(--ease),
    border-color 260ms var(--ease),
    background-color 260ms var(--ease),
    border-radius 260ms var(--ease);
}

.voice__prompt > * {
  transition: opacity 160ms var(--ease) 90ms;
}

.voice__prompt--small {
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--glass);
}

.voice__prompt--small > * {
  opacity: 0;
  transition-delay: 0ms;
}

/* ---------- Nahrávání a uložená nahrávka v místě pole ---------- */
.voice__meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.voice__meter .voice__actions {
  margin-left: auto;
}

.voice__rec {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--pink);
  box-shadow: 0 0 10px rgba(255, 107, 181, 0.7);
  animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
  50% {
    opacity: 0.35;
  }
}

.voice__time {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink);
  transition: color var(--duration-fast) var(--ease);
}

.voice__time--ending {
  color: var(--pink);
}

.voice__wave {
  display: block;
  width: 100%;
  height: 56px;
}

.voice__typed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
  min-width: 0;
}

.voice__typed-text {
  flex: 1 1 240px;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.voice__typed-text q {
  color: var(--ink);
  quotes: "„" "“";
}

@media (hover: hover) and (pointer: fine) {
  .voice__keys {
    display: inline;
  }
}

/* ---------- Souhlas ---------- */
.consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-3) 0;
  cursor: pointer;
}

.consent__input {
  position: absolute;
  /* Nad čtverečkem: skutečné pole je terčem kliknutí (jinak by ho překryla ikona s opacity). */
  z-index: 1;
  opacity: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.consent__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--glass);
  color: var(--on-ink);
  transition:
    border-color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.consent__box svg {
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease);
}

.consent__input:checked + .consent__box {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 20px rgba(154, 162, 255, 0.3);
}

.consent__input:checked + .consent__box svg {
  opacity: 1;
}

.consent__input:focus-visible + .consent__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.consent__input[aria-invalid="true"] + .consent__box {
  border-color: var(--negative);
}

.consent__text {
  font-size: 1rem;
  line-height: 1.6;
}

.question--consent .question__field {
  margin-top: 0;
}

/* ---------- Odkazy a odkaz na zásady ---------- */
.link {
  border-radius: 2px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
  transition:
    color var(--duration-fast) var(--ease),
    text-decoration-color var(--duration-fast) var(--ease);
}

.link:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.privacy {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Samostatný odkaz potřebuje terč aspoň 24 px na výšku. */
.privacy .link {
  display: inline-block;
  padding: var(--space-1) 0;
}

/* Pod textem souhlasu, ne pod čtverečkem. */
.question--consent .privacy {
  margin-top: calc(var(--space-2) * -1);
  padding-left: calc(24px + var(--space-3));
}

/* ---------- Tlačítka ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-8);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration-fast) var(--ease),
    border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.button svg {
  flex: none;
  transition: transform var(--duration-fast) var(--ease);
}

.button--primary {
  background: var(--ink);
  color: var(--on-ink);
}

.button--primary:hover {
  background: var(--ink-hover);
  box-shadow: var(--glow-button);
}

.button--primary:hover svg {
  transform: translateX(3px);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--glass);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: var(--ink);
}

.button--ghost {
  min-height: 44px;
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
}

.button--ghost:hover {
  color: var(--ink);
}

.button--ghost:hover svg {
  transform: translateX(-3px);
}

.actions__hint {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.actions__hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink);
}

.swipe-hint {
  margin-top: var(--space-6);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Klávesové nápovědy jen tam, kde je klávesnice pravděpodobná. */
@media (hover: hover) and (pointer: fine) {
  .actions__hint {
    display: inline-flex;
  }
}

@media (hover: none), (pointer: coarse) {
  .option__key {
    display: none;
  }
}

@media (max-width: 640px) {
  .actions__hint,
  .voice__keys,
  .option__key,
  .hint {
    display: none;
  }
}

/* ---------- Stavové obrazovky ---------- */
.panel {
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.panel__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.3rem + 2.2vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.panel__heading:focus {
  outline: none;
}

.panel__text {
  margin-top: var(--space-4);
  max-width: 560px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-line;
}

.panel--error {
  border-color: rgba(255, 138, 122, 0.4);
}

.panel__status {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--negative-soft);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--negative);
}

/* ---------- Statický text (zásady) ---------- */
.doc .doc__meta {
  margin-top: var(--space-3);
  font-size: 0.875rem;
}

.doc h2 {
  margin-top: var(--space-8);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.doc p,
.doc ul {
  margin: var(--space-3) 0 0;
  max-width: 68ch;
  line-height: 1.65;
  color: var(--muted);
}

.doc ul {
  padding-left: 1.5em;
  list-style-type: "›  ";
}

.doc li::marker {
  font-family: var(--font-mono);
  color: var(--accent);
}

.doc li + li {
  margin-top: var(--space-2);
}

.loader {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) 0;
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  line-height: 1.4;
}

.loader__spinner {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}

.loader__text:focus {
  outline: none;
}

/* ---------- Poděkování ---------- */
.thanks {
  position: relative;
}

.thanks__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-6);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 32px rgba(154, 162, 255, 0.3);
  animation: mark-in 500ms var(--ease) both;
}

.thanks__status {
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--positive);
  animation: fade-in 400ms var(--ease) 300ms both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.thanks__check {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: check-draw 420ms var(--ease) 180ms forwards;
}

.particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--particle-size, 5px);
  height: var(--particle-size, 5px);
  margin: calc(var(--particle-size, 5px) / -2);
  border-radius: var(--radius-pill);
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  animation: particle-fly var(--particle-duration, 1400ms) var(--ease) var(--particle-delay, 0ms) forwards;
}

.particle--ink {
  background: var(--ink);
}

.particle--pink {
  background: var(--pink);
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes check-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes particle-fly {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--particle-x, 0), var(--particle-y, -80px)) scale(1);
  }
}

/* ---------- Honeypot a noscript ---------- */
.honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.noscript {
  position: relative;
  z-index: 2;
  width: min(var(--content-max), 100% - 2rem);
  margin: var(--space-12) auto;
  font-size: 1.125rem;
}

/* ---------- Větší obrazovky ---------- */
@media (min-width: 720px) and (min-height: 640px) {
  .stage {
    align-content: center;
    padding-top: var(--space-10);
    padding-bottom: calc(var(--space-16) + var(--space-12));
  }

  .panel {
    padding: var(--space-12);
  }
}

/* ---------- Omezený pohyb ---------- */
@media (prefers-reduced-motion: reduce) {
  .view,
  .progress__fill {
    transition-duration: 1ms;
  }

  .view--from-right,
  .view--from-left,
  .view--to-right,
  .view--to-left {
    transform: none;
    filter: none;
  }

  .backdrop__aurora,
  .caret,
  .option,
  .question--shake,
  .thanks__status,
  .voice__rec {
    animation: none;
  }

  .backdrop__signals,
  .backdrop__glow,
  .option--picked::after {
    display: none;
  }

  .options__cursor,
  .voice__prompt > *,
  .voice__prompt--morph {
    transition: none;
  }

  .button svg,
  .button--primary:hover svg,
  .button--ghost:hover svg {
    transform: none;
    transition: none;
  }

  .thanks__mark {
    animation: none;
  }

  .thanks__check {
    animation: none;
    stroke-dashoffset: 0;
  }

  .particle {
    display: none;
  }
}
