/* ==========================================================================
   CC vlakno - redesign modalu (23.9.2026)
   Vsechno je scopovane na .modal-cc-thread / .modal-cc-runlog / .cc-live,
   aby se nedotklo zbytku appky. Nacita se AZ ZA style.css, selektory jsou
   zamerne o kousek specifictejsi, aby vyhraly bez !important.

   Paleta (na podkladu #0b1024):
   - teal   (--cct-teal)   = ty / primarni akce / beh CC
   - violet (--cct-violet) = CC bubliny
   - amber  (--cct-amber)  = fronta / ceka se / draft
   - red    (--cct-red)    = loop spi / chyba
   ========================================================================== */
.modal-cc-thread,
.modal-cc-runlog {
  --cct-teal: 25,211,197;
  --cct-violet: 167,139,250;
  --cct-amber: 244,168,67;
  --cct-red: 255,91,110;
  --cct-green: 74,222,128;
  --cct-ink: 233,238,242;
  --cct-panel: #0d1330;
  --cct-panel-2: #0b1024;
  --cct-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Panel ---------- */
.modal-cc-thread .modal-panel.glass,
.modal-cc-runlog .modal-panel.glass {
  background: linear-gradient(180deg, var(--cct-panel) 0%, var(--cct-panel-2) 100%);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.modal-cc-thread .modal-body {
  padding: 14px 14px 28px;
  background:
    radial-gradient(70% 40% at 50% 0%, rgba(var(--cct-violet),0.07), transparent 70%);
}
/* Vnitrni obsah drzi citelnou sirku i na sirokem monitoru */
.modal-cc-thread .modal-body > * {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Hlavicka ---------- */
.modal-cc-thread .modal-head {
  padding: 12px 14px 10px;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.modal-cc-thread .modal-head h3 {
  font-size: 16px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  padding-top: 2px;
}
.modal-cc-thread .cct-subrow {
  margin-top: 6px; gap: 10px;
  justify-content: flex-start;
}
.modal-cc-thread .cct-subrow #cct-sub { font-size: 12.5px; color: rgba(var(--cct-ink),0.55); }
.modal-cc-thread .cct-subrow #cct-sub:empty { display: none; }
.modal-cc-thread .modal-head-right { gap: 6px; padding-top: 0; }
.modal-cc-thread .modal-head-right .iconbtn,
.modal-cc-runlog .modal-head-right .iconbtn {
  width: 40px; height: 40px; border-radius: 12px; font-size: 16px;
  background: rgba(255,255,255,0.04);
}

/* Stitek stavu: barevna tecka + text, jedna barva na stav */
.modal-cc-thread .status-pill {
  --sp: var(--cct-teal);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(var(--sp),0.13);
  color: rgb(var(--sp));
  border: 1px solid rgba(var(--sp),0.35);
  white-space: nowrap;
}
.modal-cc-thread .status-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: rgb(var(--sp));
  box-shadow: 0 0 8px rgba(var(--sp),0.9);
}
.modal-cc-thread .status-pill.status-pending,
.modal-cc-thread .status-pill.status-user_replied { --sp: var(--cct-teal); }
.modal-cc-thread .status-pill.status-in_progress { --sp: var(--cct-violet); }
.modal-cc-thread .status-pill.status-in_progress::before { animation: cct-blink 1.2s ease-in-out infinite; }
.modal-cc-thread .status-pill.status-awaiting_user,
.modal-cc-thread .status-pill.status-draft_email { --sp: var(--cct-amber); }
.modal-cc-thread .status-pill.status-completed { --sp: var(--cct-green); }
.modal-cc-thread .status-pill.status-cancelled {
  --sp: 160,168,190;
  background: rgba(255,255,255,0.06); color: rgba(var(--cct-ink),0.6);
}
.modal-cc-thread .status-pill.status-cancelled::before { box-shadow: none; opacity: 0.6; }

/* ---------- Chat: bubliny ---------- */
.modal-cc-thread .chat { gap: 12px; padding: 2px 0; }
.modal-cc-thread .chat .msg {
  --mb: 255,255,255;
  position: relative;
  padding: 10px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(var(--mb),0.22);
  background: linear-gradient(160deg, rgba(var(--mb),0.15) 0%, rgba(var(--mb),0.05) 100%), #121a36;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  max-width: 86%;
  align-self: flex-start;
}
.modal-cc-thread .chat .msg-cc {
  --mb: var(--cct-violet);
  border-bottom-left-radius: 6px;
  max-width: 88%;
}
.modal-cc-thread .chat .msg-user {
  --mb: var(--cct-teal);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  max-width: 80%;
  background: linear-gradient(160deg, rgba(var(--mb),0.20) 0%, rgba(var(--mb),0.07) 100%), #0f1c33;
}
.modal-cc-thread .chat .msg-system {
  --mb: var(--cct-green);
  align-self: center;
  max-width: 92%;
  text-align: left;
  font-size: 13px;
  background: rgba(var(--mb),0.06);
  box-shadow: none;
  border-style: dashed;
}
.modal-cc-thread .chat .msg-sent-email { align-self: stretch; max-width: 100%; border-style: solid; }

/* meta radek: autor . cas . [zvuk vpravo] */
.modal-cc-thread .chat .msg-head {
  justify-content: flex-start; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 11.5px;
  color: rgba(var(--cct-ink),0.5);
}
.modal-cc-thread .chat .msg-head > span:first-child {
  font-weight: 800; letter-spacing: 0.02em;
  color: rgba(var(--mb),0.95);
}
.modal-cc-thread .chat .msg-user .msg-head > span:first-child { color: rgb(var(--cct-teal)); }
.modal-cc-thread .chat .msg-time { font-variant-numeric: tabular-nums; }
.modal-cc-thread .chat .msg-time::before { content: '·'; margin-right: 8px; opacity: 0.6; }
.modal-cc-thread .chat .tts-read-btn { margin-left: auto; width: 28px; height: 28px; }

.modal-cc-thread .chat .msg-body {
  font-size: 16px; line-height: 1.58;
  color: rgba(var(--cct-ink),0.93);
}
.modal-cc-thread .chat .msg-body p { margin: 0 0 6px; }
.modal-cc-thread .chat .msg-body a { color: rgb(var(--cct-teal)); }
.modal-cc-thread .chat .msg-body a:hover { color: #8ae7d6; }
.modal-cc-thread .chat .msg-more {
  display: inline-flex; align-items: center;
  margin-left: 4px; padding: 2px 10px; min-height: 26px;
  font-size: 12.5px; font-weight: 700;
  color: #fff;
  background: rgba(var(--cct-violet),0.28);
  border: 1px solid rgba(var(--cct-violet),0.55);
  border-radius: 999px;
  vertical-align: middle;
}
.modal-cc-thread .chat .msg-more:hover { background: rgba(var(--cct-violet),0.45); }
.modal-cc-thread .msg-old { opacity: 0.66; }
.modal-cc-thread .msg-pending { opacity: 0.6; }

/* ---------- Draft karta ---------- */
.modal-cc-thread .draft-card {
  background: linear-gradient(160deg, rgba(var(--cct-amber),0.10), rgba(var(--cct-amber),0.03)), #121a36;
  border: 1px solid rgba(var(--cct-amber),0.32);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.modal-cc-thread .draft-head { color: rgb(var(--cct-amber)); font-size: 14px; }
.modal-cc-thread .draft-card input,
.modal-cc-thread .draft-card textarea { font-size: 16px; }

/* ---------- Paticka: odpoved CC ---------- */
.modal-cc-thread .modal-foot {
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(8,12,30,0.85);
}
.modal-cc-thread .cc-reply { max-width: 880px; margin: 0 auto; }
.modal-cc-thread .cc-reply textarea {
  font-size: 16px; line-height: 1.45;
  padding: 11px 14px;
  min-height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.15s, background 0.15s;
}
.modal-cc-thread .cc-reply textarea:focus {
  outline: none;
  border-color: rgba(var(--cct-teal),0.65);
  background: rgba(var(--cct-teal),0.05);
}
.modal-cc-thread .cc-reply textarea::placeholder { color: rgba(var(--cct-ink),0.4); }
.modal-cc-thread .cc-reply-actions { gap: 10px; margin-top: 8px; }
.modal-cc-thread .cc-reply-actions .mic-btn-small {
  width: 44px; height: 44px; font-size: 19px;
  box-shadow: 0 4px 14px rgba(var(--cct-teal),0.3);
}
.modal-cc-thread .cc-reply-actions #cct-send {
  flex: 1 1 auto; min-height: 44px; border-radius: 14px;
  font-size: 15px;
}
.modal-cc-thread .cc-reply-actions #cct-cancel {
  flex: 0 0 44px; width: 44px; min-width: 44px; min-height: 44px;
  padding: 0; border-radius: 14px;
  font-size: 15px; color: rgba(var(--cct-ink),0.6);
}
.modal-cc-thread .cc-reply-actions #cct-cancel:hover {
  color: rgb(var(--cct-red)); border-color: rgba(var(--cct-red),0.45);
  background: rgba(var(--cct-red),0.1);
}
.modal-cc-thread .mic-status:empty { display: none; }

/* ==========================================================================
   ZIVA BUBLINA (#cct-live.cc-live) - co CC prave dela + bezici cas
   ========================================================================== */
.cc-live {
  --ph: 25,211,197;                  /* barva faze (rgb) */
  position: relative;
  display: block;
  padding: 0;
  margin-bottom: 14px;
  border-radius: 20px;
  border: 1px solid rgba(var(--ph),0.38);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(var(--ph),0.18), transparent 55%),
    linear-gradient(160deg, rgba(var(--ph),0.07), rgba(var(--ph),0.02)),
    #10183a;
  box-shadow:
    0 0 0 1px rgba(var(--ph),0.08) inset,
    0 10px 34px rgba(var(--ph),0.16),
    0 8px 22px rgba(0,0,0,0.3);
  color: rgba(var(--cct-ink),0.92);
  overflow: hidden;
}
.cc-live::after {                    /* jemne "skenovani" po hornim okraji */
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--ph),0.9), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: ccl-scan 2.6s linear infinite;
  opacity: 0.9;
}
/* Horni cast: kruh | text | log tlacitko (od 23.9. obal .ccl-top, pod nim .ccl-feed) */
.ccl-top {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 14px 14px 16px;
}
.cc-live[data-phase="running"] { --ph: 25,211,197; }
.cc-live[data-phase="queued"],
.cc-live[data-phase="busy"] { --ph: 244,168,67; }
.cc-live[data-phase="sleep"] { --ph: 255,91,110; }
.cc-live[data-phase="done"] { --ph: 74,222,128; }

/* Kruh: conic-gradient z --p (0-100). Jedna otacka = 2 min. */
.ccl-ring {
  --p: 0;
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.28);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.ccl-ring::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgb(var(--ph)) calc(var(--p) * 1%), rgba(255,255,255,0.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  filter: drop-shadow(0 0 6px rgba(var(--ph),0.55));
}
.ccl-ring::after {                   /* dychajici zare kolem kruhu */
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(var(--ph),0.35);
  animation: ccl-breathe 2.4s ease-in-out infinite;
  pointer-events: none;
}
.ccl-time {
  position: relative; z-index: 1;
  font-family: var(--cct-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 800; letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 10px rgba(var(--ph),0.6);
}

.ccl-main { min-width: 0; }
.ccl-title {
  font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.25;
}

/* Stepper = "level" progress: Odeslano > Ve fronte > CC pracuje > Odpoved */
.ccl-steps {
  display: flex;
  margin: 10px 0 8px;
}
.ccl-step {
  flex: 1 1 0; min-width: 0;
  position: relative;
  padding-top: 16px;
  text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  color: rgba(var(--cct-ink),0.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ccl-step i {
  position: absolute; top: 0; left: 50%;
  width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%;
  background: #1c264d;
  border: 2px solid rgba(255,255,255,0.18);
  box-sizing: border-box;
  z-index: 1;
}
/* Spojnice: kazdy krok kresli dve pulcary UVNITR sveho boxu (leva k predchozimu,
   prava k dalsimu). Drive ::before s left:-50% oriznul overflow:hidden kroku
   a mezi teckami zustavala mezera (Tomas 23.9.2026). */
.ccl-step::before, .ccl-step::after {
  content: '';
  position: absolute; top: 4px; width: 50%; height: 2px;
  background: rgba(255,255,255,0.1);
}
.ccl-step::before { left: 0; }
.ccl-step::after { right: 0; }
.ccl-step:first-child::before, .ccl-step:last-child::after { display: none; }
.ccl-step.is-done { color: rgba(var(--cct-ink),0.8); }
.ccl-step.is-done i {
  background: rgb(var(--ph)); border-color: rgb(var(--ph));
  box-shadow: 0 0 8px rgba(var(--ph),0.7);
}
.ccl-step.is-done::before, .ccl-step.is-done::after,
.ccl-step.is-active::before { background: rgb(var(--ph)); }
.ccl-step.is-active { color: #fff; }
.ccl-step.is-active i {
  background: #fff; border-color: rgb(var(--ph));
  box-shadow: 0 0 0 4px rgba(var(--ph),0.25), 0 0 12px rgba(var(--ph),0.8);
  animation: ccl-step-pulse 1.4s ease-in-out infinite;
}

/* Co se prave deje */
.ccl-now {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  font-size: 13px; line-height: 1.35;
  color: rgba(var(--cct-ink),0.85);
}
.ccl-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: rgb(var(--ph));
  box-shadow: 0 0 0 0 rgba(var(--ph),0.6);
  animation: ccl-dot 1.6s ease-out infinite;
}
.ccl-now code {
  font-family: var(--cct-mono); font-size: 11px;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(0,0,0,0.35); color: rgb(var(--ph));
  border: 1px solid rgba(var(--ph),0.25);
}
.ccl-ago { color: rgba(var(--cct-ink),0.45); font-size: 12px; }

/* Chipy (model, beh, volani) */
.ccl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ccl-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(var(--cct-ink),0.8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ccl-chip-warn {
  background: rgba(var(--cct-amber),0.14);
  border-color: rgba(var(--cct-amber),0.45);
  color: rgb(var(--cct-amber));
}

/* Tlacitko logu */
.ccl-log {
  align-self: start;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(var(--cct-ink),0.9);
  font: inherit; font-size: 17px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.ccl-log:hover { background: rgba(var(--ph),0.16); border-color: rgba(var(--ph),0.45); }

/* ---------- Prubeh (quest log): kroky modelu, nejnovejsi nahore ---------- */
.ccl-feed {
  border-top: 1px solid rgba(var(--ph),0.18);
  background: rgba(0,0,0,0.18);
}
.ccl-feed-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 40px;
  padding: 6px 14px 6px 16px;
  border: 0; background: transparent;
  color: rgba(var(--cct-ink),0.8);
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
  text-align: left; cursor: pointer;
}
.ccl-feed-toggle:hover { color: #fff; background: rgba(var(--ph),0.06); }
.ccl-feed-toggle span {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(var(--ph),0.14); color: rgb(var(--ph));
  border: 1px solid rgba(var(--ph),0.3);
  font-variant-numeric: tabular-nums;
}
.ccl-feed-list {
  list-style: none; margin: 0;
  padding: 2px 12px 12px 14px;
  max-height: 260px; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ccl-ev {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 5px 0 5px 34px;
  min-height: 32px;
  font-size: 13px; line-height: 1.35;
  color: rgba(var(--cct-ink),0.62);
}
.ccl-ev::before {                    /* svisla osa */
  content: '';
  position: absolute; left: 12px; top: 0; bottom: 0; width: 2px;
  background: rgba(255,255,255,0.08);
}
.ccl-ev:first-child::before { top: 16px; }
.ccl-ev:last-child::before { bottom: auto; height: 16px; }
.ccl-ev-ico {
  position: absolute; left: 0; top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  background: #141c3f;
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 1;
}
.ccl-ev-txt { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.ccl-ev-txt b { font-weight: 600; color: rgba(var(--cct-ink),0.85); }
.ccl-ev-txt em {
  font-style: normal;
  font-family: var(--cct-mono); font-size: 10.5px; font-weight: 700;
  padding: 0 6px; margin-left: 2px; border-radius: 999px;
  background: rgba(var(--ph),0.16); color: rgb(var(--ph));
  border: 1px solid rgba(var(--ph),0.3);
  vertical-align: 1px;
}
.ccl-ev-detail {
  display: block;
  font-family: var(--cct-mono); font-size: 11.5px;
  color: rgba(var(--cct-ink),0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ccl-ev:hover .ccl-ev-detail,
.ccl-ev:focus-within .ccl-ev-detail { white-space: normal; overflow-wrap: anywhere; }
.ccl-ev-t {
  flex: 0 0 auto; padding-top: 5px;
  font-size: 11px; white-space: nowrap;
  color: rgba(var(--cct-ink),0.38);
  font-variant-numeric: tabular-nums;
}
/* nejnovejsi krok = zvyrazneny, jemne pulzuje */
.ccl-ev:first-child { color: rgba(var(--cct-ink),0.9); }
.ccl-ev:first-child .ccl-ev-txt b { color: #fff; }
.ccl-ev:first-child .ccl-ev-t { color: rgba(var(--cct-ink),0.6); }
.ccl-ev:first-child .ccl-ev-ico {
  border-color: rgba(var(--ph),0.7);
  box-shadow: 0 0 0 3px rgba(var(--ph),0.18), 0 0 12px rgba(var(--ph),0.55);
  animation: ccl-ev-pulse 1.8s ease-in-out infinite;
}
.cc-live[data-phase="done"] .ccl-ev:first-child .ccl-ev-ico { animation: none; }
/* komentar modelu = bublinka, kurziva */
.ccl-ev.is-say .ccl-ev-txt {
  padding: 6px 10px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(var(--cct-violet),0.12);
  border: 1px solid rgba(var(--cct-violet),0.28);
  font-style: italic;
}
.ccl-ev.is-say .ccl-ev-txt b { font-weight: 500; color: rgba(var(--cct-ink),0.9); }
.ccl-ev.is-say .ccl-ev-ico { background: rgba(var(--cct-violet),0.18); border-color: rgba(var(--cct-violet),0.5); }
/* zastaveni / varovani */
.ccl-ev.is-stop .ccl-ev-txt b { color: rgb(var(--cct-red)); font-weight: 700; }
.ccl-ev.is-stop .ccl-ev-ico { background: rgba(var(--cct-red),0.16); border-color: rgba(var(--cct-red),0.55); }
.ccl-ev.is-stop:first-child .ccl-ev-ico { box-shadow: 0 0 0 3px rgba(var(--cct-red),0.18), 0 0 12px rgba(var(--cct-red),0.55); }
.ccl-ev.is-warn .ccl-ev-txt b { color: rgb(var(--cct-amber)); }
.ccl-ev.is-warn .ccl-ev-ico { background: rgba(var(--cct-amber),0.14); border-color: rgba(var(--cct-amber),0.5); }

/* Faze DONE: kompaktni lista */
.cc-live[data-phase="done"] {
  display: block;
  padding: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  background: linear-gradient(90deg, rgba(var(--ph),0.1), rgba(var(--ph),0.03)), #10183a;
}
.cc-live[data-phase="done"]::after { animation: none; opacity: 0.35; background-size: 100% 100%; }
.ccl-done {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  padding: 9px 10px 9px 12px;
  font-size: 13px;
}
.ccl-done-ico {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(var(--ph),0.18);
  box-shadow: 0 0 10px rgba(var(--ph),0.35);
}
.ccl-done-txt { font-weight: 600; color: rgba(var(--cct-ink),0.85); margin-right: 4px; }
.ccl-done-txt b { color: #fff; font-family: var(--cct-mono); font-variant-numeric: tabular-nums; font-weight: 800; }
.ccl-done .ccl-log {
  width: auto; height: 32px; padding: 0 11px;
  margin-left: auto;
  font-size: 12.5px; font-weight: 700; gap: 5px;
  border-radius: 999px;
}

/* ---------- Animace ---------- */
@keyframes ccl-scan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes ccl-breathe { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes ccl-dot {
  0%   { box-shadow: 0 0 0 0 rgba(var(--ph),0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(var(--ph),0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--ph),0); }
}
@keyframes ccl-step-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(var(--ph),0.25), 0 0 12px rgba(var(--ph),0.8); }
  50%     { box-shadow: 0 0 0 6px rgba(var(--ph),0.12), 0 0 16px rgba(var(--ph),1); }
}
@keyframes ccl-ev-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(var(--ph),0.18), 0 0 12px rgba(var(--ph),0.55); }
  50%     { box-shadow: 0 0 0 5px rgba(var(--ph),0.1), 0 0 16px rgba(var(--ph),0.85); }
}
@keyframes cct-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes ccrl-run-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ==========================================================================
   LOG MODAL (#modal-cc-runlog) - nad CC vlaknem
   ========================================================================== */
.modal.modal-cc-runlog {
  z-index: 1600;                     /* .modal-stacked ma 1500, cc-thread 100 */
  align-items: stretch;
  padding-top: env(safe-area-inset-top, 0px);
}
.modal-cc-runlog .modal-backdrop { background: rgba(3,5,16,0.7); }
.modal-cc-runlog .modal-panel {
  max-width: none;
  height: calc(100dvh - env(safe-area-inset-top, 0px));
  border-radius: 0;
}
.modal-cc-runlog .modal-head { padding: 12px 14px 10px; border-bottom-color: rgba(255,255,255,0.07); }
.modal-cc-runlog .modal-head h3 { font-size: 16px; }
.modal-cc-runlog .modal-body { padding: 12px 14px 28px; }
.modal-cc-runlog .modal-body > * { max-width: 1040px; margin-left: auto; margin-right: auto; }

.ccrl-subrow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 6px; font-size: 12px;
}
.ccrl-subrow #ccrl-sub { font-family: var(--cct-mono); font-size: 11.5px; color: rgba(var(--cct-ink),0.5); }
.ccrl-filter {
  font: inherit; font-size: 12px; font-weight: 700;
  min-height: 30px; padding: 4px 11px;
  border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(var(--cct-ink),0.75);
}
.ccrl-filter.is-on {
  background: rgba(var(--cct-teal),0.14);
  border-color: rgba(var(--cct-teal),0.5);
  color: rgb(var(--cct-teal));
}
.ccrl-empty {
  padding: 48px 16px; text-align: center;
  color: rgba(var(--cct-ink),0.7); font-size: 14px; line-height: 1.5;
}

/* Jeden beh = karta */
.ccrl-run {
  --st: 160,168,190;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  background: rgba(255,255,255,0.025);
  margin-bottom: 12px;
  overflow: hidden;
}
.ccrl-run.st-running { --st: var(--cct-teal); }
.ccrl-run.st-done { --st: var(--cct-green); }
.ccrl-run.st-error { --st: var(--cct-red); }
.ccrl-run.st-timeout, .ccrl-run.st-limit { --st: var(--cct-amber); }
.ccrl-run.st-lost { --st: 160,168,190; }
.ccrl-run[open] { border-color: rgba(var(--st),0.35); }

.ccrl-run-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  padding: 12px 14px 12px 12px;
  min-height: 48px;
  cursor: pointer; list-style: none;
  user-select: none;
}
.ccrl-run-head::-webkit-details-marker { display: none; }
.ccrl-run-head::before {
  content: ''; flex: 0 0 auto;
  width: 8px; height: 8px; margin-right: 2px;
  border-right: 2px solid rgba(var(--cct-ink),0.5);
  border-bottom: 2px solid rgba(var(--cct-ink),0.5);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.ccrl-run[open] > .ccrl-run-head::before { transform: rotate(45deg); }
.ccrl-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(var(--st),0.15); color: rgb(var(--st));
  border: 1px solid rgba(var(--st),0.4);
}
.ccrl-run.st-running .ccrl-badge { animation: ccrl-run-pulse 1.4s ease-in-out infinite; }
.ccrl-when { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ccrl-run-head .ccl-chip { font-size: 11px; padding: 2px 8px; }
.ccrl-meta {
  padding: 0 14px 12px 28px;
  font-size: 12px; color: rgba(var(--cct-ink),0.55);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ccrl-meta b { color: rgba(var(--cct-ink),0.9); font-weight: 600; }

/* Sekce 1-4 jako timeline */
.ccrl-sec {
  position: relative;
  padding: 12px 14px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.ccrl-meta + .ccrl-sec { border-top: 0; }
.ccrl-sec::before {                  /* svisla linka timeline */
  content: '';
  position: absolute; left: 25px; top: 0; bottom: 0; width: 2px;
  background: rgba(255,255,255,0.07);
}
.ccrl-meta + .ccrl-sec::before { top: 14px; }
.ccrl-sec:last-child::before { bottom: auto; height: 22px; }
.ccrl-sec-h {
  position: relative;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  font-size: 13.5px; font-weight: 700;
  color: rgba(var(--cct-ink),0.92);
  list-style: none; cursor: default;
  min-height: 24px;
}
.ccrl-sec-h .muted { white-space: nowrap; }
.ccrl-sec-h::-webkit-details-marker { display: none; }
.ccrl-sec-h .muted { font-size: 12px; font-weight: 500; }
.ccrl-sec-h code {
  font-family: var(--cct-mono); font-size: 12px;
  padding: 0 5px; border-radius: 5px; background: rgba(255,255,255,0.08);
}
.ccrl-num {
  flex: 0 0 24px;
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--cct-mono); font-size: 11.5px; font-weight: 800;
  color: rgb(var(--cct-teal));
  background: #0d1330;
  border: 2px solid rgba(var(--cct-teal),0.55);
  box-shadow: 0 0 0 3px #0d1330, 0 0 10px rgba(var(--cct-teal),0.25);
  z-index: 1;
}
details.ccrl-fold > .ccrl-sec-h { cursor: pointer; }
details.ccrl-fold > .ccrl-sec-h::after {
  content: ''; margin-left: auto;
  width: 8px; height: 8px;
  border-right: 2px solid rgba(var(--cct-ink),0.45);
  border-bottom: 2px solid rgba(var(--cct-ink),0.45);
  transform: rotate(-45deg); transition: transform 0.15s;
}
details.ccrl-fold[open] > .ccrl-sec-h::after { transform: rotate(45deg); }
.ccrl-copy {
  margin-left: auto;
  font: inherit; font-size: 11.5px; font-weight: 700;
  min-height: 30px; padding: 3px 10px;
  border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(var(--cct-ink),0.8);
  white-space: nowrap;
}
.ccrl-copy:hover { background: rgba(var(--cct-teal),0.14); border-color: rgba(var(--cct-teal),0.45); color: rgb(var(--cct-teal)); }
.ccrl-none { margin: 8px 0 0 34px; font-size: 12.5px; }

/* Vypisy */
.ccrl-pre {
  position: relative;
  margin: 10px 0 0 34px;
  max-height: 280px; overflow: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(var(--cct-ink),0.85);
  font-family: var(--cct-mono); font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ccrl-cmd {
  background: #05070f;
  border-color: rgba(var(--cct-teal),0.3);
  color: #c9f5ef;
}
.ccrl-cmd::before { content: '$ '; color: rgb(var(--cct-teal)); font-weight: 700; }
.ccrl-out {
  border-color: rgba(var(--cct-violet),0.3);
  background: linear-gradient(180deg, rgba(var(--cct-violet),0.06), transparent 30%), rgba(0,0,0,0.35);
}

/* Volani cc.php */
.ccrl-calls {
  list-style: none; margin: 10px 0 0 34px; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.ccrl-call details { border-radius: 10px; }
.ccrl-call > details > summary {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid rgba(255,255,255,0.12);
  font-size: 12.5px; cursor: pointer; list-style: none;
  user-select: none;
}
.ccrl-call > details > summary::-webkit-details-marker { display: none; }
.ccrl-call > details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: rgba(255,255,255,0.05); }
.ccrl-call.is-mine > details > summary { border-left-color: rgb(var(--cct-teal)); }
.ccrl-call.is-err > details > summary { border-left-color: rgb(var(--cct-red)); background: rgba(var(--cct-red),0.06); }
.ccrl-t {
  flex: 0 0 auto; min-width: 46px;
  font-family: var(--cct-mono); font-size: 11px; font-variant-numeric: tabular-nums;
  color: rgba(var(--cct-ink),0.5);
}
.ccrl-act {
  flex: 0 0 auto;
  font-family: var(--cct-mono); font-size: 11.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 6px;
  color: rgb(var(--cct-teal)); background: rgba(var(--cct-teal),0.1);
  border: 1px solid rgba(var(--cct-teal),0.22);
}
.ccrl-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(var(--cct-ink),0.8); }
.ccrl-ms, .ccrl-http {
  flex: 0 0 auto;
  font-family: var(--cct-mono); font-size: 11px; font-variant-numeric: tabular-nums;
  color: rgba(var(--cct-ink),0.45);
}
.ccrl-http:empty { display: none; }
.ccrl-call.is-err .ccrl-http { color: rgb(var(--cct-red)); font-weight: 700; }
.ccrl-io {
  padding: 6px 10px 10px;
  border: 1px solid rgba(255,255,255,0.06); border-top: 0;
  border-radius: 0 0 10px 10px;
  background: rgba(0,0,0,0.15);
}
.ccrl-io-h {
  margin: 8px 0 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(var(--cct-ink),0.5);
}
.ccrl-io .ccrl-pre { margin: 0; max-height: 220px; font-size: 11.5px; }

/* ==========================================================================
   Desktop (>= 900px): vlakno jako siroky panel uprostred, ne fullscreen
   ========================================================================== */
@media (min-width: 900px) {
  .modal.modal-cc-thread {
    align-items: center; justify-content: center;
    padding: 24px;
  }
  .modal-cc-thread .modal-panel {
    max-width: 1080px;
    height: calc(100dvh - 48px);
    border-radius: 22px;
  }
  .modal-cc-thread .modal-head { padding: 16px 20px 12px; }
  .modal-cc-thread .modal-head h3 { font-size: 18px; }
  .modal-cc-thread .modal-body { padding: 20px 24px 32px; }
  .modal-cc-thread .chat { gap: 14px; }
  .modal-cc-thread .chat .msg { padding: 12px 16px 14px; }
  .modal-cc-thread .chat .msg-cc { max-width: 82%; }
  .modal-cc-thread .chat .msg-user { max-width: 72%; }
  .modal-cc-thread .modal-foot { padding: 12px 24px 14px; }
  /* Paticka: mic | textarea | Poslat | x v jednom radku */
  .modal-cc-thread .cc-reply { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 10px; align-items: end; }
  .modal-cc-thread .cc-reply textarea { grid-column: 1; grid-row: 1; margin: 0; }
  .modal-cc-thread .cc-reply-actions { grid-column: 2; grid-row: 1; margin: 0; }
  .modal-cc-thread .cc-reply-actions #cct-send { flex: 0 0 auto; min-width: 130px; padding: 0 20px; }
  .modal-cc-thread .mic-status { grid-column: 1 / -1; }

  .ccl-top { grid-template-columns: 80px minmax(0,1fr) auto; gap: 18px; padding: 16px 16px 16px 18px; }
  .ccl-feed-list { max-height: 300px; padding: 2px 16px 14px 18px; }
  .ccl-ring { width: 80px; height: 80px; }
  .ccl-time { font-size: 17px; }
  .ccl-title { font-size: 16px; }
  .ccl-steps { max-width: 460px; }
  .ccl-step { font-size: 11px; }
  .ccl-now { font-size: 13.5px; }

  .modal.modal-cc-runlog { align-items: center; justify-content: center; padding: 24px; }
  .modal-cc-runlog .modal-panel { max-width: 1120px; height: calc(100dvh - 48px); border-radius: 22px; }
  .modal-cc-runlog .modal-head { padding: 16px 20px 12px; }
  .modal-cc-runlog .modal-body { padding: 18px 24px 32px; }
  .ccrl-pre { max-height: 360px; }
}

/* ==========================================================================
   Mobil (<= 480px): vsechno se musi vejit na 390px bez horizontalniho scrollu
   ========================================================================== */
@media (max-width: 480px) {
  .modal-cc-thread .modal-body { padding: 12px 12px 24px; }
  .modal-cc-thread .chat .msg { max-width: 94%; padding: 9px 12px 11px; }
  .modal-cc-thread .chat .msg-cc { max-width: 94%; }
  .modal-cc-thread .chat .msg-user { max-width: 88%; }
  .modal-cc-thread .chat .msg-body { font-size: 15.5px; }
  .modal-cc-thread .modal-foot { padding-left: 12px; padding-right: 12px; }

  /* Log tlacitko do rohu, aby stepper dostal celou sirku */
  .cc-live { border-radius: 18px; }
  .ccl-top { grid-template-columns: 62px minmax(0,1fr); gap: 12px; padding: 12px 12px 12px 12px; }
  .ccl-top .ccl-log { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; font-size: 14px; }
  .ccl-top .ccl-title { padding-right: 40px; }
  .ccl-feed-toggle { padding-left: 12px; }
  .ccl-feed-list { padding: 2px 10px 10px 10px; max-height: 240px; }
  .ccl-ev { font-size: 12.5px; padding-left: 32px; }
  .ccl-ev-t { font-size: 10.5px; }
  /* tri ikonova tlacitka v hlavicce (🔗 🧾 ✕) at nechaji misto nazvu */
  .modal-cc-thread .modal-head-right { gap: 4px; }
  .modal-cc-thread .modal-head-right .iconbtn { width: 38px; height: 38px; }
  .ccl-ring { width: 62px; height: 62px; }
  .ccl-ring::before {
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  }
  .ccl-time { font-size: 13px; }
  .ccl-title { font-size: 14px; }
  .ccl-step { font-size: 9.5px; letter-spacing: 0; }
  .ccl-now { font-size: 12.5px; }
  .ccl-log { width: 36px; height: 36px; font-size: 15px; }
  .ccl-done { padding: 8px 8px 8px 10px; font-size: 12.5px; }
  .ccl-done .ccl-log { height: 30px; }

  .modal-cc-runlog .modal-body { padding: 10px 10px 24px; }
  .ccrl-sec { padding: 10px 10px 12px; }
  .ccrl-sec::before { display: none; }
  .ccrl-num { box-shadow: none; }
  .ccrl-meta { padding: 0 12px 10px 12px; }
  .ccrl-pre, .ccrl-calls, .ccrl-none { margin-left: 0; }
  .ccrl-pre { max-height: 240px; font-size: 11.5px; }
  .ccrl-call > details > summary { flex-wrap: wrap; row-gap: 2px; padding: 7px 8px; }
  .ccrl-what { flex-basis: 100%; order: 10; white-space: normal; font-size: 12px; color: rgba(var(--cct-ink),0.65); }
}

/* ---------- Bez animaci, kdyz si to uzivatel preje ---------- */
@media (prefers-reduced-motion: reduce) {
  .cc-live::after, .ccl-ring::after, .ccl-dot, .ccl-step.is-active i, .ccl-ev-ico,
  .modal-cc-thread .status-pill::before, .ccrl-run.st-running .ccrl-badge {
    animation: none !important;
  }
}

/* ---- Prubeh: jen JEDEN krok + listovani ‹ › (Tomas 23.9.2026: seznam zabiral pul obrazovky) ---- */
.ccl-feed-one {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
}
.ccl-feed-one .ccl-ev {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 2px 4px;
}
.ccl-feed-one .ccl-ev::before { display: none; }          /* bez svisle osy */
.ccl-feed-one .ccl-ev-txt { padding-top: 0; overflow: hidden; }
.ccl-feed-one .ccl-ev-txt b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.ccl-feed-one .ccl-ev.is-say .ccl-ev-txt { padding: 6px 10px; }
.ccl-feed-one .ccl-ev-t { white-space: nowrap; flex: 0 0 auto; }
.ccl-pg {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(var(--ph),0.35);
  background: rgba(var(--ph),0.08);
  color: rgba(var(--cct-ink),0.9);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ccl-pg:hover:not([disabled]) { background: rgba(var(--ph),0.2); }
.ccl-pg[disabled] { opacity: 0.25; cursor: default; }
@media (max-width: 480px) {
  .ccl-feed-one { padding: 6px 4px; gap: 4px; }
  .ccl-pg { width: 30px; height: 30px; font-size: 16px; }
  .ccl-feed-one .ccl-ev { gap: 8px; }
  .ccl-feed-one .ccl-ev-t { font-size: 10.5px; }
}
.ccl-feed-one .ccl-ev-ico { position: static; flex: 0 0 26px; }
