/* ==========================================================================
   Design tokeny (v218 redesign 2026-09: grafit + teal + amber, pryc od fialove)
   - teal (--accent)  = primarni akce, mail, aktivni stavy
   - amber (--accent-2) = CC / AI vrstva (chat, drafty, in_progress)
   - grafitova cerna se zelenomodrym nadechem misto navy-fialove
   Vsechny barvy v souboru jsou bud tokeny, nebo odvozeniny z teto palety.
   ========================================================================== */
:root {
  --bg: #0a0f14;              /* zakladni pozadi */
  --bg-raise: #101820;        /* vyssi vrstva / panely */
  --ink: #e9eef2;             /* hlavni text */
  --ink-rgb: 233,238,242;
  --accent: #2dd4bf;          /* teal - primarni akcent */
  --accent-rgb: 45,212,191;
  --accent-deep: #0d9488;     /* tmavsi teal (gradienty, pressed) */
  --accent-soft: #8ae7d6;     /* svetly teal (odkazy, popisky) */
  --accent-soft-rgb: 138,231,214;
  --accent-2: #f4a843;        /* amber - CC / AI akcent */
  --accent2-rgb: 244,168,67;
  --accent2-deep: #d98324;
  --accent2-soft: #f7cf9b;
  --on-accent: #04201c;       /* tmavy text na teal plochach */
  --danger: #ff5b6e;
  --ok: #4ade80;
}

/* ===== Reset + base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  /* Bytelny shell: dokument SAM nescrolluje (zadny iOS rubber-band bounce).
     Scrolluje jen vnitrni .content. Viz #view-app / .content nize. */
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  accent-color: var(--accent);
}
input, textarea, select { touch-action: manipulation; }
/* Tenky nenapadny scrollbar (desktop) */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ===== Staticke pozadi (v218: klidny grafit, jemna teal zare misto orbu) ===== */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 90% at 15% -10%, #12242a 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, #10181f 0%, transparent 60%),
    var(--bg);
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(110px);
  /* Staticke, bez animace (bytelnost 2026-09-02). v218: opacity srazena na
     jemny nadech - premiovy klid misto barevnych orbu. */
}
.orb-1 { width: 460px; height: 460px; background: var(--accent); top: -180px; left: -160px; opacity: 0.10; }
.orb-2 { width: 380px; height: 380px; background: var(--accent-2); top: 34%; right: -180px; opacity: 0.05; }
.orb-3 { width: 340px; height: 340px; background: var(--accent-deep); bottom: -180px; left: 28%; opacity: 0.08; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.08); }
  66%      { transform: translate(-30px,30px) scale(0.95); }
}

/* ===== Glass (v218: tmave tonovane sklo misto mlecne bileho) ===== */
.glass {
  background: rgba(16,23,28,0.78);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.40);
}

/* ===== View layouts ===== */
/* Kazdy view je fixni na cely viewport; scrolluje jen vnitrni oblast. */
.view { position: fixed; inset: 0; width: 100%; }
#view-app { display: flex; flex-direction: column; }
.view-center { display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.hidden { display: none !important; }

/* ===== Login card ===== */
.card-login {
  width: 100%;
  max-width: 380px;
  padding: 32px 26px;
}
.pin-card { padding: 28px 24px; }
.pin-card .brand { margin-bottom: 16px; }
.pin-card h1 { font-size: 22px; }
.pin-dots {
  display: flex; justify-content: center; gap: 14px;
  margin: 14px 0 22px;
}
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.25);
  transition: all 0.18s ease;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb),0.55);
  transform: scale(1.18);
}
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pin-key {
  font-size: 26px; font-weight: 500;
  height: 64px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}
.pin-key:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}
.pin-key.pressed,
.pin-key:active {
  background: rgba(var(--accent-rgb),0.35);
  border-color: rgba(var(--accent-rgb),0.6);
  transform: scale(0.93);
  box-shadow: 0 0 18px rgba(var(--accent-rgb),0.35);
}
.pin-key-action {
  font-size: 22px;
  background: rgba(255,255,255,0.04);
  opacity: 0.85;
}
.pin-card .error-msg { margin-top: 16px; text-align: center; color: #ff8b8b; min-height: 18px; }
.pin-shake { animation: pinShake 0.32s ease-in-out; }
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@media (max-width: 360px) {
  .pin-key { height: 56px; font-size: 22px; }
  .pin-keypad { gap: 8px; }
}
.brand { text-align: center; margin-bottom: 22px; }
.brand-logo {
  font-size: 32px; width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb),0.4);
}
.brand h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.muted { color: rgba(var(--ink-rgb),0.55); font-size: 13px; }

/* ===== Forms ===== */
.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(var(--ink-rgb),0.55);
  margin-bottom: 6px;
}
.field input, .field textarea, .acct-select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  font: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.field input:focus, .field textarea:focus, .acct-select:focus {
  border-color: rgba(var(--accent-rgb),0.6);
  background: rgba(255,255,255,0.10);
}
.field textarea { resize: vertical; min-height: 140px; font-family: inherit; }
.field-grow { flex: 1; min-height: 180px; display: flex; flex-direction: column; }
.field-grow textarea { flex: 1; }

/* ===== Buttons ===== */
.btn {
  border: 0; cursor: pointer;
  padding: 12px 18px;
  border-radius: 12px;
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.08s, opacity 0.15s, background 0.15s;
  min-height: 44px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1cbfa9);
  color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(var(--accent-rgb),0.30);
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-ghost:hover { background: rgba(255,255,255,0.10); }
.btn-block { width: 100%; margin-top: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ===== Topbar ===== */
.topbar {
  flex: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  margin: 8px;
  border-radius: 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar h2 { margin: 0 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.iconbtn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  width: 42px; height: 42px;
  border-radius: 12px;
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
  /* BUG FIX (2026-06-05/06, vlákno t_2adb19866361591e):
     - Robot ikona zůstává UVNITŘ rámečku (border+bg) — žádné odsazení.
     - Badge (číslo) DROBNĚ přečnívá PŘES rámeček ven do horního pravého rohu.
     - Klíčové: overflow:visible (s !important kvůli pozdějšímu ripple bloku
       který nastavoval overflow:hidden a badge tak řezal). */
  position: relative;
  overflow: visible !important;
}
.iconbtn:hover { background: rgba(255,255,255,0.10); }
.iconbtn:active { transform: scale(0.92); background: rgba(var(--accent-rgb),0.18); }
.iconbtn[hidden] { display: none; }
/* Badge uvnitř iconbtn → drobně leze přes pravý/horní okraj rámečku ven.
   Tomáš (msg 632): „v rámečku jen robot a číslo v kolečku drobně leze PŘES
   rámeček ven, vypadá to lépe a vejde se to tam." Klíč:
   - top/right negativní (cca 1/3 výšky badge venku za hranou)
   - kontrastní outline+stín aby vypadal jako „nálepka přilepená na rámeček"
   - z-index nad iconbtn obsah */
.iconbtn .badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  font-size: 10px; line-height: 14px;
  font-weight: 700;
  border-radius: 999px;
  /* dvojitý ring: vnitřní tmavý (vystoupne z topbar), vnější jemný highlight */
  box-shadow:
    0 0 0 1.5px rgba(13,19,23,0.95),
    0 1px 3px rgba(255,91,140,0.45);
  pointer-events: none;
  box-sizing: border-box;
  z-index: 2;
}
.trust-pill {
  background: linear-gradient(135deg, rgba(255,170,80,0.30), rgba(255,120,40,0.20));
  border: 1px solid rgba(255,170,80,0.55);
  color: #ffd9a8;
  padding: 6px 10px;
  border-radius: 16px;
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: pulse-attn 2.2s ease-in-out infinite;
}
.trust-pill:hover { filter: brightness(1.12); }

.acct-select {
  padding: 8px 10px;
  width: auto; min-width: 0;
  font-size: 13px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.acct-select option { background: #14262c; color: #fff; }

/* ===== Content ===== */
.content {
  /* Jediny scroller v appce. min-height:0 je nutne, aby flex ditě mohlo scrollovat. */
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 0 12px 20px;
}
.status-line { padding: 8px 6px 14px; font-size: 13px; color: rgba(var(--ink-rgb),0.55); }

/* ===== List ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.email-item {
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}
.email-item:hover { background: rgba(255,255,255,0.09); }
.email-item:active { transform: scale(0.99); }
.email-item.unread { background: rgba(var(--accent-rgb),0.10); border-color: rgba(var(--accent-rgb),0.30); }
.email-item.unread .ei-from { color: #fff; }
.email-item.unread::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.email-item .ei-row1 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.email-item .ei-from { font-weight: 600; font-size: 14px; color: rgba(var(--ink-rgb),0.92); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display:flex; align-items:center; gap:6px; }
.acct-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; border-radius:50%;
  font-size:10px; font-weight:800; color:#fff;
  flex-shrink:0; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.acct-filter { display:inline-flex; align-items:center; }
.acct-filter .af-cycle {
  width:28px; height:28px; border-radius:50%;
  border:1.5px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.92);
  cursor:pointer; padding:0;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.0), inset 0 1px 2px rgba(255,255,255,0.4);
}
.acct-filter .af-cycle:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18), inset 0 1px 2px rgba(255,255,255,0.4);
}
.acct-filter .af-cycle:active { transform: scale(0.92); }
.acct-filter .af-cycle.flip {
  animation: af-flip 0.32s ease;
}
@keyframes af-flip {
  0%   { transform: rotateY(0deg) scale(1); }
  50%  { transform: rotateY(180deg) scale(0.92); }
  100% { transform: rotateY(360deg) scale(1); }
}

/* ===== Cool app loader ===== */
.app-loader {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  min-height: 55vh; gap: 18px;
  animation: fadeInUp 0.35s ease-out;
}
.app-loader-ring {
  position: relative;
  width: 84px; height: 84px;
}
.app-loader-ring::before,
.app-loader-ring::after,
.app-loader-ring .alr-core {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
}
.app-loader-ring::before {
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: alr-spin 1.4s cubic-bezier(0.65,0.05,0.36,1) infinite;
}
.app-loader-ring::after {
  inset: 10px;
  border-bottom-color: var(--accent-2);
  border-left-color: var(--accent-2);
  animation: alr-spin 1.8s cubic-bezier(0.65,0.05,0.36,1) infinite reverse;
}
.app-loader-ring .alr-core {
  inset: 22px;
  border-top-color: var(--accent-soft);
  border-right-color: var(--accent-soft);
  animation: alr-spin 1.1s cubic-bezier(0.65,0.05,0.36,1) infinite;
}
.app-loader-ring .alr-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent) 60%, var(--accent-deep) 100%);
  box-shadow: 0 0 18px rgba(var(--accent-rgb),0.7), 0 0 36px rgba(var(--accent2-rgb),0.45);
  animation: alr-pulse 1.6s ease-in-out infinite;
}
.app-loader-text {
  font-size: 13px; letter-spacing: 1.5px;
  color: rgba(var(--ink-rgb),0.55);
  text-transform: uppercase;
  display: inline-flex; gap: 4px;
}
.app-loader-text span {
  display: inline-block;
  animation: alr-bounce 1.4s ease-in-out infinite;
}
.app-loader-text span:nth-child(2) { animation-delay: 0.1s; }
.app-loader-text span:nth-child(3) { animation-delay: 0.2s; }
.app-loader-text span:nth-child(4) { animation-delay: 0.3s; }
.app-loader-text span:nth-child(5) { animation-delay: 0.4s; }
.app-loader-text span:nth-child(6) { animation-delay: 0.5s; }
.app-loader-text span:nth-child(7) { animation-delay: 0.6s; }
@keyframes alr-spin { to { transform: rotate(360deg); } }
@keyframes alr-pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%      { transform: scale(1.6); opacity: 0.55; }
}
@keyframes alr-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.45; }
  50%      { transform: translateY(-3px); opacity: 1;    }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.email-item .ei-date { font-size: 12px; color: rgba(var(--ink-rgb),0.50); flex-shrink: 0; }
.email-item .ei-subject {
  font-size: 14px; color: rgba(var(--ink-rgb),0.80);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.email-item .ei-summary {
  font-size: 11.5px; color: rgba(var(--ink-rgb),0.50);
  font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}

/* ===== Email detail body (HTML) ===== */
.email-summary {
  background: rgba(255,170,80,0.10);
  border: 1px solid rgba(255,170,80,0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  color: rgba(255,217,168,0.95);
}
/* "Co s tím?" výjezdní box */
.email-action {
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}
.email-action .act-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.email-action .act-chip { font-weight: 600; font-size: 13px; }
.email-action .act-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
}
.email-action .act-caret { margin-left: auto; opacity: 0.7; font-size: 12px; }
.email-action .act-body {
  padding: 0 12px 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.88);
}
.email-action.act-solve   { border-color: rgba(70,200,120,0.40); background: rgba(70,200,120,0.08); }
.email-action.act-confirm { border-color: rgba(240,200,70,0.45); background: rgba(240,200,70,0.09); }
.email-action.act-propose { border-color: rgba(var(--accent-rgb),0.40); background: rgba(var(--accent-rgb),0.08); }

/* Nálepka „Předáno Martinovi" v seznamu (píše se až po SMTP 250) */
.fwd-label {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(120,200,140,0.18);
  color: rgba(170,230,185,0.95);
  border: 1px solid rgba(120,200,140,0.35);
  vertical-align: middle;
}

.email-body-html {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-x: auto;
}
.email-body-html p { margin: 0 0 10px; }
.email-body-html p:last-child { margin-bottom: 0; }
.email-body-html a { color: #58d5c0; }
.email-body-html img { max-width: 100%; height: auto; }
.email-body-html blockquote {
  border-left: 3px solid rgba(255,255,255,0.15);
  padding-left: 10px;
  color: rgba(var(--ink-rgb),0.55);
  margin: 8px 0;
  font-size: 13px;
}
.email-body-html table { border-collapse: collapse; max-width: 100%; }
.email-body-html td, .email-body-html th { padding: 4px 8px; }
.email-body-html pre { background: rgba(0,0,0,0.30); padding: 8px 10px; border-radius: 6px; overflow-x: auto; }
.email-body-html .raw-text {
  background: transparent; padding: 0;
  white-space: pre-wrap; word-wrap: break-word;
  font-family: inherit; font-size: inherit;
}
.raw-text {
  white-space: pre-wrap; word-wrap: break-word;
  font-family: inherit; font-size: 14px; line-height: 1.55;
  color: rgba(var(--ink-rgb),0.92);
}

/* ===== Autocomplete kontakty ===== */
.field { position: relative; }
.ac-dropdown {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: rgba(20, 24, 55, 0.98);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  margin-top: 4px;
  z-index: 200;
  max-height: 240px; overflow-y: auto;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.ac-dropdown.show { display: block; }
.ac-item {
  padding: 8px 12px;
  display: flex; align-items: baseline; gap: 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover { background: rgba(var(--accent-rgb),0.15); }
.ac-name { font-size: 13px; font-weight: 600; }
.ac-email { font-size: 12px; color: rgba(var(--ink-rgb),0.55); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { font-size: 10px; color: rgba(var(--ink-rgb),0.40); white-space: nowrap; }

.ccbcc-toggle {
  display: flex; gap: 10px;
  margin: -6px 0 10px;
}
.ccbcc-toggle.hidden { display: none; }
.link-btn {
  background: transparent;
  border: 0; padding: 4px 0;
  color: rgba(var(--accent-rgb),0.85);
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent-soft); text-decoration: underline; }
.link-btn.hidden { display: none; }

/* ===== Proposed time karta ===== */
.proposed-times {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 12px;
}
.pt-card {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.10), rgba(var(--accent-rgb),0.10));
  border: 1px solid rgba(var(--accent-rgb),0.40);
  border-radius: 12px;
  padding: 12px 14px;
}
.pt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pt-icon { font-size: 26px; flex-shrink: 0; }
.pt-info { flex: 1; min-width: 0; }
.pt-when { font-size: 14px; color: #cdf0e9; }
.pt-raw { font-size: 11px; font-style: italic; margin-top: 2px; }
.pt-cal-link {
  font-size: 11px; color: var(--accent-soft);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid rgba(var(--accent-rgb),0.4);
  border-radius: 8px;
  white-space: nowrap;
}
.pt-cal-link:hover { background: rgba(var(--accent-rgb),0.15); }

/* ===== PLÁNOVAČ TERMÍNŮ ===== */
.planner-toggle-row { margin: 8px 0; }
.cmp-attach-row { margin: 6px 0 4px; display: flex; align-items: center; gap: 8px; }
.cmp-attach-row.hidden { display: none; }
/* SIDEPANEL */
.planner-sidepanel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 100vw;
  background: rgba(15, 18, 38, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255,255,255,0.12);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 1100;
  display: flex; flex-direction: column;
}
.planner-sidepanel.open { transform: translateX(0); }
.ps-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: max(16px, env(safe-area-inset-top, 16px)) 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.ps-head h3 { margin: 0; font-size: 17px; }
.ps-head .iconbtn {
  width: 44px; height: 44px;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-right: -8px;
}
.ps-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  -webkit-overflow-scrolling: touch;
}
/* "Vybráno:" panel - sticky pod ps-head (přesunut z bottom, aby se neskákalo s mobilní klávesnicí) */
.planner-footer {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(var(--accent-rgb),0.35);
  background: rgba(13,19,23,0.98);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
.planner-footer.hidden { display: none; }
.pf-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px;
}
.pf-info strong { color: #fff; flex: 1; }
.pf-label { color: rgba(var(--ink-rgb),0.6); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.pf-options {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 13px;
}
.pf-check {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  color: rgba(var(--ink-rgb),0.85);
}
.pf-check input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.pf-recipient { display: flex; position: relative; }
.pf-recipient.hidden { display: none; }
/* Autocomplete dropdown v planner footer - dolů (footer je teď pod ps-head) */
#pf-recipient-ac.ac-dropdown {
  top: 100%; bottom: auto;
  margin-top: 4px; margin-bottom: 0;
}
.pf-recipient input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
/* Chips - vybraní účastníci pod inputem */
.pf-chips {
  display: flex; flex-wrap: wrap;
  gap: 2px 0;
  max-height: 96px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: -2px;
}
.pf-chips.hidden { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(var(--accent-rgb),0.20);
  border: 1px solid rgba(var(--accent-rgb),0.40);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 13px;
  margin: 2px 4px 2px 0;
  color: #fff;
  max-width: 100%;
}
.chip .chip-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 220px;
}
.chip .chip-x {
  cursor: pointer;
  opacity: 0.7;
  font-weight: 700;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
}
.chip .chip-x:hover { opacity: 1; color: #ff6b6b; }
.pf-field { display: flex; }
.pf-field.hidden { display: none; }
.pf-field input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}
.pf-field input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb),0.55);
  background: rgba(255,255,255,0.09);
}
#pf-title:invalid { border-color: rgba(255,99,99,0.45); }
.pf-field input.shake { animation: pinShake 0.32s ease-in-out; border-color: rgba(255,99,99,0.65); }
.pf-duration {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 3px 6px;
}
.pf-radio {
  display: inline-flex; align-items: center; gap: 3px;
  cursor: pointer; user-select: none;
  color: rgba(var(--ink-rgb),0.78);
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 5px;
}
.pf-radio input[type="radio"] { accent-color: var(--accent); margin: 0; width: 12px; height: 12px; cursor: pointer; }
.pf-radio:has(input:checked) { background: rgba(var(--accent-rgb),0.18); color: #fff; }
.pf-dur-unit { font-size: 11px; padding-right: 2px; }
.pf-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pf-actions .btn { flex: 1; min-width: 0; }
.pf-actions .btn.hidden { display: none; }
#pf-clear {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(var(--ink-rgb),0.7);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
#pf-clear:hover { color: #fff; background: rgba(255,255,255,0.08); }
.pl-jump {
  margin-bottom: 10px;
}
.pl-jump input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.pl-allday {
  margin: 8px 0 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.pl-allday-row {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.pl-allday-row.pl-source-google { border-left: 3px solid #37bfb5; }
.pl-allday-row.pl-source-m365 { border-left: 3px solid #f993da; }
@media (max-width: 480px) {
  .planner-sidepanel { width: 100vw; }
}

.planner {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}
.planner-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
  font-size: 14px;
}
.planner-grid {
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  user-select: none;
}
.planner-loading, .planner-error {
  padding: 16px; text-align: center; opacity: 0.7;
}
.pl-nav {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.18); border-radius: 10px;
}
.pl-nav-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer;
  font-size: 16px; font-family: inherit;
  transition: all 0.15s;
}
.pl-nav-btn:hover:not(:disabled) { background: rgba(var(--accent-rgb),0.25); border-color: rgba(var(--accent-rgb),0.45); }
.pl-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pl-nav-info { flex: 1; text-align: center; }
.pl-nav-day { font-size: 16px; font-weight: 600; }
.pl-nav-free { font-size: 12px; margin-top: 2px; }
.pl-day-slots {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px;
}
.pl-day-pager { display: none; } /* nepoužíváme - místo toho date input + šipky */
.pl-col-head { display: none; }
.pl-slots {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 360px; overflow-y: auto;
}
.pl-slot {
  font-size: 13px; padding: 8px 12px;
  border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
  text-align: left;
}
.pl-slot.pl-free {
  background: rgba(74, 222, 128, 0.18); color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
  text-align: center;
  font-weight: 500;
}
.pl-slot.pl-free:hover {
  background: rgba(74, 222, 128, 0.35); color: #fff;
  transform: translateX(2px);
}
.pl-slot.pl-free.pl-picked {
  background: rgba(var(--accent-rgb),0.45); color: #fff;
  border-color: rgba(var(--accent-rgb),0.7);
  font-weight: 600;
}
.pl-slot.pl-busy {
  background: rgba(255, 255, 255, 0.04); color: rgba(255,255,255,0.6);
  cursor: not-allowed;
  display: flex; gap: 10px; align-items: center;
}
.pl-slot-time { font-size: 12px; opacity: 0.6; min-width: 44px; flex-shrink: 0; }
.pl-slot-title { font-size: 13px; line-height: 1.25; flex: 1; }
.pl-slot-loc { font-size: 11px; flex-shrink: 0; opacity: 0.65; }
.pl-slot.pl-source-google.pl-busy { border-left: 3px solid #37bfb5; }
.pl-slot.pl-source-m365.pl-busy { border-left: 3px solid #f993da; }
.planner-hint {
  font-size: 11px; margin-top: 8px;
}
.pl-slot-actions {
  margin-top: 12px; padding: 12px;
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid rgba(var(--accent-rgb),0.25);
  border-radius: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.pl-actions-info { flex-basis: 100%; font-size: 14px; }
.btn-small { padding: 6px 12px; font-size: 13px; }

.pt-slots {
  display: flex; gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.pt-slot {
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(var(--ink-rgb),0.65);
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit; font-size: 12px;
  cursor: pointer;
  min-width: 44px;
  transition: background 0.12s, transform 0.08s;
}
.pt-slot:hover {
  background: rgba(var(--accent-rgb),0.18);
  color: #fff;
  border-color: rgba(var(--accent-rgb),0.45);
}
.pt-slot:active { transform: scale(0.96); }
.pt-slot.proposed {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.40), rgba(var(--accent2-rgb),0.30));
  border-color: rgba(var(--accent-rgb),0.75);
  color: #fff;
  font-weight: 700;
}
.pt-slot.overlap-free {
  background: rgba(120,255,180,0.10);
  border-color: rgba(120,255,180,0.30);
  color: #d8ffea;
}
.pt-slot.overlap-partial {
  background: rgba(255,170,80,0.15);
  border-color: rgba(255,170,80,0.40);
  color: #ffd9a8;
}
.pt-slot.overlap-full {
  background: rgba(255,91,140,0.18);
  border-color: rgba(255,91,140,0.40);
  color: #ffb8c8;
  text-decoration: line-through;
  opacity: 0.7;
}
.pt-slot.proposed.overlap-full { text-decoration: none; opacity: 1; }
.pt-status { font-size: 11px; margin-top: 4px; }
.pt-hint { font-size: 11px; margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pt-legend {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 2px;
}
.pt-legend.free { background: rgba(120,255,180,0.40); border: 1px solid rgba(120,255,180,0.55); }
.pt-legend.busy { background: rgba(255,91,140,0.40); border: 1px solid rgba(255,91,140,0.55); }
.pt-legend.partial { background: rgba(255,170,80,0.40); border: 1px solid rgba(255,170,80,0.55); }

/* ===== Compose attachments chips ===== */
.cmp-att-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0;
}
.cmp-att-chips.hidden { display: none; }
.cmp-att-head {
  flex-basis: 100%;
  font-size: 12px; color: rgba(var(--ink-rgb),0.55);
  margin-bottom: 2px;
}
.cmp-att-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  max-width: 100%;
}
.cmp-att-icon { font-size: 14px; }
.cmp-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.cmp-att-size { color: rgba(var(--ink-rgb),0.45); font-size: 11px; }
.cmp-att-remove {
  background: transparent; border: 0; color: rgba(var(--ink-rgb),0.50);
  cursor: pointer; padding: 0 2px; font-size: 14px;
}
.cmp-att-remove:hover { color: #ff8da8; }

/* ===== Attachments ===== */
.attachments {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px;
}
.att-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: inherit; text-decoration: none;
  transition: background 0.15s;
}
.att-card:hover { background: rgba(255,255,255,0.10); }
.att-card:active { transform: scale(0.99); }
.att-card-row { flex-wrap: nowrap; }
.att-icon { font-size: 24px; flex-shrink: 0; width: 28px; text-align: center; }
.att-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.att-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 11px; color: rgba(var(--ink-rgb),0.55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-action { font-size: 16px; color: rgba(var(--ink-rgb),0.55); flex-shrink: 0; }
.att-link {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  color: inherit; text-decoration: none;
  cursor: pointer;
}
.att-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  margin-left: 6px;
}
.btn-drive-save {
  min-height: 32px; min-width: 32px; padding: 4px 8px;
  font-size: 14px; line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Attachment viewer modal (lightbox - hl. pro PWA standalone) ===== */
.att-viewer-panel {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: #0a0e12;
  z-index: 10001;
}
.att-viewer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0));
  background: rgba(0,0,0,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.att-viewer-title {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.att-viewer-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.att-viewer-close {
  /* PWA fix (vlákno t_83b03ce762efa777 msg 507): close býval moc malý
     a iframe s PDF občas překryl klik. Zvětšeno na Apple touch target
     (48×48), výrazná barva, vždy nad iframe (z-index). */
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  color: #ffffff;
  width: 48px; height: 48px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.att-viewer-close:hover, .att-viewer-close:active { background: rgba(255,255,255,0.32); }
.att-viewer-head { position: relative; z-index: 2; }
.att-viewer-body {
  flex: 1; min-height: 0;
  display: flex; align-items: stretch; justify-content: center;
  overflow: auto;
  background: #0a0e12;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.att-viewer-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  margin: auto;
  touch-action: pinch-zoom;
}
.att-viewer-frame {
  width: 100%; height: 100%;
  border: 0;
  background: #fff;
}
.att-viewer-fallback {
  margin: auto;
  text-align: center;
  padding: 24px;
  color: var(--ink);
}
.att-viewer-fallback .btn { margin-top: 12px; display: inline-block; }
body.att-viewer-open { overflow: hidden; }

/* Drive picker - hierarchický navigator (breadcrumb + folders + files + actions) */
.drive-folder-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.drive-folder-row {
  padding: 10px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
  transition: background 0.15s;
}
.drive-row-folder { cursor: pointer; }
.drive-row-folder:hover { background: rgba(255,255,255,0.06); }
.drive-row-file {
  opacity: 0.5;
  cursor: default;
  /* Files = jen orientace, NON-clickable */
}
.drive-row-file:hover { background: transparent; }
.dp-folder-icon { font-size: 20px; flex-shrink: 0; }
.dp-folder-meta { flex: 1; min-width: 0; }
.dp-folder-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-folder-date { font-size: 11px; }
.dp-folder-arrow { font-size: 18px; flex-shrink: 0; opacity: 0.55; }

/* Section headers v Drive picker - "Můj Disk" / "Sdíleno se mnou" */
.dp-section-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(var(--ink-rgb),0.45);
  padding: 12px 14px 6px;
  font-weight: 600;
}
.dp-section-header:first-child { padding-top: 4px; }

/* Breadcrumb */
.drive-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px;
  padding: 8px 10px;
  margin: 8px 0;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.dp-bc-item { white-space: nowrap; }
.dp-bc-link { cursor: pointer; color: #8ae7d6; }
.dp-bc-link:hover { text-decoration: underline; }
.dp-bc-current { font-weight: 600; color: var(--ink); }
.dp-bc-sep { opacity: 0.4; padding: 0 2px; }

/* Hledání v aktuální složce - klient-side filter řádků */
.dp-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  margin: 4px 0 8px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.dp-search::placeholder { color: rgba(var(--ink-rgb),0.45); }
.dp-search:focus { border-color: rgba(var(--accent-soft-rgb),0.55); }

/* Action bar (footer) */
.drive-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 8px; margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.drive-actions .btn { flex: 1; min-width: 110px; }
.drive-actions .btn-primary { flex: 1.4; }
.drive-actions .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.dp-reconsent {
  background: rgba(255, 200, 0, 0.10);
  border: 1px solid rgba(255, 200, 0, 0.40);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 4px;
  text-align: center;
}
.dp-reconsent-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.dp-reconsent-msg { font-size: 13px; color: rgba(var(--ink-rgb),0.80); margin-bottom: 10px; }
.dp-reconsent-btn { display: inline-block; }
.dp-reconsent-detail { font-size: 11px; margin-top: 8px; word-break: break-word; }

.thread-toggle { margin-top: 12px; text-align: center; }
.btn-small { padding: 6px 14px; min-height: 32px; font-size: 12px; font-weight: 500; }
.email-body-full {
  margin-top: 12px;
  border-color: rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
  opacity: 0.78;
}
.email-body-full::before {
  content: '⤵ Celá konverzace včetně předchozích zpráv';
  display: block;
  font-size: 11px;
  color: rgba(var(--ink-rgb),0.5);
  margin-bottom: 8px;
  font-style: italic;
}

/* ===== CC status indicator on email-item ===== */
.email-item { padding-right: 38px; }
.email-item .cc-indicator {
  position: absolute;
  right: 10px;
  top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.45);
}
.cc-indicator.cc-pending      { color: var(--accent-soft); border-color: rgba(var(--accent-rgb),0.55); }
.cc-indicator.cc-in_progress  { color: var(--accent2-soft); border-color: rgba(var(--accent2-rgb),0.55); animation: spin 2.5s linear infinite; }
.cc-indicator.cc-awaiting_user,
.cc-indicator.cc-draft_email  { color: #ffd9a8; border-color: rgba(255,170,80,0.65); background: rgba(255,170,80,0.18); animation: pulse-attn 1.6s ease-in-out infinite; }
.cc-indicator.cc-user_replied { color: var(--accent-soft); border-color: rgba(var(--accent-rgb),0.55); }
.cc-indicator.cc-completed    { color: #b8ffd0; border-color: rgba(120,255,180,0.45); opacity: 0.7; }
.cc-indicator.cc-cancelled    { color: #aaa; opacity: 0.45; }

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes pulse-attn {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,170,80,0); }
  50%     { box-shadow: 0 0 0 6px rgba(255,170,80,0.30); }
}

/* ===== Detail ===== */
.detail { padding: 18px 18px 22px; margin-top: 4px; }
.detail-head h3 { margin: 0 0 12px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-bottom: 16px; }
.meta strong { font-weight: 600; }
.email-body {
  background: rgba(0,0,0,0.18);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 55vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.06);
}
.detail-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 140px; }

/* ===== Drawer (reply) ===== */
.drawer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.drawer-panel {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: 92dvh;
  border-radius: 22px 22px 0 0;
  padding: 18px;
  display: flex; flex-direction: column;
  animation: slideUp 0.25s ease-out;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.drawer-body { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.drawer-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.drawer-foot .btn { flex: 1; max-width: 200px; }

/* ===== Mic ===== */
.mic-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 4px;
}
.mic-btn {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb),0.4);
  transition: transform 0.1s;
}
.mic-btn:active { transform: scale(0.95); }
.mic-btn.recording { background: linear-gradient(135deg, #ff5b8c, #ff7a5b); animation: pulse 1.5s infinite; }
.mic-btn .mic-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,91,140,0.5);
  opacity: 0; pointer-events: none;
}
.mic-btn.recording .mic-pulse { animation: ring 1.5s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 6px 18px rgba(255,91,140,0.4); }
  50%     { box-shadow: 0 6px 24px rgba(255,91,140,0.8); }
}
@keyframes ring {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.mic-info { flex: 1; min-width: 0; }
.mic-status { font-size: 13px; color: rgba(var(--ink-rgb),0.75); }
.mic-interim { font-size: 13px; color: rgba(var(--ink-rgb),0.45); font-style: italic; margin-top: 2px; min-height: 18px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16,22,27,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(120,30,60,0.95); border-color: rgba(255,91,140,0.4); }
.toast.success { background: rgba(30,80,60,0.95); border-color: rgba(91,255,140,0.4); }

/* ===== Error msg ===== */
.error-msg {
  color: #ff8da8;
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

/* ===== Skeleton ===== */
.skel {
  height: 64px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Mobile tweaks ===== */
/* ===== Modaly ===== */
body.modal-open { overflow: hidden; }
.modal.modal-stacked { z-index: 1500; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.18s ease-out;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  /* iOS fix (2026-09-01): zavírání tapem na backdrop jde přes delegovaný
     document click listener ([data-close]). iOS Safari negeneruje click
     z tapu na ne-interaktivní div bez cursor:pointer → backdrop na iPhonu
     nešel "odkliknout". */
  cursor: pointer;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative;
  width: 100%; max-width: 640px;
  height: 92dvh;
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp 0.22s ease-out;
  overflow: hidden;
}
/* CC thread modal (vlákno + draft) = fullscreen, aby se Tomášovi
   nestalo, že nechtěně klikne mimo wisivig editor a ztratí draft
   (t_d2d8c7a2f03429fd, 9.6.2026).
   iPhone notch: posuneme CELÝ modal container pod safe-area-inset-top
   (v197 hack jen na .modal-head nestačil — iOS Safari někdy env() uvnitř
   position:fixed dětí počítá od jejich offsetu, ne od layout viewportu).
   Panel pak má height = 100dvh - notch, takže nepřeteče dolů pod home
   indicator. */
.modal.modal-cc-thread {
  padding-top: env(safe-area-inset-top, 0px);
  align-items: stretch;
}
.modal-cc-thread .modal-panel {
  max-width: none;
  height: calc(100dvh - env(safe-area-inset-top, 0px));
  border-radius: 0;
}
/* Když je viditelný draft (cct-draft není .hidden) — schovej spodní
   chat-with-CC toolbar. Tomáš v draft módu posílá EMAIL, ne reply na CC;
   původně modal-foot (cca 150 px) překrýval Trix editor a Odeslat button
   spadl mimo viewport (t_d2d8c7a2f03429fd 9.6.2026 follow-up). */
.modal-cc-thread.cct-mode-draft .modal-foot { display: none; }
/* Zprávy v cc-thread modalu = full width okna (předtím .msg-user 90 %, .msg-cc 95 %,
   v widescreen fullscreen vypadalo úzce — Tomáš t_5f9172a37927b95a 9.6.2026). */
.modal-cc-thread .msg-user,
.modal-cc-thread .msg-cc,
.modal-cc-thread .msg-system,
.modal-cc-thread .msg-sent-email {
  max-width: 100%;
  align-self: stretch;
}
.modal-cc-thread .chat {
  max-height: none;
  /* .chat má globálně overscroll-behavior:contain (řádek "chat" níže) pro
     případy, kdy SAMO sebe scrolluje (Slack thread). Tady ale s max-height:none
     nescrolluje vůbec - skutečný scroll container je rodič .modal-body.
     "contain" na neskrolující elementu vnořeném v jiném "contain" containeru
     umí u trackpadu/touch gest (na rozdíl od kolečka myši) zablokovat
     scroll-chaining nahoru - dvěma prsty pak nešlo scrollovat, fungoval jen
     tah za scrollbar (Tomáš t_ - 08.09.2026). */
  overscroll-behavior: auto;
}
.modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-head-left { flex: 1; min-width: 0; }
.modal-head-right { display: flex; align-items: center; gap: 8px; }
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  -webkit-overflow-scrolling: touch;
}
.modal-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; gap: 8px; align-items: center;
  flex-shrink: 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.modal-foot .btn { flex: 1; min-width: 0; }

/* ===== Searchbar ===== */
.searchbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  max-width: 720px; margin: 0 auto 4px;
  position: sticky;
  top: calc(56px + env(safe-area-inset-top));
  z-index: 40;
}
.searchbar.hidden { display: none; }
#search-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(var(--accent-rgb),0.45);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font: inherit; font-size: 14px;
  outline: none;
}
#search-input:focus { border-color: rgba(var(--accent-rgb),0.85); background: rgba(255,255,255,0.12); }

/* ===== FAB =====
   z-index: 150 → vidí se NAD modal-email (z-index 100) aby Tomáš mohl spustit
   nový CC chat / přečíst nový text i z otevřeného emailu. Pod stacked modaly
   (1500) tak, ať nepřekáží project pickeru/drive pickeru. */
.fab {
  position: fixed; right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(var(--accent-rgb),0.45);
  z-index: 150;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.fab:hover { transform: scale(1.05); }
.fab.hidden { display: none !important; }

/* TTS FAB — druhý kruh nad #fab-cc-new (čte poslední novou zprávu).
   Vlákno t_9df319f76672b78b. Skryté, dokud není „nový text k přečtení". */
#fab-tts-new {
  bottom: calc(86px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #34d399, var(--accent-deep));
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(77,255,177,0.45);
}
#fab-tts-new.speaking {
  background: linear-gradient(135deg, #ff5b8c, #e0486d);
  animation: tts-pulse 1.4s ease-in-out infinite;
}
@keyframes tts-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(255,91,140,0.45); }
  50%      { box-shadow: 0 8px 30px rgba(255,91,140,0.85); }
}
#fab-tts-new.loading::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #fff;
  animation: fab-spin 0.9s linear infinite;
}
@keyframes fab-spin { to { transform: rotate(360deg); } }
.fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: #ff5b8c;
  color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* Skrýt OBA FAB tlačítka, když jsou otevřené modaly kde nemají smysl:
   compose (psaní), CC thread (uvnitř chatu), Slack thread, project picker
   a drive picker. Tomáš chce vidět FAB v inboxu A v detail emailu. */
body[data-fab-hide="1"] .fab { display: none !important; }

/* TTS read button uvnitř CC zprávy / emailu — malá ikona vedle „Více" */
.tts-read-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(var(--ink-rgb),0.85);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.tts-read-btn:hover {
  background: rgba(var(--accent-rgb),0.25);
  color: #fff;
  transform: scale(1.08);
}
.tts-read-btn.speaking {
  background: linear-gradient(135deg, #ff5b8c, #e0486d);
  color: #fff;
  border-color: transparent;
  animation: tts-pulse 1.4s ease-in-out infinite;
}
.tts-read-btn.loading::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #fff;
  animation: fab-spin 0.9s linear infinite;
}
.tts-read-btn { position: relative; }

/* ===== Tabs (legacy, není v novém UX použito) ===== */
.tabs {
  display: flex; gap: 6px;
  padding: 0 12px 8px; max-width: 720px; margin: 0 auto;
}
.tab {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(var(--ink-rgb),0.70);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tab.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.25), rgba(var(--accent2-rgb),0.20));
  color: #fff;
  border-color: rgba(var(--accent-rgb),0.45);
}
.badge {
  background: #ff5b8c; color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  font-weight: 700; line-height: 1;
}

/* ===== Auto-refresh loader nad ikonkami v záhlaví ===== */
/* Při probíhajícím autoRefreshTick() přidáme .refreshing na .topbar-right.
   Vykreslíme jemnou animovanou linku nad ikonkami — nerušivé, ale viditelné. */
.topbar-right { position: relative; }
.topbar-right::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -3px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.85), rgba(var(--accent2-rgb),0.85), transparent);
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 200ms ease;
  pointer-events: none;
}
.topbar-right.refreshing::before {
  opacity: 1;
  animation: refresh-sweep 1.1s linear infinite;
}
@keyframes refresh-sweep {
  0%   { transform: translateX(-30%) scaleX(0.6); }
  50%  { transform: translateX(0)     scaleX(1.0); }
  100% { transform: translateX( 30%) scaleX(0.6); }
}

/* Počet "čeká" pod af-cycle (acct-filter) tlačítkem */
.af-cycle { position: relative; }
.af-count {
  position: absolute;
  bottom: -6px; right: -4px;
  background: #ff5b8c; color: #fff;
  font-size: 10px; line-height: 1; font-weight: 800;
  padding: 2px 5px; border-radius: 9px;
  min-width: 14px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* ===== Mini buttons inside email-item ===== */
.email-item .ei-row-actions {
  display: flex; gap: 6px; margin-top: 4px;
}
.mini-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(var(--ink-rgb),0.85);
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.mini-btn:hover { background: rgba(255,255,255,0.12); }
.mini-btn:active { transform: scale(0.94); opacity: 0.85; }
.mini-cc {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.20), rgba(var(--accent2-rgb),0.20));
  border-color: rgba(var(--accent-rgb),0.40);
  color: #fff;
}
.mini-rule {
  background: linear-gradient(135deg, rgba(255,196,77,0.18), rgba(255,140,80,0.16));
  border-color: rgba(255,196,77,0.40);
  color: #fff;
}

/* ===== Auto-rules modaly ===== */
.re-context {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.rule-type-options {
  display: flex; flex-direction: column; gap: 8px;
  margin: 12px 0;
}
.rule-type {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  cursor: pointer;
}
.rule-type input { margin-top: 3px; }
.rule-type strong { font-weight: 600; }
.rule-type span.muted { font-size: 11px; display: block; }
.re-move-check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 13px;
}
.rule-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 8px;
}
.ri-main { flex: 1; min-width: 0; }
.ri-acct { font-size: 11px; opacity: 0.7; }
.ri-type { font-weight: 600; font-size: 12px; margin-top: 2px; }
.ri-pattern { font-family: monospace; font-size: 13px; margin-top: 2px; word-break: break-all; }
.ri-note { font-size: 11px; margin-top: 2px; }
.ri-actions { display: flex; gap: 4px; align-items: center; }
.ri-actions button {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.ri-actions button:hover { background: rgba(255,255,255,0.14); }
.rl-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
  font-size: 12px;
}
.rl-when { opacity: 0.6; font-size: 10px; }
.rl-from { margin-top: 2px; }
.rl-subj { margin-top: 2px; font-weight: 600; }
.rl-sum { font-size: 11px; margin-top: 2px; }

/* ===== CC-specific button styling ===== */
.btn-cc {
  background: linear-gradient(135deg, var(--accent-2), var(--accent2-deep));
  color: #291702;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(var(--accent2-rgb),0.30);
}
.btn-cc:hover { filter: brightness(1.10); }

/* ===== CC list items ===== */
.cc-actions { margin-bottom: 12px; }
.cc-item {
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  transition: transform 0.08s, background 0.15s;
  margin-bottom: 8px;
}
.cc-item:hover { background: rgba(255,255,255,0.09); }
.cc-item.status-pending { border-color: rgba(var(--accent-rgb),0.40); }
.cc-item.status-awaiting_user, .cc-item.status-draft_email {
  border-color: rgba(255,170,80,0.50);
  background: rgba(255,170,80,0.08);
}
.cc-item.status-completed { opacity: 0.65; }
.cc-item.status-cancelled { opacity: 0.45; }

.status-row { margin-top: 2px; }
.status-pill {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: rgba(var(--ink-rgb),0.85);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.status-pill.status-pending { background: rgba(var(--accent-rgb),0.25); color: var(--accent-soft); }
.status-pill.status-in_progress { background: rgba(var(--accent2-rgb),0.25); color: var(--accent2-soft); }
.status-pill.status-awaiting_user { background: rgba(255,170,80,0.25); color: #ffd9a8; }
.status-pill.status-user_replied { background: rgba(var(--accent-rgb),0.25); color: var(--accent-soft); }
.status-pill.status-draft_email { background: rgba(255,170,80,0.30); color: #ffe6c2; }
.status-pill.status-completed { background: rgba(120,255,180,0.20); color: #b8ffd0; }
.status-pill.status-cancelled { background: rgba(120,120,120,0.25); color: #ccc; }

/* ===== CC thread (chat) ===== */
.cc-thread-card { padding: 16px 16px 18px; }
.cc-thread-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 14px;
}
.cc-thread-title { font-size: 17px; font-weight: 700; }
.cc-thread-sub { font-size: 12px; margin-top: 2px; }

.chat {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 50vh; overflow-y: auto;
  padding: 4px 0;
  margin-bottom: 12px;
}
.chat-context {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}
.chat-context-head { font-weight: 600; color: rgba(var(--ink-rgb),0.75); margin-bottom: 4px; }
.chat-context-body { color: rgba(var(--ink-rgb),0.65); white-space: pre-wrap; font-size: 12px; }

/* ===== CC HTML email preview (sandboxed iframe) ===== */
/* Bug fix 2026-06-05 (vlákno t_6e75a7ebbe2dc8e5): newsletter HTML emaily
   se zobrazovaly z plain-text fallbacku s rozsekanými URL. Iframe izoluje
   HTML obsah (sandbox bez scripts/forms) — XSS/prompt injection neutralizováno. */
.cc-email-html-preview .chat-context-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.cc-email-html-open {
  background: rgba(var(--accent-rgb),0.18); color: #cdf0e9;
  border: 1px solid rgba(var(--accent-rgb),0.35);
  border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer;
  white-space: nowrap;
}
.cc-email-html-open:hover { background: rgba(var(--accent-rgb),0.28); }
/* max-height ZAMERNE neni: iframe roste do vysky mailu a scrolluje az
   .modal-body. Dva scrollbary nad sebou delaly z dlouhych mailu necitelne
   okenko (17. 9. 2026). Vysku dopocitava adjustHeight() v app.js. */
.cc-email-html-iframe {
  width: 100%; min-height: 200px; height: 300px;
  border: 0; border-radius: 8px; background: #fff;
  display: block;
}

/* ===== CC artefakty (přílohy práce) ve vlákně ===== */
.cc-artifacts { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cc-artifacts-head { font-weight: 700; font-size: 13px; color: rgba(var(--ink-rgb),0.85); }
.cc-art-card {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.10), rgba(var(--accent-rgb),0.08));
  border: 1px solid rgba(var(--accent-rgb),0.28);
  border-radius: 14px;
  padding: 12px 14px;
}
.cc-art-title { font-weight: 700; font-size: 14px; color: #eef7f5; word-break: break-word; }
.cc-art-meta { margin-top: 4px; font-size: 11px; color: rgba(var(--ink-rgb),0.6);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-art-vlabel { background: rgba(255,255,255,0.10); border-radius: 8px; padding: 2px 8px; font-weight: 600; }
.cc-art-ver {
  background: rgba(0,0,0,0.25); color: var(--ink); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 11px; min-height: 32px;
}
.cc-art-actions { margin-top: 10px; display: flex; gap: 8px; }
.cc-art-actions .btn { flex: 1; padding: 10px 14px; min-height: 40px; text-decoration: none; }

/* Poslech prilohy (18.9.2026, vlakno t_bb2caf433addbd13) — stavy tlacitka 🔊
   na karte prilohy. Stejna logika jako .tts-read-btn u zpravy, jen v tvaru btn. */
.cc-art-tts { position: relative; }
.cc-art-tts.speaking {
  background: linear-gradient(135deg, #ff5b8c, #e0486d);
  color: #fff;
  border-color: transparent;
  animation: tts-pulse 1.4s ease-in-out infinite;
}
.cc-art-tts.loading { opacity: 0.75; }
.cc-art-tts.loading::after {
  content: '';
  position: absolute;
  right: 10px; top: 50%;
  width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  animation: fab-spin 0.9s linear infinite;
}

.msg {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.msg-head {
  font-size: 11px; color: rgba(var(--ink-rgb),0.55);
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
/* escapeAndLinkify nahradil white-space:pre-wrap za \n→<br>, takže pre-wrap
   už nepotřebujeme; ale necháváme break-word pro dlouhé URLs. */
.msg-body { font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg-body a { color: var(--accent-2); text-decoration: underline; }
.msg-body a:hover { color: #f2c078; }
.msg-body strong { font-weight: 700; }
.msg-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 4px; }
.msg-body ul { margin: 4px 0; padding-left: 20px; }
.msg-body li { margin: 2px 0; }
.msg-more { display: inline; margin-left: 2px; padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--accent-2); background: rgba(var(--accent2-rgb),0.12); border: 1px solid rgba(var(--accent2-rgb),0.35); border-radius: 999px; cursor: pointer; }
.msg-user { background: rgba(var(--accent-rgb),0.15); border-color: rgba(var(--accent-rgb),0.35); align-self: flex-end; max-width: 90%; }
.msg-cc   { background: rgba(var(--accent2-rgb),0.12);  border-color: rgba(var(--accent2-rgb),0.35); max-width: 95%; }
.msg-system { background: rgba(120,255,180,0.10); border-color: rgba(120,255,180,0.30); font-size: 12px; text-align: center; }
/* Optimisticky vykreslená user zpráva, čeká na potvrzení od serveru.
   Subtle opacity + drobná tečka u času — žádné dramatické UI. */
.msg-pending { opacity: 0.65; }
.msg-pending .msg-time::after { content: ' · odesílám…'; opacity: 0.7; }

/* Dlaždice odeslaného emailu (sentinel SENT_EMAIL_V1) — kompaktní karta
   se subjektem + recipientem + tlačítkem „Zobrazit text". Klik rozbalí celý
   odeslaný text s linkified obsahem. Vychází z msg-system, ale lépe
   strukturovaná pro skenování. */
.msg-sent-email { background: rgba(91,255,140,0.10); border-color: rgba(91,255,140,0.30); padding: 10px 12px; text-align: left; }
.msg-sent-head { display: flex; align-items: center; gap: 10px; }
.msg-sent-icon { font-size: 18px; opacity: 0.85; }
.msg-sent-meta { flex: 1; min-width: 0; }
.msg-sent-subj { font-size: 13px; font-weight: 600; color: rgba(var(--ink-rgb),0.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-sent-sub { font-size: 11px; color: rgba(var(--ink-rgb),0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-sent-toggle { font-size: 12px; padding: 4px 10px; background: rgba(91,255,140,0.15); border: 1px solid rgba(91,255,140,0.40); color: #5cff8c; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.msg-sent-toggle:hover { background: rgba(91,255,140,0.25); }
.msg-sent-body { font-size: 13px; line-height: 1.55; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(91,255,140,0.20); color: rgba(var(--ink-rgb),0.85); word-break: break-word; }
.msg-sent-body.hidden { display: none; }
.msg-sent-body a { color: var(--accent-2); text-decoration: underline; }

.cc-reply { margin-top: 0; width: 100%; }
.cc-reply textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font: inherit;
  resize: vertical;
  min-height: 56px;
}
.cc-reply-actions {
  display: flex; gap: 8px; margin-top: 8px; align-items: center;
}
.cc-reply-actions .btn { flex: 1; min-height: 40px; }
.mic-btn-small {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn-small.recording {
  background: linear-gradient(135deg, #ff5b8c, #ff7a5b);
  animation: pulse 1.5s infinite;
}

/* ===== Draft email card ===== */
.draft-card {
  background: rgba(255,170,80,0.08);
  border: 1px solid rgba(255,170,80,0.30);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.draft-head {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: #ffd9a8;
}
.draft-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 6px;
}
.draft-foot .btn { flex: 1; max-width: 200px; }

/* ===== CC project picker ===== */
.pp-search-row {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.pp-search {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 14px;
  outline: none;
}
.pp-search:focus { border-color: rgba(var(--accent-rgb),0.50); background: rgba(255,255,255,0.10); }
.pp-status {
  font-size: 12px; color: rgba(var(--ink-rgb),0.55);
  margin-bottom: 8px;
}
.pp-list { max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.pp-item {
  padding: 11px 13px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
  transition: background 0.12s;
}
.pp-item:hover { background: rgba(var(--accent-rgb),0.12); border-color: rgba(var(--accent-rgb),0.30); }
.pp-row1 { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pp-name {
  font-weight: 600; font-size: 14px;
  color: rgba(var(--ink-rgb),0.95);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; gap: 8px; align-items: center;
}
.pp-mtime { font-size: 11px; color: rgba(var(--ink-rgb),0.45); flex-shrink: 0; }
.pp-path {
  font-size: 11px;
  color: rgba(var(--ink-rgb),0.45);
  font-family: ui-monospace, Menlo, monospace;
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-desc {
  font-size: 11.5px;
  color: rgba(var(--ink-rgb),0.62);
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pp-type {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pp-type-node    { background: rgba(120,255,180,0.18); color: #b0f4ce; }
.pp-type-php     { background: rgba(var(--accent2-rgb),0.20); color: var(--accent2-soft); }
.pp-type-python  { background: rgba(255,210,90,0.18); color: #ffe9a8; }
.pp-type-claude  { background: rgba(var(--accent-rgb),0.22); color: #c3ede5; }
.pp-item mark { background: rgba(255,200,80,0.40); color: #fff; padding: 0 2px; border-radius: 3px; }
.btn-small { font-size: 12px; padding: 6px 12px; }

/* Slack items */
.slack-item { cursor: pointer; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); transition: background 0.15s; }
.slack-item:hover { background: rgba(255,255,255,0.06); }
.slack-item .item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.slack-item .item-left { display: flex; align-items: center; gap: 6px; }
.slack-item .slack-icon { font-size: 14px; }
.slack-item .item-preview { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.4; }
.slack-item .item-suggestion { font-size: 12px; color: rgba(100,220,200,0.8); margin-top: 4px; }
.slack-item .item-date { font-size: 11px; white-space: nowrap; }
.slack-item.has-summary { border-left: 3px solid rgba(100,220,200,0.5); }

/* Slack reply card */
.btn-slack-send {
  background: linear-gradient(135deg, #4a154b, #611f69) !important;
  color: #fff !important;
  border: 1px solid rgba(97,31,105,0.5) !important;
  font-weight: 600;
}
.btn-slack-send:hover { filter: brightness(1.2); }
.draft-body-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font: inherit;
  resize: vertical;
  min-height: 72px;
}
.draft-body-input:focus { border-color: rgba(var(--accent-rgb),0.5); background: rgba(255,255,255,0.10); outline: none; }

/* Trix editor (Basecamp) dark theme. Trix render = <trix-toolbar> (auto-vložený
   nad editorem) + <trix-editor contenteditable>. Hidden <input type=hidden> drží
   synchronizovaný HTML output. Trix nemá vlastní interní model (jako Quill
   Delta) — pracuje přímo s DOM přes native contenteditable + ProseMirror-like
   AttachmentManager. To znamená: žádný caret jump, žádné dědění formátu po
   loadHTML, žádné DOM re-normalize při kliku. */
/* Trix focus iOS fix — t_d2d8c7a2f03429fd hluboká revize 10.6.2026:
   <trix-editor> JE samotný contenteditable element (web component, ne shadow DOM,
   ne wrapper). Tj. selector `.dr-trix-host trix-editor` byl no-op (cíl neexistuje).
   Hlavní kořeny předchozí poruchy:
     1) <label> wrap kolem <trix-editor> (index.php) — HTML spec: klik na <label>
        propaguje na první focusable control uvnitř (= hidden input <input type=hidden>),
        ten focus pohltí (neviditelný), iOS Safari NEvyvolá keyboard na trix-editor.
     2) `touch-action: manipulation` na contenteditable — potlačuje gesture conflict
        resolution na iOS Safari → tap neumístí caret, native focus path se přeruší.
     3) `position: relative; z-index: 2` vytvořilo zbytečný stacking context —
        kombinace s `position: sticky` toolbarem zhoršovala selection.
     4) JS `pointerdown` handler který volal `editor.focus()` — programmatic focus
        na contenteditable na iOS NEOTEVŘE klávesnici (jen native user-gesture
        click/tap přímo na element ji vyvolá).
     5) Inherited font-size < 16px → iOS auto-zoom + gesture konflikt.
   Tato verze: nech native iOS contenteditable mechanismus dělat svou práci. */
.dr-trix-host {
  display: block;
  min-height: 200px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: none;
  border-radius: 0 0 12px 12px;
  color: #fff;
  font-family: inherit;
  /* iOS Safari: font-size MUSÍ být ≥16px, jinak browser při focus auto-zoomuje
     a často se mezitím gesture rozbije → focus se ztratí, keyboard nevyjede. */
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  /* NEPOUŽÍVAT touch-action: manipulation — na iOS Safari to brání nativnímu
     tap-to-focus contenteditable mechanismu (potvrzeno empiricky pres Playwright
     iPhone 14 simulaci 10.6.2026 v rámci t_d2d8c7a2f03429fd). Default `auto`. */
  touch-action: auto;
  /* iOS quirk: bez WebkitAppearance:none Safari někdy nevykreslí caret v
     contenteditable s custom backgroundem. */
  -webkit-appearance: none;
}
.dr-trix-host:focus { border-color: rgba(var(--accent-rgb),0.6); background: rgba(255,255,255,0.10); }
.dr-trix-host[placeholder]:empty::before { content: attr(placeholder); color: rgba(var(--ink-rgb),0.40); }
/* Trix toolbar — sticky nad editorem v scrollujícím .modal-body, aby Tomáš
   viděl bold/italic i u dlouhých draftů (jako u staré Quill verze). */
.field trix-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(24,30,34,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.field trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 4px 6px;
}
.field trix-toolbar .trix-button-group {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  margin: 4px 4px 4px 0;
  background: rgba(255,255,255,0.04);
}
.field trix-toolbar .trix-button-group--file-tools { display: none; }
.field trix-toolbar .trix-button {
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(var(--ink-rgb),0.85);
  padding: 6px 10px;
  height: 32px;
  min-width: 32px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.field trix-toolbar .trix-button:last-child { border-right: 0; }
.field trix-toolbar .trix-button:hover { color: var(--accent-2); background: rgba(var(--accent2-rgb),0.10); }
.field trix-toolbar .trix-button.trix-active { color: var(--accent-2); background: rgba(var(--accent2-rgb),0.18); }
.field trix-toolbar .trix-button:disabled { opacity: 0.35; cursor: not-allowed; }
/* Trix default ikon via background SVG — invert pro dark theme. */
.field trix-toolbar .trix-button--icon::before {
  filter: invert(0.85) brightness(1.4);
  opacity: 1;
}
.field trix-toolbar .trix-button--icon.trix-active::before {
  filter: invert(0.6) sepia(1) hue-rotate(245deg) saturate(5);
}
/* Dialog (link insertion) — dark. */
.field trix-toolbar .trix-dialogs {
  background: transparent;
  position: relative;
}
.field trix-toolbar .trix-dialog {
  background: #141b20;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.field trix-toolbar .trix-dialog input[type=text],
.field trix-toolbar .trix-dialog input[type=url] {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
}
.field trix-toolbar .trix-dialog .trix-button {
  background: rgba(var(--accent-rgb),0.18);
  border: 1px solid rgba(var(--accent-rgb),0.30);
  border-radius: 8px;
  margin-left: 6px;
  height: auto;
  padding: 6px 12px;
}
.dr-trix-host a { color: var(--accent-2); }
.dr-trix-host blockquote {
  border-left: 3px solid rgba(var(--accent2-rgb),0.40);
  margin: 8px 0;
  padding: 4px 0 4px 12px;
  color: rgba(var(--ink-rgb),0.75);
}
.dr-trix-host pre {
  background: rgba(0,0,0,0.30);
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
}
.dr-trix-host ul, .dr-trix-host ol { padding-left: 22px; }
.dr-trix-host p, .dr-trix-host li { line-height: 1.5; }
/* Skrýt file-attach button (řešíme přílohy mimo editor) — duplikát JS skrývání
   pro případ, kdy se editor inicializuje pozdě. */
.field trix-toolbar [data-trix-action="attachFiles"],
.field trix-toolbar [data-trix-action="attach"] { display: none !important; }
.draft-actions {
  display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end;
}
.draft-actions .btn { min-width: 100px; }
#slt-slack-reply .draft-head {
  color: var(--accent2-soft);
  font-size: 13px;
}
.btn-mic { flex: 0 0 40px !important; font-size: 16px; }
.btn-mic.recording {
  background: linear-gradient(135deg, #ff5b8c, #ff7a5b) !important;
  animation: pulse 1.5s infinite;
}

/* Slack original message card */
.slack-orig-card {
  background: rgba(74,21,75,0.15);
  border: 1px solid rgba(74,21,75,0.35);
  border-left: 3px solid #611f69;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.slack-orig-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 13px;
}
.slack-orig-header .muted { font-size: 12px; }
.slack-orig-body {
  font-size: 14px; line-height: 1.5;
  color: rgba(255,255,255,0.9);
  white-space: pre-wrap;
}

/* Slack status pills in list */
.slack-status-pill {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.03em;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45);
  white-space: nowrap;
}
.slack-status-pill.status-new {
  background: rgba(var(--accent-rgb),0.20); color: #6fdcc9;
}
.slack-status-pill.status-active {
  background: rgba(255,170,80,0.20); color: #ffc97a;
}
.status-pill.status-new { background: rgba(var(--accent-rgb),0.20); color: #6fdcc9; }
.status-pill.status-active { background: rgba(255,170,80,0.20); color: #ffc97a; }
.slack-item .item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.slack-channel { font-size: 12px; }

/* Chat separator */
.chat-separator {
  text-align: center; margin: 14px 0 10px;
  position: relative;
}
.chat-separator::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.chat-separator span {
  position: relative; z-index: 1;
  background: rgba(10,15,20,0.8); padding: 0 12px;
  font-size: 11px; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.chat-time { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 2px; }

/* Typing/loading animation */
.typing-dots span {
  animation: blink 1.4s infinite both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }

@media (max-width: 480px) {
  /* TOPBAR mobile fix (2026-06-05, vlákno t_2adb19866361591e, 2. iterace):
     7 ikon × 36px + 6 mezer × 6px = 288px → na 360px Android vyjde za pravý
     okraj „glass" kontejneru topbaru (margin 8 + padding 14 + left ~50px
     = 80px obsazeno → zbývá jen 282px). Při 320px iPhone SE chybí 36px →
     poslední ikona ↻ úplně mimo viewport. Řešení: zmenšit margin/padding/gap
     i iconbtn, aby se 7 ikon pohodlně vešlo už od 320px. */
  .topbar { margin: 6px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .topbar-left, .topbar-right { gap: 4px; }
  .topbar h2 { font-size: 16px; }
  .iconbtn { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }
  /* Mobil: badge dál drobně leze ven přes roh rámečku (Tomáš msg 632). */
  .iconbtn .badge { top: -5px; right: -5px; min-width: 15px; height: 15px; font-size: 9px; line-height: 13px; padding: 0 3px; }
  .detail { padding: 16px; }
  .detail-head h3 { font-size: 17px; }
  .acct-select { font-size: 12px; max-width: 130px; text-overflow: ellipsis; }
}
/* Velmi úzké telefony (iPhone SE 320px, malé Androidy) — ještě těsnější. */
@media (max-width: 360px) {
  .topbar { margin: 4px; padding: 7px 8px; padding-top: calc(7px + env(safe-area-inset-top)); }
  .topbar-left, .topbar-right { gap: 3px; }
  .iconbtn { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
  .iconbtn .badge { top: -5px; right: -5px; min-width: 14px; height: 14px; font-size: 9px; line-height: 12px; padding: 0 3px; }
}

/* Auto-pravidla — action block (vlákno t_221f26d60e58aa56) */
.re-action-block {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}
.re-action-block legend {
  font-size: 12px; color: rgba(255,255,255,0.6);
  padding: 0 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.re-drive-options {
  margin-top: 8px; padding: 10px 12px;
  background: rgba(var(--accent-rgb),0.06);
  border-left: 2px solid rgba(var(--accent-rgb),0.5);
  border-radius: 4px;
  display: flex; flex-direction: column; gap: 10px;
}
.re-drive-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.re-drive-label { font-size: 13px; }
.re-drive-path {
  flex: 1; font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  font-family: ui-monospace, monospace;
}
.re-drive-path.muted { color: rgba(255,255,255,0.4); font-style: italic; }
.re-filter-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px;
}
.re-filter-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
#re-filename-tpl {
  font-family: ui-monospace, monospace; font-size: 13px;
}

/* =====================================================================
   UI PRELOADERS (2026-06-05, vlákno t_4d4246c00fe06b2a, msg 598)
   ---------------------------------------------------------------------
   Tomáš: „dej všude preloader nějaký pěkný navíc. At nemám pocit
   'zmáčkl jsem to vůbec?'". Cíl: na každé akci s response > ~80ms
   instantní vizuální feedback, aby user věděl „klik proběhl, něco se
   děje". Subtle, ne křiklavé — odpovídá glass tématu.
   ===================================================================== */

/* === Top thin loading bar — singleton element nad celou app === */
.top-loading-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 180ms ease;
  background: transparent;
}
.top-loading-bar.is-active { opacity: 1; }
.top-loading-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(var(--accent-rgb),0.95) 35%,
    rgba(var(--accent2-rgb),0.95) 65%,
    transparent 100%);
  animation: tlb-slide 1.05s linear infinite;
  will-change: transform;
}
@keyframes tlb-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(385%); }
}

/* === Button busy state — instantní spinner na tlačítku ===
   Funguje na .btn (textová) i .iconbtn (ikona). Přidává spinner napravo
   od labelu, lehce zablokuje click. */
.btn.btn-busy,
.iconbtn.btn-busy {
  position: relative;
  cursor: progress;
  pointer-events: none;
  opacity: 0.85;
}
.btn.btn-busy::after,
.iconbtn.btn-busy::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.95);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  will-change: transform;
}
.iconbtn.btn-busy {
  /* U icon-btn (jen ikona) skryjeme text a vykreslíme jen spinner uprostřed. */
  color: transparent !important;
}
.iconbtn.btn-busy::after {
  position: absolute;
  inset: 0;
  margin: auto;
}

/* === Click ripple — instantní pulse na všechny .btn / .iconbtn / .fab ===
   CSS-only (žádný JS), feedback v cca 1 frame. Nepokrývá .pin-key (má vlastní).
   Fix 2026-06-05 (vlákno t_9df319f76672b78b): původně .fab dostala position:relative
   která override .fab z dřívějška (position:fixed) → FAB se schoval. Teď .fab zůstává
   fixed, jen overflow:hidden pro ripple containment.
   Fix 2026-06-06 (vlákno t_2adb19866361591e, msg 632): .iconbtn MUSÍ mít
   overflow:visible, jinak badge v rohu se ořízne. Ripple proto omezíme
   border-radius:inherit (gradient má scale max 1.0 → nevyleze za box),
   nepotřebujeme overflow:hidden na .iconbtn. */
.btn, .mini-btn, .mic-btn-small {
  position: relative;
  overflow: hidden;
}
.fab {
  overflow: hidden;
}
.btn:active::before,
.iconbtn:active::before,
.fab:active::before,
.mini-btn:active::before,
.mic-btn-small:active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.18) 35%,
    transparent 65%);
  animation: click-ripple 380ms ease-out;
  pointer-events: none;
  will-change: opacity, transform;
}
@keyframes click-ripple {
  0%   { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0;   transform: scale(1.0); }
}

/* === Skeleton blocks (extension stávajícího .skel) === */
.skel-line, .skel-circle, .skel-block {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
.skel-line { height: 12px; margin: 6px 0; }
.skel-line.short { width: 40%; }
.skel-line.medium { width: 70%; }
.skel-line.long { width: 92%; }
.skel-circle { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.skel-block { height: 60px; }

/* === Email body skeleton (otevírání emailu, čeká se na get) === */
.email-body-skeleton {
  padding: 10px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.email-body-skeleton::before,
.email-body-skeleton::after,
.email-body-skeleton > .ebs-fill {
  content: '';
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.email-body-skeleton::before { width: 88%; }
.email-body-skeleton::after { width: 62%; }
.email-body-skeleton > .ebs-fill { width: 75%; height: 12px; }

/* === CC message skeleton (chat bubliny placeholder při openCcThread) === */
.cc-msg-skeleton {
  padding: 12px 0;
  display: flex; flex-direction: column; gap: 14px;
}
.cc-msg-skeleton .cms-row {
  display: flex; gap: 10px; align-items: flex-start;
}
.cc-msg-skeleton .cms-row.right { flex-direction: row-reverse; }
.cc-msg-skeleton .cms-bubble {
  flex: 0 1 60%;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.cc-msg-skeleton .cms-bubble.wide { flex-basis: 75%; height: 52px; }

/* === Inline element loading overlay ===
   Přidej class .is-loading na jakýkoli kontejner → subtle shimmer overlay
   přes obsah, nezasahuje do layoutu (absolute), aby user věděl „pracuje to". */
.is-loading {
  position: relative;
}
.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.08) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

/* === Modal closing fade-out === */
/* Při zavírání modalu — krátký GPU-friendly fade (opacity), žádný layout reflow.
   Modaly se hned schovají (.hidden), ale visual blesk je opacity 1→0 ms. */
.modal.is-closing {
  animation: modal-fade-out 0.12s ease-in forwards;
  pointer-events: none;
}
@keyframes modal-fade-out {
  to { opacity: 0; }
}

/* === Tendery modal — NEN monitor panel (vlákno t_d53090093d46aa66) === */
.tender-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-bottom: 12px;
}
.tender-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(var(--ink-rgb),0.65);
  padding: 8px 14px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tender-tab:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.tender-tab.active {
  background: rgba(var(--accent-rgb),0.16);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.18);
}
.tender-pane.hidden { display: none; }

/* — Tender list row — */
.tender-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  margin-bottom: 8px;
}
.tender-row.cancelled { opacity: 0.45; }
.tender-row-main { flex: 1; min-width: 0; }
.tender-row-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; line-height: 1.3; }
.tender-row-meta { font-size: 12px; color: rgba(var(--ink-rgb),0.55); display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tender-row-meta .pill {
  background: rgba(var(--accent-rgb),0.16);
  border: 1px solid rgba(var(--accent-rgb),0.35);
  color: #b2e8dd;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tender-row-meta .pill.danger { background: rgba(255,90,90,0.16); border-color: rgba(255,90,90,0.4); color: #ffb0b0; }
.tender-row-meta .pill.ok { background: rgba(110,210,140,0.16); border-color: rgba(110,210,140,0.35); color: #b5f0c8; }
/* — Prehled po „Jdeme do toho" — */
.t2-prep {
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.07); border: 1px solid rgba(var(--accent-rgb), 0.28);
  font-size: 13px; line-height: 1.45;
}
.t2-prep-wait { background: rgba(255,180,60,0.08); border-color: rgba(255,180,60,0.35); }
.t2-prep-head { font-weight: 700; margin-bottom: 6px; }
.t2-prep-price { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: 6px 0; font-size: 14px; }
.t2-prep-price .pill { font-size: 12px; }
.t2-prep-row { margin: 3px 0; }
.t2-prep-sec { margin-top: 8px; }
.t2-prep-sec ul { margin: 3px 0 0; padding-left: 18px; }
.t2-bad { color: #ffb0b0; }
.t2-ask { padding: 6px 8px; border-radius: 8px; background: rgba(255,180,60,0.10); }

/* — Tendery v2 — */
/* Duvod verdiktu: nejcennejsi veta na karte, drive schovana v title tooltipu. */
.t2-why {
  font-size: 13px; line-height: 1.45; margin: 0 0 6px;
  padding-left: 10px; border-left: 3px solid rgba(var(--ink-rgb), 0.25);
  color: rgba(var(--ink-rgb), 0.82);
}
.t2-why-jdeme   { border-left-color: rgba(110,210,140,0.75); }
.t2-why-zvazit  { border-left-color: rgba(255,180,60,0.75); }
.t2-why-nejdeme { border-left-color: rgba(255,90,90,0.6); color: rgba(var(--ink-rgb), 0.6); }
.t2-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(var(--ink-rgb),0.7); }
.t2-check input { accent-color: rgb(var(--accent-rgb)); }

/* Panel byl uzky (640 px) a 212 px zabiraly akce -> text se lamal do sloupecku. */
#modal-tender .modal-panel { max-width: 940px; }
.tender-tabs { overflow-x: auto; scrollbar-width: thin; }

@media (max-width: 680px) {
  .tender-row { flex-direction: column; align-items: stretch; }
  .tender-row-actions { flex-direction: row; width: 100%; margin-top: 8px; }
  .tender-row-actions .btn { flex: 1; }
  .t2-toolbar .small { margin-left: 0; width: 100%; }
  .t2-popis { max-height: none; }
}


.t2-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
}
.t2-toolbar .input { flex: 1 1 240px; min-width: 180px; }
.t2-toolbar .small { margin-left: auto; }
.linkbtn {
  background: none; border: none; padding: 0; font: inherit; font-size: 12px;
  color: rgba(var(--accent-rgb), 0.95); cursor: pointer; text-decoration: underline;
}
.t2-detail {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(var(--ink-rgb), 0.12);
}
.t2-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 8px; }
.t2-tab th {
  text-align: left; white-space: nowrap; width: 130px; padding: 3px 10px 3px 0;
  color: rgba(var(--ink-rgb), 0.5); font-weight: 600;
}
.t2-tab td { padding: 3px 0; color: rgba(var(--ink-rgb), 0.85); }
.t2-popis {
  font-size: 13px; line-height: 1.5; white-space: pre-wrap;
  max-height: 320px; overflow: auto;
  background: rgba(var(--ink-rgb), 0.04); border-radius: 10px; padding: 10px 12px;
}

/* — Rozhodovací blok zakázky: cena + lhůta nahoře, pod tím „co se chce" —
   Tomáš potřebuje posoudit jedním okem, jestli do toho jít. */
.tender-row-money {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px;
  margin: 2px 0 6px;
}
.tender-money {
  font-size: 17px; font-weight: 750; letter-spacing: -0.01em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.tender-money.muted { font-size: 14px; font-weight: 600; color: rgba(var(--ink-rgb),0.45); }
.tender-row-money .pill {
  background: rgba(var(--accent-rgb),0.16);
  border: 1px solid rgba(var(--accent-rgb),0.35);
  color: #b2e8dd;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.tender-row-money .pill.danger { background: rgba(255,90,90,0.16); border-color: rgba(255,90,90,0.4); color: #ffb0b0; }
.tender-row-money .pill.ok { background: rgba(110,210,140,0.16); border-color: rgba(110,210,140,0.35); color: #b5f0c8; }
.tender-row-money .pill.warn { background: rgba(255,180,60,0.16); border-color: rgba(255,180,60,0.4); color: #ffdca0; }
.tender-bullets {
  margin: 0 0 6px; padding: 0 0 0 16px;
  font-size: 13px; line-height: 1.45; color: rgba(var(--ink-rgb),0.82);
}
.tender-bullets li { margin: 1px 0; }
.tender-bullets.pending {
  list-style: none; padding-left: 0;
  color: rgba(var(--ink-rgb),0.55); font-style: italic;
}

.tender-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* 30px bylo pod Apple touch minimem - zvětšeno (iOS UX fix 2026-09-01) */
.tender-row-actions .iconbtn { width: 38px; height: 38px; font-size: 15px; }
.tender-row-actions a.iconbtn { text-decoration: none; }

/* — Tender config sections — */
.tender-cfg-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.tender-cfg-section > h4 { margin: 0 0 10px 0; font-size: 14px; color: var(--ink); }
.tender-cfg-section > h4 .small { font-weight: 400; font-size: 12px; }
.tender-cfg-section > summary { cursor: pointer; font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.tender-cfg-section[open] > summary { margin-bottom: 10px; }

/* — Chip input (Negative filter UI) — */
.chip-input {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  min-height: 44px;
  align-items: center;
}
.chip-input .chip-list { display: contents; }
.chip-input input {
  flex: 1; min-width: 160px;
  background: transparent; border: none; color: var(--ink);
  font: inherit; font-size: 13px; outline: none;
  padding: 4px 6px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,90,90,0.16);
  border: 1px solid rgba(255,90,90,0.35);
  color: #ffb6b6;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.chip.positive { background: rgba(110,210,140,0.16); border-color: rgba(110,210,140,0.4); color: #b5f0c8; }
.chip.negative { background: rgba(255,90,90,0.16); border-color: rgba(255,90,90,0.35); color: #ffb6b6; }
.chip.small { font-size: 11px; padding: 1px 5px 1px 8px; }
.chip-x {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0.7;
}
.chip-x:hover { opacity: 1; }

/* === 🌐 Tender PUBLIC list — záložka „Všechny" === */
.tender-all-head {
  margin: 4px 0 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.tender-all-head .select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink);
  border-radius: 9px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
}
.tender-row-kw {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.tender-row.selected {
  border-color: rgba(110,210,140,0.35) !important;
  background: rgba(110,210,140,0.05);
}
/* Vlákno t_d53090093d46aa66 (msg 710): unread match — výrazné orámování */
.tender-row.unread {
  border-color: rgba(255,140,60,0.55) !important;
  background: rgba(255,140,60,0.06);
  box-shadow: 0 0 0 1px rgba(255,140,60,0.18) inset;
}
.btn.small { font-size: 12px; padding: 4px 10px; }
.pill.warn { background: rgba(255,180,60,0.18); border-color: rgba(255,180,60,0.42); color: #ffd699; }
.pill.danger { background: rgba(255,90,90,0.18); border-color: rgba(255,90,90,0.42); color: #ffb6b6; }
.pill.ok { background: rgba(110,210,140,0.16); border-color: rgba(110,210,140,0.4); color: #b5f0c8; }

.tender-cfg-readonly .cfg-block { margin-bottom: 8px; }
.tender-cfg-readonly .cfg-block b { color: var(--ink); font-size: 12px; }
.tender-cfg-readonly .muted { font-size: 12px; font-family: 'JetBrains Mono', monospace; }

.row-2 { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row-2 .field { flex: 1; min-width: 120px; }
.row-2 .btn { white-space: nowrap; }

/* === ⚙️ Nastavení modal — 2 záložky (Pravidla + Tokeny) === */
.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-bottom: 14px;
}
.settings-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(var(--ink-rgb),0.65);
  padding: 8px 14px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.settings-tab:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.settings-tab.active {
  background: rgba(var(--accent-rgb),0.16);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.18);
}
.settings-pane.hidden { display: none; }

/* — Tokeny: 5h rolling window card (vlákno t_84a213fd061ebd8c) — */
.tokens-5h-card {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.10), rgba(52, 152, 219, 0.10));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.t5h-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.t5h-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(var(--ink-rgb),0.75);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.t5h-pct {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.t5h-bar {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.t5h-bar-fill {
  height: 100%;
  width: 0%;
  background: #2ecc71;
  transition: width 0.3s ease, background 0.3s ease;
}
.t5h-meta {
  font-size: 12px;
  color: rgba(var(--ink-rgb),0.75);
}
.tsc-pct {
  font-size: 11px;
  font-weight: 600;
  color: #2ecc71;
  margin-left: 4px;
  letter-spacing: 0;
  text-transform: none;
}

/* — Tokeny: týdenní limit plánu (Max 20×) progress bar (vlákno t_84a213fd061ebd8c msg 719) — */
.tokens-plan-box {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(var(--accent-rgb),0.06));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.tokens-plan-box.hidden { display: none; }
.tpb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tpb-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(var(--ink-rgb),0.85);
}
.tpb-title strong { color: var(--ink); }
.tpb-icon { font-size: 16px; }
.tpb-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tpb-bar {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
}
.tpb-bar-fill {
  height: 100%;
  width: 0%;
  background: #2ecc71;
  transition: width 0.4s ease, background 0.3s ease;
}
.tpb-detail {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(var(--ink-rgb),0.75);
  font-variant-numeric: tabular-nums;
}
.tpb-detail span { font-weight: 700; color: var(--ink); }
.tpb-source {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(var(--ink-rgb),0.50);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tpb-source-link {
  color: var(--accent);
  text-decoration: none;
}
.tpb-source-link:hover { text-decoration: underline; }
.tpb-tooltip {
  cursor: help;
  opacity: 0.7;
}
.tpb-tooltip:hover { opacity: 1; }

/* — Tokeny: souhrnné kartičky (dnes / včera / týden / měsíc) — */
.tokens-scope-info {
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.08), rgba(46,204,113,0.06));
  border: 1px solid rgba(var(--accent-rgb),0.22);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: rgba(var(--ink-rgb),0.80);
  line-height: 1.5;
}
.tokens-scope-info code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #d4f2ec;
}
.tokens-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tokens-summary-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}
.tokens-summary-card.highlight {
  background: linear-gradient(135deg, rgba(46,204,113,0.10), rgba(var(--accent-rgb),0.08));
  border-color: rgba(46,204,113,0.30);
}
.tsc-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(var(--ink-rgb),0.55);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tsc-total {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 4px 0;
  line-height: 1.1;
}
.tsc-meta {
  font-size: 11px;
  color: rgba(var(--ink-rgb),0.55);
  line-height: 1.4;
}
.tsc-meta span { white-space: nowrap; }
.tsc-trend {
  margin-top: 6px;
  font-size: 11px;
}

.tokens-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.tokens-section-h {
  margin: 18px 0 8px 0;
  font-size: 13px;
  color: rgba(var(--ink-rgb),0.75);
}

.tokens-table-wrap {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: auto;
  max-height: 360px;
}
.tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tokens-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20, 25, 50, 0.95);
  backdrop-filter: blur(6px);
  color: rgba(var(--ink-rgb),0.75);
  font-weight: 600;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  white-space: nowrap;
}
.tokens-table thead th:first-child { text-align: left; }
.tokens-table tbody td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(var(--ink-rgb),0.85);
  white-space: nowrap;
}
.tokens-table tbody td:first-child { text-align: left; }
.tokens-table tbody tr:hover td { background: rgba(255,255,255,0.03); }
.tokens-table tbody td code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #d4f2ec;
}
.tokens-table .muted { text-align: center; color: rgba(var(--ink-rgb),0.45); }

@media (max-width: 900px) {
  .tokens-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 500px) {
  .tokens-summary-grid { grid-template-columns: 1fr; }
  .tokens-table { font-size: 11px; }
  .tokens-table thead th, .tokens-table tbody td { padding: 5px 6px; }
}

/* ===== Heartbeat status bar (floating, spodní hrana) ===== */
/* Vlákno t_973f0a0b9287c31c msg 749. Tomáš: zaoblený display iPhonu ořezává text — posun
   bar nahoru (safe-area-inset-bottom + gap), border-radius pro floating look, a animace
   3 teček v labelu jen když pracuje (idle = nic, žádné tečky). */
.hb-box {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: -3px;
  bottom: calc(env(safe-area-inset-bottom, 0px) - 3px);
  max-width: 600px;
  margin: 0 auto;
  /* Pod FABy (150), nad tab barem (90) - FAB nesmí být zakrytý (iOS fix 2026-09-01) */
  z-index: 120;
  background: rgba(20, 20, 28, 0.92);
  color: #d6dedd;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  padding: 5px 14px;
  min-height: 24px;
  font-size: 11px;
  line-height: 1.3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  /* iOS fix (2026-09-01): bar je jen informativní - NESMÍ krást tapy prvkům
     pod sebou (spodní tab bar, tlačítka v modal-foot). */
  pointer-events: none;
}
.hb-box.hidden { display: none; }

.hb-box .hb-label {
  flex: 1 1 auto;
  font-weight: 500;
  color: #c7f0d6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hb-box.is-stale .hb-label { color: #ffb86c; }
.hb-box .hb-time {
  flex: 0 0 auto;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.hb-box.is-stale .hb-time { color: #ff8a65; opacity: 0.9; }

/* Animované 3 tečky za labelem — JEN když má .hb-dots class (active stav).
   Sekvence: . → .. → ... → (prázdno) → . → .. → ... — cyklus 1.2 s.
   Fixed width zabraňuje skákání layoutu. */
.hb-box .hb-dots::after {
  content: '';
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: hb-dots-pulse 1.2s steps(1) infinite;
}
@keyframes hb-dots-pulse {
  0%   { content: ''; }
  25%  { content: ' .'; }
  50%  { content: ' ..'; }
  75%  { content: ' ...'; }
  100% { content: ''; }
}

/* Skryj zděděné prvky ze staré verze, kdyby cache poslala starý markup */
.hb-box .hb-row1, .hb-box .hb-row2, .hb-box .hb-row3, .hb-box .hb-detail,
.hb-box .hb-icon, .hb-box .hb-pill { display: none !important; }

/* Padding na body, aby floating bar nepřekrýval obsah/tlačítka */
body.has-heartbeat-bar { padding-bottom: 50px; }

@media (max-width: 720px) {
  .hb-box { font-size: 10.5px; padding: 5px 10px; left: 8px; right: 8px; }
  body.has-heartbeat-bar { padding-bottom: 48px; }
}


/* ===== emaily2: Nastavení — Know-how / Sekvence / Přístupy ===== */
/* 5 tabů se na mobilu nevejde do řádku → horizontální scroll */
.settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab { white-space: nowrap; flex: 1 0 auto; }

.kb-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.kb-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
}
.kb-cat-head {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(var(--ink-rgb),0.45);
  margin: 14px 2px 6px;
}
.kb-item { cursor: pointer; }

/* Heartbeat sekvence */
.hb-item { display: flex; align-items: center; gap: 8px; }
.hb-item.hb-disabled .ri-main { opacity: 0.45; }
.hb-order { display: flex; flex-direction: column; gap: 2px; }
.hb-order button {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  color: rgba(var(--ink-rgb),0.7);
  font-size: 9px;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
}
.hb-order button:disabled { opacity: 0.25; cursor: default; }
.hb-stale-warn {
  background: rgba(255,120,80,0.12);
  border: 1px solid rgba(255,120,80,0.35);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.hb-log { margin-top: 12px; }

/* Přístupy (secrets) */
.secrets-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.secrets-form input {
  flex: 1 1 160px;
  min-width: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
}

/* Edit modály (KB + HB krok) */
.modal-panel-wide { max-width: 760px; width: min(760px, calc(100vw - 24px)); }
.kbe-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#kbe-body, #hbe-prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
}
.kbe-history-row { margin-top: 8px; }
#kbe-history {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  max-width: 100%;
}
.btn-danger-ghost { color: #ff8a7a !important; margin-right: auto; }

@media (max-width: 560px) {
  .kbe-meta-row { grid-template-columns: 1fr; }
  .secrets-form input { flex-basis: 100%; }
  .secrets-form button { flex: 1; }
}

/* ==========================================================================
   emaily2 — UX 2.0 (mobil-first, ikonkové ovládání palcem)
   Fable5 UX review 2026-07-02: spodní tab bar, větší touch-targety,
   iOS anti-zoom, undo archivace, „Více" sheet, čistší topbar.
   ========================================================================== */

/* --- SPODNÍ TAB BAR ------------------------------------------------------- */
.tabbar {
  flex: 0 0 auto; z-index: 90;
  display: flex; align-items: stretch;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.10);
  border-radius: 0;
  background: rgba(11,17,21,0.86);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}
.tabbar .tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; position: relative;
  background: none; border: 0; cursor: pointer;
  padding: 6px 2px; border-radius: 14px;
  color: rgba(var(--ink-rgb),0.62);
  transition: color 0.15s, background 0.15s, transform 0.1s;
  min-height: 52px;
}
.tabbar .tab .tab-ico { font-size: 21px; line-height: 1; }
.tabbar .tab .tab-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }
.tabbar .tab:active { transform: scale(0.93); }
.tabbar .tab.active {
  color: var(--accent-soft);
  background: rgba(var(--accent-rgb),0.14);
}
.tabbar .tab.active .tab-lbl { color: var(--accent-soft); }
.tabbar .tab-badge {
  position: absolute; top: 2px; right: 50%; transform: translateX(20px);
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #ff5b6e; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 2px 6px rgba(255,91,110,0.5);
}
.tabbar .tab-badge.hidden { display: none; }
body.modal-open .tabbar { display: none; }

/* Obsah nad tab barem + FABy nad tab barem (na hlavním view) */
.content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
#fab-tts-new { bottom: calc(150px + env(safe-area-inset-bottom)); }
/* V modalu je tab bar skrytý → FABy dolů (TTS v detailu apod.) */
body.modal-open .fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
body.modal-open #fab-tts-new { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* Heartbeat bar vs. spodní navigace (iOS fix 2026-09-01):
   - na hlavním view bar seděl PŘES tab bar → zakrýval popisky a kradl tapy
     (Schránka/CC/Slack byly mrtvé v dolní půlce) → posun NAD tab bar;
   - v otevřeném modalu překrýval tlačítka v patičce (CC / Číst / Přeposlat
     v detailu emailu) → v modalu bar úplně schovat. */
body:not(.modal-open) .hb-box { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
body.modal-open .hb-box { display: none; }
/* Když bar sedí nad tab barem, poslední karta v inboxu potřebuje víc místa */
body.has-heartbeat-bar .content { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

/* --- ČISTŠÍ TOPBAR: přesunuté ikony schované (žijí v tab baru / „Více") --- */
#btn-slack-tab, #btn-cc-tab, #btn-tender-tab,
#btn-settings, #btn-planner-open, #btn-refresh { display: none; }

/* --- „VÍCE" ACTION SHEET -------------------------------------------------- */
.sheet-panel { max-width: 520px; }
.more-sheet { display: flex; flex-direction: column; gap: 8px; }
.more-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px; padding: 15px 16px;
  color: var(--ink); font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; min-height: 54px;
  transition: background 0.15s, transform 0.1s;
}
.more-item:active { transform: scale(0.98); background: rgba(255,255,255,0.09); }
.more-item .more-ico { font-size: 20px; width: 26px; text-align: center; }
.more-item .more-arrow { margin-left: auto; color: rgba(var(--ink-rgb),0.4); font-size: 20px; }
.more-item.hidden { display: none; }

/* --- VĚTŠÍ TOUCH TARGETY (Apple min 44px, kde to jde) -------------------- */
.mini-btn {
  padding: 7px 12px; font-size: 12.5px;
  min-height: 34px; display: inline-flex; align-items: center; gap: 3px;
}
.ri-actions { gap: 6px; }
.ri-actions button { min-height: 36px; min-width: 36px; padding: 7px 10px; font-size: 14px; }
.hb-order button { font-size: 12px; padding: 5px 9px; min-width: 30px; }

/* --- LÁMÁNÍ DLOUHÝCH NÁZVŮ (nelámat po znaku, jen dlouhé tokeny) --------- */
.ri-pattern { word-break: normal; overflow-wrap: anywhere; }
.ri-title, .ri-main, .kb-item .ri-title, .hb-item .ri-title {
  overflow-wrap: anywhere; word-break: normal;
}

/* --- UNDO TOAST ---------------------------------------------------------- */
.toast-action {
  margin-left: 12px; padding: 5px 12px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px; color: #fff; font: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer; white-space: nowrap; min-height: 30px;
}
.toast-action:active { transform: scale(0.95); }

/* --- SCROLLOVATELNÉ TABY (settings + tender) s fade affordance ----------- */
.tender-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tender-tabs::-webkit-scrollbar { display: none; }
.tender-tab { white-space: nowrap; flex: 1 0 auto; }

/* --- iOS ANTI-ZOOM: textová pole ≥16px na mobilu (jinak Safari zoomuje) -- */
@media (max-width: 560px) {
  input:not([type=radio]):not([type=checkbox]):not([type=range]),
  textarea, select {
    font-size: 16px !important;
  }
  .tabbar .tab .tab-lbl { font-size: 10px; }
}

/* --- DETAIL EMAILU: 5 tlačítek se na 390px mačkalo → prioritní 2-řádkový layout.
   1. řádek: 🎙 Odpovědět (primární, široké) + ✓ HOTOVO. 2. řádek: CC / Číst / Přeposlat. */
#modal-email .modal-foot { flex-wrap: wrap; }
#modal-email .modal-foot .btn { flex: 1 1 auto; min-width: 92px; min-height: 46px; }
#modal-email #btn-voice-reply { order: 1; flex: 2 1 55%; }
#modal-email #btn-archive { order: 2; flex: 1 1 38%; }
#modal-email #btn-cc-from-email,
#modal-email #btn-tts-email,
#modal-email #btn-forward { order: 3; flex: 1 1 30%; min-height: 42px; font-size: 13px; }

/* --- DRIVE PICKER: ⭐ Zkratky (nejčastější složky) ----------------------- */
.dp-favorites { margin: 4px 0 10px; }
.dp-fav-head {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(var(--ink-rgb),0.5); margin: 0 2px 8px;
}
.dp-fav-empty, .dp-fav-loading { font-size: 13px; padding: 6px 2px; }
.dp-fav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dp-fav-chip {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.14), rgba(var(--accent2-rgb),0.12));
  border: 1px solid rgba(var(--accent-rgb),0.30);
  border-radius: 14px; padding: 12px 12px; min-height: 52px;
  color: #fff; font: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.dp-fav-chip:active { transform: scale(0.97); }
.dp-fav-chip:hover { border-color: rgba(var(--accent-rgb),0.55); }
.dp-fav-ico { font-size: 18px; flex-shrink: 0; }
.dp-fav-name {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dp-fav-count { flex-shrink: 0; font-size: 11px; font-weight: 700; }
.dp-browse-toggle {
  display: block; width: 100%; margin-bottom: 6px;
  background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.20);
  border-radius: 12px; padding: 12px; min-height: 46px;
  color: rgba(var(--ink-rgb),0.8); font: inherit; font-weight: 600; cursor: pointer;
}
.dp-browse-toggle:active { transform: scale(0.99); background: rgba(255,255,255,0.09); }
@media (max-width: 380px) { .dp-fav-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   iOS / mobil tap-target audit (2026-09-01)
   Cíl: všechno reaguje na tap, žádné mrtvé zóny, žádný sticky :hover.
   Aditivní blok - nemění vzhled, jen hit-zóny a touch chování.
   ========================================================================== */

/* Malé ikonové buttony (38px vizuálně) - neviditelně rozšířená tap zóna
   na ~48px. ::after je transparentní, klik na něj patří buttonu. */
.iconbtn { position: relative; }
.iconbtn::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 14px;
}

/* Kolečko filtru účtů v topbaru je 28px - tap zóna rozšířena na 44px */
.acct-filter .af-cycle { position: relative; }
.acct-filter .af-cycle::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
}

/* Křížek u chipu (příjemci v plánovači) - větší tap zóna bez posunu layoutu */
.chip .chip-x { padding: 6px 8px; margin: -6px -8px -6px -4px; }
/* Křížek u chipu klíčových slov (Tendery → Nastavení) */
.chip-input .chip-x { padding: 6px 8px; margin: -6px -4px -6px -2px; }

/* Mini akce v inbox kartě (🤖 CC / 🪄 / ✓) - pohodlnější palcem */
.mini-btn { min-height: 38px; }
/* Akce u pravidel / know-how položek */
.ri-actions button { min-height: 40px; min-width: 40px; }
.btn-drive-save { min-height: 38px; min-width: 38px; }

/* Modal scroll: nepropagovat scroll na pozadí (iOS scroll-chaining) */
.modal-body { overscroll-behavior: contain; }
.chat { overscroll-behavior: contain; }

/* Sticky :hover na dotyku - na iOS zůstane hover stav "přilepený" po tapu.
   Na zařízeních bez myši vracíme klidový vzhled. */
@media (hover: none) {
  .email-item:hover { background: rgba(255,255,255,0.05); }
  .email-item.unread:hover { background: rgba(var(--accent-rgb),0.10); }
  .cc-item:hover { background: rgba(255,255,255,0.05); }
  .slack-item:hover { background: transparent; }
  .iconbtn:hover { background: rgba(255,255,255,0.05); }
  .btn-ghost:hover { background: rgba(255,255,255,0.06); }
  .pin-key:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
  .fab:hover { transform: none; }
  .tender-tab:hover { color: rgba(var(--ink-rgb),0.65); background: transparent; }
  .tender-tab.active:hover {
    color: #fff;
    background: rgba(var(--accent-rgb),0.16);
  }
}

/* ===== ČTENÍ MAILU v2 (2026-09-02, v216) ==================================
   Tomáš: "čtení mailů je hnus". Plaintext fallback -> proporcionální systémové
   písmo, čitelná velikost, citovaná historie za 📜 toggle, klidnější karty. */

/* Tělo plaintext mailu - žádný terminál, normální čtečka */
.mail-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  color: rgba(var(--ink-rgb),0.94);
}
.mail-text a { color: #58d5c0; text-decoration: underline; word-break: break-all; }

/* Citovaná historie (uvnitř #d-full) - ztlumená, odsazená */
.mail-quoted {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(var(--ink-rgb),0.60);
  border-left: 3px solid rgba(255,255,255,0.15);
  padding-left: 10px;
}

/* ⏳ stav "shrnutí se připravuje" - decentní, ne oranžový 💡 box */
.email-summary.summary-pending {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(var(--ink-rgb),0.55);
  font-style: italic;
}

/* Karta ve schránce: AI shrnutí čitelněji (ukazuje se JEN když je reálné) */
.email-item .ei-summary {
  font-style: normal;
  font-size: 12px;
  color: rgba(255,217,168,0.80);
}

/* Akční mini tlačítka na kartě - vizuálně lehčí, touch target zůstává */
.email-item .ei-row-actions { gap: 8px; margin-top: 6px; }
.email-item .mini-btn {
  opacity: 0.85;
  font-size: 11.5px;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.email-item .mini-btn:active { opacity: 1; }

/* Detail na mobilu: tělo na plnou šířku, o chlup větší text i pro HTML maily */
@media (max-width: 560px) {
  .email-body-html { padding: 12px 12px; font-size: 15.5px; }
}

/* Verze appky v "Více" sheetu */
.app-version-line {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: rgba(var(--ink-rgb),0.40);
}

/* ===== 🔔 Notifikace (nastavení) ===== */
.notif-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; min-height: 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px; cursor: pointer;
}
.notif-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* ===== CC vlákno: hlavička (18.9.2026) =====
   Štítek stavu je pod názvem, ne vedle něj - vedle ukrajoval půlku šířky
   a předmět se lámal do pěti řádků. Název max 2 řádky, pak výpustka. */
.cct-status-row { margin-top: 8px; }
.modal-cc-thread .modal-head h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.25;
}
.modal-cc-thread .modal-head-right { align-items: flex-start; }

/* Přepsání draftu - zadání, čím ho vylepšit */
.draft-redo {
  margin-top: 10px; padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(var(--accent-rgb),0.25);
  border-radius: 12px;
}
.draft-redo textarea {
  width: 100%; font: inherit; font-size: 16px;  /* 16px = iOS nezoomuje */
  background: rgba(0,0,0,0.25); color: var(--ink);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 10px;
}
/* Proklik z CC seznamu zpátky na původní mail */
.cc-from-mail {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 4px 8px; font-size: 13px; cursor: pointer;
  min-height: 32px; min-width: 36px;
}
.cc-from-mail:hover { background: rgba(255,255,255,0.12); }
.status-row { display: flex; align-items: center; gap: 8px; }

/* Štítek stavu vedle odesílatele, ne na vlastním řádku (Tomáš 18.9.2026) */
.cct-subrow {
  display: flex; align-items: center; gap: 8px;
  justify-content: space-between; margin-top: 2px;
}
.cct-subrow #cct-sub {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cct-subrow .status-pill { flex-shrink: 0; }

/* „Hotovo, neodesílat" v draft kartě - v draft módu je spodní lišta skrytá */
.draft-done {
  width: 100%; margin-top: 8px; min-height: 44px;
  color: rgba(var(--ink-rgb),0.75);
}

/* ===== CC vlákno: nejnovější nahoře (18.9.2026) =====
   Starší zprávy jsou potlačené, ať oko padne na aktuální výměnu.
   Po najetí/dotyku se vrátí do plné čitelnosti. */
.modal-cc-thread .msg-old { opacity: 0.58; transition: opacity 0.15s ease; }
.modal-cc-thread .msg-old:hover,
.modal-cc-thread .msg-old:focus-within { opacity: 1; }
/* Originál mailu je na konci vlákna - odděl ho, ať je jasné, že je to podklad */
.modal-cc-thread .cc-email-html-preview { margin-top: 18px; }

/* Mrtvý loop - poplach, ne šedý text v rohu (18.9.2026) */
#heartbeat-status-box.is-dead {
  background: rgba(200, 60, 60, 0.92) !important;
  border-color: rgba(255,120,120,0.8) !important;
  color: #fff;
}
#heartbeat-status-box.is-dead .hb-label { font-weight: 700; color: #fff; }
#heartbeat-status-box.is-dead .hb-time { color: rgba(255,255,255,0.85); }

/* Přílohy draftu — proužek nad tlačítkem Odeslat v CC draft kartě (19.9.2026). */
.draft-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.draft-att {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 5px 10px; border-radius: 999px;
  background: var(--bg-soft, rgba(127,127,127,.12));
  border: 1px solid var(--border, rgba(127,127,127,.25));
  font-size: 12px; line-height: 1.3;
}
.draft-att .att-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
.draft-att .att-size { opacity: .6; flex: none; }
