:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-bg-color, #f5f7fb);
  --text: var(--tg-theme-text-color, #16202f);
  --muted: var(--tg-theme-hint-color, #64748b);
  --panel: var(--tg-theme-secondary-bg-color, #ffffff);
  --accent: var(--tg-theme-button-color, #2f80ed);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --border: rgba(101, 119, 147, 0.22);
  --soft: rgba(101, 119, 147, 0.12);
  --success: #1f8a5b;
  --error: #b42318;
  --pending: #946200;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.panel,
.state-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
}

.panel {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.brand-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 25px;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.subhead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.value-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.value-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.value-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  line-height: 1.35;
}

.trust-row {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--soft);
}

.trust-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
}

.trust-row[data-tone="success"] .trust-mark {
  background: var(--success);
}

.trust-row[data-tone="error"] .trust-mark {
  background: var(--error);
}

.trust-row span,
.fact-label {
  color: var(--muted);
  font-size: 13px;
}

.trust-row strong {
  display: block;
  margin-top: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  font-weight: 750;
  font-size: 17px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
}

.secondary-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.secondary-button[hidden] {
  display: none;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-text {
  min-height: 44px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.4;
}

.status-text[data-tone="ready"] {
  color: var(--text);
}

.status-text[data-tone="success"] {
  color: var(--success);
}

.status-text[data-tone="error"] {
  color: var(--error);
}

.status-text[data-tone="pending"] {
  color: var(--pending);
}

.state-card {
  padding: 14px;
  display: grid;
  gap: 4px;
}

.state-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.state-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

@media (max-width: 420px) {
  .app-shell {
    padding: 14px;
  }

  .panel {
    padding: 16px;
  }

  .brand-row {
    grid-template-columns: 44px 1fr;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  h1 {
    font-size: 22px;
  }
}
