.survey-container {
  flex-direction: column;
  gap: 16px;
  padding: 60px 20px 28px;
  overflow-y: auto;
  overflow-x: hidden;
}

.survey-header {
  position: absolute;
  bottom: 14rem;
  left: 0;
  z-index: 2;
  max-width: 400px;
  width: 90%;
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-size: 16px;
  color: #181D27;
  position: relative;
}

.survey-header {
  bottom: auto;
  left: auto;
  width: 90%;
  max-width: 400px;
  flex-shrink: 0;
}

.loading-icon {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #016143;
    border-radius: 50%;
    width: 32px;
    height: 24px;
    animation: loading-spinner-rotate 1s linear infinite;
}
.survey-card {
  background: #fff;
  padding: 24px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  text-align: start;
  z-index: 2;
  display: none;
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 90%;
  max-width: 500px;
  margin: 0 auto;
}

/* Follow-up card scrolls internally; title and nav stay visible */
.survey-container .survey-card.follow-up {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 185px);
  max-height: calc(100dvh - 185px);
}

.survey-container .survey-card.follow-up .checkbox-options {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.survey-container .survey-card.follow-up .followup-nav {
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}

.survey-card.active {
  display: block;
}

/* Question text */
.survey-card h2 {
  font-size: 24px;
  font-weight: normal;
  line-height: 32px;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.survey-card h2 strong {
  font-weight: 700;
}

/* Italic hint below question */
.survey-subtext {
  font-style: italic;
  font-size: 14px;
  color: #666;
  margin-bottom: 30px;
  margin-top: 30px;
}

.follow-up .survey-subtext {
  margin-top: 16px;
  margin-bottom: 16px;
}

/* === EMOJI SCALE === */

.emoji-scale {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 30px;
  padding: 0 2px;
}

/* Gradient track — colours match the emoji border palette */
.emoji-track {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: linear-gradient(to right, #F97171, #FB6514, #FBBF23, #84CC16, #4BDE80);
  border-radius: 3px;
  z-index: 0;
}

/*
  Layout size is fixed at 36×36 so the track alignment never shifts.
  Unselected: scale(0.667) → appears ~24×24 with a visually ~2px border.
  Selected:   scale(1.0)   → appears 36×36 with a 3px border.
  (Border is declared at 3px; at scale 0.667 it renders as ~2px.)
*/
.emoji-btn {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  border: 3px solid transparent;
  transform: scale(0.667);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.emoji-btn.selected {
  transform: scale(1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

/* Per-emoji border colours */
.emoji-btn[data-value="1"] { border-color: #F97171; }
.emoji-btn[data-value="2"] { border-color: #FB6514; }
.emoji-btn[data-value="3"] { border-color: #FBBF23; }
.emoji-btn[data-value="4"] { border-color: #84CC16; }
.emoji-btn[data-value="5"] { border-color: #4BDE80; }

/* Label area below the track */
.scale-label-area {
  margin-top: 6px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

/* Response preview pill */
.scale-pill {
  color: #111827;
  font-size: 14px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0 18px;
  font-weight: 500;
  line-height: 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.scale-pill--hidden { visibility: hidden; }

.scale-pill[data-value="1"] { border-color: #F97171; background: rgba(249, 113, 113, 0.18); }
.scale-pill[data-value="2"] { border-color: #FB6514; background: rgba(251, 101, 20, 0.18); }
.scale-pill[data-value="3"] { border-color: #FBBF23; background: rgba(251, 191, 35, 0.18); }
.scale-pill[data-value="4"] { border-color: #84CC16; background: rgba(132, 204, 22, 0.18); }
.scale-pill[data-value="5"] { border-color: #4BDE80; background: rgba(75, 222, 128, 0.18); }

/* === NAV BUTTONS === */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.nav-buttons button {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  width: 151px;
  height: 44px;
  color: #535862;
  border: none;

}
/* Primary action button (Next / Submit) used in both base and follow-up cards */
.next-btn {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  background: #D0EDE4;
  color: #016143;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Funnel Display', sans-serif;
  touch-action: manipulation;
}

.next-btn:hover {
  background: #b8ddd0;
}

.next-btn:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

.back-btn {
  width: 151px;
  height: 44px;
  background: #fff;
  border: 2px solid #D5D7DA;
  border-radius: 12px;
  color: #414651;
}

.skip-btn {
  background: transparent;
  color: #666;
  border: none;
}

/* Skip link that sits below the Back/Next row */
.skip-below {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  margin-top: 6px;
  font-family: 'Funnel Display', sans-serif;
  touch-action: manipulation;
}

.skip-below:hover {
  color: #6b7280;
}

/* === CHECKBOX OPTIONS (follow-up questions) === */

.checkbox-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-weight: 400;
}

.checkbox-option--other {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.checkbox-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.checkbox-label-text {
  font-size: 15px;
  color: #333;
  flex: 1;
  text-align: left;
  line-height: 1.4;
}

/* Custom checkbox/radio: rounded square, right side */
.checkbox-option input[type="checkbox"],
.checkbox-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.checkbox-option input[type="checkbox"]:checked,
.checkbox-option input[type="radio"]:checked {
  background: #016143;
  border-color: #016143;
}

.checkbox-option input[type="checkbox"]:checked::after,
.checkbox-option input[type="radio"]:checked::after {
  content: "✓";
  position: absolute;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  top: -1px;
  left: 3px;
}

/* === DEMOGRAPHIC SURVEY (sidebar insight cards) === */

.dem-intro-text {
  font-size: 15px;
  color: #1a1a1a;
  line-height: 1.5;
  margin-bottom: 4px;
  margin-top: 0;
}

.dem-intro-subtext {
  font-style: italic;
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  margin-top: 0;
}

.dem-question {
  font-size: 20px;
  font-weight: normal;
  line-height: 1.35;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.dem-options {
  margin-bottom: 0;
}

.dem-nav {
  margin-top: 16px;
}

/* === DEMOGRAPHIC TOAST === */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #016143;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Funnel Display', sans-serif;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  white-space: nowrap;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.checkbox-option.selected {
  border-color: #016143;
  background: #f0faf6;
}

.checkbox-option.selected .checkbox-label-text {
  color: #016143;
  font-weight: 500;
}

.other-field {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
}

.other-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: #333;
  background: transparent;
  font-family: 'Funnel Display', sans-serif;
}

.other-input::placeholder {
  color: #aaa;
}

/* === FOLLOW-UP NAV ROW === */

.followup-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* === POST-SURVEY DONE CARD === */

.survey-card--done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px 36px 30px;
}

.survey-done-spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #e5e7eb;
  border-top-color: #016143;
  border-radius: 50%;
  animation: loading-spinner-rotate 1s linear infinite;
  flex-shrink: 0;
  margin: 0 auto 16px;
}

.survey-card .survey-done-title {
  color: #191919;
  font-weight: 700;
  margin-bottom: 20px;
}

.survey-card--done .survey-status {
  font-size: 18px;
  color: #191919;
  margin: 0;
}
