* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--tg-theme-bg-color, #f4f6f8);
  color: var(--tg-theme-text-color, #1a1a1a);
  min-height: 100vh;
  min-height: 100dvh;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.header {
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--tg-theme-hint-color, #d0d5dd);
}

.role {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #667085);
  margin-bottom: 4px;
}

.title {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.step-counter {
  margin-top: 8px;
  font-size: 14px;
  color: var(--tg-theme-hint-color, #667085);
}

.content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.image-wrap {
  position: relative;
  background: var(--tg-theme-secondary-bg-color, #fff);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--tg-theme-hint-color, #e4e7ec);
  min-height: 180px;
}

#step-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
  background: #fff;
}

.image-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--tg-theme-hint-color, #98a2b3);
  font-size: 14px;
}

.image-wrap.no-image #step-image {
  display: none;
}

.image-wrap.no-image .image-placeholder {
  display: flex;
}

.step-text {
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 16px 0;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tg-theme-hint-color, #d0d5dd);
  transition: transform 0.2s, background 0.2s;
}

.dot.active {
  background: var(--tg-theme-button-color, #2aabee);
  transform: scale(1.2);
}

.footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--tg-theme-button-color, #2aabee);
  color: var(--tg-theme-button-text-color, #fff);
}

.btn-secondary {
  background: var(--tg-theme-secondary-bg-color, #e8edf2);
  color: var(--tg-theme-text-color, #1a1a1a);
}

.state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  text-align: center;
  font-size: 16px;
  color: var(--tg-theme-hint-color, #667085);
}

#image-wrap.zoomed {
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-wrap.zoomed #step-image {
  max-height: 95vh;
  max-width: 95vw;
}
