:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e9ecf0;
  --line-2: #f1f3f6;
  --accent: #2481cc;
  --accent-hover: #1f72b6;
  --accent-soft: #e9f3fc;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --bad: #c2410c;
  --bad-ink: #b42318;
  --bad-soft: #fdecea;
  --tg-bg: #d9e4cf;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei",
    "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 26px; line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: #fff; border-right: 1px solid var(--line); padding: 20px 14px 16px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.brandmark { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; color: var(--ink); }
.brandmark .tile {
  width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.brandmark .logo { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px rgba(36,129,204,.28); flex: none; }
.topbar .logo { border-radius: 8px; }
.brandmark .name { font-weight: 700; line-height: 1.2; font-size: 14.5px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 12px 5px; }
.nav a {
  display: flex; align-items: center; gap: 11px; color: var(--ink-2); padding: 8px 12px; border-radius: 10px;
  font-weight: 500; margin-bottom: 2px;
}
.nav a .icon { color: var(--muted); }
.nav a:hover { background: #f4f6f8; color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.active .icon { color: var(--accent); }
.brand-pick { padding: 0 4px 6px; }
.brand-pick select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit;
  font-weight: 600; color: var(--ink);
}
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; }
.side-foot .who { font-size: 13px; color: var(--muted); margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; }
.side-foot a, .side-foot button {
  display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 7px 4px; font: inherit; font-weight: 500;
  background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.side-foot a:hover, .side-foot button:hover { color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; margin-bottom: 8px; background: var(--bg); }
.seg a { padding: 3px 12px !important; border-radius: 7px; width: auto !important; font-size: 13px; color: var(--muted) !important; }
.seg a.on { background: #fff; color: var(--ink) !important; box-shadow: var(--shadow); font-weight: 600; }

.main { padding: 32px 40px 64px; min-width: 0; }
.container { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumb { font-size: 13px; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 4px; }
.topbar { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .main { padding: 20px 16px 48px; }
}

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
@media (max-width: 1000px) { .grid.main-side { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--muted); font-weight: 500; }
.stat .num { font-size: 28px; font-weight: 700; margin-top: 14px; line-height: 1.1; }
.tint { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.tint.blue { background: var(--accent-soft); color: var(--accent); }
.tint.green { background: var(--ok-soft); color: var(--ok); }
.tint.amber { background: var(--warn-soft); color: var(--warn); }
.tint.red { background: var(--bad-soft); color: var(--bad-ink); }
.tint.gray { background: var(--line-2); color: var(--muted); }

/* list rows */
.rows > .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.rows > .item:first-child { border-top: 0; }
.rows .item .title { font-weight: 600; color: var(--ink); }
.rows .item .meta { color: var(--muted); font-size: 13px; }
.rows .item .right { text-align: right; white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .tint { margin: 0 auto 10px; width: 44px; height: 44px; border-radius: 12px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt { margin-top: 14px; }
.meter { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter > div { height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12.5px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=password], input[type=url], input[type=search], input[type=datetime-local],
input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #dfe3e8; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type=file] { padding: 7px 10px; }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; margin-bottom: 8px; }
.check input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.inline-form { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink-2); border-color: #dfe3e8; }
.btn.secondary:hover { background: #f6f7f9; color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad-ink); border-color: #f3c7c1; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid; font-weight: 500; }
.flash.success { background: var(--ok-soft); border-color: #c6e9d3; color: #14532d; }
.flash.error { background: var(--bad-soft); border-color: #f7cbc5; color: #8a1c13; }
.flash.info { background: var(--accent-soft); border-color: #cfe3f7; color: #1b5a92; }
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--bad-soft); color: #8a1c13; border: 1px solid #f7cbc5; margin-bottom: 20px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 14px 4px; margin-right: 18px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }

/* ---------- message editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1080px) { .editor { grid-template-columns: 1fr; } }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.over { color: var(--bad-ink); font-weight: 600; }
.toolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.toolbar button { background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-2); }
.toolbar button:hover { background: #f6f7f9; }
.media-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-pick select { flex: 1; min-width: 200px; }
.btn-rows { display: flex; flex-direction: column; gap: 8px; }
.btn-row, .btn-head { display: grid; grid-template-columns: 1.2fr 120px 1.4fr 92px 60px 36px; gap: 8px; align-items: center; }
.btn-head { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.btn-row input, .btn-row select { padding: 7px 9px; }
.btn-row .rm { border: 1px solid #f3c7c1; background: #fff; color: var(--bad-ink); border-radius: 9px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .btn-row { grid-template-columns: 1fr 1fr; } .btn-head { display: none; } }

.preview { background: var(--tg-bg); border-radius: var(--radius); padding: 16px; position: sticky; top: 20px; }
.preview .title { font-size: 12px; color: #4d5a43; margin-bottom: 8px; font-weight: 600; }
.bubble { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.bubble img, .bubble video { display: block; width: 100%; max-height: 320px; object-fit: cover; background: #000; }
.bubble .text { padding: 8px 11px 10px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.bubble .text:empty::before { content: attr(data-empty); color: #9aa2ad; }
.bubble .text blockquote { border-left: 3px solid var(--accent); margin: 4px 0; padding-left: 8px; }
.bubble .text code, .bubble .text pre { background: #f2f4f7; border-radius: 4px; padding: 0 4px; font-size: 13px; }
.bubble .text pre { display: block; padding: 8px 10px; margin: 4px 0; white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; }
.bubble .text blockquote { background: rgba(36,129,204,.08); border-radius: 4px; padding: 4px 8px; }
.bubble .text blockquote[expandable] { position: relative; max-height: 4.6em; overflow: hidden; padding-right: 22px; }
.bubble .text blockquote[expandable]::after { content: "⌄"; position: absolute; right: 6px; bottom: 2px; color: var(--accent); font-weight: 700; }
.bubble .text tg-spoiler { background: #c9ced6; color: transparent; border-radius: 3px; cursor: pointer; transition: color .2s, background .2s; }
.bubble .text tg-spoiler:hover { background: #eef0f3; color: inherit; }
.bubble .text s { text-decoration: line-through; }
.kbd { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.kbd .krow { display: flex; gap: 4px; }
.kbd .k {
  flex: 1; background: rgba(78, 102, 64, .5); color: #fff; text-align: center; border-radius: 10px; padding: 9px 6px;
  font-size: 13px; font-weight: 600; position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kbd .k .t { position: absolute; top: 2px; right: 6px; font-size: 10px; opacity: .85; font-weight: 400; }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.media-item { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.media-item .thumb { height: 140px; background: var(--line-2); display: flex; align-items: center; justify-content: center; }
.media-item .thumb img, .media-item .thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-item .meta { padding: 10px 12px 12px; }
.media-item .meta .name { font-weight: 600; word-break: break-word; }

.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }

.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--faint); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 28px; }
.pager { display: flex; gap: 8px; padding: 14px 20px; align-items: center; border-top: 1px solid var(--line); }
details > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.menu-pop { position: relative; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* variables */
.var-row, .var-head { display: grid; grid-template-columns: 180px 1fr 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.var-head { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.var-row .rm { border: 1px solid #f3c7c1; background: #fff; color: var(--bad-ink); border-radius: 9px; height: 38px; cursor: pointer; }
@media (max-width: 640px) { .var-row { grid-template-columns: 1fr 1fr 36px; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 2px; }
.chips .lbl { font-size: 12px; color: var(--muted); }
.chip { border: 1px dashed #c9d3de; background: #f8fafc; color: var(--ink-2); border-radius: 8px; padding: 2px 8px; font: inherit; font-size: 12.5px; cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.code { border-color: #b9d6f2; background: var(--accent-soft); color: var(--accent); }
.codebox { font-family: ui-monospace, Menlo, monospace; font-size: 13px; min-height: 320px; }
.kpi-inline { display: flex; gap: 28px; flex-wrap: wrap; }
.kpi-inline .v { font-size: 22px; font-weight: 700; }
.tab-link { padding: 14px 4px; margin-right: 18px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.seg-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--bg); gap: 2px; flex-wrap: wrap; }
.seg-pick label { margin: 0; padding: 6px 12px; border-radius: 8px; font-weight: 500; color: var(--muted); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.seg-pick input { display: none; }
.seg-pick label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pick-list label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; font-weight: 500; cursor: pointer; }
.pick-list label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick-list input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* sidebar groups: Bot 1 / Bot 2 */
.nav-group { margin: 10px 0 4px; border-radius: 12px; padding: 4px 0 2px; }
.nav-title { display: block; padding: 8px 12px 6px; font-size: 11px; font-weight: 700; line-height: 1.4;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.nav-title .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.nav-title .nav-hint { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); font-size: 12px; margin-top: 2px; }
.g1 .dot { background: var(--ok); }
.g2 .dot { background: var(--accent); }
.g1 { background: #f6fbf8; }
.g2 { background: #f5f9fe; }
.g1 .nav a.active { background: var(--ok-soft); color: var(--ok); }
.g1 .nav a.active .icon { color: var(--ok); }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
.btn.icon-only { padding: 6px 8px; }

/* loading state */
.spinner { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { opacity: .85; cursor: progress; gap: 8px; }
.loading-box { display: flex; align-items: center; gap: 14px; padding: 22px 8px; color: var(--accent); }
.loading-box .spinner { width: 26px; height: 26px; border-width: 3px; }
.loading-box strong { color: var(--ink); }

/* "Send image message" button: its own image and text */
.msg-note { font-size: 12.5px; color: var(--muted); }
.btn-msg { display: grid; gap: 8px; padding: 12px; margin: -2px 0 4px; border: 1px dashed #b9d7f0; border-radius: 12px; background: var(--accent-soft); }
.btn-msg-head { font-size: 12px; font-weight: 600; color: var(--accent); }
.btn-msg textarea { min-height: 70px; }
.btn-msg-thumb:empty { display: none; }
.btn-msg-thumb img, .btn-msg-thumb video { max-height: 110px; max-width: 100%; border-radius: 8px; display: block; }

/* custom emoji in the preview: shown as its normal emoji, marked */
tg-emoji { border-bottom: 1.5px dotted var(--accent); }

/* weekday / month-day chips on the post form */
.day-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick label { margin: 0; cursor: pointer; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; font-weight: 500; background: #fff; color: var(--ink-2); }
.day-pick.month span { min-width: 38px; padding: 0; }
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* button colors (Telegram button style) */
.style-pick.s-primary { background: #e8f1fd; color: #1d63c7; border-color: #b9d3f5; }
.style-pick.s-success { background: #e7f7ee; color: #18794e; border-color: #b4e2c7; }
.style-pick.s-danger { background: #fdecec; color: #c0362c; border-color: #f3c0bb; }
.preview .k.k-primary { background: #3b8be8; color: #fff; }
.preview .k.k-success { background: #2fa463; color: #fff; }
.preview .k.k-danger { background: #e0483d; color: #fff; }
.preview .k.k-primary .t, .preview .k.k-success .t, .preview .k.k-danger .t { color: rgba(255,255,255,.8); }

/* normal emoji picker */
.emoji-wrap { position: relative; display: inline-block; }
.emoji-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 352px; max-width: calc(100vw - 40px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.14); padding: 8px 10px; }
.emoji-search { width: 100%; padding: 7px 10px; font-size: 13px; margin-bottom: 6px; }
.emoji-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 4px; }
.toolbar .emoji-tabs button { border: 0; background: none; font-size: 17px; padding: 3px 0; flex: 1; border-radius: 6px; }
.toolbar .emoji-tabs button:hover { background: #f1f3f6; }
.emoji-body { max-height: 270px; overflow: auto; position: relative; }
.emoji-empty { padding: 16px 4px; color: var(--muted); font-size: 13px; text-align: center; }
.emoji-group + .emoji-group { margin-top: 6px; }
.emoji-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 4px 2px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.toolbar .emoji-grid button { border: 0; background: none; font-size: 20px; padding: 3px 0; border-radius: 6px; line-height: 1.2; }
.toolbar .emoji-grid button:hover { background: #f1f3f6; }

/* on/off switch */
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { flex: none; width: 42px; height: 24px; border-radius: 99px; background: #cfd5dd; position: relative; transition: background .15s; margin-top: 1px; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track .knob { left: 21px; }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Open menu" button: where the menu opens */
.btn-open { display: flex; align-items: center; gap: 8px; margin: -3px 0 4px; padding-left: 4px; font-size: 12.5px; color: var(--muted); }
.btn-open select { width: auto; padding: 4px 8px; font-size: 12.5px; }

/* post editor: pick an AI quote */
.ai-quotes { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.ai-quote { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; }
.ai-quote .btn { flex: none; }

.sched-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.sched-line .icon { color: var(--accent); }
.pool-back { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 4px 14px; padding: 9px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.pool-back:hover { background: #000; color: #fff; }
.pool-back .icon { color: #fff; }
.chan-line { display: flex; align-items: center; gap: 4px; }

/* channel filter (Bot 2 lists) */
.ch-pick { position: relative; }
.ch-pick-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 220px; max-width: 320px; height: 42px; padding: 0 12px 0 14px; border: 1px solid #dfe3e8; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.ch-pick-btn:hover { border-color: #c9ced6; }
.ch-pick.open .ch-pick-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ch-pick-btn .icon { color: var(--accent); flex: none; }
.ch-pick-cur { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pick-btn .ch-chev { color: var(--muted); flex: none; transition: transform .15s; }
.ch-pick.open .ch-pick-btn .ch-chev { transform: rotate(180deg); }
.ch-pick-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: max(100%, 260px); max-height: 360px; overflow-y: auto; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px -8px rgba(16,24,40,.22); }
.ch-pick-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-pick-menu a:hover { background: #f4f6f8; color: var(--ink); }
.ch-pick-menu a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ch-pick-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.ch-pick-test summary { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.ch-pick-test summary::-webkit-details-marker { display: none; }
.ch-pick-test summary:hover { background: #f4f6f8; color: var(--ink-2); }
.ch-pick-test summary .ch-chev { transition: transform .15s; }
.ch-pick-test[open] summary .ch-chev { transform: rotate(90deg); }
.ch-count { margin-left: auto; font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
.ch-pick-test a { padding-left: 29px; }
