/* SMAILÍK – vzhled */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #1d2033;
  --muted: #6b7088;
  --line: #e6e8f0;
  --brand: #5b4bd1;
  --brand-2: #3b2a6b;
  --sun: #ffc531;
  --sun-soft: #fff4d1;
  --ok: #17915a;
  --sev0: #1f9d63; --sev0-bg: #e5f6ed;
  --sev1: #b7791f; --sev1-bg: #fdf3dc;
  --sev2: #dd6b20; --sev2-bg: #feebdc;
  --sev3: #d63a3a; --sev3-bg: #fde4e4;
  --sev4: #8f1d5c; --sev4-bg: #f8dceb;
  --pos: #1f9d63; --neu: #b8bccb; --neg: #d63a3a;
  --surface-2: #f7f8fc;
  --chip: #eceef5;
  --brand-soft: #efedfc;
  --line-2: #d5d8e4;
  --ink-2: #4a4f66;
  --info-bg: #e7f0ff; --info: #1d4ed8;
  --warn-surface: #fff7f7;
  --sev3-line: #f5b5b5;
  --grid: #eef0f5;
  color-scheme: light;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 4px 16px rgba(20, 24, 50, .04);
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; display: flex; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .15rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
h3 { font-size: .98rem; margin: 0 0 .6rem; }
h4 { font-size: .85rem; margin: 1rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: .3rem 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.err-text { color: var(--sev3); }
.warn-text { color: var(--sev2); }
.ai { background: linear-gradient(90deg, var(--brand), #9b5de5); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- postranní menu ---------- */
.sidebar { width: 236px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .55rem; padding: 1.1rem 1.1rem .9rem; font-weight: 800; font-size: 1.3rem; color: var(--brand-2); letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.sidebar nav { flex: 1; overflow-y: auto; padding: .3rem .6rem; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 9px; color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.sidebar nav a i { font-style: normal; width: 1.2rem; display: inline-flex; color: var(--muted); }
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
.sidebar nav a.active i { color: var(--brand); }
.sidebar .count { margin-left: auto; background: var(--chip); color: var(--muted); font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; }
.sidebar .count.hot { background: var(--sev3); color: #fff; }
.nav-sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 1rem .7rem .4rem; }
.me { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.me small { display: block; color: var(--muted); }
.me a { color: var(--muted); display: inline-flex; padding: .3rem; border-radius: 7px; }
.me a:hover { background: var(--bg); color: var(--sev3); }

main { flex: 1; min-width: 0; padding: 1.6rem 2rem 3rem; max-width: 1400px; }
.demo-bar { background: var(--sun-soft); border: 1px solid #f3dc8f; color: #7a5b00; padding: .55rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .88rem; }

/* ---------- stránky ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.card-head.pad { padding: 1rem 1.2rem .4rem; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem 1rem; }
.connect-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.kpi > span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi b { display: block; font-size: 1.55rem; margin: .15rem 0; letter-spacing: -.01em; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpis.small .kpi b { font-size: 1.25rem; }
.kpi b.mood { display: flex; gap: .7rem; }
.mood .pos { color: var(--pos); } .mood .neg { color: var(--neg); }
.alert-critical { display: block; background: var(--sev3-bg); border: 1px solid var(--sev3-line); color: var(--sev3); padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 500; }
.alert-critical b { font-size: 1.15rem; }

/* ---------- odznaky ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .12rem .5rem; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.big { font-size: .9rem; padding: .3rem .8rem; }
.badge.sev0 { background: var(--sev0-bg); color: var(--sev0); }
.badge.sev1 { background: var(--sev1-bg); color: var(--sev1); }
.badge.sev2 { background: var(--sev2-bg); color: var(--sev2); }
.badge.sev3 { background: var(--sev3-bg); color: var(--sev3); }
.badge.help { background: var(--info-bg); color: var(--info); }
.badge.sev4 { background: var(--sev4); color: #fff; }
.badge.st-watch { background: var(--sev1-bg); color: var(--sev1); }
.badge.st-blacklist { background: var(--sev3-bg); color: var(--sev3); }
.badge.st-whitelist { background: var(--sev0-bg); color: var(--sev0); }
.badge.ps-scheduled { background: #e8e5fb; color: var(--brand); }
.badge.ps-published { background: var(--sev0-bg); color: var(--sev0); }
.badge.ps-failed, .badge.ps-partial { background: var(--sev3-bg); color: var(--sev3); }
.badge.ps-approval { background: var(--sev1-bg); color: var(--sev1); }
.chip { display: inline-block; font-size: .74rem; padding: .1rem .5rem; border-radius: 6px; background: var(--chip); color: var(--ink-2); margin: 0 .2rem .2rem 0; }
.chip.topic { background: var(--brand-soft); color: var(--brand); }
.chip-help, .chip-self_harm { background: var(--info-bg); color: var(--info); font-weight: 600; }
.chip-threat, .chip-hate, .chip-sexual, .chip-personal_data { background: var(--sev3-bg); color: var(--sev3); }
.chip-vulgar, .chip-insult, .chip-harassment, .chip-spam, .chip-scam { background: var(--sev2-bg); color: var(--sev2); }
.chip-praise { background: var(--sev0-bg); color: var(--sev0); }
.chip-question, .chip-complaint { background: var(--sun-soft); color: #8a6500; }
.net { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: .72rem; font-weight: 800; color: #fff; vertical-align: middle; flex-shrink: 0; }
.net-fb { background: #1877f2; font-family: Georgia, serif; }
.net-ig { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.net-x { background: #111; }
.net-li { background: #0a66c2; font-weight: 700; font-size: .62em; letter-spacing: -.02em; }

/* ---------- tlačítka a formuláře ---------- */
.btn { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .5rem .95rem; border-radius: 9px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none !important; line-height: 1.2; }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn.small { padding: .32rem .65rem; font-size: .83rem; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #4b3cc0; }
.btn.ok { color: var(--ok); border-color: #bfe5d2; }
.btn.danger { color: var(--sev3); border-color: #f2c4c4; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; justify-content: center; margin-top: .6rem; }
.btn.ai-btn { color: var(--brand); border-color: var(--line-2); }
form.inline { display: inline; }
.form label, label { display: block; font-size: .87rem; font-weight: 500; margin-bottom: .7rem; }
.form label small, label small { display: block; font-weight: 400; margin-top: .2rem; }
input, select, textarea { display: block; width: 100%; font: inherit; font-size: .92rem; padding: .5rem .65rem; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); margin-top: .25rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid #cbc4f6; border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0 .35rem 0 0; vertical-align: middle; }
label.check { display: flex; align-items: center; font-weight: 400; }
label.check.indent { margin-left: 1.6rem; }
.inline-label input { display: inline-block; }
.w80 { width: 80px !important; display: inline-block !important; }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { width: auto; margin: 0; }
.filters.bar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; margin-bottom: 1rem; }
.filters.bar input[type=search] { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 9px; padding: 3px; }
.seg a { padding: .32rem .7rem; border-radius: 7px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: .5rem; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 40%); padding: 1rem 0; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--card); border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--sev1); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------- záložky ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a b { background: var(--chip); color: var(--muted); font-size: .74rem; padding: .05rem .45rem; border-radius: 99px; margin-left: .2rem; }
.tabs a.hot b { background: var(--sev3); color: #fff; }

/* ---------- komentáře ---------- */
.comment-list { display: flex; flex-direction: column; gap: .7rem; }
.comment { display: flex; gap: .7rem; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.comment.sev-l0 { border-left-color: var(--sev0); }
.comment.sev-l1 { border-left-color: #e9b949; }
.comment.sev-l2 { border-left-color: var(--sev2); }
.comment.sev-l3 { border-left-color: var(--sev3); }
.comment.sev-l4 { border-left-color: var(--sev4); background: var(--warn-surface); }
.comment.is-help { border-left-color: #2563eb; }
/* smazané a skryté komentáře – na první pohled jasné */
.comment.is-deleted { border-left-color: var(--muted) !important; background: var(--surface-2); }
.comment.is-deleted .text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.comment.is-deleted .meta, .comment.is-deleted .post-preview { opacity: .55; }
.comment.is-hidden .text { color: var(--muted); }
.state-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin: -.15rem 0 .6rem; padding: .5rem .75rem; border-radius: 8px; font-size: .9rem; }
.state-banner b { font-size: 1rem; letter-spacing: .01em; }
.state-banner span { margin-left: auto; color: inherit; opacity: .8; font-size: .85rem; }
.state-banner.sb-deleted { background: var(--ink); color: var(--card); }
.state-banner.sb-hidden { background: var(--sev1-bg); color: var(--sev1); border: 1px solid var(--sev1); }
.comment-main { flex: 1; min-width: 0; }
.comment header { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .35rem; }
.comment header .author { font-weight: 600; color: var(--ink); }
.comment .spacer { flex: 1; }
.comment .text { display: block; color: var(--ink); font-size: .97rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.comment .text:hover { text-decoration: none; }
.comment .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .3rem; }
.comment .reason { font-size: .8rem; color: var(--muted); }
.comment .post-ref { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.comment .actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.bulk-check { margin-top: .3rem !important; }
.reply-box { margin-top: .6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
.reply-tools { display: flex; gap: .5rem; align-items: center; }
.reply-tools select { width: auto; margin: 0; }
.reply-box textarea { margin: .5rem 0; }
.suggestions .sg { display: block; width: 100%; text-align: left; background: var(--card); border: 1px dashed var(--line-2); border-radius: 8px; padding: .5rem .7rem; margin-top: .4rem; cursor: pointer; font: inherit; font-size: .88rem; }
.suggestions .sg:hover { background: var(--brand-soft); }
.bulk-bar { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.bulk-bar select { width: auto; margin: 0; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .smile { font-size: 3rem; color: var(--sun); }
.fulltext { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-context, .parent-context { background: var(--surface-2); }
.thread-row { border-top: 1px solid var(--line); padding: .55rem 0; }
.thread-row:first-of-type { border-top: 0; }
.thread-row.own { background: #f7f6ff; margin: 0 -.5rem; padding: .55rem .5rem; border-radius: 8px; }
.hist { padding: .45rem 0; border-top: 1px solid var(--line); }
.hist:first-of-type { border-top: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0 0 .5rem; font-size: .88rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.sev-pick { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.sev-pick label { margin: 0; display: flex; align-items: center; font-weight: 400; padding: .3rem .5rem; border-radius: 7px; cursor: pointer; }
.sev-pick label:hover { background: var(--bg); }
.cat-pick { display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: .6rem; }
.cat-pick label { margin: 0; display: inline-flex; align-items: center; font-weight: 400; }
.radio-card { display: flex !important; align-items: flex-start; gap: .3rem; border: 1px solid var(--line); border-radius: 9px; padding: .55rem .7rem; cursor: pointer; margin-bottom: .4rem !important; }
.radio-card small { color: var(--muted); }
.radio-card input { margin-top: .2rem; }

/* ---------- mini řádky, grafy ---------- */
.mini-row { display: flex; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--line); color: var(--ink); }
.mini-row:first-of-type { border-top: 0; }
.mini-row:hover { text-decoration: none; background: var(--surface-2); }
.mini-row.static:hover { background: none; }
.mini-row p { margin: .1rem 0; font-size: .87rem; color: var(--ink-2); }
.mini-row small { color: var(--muted); font-size: .78rem; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 220px; }
.hbars { display: flex; flex-direction: column; gap: .45rem; }
.hbar { display: grid; grid-template-columns: 9rem 1fr 3rem; align-items: center; gap: .5rem; font-size: .85rem; margin-bottom: .35rem; }
.hbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { display: block; height: 10px; border-radius: 99px; width: var(--w); background: var(--brand); opacity: .8; }
.hbar i[class^="chip-"] { padding: 0; }
.hbar b { text-align: right; font-weight: 600; }
.moodbar { display: flex; height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; width: 120px; }
.moodbar .pos { background: var(--pos); } .moodbar .neg { background: var(--neg); margin-left: auto; }
.heatmap { display: flex; flex-direction: column; gap: 3px; margin: .6rem 0; }
.hm-row { display: grid; grid-template-columns: 2rem repeat(24, 1fr); gap: 3px; align-items: center; }
.hm-row span { font-size: .78rem; color: var(--muted); }
.hm-row i { display: block; aspect-ratio: 1; border-radius: 3px; background: rgba(91, 75, 209, calc(.06 + var(--a) * .94)); }
.hm-head em { font-style: normal; font-size: .68rem; color: var(--muted); }

/* ---------- tabulky ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .65rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: .65rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table tr.off td { opacity: .5; }
.table tr.err-row td { background: var(--warn-surface); }
.card .table th:first-child, .card .table td:first-child { padding-left: 1.2rem; }

/* ---------- plánovač ---------- */
.hint { background: var(--brand-soft); border: 1px solid var(--line-2); border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: 1rem; font-size: .9rem; color: var(--brand-2); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
.cal-day { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; min-height: 150px; padding: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.cal-day.today { border-color: var(--brand); background: #f8f7ff; }
.cal-head { font-size: .82rem; color: var(--muted); }
.cal-item { display: block; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 7px; padding: .35rem .45rem; font-size: .78rem; color: var(--ink); }
.cal-item .ct { display: block; color: var(--ink-2); margin-top: .15rem; }
.cal-item .net { width: 17px; height: 17px; font-size: .62rem; margin-left: .15rem; }
.cal-item:hover { text-decoration: none; border-color: var(--line-2); }
.cal-item.ps-draft { border-left-color: #b8bccb; }
.cal-item.ps-approval { border-left-color: var(--sev1); }
.cal-item.ps-published { border-left-color: var(--sev0); }
.cal-item.ps-failed, .cal-item.ps-partial { border-left-color: var(--sev3); }
.cal-add { margin-top: auto; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 7px; padding: .15rem; }
.cal-add:hover { text-decoration: none; color: var(--brand); border-color: var(--brand); }
.post-row { display: flex; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); align-items: flex-start; }
.post-row:first-of-type { border-top: 0; }
.post-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.post-row .grow { flex: 1; min-width: 0; }
.post-meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.post-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; max-width: 260px; }
.acc-pick { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 1rem; }
.acc-pick label { margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: .45rem .7rem; display: flex; align-items: center; cursor: pointer; font-weight: 500; }
.media-prev { display: flex; gap: 1rem; align-items: center; }
.media-prev img { max-width: 160px; border-radius: 8px; }
.preview-card { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }
.pv-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.pv-img { width: 100%; border-radius: 8px; margin-top: .5rem; }
#pv-text { white-space: pre-wrap; font-size: .9rem; }

/* ---------- hlášky ---------- */
.flash { padding: .7rem .95rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid; }
.flash.ok { background: var(--sev0-bg); border-color: #bfe5d2; color: #11683f; }
.flash.err { background: var(--sev3-bg); border-color: var(--sev3-line); color: #a12626; }
.flash.warn { background: var(--sun-soft); border-color: #f3dc8f; color: #7a5b00; }
.code { background: #1d2033; color: #f5f6fa; padding: .7rem .9rem; border-radius: 9px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.copy { cursor: copy; }
.test-result { margin-top: .7rem; padding: .6rem; background: var(--bg); border-radius: 8px; }
.pager { display: flex; gap: .3rem; justify-content: center; margin: 1rem 0; }
.pager a, .pager span { padding: .35rem .7rem; border-radius: 7px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.pager a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
details summary { cursor: pointer; }

/* ---------- přihlášení ---------- */
.auth-page { align-items: center; justify-content: center; background: radial-gradient(circle at 30% 20%, #fff7d6, transparent 40%), radial-gradient(circle at 80% 80%, #ebe7ff, transparent 45%), var(--bg); padding: 2rem 1rem; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px rgba(40, 30, 100, .08); padding: 2rem; width: 100%; max-width: 380px; }
.auth-card.wide { max-width: 720px; }
.logo-big { font-weight: 900; font-size: 2rem; text-align: center; color: var(--brand-2); letter-spacing: .03em; }
.center-img { display: block; margin: 0 auto .4rem; }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .nav-sep { display: none; }
  main { padding: 1rem; }
  .grid-2, .grid-3, .grid2, .connect-cards { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: 1fr; }
}

/* ---------- náhled příspěvku ---------- */
.post-preview { display: flex; gap: .7rem; align-items: flex-start; margin-top: .55rem; padding: .55rem .7rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.post-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.post-preview p { margin: .1rem 0 .2rem; font-size: .86rem; color: var(--ink-2); }
.post-preview small { font-size: .78rem; }
.post-head { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface-2); }
.post-head img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.post-head p { white-space: pre-wrap; margin: .3rem 0 .4rem; }
.post-head .grow { flex: 1; min-width: 0; }
.suggestions .sg b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); margin-bottom: .15rem; }

/* ---------- zprávy ---------- */
.conv-list { display: flex; flex-direction: column; gap: .5rem; }
.conv-row { display: flex; gap: .7rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--radius); padding: .75rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
.conv-row:hover { text-decoration: none; border-color: var(--line-2); }
.conv-row.unread { border-left-color: var(--brand); }
.conv-row.is-help { border-left-color: #2563eb; background: #f8fbff; }
.conv-row p { margin: .2rem 0; color: var(--ink-2); font-size: .92rem; }
.conv-row .grow { flex: 1; min-width: 0; }
.conv-row .count { background: var(--sev3); color: #fff; font-size: .75rem; padding: .05rem .45rem; border-radius: 99px; }
.conv-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.conv-top .spacer { flex: 1; }
.chat { display: flex; flex-direction: column; gap: .6rem; max-height: 65vh; overflow-y: auto; background: var(--surface-2); }
.bubble { max-width: 78%; }
.bubble .b-text { padding: .55rem .8rem; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; }
.bubble.in { align-self: flex-start; }
.bubble.in .b-text { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; text-align: right; }
.bubble.out .b-text { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; text-align: left; }
.flash.small { font-size: .82rem; padding: .45rem .7rem; }

/* ---------- příspěvky ---------- */
.filters .spacer { flex: 1; }
.post-list { display: flex; flex-direction: column; gap: .2rem; }
.post-item { display: flex; gap: 1rem; align-items: flex-start; }
.post-item > img, .post-item .img-ph { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: var(--chip); display: flex; align-items: center; justify-content: center; }
.post-item .grow { flex: 1; min-width: 0; }
.post-item p { margin: .35rem 0 .5rem; white-space: pre-wrap; }
.post-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .86rem; color: var(--ink-2); }
.post-stats .spacer { flex: 1; }
.data-range { font-size: .8rem; color: var(--muted); }

.strong-link { font-weight: 600; }

/* ---------- verze ---------- */
.version-link { display: block; padding: .4rem 1.1rem; font-size: .78rem; color: var(--muted); }
.version-link:hover, .version-link.active { color: var(--brand); text-decoration: none; }
.update-bar { display: block; background: var(--brand-soft); border: 1px solid var(--line-2); color: var(--brand-2); padding: .55rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; font-weight: 500; }
.update-bar:hover { text-decoration: none; background: #e6e2fb; }
.version.current { border-color: var(--line-2); }
.version ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; }
.version li { margin: .2rem 0; }
.version h4 { margin: .6rem 0 .2rem; text-transform: none; letter-spacing: 0; }
.post-link { display: inline-block; margin: 2px 0 6px; font-size: .9em; text-decoration: none; word-break: break-word; }
.post-link:hover { text-decoration: underline; }
/* přehled: načtení dat, problémové příspěvky, automatizace */
.refresh-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.refresh-row form { margin: 0; }
.data-at { font-size: .92em; color: var(--muted); }
.data-at b { color: var(--ink); }
.problem-post { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.problem-post:first-of-type { border-top: 0; }
.pp-main { display: flex; gap: 10px; align-items: flex-start; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.pp-main p { margin: 0 0 4px; font-weight: 500; }
.pp-main small { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pp-main:hover p { text-decoration: underline; }
.pp-actions { display: flex; gap: 6px; flex: none; }
.automation { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.automation li { display: flex; gap: 10px; align-items: flex-start; }
.automation small { display: block; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.on { background: #1f9d63; }
.dot.off { background: #c9ccd8; }
@media (max-width: 700px) { .problem-post { flex-direction: column; align-items: stretch; } }

/* tmavý režim – přepínač vlevo dole (ukládá se v prohlížeči), výchozí podle systému */
:root[data-theme="dark"] {
  --bg: #11121a;
  --card: #1a1c28;
  --ink: #e9eaf3;
  --muted: #9da2bb;
  --line: #2b2e40;
  --brand: #a597ff;
  --brand-2: #d7d0ff;
  --sun-soft: #3a3118;
  --sev0: #3cc285; --sev0-bg: #15342a;
  --sev1: #e0a841; --sev1-bg: #3a2e14;
  --sev2: #f08b47; --sev2-bg: #3d2617;
  --sev3: #f06a6a; --sev3-bg: #3f1d22;
  --sev4: #e25aa6; --sev4-bg: #3b1830;
  --pos: #3cc285; --neu: #5d6178; --neg: #f06a6a;
  --surface-2: #202232;
  --chip: #2a2d40;
  --brand-soft: #2a2553;
  --line-2: #3b3f57;
  --ink-2: #c3c6d8;
  --info-bg: #1c2a48; --info: #93b6ff;
  --warn-surface: #2a1c22;
  --sev3-line: #6e2e35;
  --grid: #262939;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .pager a.on, :root[data-theme="dark"] .bubble.out .b-text { color: #15132b; }
:root[data-theme="dark"] .code { background: #0b0c12; }
:root[data-theme="dark"] img[src$="logo.svg"] { filter: none; }
.theme-toggle { display: flex; gap: 4px; margin: 0 .9rem .6rem; background: var(--chip); border-radius: 9px; padding: 3px; }
.theme-toggle button { flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; padding: .3rem .2rem; border-radius: 7px; cursor: pointer; }
.theme-toggle button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
/* připojené sítě v postranním panelu */
.net-status { display: flex; gap: 8px; padding: 0 1.1rem .8rem; text-decoration: none !important; }
.net-status .ns { position: relative; display: inline-flex; }
.net-status .ns .net { width: 26px; height: 26px; border-radius: 8px; font-size: .8rem; }
.net-status .ns i { position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--card); }
.net-status .ns-ok i { background: #1f9d63; }
.net-status .ns-warn i { background: #e0a841; }
.net-status .ns-err i { background: var(--sev3); }
.net-status .ns-none .net, .net-status .ns-off .net { filter: grayscale(1); opacity: .35; }
.net-status .ns-none i, .net-status .ns-off i { display: none; }
.kpi-link { display: block; color: inherit; text-decoration: none !important; }
.kpi-link:hover { border-color: var(--line-2); }
.budget-bar { display: block; height: 6px; background: var(--chip); border-radius: 99px; margin-top: .45rem; overflow: hidden; }
.budget-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.budget-bar i.hot { background: var(--sev3); }
:root[data-theme="dark"] .demo-bar { background: #3a3118; color: #f3d27a; border-color: #6b5520; }
:root[data-theme="dark"] .flash.ok { background: #15342a; color: #8fe0b8; }
/* klikací čísla na přehledu */
.kpi .mood a, .kpi a.kpi-num { color: inherit; text-decoration: none; border-bottom: 2px dotted transparent; }
.kpi .mood a.pos { color: var(--pos); } .kpi .mood a.neg { color: var(--neg); }
.kpi .mood a:hover, .kpi a.kpi-num:hover { border-bottom-color: currentColor; text-decoration: none; }
.active-filter { background: var(--brand-soft); color: var(--brand-2); border-radius: 10px; padding: .55rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.active-filter a { margin-left: .6rem; }
/* příspěvek nad komentářem, naše odpovědi, schvalování */
.post-preview.post-above { margin: 0 0 .65rem; }
.our-reply { margin: .55rem 0 0 1.4rem; padding: .5rem .75rem; border-left: 3px solid var(--ok); background: var(--sev0-bg); border-radius: 0 8px 8px 0; font-size: .9rem; }
.our-reply p { margin: .2rem 0 0; }
.approve-box { margin: .6rem 0 0 1.4rem; padding: .6rem .75rem; border: 1px dashed var(--brand); background: var(--brand-soft); border-radius: 10px; display: flex; flex-direction: column; gap: .45rem; }
.approve-box textarea { background: var(--card); }
.approve-box .row-gap { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.alert-approve { display: block; background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand-2); padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-weight: 500; }
.approve-row { padding: .7rem 0; border-top: 1px solid var(--line); }
.approve-row:first-of-type { border-top: 0; }
.approve-row .q { font-size: .88rem; color: var(--ink-2); margin: 0 0 .3rem; }
.approve-row .a { font-size: .92rem; margin: 0 0 .45rem; padding-left: .6rem; border-left: 3px solid var(--brand); }
.approve-row form { display: inline; }

/* vzdušnější karta komentáře */
.comment-list { gap: 1rem; }
.comment { padding: 1.1rem 1.3rem 1rem; gap: .9rem; }
.comment .post-preview.post-above { margin: 0 0 1rem; padding: .7rem .9rem; }
.comment header { margin-bottom: .5rem; gap: .5rem; }
.comment .text { line-height: 1.6; margin-bottom: .65rem; }
.comment .meta { gap: .35rem .5rem; }
.comment .our-reply { margin: 1rem 0 0 1.4rem; padding: .7rem .95rem; line-height: 1.55; }
.comment .our-reply p { margin-top: .35rem; }
.comment .approve-box { margin: 1rem 0 0 1.4rem; padding: .8rem .95rem; gap: .6rem; }
.comment .actions { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); gap: .45rem; }
.comment .reply-box { margin-top: .8rem; }
