/* Мини-приложение «Бот-сводка». Цвета — из темы Telegram (--tg-theme-*), в браузере — запасные светлые/тёмные. */
:root {
  --fb-bg: #ffffff; --fb-sec: #f1f1f4; --fb-text: #0f0f12; --fb-hint: #8b8b93; --fb-link: #2a7ae2;
  --fb-btn: #2a7ae2; --fb-btn-text: #ffffff; --fb-sep: #e3e3e8; --fb-danger: #e5383b; --fb-accent: #2a7ae2;
  --bg: var(--tg-theme-secondary-bg-color, var(--fb-sec));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-bg)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --link: var(--tg-theme-link-color, var(--fb-link));
  --btn: var(--tg-theme-button-color, var(--fb-btn));
  --btn-text: var(--tg-theme-button-text-color, var(--fb-btn-text));
  --sep: var(--tg-theme-section-separator-color, var(--fb-sep));
  --danger: var(--tg-theme-destructive-text-color, var(--fb-danger));
  --accent: var(--tg-theme-accent-text-color, var(--fb-accent));
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --fb-bg: #1c1c1e; --fb-sec: #0f0f10; --fb-text: #f2f2f5; --fb-hint: #8e8e96; --fb-link: #5aa1ff;
          --fb-btn: #3b82f6; --fb-sep: #2c2c30; --fb-danger: #ff5a5f; --fb-accent: #5aa1ff; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
main { max-width: 640px; margin: 0 auto; padding: 8px 12px 140px; }
.loading { color: var(--hint); text-align: center; margin-top: 40vh; }
h1 { font-size: 22px; margin: 12px 4px 4px; }
.lead { color: var(--hint); margin: 0 4px 12px; font-size: 14px; }
.back { background: none; border: 0; color: var(--link); font-size: 16px; padding: 8px 4px; cursor: pointer; }
.section { margin: 14px 0; }
.section-title { color: var(--hint); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; margin: 0 14px 6px; }
.section-note { color: var(--hint); font-size: 13px; margin: 6px 14px 0; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; position: relative;
  cursor: pointer; user-select: none; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 1px solid var(--sep); }
.row.noicon + .row.noicon::before, .row.noicon + .row::before { left: 14px; }
.row:active { opacity: .7; }
.row.disabled { opacity: .45; }
.row .icon { width: 26px; text-align: center; font-size: 20px; flex: none; }
.row .body { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.row .sub { color: var(--hint); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.row .value { color: var(--hint); font-size: 14px; text-align: right; max-width: 48%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.row .chev { color: var(--hint); font-size: 20px; flex: none; }
.row.danger .title { color: var(--danger); }
.row.link .title { color: var(--link); }
.check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--hint); flex: none;
  display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--btn-text); }
.check.all, .check.some { background: var(--btn); border-color: var(--btn); }
.check.radio { border-radius: 50%; }
.row .field-wrap { margin: 0; }
.row .field { padding: 4px 0; background: transparent; border-radius: 0; }
.open { color: var(--link); font-size: 14px; padding: 6px 2px 6px 10px; flex: none; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--sep); position: relative; flex: none;
  transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on { background: var(--btn); }
.switch.on::after { left: 21px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tile { background: var(--card); border-radius: var(--radius); padding: 14px; min-height: 92px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; }
.tile .icon { font-size: 26px; }
.tile .title { font-weight: 600; }
.tile .sub { color: var(--hint); font-size: 13px; }
.tile.disabled { opacity: .45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { background: var(--card); border-radius: 18px; padding: 8px 12px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--sep); }
.chip.on { background: var(--btn); color: var(--btn-text); border-color: var(--btn); }
.hint-bar { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0;
  display: flex; gap: 10px; align-items: center; cursor: pointer; }
.hint-bar .title { flex: 1; font-size: 14px; }
.field { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--radius); background: var(--card);
  color: var(--text); font: inherit; outline: none; }
textarea.field { min-height: 110px; resize: vertical; }
.field-wrap { margin: 10px 0; }
.btn { display: block; width: 100%; padding: 14px; border: 0; border-radius: var(--radius); background: var(--btn);
  color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer; margin: 10px 0; }
.btn.secondary { background: var(--card); color: var(--link); font-weight: 500; }
.btn.danger { background: var(--card); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); }
.sticky .btn { max-width: 616px; margin: 0 auto; }
.sticky .under { text-align: center; color: var(--hint); font-size: 13px; margin-top: 4px; }
.price { text-align: center; color: var(--hint); font-size: 14px; margin: 6px 0; }
.empty { text-align: center; color: var(--hint); padding: 36px 16px; }
.empty .icon { font-size: 40px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(20,20,22,.92);
  color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: 90vw; }
.slide { text-align: center; padding: 40px 12px 12px; }
.slide .icon { font-size: 64px; }
.slide h1 { margin-top: 16px; }
.dots { text-align: center; color: var(--hint); letter-spacing: 6px; margin: 12px 0; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 28px; letter-spacing: 4px; text-align: center;
  background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 0; user-select: all; }
.qr { display: block; margin: 12px auto; width: 240px; height: 240px; border-radius: var(--radius); background: #fff; }
.pre { white-space: pre-wrap; background: var(--card); border-radius: var(--radius); padding: 12px 14px; font-size: 14px;
  overflow-wrap: anywhere; }
.result-head { display: flex; gap: 8px; align-items: baseline; }
.result-head .title { font-weight: 600; flex: 1; }
.tag { color: var(--hint); font-size: 13px; }
.score { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; font-size: 14px; }
.score .h { color: var(--hint); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal div { padding: 8px 0; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cal .wd { color: var(--hint); cursor: default; font-size: 12px; }
.cal .off { visibility: hidden; }
.cal .future { color: var(--hint); opacity: .4; cursor: default; }
.cal .in { background: color-mix(in srgb, var(--btn) 25%, transparent); }
.cal .edge { background: var(--btn); color: var(--btn-text); }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin: 8px 4px; }
.small { font-size: 13px; color: var(--hint); }
.mt { margin-top: 14px; }
