/* Colors follow the Telegram theme; fallbacks follow the phone theme. */
:root {
  --bg: #ffffff; --fg: #111827; --hint: #6b7280;
  --card: #f3f4f6; --accent: #2481cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17212b; --fg: #f3f4f6; --hint: #9ca3af;
    --card: #232e3c; --accent: #6ab3f3;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--fg));
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  line-height: 1.7;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
header { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 6px; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; margin: 12px 0 4px; }
main { padding: 8px 16px; }
.muted { color: var(--tg-theme-hint-color, var(--hint)); }
nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--tg-theme-secondary-bg-color, var(--card));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(128, 128, 128, 0.25);
}
.tab {
  flex: 1; text-align: center; padding: 12px 2px; font-size: 12px;
  color: var(--tg-theme-hint-color, var(--hint)); text-decoration: none;
}
.tab.on { color: var(--tg-theme-link-color, var(--accent)); font-weight: 700; }
