:root {
  color-scheme: dark;
  --page: #0b0d10;
  --panel: #14171b;
  --stroke: #26292d;
  --primary: #ebedef;
  --secondary: #c8ccd3;
  --muted: #9da4af;
  --good: #56c197;
  --bad: #f06f62;
  --warn: #d9a645;
  --orange: #ff771d;
  font-family: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--primary); }
main { max-width: 640px; margin: 0 auto; padding: max(14px, var(--tg-content-safe-area-inset-top, 0px)) 14px 78px; }
h1 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -.024em; }
h2 { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 13px; }
p { margin: 0; line-height: 1.42; }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; color: var(--primary); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .55; }
[hidden] { display: none !important; }
.top, .row, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top { margin-bottom: 14px; }
.logo { display: block; width: 57px; height: 24px; margin: 0 0 6px; }
.tabs, .actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tab, .action { padding: 8px 11px; border-radius: 8px; background: #1c1e21; color: var(--secondary); font-size: 13px; font-weight: 650; min-height: 34px; }
.tab[aria-pressed=true], .action.strong, .primary { color: var(--page); background: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.panel { background: var(--panel); border: 1px solid var(--stroke); border-radius: 13px; padding: 14px; margin-bottom: 12px; }
.grid .panel { margin: 0; min-height: 83px; }
.grid { margin-bottom: 12px; }
.metric { display: block; font-size: 25px; font-weight: 750; line-height: 1.2; margin: 3px 0; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.badge { display: inline-flex; align-items: center; white-space: nowrap; padding: 4px 8px; border-radius: 7px; background: #24272b; font-size: 12px; font-weight: 650; }
.badge.good { background: #1c2d28; }
.badge.bad { background: #302222; }
.badge.warn { background: #302920; }
.row { min-width: 0; padding: 10px 0; border-top: 1px solid var(--stroke); text-align: left; overflow-wrap: anywhere; }
.row:first-of-type { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
button.row { width: 100%; background: transparent; }
.row p, .row small { display: block; margin-top: 2px; }
.panel-title { font-size: 14px; font-weight: 700; }
.chart { display: block; width: 100%; height: 110px; color: var(--secondary); overflow: visible; }
.chart-layout { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.chart-scale { display: flex; flex-direction: column; justify-content: space-between; padding: 5px 0; color: var(--muted); font-size: 11px; text-align: left; }
.chart-grid { fill: none; stroke: var(--stroke); stroke-width: .5; stroke-dasharray: 2 4; }
.dau-panel .section-head { align-items: flex-start; margin-bottom: 14px; }
.dau-panel h2 { margin: 0; white-space: nowrap; }
.chart-range { text-align: right; font-size: 11px; }
.dashboard-header { align-items: flex-start; }
.dashboard-header small { display: block; font-size: 11px; line-height: 1.5; }
.timestamp { margin-top: 2px; }
.alert-button { flex-shrink: 0; white-space: nowrap; border-radius: 8px; padding: 8px; background: #24272b; color: var(--secondary); font-size: 12px; font-weight: 650; }
.alert-button.has-alerts { color: var(--bad); background: #302222; }
.metric-description { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.funnel-description { min-width: 0; }
.funnel-description strong { font-size: 13px; }
.funnel-description small { font-size: 11px; line-height: 1.35; overflow-wrap: normal; }
.funnel-result { display: grid; grid-template-columns: 48px 80px; align-items: center; justify-items: end; gap: 6px; text-align: right; white-space: nowrap; }
.funnel-result > strong { font-size: 14px; }
.funnel-result .badge { font-size: 10px; padding: 4px 6px; }
.bar, .track { display: block; border-radius: 8px; height: 8px; }
.track { width: 100%; background: #25282c; margin: 8px 0 14px; }
.bar { background: var(--secondary); }
.bar.last { background: var(--orange); }
.step { display: flex; justify-content: space-between; gap: 8px; }
.primary { position: fixed; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 24px), 615px); padding: 14px; border-radius: 12px; font-weight: 750; }
.notice { position: fixed; inset: auto 12px 66px; max-width: 600px; margin: auto; background: var(--panel); border: 1px solid var(--stroke); padding: 12px; border-radius: 9px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, textarea, select { max-width: 100%; min-width: 0; background: var(--page); color: var(--primary); border: 1px solid var(--stroke); padding: 10px; border-radius: 8px; }
.toggle { display: flex; justify-content: space-between; align-items: center; }
.toggle input { accent-color: var(--primary); width: 20px; height: 20px; }
.pack { display: block; width: 100%; text-align: left; color: var(--primary); }
.pack.selected { outline: 2px solid var(--primary); outline-offset: -2px; }
.pack p { color: var(--muted); margin-top: 5px; }

.period-note { margin-bottom: 10px; font-size: 12px; }
