/* Živá podpora (podpora.js) – schránka zpráv podle vzoru GOODIE Product Board → Zprávy a Nastavení → Živá podpora.
   Barvy jen z proměnných motivu (styles.css, vzhled.js), ať sedí všech šest provedení i Vlastní barvy. */

/* Schránka zabírá celou plochu: seznam i konverzace se posouvají samy, stránka ne. */
.route[data-module="podpora"], .route[data-module="podpora_chat"], .route[data-module="podpora_email"], .route[data-module="podpora_vzkazy"] {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding: 14px 16px 12px; max-width: none; width: 100%; box-sizing: border-box;
}
.main:has(> .route[data-module^="podpora"]:not([data-module="podpora_nastaveni"])) { overflow: hidden; }

.pd { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 23rem) minmax(0, 1fr); gap: 12px; }

/* ---------- horní lišta ---------- */
.pd-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 2px 4px; }
.pd-bar__title { display: flex; align-items: baseline; gap: 8px; margin-right: 4px; }
.pd-bar__title h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.pd-bar__title span { font-size: 12px; color: var(--muted); }
.pd-bar__sp { flex: 1; }
.pd-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 11px 4px 9px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink); max-width: 100%; }
.pd-state b { font-weight: 650; white-space: nowrap; }
.pd-state__why { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: none; }
.pd-state--online .pd-dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.pd-state--zaneprazdneno .pd-dot { background: var(--warn); }
.pd-state--mimo .pd-dot { background: var(--muted); }
.pd-who { display: inline-flex; }
.pd-av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700;
  background: var(--lime); color: var(--brand-ink); border: 2px solid var(--canvas); margin-left: -6px; }
.pd-av:first-child { margin-left: 0; }
.pd-busy { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.pd-busy.is-on { background: color-mix(in srgb, var(--warn) 16%, var(--bg)); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.pd-mail { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pd-mail--err { color: var(--danger); }
.pd-mail--off a { color: var(--link); }
.pd-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--link); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.pd-link:hover { text-decoration: underline; }
.pd-icon { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer; }
.pd-icon:hover { color: var(--ink); border-color: var(--line-3); }
.pd-icon.is-on { color: var(--ink); }

/* ---------- seznam ---------- */
.pd-list, .pd-thread { min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.pd-list__top { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pd-row { display: flex; gap: 8px; align-items: center; }
.pd-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 11px; height: 30px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-1); color: var(--muted-2); }
.pd-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--ink); outline: none; }
.pd-new { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.pd-src { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: 999px; }
.pd-src__b { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: none;
  padding: 5px 6px; border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pd-src__b span { overflow: hidden; text-overflow: ellipsis; }
.pd-src__b em { font-style: normal; font-size: 10.5px; min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--brand-ink); }
.pd-src__b:hover { color: var(--ink); }
.pd-src__b.is-on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.pd-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-chip { border: 0; background: none; padding: 2px 8px; border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pd-chip span { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.pd-chip:hover { background: var(--bg-2); color: var(--ink); }
.pd-chip.is-on { background: var(--lime); color: var(--brand-ink); }
.pd-chip.is-on span { color: color-mix(in srgb, var(--brand-ink) 60%, transparent); }

.pd-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.pd-it { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.pd-it a { display: block; padding: 8px 12px; color: inherit; text-decoration: none; }
.pd-it a:hover { background: var(--bg-1); }
.pd-it.is-unread a { background: color-mix(in srgb, var(--lime) 10%, var(--bg)); }
.pd-it.is-sel a { background: color-mix(in srgb, var(--lime) 26%, var(--bg)); }
.pd-it.is-closed .pd-it__t { color: var(--muted); }
.pd-it__l1, .pd-it__l2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pd-it__l2 { margin-top: 2px; font-size: 12px; }
.pd-it__ic { flex: none; width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.pd-it__ic--chat { background: color-mix(in srgb, var(--ok) 14%, var(--bg)); color: var(--ok); }
.pd-it__ic--email { background: color-mix(in srgb, var(--info) 13%, var(--bg)); color: var(--info); }
.pd-it__ic--vzkaz { background: color-mix(in srgb, var(--warn) 18%, var(--bg)); color: color-mix(in srgb, var(--warn) 70%, var(--ink)); }
.pd-it__t { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-it.is-unread .pd-it__t { font-weight: 800; }
.pd-it__time { flex: none; font-size: 11px; color: var(--muted-2); }
.pd-it__sub { display: block; margin: 2px 0 0 26px; font-size: 12px; font-weight: 600; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-it__s { flex: 1; min-width: 0; margin-left: 26px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-it__as { display: block; margin: 2px 0 0 26px; font-size: 10.5px; color: var(--muted-2); }
.pd-new { flex: none; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--lime); color: var(--brand-ink); }
.pd-live { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; color: #fff; background: var(--ok); vertical-align: middle; }
.pd-test { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; color: var(--muted); background: var(--bg-2); vertical-align: middle; }
.pd-rs { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 650; }
.pd-rs--wait { color: color-mix(in srgb, var(--warn) 78%, var(--ink)); }
.pd-rs--ok { color: var(--ok); }
.pd-rs--done { color: var(--muted-2); }
.pd-empty { padding: 26px 16px; text-align: center; font-size: 12.5px; color: var(--muted); list-style: none; }
.pd-more { width: 100%; border: 0; background: none; padding: 10px; font: inherit; font-size: 12px; font-weight: 600; color: var(--link); cursor: pointer; }

/* ---------- konverzace ---------- */
.pd-blank { margin: auto; max-width: 380px; padding: 40px 20px; text-align: center; color: var(--muted-2); font-size: 13px; }
.pd-blank p { margin: 8px 0 0; }
.pd-blank b { color: var(--muted); }
.pd-th { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pd-th__head { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.pd-back { display: none; border: 0; background: none; color: var(--muted); padding: 4px; cursor: pointer; }
.pd-th__ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; margin-top: 1px; }
.pd-th__t { flex: 1; min-width: 0; }
.pd-th__t h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-th__t p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-th__contact a { color: var(--link); }
.pd-th__act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pd-th__act .btn { display: inline-flex; align-items: center; gap: 4px; }
.pd-th__msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-1); scrollbar-width: thin; }

.pd-lucy { background: var(--bg); border: 1px dashed var(--line-3); border-radius: var(--r-md); padding: 8px 12px; font-size: 12.5px; }
.pd-lucy summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.pd-lucy__in { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 280px; overflow-y: auto; }
.pd-lucy__m { line-height: 1.45; color: var(--ink-3); }
.pd-day { text-align: center; font-size: 11px; color: var(--muted-2); margin: 6px 0 2px; }
.pd-day span { background: var(--bg-1); padding: 0 8px; }
.pd-sys { align-self: center; max-width: 80%; text-align: center; font-size: 11.5px; color: var(--muted); background: var(--bg-2); padding: 3px 12px; border-radius: 999px; }
.pd-sys span { color: var(--muted-2); margin-left: 4px; }
.pd-sys--team { background: transparent; border: 1px dashed var(--line-3); }
.pd-m { max-width: min(78%, 640px); display: flex; flex-direction: column; gap: 3px; }
.pd-m--in { align-self: flex-start; }
.pd-m--out, .pd-m--note { align-self: flex-end; align-items: flex-end; }
.pd-m__meta { font-size: 11px; color: var(--muted-2); padding: 0 6px; }
.pd-m__b { font-size: 13.5px; line-height: 1.5; padding: 9px 13px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  overflow-wrap: anywhere; }
.pd-m--in .pd-m__b { border-bottom-left-radius: 5px; }
.pd-m--out .pd-m__b { background: color-mix(in srgb, var(--lime) 22%, var(--bg)); border-color: color-mix(in srgb, var(--lime) 40%, var(--line)); border-bottom-right-radius: 5px; }
.pd-m--note .pd-m__b { background: color-mix(in srgb, var(--warn) 9%, var(--bg)); border: 1px dashed color-mix(in srgb, var(--warn) 50%, var(--line)); border-bottom-right-radius: 5px; }
.pd-m__b p { margin: 0 0 .5em; }
.pd-m__b p:last-child, .pd-m__b ul:last-child, .pd-m__b ol:last-child { margin-bottom: 0; }
.pd-m__b ul, .pd-m__b ol { margin: .2em 0 .5em; padding-left: 1.3em; }
.pd-m__b blockquote { margin: .2em 0 .5em; padding-left: 10px; border-left: 3px solid var(--line-3); color: var(--muted); }
.pd-m__b code { font-size: 12px; background: var(--bg-2); padding: 1px 4px; border-radius: 4px; }
.pd-m__b mark { background: color-mix(in srgb, var(--lime) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.pd-m__b a { color: var(--link); }
.pd-check { list-style: none; padding-left: .2em !important; }
.pd-check li::before { content: '☐ '; }
.pd-check li.is-done::before { content: '☑ '; }
.pd-cut { margin-top: 6px; font-size: 11px; color: var(--muted-2); font-style: italic; }
.pd-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pd-file { display: inline-flex; align-items: center; gap: 5px; max-width: 220px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-1); font-size: 12px; color: var(--ink); text-decoration: none; }
.pd-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file--img { flex-direction: column; align-items: stretch; border-radius: 10px; padding: 4px; }
.pd-file--img img { width: 160px; max-height: 140px; object-fit: cover; border-radius: 7px; display: block; }
.pd-file--img span { font-size: 11px; padding: 2px 3px 0; }

/* ---------- psaní odpovědi (jako v Asaně) ---------- */
.pd-th__compose { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--bg); }
.pd-ro { margin: 0; font-size: 12.5px; color: var(--muted); }
.pd-cmp { border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); position: relative; }
.pd-cmp:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--focus-soft); }
.pd-cmp--note { background: color-mix(in srgb, var(--warn) 6%, var(--bg)); border-style: dashed; }
.pd-cmp__tabs { display: flex; align-items: center; gap: 2px; padding: 6px 8px 0; flex-wrap: wrap; }
.pd-cmp__tabs > button { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.pd-cmp__tabs > button.is-on { background: var(--bg-2); color: var(--ink); }
.pd-cmp__ch { margin-left: auto; font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.pd-cmp__ch button { border: 1px solid var(--line); background: var(--bg); font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 9px; border-radius: 999px; cursor: pointer; }
.pd-cmp__ch button.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pd-tools { display: flex; flex-wrap: wrap; gap: 1px; padding: 4px 8px 0; }
.pd-tools[hidden] { display: none; }
.pd-tools button { min-width: 28px; height: 26px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.pd-tools button:hover { background: var(--bg-2); color: var(--ink); }
.pd-mk { background: color-mix(in srgb, var(--lime) 55%, transparent); padding: 0 3px; border-radius: 3px; }
.pd-emoji { position: absolute; bottom: calc(100% + 6px); left: 8px; z-index: 5; display: grid; grid-template-columns: repeat(10, 30px); gap: 2px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.pd-emoji[hidden] { display: none; }
.pd-emoji button { width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; font-size: 17px; cursor: pointer; }
.pd-emoji button:hover { background: var(--bg-2); }
.pd-ed { min-height: 64px; max-height: 260px; overflow-y: auto; padding: 8px 12px; font-size: 13.5px; line-height: 1.5; outline: none; color: var(--ink); }
.pd-ed:empty::before { content: 'Napište odpověď…'; color: var(--muted-2); pointer-events: none; }
.pd-cmp--note .pd-ed:empty::before { content: 'Poznámka pro tým (zákaznice ji neuvidí)…'; }
.pd-ed p, .pd-ed div { margin: 0; }
.pd-ed ul, .pd-ed ol { margin: 2px 0; padding-left: 1.4em; }
.pd-ed blockquote { margin: 2px 0; padding-left: 10px; border-left: 3px solid var(--line-3); color: var(--muted); }
.pd-ed mark { background: color-mix(in srgb, var(--lime) 45%, transparent); color: inherit; }
.pd-ed code { font-size: 12px; background: var(--bg-2); padding: 1px 4px; border-radius: 4px; }
.pd-ed a { color: var(--link); }
.pd-cmp__foot { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px 12px; }
.pd-cmp__hint { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); }
/* Ukázkový chat v rohu administrace (ukazka.js) leží vpravo dole – tlačítko Odeslat musí být vedle něj. */
body:has(.ukz-roh) .pd-th__compose { padding-right: 84px; }

/* ---------- Nastavení → Živá podpora ---------- */
.pd-set { display: flex; flex-direction: column; gap: 16px; max-width: 860px; padding-bottom: 70px; }
.pd-set .pd-state { font-size: 12px; }
.pd-sw { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; cursor: pointer; font-size: 13.5px; line-height: 1.4; }
.pd-sw input { margin-top: 3px; }
.pd-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.pd-langs { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pd-days { display: flex; flex-direction: column; gap: 6px; }
.pd-day-row { display: grid; grid-template-columns: 120px 120px 12px 120px auto; gap: 8px; align-items: center; }
.pd-day-row .form__input { height: 32px; padding: 0 8px; }
.pd-day-row.is-off .form__input { opacity: .45; }
.pd-closed { display: flex; flex-direction: column; gap: 6px; }
.pd-closed__r { display: grid; grid-template-columns: 150px 12px 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pd-closed__r .form__input { height: 32px; padding: 0 8px; }
.pd-savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 14px; margin-top: -54px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); z-index: 3; }
.pd-savebar.is-dirty span { color: var(--ink); font-weight: 600; }

/* ---------- mobil ---------- */
@media (max-width: 860px) {
  .route[data-module="podpora"], .route[data-module="podpora_chat"], .route[data-module="podpora_email"], .route[data-module="podpora_vzkazy"] { padding: 10px 8px; }
  .pd-main { grid-template-columns: 1fr; }
  .pd--thread .pd-list { display: none; }
  .pd:not(.pd--thread) .pd-thread { display: none; }
  .pd-back { display: block; }
  .pd-state__why { display: none; }
  .pd-th__head { flex-wrap: wrap; }
  .pd-th__act { width: 100%; justify-content: flex-start; }
  .pd-m { max-width: 92%; }
  .pd-day-row { grid-template-columns: 1fr 100px 10px 100px; }
  .pd-day-row > .muted { display: none; }
  .pd-closed__r { grid-template-columns: 1fr 10px 1fr; }
  .pd-closed__r input[data-f="pozn"] { grid-column: 1 / -1; }
}

/* Podkategorie v menu (Živá podpora → Zprávy → Chat na webu…): odsazené pod kategorií, o kousek menší. */
.nav__item--sub { padding-left: 30px !important; font-size: 12.5px !important; }
.nav__item--sub svg { width: 14px !important; height: 14px !important; opacity: .8; }
html[data-nav="DENSE"] .nav__item--sub { padding-left: 28px !important; font-size: 12px !important; }

/* Přepínač jazyků vpravo nahoře (pokyn vlastníka 19. 11. 2026) */
.pd-langs { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.pd-langs__l { font-size: 11.5px; color: var(--muted); margin-right: 4px; }
.pd-lang { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none; }
.pd-lang input { margin: 0; width: 13px; height: 13px; accent-color: var(--ink); }
.pd-lang.is-on { color: var(--ink); background: var(--bg-2); }
.pd-dot--online { background: var(--ok); }
.pd-dot--zaneprazdneno { background: var(--warn); }
.pd-dot--mimo, .pd-dot--vypnuto { background: var(--muted-2); }
.pd-lng { flex: none; font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
