/* Только стандартные цвета темы Telegram (ТЗ п. 7, «Интерфейс»). Значения по умолчанию —
   светлая тема Telegram, чтобы вне клиента приложение выглядело так же. */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2481cc);
  --btn: var(--tg-theme-button-color, #2481cc);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --sec-bg: var(--tg-theme-secondary-bg-color, #efeff4);
  --section: var(--tg-theme-section-bg-color, #ffffff);
  --section-head: var(--tg-theme-section-header-text-color, #6d6d72);
  --subtitle: var(--tg-theme-subtitle-text-color, #8e8e93);
  --danger: var(--tg-theme-destructive-text-color, #e53935);
  --ok: #2e9e4f;
  --warn: #d98a00;
  --sep: color-mix(in srgb, var(--hint) 22%, transparent);
  --r: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--sec-bg); color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", sans-serif; }
body { min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.bar__title { flex: 1; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 5px 10px;
  font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); cursor: default; }
.net::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.net.off { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.net.sending { background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }
.net.demo { cursor: pointer; }

.view { padding: 12px 12px 0; }
.head { padding: 6px 6px 12px; }
.head h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -.2px; }
.head p { margin: 0; color: var(--subtitle); font-size: 14px; }
.kicker { font-size: 13px; color: var(--hint); font-weight: 600; letter-spacing: .2px; margin-bottom: 4px; }

.sec-title { margin: 18px 16px 6px; font-size: 13px; text-transform: uppercase; color: var(--section-head); letter-spacing: .3px; }
.list { background: var(--section); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 48px; position: relative; width: 100%;
  background: none; border: 0; text-align: left; }
.row + .row::before { content: ""; position: absolute; left: 14px; right: 0; top: 0; border-top: .5px solid var(--sep); }
button.row { cursor: pointer; }
button.row:active { background: color-mix(in srgb, var(--hint) 12%, transparent); }
.row__main { flex: 1; min-width: 0; }
.row__t { font-size: 16px; }
.row__s { font-size: 13.5px; color: var(--subtitle); margin-top: 1px; }
.row__v { font-size: 14px; color: var(--hint); white-space: nowrap; }
.row.disabled { opacity: .45; pointer-events: none; }
.num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; background: var(--sec-bg); color: var(--hint); }
.num.cur { background: var(--btn); color: var(--btn-text); }
.num.ok { background: var(--ok); color: #fff; }
.num.wait { background: var(--warn); color: #fff; }
.ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; font-size: 15px; }
.ico.blue { background: #2481cc; } .ico.green { background: #34c759; } .ico.orange { background: #ff9500; } .ico.red { background: #ff3b30; } .ico.gray { background: #8e8e93; }
.chev { color: var(--hint); font-size: 18px; }
.tick { color: var(--ok); font-weight: 700; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--sec-bg); color: var(--hint); }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.blue { background: color-mix(in srgb, var(--link) 14%, transparent); color: var(--link); }

.links { display: flex; gap: 8px; margin: 10px 6px 0; }
.links a { flex: 1; text-align: center; text-decoration: none; color: var(--link); background: var(--section);
  border-radius: 10px; padding: 9px; font-size: 14px; font-weight: 500; }

.note { margin: 10px 6px; font-size: 13px; color: var(--hint); }
.banner { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: color-mix(in srgb, var(--warn) 14%, var(--section)); }
.banner.err { background: color-mix(in srgb, var(--danger) 12%, var(--section)); }
.banner.info { background: color-mix(in srgb, var(--link) 10%, var(--section)); }

.mark { border: 0; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; min-width: 104px; }
.mark.here { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.mark.gone { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.scan { font-size: 11px; font-weight: 700; color: var(--link); margin-left: 6px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hint); flex: none; }
.radio.on { border: 7px solid var(--btn); }

.btn2 { display: block; width: 100%; margin: 10px 0 0; border: 0; border-radius: 10px; padding: 12px;
  background: var(--section); color: var(--link); font-weight: 600; cursor: pointer; }
.btn2.danger { color: var(--danger); }

textarea { width: 100%; min-height: 76px; border: 0; border-radius: var(--r); padding: 12px 14px; resize: vertical;
  background: var(--section); color: var(--text); font: inherit; }
video.preview { width: 100%; max-height: 300px; border-radius: var(--r); background: #000; display: block; }
.progress { height: 6px; border-radius: 6px; background: var(--sec-bg); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--btn); transition: width .25s; }
.bigdone { text-align: center; padding: 40px 16px 20px; }
.bigdone .emoji { font-size: 56px; }
.bigdone h1 { margin: 12px 0 6px; font-size: 24px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat { background: var(--section); border-radius: var(--r); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 28px; }
.stat span { color: var(--hint); font-size: 13px; }
.empty { text-align: center; color: var(--hint); padding: 60px 20px; }
.empty .emoji { font-size: 44px; margin-bottom: 10px; }

.main-btn { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg);
  border-top: .5px solid var(--sep); z-index: 6; }
.main-btn button { width: 100%; border: 0; border-radius: 10px; padding: 14px; font-weight: 600; font-size: 16px;
  background: var(--btn); color: var(--btn-text); cursor: pointer; }
.main-btn button:disabled { opacity: .45; cursor: default; }
.in-tg .main-btn { display: none; }
.in-tg body, body.in-tg { padding-bottom: 16px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 92%;
  background: rgba(30, 30, 30, .92); color: #fff; font-size: 14px; padding: 10px 14px; border-radius: 12px; z-index: 20;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; }
.sheet__box { width: 100%; background: var(--sec-bg); border-radius: 16px 16px 0 0; padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); max-height: 85vh; overflow: auto; }
.sheet__box h3 { margin: 4px 6px 10px; font-size: 17px; }
.sheet input { width: 100%; border: 0; border-radius: 10px; padding: 12px; font: inherit; background: var(--section); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button { border: 0; border-radius: 999px; padding: 7px 11px; background: var(--section); color: var(--link); font-size: 13px; cursor: pointer; }
.count { font-variant-numeric: tabular-nums; }
