/* 📱 PORA DASHBOARD в Telegram (Mini App, 25.11): поверх panel.css — узкая раскладка боковой панели на весь экран телефона.
   Скрыто то, что без расширения не работает: «📌 следовать за графиком» (графика рядом нет). Экран «скоро / только участникам». */
/* 26.11: прокрутка — только у html; body не контейнер прокрутки (overflow-x: clip вместо hidden), иначе overscroll-behavior
   и overflow-x: hidden из panel.css запирают колесо и палец в body (Тарас: «скролінг не працює»). */
html.tgapp { overscroll-behavior-y: none; }
html.tgapp body { overflow: visible; overflow-x: clip; overscroll-behavior-y: auto; }
html.tgapp .coinbar .icon-btn[title^="Панель следует"],
html.tgapp .coinbar .icon-btn[title^="Монета закреплена"] { display: none; }
html.tgapp .brand .sub { letter-spacing: .04em; }
.tg-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.tg-gate-card { max-width: 360px; width: 100%; padding: 20px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); text-align: center; }
.tg-gate-card b { display: block; font-size: 18px; line-height: 24px; margin-bottom: 8px; }
.tg-gate-card p { margin: 0 0 16px; color: var(--fg2); font-size: 14px; line-height: 20px; }
.tg-gate-card .btn { min-width: 120px; height: 44px; }
/* 🔐 25.11: «Сбросить в боте» рядом с «Закрыть» (отказ «уже привязан»). */
.tg-gate-card .btn + .btn { margin-left: 8px; }
html.tg-gated body { overflow: hidden; }

/* ── 📱 Телефонная раскладка (25.11, Влад: «пункты меню внизу экрана, свайп между вкладками монеты, крупные кнопки, назад —
   системной кнопкой Телеграма»). Меню внизу — те же вкладки панели (#tabs, вынесен из шапки в index.html); свайп и «Назад» —
   в tgapp.js. Отступ снизу — под меню и под полосу жестов (safe area: env() у iOS, --tg-safe-area-inset-bottom у Telegram 8+). ── */
html.tgapp { --tg-bar-h: 56px; }
/* Крупнее: шрифт (основной текст 14 px, мельче 12 — нигде), кнопки и поля 40, чипы 40, строки 40, вкладки 44. */
html.tgapp body.side {
  --fs-1: 12px; --lh-1: 16px; --fs-2: 13px; --lh-2: 18px; --fs-3: 14px; --lh-3: 20px; --fs-4: 15px; --lh-4: 22px;
  --fs-5: 17px; --lh-5: 24px; --fs-6: 20px; --lh-6: 26px;
  --ctl-h: 40px; --chip-h: 40px; --row-h: 40px; --card-h: 48px;
  min-height: 100vh;
  padding-bottom: calc(var(--tg-bar-h) + 8px + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)));
}
html.tgapp.tg-kb body.side { padding-bottom: 8px; }

/* Меню внизу экрана: значок и короткая подпись, выбранный пункт — золотом и чертой сверху. */
html.tgapp #tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 0; margin: 0;
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; overflow: hidden;
  background: var(--bg-a); -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
}
html.tgapp #tabs button {
  position: relative; flex: 1 1 0; min-width: 0; height: var(--tg-bar-h); padding: 0 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--dim); font-size: 12px; line-height: 14px; font-weight: 600; white-space: nowrap; overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
}
html.tgapp #tabs button .ti { display: block; margin: 0; font-size: 21px; line-height: 24px; filter: grayscale(1); opacity: .55; transition: opacity .12s ease; }
html.tgapp #tabs button[aria-selected="true"] { color: var(--acc-fg); }
html.tgapp #tabs button[aria-selected="true"] .ti { filter: none; opacity: 1; }
html.tgapp #tabs button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 2px; border-radius: 0 0 2px 2px; background: var(--acc); }
html.tgapp #tabs button:active { background: var(--hover); }
html.tgapp #tabs button .badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: 11px; line-height: 16px; }
/* Пишут в поле — клавиатура: меню прячется, чтобы не висеть над ней. */
html.tgapp.tg-kb #tabs { display: none; }

/* Шапка: строка марки и строка монеты — кнопки 40 px. */
html.tgapp #hdr:not(.dtop) { padding: 2px var(--s3) 0; }
html.tgapp .brand { height: 44px; gap: 8px; }
html.tgapp .brand img { width: 20px; height: 20px; }
html.tgapp .brand .icon-btn, html.tgapp .coinbar .icon-btn { min-width: 40px; height: 40px; font-size: 18px; }
html.tgapp .coinbar { min-height: 44px; }
html.tgapp .cb-coin, html.tgapp .cb-find { height: 40px; }
html.tgapp #ctx { padding: var(--s1) 0 var(--s2); }

/* Вкладки экрана и монеты — 44 px; сегменты, чипы, «ещё», «?» карточки, подсказки поиска — от 40 px. */
html.tgapp body.side .ctabs button { height: 44px; padding: 0 var(--s3); }
html.tgapp .seg { height: 40px; }
html.tgapp .seg button { height: 36px; padding: 0 var(--s3); }
html.tgapp .fchip, html.tgapp .nchip { height: 40px; }
html.tgapp .hbtn, html.tgapp .icon-btn.hbtn { min-width: 40px; width: 40px; height: 40px; }
html.tgapp .lnk-more { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s2); }
html.tgapp .more { height: 40px; }
html.tgapp .btn.ghost, html.tgapp .btn { min-height: 40px; }
html.tgapp .sugg button { height: 44px; }
html.tgapp .sugg button.two { min-height: 52px; }
html.tgapp .card-t { min-height: 40px; }
html.tgapp .bchip, html.tgapp .bchip.t-up, html.tgapp .bchip.t-down, html.tgapp .bchip.t-warn, html.tgapp .bchip.t-neu { min-height: 40px; }
/* Мелкие кнопки внутри строк (тикер-чип, кнопки таблиц, сортировка в шапке таблицы) остаются на вид прежними, а место касания — 40 px. */
html.tgapp .coin-chip, html.tgapp .tbtn, html.tgapp .th-s { position: relative; }
html.tgapp .coin-chip::after, html.tgapp .tbtn::after { content: ""; position: absolute; left: -4px; right: -4px; top: -10px; bottom: -10px; }
html.tgapp .th-s::after { content: ""; position: absolute; left: -2px; right: -2px; top: -12px; bottom: -12px; }
/* Поля — 16 px: меньше iOS увеличивает страницу при фокусе. */
html.tgapp input[type="text"], html.tgapp input[type="search"], html.tgapp textarea, html.tgapp select { font-size: 16px; }

/* Всплывашки — над меню. */
html.tgapp .toast { bottom: calc(var(--tg-bar-h) + 12px + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px))); }
html.tgapp body.side .askw { top: 50px; max-height: calc(100vh - 66px - var(--tg-bar-h)); }

/* ── 🎨 Цвета темы Telegram (25.11): фон, карточки, линии и текст — переменными panel.css из tgapp.js (класс tg-th на <html>);
   здесь — ссылки и кнопки цветами Telegram (link_color, button_color / button_text_color). Зелёный/красный роста и падения, золото
   сигналов, выбранного пункта и вкладок — свои, не трогаем. ── */
html.tg-th .btn:not(.ghost) { background: var(--tg-btn, var(--acc)); color: var(--tg-btn-fg, var(--acc-ink)); }
html.tg-th .lnk, html.tg-th .tg a, html.tg-th .state.st-err .lnk-more { color: var(--tg-link, var(--acc-fg)); }
html.tg-th .lnk-more:hover, html.tg-th .addr-l:hover { color: var(--tg-link, var(--acc-fg)); border-bottom-color: currentColor; }
html.tg-th .tg-gate { background: var(--bg); }

/* ── 🌐 Сайт (02.12): экран входа, широкий вид на ПК (разметка dashboard.html — tgapp.js), свои экраны web.js поверх #main ── */
html.web .dtop #toSide, html.web .dtop #toPip, html.web .dtop #share { display: none !important; }
.web-gate .tg-gate-card { max-width: 400px; padding: 24px 20px; }
.wg-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; font-size: 16px; letter-spacing: .06em; }
.wg-logo img { width: 28px; height: 28px; border-radius: 6px; }
.wg-logo b { display: inline; margin: 0; font-size: 16px; color: var(--acc-fg); }
.web-gate .tg-gate-card .btn { display: block; width: 100%; margin: 8px 0 0; height: 44px; }
.web-gate .tg-gate-card .btn + .btn { margin-left: 0; }
.web-gate .wg-note { margin: 12px 0 0; min-height: 20px; font-size: 13px; line-height: 18px; color: var(--dim); }
.web-gate .wg-note:empty { display: none; }
.xv { display: none; }
html.xv-on #main { display: none; }
html.xv-on .xv { display: block; min-width: 0; padding: 12px; }
html.desk.xv-on .xv { padding: 16px 24px 32px; max-width: 1240px; }
.xv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.xv-title { font-size: 18px; line-height: 24px; }
.xv-btn.on { color: var(--acc-fg); background: var(--acc-bg); filter: none; }
.xv-out.btn { height: 32px; }
.xv-load, .xv-err { padding: 32px 8px; color: var(--dim); text-align: center; }
/* 🔔 Мои уведомления (02.12, web.js) */
.nf-busy { opacity: .6; pointer-events: none; }
.nf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.nf-est { flex: 1 1 260px; font-size: 16px; line-height: 22px; font-weight: 600; }
.nf-dim { color: var(--dim); font-weight: 400; font-size: 13px; }
.nf-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-warn { flex-basis: 100%; padding: 8px 12px; border-radius: 8px; background: var(--acc-bg); color: var(--acc-fg); font-size: 13px; }
.nf-sec { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.nf-h { margin: 0 0 8px; font-size: 15px; line-height: 20px; }
.nf-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 16px; }
.nf-gname { margin: 4px 0; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.nf-kind { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.nf-kind label { flex: 1 1 auto; min-width: 0; cursor: pointer; font-size: 14px; line-height: 18px; }
.nf-kind input[type="checkbox"], .nf-line input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.nf-kind:not(.on) label { color: var(--fg2); }
.nf-sel { height: 32px; max-width: 120px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card2); color: var(--fg); font-size: 13px; }
.nf-sel:disabled { opacity: .45; }
.nf-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 12px; }
.nf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.nf-chip { height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 17px; background: var(--card2); color: var(--fg2); font-size: 13px; cursor: pointer; }
.nf-chip.on { border-color: var(--acc-line, var(--acc)); background: var(--acc-bg); color: var(--acc-fg); font-weight: 600; }
.nf-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.nf-in { flex: 1 1 180px; height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card2); color: var(--fg); }
.nf-sec p { margin: 0 0 6px; }
.nf-foot { margin: 4px 2px 16px; line-height: 18px; }
html.tgapp .nf-chip, html.tgapp .nf-sel, html.tgapp .nf-in { min-height: 40px; }
/* 📅 Отчёт дня (02.12, rep.js): экран дашборда и страница без входа /app/report */
.rp { min-width: 0; }
.rp-busy { opacity: .6; pointer-events: none; }
.rp-nav, .rp-tabs, .rp-filt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.rp-date, .rp-in { height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card2); color: var(--fg); font: inherit; }
.rp-in[type="search"] { flex: 1 1 160px; max-width: 260px; }
.rp-chip { height: 34px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 17px; background: var(--card2); color: var(--fg2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.rp-chip.on { border-color: var(--acc-line, var(--acc)); background: var(--acc-bg); color: var(--acc-fg); font-weight: 600; }
.rp-chip:disabled { opacity: .45; cursor: default; }
.rp-dim { color: var(--dim); font-size: 13px; }
.rp-up { color: var(--up); }
.rp-down { color: var(--down); }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 12px; }
.rp-tile { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rp-wide { grid-column: span 2; }
@media (max-width: 520px) { .rp-wide { grid-column: auto; } }
.rp-tl { color: var(--dim); font-size: 12px; line-height: 16px; }
.rp-tv { margin: 4px 0; font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-best { margin: 0 0 12px; font-size: 14px; line-height: 20px; }
.rp-tbox { overflow-x: auto; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.rp-table th, .rp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
.rp-table td.rp-text { white-space: normal; min-width: 200px; max-width: 420px; }
.rp-table .rp-num { text-align: right; }
.rp-table .rp-c { text-align: center; }
.rp-th { padding: 0; border: 0; background: none; color: var(--dim); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rp-link { color: var(--acc-fg); }
.rp-empty, .rp-err { padding: 24px 12px; color: var(--dim); text-align: center; }
.rp-sec { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow-x: auto; }
.rp-sec .rp-table { border-top: 1px solid var(--line); }
.rp-h { margin: 0 0 8px; font-size: 15px; }
.rp-h4 { margin: 8px 0 4px; font-size: 13px; color: var(--dim); }
.rp-foot { margin: 0 2px 16px; line-height: 18px; }
.rp-cta { margin: 16px 0 32px; padding: 20px 16px; border: 1px solid var(--acc-line, var(--acc)); border-radius: 12px; background: var(--acc-bg); text-align: center; }
.rp-cta p { margin: 8px 0 12px; color: var(--fg2); }
.rp-cta .btn { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; text-decoration: none; }
body.rp-page { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.rp-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 56px; margin: 0 -16px 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg-a); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.rp-head img { width: 24px; height: 24px; border-radius: 6px; }
.rp-head b { color: var(--acc-fg); letter-spacing: .06em; }
.rp-head .grow { flex: 1 1 auto; }
.rp-head .btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; text-decoration: none; }
.rp-mode { display: flex; gap: 8px; margin: 0 0 12px; }
.rp-top { margin: 0; padding-left: 24px; font-size: 14px; line-height: 22px; }
