/* Plugin rozhodnuti: vlakno, karty otazek, pruh postupu, akcni lista. Tokeny ze skorapky (jadro/app.css). */

/* pruh postupu: segment za kazdou otazku (signature) */
.postup { margin: 22px 0 8px; }
.postup-pruh { display: flex; gap: 3px; height: 8px; }
.postup-pruh a {
  flex: 1; min-width: 3px; border-radius: 3px; background: var(--bg-2);
  transition: transform .2s var(--ease);
  position: relative; overflow: hidden;
}
.postup-pruh a::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--c, transparent); transform-origin: left center;
  transition: background .3s var(--ease);
}
.postup-pruh a:hover { transform: scaleY(1.6); }
.postup-pruh a.je-odpovezeno { --c: var(--ink); }
.postup-pruh a.je-neodeslano { --c: var(--signal); }
.postup-pruh a.je-dotaz { --c: var(--agent); }
.postup-pruh a.je-nova-zprava { --c: var(--agent); }
.postup-pruh a.je-nova-zprava::after { animation: blik 1.6s var(--ease) infinite; }
/* segment, ktery prave zmenil stav, se naplni zleva (pridava rozhodnuti.js) */
.postup-pruh a.je-zmena::after { animation: plneni .5s var(--ease) both; }
@keyframes plneni { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  .postup-pruh a.je-zmena::after { animation: none; }
}
@keyframes blik { 50% { opacity: .45; } }
.postup-text { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.postup-text b { color: var(--ink); font-variant-numeric: tabular-nums; }
.postup-legenda { display: inline-flex; align-items: center; gap: 6px; }
.postup-legenda i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.stav-vlakna {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 13px 16px; border-radius: 14px;
  font-size: 14.5px; font-weight: 560;
}
.stav-vlakna--ty { background: var(--signal-mekky); color: var(--signal-text); }
.stav-vlakna--agent { background: var(--agent-mekky); color: var(--agent); }
.stav-vlakna--uzavrene { background: var(--bg-2); color: var(--ink-2); }
.stav-vlakna > span:not(.zive) { flex: 1; }
.stav-vlakna > .zive { margin: 0 4px; }
.stav-vlakna small { font-weight: 500; opacity: .85; }

.zaver {
  margin-top: 18px; padding: 18px 20px; border-radius: var(--r-l); background: var(--plocha); border: 1px solid var(--cara);
  border-left: 3px solid var(--ok);
}
.zaver h3 { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); margin-bottom: 6px; }
.zaver p { font-family: var(--serif); font-size: 18px; line-height: 1.45; white-space: pre-line; }

.skupina { margin-top: 30px; }

.skupina-nadpis {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -16px 10px; padding: calc(10px + var(--bezpeci-nahore)) 18px 10px;
  background: var(--bg);
  font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -.01em;
}
@media (min-width: 860px) { .skupina-nadpis { margin: 0 -8px 10px; padding: 12px 8px; } }
.otazky { display: flex; flex-direction: column; gap: 10px; }

/* karta otazky */
.otazka {
  background: var(--plocha); border: 1px solid var(--cara); border-radius: var(--r-l);
  box-shadow: var(--stin-1);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
  scroll-margin-top: calc(70px + var(--bezpeci-nahore));
}
.otazka[open] { box-shadow: var(--stin-2); border-color: var(--cara-2); }
.otazka.je-cil { animation: cil 1.2s var(--ease); }
@keyframes cil { 0%, 40% { box-shadow: 0 0 0 4px var(--signal-mekky), var(--stin-2); } }
.otazka > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 16px 16px 14px; border-radius: var(--r-l);
}
.otazka > summary::-webkit-details-marker { display: none; }
.otazka > summary:hover { background: var(--plocha-2); }
.otazka[open] > summary:hover { background: transparent; }
.otazka-cislo {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.otazka.je-odpovezeno .otazka-cislo { background: var(--ink); color: var(--bg); }
.otazka.je-neodeslano .otazka-cislo { background: var(--signal); color: var(--signal-ink); }
.otazka.je-dotaz .otazka-cislo, .otazka.je-nova-zprava .otazka-cislo { background: var(--agent); color: #fff; }
.otazka-hlava { flex: 1; min-width: 0; }
.otazka-stitky { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.otazka-stitky:empty { display: none; }
.otazka-text { font-size: 16.5px; line-height: 1.45; font-weight: 560; letter-spacing: -.005em; white-space: pre-line; text-wrap: pretty; }
.otazka:not([open]) .otazka-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 520; color: var(--ink-2); }
.otazka-shrnuti { display: none; align-items: center; gap: 7px; margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.otazka-shrnuti .ik { width: 16px; height: 16px; color: var(--ok); }
.otazka:not([open]) .otazka-shrnuti { display: flex; }
.otazka-shrnuti span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otazka-sipka { color: var(--ink-3); margin-top: 4px; transition: transform .25s var(--ease); }
.otazka[open] .otazka-sipka { transform: rotate(180deg); }
.otazka-telo { padding: 0 16px 16px 56px; }
@media (max-width: 520px) { .otazka-telo { padding: 0 14px 16px 14px; } }

.detail { margin: 2px 0 14px; }
.detail > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 4px 0;
}
.detail > summary::-webkit-details-marker { display: none; }
.detail > summary .ik { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.detail[open] > summary .ik { transform: rotate(180deg); }
.detail-text { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); color: var(--ink-2); font-size: 14.5px; white-space: pre-line; }

/* moznosti */
.moznosti { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.moznost {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 12px 14px; text-align: left;
  border: 1.5px solid var(--cara-2); border-radius: 14px; background: var(--plocha);
  font-size: 15.5px; font-weight: 520; line-height: 1.35;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .12s var(--ease);
}
.moznost:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: var(--plocha-2); }
.moznost:active { transform: scale(.985); }
.moznost-znak {
  display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--cara-2); color: transparent; transition: all .2s var(--ease);
}
.moznost-znak .ik { width: 14px; height: 14px; }
.moznost-text { flex: 1; }
.moznost.je-vybrana { border-color: var(--ink); background: var(--plocha); box-shadow: 0 0 0 1px var(--ink); }
.moznost.je-vybrana .moznost-znak { background: var(--ink); border-color: var(--ink); color: var(--bg); transform: scale(1.05); }
.moznost-doporuceno {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 12px; font-weight: 650; color: var(--signal-text);
}
.moznost-doporuceno .ik { width: 13px; height: 13px; }
.moznost--vlastni { border-style: dashed; color: var(--ink-2); }
.moznost--vlastni.je-vybrana { border-style: solid; color: var(--ink); }
.htmx-request.moznost, .moznost.htmx-request { opacity: .7; }

.poznamka-prepinac { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 6px 0; background: none; border: 0; }
.poznamka-prepinac:hover { color: var(--ink); }
.poznamka-prepinac .ik { width: 16px; height: 16px; }
.ulozeno { font-size: 12.5px; color: var(--ink-3); min-height: 18px; display: inline-flex; align-items: center; gap: 4px; }
.ulozeno .ik { width: 13px; height: 13px; }

/* konverzace u otazky */
.konverzace { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.zprava { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; white-space: pre-line; }
.zprava small { display: block; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; margin-bottom: 2px; opacity: .75; }
.zprava--dotaz { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.zprava--odpoved { align-self: flex-start; background: var(--agent-mekky); color: var(--ink); border-bottom-left-radius: 6px; }
.zprava--odpoved small { color: var(--agent); opacity: 1; }
.zprava--koncept { align-self: flex-end; background: transparent; border: 1.5px dashed var(--cara-2); color: var(--ink-2); }

.otazka-akce { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; }

/* akcni lista dole */
.lista-misto { height: 96px; }
.lista {
  position: fixed; z-index: 30; left: 0; right: 0;
  bottom: calc(var(--tabbar-v) + var(--bezpeci-dole));
  padding: 10px 12px;
  pointer-events: none;
}
@media (min-width: 860px) { .lista { left: var(--bok); bottom: 0; padding: 16px 40px 20px; } }
.lista-vnitrek {
  pointer-events: auto;
  max-width: calc(var(--obsah-max) - 32px); margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 18px; border-radius: 20px;
  background: color-mix(in srgb, var(--plocha) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(20px); -webkit-backdrop-filter: saturate(1.5) blur(20px);
  border: 1px solid var(--cara-2); box-shadow: var(--stin-3);
  animation: lista-in .4s var(--ease) both;
}
@keyframes lista-in { from { transform: translateY(20px); opacity: 0; } }
.lista-info { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.lista-info b { color: var(--ink); font-size: 15px; display: block; }
@media (max-width: 520px) {
  .lista-vnitrek { padding: 8px; gap: 8px; }
  .lista-info { display: none; }
  .lista-vnitrek > form { flex: 1; display: flex; }
  .lista-vnitrek > form:last-child { flex: 1.4; }
  .lista-vnitrek .tlacitko { flex: 1; justify-content: center; }
}
.lista .tlacitko--hlavni.je-pripraveno { animation: pripraveno .6s var(--ease); }
@keyframes pripraveno { 40% { transform: scale(1.04); } }

.otazka-cislo .ik { width: 16px; height: 16px; }
.moznost-klavesa { font-size: 11px; font-weight: 700; color: var(--ink-3); opacity: 0; transition: opacity .15s; }
@media (hover: hover) and (pointer: fine) {
  .moznost-klavesa { opacity: 1; }
}
.otazka-telo .text { margin-bottom: 10px; }

/* ---------- vyber z medii: mrizka dlazdic (obrazek / prehravac + tlacitko vyberu) ---------- */
.rz-vyber-info { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-3); }
.rz-mrizka {
  list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.rz-dlazdice--zvuk, .rz-dlazdice--video { grid-column: span 2; }
@media (max-width: 420px) { .rz-dlazdice--zvuk, .rz-dlazdice--video { grid-column: 1 / -1; } }
.rz-dlazdice {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1.5px solid var(--cara-2); border-radius: 14px; background: var(--plocha);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.rz-dlazdice.je-vybrana { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.rz-nahled {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 0; border: 0; cursor: pointer;
  background: repeating-conic-gradient(var(--bg-2) 0 25%, var(--plocha-2) 0 50%) 0 0 / 14px 14px;
}
span.rz-nahled { cursor: default; }
.rz-nahled img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rz-nahled--soubor { color: var(--ink-3); gap: 4px; align-content: center; }
.rz-nahled--soubor .ik { width: 28px; height: 28px; }
.rz-prehravac { display: block; width: 100%; background: var(--plocha-2); }
audio.rz-prehravac { height: 44px; margin: 10px 0 0; background: none; }
video.rz-prehravac { max-height: 48vh; background: #000; }
.rz-zvetsit { position: absolute; top: 6px; right: 6px; background: color-mix(in srgb, var(--plocha) 85%, transparent); }
.rz-vybrat {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 10px;
  text-align: left; border: 0; background: none; color: inherit; font: inherit;
}
button.rz-vybrat { cursor: pointer; }
button.rz-vybrat:active, button.rz-nahled:active { opacity: .8; }
.rz-cislo {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--cara-2); font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.rz-cislo .ik { width: 14px; height: 14px; }
.je-vybrana .rz-cislo { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.rz-popis { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rz-nazev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.rz-popis small { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.rz-dlazdice .htmx-request { opacity: .7; }
