/* Chat — panel vpravo (desktop ≥ 900 px) / spodní list (mobil). Tokeny z styles.css, s náhradními hodnotami. */

.chat {
  --ch-ink: var(--ink, #f3f1ec);
  --ch-on-ink: var(--on-ink, #0a0b0e);
  --ch-s1: var(--surface-1, #121418);
  --ch-s2: var(--surface-2, #1a1d23);
  --ch-s3: var(--surface-3, #23262e);
  --ch-hair: var(--hair, rgb(255 255 255 / .08));
  --ch-hair-strong: var(--hair-strong, rgb(255 255 255 / .16));
  --ch-text: var(--text, #f3f1ec);
  --ch-muted: var(--text-muted, #a3a6ad);
  --ch-faint: var(--text-faint, #7f838b);
  --ch-line: var(--line, rgb(255 255 255 / .12));
  --ch-focus: var(--focus, #8ab4ff);
  --ch-ok: var(--ok, #4fd18b);
  --ch-danger: var(--danger, #ff6b5e);
  --ch-ease: var(--ease-response, cubic-bezier(.2, .8, .2, 1));

  /* reset nativního <dialog> */
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ch-text);
  font: 400 15px/1.4 var(--font-ui, system-ui, "Segoe UI", sans-serif);
  overflow: hidden;
  color-scheme: dark;

  position: fixed;
  inset: 8px 8px 8px auto;
  width: 420px;
  max-width: calc(100vw - 16px);
  height: auto;
  max-height: none;
  border-radius: var(--radius-sheet, 28px);
  background: var(--ch-s1);
  box-shadow: inset 0 0 0 1px var(--ch-hair), 0 24px 64px rgb(0 0 0 / .5);
  z-index: 30;
}
.chat:not([open]) { display: none; }
.chat::backdrop { background: rgb(0 0 0 / .5); }

.chat *, .chat *::before, .chat *::after { box-sizing: border-box; }
.chat :focus-visible { outline: 2px solid var(--ch-focus); outline-offset: 2px; border-radius: 8px; }
:where(.chat) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.chat) button:disabled { cursor: default; }

.chat-sheet { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; outline: none; }

/* ---------- mobil: modální spodní list ---------- */
@media (max-width: 899.98px) {
  .chat {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px);
    inset: auto 0 var(--kb, 0px) 0;
    width: 100%;
    max-width: none;
    height: min(88dvh, calc(var(--vvh, 100dvh) - 8px));
    border-radius: var(--radius-sheet, 28px) var(--radius-sheet, 28px) 0 0;
    translate: 0 var(--drag, 0px);
    transition: translate 220ms var(--ch-ease);
  }
  .chat[data-dragging] { transition: none; }
}

/* ---------- hlavička ---------- */
.chat-grab { flex: none; touch-action: none; user-select: none; -webkit-user-select: none; }
@media (min-width: 900px) { .chat-grab { touch-action: auto; } }
.chat-handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: rgb(255 255 255 / .28); }
@media (min-width: 900px) { .chat-handle { display: none; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--ch-line); }
@media (min-width: 900px) { .chat-head { padding-top: 16px; } }
.chat-orb { flex: none; }
.chat-who { flex: 1; min-width: 0; }
.chat-name { margin: 0; font: 600 16px/1.25 var(--font-ui, system-ui, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { margin: 1px 0 0; font-size: 13px; color: var(--ch-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.4em; }
.chat-sub.is-typing { color: var(--ch-text); }
.chat-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(255 255 255 / .06);
  transition: transform var(--dur-feedback, 120ms) var(--ch-ease), background var(--dur-feedback, 120ms);
}
@media (hover: hover) and (pointer: fine) {
  .chat-close:hover { background: rgb(255 255 255 / .10); }
}
.chat-close:active { transform: scale(.92); background: rgb(255 255 255 / .14); }
/* menu „⋯“ v hlavičce (Smazat historii) */
.chat-more { margin-left: auto; }
.chat-more + .chat-close { margin-left: -4px; }
.chat-menu.chat-menu--head { left: auto; right: 12px; bottom: auto; top: calc(64px + env(safe-area-inset-top, 0px)); }
@media (min-width: 900px) { .chat-menu.chat-menu--head { top: 68px; } }
.chat-menu-item--danger { color: var(--ch-danger); }
.chat-menu-item[data-sure="1"] { background: rgb(255 107 94 / .14); }
.card-note--warn { color: var(--ch-text); background: rgb(255 190 80 / .12); border-radius: 10px; padding: 8px 10px; box-shadow: inset 0 0 0 1px rgb(255 190 80 / .28); }
.chat .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- vlákno ---------- */
.chat-body { scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .16) transparent; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 8px; scroll-padding-bottom: 8px; position: relative; display: flex; flex-direction: column; }
.chat-thread {
  /* barva zařízení (--h/--l/--c nastavuje chat.js na seznamu) a z ní tónovaný podklad příchozích bublin a karet */
  --ch-peer: oklch(var(--l, .7) var(--c, .1) var(--h, 250));
  --ch-in: var(--ch-s2);
  --ch-in-card: var(--ch-s2);
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; margin-top: auto;
}
@supports (color: color-mix(in oklch, red 16%, blue)) {
  /* karty jsou velké plochy → slabší tón než bubliny */
  .chat-thread { --ch-in: color-mix(in oklch, var(--ch-peer) 16%, var(--ch-s2)); --ch-in-card: color-mix(in oklch, var(--ch-peer) 9%, var(--ch-s2)); }
}
.chat-item { display: flex; flex-direction: column; gap: 8px; }
.chat-item.is-cont { margin-top: -10px; } /* uvnitř skupiny jen 2 px (12 − 10) */
.chat-time { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--ch-faint); font-variant-numeric: tabular-nums; }
.chat-sys { margin: 4px 0; text-align: center; font: 500 13px/1.4 var(--font-ui, system-ui, sans-serif); color: var(--ch-muted); overflow-wrap: anywhere; }

.chat-empty { margin: auto; padding: 24px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.chat-empty[hidden] { display: none; }
.chat-empty-text { margin: 0; font: 600 17px/1.4 var(--font-display, system-ui, sans-serif); letter-spacing: -.01em; color: var(--ch-muted); max-width: 22ch; }
.chat-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chat-body:has(.chat-empty:not([hidden])) .chat-thread { margin-top: 0; }

.chat-jump {
  position: absolute; left: 50%; translate: -50% 0; bottom: 76px; z-index: 3; height: 36px; padding: 0 14px 0 10px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--ch-ink); color: var(--ch-on-ink); box-shadow: 0 6px 20px rgb(0 0 0 / .45);
}
.chat-jump[hidden] { display: none; }
.chat-jump .icon { width: 16px; height: 16px; }
.chat-jump:active { transform: scale(.96); }

/* ---------- bubliny ---------- */
.bubble-row { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; }
.bubble-row[data-dir="out"] { flex-direction: row-reverse; }
.bubble {
  display: flow-root; /* obalí plovoucí čas */
  max-width: min(82%, 340px); padding: 8px 12px 7px; border-radius: 20px; position: relative;
  background: var(--ch-in); color: var(--ch-text);
  overflow-wrap: anywhere; word-break: break-word;
  transition: border-radius 160ms var(--ch-ease);
}
.bubble-row[data-dir="out"] .bubble { background: var(--ch-ink); color: var(--ch-on-ink); }
/* skupiny: „vnitřní“ rohy na straně odesílatele jsou 6 px */
.bubble-row[data-dir="in"][data-pos="first"] .bubble { border-bottom-left-radius: 6px; }
.bubble-row[data-dir="in"][data-pos="mid"] .bubble { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.bubble-row[data-dir="in"][data-pos="last"] .bubble { border-top-left-radius: 6px; }
.bubble-row[data-dir="out"][data-pos="first"] .bubble { border-bottom-right-radius: 6px; }
.bubble-row[data-dir="out"][data-pos="mid"] .bubble { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.bubble-row[data-dir="out"][data-pos="last"] .bubble { border-top-right-radius: 6px; }
.bubble-text { margin: 0; white-space: pre-wrap; }
.bubble-text.is-full { max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bubble-more {
  display: block; margin-top: 6px; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; color: inherit; opacity: .8; min-height: 24px;
}
@media (hover: hover) and (pointer: fine) {
  .bubble-more:hover { opacity: 1; }
}
.bubble-more:active { opacity: 1; }
/* čas + fajfky vpravo dole; na konci textu plave, takže sedí na posledním řádku, když se vejde */
.bubble-meta {
  float: right; display: inline-flex; align-items: center; gap: 4px; height: 14px; margin: 6px 0 -3px 12px;
  font-size: 11px; line-height: 14px; letter-spacing: .02em; opacity: .55; font-variant-numeric: tabular-nums;
  -webkit-user-select: none; user-select: none;
}
.bubble > .bubble-meta { float: none; display: flex; justify-content: flex-end; margin: 4px 0 -3px; } /* u sbalené zprávy pod tlačítkem */
.ticks { width: 18px; height: 12px; flex: none; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tick-2 { stroke-dasharray: 12; stroke-dashoffset: 12; opacity: 0; }
.ticks.is-delivered .tick-2 { stroke-dashoffset: 0; opacity: 1; }
.ticks.is-draw .tick-2 { animation: ch-tick 160ms ease-out backwards; }
@keyframes ch-tick { from { stroke-dashoffset: 12; opacity: 1; } }
.chat-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* „píše…“: bublina na konci vlákna, tři skákající tečky */
.chat-typing .bubble { display: flex; align-items: center; gap: 5px; min-height: 37px; padding: 0 14px; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ch-muted); opacity: .4; animation: ch-dot 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes ch-dot { 0%, 60%, 100% { translate: 0 0; opacity: .4; } 30% { translate: 0 -3px; opacity: 1; } }

.bubble-copy {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ch-muted);
  opacity: 0; transition: opacity var(--dur-feedback, 120ms);
}
.bubble-copy .icon { width: 16px; height: 16px; }
.bubble-copy.is-ok { color: var(--ch-ok); }
.bubble-row:focus-within .bubble-copy, .bubble-row.is-actions .bubble-copy { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .bubble-row:hover .bubble-copy { opacity: 1; }
  .bubble-copy:hover { background: rgb(255 255 255 / .1); color: var(--ch-text); }
}
.bubble-copy:active { background: rgb(255 255 255 / .14); transform: scale(.94); }
@media (hover: none) { .bubble-copy { width: 40px; height: 40px; } }

/* ---------- karty dávek ---------- */
.card-row { display: flex; }
.card-row[data-dir="out"] { justify-content: flex-end; }
.card {
  width: min(100%, 340px); border-radius: 20px; padding: 10px; background: var(--ch-s2); outline: none;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  box-shadow: inset 0 0 0 1px var(--ch-hair);
}
.card[data-dir="in"] { background: var(--ch-in-card); }
.card[data-state="consent"] { box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .3); }
.card:focus-visible { outline: 2px solid var(--ch-focus); outline-offset: 2px; }
.card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-icon { width: 22px; height: 22px; color: var(--ch-muted); }
.card-titles { min-width: 0; flex: 1; }
.card-title { margin: 0; font-weight: 600; font-size: 15px; min-width: 0; }
.card-title--ask { font-weight: 400; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.card-from { font-weight: 600; }
.card-meta { margin: 0; font-size: 12.5px; color: var(--ch-muted); font-variant-numeric: tabular-nums; }

.fn { display: inline-flex; min-width: 0; max-width: 100%; }
.fn-head { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-tail { flex: none; white-space: pre; }
.card-titles > .fn { display: flex; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.row-hit {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 4px 6px; border-radius: 14px; text-align: left; min-width: 0;
}
button.row-hit { transition: background var(--dur-feedback, 120ms); }
@media (hover: hover) and (pointer: fine) {
  button.row-hit:hover { background: rgb(255 255 255 / .07); }
}
button.row-hit:active { background: rgb(255 255 255 / .12); }
.tile {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  overflow: hidden; background: rgb(255 255 255 / .08); color: var(--ch-muted); position: relative;
}
.tile-ext { font-size: 9px; line-height: 1; font-weight: 700; letter-spacing: .04em; }
.tile-icon { width: 18px; height: 18px; }
.tile:not(:has(.tile-ext)) .tile-icon { width: 22px; height: 22px; }
.tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row.is-gone .row-hit { opacity: .5; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-name { font-size: 14.5px; }
.row-sub { font-size: 12px; color: var(--ch-muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-dir { opacity: .85; }
.row-state { flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--ch-muted); }
.row-state .icon { width: 18px; height: 18px; }
.row-state.is-ok { color: var(--ch-ok); }
.row-state.is-pop .icon, .card-ok.is-pop .icon { animation: ch-pop 220ms cubic-bezier(.3, 1.35, .5, 1) backwards; }
@keyframes ch-pop { from { scale: .6; opacity: 0; } }
.card-more { display: flex; gap: 14px; padding: 0 6px; }
.chat-link-btn { font-size: 13px; font-weight: 600; color: var(--ch-text); min-height: 32px; padding: 0 2px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) {
  .chat-link-btn:hover { color: var(--ch-muted); }
}
.chat-link-btn:active { opacity: .7; }

.card-foot { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-note { margin: 0; font-size: 12.5px; color: var(--ch-muted); line-height: 1.4; }
.card-flag { margin: 0; font: 400 14px/1.4 var(--font-ui, system-ui, sans-serif); color: var(--ch-muted); }
.card-flag--bad { color: var(--ch-danger); font-style: normal; font-family: inherit; font-size: 13px; }
.card-ok { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ch-ok); font-weight: 600; }
.card-ok .icon { width: 16px; height: 16px; }
.card-status { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.card-status-text { flex: 1; font: 400 14px/1.3 var(--font-ui, system-ui, sans-serif); color: var(--ch-muted); }
.card-spin {
  flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .2); border-top-color: var(--ch-text);
  animation: chat-spin 900ms linear infinite;
}
@keyframes chat-spin { to { rotate: 360deg; } }

.bar { height: 4px; border-radius: 2px; background: rgb(255 255 255 / .1); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); background: var(--ch-ink); border-radius: 2px; transition: transform 200ms linear; }
.card-stat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-stat-text { font-size: 12.5px; color: var(--ch-muted); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

/* ---------- tlačítka ---------- */
.chat-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--ch-text);
  background: rgb(255 255 255 / .08);
  transition: transform var(--dur-feedback, 120ms) var(--ch-ease), background var(--dur-feedback, 120ms), opacity var(--dur-feedback, 120ms);
}
@media (hover: hover) and (pointer: fine) {
  .chat-btn:hover { background: rgb(255 255 255 / .13); }
}
.chat-btn:active { transform: scale(.97); background: rgb(255 255 255 / .17); }
.chat-btn .icon { width: 18px; height: 18px; }
.chat-btn--ink { background: var(--ch-ink); color: var(--ch-on-ink); }
@media (hover: hover) and (pointer: fine) {
  .chat-btn--ink:hover { background: color-mix(in srgb, var(--ch-ink) 88%, transparent); }
}
.chat-btn--ink:active { background: var(--ch-ink); filter: brightness(1.08); }
.chat-btn--ghost { background: none; color: var(--ch-muted); min-height: 36px; padding: 0 12px; }
@media (hover: hover) and (pointer: fine) {
  .chat-btn--ghost:hover { background: rgb(255 255 255 / .08); color: var(--ch-text); }
}
.chat-btn--ghost:active { background: rgb(255 255 255 / .12); color: var(--ch-text); }
@media (pointer: coarse) { .chat-btn { min-height: 44px; } .chat-link-btn { min-height: 44px; } }

/* ---------- psaní ---------- */
.chat-over { flex: none; padding: 10px 16px; border-top: 1px solid var(--ch-line); display: flex; flex-direction: column; gap: 8px; background: rgb(255 255 255 / .04); }
.chat-over[hidden] { display: none; }
.chat-over-text { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--ch-text); overflow-wrap: anywhere; }
.chat-over-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-notice { margin: 0; padding: 8px 16px; text-align: center; font: 400 13.5px/1.4 var(--font-ui, system-ui, sans-serif); color: var(--ch-muted); border-top: 1px solid var(--ch-line); }
.chat-notice[hidden] { display: none; }
.chat-composer {
  flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--ch-line);
}
.chat-icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ch-muted);
  transition: background var(--dur-feedback, 120ms), color var(--dur-feedback, 120ms);
}
@media (hover: hover) and (pointer: fine) {
  .chat-icon-btn:hover:not(:disabled) { background: rgb(255 255 255 / .1); color: var(--ch-text); }
}
.chat-icon-btn:active:not(:disabled) { background: rgb(255 255 255 / .14); color: var(--ch-text); transform: scale(.94); }
.chat-icon-btn:disabled { opacity: .4; }
.chat-input {
  flex: 1; min-width: 0; resize: none; border: 0; outline: none; color: var(--ch-text); background: rgb(255 255 255 / .05);
  border-radius: 22px; padding: 10px 14px; font: inherit; line-height: 22px; max-height: 130px; min-height: 44px; overflow-y: auto;
  box-shadow: inset 0 0 0 1px var(--ch-hair); transition: box-shadow var(--dur-feedback, 120ms), background var(--dur-feedback, 120ms);
  scrollbar-width: thin;
}
/* ≥ 16 px na dotyku, jinak iOS při zaměření pole přiblíží stránku */
@media (pointer: coarse) { .chat-input { font-size: 16px; } }
.chat-input::placeholder { color: var(--ch-faint); }
/* bez modrého rámečku: při zaměření jen výraznější linka a světlejší pozadí */
.chat-input:focus { background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px var(--ch-hair-strong); }
.chat-input:focus-visible { outline: none; border-radius: 22px; }
.chat-input:disabled { opacity: .5; }
.chat-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ch-ink); color: var(--ch-on-ink);
  transition: transform var(--dur-feedback, 120ms) var(--ch-ease), background 160ms, color 160ms;
}
.chat-send:active:not(:disabled) { transform: scale(.9); }
.chat-send:disabled { background: rgb(255 255 255 / .08); color: var(--ch-faint); } /* prázdné pole: plochý šedý kruh */

.chat-menu {
  position: absolute; left: 12px; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 5; min-width: 180px; padding: 6px; border-radius: 18px;
  background: var(--ch-s2); box-shadow: inset 0 0 0 1px var(--ch-hair-strong), var(--shadow-float, 0 1px 2px rgb(0 0 0 / .35), 0 8px 24px rgb(0 0 0 / .28));
  display: flex; flex-direction: column;
}
.chat-menu[hidden] { display: none; }
.chat-menu-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; text-align: left; }
.chat-menu-item:focus-visible { background: rgb(255 255 255 / .1); }
@media (hover: hover) and (pointer: fine) {
  .chat-menu-item:hover { background: rgb(255 255 255 / .1); }
}
.chat-menu-item:active { background: rgb(255 255 255 / .14); }

/* ---------- drop zóna ---------- */
.chat-drop {
  position: absolute; inset: 0; z-index: 8; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center;
  background: rgb(10 11 14 / .78); border-radius: inherit; pointer-events: none;
  outline: 2px dashed rgb(255 255 255 / .45); outline-offset: -14px;
}
.chat-drop.is-on { display: flex; }
.chat-drop-icon { width: 36px; height: 36px; }
.chat-drop-text { margin: 0; font: 600 18px/1.35 var(--font-display, system-ui, sans-serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.chat-drop.is-off .chat-drop-text::after { content: " (je offline)"; }

.chat-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- dotyk: nativní pocit (viz DESIGN v4.2) ---------- */
.chat button, .chat a, .chat [role=button] { touch-action: manipulation; }
.chat button, .chat-grab, .chat-sys, .chat-time, .tile, .chat-empty-text, .card-head, .bar, .chat-drop { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat .bubble, .chat .bubble-text, .chat .chat-input, .chat .row-name, .chat .card-title { -webkit-user-select: text; user-select: text; }
.chat-body { overscroll-behavior: contain; }

/* ---------- úsporný režim (html.lite řídí perf.js; základ je v styles.css) ---------- */
html.lite .chat { box-shadow: inset 0 0 0 1px var(--ch-hair), 0 8px 24px rgb(0 0 0 / .5); }
html.lite .chat::backdrop { background: rgb(0 0 0 / .62); }
html.lite .chat-jump { box-shadow: 0 3px 10px rgb(0 0 0 / .4); }
html.lite .chat-menu { box-shadow: inset 0 0 0 1px var(--ch-hair-strong), 0 6px 16px rgb(0 0 0 / .5); }
html.lite .card-spin { animation-duration: 1.4s; }
html.lite .row-state.is-pop .icon, html.lite .card-ok.is-pop .icon { animation-timing-function: ease-out; } /* bez překmitu */

/* ---------- pohyb ---------- */
@media (prefers-reduced-motion: reduce) {
  .chat, .chat * { transition-duration: 1ms !important; }
  .card-spin { animation: none; border-top-color: rgb(255 255 255 / .5); }
  .bar-fill { transition: none; }
  .typing-dot { animation: none; opacity: .7; }
  .ticks.is-draw .tick-2, .row-state.is-pop .icon, .card-ok.is-pop .icon { animation: none; }
}
