@font-face {
  font-family: Inter;
  src: url("/fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --line: #e4e7eb;
  --line-strong: #d5d9de;
  --text: #1a1f26;
  --muted: #5b6470;
  --faint: #8a939e;
  --brand: #0e7c7b;
  --brand-hover: #0b6867;
  --brand-soft: #e6f4f4;
  --brand-ink: #0a5554;
  --fb: #1877f2;
  --fb-hover: #166fe0;
  --ok: #0f7a4a;
  --ok-bg: #e8f6ee;
  --warn: #9a5700;
  --warn-bg: #fff4e0;
  --danger: #c0352b;
  --danger-bg: #fdecec;
  --info: #1d4ed8;
  --info-bg: #eef3ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  --sidebar: 220px;
  --topbar: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 1280px;
  height: 800px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: default; }

/* ===== App shell ===== */
.app { display: flex; width: 1280px; height: 800px; background: var(--bg); }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand);
  display: grid; place-items: center;
  flex: 0 0 32px;
}
.logo svg { display: block; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px; border-radius: 8px;
  color: var(--muted); font-weight: 520; font-size: 13.5px;
  text-decoration: none;
}
.nav-item svg { flex: 0 0 20px; color: var(--faint); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.nav-item.active svg { color: var(--brand); }

.sidebar-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.sidebar-foot .nav-item { height: 38px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar);
  flex: 0 0 var(--topbar);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 18px; font-weight: 650; letter-spacing: -0.03em; }
.topbar-meta { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; color: var(--muted); position: relative;
}
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #e11d48; border: 1.5px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #dbe8e8; color: var(--brand-ink);
  display: grid; place-items: center;
  font-weight: 650; font-size: 13px;
}
.user-chip .name { font-weight: 600; font-size: 13px; line-height: 1.15; }
.user-chip .email { font-size: 11px; color: var(--muted); }

.content { flex: 1; min-height: 0; padding: 20px 24px; overflow: hidden; }

/* ===== Shared bits ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid transparent; font-weight: 600; font-size: 13px;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-dark { background: #1a1f26; color: #fff; }
.btn-fb { background: var(--fb); color: #fff; height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; width: 100%; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn-danger-ghost { background: #fff; border-color: #f0c7c4; color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px 18px; }
.card-title { font-size: 13.5px; font-weight: 650; margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.45; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-new { background: var(--info-bg); color: var(--info); }
.chip-word { background: #f3f4f6; color: #374151; font-weight: 550; height: 26px; padding: 0 10px; }
.chip-dict {
  height: 30px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff;
  font-weight: 600; font-size: 12.5px; color: var(--muted);
}
.chip-dict.on { background: var(--brand-soft); border-color: #b7d9d8; color: var(--brand-ink); }

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid #c9e4e3; font-size: 13px; font-weight: 520;
}
.banner svg { flex: 0 0 18px; color: var(--brand); }
.banner strong { font-weight: 650; }

.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle input { display: none; }
.toggle-ui {
  width: 40px; height: 22px; border-radius: 11px;
  background: #d0d5db; position: relative; flex: 0 0 40px;
}
.toggle-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.toggle input:checked + .toggle-ui { background: var(--brand); }
.toggle input:checked + .toggle-ui::after { left: 20px; }
.toggle-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ===== Login ===== */
.login-page {
  width: 1280px; height: 800px;
  background:
    radial-gradient(900px 480px at 50% -10%, #e6f4f4 0%, transparent 70%),
    var(--bg);
  display: flex; flex-direction: column;
}
.login-top {
  height: 56px; display: flex; align-items: center;
  padding: 0 28px; background: transparent;
}
.login-body { flex: 1; display: grid; place-items: center; padding-bottom: 24px; }
.login-card {
  width: 480px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(16,24,40,.06);
  padding: 36px 36px 32px;
  text-align: center;
}
.login-card .logo { width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 14px; }
.login-card h1 { font-size: 22px; font-weight: 680; letter-spacing: -0.03em; }
.login-card .tagline { color: var(--muted); margin: 6px 0 22px; font-size: 13.5px; }
.one-login {
  margin: 14px 0 20px;
  font-size: 13.5px; font-weight: 600; color: var(--brand-ink);
}
.perms {
  text-align: left;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 12px;
}
.perms-title { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.perm {
  display: grid; grid-template-columns: 16px 1fr; gap: 8px;
  padding: 6px 0; font-size: 12.5px; color: var(--text);
  align-items: start;
}
.perm div { display: block; }
.perm .desc { display: block; color: var(--muted); font-weight: 450; font-size: 12px; margin-top: 1px; }
.perm code {
  font-family: Inter, sans-serif;
  font-weight: 650; font-size: 12px;
  color: var(--brand-ink);
}
.perm span { color: var(--muted); font-weight: 450; }
.perm svg { margin-top: 2px; color: var(--brand); }

/* ===== Pages ===== */
.pages-layout { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.pages-toolbar {
  display: flex; align-items: center; gap: 16px;
}
.pages-toolbar .spacer { margin-left: auto; }
.table-wrap { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.grid thead th {
  text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
  padding: 0 12px; height: 36px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
table.grid tbody td {
  padding: 0 12px; height: 56px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr.new-row { background: #f7f9ff; }
.page-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-av {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff; flex: 0 0 32px;
}
.page-name { font-weight: 620; line-height: 1.2; }
.page-id { font-size: 11.5px; color: var(--faint); margin-top: 1px; font-variant-numeric: tabular-nums; }
.hidden-count { font-weight: 650; font-variant-numeric: tabular-nums; }
.hidden-count.zero { color: var(--faint); font-weight: 500; }
.status-cell { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.linkish { color: var(--warn); font-weight: 650; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }

/* ===== Rules ===== */
.rules-layout { display: flex; flex-direction: column; height: 100%; gap: 14px; }
.modes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; flex: 0 0 auto; }
.mode {
  padding: 14px 16px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff;
  min-height: 118px;
}
.mode.selected { border-color: var(--brand); background: #f3fafa; box-shadow: 0 0 0 3px rgba(14,124,123,.12); }
.mode-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mode h3 { font-size: 14.5px; font-weight: 650; }
.radio {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: #fff;
}
.mode.selected .radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.mode p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.rules-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.rules-cols .card { min-height: 0; overflow: hidden; }
.dict-row { display: flex; gap: 8px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.add-chip {
  height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px dashed var(--line-strong); color: var(--muted);
  background: transparent; font-size: 12px; font-weight: 550;
}
.whitelist { display: flex; flex-direction: column; gap: 8px; }
.wl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; background: #f7f8fa;
}
.wl-item .rm { margin-left: auto; color: var(--faint); font-size: 16px; line-height: 1; }
.action-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
}
.action-bar .act-label { font-weight: 650; font-size: 13px; white-space: nowrap; }
.seg { display: flex; background: #f3f4f6; border-radius: 9px; padding: 3px; gap: 2px; }
.seg-btn {
  height: 30px; padding: 0 12px; border-radius: 7px; border: 0;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px;
}
.seg-btn.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-note { font-size: 12px; color: var(--muted); }
.action-bar .btn { margin-left: auto; }

/* ===== Cleanup ===== */
.cleanup-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; height: 100%; }
.cleanup-layout .card { display: flex; flex-direction: column; overflow: hidden; }
.field { margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.page-checks { display: flex; flex-direction: column; gap: 2px; }
.check {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
}
.check .box {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid var(--line-strong); background: #fff; flex: 0 0 16px;
  display: grid; place-items: center;
}
.check.on .box { background: var(--brand); border-color: var(--brand); }
.check .sub { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.date-in {
  height: 36px; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 10px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  color: var(--text); font-weight: 500;
}
.period-seg { margin-bottom: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill {
  height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff;
  font-weight: 550; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-pill.on { background: var(--brand-soft); border-color: #b7d9d8; color: var(--brand-ink); }
.tick {
  width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #c5cbd2;
  display: grid; place-items: center;
}
.filter-pill.on .tick { background: var(--brand); border-color: var(--brand); }

.preview { padding: 28px 28px 24px; text-align: left; }
.preview-kicker { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.preview-num { font-size: 56px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin: 8px 0 4px; color: var(--text); }
.preview-label { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.breakdown { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.bd { display: flex; justify-content: space-between; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bd span { color: var(--muted); }
.bd b { font-weight: 650; }
.preview .btn { width: 100%; height: 44px; font-size: 14.5px; }
.preview-note { margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ===== Log ===== */
.log-layout { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.log-toolbar { display: flex; align-items: center; gap: 8px; }
.select {
  height: 34px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 520; color: var(--text); font-size: 12.5px;
}
.search {
  height: 34px; width: 200px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff;
  color: var(--faint); display: flex; align-items: center; gap: 6px;
}
.log-toolbar .spacer { margin-left: auto; }
.comment { color: var(--text); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reason { font-size: 12px; color: var(--muted); }
.reason b { font-weight: 650; color: var(--text); }
.post-cell { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-cell { font-size: 12px; color: var(--muted); line-height: 1.3; }
.author { font-weight: 600; }

/* ===== Telegram ===== */
body.tg-page {
  width: 420px; height: 800px; overflow: hidden;
}
.tg-page {
  width: 420px; height: 800px; overflow: hidden;
  background: #e8eef4;
  display: flex; flex-direction: column;
  font-family: Inter, "Noto Sans", sans-serif;
}
.tg-top {
  height: 62px; flex: 0 0 62px;
  background: #fff;
  border-bottom: 1px solid #dde3ea;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
}
.tg-back { color: #168acd; font-size: 20px; width: 22px; }
.tg-bot-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); display: grid; place-items: center;
}
.tg-bot-name { font-weight: 650; font-size: 15px; line-height: 1.15; }
.tg-bot-status { font-size: 12px; color: #8b939e; }
.tg-body {
  flex: 1; padding: 14px 10px 10px;
  display: flex; flex-direction: column; gap: 10px;
  background: #e8eef4;
  overflow: hidden;
}
.tg-date {
  align-self: center;
  background: rgba(0,0,0,.18);
  color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  margin: 2px 0 4px;
}
.bubble-wrap { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.bubble {
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  padding: 9px 11px 6px;
  width: 340px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  position: relative;
}
.bubble.with-btns { border-radius: 14px 14px 0 0; width: 340px; padding-bottom: 8px; }
.bubble-title { font-weight: 650; font-size: 14px; margin-bottom: 4px; line-height: 1.3; }
.bubble-text { font-size: 14px; line-height: 1.4; color: #1a1f26; }
.bubble-time { text-align: right; font-size: 11px; color: #8b939e; margin-top: 4px; }
.tg-btns {
  width: 340px;
  background: #fff;
  border-top: 1px solid #eef1f4;
  border-radius: 0 0 14px 4px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.tg-btn {
  height: 40px; display: grid; place-items: center;
  color: #168acd; font-weight: 620; font-size: 14.5px;
  border-top: 1px solid #eef1f4;
}
.tg-btn-row { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #eef1f4; }
.tg-btn-row .tg-btn { border-top: 0; }
.tg-btn-row .tg-btn + .tg-btn { border-left: 1px solid #eef1f4; }
.tg-input {
  height: 52px; flex: 0 0 52px;
  background: #fff; border-top: 1px solid #dde3ea;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  color: #8b939e; font-size: 14.5px;
}
.tg-round {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e8eef4; display: grid; place-items: center; color: #168acd;
}

/* ===== Overview ===== */
.overview-page {
  width: 2560px; height: 960px; overflow: hidden;
  background: #eceff3;
  padding: 24px 28px 20px;
  font-family: Inter, "Noto Sans", sans-serif;
  color: #1a1f26;
}
.overview-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.overview-head h1 { font-size: 22px; font-weight: 680; letter-spacing: -0.03em; }
.overview-head p { color: #5b6470; font-size: 14px; }
.overview-head { height: 40px; margin-bottom: 16px; }
.sheet {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 420px 420px;
  gap: 16px 16px;
  height: 856px;
}
.shot {
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.shot-label {
  height: 36px; flex: 0 0 36px;
  display: flex; align-items: center;
  padding: 0 14px;
  font-weight: 650; font-size: 13px;
  border-bottom: 1px solid #eef0f3;
  background: #fafbfc;
}
.shot-label span { color: #8a939e; font-weight: 500; margin-left: 8px; font-size: 12px; }
.shot-frame {
  height: 384px;
  display: grid; place-items: center;
  background: #dfe3e8;
  overflow: hidden;
  position: relative;
}
.shot-frame img { display: block; }
.shot-frame.dash img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.shot-frame.tg {
  background: #dfe3e8;
}
.shot-frame.tg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center left;
}

html:has(.overview-page), body.overview-page {
  width: 2560px; height: 960px; overflow: hidden; background: #eceff3;
}


/* ===== Artboard + legend + callouts + tooltips ===== */
html:has(.frame), body:has(.frame) {
  width: 1680px;
  height: 800px;
  overflow: hidden;
  background: #e7eaee;
}
.frame {
  display: flex;
  width: 1680px;
  height: 800px;
  background: #e7eaee;
}
.frame > .app {
  width: 1280px;
  height: 800px;
  flex: 0 0 1280px;
  overflow: hidden;
}
.frame > .login-page {
  width: 1280px;
  height: 800px;
  flex: 0 0 1280px;
  overflow: visible;
}
.login-card, .login-body { overflow: visible; }
.frame.tg-frame > .tg-page {
  width: 420px;
  height: 800px;
  flex: 0 0 420px;
  display: flex;
  flex-direction: column;
  background: #e8eef4;
  overflow: hidden;
}

.legend {
  width: 400px;
  flex: 0 0 400px;
  height: 800px;
  background: #fff;
  border-left: 1px solid #e4e7eb;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  overflow: hidden;
}
.legend-head { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eef0f3; }
.legend-title { font-size: 15px; font-weight: 680; letter-spacing: -0.02em; }
.legend-sub { font-size: 11px; color: #5b6470; margin-top: 3px; line-height: 1.35; }
.legend-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.l-item { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; }
.l-item b { font-weight: 650; }
.l-item div { font-size: 11.5px; line-height: 1.35; color: #1a1f26; }
.l-item.open { background: #fff6e8; margin: 0 -8px; padding: 6px 8px; border-radius: 8px; }
.ln {
  width: 18px; height: 18px; border-radius: 50%;
  background: #e11d48; color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  flex: 0 0 18px; margin-top: 1px;
}

.mark { position: relative; }
.n {
  position: absolute;
  top: -8px; right: -8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e11d48; color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal;
  display: grid; place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.22);
  z-index: 8;
  line-height: 1;
  pointer-events: none;
}
.n.n-left { right: auto; left: -8px; }
.n.n-tr { top: -7px; right: -7px; }

.tip {
  position: absolute;
  z-index: 40;
  width: 260px;
  background: #1c2128;
  color: #fff;
  padding: 8px 10px 9px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 450;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  text-align: left;
  white-space: normal;
}
.tip-k { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #9aa3ad; margin-bottom: 4px; }
.tip-arr {
  position: absolute;
  width: 8px; height: 8px;
  background: #1c2128;
  transform: rotate(45deg);
}
.tip.below { top: calc(100% + 10px); left: 0; }
.tip.below .tip-arr { top: -4px; left: 16px; }
.tip.above { bottom: calc(100% + 10px); left: 0; }
.tip.above .tip-arr { bottom: -4px; left: 16px; }
.tip.above-right { bottom: calc(100% + 10px); right: 0; left: auto; }
.tip.above-right .tip-arr { bottom: -4px; right: 16px; left: auto; }
.tip.below-right { top: calc(100% + 10px); right: 0; left: auto; }
.tip.below-right .tip-arr { top: -4px; right: 16px; left: auto; }
.tip.left-of { right: calc(100% + 12px); left: auto; top: 50%; transform: translateY(-50%); width: 240px; }
.tip.left-of .tip-arr { right: -4px; top: 50%; margin-top: -4px; }

/* Settings screen */
.settings-layout { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-name { font-weight: 650; font-size: 13.5px; }
.set-row .grow { flex: 1; min-width: 0; }
.fb-acc { display: flex; align-items: center; gap: 10px; }

.tip.tip-side {
  top: -58px;
  left: calc(100% + 14px);
  right: auto;
  bottom: auto;
  width: 280px;
  transform: none;
}
.tip.tip-side .tip-arr { left: -4px; top: 64px; right: auto; bottom: auto; }
.tip.out-right {
  left: calc(100% + 14px);
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: 250px;
}
.tip.out-right .tip-arr { left: -4px; top: 50%; margin-top: -4px; right: auto; bottom: auto; }
.frame.tg-frame > .tg-page,
.tg-page, .tg-body, .tg-btns, .bubble-wrap { overflow: visible; }

/* ===== Admin: Пользователи ===== */
.admin-layout { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.admin-top {
  display: grid;
  grid-template-columns: 1.2fr 1.15fr 0.95fr;
  gap: 12px;
  flex: 0 0 auto;
}
.admin-top .card { min-height: 0; }
.admin-top .card-title { margin-bottom: 8px; }
.slots-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.slots-count { font-size: 15px; font-weight: 680; letter-spacing: -0.02em; }
.slots-count b { font-weight: 700; font-variant-numeric: tabular-nums; }
.slots-free { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.slots-bar {
  height: 8px; border-radius: 99px; background: #e6e9ed; overflow: hidden; margin-bottom: 8px;
}
.slots-bar > i {
  display: block; height: 100%; width: 46%;
  background: var(--brand); border-radius: 99px; font-style: normal;
}
.def-rows { display: flex; flex-direction: column; gap: 8px; }
.def-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.def-row .def-name { font-weight: 600; font-size: 13px; }
.def-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  height: 30px; background: #fff; overflow: hidden; flex: 0 0 auto;
}
.stepper .step-btn {
  width: 28px; height: 30px; border: 0; background: #f7f8fa;
  color: var(--muted); font-size: 16px; font-weight: 500; line-height: 1;
  display: grid; place-items: center;
}
.stepper .step-val {
  width: 36px; text-align: center; font-weight: 680;
  font-variant-numeric: tabular-nums; font-size: 13px;
}

.reg-open-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reg-open-row .grow { flex: 1; min-width: 0; }
.reg-open-row .set-name { margin-bottom: 2px; }

.admin-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.admin-body > .card { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.admin-table-card .table-wrap { flex: 1; min-height: 0; overflow: hidden; }
.admin-table-card table.grid tbody td { height: 46px; padding: 0 10px; font-size: 12.5px; }
.admin-table-card table.grid thead th { padding: 0 10px; height: 34px; }
.admin-table-card tr.selected td { background: #f3fafa; }
.admin-table-card tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.admin-table-card tr.disabled-row td { color: var(--muted); }
.admin-table-card tr.disabled-row .email-main { color: var(--muted); }
.user-cell { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; }
.email-main { font-weight: 620; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-sub { font-size: 11px; color: var(--faint); }
.quota { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quota.at-cap { color: var(--warn); }
.quota.zero { color: var(--faint); font-weight: 500; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions .btn { flex-shrink: 0; }
.btn-soft {
  background: var(--brand-soft); border-color: #b7d9d8; color: var(--brand-ink);
}
.chip-off { background: #f3f4f6; color: #5b6470; }
.chip-admin {
  height: 18px; padding: 0 6px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand-ink);
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  display: inline-flex; align-items: center; margin-left: 6px; vertical-align: 1px;
}

.limits-panel { padding: 16px 16px 14px; overflow: visible; }
.limits-panel .btn-primary { width: 100%; margin-top: auto; }
.admin-table-card table.grid tbody td { padding: 0 8px; }
.admin-table-card table.grid thead th { padding: 0 8px; }
.admin-table-card .btn-xs { padding: 0 7px; }
.limits-who { margin: -4px 0 14px; }
.limits-who .email-main { font-size: 13.5px; }
.limits-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.acc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.acc-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 8px; border-radius: 8px; background: #f7f8fa;
}
.acc-item .grow { flex: 1; min-width: 0; }
.acc-name { font-weight: 620; font-size: 13px; line-height: 1.2; }
.acc-item .chip { height: 20px; font-size: 11px; padding: 0 7px; margin-top: 5px; }
.limits-panel .btn { width: 100%; }

/* ===== Register ===== */
.reg-form { text-align: left; width: 100%; }
.reg-label {
  display: block; font-size: 12.5px; font-weight: 650;
  margin-bottom: 6px; color: var(--text);
}
.reg-field { margin-bottom: 12px; }
.text-input {
  height: 40px; width: 100%;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0 12px; background: #fff;
  font-size: 13.5px;
}
.text-input.focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14,124,123,.12);
  outline: none;
}
.reg-note {
  margin: 12px 0 0;
  font-size: 12.5px; color: var(--muted); line-height: 1.45; text-align: left;
}
.reg-login-link {
  margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center;
}
.reg-login-link span {
  color: var(--brand); font-weight: 650;
}
.btn-block { width: 100%; height: 44px; font-size: 15px; border-radius: 10px; }
