/* MC — rozhranie. Alysum dizajn: svetlé, ploché (bez tieňov a prechodov), mriežka 4 px, zaoblenie 8 px. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --primary: #111827;
  --primary-text: #ffffff;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --ok: #059669;   --ok-soft: #ecfdf5;
  --warn: #d97706; --warn-soft: #fffbeb;
  --bad: #dc2626;  --bad-soft: #fef2f2;
  --fb: #1877f2;   --fb-soft: #e8f1fe;
  --ig: #d6249f;   --ig-soft: #fce7f3;
  --li: #0a66c2;
  --r: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

/* ---------- tlačidlá a polia ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: #1f2937; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); }
textarea.input { height: auto; min-height: 120px; padding: 8px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; }
label.field { display: grid; gap: 4px; }
label.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- prihlásenie ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 32px; display: grid; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.logo-mark { width: 28px; height: 28px; border-radius: var(--r); background: var(--primary); color: #fff; display: grid;
  place-items: center; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.err { color: var(--bad); font-size: 12px; min-height: 16px; }

/* ---------- rozloženie ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column;
  gap: 16px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 8px; }
.nav-group { display: grid; gap: 4px; }
.nav-label { font-size: 12px; color: var(--faint); font-weight: 500; padding: 8px 8px 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-link { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 8px; border-radius: var(--r); color: var(--muted);
  cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-link svg { width: 16px; height: 16px; flex: none; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--faint); }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin-right: auto; }
.page { padding: 24px; display: grid; gap: 24px; align-content: start; }

/* ---------- karty ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin-right: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: grid; gap: 4px;
  align-content: space-between; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.banner { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r); padding: 12px 16px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); border-color: #fde68a; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r); }

/* ---------- sieťové značky ---------- */
.net { width: 20px; height: 20px; border-radius: 4px; display: inline-grid; place-items: center; color: #fff; font-size: 10px;
  font-weight: 700; flex: none; text-transform: lowercase; }
.net.facebook { background: var(--fb); }
.net.instagram { background: var(--ig); }
.net.linkedin { background: var(--li); }

/* ---------- stavové štítky ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 4px; font-size: 12px;
  font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.tag.scheduled { background: var(--accent-soft); color: var(--accent); border-color: #c7d2fe; }
.tag.published { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.tag.error { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.tag.publishing { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }

/* ---------- výber profilov (chips) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 8px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 500; }
.chip:hover { background: var(--surface-2); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.plain { padding: 0 12px; }

/* ---------- kalendár ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { font-size: 16px; font-weight: 600; min-width: 160px; text-transform: capitalize; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; }
.seg button { height: 34px; padding: 0 12px; border: 0; background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--primary); color: #fff; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-head div { padding: 8px 12px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.day { min-height: 128px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; display: flex;
  flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: var(--surface-2); }
.day.out .dnum { color: var(--faint); }
.day.past { background: #fbfbfc; }
.day.drop { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -2px; }
.dnum { font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; height: 24px; }
.dnum .n { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r); }
.day.today .dnum .n { background: var(--primary); color: #fff; }
.dnum .add { opacity: 0; font-size: 16px; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r); }
.day:hover .dnum .add { opacity: 1; }
.dnum .add:hover { background: var(--border); color: var(--text); }
.week .day { min-height: 480px; }
.pc { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; min-width: 0; cursor: grab; border-left-width: 4px; }
.pc:hover { border-color: var(--border-strong); }
.pc.facebook { border-left-color: var(--fb); }
.pc.instagram { border-left-color: var(--ig); }
.pc.mixed { border-left-color: var(--accent); }
.pc.published { background: var(--ok-soft); }
.pc.error { background: var(--bad-soft); }
.pc.draft { border-style: dashed; border-left-style: solid; }
.pc .t { font-weight: 600; flex: none; }
.pc .x { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--muted); }
.pc .nets { display: inline-flex; gap: 2px; flex: none; }
.pc .nets .net { width: 14px; height: 14px; font-size: 8px; border-radius: 4px; }
.week .pc { flex-wrap: wrap; align-items: flex-start; padding: 8px; }
.week .pc .x { white-space: normal; width: 100%; color: var(--text); }
.more { font-size: 12px; color: var(--accent); font-weight: 500; padding: 0 4px; }
.cal-side { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.drafts { display: grid; gap: 8px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- modálne okno ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--r); width: 100%; max-width: 960px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal.narrow { max-width: 560px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin-right: auto; }
.modal-body { padding: 24px; overflow: auto; display: grid; gap: 16px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); }
.modal-foot .spacer { margin-right: auto; }
.compose { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.compose-form { display: grid; gap: 16px; align-content: start; }
.counter { font-size: 12px; color: var(--muted); text-align: right; }
.counter.over { color: var(--bad); font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); }
.hint.warn { color: var(--warn); }

/* náhľad príspevku */
.preview { display: grid; gap: 12px; align-content: start; }
.pv-tabs { display: flex; gap: 4px; }
.pv { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.pv-top { display: flex; align-items: center; gap: 8px; padding: 12px; }
.pv-av { width: 32px; height: 32px; border-radius: var(--r); background: var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.pv-name { font-weight: 600; font-size: 12px; line-height: 1.2; }
.pv-sub { font-size: 12px; color: var(--muted); line-height: 1.2; }
.pv-text { padding: 0 12px 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.pv-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--surface-2); }
.pv-img.ph { display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.pv.instagram .pv-text { padding-top: 12px; }
.pv-bar { display: flex; gap: 16px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---------- tabuľky / zoznamy ---------- */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .main-txt { min-width: 0; flex: 1; }
.li .main-txt .x { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .when { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- profily ---------- */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pf { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.pf-top { display: flex; align-items: center; gap: 12px; }
.pf-top .net { width: 36px; height: 36px; font-size: 14px; border-radius: var(--r); }
.pf-name { font-weight: 600; }
.pf-id { font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- automatizácie (chatbot) ---------- */
.flows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.flow { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); display: grid; }
.flow.off { background: var(--surface-2); }
.flow.off .flow-body { color: var(--muted); }
.flow-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.flow-head h3 { margin-right: auto; }
.flow-body { padding: 16px; display: grid; gap: 12px; }
.step { display: grid; gap: 8px; }
.step-label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.kw { display: inline-flex; height: 24px; align-items: center; padding: 0 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.connector { width: 2px; height: 12px; background: var(--border-strong); margin-left: 16px; }
.bubble { max-width: 100%; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.bubble.out { background: #e7f8ee; border-color: #bbf0cf; }
.flow-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.toggle { position: relative; width: 36px; height: 20px; border-radius: 4px; background: var(--border-strong); border: 0; cursor: pointer; flex: none; padding: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 4px; background: #fff; }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 18px; }
.tester { display: grid; gap: 12px; }
.tester-out { display: grid; gap: 8px; min-height: 40px; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-row .bubble { max-width: 80%; }

/* ---------- konverzácie (inbox) ---------- */
.inbox { display: grid; grid-template-columns: 300px 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  min-height: 520px; overflow: hidden; }
.contacts { border-right: 1px solid var(--border); overflow: auto; }
.contact { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: center; }
.contact:hover { background: var(--surface-2); }
.contact.on { background: var(--accent-soft); }
.avatar { width: 36px; height: 36px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.contact .c-main { min-width: 0; flex: 1; }
.contact .c-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; }
.thread-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.thread-body { padding: 16px; display: grid; gap: 8px; align-content: start; overflow: auto; flex: 1; background: var(--surface-2); }
.meta-line { font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- analytika ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: grid; gap: 8px; }
.metric .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.spark { width: 100%; height: 48px; display: block; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
code.inline { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 12px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 16px; right: 16px; background: var(--primary); color: #fff; padding: 12px 16px; border-radius: var(--r);
  font-size: 14px; z-index: 60; max-width: 360px; }
.toast.bad { background: var(--bad); }

/* ---------- mobil ---------- */
@media (max-width: 1100px) {
  .cal-side { grid-template-columns: 1fr; }
  .compose { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px 12px; gap: 8px;
    border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-group { display: flex; gap: 4px; }
  .nav-label, .nav-count { display: none; }
  .nav-link { width: auto; white-space: nowrap; }
  .side-foot { margin: 0; display: flex; }
  .topbar { padding: 0 16px; position: static; height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
  .page { padding: 16px; }
  .grid-2, .inbox { grid-template-columns: 1fr; }
  .contacts { border-right: 0; border-bottom: 1px solid var(--border); max-height: 240px; }
  .cal-head div { padding: 8px 4px; text-align: center; }
  .day { min-height: 72px; padding: 4px; }
  .pc .x, .pc .nets { display: none; }
  .week .cal-grid, .week .cal-head { grid-template-columns: 1fr; }
  .week .cal-head { display: none; }
  .week .day { min-height: 0; border-right: 0; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- najlepší čas ---------- */
.star { color: #d97706; font-weight: 700; }
.bests { display: flex; gap: 4px; flex-wrap: wrap; }
.best { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 4px; border-radius: 4px; font-size: 12px; color: #92400e;
  background: var(--warn-soft); border: 1px dashed #fcd34d; cursor: pointer; }
.best:hover { border-style: solid; }
.best-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 0; }
.best-row:empty { display: none; }
.best-chip { height: 28px; }

/* ---------- editor: nástroje, AI, rozbaľovačky ---------- */
.tool-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: relative; }
.tool-row > .btn { position: relative; }
.ai-btn { border-color: var(--accent); color: var(--accent); }
.ai-btn:hover { background: var(--accent-soft); }
.ai-panel { border: 1px solid #c7d2fe; background: var(--accent-soft); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.ai-out { display: grid; gap: 8px; }
.variant { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.variant-text { white-space: pre-wrap; font-size: 13px; }
.dd { position: absolute; z-index: 70; top: 36px; min-width: 280px; max-width: 360px; max-height: 320px; overflow: auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r); padding: 4px; display: grid; }
.dd button { display: grid; gap: 4px; text-align: left; border: 0; background: none; padding: 8px; border-radius: 4px; cursor: pointer; }
.dd button:hover { background: var(--surface-2); }
.dd button span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-empty { padding: 12px; font-size: 12px; color: var(--muted); }
.pv-tag { color: #1d4ed8; }

/* ---------- šablóny ---------- */
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tpl { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.tpl-content { font-size: 13px; color: var(--muted); white-space: pre-wrap; max-height: 96px; overflow: hidden; }

/* ---------- report pre klienta ---------- */
.report-form { display: grid; grid-template-columns: 1fr 200px; gap: 16px; }
.report-view { position: fixed; inset: 0; z-index: 80; background: #e5e7eb; overflow: auto; padding: 0 16px 32px; }
.rv-bar { position: sticky; top: 0; display: flex; gap: 8px; align-items: center; padding: 12px 0; background: #e5e7eb; max-width: 794px; margin: 0 auto; z-index: 2; }
.sheet { background: #fff; width: 100%; max-width: 794px; margin: 0 auto; padding: 48px; color: #111827; border: 1px solid var(--border); }
.rp-head { border-bottom: 2px solid #111827; padding-bottom: 24px; margin-bottom: 24px; }
.rp-brand { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 32px; }
.rp-logo { height: 20px; width: auto; }
.rp-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.rp-title { font-size: 32px; font-weight: 700; margin: 8px 0 4px; }
.rp-month { font-size: 16px; color: var(--muted); text-transform: capitalize; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.rp-kpis div { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; align-content: space-between; }
.rp-kpis span { font-size: 12px; color: var(--muted); }
.rp-kpis b { font-size: 24px; }
.rp-sec { margin-bottom: 32px; break-inside: avoid-page; }
.rp-sec h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.rp-summary { font-size: 14px; line-height: 1.6; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); outline: none; }
.rp-summary:focus { border-color: var(--accent); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rp-table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border-strong); padding: 8px 4px; }
.rp-table td { border-bottom: 1px solid var(--border); padding: 8px 4px; vertical-align: top; }
.rp-table .r { text-align: right; white-space: nowrap; }
.rp-table td:first-child { white-space: nowrap; }
.rp-text { max-width: 280px; }
.rp-muted { color: var(--muted); }
.rp-note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.rp-foot { border-top: 1px solid var(--border); padding-top: 12px; font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .report-form { grid-template-columns: 1fr; }
  .sheet { padding: 24px; }
  .rp-kpis { grid-template-columns: 1fr 1fr; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body.reporting { background: #fff; }
  body.reporting > *:not(#reportView) { display: none !important; }
  body.reporting .report-view { position: static; padding: 0; background: #fff; overflow: visible; }
  .no-print { display: none !important; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .rp-summary { border: 0; padding: 0; }
}
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.logo-img { width: 28px; height: 28px; display: block; }
@media print {
  .rp-kpis { grid-template-columns: repeat(4, 1fr) !important; }
  .sheet { padding: 0 !important; }
}
.logo-wordmark { height: 28px; width: auto; display: block; }
.logo-login { height: 40px; width: auto; display: block; }
.side .logo { padding: 4px 8px; }

/* =================== v3: profily, sprievodca, dashboard, editor, inbox =================== */
a { color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.block { display: block; }

/* ---- fotka profilu ---- */
.pav { position: relative; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; }
.pav img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; }
.pav-ini { color: #fff; font-weight: 700; font-size: calc(var(--s) * 0.38); line-height: 1; letter-spacing: -0.02em; }
.pav-net { position: absolute; right: -2px; bottom: -2px; width: max(12px, calc(var(--s) * 0.42)); height: max(12px, calc(var(--s) * 0.42));
  border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center; color: #fff; font-size: max(6px, calc(var(--s) * 0.2)); font-weight: 700; }
.pav-net.facebook { background: var(--fb); }
.pav-net.instagram { background: var(--ig); }
.chip .pav { --s: 20px; }
.av-stack { display: flex; }
.av-stack .pav + .pav { margin-left: -8px; }
.av-stack .pav img, .av-stack .pav { box-sizing: content-box; }
.av-stack.sm .pav + .pav { margin-left: -6px; }
.pc .pav { --s: 16px; }
.pc .pav .pav-net { display: none; }
.pc .nets { gap: 0; }
.pc .nets .pav + .pav { margin-left: -4px; }

/* ---- hero / prázdne stavy ---- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px; }
.hero h2 { font-size: 20px; margin-bottom: 8px; }
.hero p { margin: 0 0 16px; max-width: 560px; }
.hero-steps { display: grid; gap: 8px; }
.hero-steps div { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.hero-steps b { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; }

/* ---- značky a profily ---- */
.brands { display: grid; gap: 16px; }
.brand { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.brand-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.brand-head h2 { font-size: 16px; }
.prow-list { display: grid; }
.prow { display: grid; grid-template-columns: auto 1fr 120px 160px auto; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.prow:last-child { border-bottom: 0; }
.prow.off { background: var(--surface-2); }
.prow.off .prow-name { color: var(--muted); }
.prow-name { font-weight: 600; }
.prow-stat { display: grid; text-align: right; }
.prow-stat b { font-size: 16px; }
.prow .tag { justify-self: start; }
.prow-act { display: flex; gap: 8px; position: relative; }
.dd-right { right: 0; left: auto; top: 32px; }
.dd button.danger-item b { color: var(--bad); }
details.adv { border: 1px solid var(--border); border-radius: var(--r); }
details.adv summary { padding: 12px; cursor: pointer; font-weight: 500; font-size: 13px; }
.adv-body { padding: 0 12px 12px; display: grid; gap: 12px; }
.banner.ok { background: var(--ok-soft); border-color: #a7f3d0; color: #065f46; }
.modal-head .pav { margin-right: -4px; }

/* ---- sprievodca ---- */
.wizard { display: grid; grid-template-columns: 240px 1fr; min-height: 0; overflow: hidden; flex: 1; height: min(720px, calc(100vh - 120px)); }
.wz-steps { border-right: 1px solid var(--border); padding: 16px 12px; display: grid; gap: 4px; align-content: start; background: var(--surface-2); }
.wz-steps button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: var(--r); border: 1px solid transparent; background: none; cursor: pointer; }
.wz-steps button b { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; flex: none; background: #fff; }
.wz-steps button span { display: grid; font-weight: 500; }
.wz-steps button small { color: var(--muted); font-weight: 400; font-size: 12px; }
.wz-steps button.on { background: var(--surface); border-color: var(--border); }
.wz-steps button.on b { border-color: var(--accent); color: var(--accent); }
.wz-steps button.done b { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 0; }
.wz-steps button.done b::after { content: "✓"; font-size: 13px; }
.wz-body { padding: 24px; overflow: auto; display: grid; gap: 16px; align-content: start; }
.wz-body h3 { font-size: 16px; }
.wz-body p { margin: 0; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.howto li { line-height: 1.6; }
.chips-inline code { margin: 2px 2px 0 0; display: inline-block; }
.wz-foot { display: flex; gap: 8px; align-items: center; }
.fb-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.btn.fb { background: var(--fb); border-color: var(--fb); color: #fff; height: 44px; padding: 0 20px; font-size: 15px; }
.btn.fb:hover { background: #166fe0; }
.btn.fb .net { background: #fff; color: var(--fb); }
.pick-list { display: grid; gap: 12px; }
.pick { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.pick-brand .field { max-width: 320px; }
.pick-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r); cursor: pointer; }
.pick-row:hover { background: var(--surface-2); }
.pick-row .grow { display: grid; }
.pick-row input[type=checkbox] { width: 16px; height: 16px; }

/* ---- dashboard ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-hello { font-size: 24px; margin-bottom: 4px; }
.setup .card-head { flex-wrap: wrap; }
.progress { width: 100%; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); }
.setup-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.setup-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--r); padding: 12px; }
.setup-item .check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; font-size: 11px; color: #fff; font-weight: 700; }
.setup-item.ok .check { background: var(--ok); border-color: var(--ok); }
.setup-item.ok b { color: var(--muted); }
.bcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; cursor: pointer; }
.bcard:hover { border-color: var(--border-strong); }
.bcard-name { font-size: 16px; }
.bcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bcard-stats div { display: grid; }
.bcard-stats b { font-size: 20px; }
.bcard-stats span { font-size: 12px; color: var(--muted); }
.bcard-next { border-top: 1px solid var(--border); padding-top: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-row { cursor: pointer; }
.up-date { width: 40px; display: grid; text-align: center; flex: none; border: 1px solid var(--border); border-radius: var(--r); padding: 4px 0; }
.up-date b { font-size: 16px; line-height: 1.2; }
.up-date span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.up-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex: none; }
.card-head a { text-decoration: none; }

/* ---- zoznam automatizácií ---- */
.ftable { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.frow { display: grid; grid-template-columns: 1.4fr 1.6fr 70px 120px 70px 150px; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.frow:last-child { border-bottom: 0; }
.frow.fhead { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); }
.frow:not(.fhead):hover { background: var(--surface-2); }
.fname { display: grid; }
.trig { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; color: #047857; }
.trig.welcome { color: #4338ca; }
.trig.default { color: #6b7280; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tpl-card { display: grid; gap: 8px; text-align: left; border: 1px solid var(--border); border-radius: var(--r); padding: 16px; background: var(--surface); cursor: pointer; }
.tpl-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.tpl-ico { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; color: #fff; }

/* ---- vizuálny editor ---- */
body.building { overflow: hidden; }
.builder { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.fb-top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.fb-name { border: 1px solid transparent; border-radius: var(--r); padding: 4px 8px; font-size: 16px; font-weight: 600; min-width: 240px; background: none; }
.fb-name:hover, .fb-name:focus { border-color: var(--border-strong); outline: none; }
.fb-dirty { font-size: 12px; color: var(--warn); }
#fbTest.on { background: #059669; border-color: #059669; color: #fff; }
.fb-main { flex: 1; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.fb-canvas { position: relative; overflow: hidden; background-color: #f4f5f7; cursor: grab;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23d1d5db'/%3E%3C/svg%3E"); background-size: 20px 20px; }
.fb-canvas.panning { cursor: grabbing; }
.fb-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.fb-edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.fb-edges path { fill: none; stroke-width: 2; cursor: pointer; }
.fb-edges path:hover { stroke-width: 4; }
.fb-edges path.temp { stroke-dasharray: 6 4; pointer-events: none; }
.fn { position: absolute; width: 260px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); cursor: default; user-select: none; }
.fn.sel { border-color: var(--c); outline: 2px solid var(--c); outline-offset: 0; }
.fn.drop-target { outline: 2px dashed var(--accent); }
.fn-head { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: move; font-size: 13px; }
.fn-ico { width: 24px; height: 24px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.fn-body { padding: 12px; display: grid; gap: 8px; font-size: 13px; }
.fn-text { white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.fn-img { width: 100%; height: 96px; object-fit: cover; border-radius: 4px; }
.fn-meta { font-size: 12px; color: var(--muted); }
.fn-chip { border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; font-size: 12px; text-align: center; color: var(--accent); }
.fn-trig { font-weight: 600; }
.fn-kws { display: flex; flex-wrap: wrap; gap: 4px; }
.fn-outs { display: grid; border-top: 1px solid var(--border); }
.fn-out { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; font-size: 12px; border-bottom: 1px solid var(--border); }
.fn-out:last-child { border-bottom: 0; }
.fn-out.btn span { flex: 1; border: 1px solid #c7d2fe; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 4px 8px; text-align: center; font-weight: 500; }
.fn-out.yes span { color: #047857; font-weight: 600; }
.fn-out.no span { color: var(--bad); font-weight: 600; }
.fn-out.next span { color: var(--muted); }
.port { position: absolute; right: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; border: 2px solid var(--c, #9ca3af); cursor: crosshair; }
.port.on { background: var(--c, #9ca3af); }
.port:hover { transform: scale(1.3); }
.fn-in { position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #9ca3af; }
.var { background: #ede9fe; color: #6d28d9; border-radius: 4px; padding: 0 4px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.fb-palette { position: absolute; left: 16px; top: 16px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 8px; }
.fb-palette button { display: flex; gap: 8px; align-items: center; border: 0; background: none; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; text-align: left; }
.fb-palette button:hover { background: var(--surface-2); }
.fb-palette button span { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.fb-zoom { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.fb-zoom button { border: 0; background: none; height: 32px; min-width: 32px; padding: 0 8px; cursor: pointer; font-size: 14px; }
.fb-zoom button:hover { background: var(--surface-2); }
.fb-zoom span { font-size: 12px; min-width: 44px; text-align: center; color: var(--muted); }
.fb-hint { position: absolute; right: 16px; bottom: 16px; max-width: 360px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, 0.9); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; }
.dd.quick { min-width: 200px; }
.dd-title { font-size: 12px; color: var(--muted); padding: 8px 8px 4px; font-weight: 500; }
.dd .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.fb-side { background: var(--surface); border-left: 1px solid var(--border); overflow: auto; display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.side-head .fn-ico { background: var(--c); }
.side-body { padding: 16px; display: grid; gap: 16px; }
.side-empty { padding: 24px; }
.side-pv { padding: 16px; border-top: 1px solid var(--border); background: #efeae2; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.opt.col { grid-template-columns: 1fr; border: 1px solid var(--border); border-radius: var(--r); padding: 8px; }
.opt-to { grid-column: 1 / -1; font-size: 12px; color: var(--accent); margin-top: -4px; }
.kwbox { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 4px; min-height: 36px; }
.kwbox input { border: 0; outline: none; flex: 1; min-width: 140px; height: 26px; padding: 0 4px; }
.kwbox .kw button { border: 0; background: none; cursor: pointer; padding: 0 0 0 4px; color: var(--muted); }
.varbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: -8px; }
.btnlike { cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.btnlike:hover { border-color: #c4b5fd; background: #ede9fe; }

/* WhatsApp náhľad a tester */
.wa { display: grid; gap: 4px; max-width: 300px; }
.wa-bubble { position: relative; background: #fff; border-radius: 8px; padding: 6px 8px 18px; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-width: 300px; }
.wa-bubble img { display: block; width: 100%; border-radius: 6px; margin-bottom: 6px; }
.wa-bubble.me { background: #d9fdd3; padding-bottom: 6px; }
.wa-time { position: absolute; right: 8px; bottom: 4px; font-size: 10px; color: #8696a0; }
.wa-btn { display: block; width: 100%; background: #fff; border: 0; border-radius: 8px; padding: 8px; text-align: center; color: #027eb5; font-size: 13px; font-weight: 500; cursor: pointer; }
.wa-btn:disabled { color: #9ca3af; cursor: default; }
.phone { margin: 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; height: 480px; }
.phone-top { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: #008069; color: #fff; }
.phone-top .avatar { background: #fff; color: #008069; border: 0; width: 32px; height: 32px; }
.phone-chat { flex: 1; overflow: auto; background: #efeae2; padding: 12px; display: grid; gap: 8px; align-content: start; }
.wa-row { display: flex; }
.wa-row.me { justify-content: flex-end; }
.wa-col { display: grid; gap: 4px; max-width: 85%; }
.wa-note { text-align: center; font-size: 11px; color: #54656f; background: #fff7d6; border-radius: 6px; padding: 4px 8px; justify-self: center; }
.wa-list { background: #fff; border-radius: 8px; display: grid; }
.wa-list button { border: 0; border-bottom: 1px solid #eee; background: none; text-align: left; padding: 8px 12px; cursor: pointer; display: grid; }
.wa-list button span { font-size: 12px; color: #667781; }
.phone-in { display: flex; gap: 8px; padding: 8px; background: #f0f2f5; }
.phone-in input { flex: 1; border: 0; border-radius: 20px; padding: 0 12px; height: 36px; outline: none; }
.phone-in button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #008069; color: #fff; cursor: pointer; }
.t-state { padding: 0 16px 16px; display: grid; gap: 4px; }

/* ---- inbox ---- */
.inbox { grid-template-columns: 300px 1fr 280px; height: calc(100vh - 64px - 48px); min-height: 520px; }
.contacts { display: flex; flex-direction: column; }
.ibx-tools { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.ibx-tools .seg button { flex: 1; }
.ibx-tools .seg { display: flex; }
#contactList { overflow: auto; flex: 1; }
.c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { min-height: 0; }
.bubble.agent { background: var(--accent-soft); border-color: #c7d2fe; }
.b-time { display: block; font-size: 10px; color: var(--faint); text-align: right; margin-top: 2px; }
.reply { display: flex; gap: 8px; padding: 12px 16px 4px; border-top: 1px solid var(--border); align-items: flex-end; }
.reply textarea { min-height: 44px; resize: none; }
.cinfo { border-left: 1px solid var(--border); padding: 16px; display: grid; gap: 16px; align-content: start; overflow: auto; }
.cinfo h3 { font-size: 14px; }
.cinfo .kv { grid-template-columns: auto 1fr; }

@media (max-width: 1100px) {
  .prow { grid-template-columns: auto 1fr auto; }
  .prow-stat, .prow .tag { display: none; }
  .frow { grid-template-columns: 1fr 1fr auto; }
  .frow > :nth-child(3), .frow > :nth-child(4) { display: none; }
  .inbox { grid-template-columns: 260px 1fr; }
  .cinfo { display: none; }
  .fb-main { grid-template-columns: 1fr 320px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .wz-steps { grid-auto-flow: column; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .fb-main { grid-template-columns: 1fr; grid-template-rows: 1fr 45%; }
  .fb-palette { top: auto; bottom: 64px; grid-auto-flow: column; overflow-x: auto; max-width: calc(100% - 32px); }
  .fb-hint { display: none; }
  .prow-act .btn:not(.icon) { display: none; }
}

div.field { display: grid; gap: 4px; }
div.field > span:first-child { font-size: 12px; color: var(--muted); font-weight: 500; }
.wz-body { padding-bottom: 32px; }
.bbtns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bbtn { display: inline-block; border: 1px solid #a7f3d0; background: #fff; color: #047857; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 500; }
.bbtn.list { display: block; margin-top: 4px; }
.bubble.agent + * { }

/* =================== v4: značky a kanály =================== */
.brand-switch { position: relative; }
.bsw { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: left; }
.bsw:hover { border-color: var(--border-strong); background: var(--surface-2); }
.bsw-txt { display: grid; min-width: 0; flex: 1; }
.bsw-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsw-chev { color: var(--muted); font-size: 12px; }
.dd.bsw-dd { top: calc(100% + 4px); left: 0; right: 0; min-width: 0; max-width: none; z-index: 80; }
.dd.bsw-dd button.on { background: var(--accent-soft); }
.dd-sep { height: 1px; background: var(--border); margin: 4px 0; }
.chb { width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * 0.42); flex: none; line-height: 1; }
.cav { position: relative; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--s) * 0.36); flex: none; }
.cav .chb { position: absolute; right: -3px; bottom: -3px; border: 2px solid #fff; box-sizing: content-box; }
.ch-strip-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ch-strip-head h2 { margin-right: auto; }
.ch-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chcard { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--r); padding: 12px; }
.chcard.ok { background: var(--surface-2); }
.chcard .grow { min-width: 0; }
.chcard .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-table { display: grid; border: 1px solid var(--border); border-radius: var(--r); }
.ch-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.ch-row:last-child { border-bottom: 0; }
.ch-row.ch-head { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.ch-row .tag { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ch-checks { display: grid; gap: 4px; }
.ch-check { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.ch-check:hover { background: var(--surface-2); }
#sPlat button { display: inline-flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
#sPlat { display: flex; }
.post-pick { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--r); padding: 8px; }
.post-pick img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; max-height: 300px; overflow: auto; }
.post-grid button { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 4px; padding: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; display: grid; place-items: center; font-size: 11px; }
.post-grid button:hover { outline: 2px solid var(--accent); }
.post-grid img { width: 100%; height: 100%; object-fit: cover; }
.wa-brands { display: grid; gap: 8px; }
.wa-brand { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; }
.wa-brand.on { border-color: var(--accent); background: var(--accent-soft); }
.bcard.on { border-color: var(--accent); outline: 1px solid var(--accent); }
@media (max-width: 1100px) { .ch-strip { grid-template-columns: 1fr; } .ch-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .brand-switch { min-width: 200px; } .bsw .bsw-txt .small { display: none; } }

/* ---- v5: fotky a videá, karusely, reels, stories ---- */
.media-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.mt { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.mt img, .mt video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-n { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; background: rgba(17,24,39,.8); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.mt-v { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: none; }
.mt-act { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.mt:hover .mt-act, .mt:focus-within .mt-act { opacity: 1; }
.mt-act button { width: 24px; height: 24px; border: 0; border-radius: 4px; background: rgba(17,24,39,.85); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.mt-empty { width: 100%; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--faint); font-size: 12px; text-align: center; }
.pv-media { position: relative; }
.pv-media.tall .pv-img { aspect-ratio: 9 / 16; }
.pv-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: rgba(17,24,39,.8); color: #fff; font-size: 11px; font-weight: 600; }
.pv-count { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(17,24,39,.7); color: #fff; font-size: 11px; }
.pv-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.pv-dots i.on { background: var(--accent); }
.pc .fmt { color: var(--accent); font-weight: 600; }
@media (max-width: 600px) { .mt { width: 72px; height: 72px; } .mt-act { opacity: 1; } }
.banner { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-bottom: 12px; border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 8px; }
.banner > div { flex: 1; min-width: 0; }
.banner b { font-size: 14px; }
@media (max-width: 600px) { .banner { flex-direction: column; align-items: stretch; } }
.row.wrap { flex-wrap: wrap; }
.compose > *, .compose-form > * { min-width: 0; }
.note-tag { margin-left: auto; margin-right: 8px; }
@media (max-width: 600px) { .note-tag { display: none; } }
.modal-body > * { min-width: 0; }
@media (max-width: 600px) {
  .modal-foot { flex-wrap: wrap; padding: 12px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .spacer { display: none; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 12px 16px; }
}
.mt { cursor: pointer; }
.mt.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: #111827; font-size: 18px; line-height: 1; cursor: pointer; }
.pv-nav.prev { left: 8px; } .pv-nav.next { right: 8px; }
.pv-media video.pv-img { background: #000; object-fit: contain; }
