/* Спокойный минимализм: цвета берутся из темы Telegram (светлая/тёмная), запасные — нейтральный графит с одним мягким акцентом. */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #0f1114); --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #181b20));
  --line: var(--tg-theme-section-separator-color, rgba(128, 136, 150, .22)); --text: var(--tg-theme-text-color, #e8eaed); --dim: var(--tg-theme-hint-color, #8b93a1);
  --neon: var(--tg-theme-link-color, #7aa7ff); /* акцент (имя осталось прежним — на него ссылается скрипт) */
  --pink: #d99a5b; /* второй цвет для графиков и «цели» */
  --ok: #4fbf86; --warn: #d9a441; --bad: #e0646a; --on: #fff;
  --soft: color-mix(in srgb, var(--neon) 13%, transparent);
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; font-size: 17px; font-weight: 650; letter-spacing: .02em; } .eye { display: none; }
.host { margin-left: auto; color: var(--dim); font-size: 13px; }
.icon { background: none; border: 0; color: var(--dim); border-radius: 10px; width: 34px; height: 34px; font-size: 18px; cursor: pointer; } .icon:active { background: var(--soft); }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; display: grid; gap: 12px; }
.tabs { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.tab { flex: 1; background: none; border: 0; color: var(--dim); padding: 5px 2px; font-size: 11px; cursor: pointer; display: grid; gap: 2px; justify-items: center; border-radius: 12px; }
.tab span { font-size: 19px; filter: grayscale(1); opacity: .65; }
.tab.on { color: var(--text); font-weight: 600; } .tab.on span { filter: none; opacity: 1; }
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; }
.card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--dim); }
.card h3 small { color: var(--dim); font-weight: 400; margin-left: 6px; }
.grid { display: grid; gap: 12px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; } .row .grow { flex: 1; min-width: 0; }
.row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row .s { color: var(--dim); font-size: 12px; }
.dim { color: var(--dim); } .ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .pink { color: var(--pink); }
.big { font-size: 24px; font-weight: 650; line-height: 1.15; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.gauge { display: grid; justify-items: center; gap: 4px; text-align: center; }
.gauge svg { width: 88px; height: 88px; } .gauge .v { font-weight: 650; font-size: 17px; } .gauge .l { color: var(--dim); font-size: 12px; }
button.btn, a.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--neon); border: 0; border-radius: 10px; padding: 8px 13px;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; }
button.btn:active { filter: brightness(1.25); } button.btn[disabled] { opacity: .45; }
button.btn.pink { color: var(--pink); background: color-mix(in srgb, var(--pink) 14%, transparent); }
button.btn.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 13%, transparent); } button.btn.sm { padding: 5px 10px; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { border: 0; color: var(--dim); background: var(--soft); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { color: var(--on); background: var(--neon); }
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--neon); } textarea { min-height: 84px; resize: vertical; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--dim); font-size: 14px; } label.check input { width: auto; }
.bar { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--neon); border-radius: 4px; }
.badge { display: inline-block; font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dim); } .dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.chart { width: 100%; height: auto; display: block; } .chart text { fill: var(--dim); font-size: 10px; }
.toast { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(82px + env(safe-area-inset-bottom)); background: var(--text); color: var(--bg);
  border-radius: 12px; padding: 10px 16px; max-width: 90vw; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); } .toast.err { background: var(--bad); color: #fff; }
.sheet { position: fixed; z-index: 15; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 760px; max-height: 88vh; overflow: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 16px; display: grid; gap: 12px; }
.empty { color: var(--dim); text-align: center; padding: 16px 0; } .spin { color: var(--dim); text-align: center; padding: 28px 0; animation: pulse 1.2s infinite; } @keyframes pulse { 50% { opacity: .35 } }
pre.log { margin: 0; max-height: 300px; overflow: auto; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.bubble { padding: 9px 12px; border-radius: 14px; max-width: 88%; white-space: pre-wrap; } .bubble.me { justify-self: end; background: var(--soft); }
.bubble.bot { justify-self: start; background: var(--bg); }
.inline { display: flex; gap: 8px; } .inline > :first-child { flex: 1; } .right { margin-left: auto; }
a { color: var(--neon); }

[hidden] { display: none !important; }
