/* Фирменный стиль Azawa: Onest для заголовков, Inter для текста, фиолетовый акцент,
   крупные скругления, кнопки-пилюли. Токены те же, что в «Библиотеке Azawa». */
:root {
  color-scheme: light;
  --f-head: 'Onest', -apple-system, BlinkMacSystemFont, 'SF Pro Display', Roboto, system-ui, sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', Roboto, system-ui, sans-serif;
  --bg: #ffffff;
  --bg2: #f6f7f9;
  --card: #ffffff;
  --text: #111111;
  --hint: #71757d;
  --link: #613fe5;
  --sep: rgba(17, 17, 17, .1);
  --accent: #613fe5;
  --accent-ink: #ffffff;
  --accent-soft: #efeafd;
  --good: #12a150;
  --good-soft: rgba(18, 161, 80, .12);
  --bad: #d93025;
  --bad-soft: rgba(217, 48, 37, .1);
  --radius: 20px;
  --pill: 360px;
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f11;
  --bg2: #1a1b1f;
  --card: #1a1b1f;
  --text: #f2f2f3;
  --hint: #9a9ca3;
  --link: #9b82ff;
  --sep: rgba(255, 255, 255, .1);
  --accent: #8b6cff;
  --accent-soft: #2a2350;
  --good: #3ddc84;
  --good-soft: rgba(61, 220, 132, .14);
  --bad: #ff6b60;
  --bad-soft: rgba(255, 107, 96, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
h1, h2, h3, .card__t, .stat__n { font-family: var(--f-head); letter-spacing: -.01em; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head__brand { margin: 0 0 2px; font: 600 11px/1 var(--f-head); letter-spacing: .16em; text-transform: uppercase; color: var(--hint); }
.head__hi { margin: 0; font-size: 19px; font-weight: 600; }
.head__hi span { color: var(--accent); }

.card { background: var(--bg2); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card__t { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.card__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--pill); padding: 4px 12px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent); }
.badge--good { background: var(--good-soft); color: var(--good); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }

.key { display: block; width: 100%; background: var(--card); border: 1px solid var(--sep); border-radius: 14px; padding: 12px 14px; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; text-align: left; cursor: pointer; }
.key:active { border-color: var(--accent); }
.hint { font-size: 12px; color: var(--hint); margin: 8px 0 0; }

.meter { height: 6px; border-radius: var(--pill); background: var(--sep); overflow: hidden; margin: 12px 0 8px; }
.meter__bar { height: 100%; background: var(--accent); border-radius: var(--pill); transition: width .3s ease; }

.btn { border: none; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; padding: 12px 20px; cursor: pointer; width: 100%; }
.btn:disabled { opacity: .5; }
.btn--ghost { background: var(--card); color: var(--text); border: 1px solid var(--sep); font-weight: 500; }
.btn--small { width: auto; padding: 7px 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(--hint); }
.steps li { margin-bottom: 6px; }
.steps b { color: var(--text); font-weight: 500; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sep); }
.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; }
.row__s { font-size: 12px; color: var(--hint); }
.row__side { flex: none; text-align: right; font-size: 12px; color: var(--hint); }
.empty { font-size: 13px; color: var(--hint); padding: 8px 0; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--bg2); border-radius: 14px; padding: 12px 14px; }
.stat__n { font-size: 20px; font-weight: 600; }
.stat__l { font-size: 12px; color: var(--hint); }

.search { width: 100%; background: var(--bg2); border: 1px solid transparent; border-radius: var(--pill); padding: 11px 16px; font: inherit; font-size: 14px; color: var(--text); outline: none; margin-bottom: 12px; }
.search:focus { border-color: var(--accent); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: center; padding: 8px 16px calc(var(--safe-bottom) + 10px); background: var(--bg); border-top: 1px solid var(--sep); }
.nav__btn { flex: 1; max-width: 200px; border: none; background: none; color: var(--hint); font-size: 13px; font-weight: 500; padding: 10px 0; border-radius: var(--pill); cursor: pointer; }
.nav__btn.is-on { background: var(--accent-soft); color: var(--accent); }

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