/* Tým a asistent mimo frontu (team.js): zprávy, fotky, statistiky, nahrávka schůzky, zakládání hlasem, režim Auto.
   Barvy jen z tokenů styles.css; prefix tm- kvůli kolizím. */
.tm-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brown { color: var(--brown); }
.tm-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.tm-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; color: var(--text2); text-align: center; }

/* MARK: Zprávy – dvoupanel: vlákna vlevo, konverzace vpravo; výška podle okna, stránka nescrolluje */
.tm-msgs { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 182px); min-height: 440px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tm-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--subtle); }
.tm-side-top { padding: 12px; border-bottom: 1px solid var(--border); }
.tm-side-top .seg button { font-size: 13px; padding: 5px 6px; }
.tm-side-err { padding: 8px 12px; font-size: 13px; color: var(--red); background: var(--redbg); }
.tm-side-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.tm-side-h { font-size: 11px; font-weight: 650; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.tm-side-note { padding: 12px 10px; font-size: 13px; color: var(--text2); }
.tm-thr { display: flex; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; }
.tm-thr:hover { background: var(--hover); }
.tm-thr.on { background: var(--sideon); }
.tm-thr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tm-thr-top { display: flex; align-items: baseline; gap: 8px; }
.tm-thr-top b { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-thr-top small { flex: none; font-size: 12px; color: var(--text2); }
.tm-thr.unread .tm-thr-top small { color: var(--blue); font-weight: 600; }
.tm-thr-sub { font-size: 12.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-thr-bot { display: flex; align-items: flex-start; gap: 8px; }
.tm-thr-prev { flex: 1; min-width: 0; font-size: 13px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tm-thr.unread .tm-thr-prev { color: var(--text); font-weight: 550; }
.tm-num { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 650; display: flex; align-items: center; justify-content: center; }

.tm-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tm-conv.panel { height: min(62vh, 620px); min-height: 360px; }
.tm-conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.tm-conv-title { flex: 1; min-width: 0; }
.tm-conv-name { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px; display: flex; flex-direction: column; gap: 6px; }
.tm-scroll > .tm-state { margin: auto 0; }
.tm-conv.panel .tm-scroll { padding: 8px 2px; }
.tm-day { align-self: center; font-size: 12px; font-weight: 600; color: var(--text2); padding: 8px 0; }
.tm-msg { display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; gap: 2px; max-width: min(72%, 620px); }
.tm-msg.mine { align-self: flex-end; align-items: flex-end; }
.tm-author { font-size: 12px; font-weight: 600; color: var(--text2); padding: 6px 4px 0; }
.tm-bubwrap { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.tm-msg.mine .tm-bubwrap { flex-direction: row-reverse; }
.tm-bub { padding: 8px 12px; border-radius: 14px; background: var(--subtle); border: 1px solid var(--border); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; text-align: left; min-width: 0; }
.tm-msg.mine .tm-bub { background: var(--blue); border-color: var(--blue); color: #fff; }
.tm-msg.pending .tm-bub { opacity: .6; }
.tm-acts { display: flex; gap: 2px; opacity: 0; flex: none; transition: opacity .1s; }
.tm-msg:hover .tm-acts, .tm-acts:focus-within { opacity: 1; }
.tm-acts button { width: 26px; height: 26px; border-radius: 7px; color: var(--text2); display: flex; align-items: center; justify-content: center; }
.tm-acts button:hover { background: var(--hover); color: var(--text); }
.tm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text2); padding: 0 4px; }
.tm-meta.red { color: var(--red); } .tm-meta.brown { color: var(--brown); }
.tm-ticks { display: inline-flex; vertical-align: -1px; margin-left: 3px; } .tm-ticks.read { color: var(--blue); }
.tm-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.tm-conv.panel .tm-compose { padding: 10px 0 0; }
.tm-compose textarea { flex: 1; resize: none; min-height: 38px; max-height: 130px; overflow-y: auto; padding: 8px 12px; }
.tm-send { width: 38px; height: 38px; padding: 0; justify-content: center; flex: none; }
@media (max-width: 900px) { .tm-msgs { grid-template-columns: 240px minmax(0, 1fr); } }

/* MARK: Fotky – mřížka náhledů a prohlížeč přes celou obrazovku */
.tm-photos .ctitle { flex-wrap: wrap; }
.tm-ph-err { margin: 0 0 10px; }
.tm-ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tm-ph-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--subtle); border: 1px solid var(--border); padding: 0; display: flex; align-items: center; justify-content: center; }
.tm-ph-tile:hover { border-color: var(--muted); }
.tm-ph-tile.on { box-shadow: 0 0 0 3px var(--green); border-color: var(--green); }
.tm-ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-ph-tile.uploading { flex-direction: column; gap: 6px; color: var(--text2); }
.tm-ph-tile.uploading small { font-size: 12px; }
.tm-ph-state { display: flex; align-items: center; justify-content: center; padding: 8px; font-size: 12px; color: var(--text2); text-align: center; }
.tm-ph-date { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; font-weight: 600; }
.tm-ph-check { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; display: flex; align-items: center; justify-content: center; }
.tm-ph-check.on { background: var(--green); border-color: var(--green); }
.tm-ph-empty { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; text-align: left; border: 1px dashed var(--border2); border-radius: var(--radius); background: var(--card); }
.tm-ph-empty:hover { border-color: var(--muted); }
.tm-ph-empty-i { width: 48px; height: 48px; border-radius: 50%; background: var(--subtle); display: flex; align-items: center; justify-content: center; flex: none; }
.tm-ph-empty b { display: block; font-size: 15px; } .tm-ph-empty small { color: var(--text2); font-size: 13px; }

/* Prohlížeč je tmavý v obou režimech: fotka vynikne, ovládání ustoupí. */
.tm-viewer { position: fixed; inset: 0; z-index: 40; background: #000; color: #fff; display: flex; flex-direction: column; }
.tm-viewer > .modal-bg { color: var(--text); }
.tm-vw-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex: none; }
.tm-vw-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.tm-vw-count { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 16px; background: rgba(255,255,255,.14); font-variant-numeric: tabular-nums; }
.tm-vw-x { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.tm-vw-x:hover { background: rgba(255,255,255,.26); }
.tm-vw-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 72px; }
.tm-vw-img { max-width: 100%; max-height: 100%; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; padding: 0; cursor: default; color: #fff; }
.tm-vw-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.tm-vw-img .tm-ph-state { color: #fff; }
.tm-vw-stage.zoom { overflow: auto; display: block; padding: 0; }
.tm-vw-stage.zoom .tm-vw-img { display: inline-block; width: auto; height: auto; max-width: none; max-height: none; }
.tm-vw-stage.zoom .tm-vw-img img { max-width: none; max-height: none; cursor: zoom-out; }
.tm-vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; }
.tm-vw-nav:hover { background: rgba(255,255,255,.26); }
.tm-vw-nav:disabled { opacity: .25; cursor: default; }
.tm-vw-nav.left { left: 12px; } .tm-vw-nav.right { right: 12px; }
.tm-vw-bottom { display: flex; align-items: flex-end; gap: 16px; padding: 12px 16px 16px; flex: none; flex-wrap: wrap; }
.tm-vw-info { flex: 1; min-width: 220px; }
.tm-vw-caption { font-size: 16px; font-weight: 550; overflow-wrap: anywhere; }
.tm-vw-meta { font-size: 13px; opacity: .7; }
.tm-vw-err { font-size: 13px; color: #ff8a97; margin-top: 4px; }
.tm-vw-acts { display: flex; gap: 8px; }
.tm-vw-acts button { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.tm-vw-acts button:hover { background: rgba(255,255,255,.26); }
.tm-vw-acts .danger { color: #ff8a97; }

/* MARK: Poznámka */
.tm-note-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 13px; }

/* MARK: Statistiky */
.tm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.tm-stat .kl { display: flex; align-items: center; gap: 6px; }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.tm-stats2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.tm-stats2 .card { margin: 0; }
.tm-stats-side { display: flex; flex-direction: column; gap: var(--gap); }
.tm-back { margin-bottom: 12px; }
@media (max-width: 1100px) { .tm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tm-stats2 { grid-template-columns: 1fr; } }

/* MARK: Nahrávka schůzky */
.tm-rec { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: 0; padding: 24px; }
.tm-rec-clock { font-size: 48px; font-weight: 700; letter-spacing: -1px; text-align: center; font-variant-numeric: tabular-nums; }
.tm-rec-clock.idle { color: var(--text2); }
.tm-rec-hint { text-align: center; color: var(--text2); } .tm-rec-hint.red { color: var(--red); }
.tm-rec-go { justify-content: center; padding: 14px; font-size: 16px; }
.tm-rec .savebar { margin-top: 0; }
.tm-done { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tm-done-i { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.tm-res { display: grid; gap: var(--gap); } .tm-res.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-res .card { margin: 0; }
.tm-res + .card, .tm-trans { margin-top: var(--gap); margin-bottom: 0; }
.tm-points { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.tm-sug { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tm-sug:first-of-type { border-top: 0; }
.tm-sug-main { flex: 1; min-width: 220px; }
.tm-sug-title { font-weight: 600; } .tm-sug-title.off { text-decoration: line-through; color: var(--text2); }
.tm-sug-when { font-size: 13px; }
.tm-sug-state { font-size: 13px; font-weight: 600; }
.tm-trans summary { cursor: pointer; font-weight: 600; }
.tm-trans > div { margin-top: 8px; white-space: pre-wrap; font-size: 13.5px; user-select: text; }
@media (max-width: 800px) { .tm-res.two { grid-template-columns: 1fr; } }

/* MARK: Zakládání hlasem */
.tm-vsay { padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 550; white-space: pre-wrap;
  background: color-mix(in srgb, var(--purple) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--purple) 25%, var(--border)); margin-bottom: 12px; }
.tm-vgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.tm-vgrid .card { margin: 0; }
.tm-vrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 0; }
.tm-vrow > span { color: var(--text2); font-size: 13px; }
.tm-vrow > b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tm-vconf { font-size: 13px; font-weight: 600; margin-top: 4px; }
.tm-vmat { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; margin-top: 6px; background: color-mix(in srgb, var(--mc) 9%, var(--card)); }
.tm-vmat > span:last-child { margin-left: auto; color: var(--text2); font-weight: 600; font-size: 13.5px; }
.tm-vinput { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tm-vinput > .btn { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border2)); white-space: nowrap; }
.tm-vinput > .btn.red { color: #fff; }
.tm-vtype { flex: 1; min-width: 260px; display: flex; gap: 8px; }
@media (max-width: 800px) { .tm-vgrid { grid-template-columns: 1fr; } }

/* MARK: Návrh z diktátu */
.tm-info { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); color: var(--text2); }
.tm-info:first-child { border-top: 0; padding-top: 0; } .tm-info:last-child { padding-bottom: 0; }
.tm-info b { display: block; color: var(--text); font-weight: 600; } .tm-info span { font-size: 13px; }
.tm-cand { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-top: 6px; text-align: left; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
.tm-cand:hover { border-color: var(--muted); }
.tm-cand.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.tm-cand-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border2); display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.tm-cand.on .tm-cand-dot { background: var(--green); border-color: var(--green); }
.tm-cand-main { flex: 1; min-width: 0; }
.tm-cand-main b { display: block; font-weight: 600; } .tm-cand-main small { color: var(--text2); font-size: 13px; }

/* MARK: Režim Auto – vždy tmavý (tokeny přepsané jen tady), čitelné z dálky */
.tm-auto { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; padding: 16px 28px 28px; overflow: auto; color: #fff; background: #111113;
  --card: #1c1c1e; --bg: #111113; --text: #fff; --text2: #a1a1a6; --muted: #8e8e93; --border: #2c2c2e; --border2: #3a3a3c; --hover: #232327; --segment: #2c2c2e; --subtle: #1c1c1e; color-scheme: dark; }
.tm-auto-bar { display: flex; align-items: center; justify-content: space-between; flex: none; margin-bottom: 24px; }
.tm-auto-name { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.tm-auto-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 40px; align-items: center; max-width: 1200px; width: 100%; margin: 0 auto; }
.tm-auto-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tm-auto-card { padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); }
.tm-auto-q { color: var(--text2); font-size: 15px; margin-bottom: 10px; }
.tm-auto-a { font-size: 24px; font-weight: 600; line-height: 1.35; white-space: pre-wrap; }
.tm-auto-card.draft { border: 1.5px solid var(--brown); font-size: 16px; color: #d1d1d6; display: flex; flex-direction: column; gap: 6px; }
.tm-auto-kicker { font-size: 12px; font-weight: 700; letter-spacing: .5px; color: #e0a35c; }
.tm-auto-big { font-size: 18px; font-weight: 600; color: #fff; }
.tm-auto-miss { font-size: 15px; font-weight: 600; color: #ff6b7d; }
.tm-auto-yes { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.tm-auto-yes .btn { justify-content: center; min-height: 60px; font-size: 18px; }
.tm-auto-call { justify-content: center; min-height: 60px; font-size: 18px; text-decoration: none; }
.tm-auto-right { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.tm-auto-rec { width: 200px; height: 200px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tm-auto-rec:hover { filter: brightness(1.08); }
.tm-auto-rec:disabled { opacity: .7; cursor: default; }
.tm-auto-rec.on { animation: tm-pulse 1.4s ease-in-out infinite; }
.tm-auto-rec .stop { width: 56px; height: 56px; border-radius: 10px; }
.tm-auto-rec .spin { width: 40px; height: 40px; border-width: 3px; }
@keyframes tm-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 50% { box-shadow: 0 0 0 26px transparent; } }
.tm-auto-state { font-size: 24px; font-weight: 700; }
.tm-auto-hint { font-size: 15px; color: var(--text2); }
@media (max-width: 900px) { .tm-auto-body { grid-template-columns: 1fr; gap: 24px; } }
@media (prefers-reduced-motion: reduce) { .tm-auto-rec.on { animation: none; outline: 6px solid color-mix(in srgb, var(--red) 45%, transparent); } }
/* Kdo je online */
.pdot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border2); }
.pdot.on, .pline.on .pdot { background: var(--green); }
.pline { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pline.on { color: var(--green); }
.pline b { font-weight: 600; color: var(--text); }
.tm-seen { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; font-size: 12.5px; color: var(--text2); }
.tm-av { position: relative; }
.tm-av .pdot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; box-shadow: 0 0 0 2px var(--card); }
