body {
  margin: 0;
  padding: 16px;
  background-color: var(--tg-theme-bg-color, #fff);
  color: var(--tg-theme-text-color, #000);
  font-family: -apple-system, sans-serif;
}

.question-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-overlay {
  position: absolute;
  inset: 0;
  background: var(--tg-theme-bg-color, rgba(255, 255, 255, 0.85));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--tg-theme-hint-color, #ccc);
  border-top-color: var(--tg-theme-button-color, #2481cc);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.question-text {
  font-size: 17px;
  line-height: 1.4;
  margin: 0;
}

.scale-anchors {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tg-theme-hint-color, #999);
}

.likert-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.likert-btn {
  flex: 1;
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background-color: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #fff);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.likert-btn.selected {
  opacity: 1;
  transform: scale(1.1);
}

.likert-btn:disabled {
  cursor: default;
}

.loading, .error {
  color: var(--tg-theme-hint-color, #999);
  text-align: center;
  margin-top: 40px;
}

.forced-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forced-choice-btn {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--tg-theme-button-color, #2481cc);
  border-radius: 12px;
  background: transparent;
  color: var(--tg-theme-text-color, #000);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.forced-choice-btn.selected {
  background-color: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #fff);
}

.forced-choice-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* Profile screen */
.profile-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-title {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}

.profile-count {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #999);
  margin: 0;
}

.domain-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-label {
  width: 110px;
  font-size: 13px;
  flex-shrink: 0;
}

.domain-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--tg-theme-secondary-bg-color, #f0f0f0);
  border-radius: 10px;
  overflow: hidden;
}

.domain-bar-fill {
  height: 100%;
  background: var(--tg-theme-button-color, #2481cc);
  border-radius: 10px;
  transition: width 0.4s ease;
}

.domain-bar-fill.low-confidence {
  opacity: 0.35;
  background: repeating-linear-gradient(
    90deg,
    var(--tg-theme-button-color, #2481cc) 0px,
    var(--tg-theme-button-color, #2481cc) 4px,
    transparent 4px,
    transparent 8px
  );
}

.domain-score {
  width: 30px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.profile-hint {
  font-size: 13px;
  color: var(--tg-theme-hint-color, #999);
  text-align: center;
  margin: 0;
}

/* Navigation */
.nav-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--tg-theme-button-color, #2481cc);
  color: var(--tg-theme-button-text-color, #fff);
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

.nav-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: var(--tg-theme-link-color, #2481cc);
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 12px;
  padding: 8px 0;
}

.done-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Onboarding Screen */
.onboarding-screen {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
    text-align: center;
}

.onboarding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.onboarding-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.onboarding-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.3;
}

.onboarding-text {
    color: var(--tg-theme-hint-color);
    font-size: 16px;
    line-height: 1.5;
}

.onboarding-footer {
    padding: 24px 0;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tg-theme-hint-color);
    opacity: 0.3;
}

.dot.active {
    opacity: 1;
    background: var(--tg-theme-button-color);
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    flex: 1;
}

.btn-secondary {
    padding: 14px 24px;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* Insights */
.insights-container {
    margin: 16px 0;
}

.insights-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.insights-scroll::-webkit-scrollbar {
    display: none;
}

.insight-card {
    flex: 0 0 280px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    scroll-snap-align: start;
}

.insight-icon {
    font-size: 20px;
    margin-right: 8px;
}

.insight-domain {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
}
