/* ───────────────────────────────────────────────────────────────────────────
 * Telegram Mini App design system — tonsite.
 *
 * Component classes use a mini-app-specific vocabulary, separate from the
 * desktop product shell. Colors come from Telegram's injected `--tg-theme-*` CSS
 * variables (set by telegram-web-app.js), with fallbacks so the same shell also
 * renders standalone in a browser. Component vocabulary mirrors the native
 * Telegram-iOS / Apple-iOS kits: grouped table cells + section headers, a
 * floating liquid-glass tab bar, a slide-up bottom sheet, pill buttons.
 * Geometry is ported from ../redoapp and aligned with the Telegram iOS UI Kit:
 * regular list row 6023:2116, 2-tab bar 6028:2075, sheet 6211:5049.
 * ─────────────────────────────────────────────────────────────────────────── */

html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body { background: var(--tg-theme-bg-color, #ffffff); }

.tg-app {
  /* Theme tokens (Telegram → fallback). One indirection so the rules below read
     cleanly and a single line swaps a token app-wide. */
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --subtitle: var(--tg-theme-subtitle-text-color, var(--tg-theme-hint-color, #8e8e93));
  --link: var(--tg-theme-link-color, #3390ec);
  --accent: var(--tg-theme-button-color, #3390ec);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, var(--bg));
  --section-bg: var(--tg-theme-section-bg-color, var(--secondary-bg));
  --destructive: var(--tg-theme-destructive-text-color, #ff3b30);
  --separator: var(--tg-theme-section-separator-color, rgba(128, 128, 128, 0.22));
  --ok: #34c759;

  --safe-top: var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);

  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  color-scheme: light dark;
}
html[data-theme="light"] .tg-app { color-scheme: light; }
html[data-theme="dark"] .tg-app { color-scheme: dark; }

.tg-app * { box-sizing: border-box; }

:where(.tg-app) button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.tg-app code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  padding: 0.05em 0.35em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.tg-app a { color: var(--link); text-decoration: none; }

.gram-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -0.14em;
  background: url("../assets/gram.svg") center / contain no-repeat;
}

.tg-btn--primary .gram-icon,
.btn-new .gram-icon {
  background-image: url("../assets/gram-inverted.svg");
}

.icon-bid {
  display: inline-block;
  width: 21px;
  height: 22px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("../assets/telegram-bid-fill.svg") center / contain no-repeat;
  mask: url("../assets/telegram-bid-fill.svg") center / contain no-repeat;
}

.dns-catalog-amount {
  font-size: 14px;
  font-weight: 590;
}

.dns-catalog-amount .gram-icon {
  width: 1.1em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.18em;
}
