/* ─── Токены ─── */
:root, [data-theme="dark"] {
  --bg: #111726;
  --surface: #171f31;
  --raised: #1e2840;
  --input: #121a2b;
  --line: #27324b;
  --line-2: #34405e;
  --text: #e8edf6;
  --muted: #8e9ab3;
  --faint: #5f6b85;
  --accent: #e3b25a;
  --accent-ink: #231a06;
  --accent-soft: rgba(227, 178, 90, .12);
  --accent-line: rgba(227, 178, 90, .35);
  --ok: #4fc08d;
  --bad: #ef6b64;
  --ice: #62b7ea;
  --idle: #8e9ab3;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --scrim: rgba(6, 9, 18, .6);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef1f6;
  --surface: #ffffff;
  --raised: #f4f6fa;
  --input: #ffffff;
  --line: #e0e5ee;
  --line-2: #cbd3e1;
  --text: #18203a;
  --muted: #5d6883;
  --faint: #98a2b8;
  --accent: #b8842a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(184, 132, 42, .1);
  --accent-line: rgba(184, 132, 42, .4);
  --ok: #1d9a61;
  --bad: #d4423a;
  --ice: #2689c4;
  --idle: #7d88a1;
  --shadow: 0 18px 50px rgba(24, 32, 58, .16);
  --scrim: rgba(24, 32, 58, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Onest, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mono { font-family: "JetBrains Mono", Consolas, ui-monospace, monospace; font-size: 13px; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ─── Бренд ─── */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); position: relative; flex: none;
}
.brand-mark::before { content: ""; position: absolute; left: 6px; top: 10px; width: 8px; height: 8px; border: 2.5px solid var(--accent-ink); border-radius: 50%; }
.brand-mark::after { content: ""; position: absolute; left: 16px; top: 14px; width: 9px; height: 2.5px; background: var(--accent-ink); box-shadow: 5px 2px 0 -0.5px var(--accent-ink); }

/* ─── Ключ-бирка: главный визуальный элемент ─── */
.key {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 4px 10px 10px 4px;
  padding: 3px 10px 3px 8px; white-space: nowrap; cursor: pointer; max-width: 320px;
}
.key::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; }
.key span { overflow: hidden; text-overflow: ellipsis; }
.key:hover { border-color: var(--accent); }

/* ─── Поля и кнопки ─── */
input, select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; cursor: pointer; }
textarea { resize: vertical; line-height: 1.6; }
select { cursor: pointer; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
.field small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 7px; }
.field small b { color: var(--muted); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 9px 15px; cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.07); }
.btn-danger { color: var(--bad); }
.btn-danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13.5px; }
.btn-block { width: 100%; padding: 11px 15px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn.danger:hover { color: var(--bad); }
.icon-btn.ok:hover { color: var(--ok); }

.seg { display: flex; gap: 4px; background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: 0; border-radius: 7px; padding: 8px 12px; cursor: pointer; color: var(--muted); font-weight: 500;
}
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.seg-wide { margin-bottom: 22px; }
[data-theme="light"] .seg { background: var(--raised); }
[data-theme="light"] .seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(24, 32, 58, .14); }
input.mono::placeholder, textarea.mono::placeholder { font-family: Onest, "Segoe UI", system-ui, sans-serif; font-size: 14px; }

.lang-switch { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang-switch button { background: none; border: 0; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--faint); }
.lang-switch button.on { background: var(--accent-soft); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--input); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500;
}
.chip:hover { border-color: var(--faint); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; background: var(--input);
}
.checks label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }

/* ─── Статусы ─── */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); } .badge.bad { color: var(--bad); } .badge.frozen { color: var(--ice); } .badge.idle { color: var(--idle); }

/* ─── Экран входа: бирка на нити ─── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 72px 20px 40px; position: relative; overflow: hidden; }
.auth-tools { position: absolute; top: 18px; right: 18px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.tag {
  width: 100%; max-width: 372px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 58px 30px 26px; box-shadow: var(--shadow);
}
.tag-hole {
  position: absolute; top: 20px; left: 50%; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; background: var(--bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-line);
}
.tag-brand { justify-content: center; margin-bottom: 26px; }
.tag .seg { margin-bottom: 22px; }
.tag .form-err:empty { min-height: 0; margin: 0; }

/* ─── Оболочка ─── */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 14px;
}
.side > .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 12px; background: none; border: 0; border-radius: 8px;
  padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 500; text-align: left; position: relative;
}
.nav button:hover { color: var(--text); background: var(--raised); }
.nav button.on { color: var(--accent); background: var(--accent-soft); }
.nav button.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-label { font-size: 12px; color: var(--faint); padding: 18px 12px 6px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; text-transform: uppercase;
}
.me-text { min-width: 0; flex: 1; line-height: 1.3; margin-left: 4px; }
.me .icon-btn { width: 32px; height: 32px; }
.me-text b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  padding: 16px 32px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 22px; flex: 1; }
.top-tools { display: flex; align-items: center; gap: 10px; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums;
}
.menu-btn { display: none; }
.scrim { display: none; }
.content { padding: 28px 32px 48px; max-width: 1400px; width: 100%; }

/* ─── Карточки, таблицы ─── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.card h3 { font-size: 16px; margin-bottom: 16px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.page-head p, .page-hint { margin: 0; max-width: 68ch; }
.page-hint { margin-bottom: 20px; }

.stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 22px;
}
.stat {
  position: relative; text-align: left; background: var(--surface); border: 0; border-radius: 0;
  padding: 14px 18px 16px; cursor: pointer; transition: background .15s;
}
.stat:hover { background: var(--raised); }
.stat.on { background: var(--raised); }
.stat.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--dot); }
.stat .n { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.15; }
.stat .n.zero { color: var(--faint); font-weight: 500; }
.stat .badge { font-size: 13px; color: var(--muted); }
.stat .badge::before { background: var(--dot, var(--faint)); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 170px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 38px; }

.bulk {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.bulk b { color: var(--accent); }
.bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }

.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--faint);
  padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--raised) 55%, transparent); }
.table tr.sel td { background: var(--accent-soft); }
.table .cb { width: 44px; }
.table .sub { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.table .acts, .table th:last-child { position: sticky; right: 0; background: var(--surface); text-align: right; box-shadow: -8px 0 12px -10px rgba(0,0,0,.35); }
.table tbody tr:hover td.acts { background: color-mix(in srgb, var(--raised) 55%, var(--surface)); }
.table tr.sel td.acts { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.acts-in { display: inline-flex; gap: 2px; }
.acts-in .icon-btn { width: 32px; height: 32px; }
.acts-in .icon-btn .i { width: 17px; height: 17px; }
.num { font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .i { width: 36px; height: 36px; color: var(--faint); margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 0 18px; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pager .muted { margin-right: 8px; font-size: 14px; }

/* ─── Генерация ─── */
.gen-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.gen-side { position: sticky; top: 92px; display: grid; gap: 16px; }
.summary { overflow: hidden; }
.summary dl { margin: 0; display: grid; gap: 10px; }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dt.faint { color: var(--faint); font-size: 13px; }
.summary dd { margin: 0; font-weight: 500; text-align: right; }
.summary dl.totals { margin-bottom: 18px; }
.summary dl .total { font-size: 17px; }
.summary dl .total dt { color: var(--text); font-weight: 500; }
.summary dl .total dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary dl .warn dd { color: var(--bad); }
/* перфорация как у чека: пунктир и два полукруглых выреза по краям */
.perf { position: relative; height: 0; border-top: 2px dashed var(--line-2); margin: 20px -24px 18px; }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
}
.perf::before { left: -12px; }
.perf::after { right: -12px; }
.link-line {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint);
  background: var(--input); border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px 10px; margin-bottom: 16px;
  word-break: break-all;
}
.link-line .i { width: 14px; height: 14px; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.result-head h3 { margin: 0; }
.result textarea { margin-bottom: 12px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.prices { max-width: 480px; }
.price-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.price-row:last-of-type { border-bottom: 0; margin-bottom: 16px; }
.price-row span { flex: 1; font-weight: 500; }
.price-row input { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.price-row small { color: var(--faint); width: 64px; }

/* ─── Модалка и тосты ─── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: var(--scrim); backdrop-filter: blur(3px); }
.modal-card {
  width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow);
  animation: pop .16s ease-out;
}
.modal-card.wide { max-width: 600px; }
.modal-card.xwide { max-width: 960px; }
.tpl-box { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; margin-bottom: 18px; }
.tpl-hint { margin: 0 0 14px; font-size: 14px; max-width: 75ch; }
.tpl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tpl-head .seg { flex: 0 1 320px; }
.tpl-btns { display: flex; gap: 6px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.tpl-grid textarea { font-size: 12.5px; line-height: 1.55; tab-size: 2; }
.tpl-err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 6px; }
.tpl-preview {
  margin: 0; padding: 12px 14px; background: var(--input); border: 1px dashed var(--line-2); border-radius: 8px;
  font-size: 12.5px; line-height: 1.55; color: var(--ok); overflow: auto; max-height: 240px; white-space: pre;
}
.var-list {
  display: grid; gap: 2px; max-height: 420px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--input);
}
.var-list button {
  display: grid; gap: 1px; text-align: left; background: none; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer;
}
.var-list button:hover { background: var(--accent-soft); }
.var-list code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; color: var(--accent); }
.var-list span { font-size: 12.5px; color: var(--muted); }
.tpl-note { display: block; margin-top: 8px; font-size: 12.5px; line-height: 1.5; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.modal-head h2 { font-size: 19px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 20px; }
.meta-grid div { background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.meta-grid dt { font-size: 12px; color: var(--faint); }
.meta-grid dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 500; }
.warn-box { margin: 0 0 18px; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.modal-card p.muted { font-size: 14px; }
.dev-list { display: grid; gap: 6px; margin-bottom: 18px; }
.dev-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; background: var(--input); border-radius: 8px; padding: 8px 10px; }
.section-title { font-size: 14px; font-weight: 600; margin: 4px 0 10px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--raised); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow); font-size: 14px; max-width: 380px;
  animation: pop .16s ease-out;
}
.toast .i { color: var(--ok); }
.toast.bad { border-color: var(--bad); }
.toast.bad .i { color: var(--bad); }

/* ─── Адаптив ─── */
@media (max-width: 1320px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .gen-grid { grid-template-columns: 1fr; }
  .gen-side { position: static; }
}
@media (max-width: 900px) {
  .tag { padding: 54px 22px 22px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 40; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
  .menu-btn { display: inline-grid; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 19px; }
  .content { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px 12px; }
  .stat .n { font-size: 20px; }
  .stat .badge { font-size: 12px; }
  .balance-pill span { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
  .row2, .meta-grid, .tpl-grid { grid-template-columns: 1fr; }
  .toolbar select { flex: 1; }
  .balance-pill .i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ─── Раздел «Бот» ─── */
.bot-lang { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.bot-lang .seg { flex: 0 0 140px; }
.bot-status { margin-left: auto; }
.bot-tabs { max-width: 460px; }
.apps-list { display: grid; gap: 14px; }
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.app-card.off { opacity: .6; }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.app-title b { font-size: 15px; }
.app-title .sub { display: block; }
.item-rows { display: grid; gap: 6px; margin-bottom: 12px; }
.item-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.item-label { font-weight: 500; }
.item-empty { padding: 10px 4px; }
.add-item { width: 100%; }
.table tr.off td { opacity: .55; }
