:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-bg-color, #f4f7f7);
  --text: var(--tg-theme-text-color, #101820);
  --muted: var(--tg-theme-hint-color, #68737d);
  --panel: var(--tg-theme-secondary-bg-color, #ffffff);
  --button: var(--tg-theme-button-color, #0f8b8d);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --line: rgba(16, 24, 32, 0.12);
  --accent: #d1495b;
  --gold: #edae49;
  font-family: Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  justify-content: center;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  flex: 0 0 auto;
  border-radius: 14px;
}

.eyebrow,
.session-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
}

.icon-button svg,
.buy-button svg,
.action-tile svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action {
  margin-bottom: 14px;
}

.buy-button {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 8px;
  padding: 18px;
  color: var(--button-text);
  background: linear-gradient(135deg, var(--button), #2364aa);
  text-align: right;
  box-shadow: 0 12px 26px rgba(15, 139, 141, 0.24);
}

.coin-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-weight: 800;
  font-size: 13px;
}

.buy-button strong {
  display: block;
  font-size: 20px;
  line-height: 1.4;
}

.buy-button small {
  display: block;
  opacity: 0.82;
  font-size: 13px;
  line-height: 1.7;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.action-tile {
  min-height: 94px;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.action-tile svg {
  color: var(--accent);
}

.action-tile span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.session-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.session-value {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(237, 174, 73, 0.18);
}

.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  min-height: 44px;
  display: none;
  place-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(16, 24, 32, 0.92);
  color: #fff;
  font-size: 14px;
  text-align: center;
  z-index: 10;
}

.toast.is-visible {
  display: grid;
}

@media (max-width: 360px) {
  .action-grid {
    grid-template-columns: 1fr;
  }

  .action-tile {
    min-height: 64px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding: 0 16px;
  }
}
