/* Кабинет плагина — тот же визуальный язык, что у лендинга:
   Geist, тёплый холст, белые карточки с тонкой рамкой, фиолетовый акцент,
   моно-лейблы капсом. Тема всегда светлая — как на сайте, независимо от Telegram. */
:root {
  color-scheme: light;
  --f-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', Roboto, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --paper: #f1f0ee;
  --paper-2: #e9e7e3;
  --card: #ffffff;
  --ink: #101010;
  --ink-2: #55534e;
  --ink-3: #8b8781;
  --line: rgba(16, 16, 16, .1);
  --line-soft: rgba(16, 16, 16, .06);
  --accent: #5b4be5;
  --accent-2: #8b6cff;
  --accent-soft: #ece7fd;
  --lime: #d9ff47;
  --good: #12a150;
  --bad: #d93025;
  --bad-soft: rgba(217, 48, 37, .1);
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 16px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}


* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 15px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2 { margin: 0; font-weight: 400; letter-spacing: -.03em; line-height: 1.1; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { min-height: 100vh; max-width: 640px; margin: 0 auto; padding: calc(var(--safe-top) + 14px) 16px calc(var(--safe-bottom) + 88px); }
.skeleton { height: 40vh; }

/* ── Шапка ─────────────────────────────────────────────── */
.head { display: grid; gap: 4px; margin-bottom: 20px; }
.head__brand { display: flex; align-items: center; gap: 7px; margin: 0 0 6px;
  font: 400 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.head__brand .brand__svg { width: 18px; height: 18px; border-radius: 4px; display: block; flex: none; }
.head__hi { font-size: 28px; font-weight: 400; letter-spacing: -.032em; }

/* ── Карточки ──────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 20px; margin-bottom: 12px;
  transition: border-color .3s ease; }
.card:hover { border-color: var(--line); }
.card__t { margin: 0 0 12px; font-size: 17px; font-weight: 400; letter-spacing: -.028em; }
.card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 11px; font: 400 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }

.key { display: block; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; font: 400 13px/1.4 var(--f-mono); color: var(--ink); word-break: break-all; text-align: left; cursor: pointer; transition: border-color .18s ease; }
.key:active, .key:hover { border-color: var(--accent); }
.hint { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }

.meter { height: 5px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin: 14px 0 8px; }
.meter__bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s cubic-bezier(.2, .9, .2, 1); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; padding-inline: 18px; border: 1px solid transparent; border-radius: var(--r-sm); background: var(--accent); color: #fff; font: 500 14px var(--f-sans); cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; transform: none; }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper-2); filter: none; }
.btn--small { width: auto; height: 32px; padding-inline: 12px; font-size: 12px; white-space: nowrap; }
.btns { display: flex; gap: 6px; flex: none; }

.steps { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.steps li { margin-bottom: 7px; }
.steps b { color: var(--ink); font-weight: 500; }
.steps a { color: var(--accent); }

/* ── Списки ────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: none; }
.row__main { min-width: 0; }
.row__t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.row__s { font-size: 12px; color: var(--ink-3); }
.row__side { flex: none; font: 400 11px var(--f-mono); color: var(--ink-3); }
.empty { font-size: 13px; color: var(--ink-3); padding: 10px 0; }

/* ── Админка ───────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.stat { background: var(--card); padding: 14px 16px; }
.stat__n { font-size: 24px; font-weight: 400; letter-spacing: -.032em; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.search { width: 100%; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 11px 14px; font: 400 14px var(--f-sans); color: var(--ink); outline: none; margin-bottom: 12px; }
.search:focus { border-color: var(--accent); }

/* ── Навигация ─────────────────────────────────────────── */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; justify-content: center; padding: 8px 16px calc(var(--safe-bottom) + 10px); background: var(--paper); border-top: 1px solid var(--line-soft); }
.nav__btn { flex: 1; max-width: 200px; border: 1px solid transparent; background: none; color: var(--ink-3); font: 400 13px var(--f-sans); padding: 10px 0; border-radius: var(--r-sm); cursor: pointer; transition: background .18s ease, color .18s ease; }
.nav__btn.is-on { background: var(--card); color: var(--ink); border: 1px solid var(--line-soft); }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 82px); transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: 13px; padding: 9px 16px; border-radius: 99px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.toast.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; }
}
