:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary: var(--tg-theme-secondary-bg-color, #f2f2f7);
  --section: var(--tg-theme-section-bg-color, var(--bg));
  --separator: var(--tg-theme-section-separator-color, rgba(0, 0, 0, 0.08));
  --destructive: var(--tg-theme-destructive-text-color, #ff3b30);
  --subtitle: var(--tg-theme-subtitle-text-color, var(--hint));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-h: 72px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
}

#app {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

.top {
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.steps {
  display: flex;
  gap: 6px;
}

.steps span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--separator);
  transition: background 0.2s ease;
}

.steps span.on {
  background: var(--button);
}

.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px calc(var(--bottom-h) + var(--safe-bottom) + 16px);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  opacity: 1;
}

.title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--subtitle);
  font-size: 15px;
  margin-bottom: 20px;
}

.platform-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--secondary);
  border-radius: var(--radius);
  padding: 4px;
}

.platform-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.platform-item:active {
  background: rgba(127, 127, 127, 0.12);
}

.platform-item.selected {
  background: var(--section);
  box-shadow: 0 0 0 1px var(--separator);
}

.platform-item .emoji {
  font-size: 22px;
  width: 28px;
  text-align: center;
}

.platform-item .label {
  flex: 1;
  font-weight: 500;
}

.platform-item .check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--hint);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.15s ease;
}

.platform-item.selected .check {
  border-color: var(--button);
  background: var(--button);
  color: var(--button-text);
}

.card {
  background: var(--secondary);
  border-radius: var(--radius);
  padding: 16px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--section);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.card-title {
  font-weight: 600;
  font-size: 16px;
}

.card-title.muted {
  font-weight: 500;
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-hint {
  color: var(--hint);
  font-size: 13px;
  margin-top: 2px;
}

.sub-name {
  font-weight: 600;
  margin-bottom: 6px;
}

.sub-url {
  font-size: 13px;
  color: var(--hint);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--secondary);
  border-radius: var(--radius);
  color: var(--subtitle);
  font-size: 14px;
}

.done-block {
  text-align: center;
  padding-top: 48px;
}

.done-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 600;
}

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--tg-theme-bottom-bar-bg-color, var(--bg));
  border-top: 0.5px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:active {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  background: var(--button);
  color: var(--button-text);
  order: 1;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
  order: 2;
}

.btn-ghost {
  background: transparent;
  color: var(--link);
  order: 3;
  font-weight: 500;
  padding: 8px;
}

.error-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--destructive) 12%, transparent);
  color: var(--destructive);
  font-size: 14px;
}
