/* CSS Custom Properties / Design Tokens */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-header: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Motion & Layout */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  --error: #ef4444;

  /* Theme-specific tokens (Default: Dark Mode - Solid Black Background) */
  --bg-main: #000000;
  --card-bg: #111111;
  --card-border: #262626;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Breast Cancer Ribbon Pink Palette */
  --primary: #ec4899; /* Breast Cancer Ribbon Pink */
  --primary-hover: #db2777;
  --primary-glow: rgba(236, 72, 153, 0.22);
  
  --accent: #10b981; /* Emerald */
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.2);

  --ai-purple: #f472b6; /* Ribbon Pink Tint */
  --ai-purple-glow: rgba(244, 114, 182, 0.18);

  /* Transparent overlay helpers */
  --item-bg: #171717;
  --item-border: #262626;
  --item-hover-bg: #222222;
  --item-hover-border: #383838;
  --item-selected-bg: var(--primary-glow);
  --item-selected-color: #fff;
  --item-selected-final-bg: var(--accent-glow);
  --item-selected-final-color: #fff;

  --card-divider: #262626;
  --slider-track: #262626;
  --modal-backdrop: rgba(0, 0, 0, 0.85);
  
  color-scheme: dark;
}

/* Light Theme Variables */
[data-theme="light"] {
  /* Solid White Background */
  --bg-main: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --primary: #db2777; /* Deep Contrast Breast Cancer Ribbon Pink */
  --primary-hover: #be185d;
  --primary-glow: rgba(219, 39, 119, 0.14);
  
  --accent: #059669;
  --accent-hover: #065f46;
  --accent-glow: rgba(5, 150, 105, 0.12);

  --ai-purple: #db2777;
  --ai-purple-glow: rgba(219, 39, 119, 0.14);

  --item-bg: #f8fafc;
  --item-border: #e2e8f0;
  --item-hover-bg: #f1f5f9;
  --item-hover-border: #cbd5e1;
  --item-selected-bg: var(--primary);
  --item-selected-color: #fff;
  --item-selected-final-bg: var(--accent);
  --item-selected-final-color: #fff;

  --card-divider: #e2e8f0;
  --slider-track: #e2e8f0;
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  
  color-scheme: light;
}

/* System Preference Fallback */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-main: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    
    --primary: #db2777;
    --primary-hover: #be185d;
    --primary-glow: rgba(219, 39, 119, 0.14);
    
    --accent: #059669;
    --accent-hover: #065f46;
    --accent-glow: rgba(5, 150, 105, 0.12);

    --ai-purple: #db2777;
    --ai-purple-glow: rgba(219, 39, 119, 0.14);

    --item-bg: #f8fafc;
    --item-border: #e2e8f0;
    --item-hover-bg: #f1f5f9;
    --item-hover-border: #cbd5e1;
    --item-selected-bg: var(--primary);
    --item-selected-color: #fff;
    --item-selected-final-bg: var(--accent);
    --item-selected-final-color: #fff;

    --card-divider: #e2e8f0;
    --slider-track: #e2e8f0;
    --modal-backdrop: rgba(0, 0, 0, 0.6);
    
    color-scheme: light;
  }
}

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  position: relative;
  padding: 24px 16px;
}

/* Background Ambient Glows - Disabled for clean solid background */
.bg-glow {
  display: none !important;
}

/* App Container & Layout */
.app-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
  margin: 0 auto;
}

/* Desktop Widescreen Layout (3/4 of Screen Width) */
@media (min-width: 992px) {
  body {
    padding: 36px 24px 60px;
  }

  .app-container {
    width: 75vw;
    max-width: 1600px;
  }

  .survey-card {
    padding: 44px 48px;
    gap: 32px;
  }

  .expect-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .modal-content {
    max-width: min(75vw, 840px);
  }
}

/* Header & Progress Tracking */
.survey-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
  outline: none;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Toggle Sun/Moon Icon State */
[data-theme="light"] .theme-toggle-icon .sun-icon {
  display: none;
}
[data-theme="light"] .theme-toggle-icon .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle-icon .sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle-icon .moon-icon {
  display: none;
}

/* System preference defaults when data-theme attribute is not set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle-icon .sun-icon {
    display: none;
  }
  :root:not([data-theme]) .theme-toggle-icon .moon-icon {
    display: block;
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle-icon .sun-icon {
    display: block;
  }
  :root:not([data-theme]) .theme-toggle-icon .moon-icon {
    display: none;
  }
}
/* If system prefers-color-scheme media query isn't matched, default to showing sun-icon (as background is dark) */
:root:not([data-theme]) .theme-toggle-icon .sun-icon {
  display: block;
}
:root:not([data-theme]) .theme-toggle-icon .moon-icon {
  display: none;
}

.study-title {
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--primary-glow);
}

.progress-bar-container {
  height: 6px;
  background: var(--item-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Glassmorphic Card Slider */
.card-slider {
  position: relative;
  width: 100%;
}

.survey-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: cardEntry 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntry {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-badge {
  background: var(--primary-glow);
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--primary-glow);
  flex-shrink: 0;
}

.icon-badge svg {
  width: 24px;
  height: 24px;
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.2);
}

.section-title {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.question-badge {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-glow);
  border: 1px solid var(--primary-glow);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.question-text {
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.4;
  margin-top: 4px;
  color: var(--text-main);
}

/* Common Typography & Rich Text */
.rich-text {
  font-size: 1.0rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.rich-text p {
  margin-bottom: 16px;
}

.rich-text strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Buttons System */
.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn-icon:hover:not(:disabled) svg {
  transform: translateX(4px);
}

/* Options Grid / Custom Radios */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.option-card {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition-fast);
}

.option-card:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  transform: translateX(4px);
}

.option-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.option-left-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.option-badges-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge-item {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}

.badge-item.badge-user {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--primary-glow);
}

.badge-item.badge-ai {
  background: var(--ai-purple-glow);
  color: var(--ai-purple);
  border: 1px solid var(--ai-purple-glow);
}

.badge-item.badge-final {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.option-card.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.option-card.initial-selected {
  border-color: var(--item-border);
  background: var(--item-bg);
  opacity: 0.9;
}

.option-card.ai-recommended {
  border-color: var(--item-border);
  background: var(--item-bg);
}

.option-card.selected-final {
  background: var(--primary-glow) !important;
  border: 2px solid var(--primary) !important;
  opacity: 1 !important;
  box-shadow: 0 0 18px var(--primary-glow) !important;
}

.option-radio-visual {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.option-card:hover .option-radio-visual {
  border-color: var(--text-muted);
}

.option-card.selected .option-radio-visual {
  border-color: var(--primary) !important;
}



.option-card.selected-final .option-radio-visual {
  border-color: var(--primary) !important;
}

.option-radio-visual::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}



.option-card.selected-final .option-radio-visual::after {
  background: var(--primary) !important;
  transform: scale(1) !important;
}

.option-card.selected .option-radio-visual::after {
  transform: scale(1);
}

.option-label-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
}

/* Certainty Selector (Pills) */
.certainty-selector {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.certainty-pill {
  flex: 1;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  padding: 12px 6px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.certainty-pill:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  color: var(--text-main);
}

.certainty-pill.selected {
  background: var(--item-selected-bg);
  border-color: var(--primary);
  color: var(--item-selected-color);
  box-shadow: 0 0 15px var(--primary-glow);
}

.certainty-pill.initial-selected {
  border-color: var(--text-dim);
  opacity: 0.75;
}

.certainty-pill.selected-final {
  background: var(--item-selected-bg) !important;
  border-color: var(--primary) !important;
  color: var(--item-selected-color) !important;
  opacity: 1 !important;
  box-shadow: 0 0 15px var(--primary-glow) !important;
}

.certainty-pill .num {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-header);
}

.certainty-pill .label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Form Groups & Inputs helper */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-medium { margin-top: 16px; }
.mt-large { margin-top: 28px; }

.input-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.input-control {
  font-family: var(--font-sans);
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-main);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: var(--transition-fast);
}

.input-control:focus {
  background: var(--item-hover-bg);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

select.input-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c96a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
  padding-right: 48px;
}

.text-area {
  min-height: 100px;
  resize: vertical;
}

.demographic-subtext {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Stage / Phase Indicator Tracker */
.stage-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.stage-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-indicator.stage-final {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.stage-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--item-hover-bg);
  color: var(--text-muted);
  border: 1px solid var(--item-border);
  white-space: nowrap;
}

.stage-badge.stage-badge-final {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

.stage-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 6px var(--primary-glow);
  white-space: nowrap;
}

.stage-label {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Question Section tight spacing */
#question-section {
  gap: 14px;
}

#question-section .card-header {
  margin: 0;
  padding: 0;
}

#question-section .card-content {
  margin: 0;
  padding: 0;
}

/* AI Suggestion Card Design */
.ai-card {
  background: var(--card-bg);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 2px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  animation: aiCardReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes aiCardReveal {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-card-glow {
  display: none;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-logo {
  background: var(--ai-purple-glow);
  color: var(--primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--primary);
  flex-shrink: 0;
}

.ai-logo svg {
  width: 15px;
  height: 15px;
  animation: spinSlow 8s linear infinite;
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-header-text {
  display: flex;
  flex-direction: column;
}

.ai-badge {
  font-family: var(--font-header);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.ai-status {
  font-size: 0.65rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.ai-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-suggestion-box, .ai-confidence-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ai-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.ai-confidence-meter-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-confidence-value {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ai-purple);
  width: 55px;
  flex-shrink: 0;
}

.ai-confidence-track {
  height: 6px;
  background: var(--item-border);
  border-radius: 3px;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.ai-confidence-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--primary-glow);
  transition: width 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}



.ai-prompt-callout {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--primary-glow);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.5;
  align-items: flex-start;
}

.ai-prompt-callout svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Completion Outro Screen */
.success-ring {
  background: var(--accent-glow);
  color: var(--accent);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid rgba(16, 185, 129, 0.3);
  margin: 0 auto;
  flex-shrink: 0;
}

.checkmark-icon {
  width: 38px;
  height: 38px;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheckmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.2s;
}

@keyframes drawCheckmark {
  100% { stroke-dashoffset: 0; }
}

.centered-header {
  flex-direction: column;
  gap: 18px;
}

.text-center { text-align: center; }

.outro-text {
  font-size: 1.15rem;
  color: var(--text-main);
  line-height: 1.5;
}

.outro-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Card Actions aligner */
.card-actions {
  display: flex;
  justify-content: flex-end;
}




/* ---------------------------------------------------- */
/* St. Gallen Questionnaire Layout & Custom Styling     */
/* ---------------------------------------------------- */

.options-grid.cols-2 {
  grid-template-columns: 1fr;
}

.options-grid.cols-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 580px) {
  .options-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .options-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Custom Radio Card Indicator Styling */
.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-card {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.radio-card::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  background: transparent;
  display: inline-block;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.radio-card:hover::before {
  border-color: var(--text-muted);
}

.radio-card:has(input[type="radio"]:checked)::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px var(--bg-main);
}

.radio-card:has(input[type="radio"]:checked) {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Inline text input for Other cards */
.other-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.inline-text {
  flex-grow: 1;
  min-width: 120px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  height: 36px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
}

.inline-text:focus {
  border-color: var(--primary);
  background: var(--item-hover-bg);
}

.inline-text:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--item-border);
}

/* Likert Scale Layout */
.likert-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-top: 8px;
}

@media (min-width: 580px) {
  .likert-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}


.likert-label-edge {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 120px;
  line-height: 1.3;
}

.likert-label-edge:first-of-type {
  text-align: left;
}

.likert-label-edge:last-of-type {
  text-align: right;
}

.likert-options {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-grow: 1;
}

.likert-pill {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.likert-pill:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  color: var(--text-main);
  transform: translateY(-2px);
}

.likert-pill.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: scale(1.1);
}

.form-section-title {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--card-divider);
  padding-bottom: 8px;
  margin-top: 24px;
  margin-bottom: -4px;
  letter-spacing: -0.01em;
}

.font-small {
  font-size: 0.88rem;
}

/* ---------------------------------------------------- */
/* Intro Section Layout & Custom Styling                */
/* ---------------------------------------------------- */

.intro-welcome {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro-lead {
  font-size: 1.0rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.institution-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -8px;
  margin-bottom: 8px;
}

.inst-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.inst-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
  box-shadow: 0 0 8px var(--primary-glow);
}

.inst-badge.support {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--text-muted);
}

.inst-badge.support .inst-dot {
  background-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.inst-badge:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  color: var(--text-main);
  transform: translateY(-1px);
}

.intro-section-subtitle {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-top: 8px;
  margin-bottom: 2px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--primary);
}

/* Expect Cards Grid */
.expect-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.expect-card {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: var(--transition);
}

.expect-card:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.expect-card.highlight {
  background: var(--item-bg);
  border-color: var(--primary-glow);
}

.expect-card.highlight:hover {
  background: var(--item-hover-bg);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.expect-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--item-hover-bg);
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--item-border);
}

.expect-card.highlight .expect-card-icon {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary-glow);
}

.expect-card-icon svg {
  width: 20px;
  height: 20px;
}

.expect-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expect-card-content h4 {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.expect-card-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.expect-card-content strong {
  color: var(--text-main);
}

/* Callout Box styling */
.intro-action-callout {
  background: rgba(16, 185, 129, 0.02);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 8px;
}

.callout-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-icon svg {
  width: 20px;
  height: 20px;
}

.callout-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Study Terms & Agreement Box Styling */
.study-agreement-box,
.gdpr-consent-box {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  padding: 22px 24px;
  border-radius: var(--radius-md);
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.study-agreement-box.highlight-required {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.agreement-actions {
  display: flex;
  width: 100%;
}

.agreement-actions .btn {
  width: 100%;
  justify-content: center;
}

.study-agreement-label,
.gdpr-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  position: relative;
  width: 100%;
}

.study-agreement-label input[type="checkbox"],
.gdpr-checkbox-label input[type="checkbox"] {
  position: absolute;
  top: 2px;
  left: 0;
  width: 20px;
  height: 20px;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--text-dim);
  background: transparent;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition-fast);
  margin-top: 2px;
  pointer-events: none; /* Allows click to pass reliably to the input / label */
}

.study-agreement-label:hover .checkbox-custom,
.gdpr-checkbox-label:hover .checkbox-custom {
  border-color: var(--text-muted);
}

.study-agreement-label input[type="checkbox"]:focus-visible ~ .checkbox-custom,
.gdpr-checkbox-label input[type="checkbox"]:focus-visible ~ .checkbox-custom {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.study-agreement-label input[type="checkbox"]:checked ~ .checkbox-custom,
.gdpr-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
  border-color: var(--primary);
  background: var(--primary);
}

.study-agreement-label input[type="checkbox"]:checked ~ .checkbox-custom::after,
.gdpr-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.agreement-text,
.consent-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.agreement-text a,
.consent-text a {
  color: var(--primary);
  text-decoration: underline;
  transition: var(--transition-fast);
  position: relative;
  z-index: 3;
}

.agreement-text a:hover,
.consent-text a:hover {
  color: var(--primary-hover);
}

/* GDPR Details Collapsible */
.gdpr-details {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  margin-top: 8px;
}

.gdpr-details-summary {
  padding: 14px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none; /* Hide default arrow */
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.gdpr-details-summary::-webkit-details-marker {
  display: none; /* Hide Safari default arrow */
}

.gdpr-details-summary::after {
  content: '+';
  font-size: 1.1rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.gdpr-details[open] .gdpr-details-summary {
  color: var(--text-main);
  border-bottom: 1px solid var(--card-divider);
}

.gdpr-details[open] .gdpr-details-summary::after {
  content: '−';
  transform: rotate(180deg);
}

.gdpr-details-summary:hover {
  color: var(--text-main);
  background: var(--item-hover-bg);
}

.gdpr-details-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gdpr-details-content h4 {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.gdpr-details-content p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.gdpr-details-content strong {
  color: var(--text-main);
}

/* Footer Styling */
.survey-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.survey-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition-fast);
}

.survey-footer a:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-divider {
  color: var(--card-divider);
}

/* Modal Styling (Glassmorphism Modal Overlays) */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 640px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 80vh;
}

.modal-close {
  color: var(--text-muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 24px;
  transition: var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-content h3 {
  font-family: var(--font-header);
  font-size: 1.35rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--card-divider);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.modal-body-scroll {
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 55vh;
}

/* Custom Scrollbar for Modal Scroll Body */
.modal-body-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-track {
  background: var(--item-bg);
  border-radius: 3px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
  background: var(--item-hover-border);
  border-radius: 3px;
}

.modal-body-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
  border-radius: 3px;
}

.modal-body-scroll h4 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 12px;
  margin-bottom: -4px;
}

.modal-body-scroll p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.modal-body-scroll strong {
  color: var(--text-main);
}

.modal-body-scroll ul,
.modal-body-scroll ol {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  padding-left: 20px;
}

.modal-body-scroll li {
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 2px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.modal-section-header {
  font-family: var(--font-header);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 20px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--card-divider);
  padding-bottom: 4px;
}

.legal-link {
  color: var(--primary);
  text-decoration: none;
}

.legal-link:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes modalSlide {
  0% { transform: translateY(15px) scale(0.97); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Custom Form Validation Error Styles */
.form-group.has-error {
  border-left: 3px solid var(--error) !important;
  padding-left: 16px !important;
  margin-left: -19px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group.has-error .input-label {
  color: var(--error) !important;
}

.form-group.has-error .input-control {
  border-color: var(--error) !important;
  background: rgba(239, 68, 68, 0.02) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-group.has-error .option-card,
.form-group.has-error .certainty-pill,
.form-group.has-error .likert-pill {
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.form-group.has-error .option-card:hover,
.form-group.has-error .certainty-pill:hover,
.form-group.has-error .likert-pill:hover {
  border-color: var(--error) !important;
}

/* Disable interactions for initial selections in stage 2 */
.disabled-interaction {
  pointer-events: none !important;
  user-select: none !important;
}

/* Survey Introduction Glossary styling */
.intro-glossary {
  margin-top: 24px;
  padding: 16px;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: var(--radius-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
}

.intro-glossary:hover {
  background: var(--item-hover-bg);
  border-color: var(--item-hover-border);
}

.intro-glossary-header {
  margin: 0;
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.intro-glossary-header svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
  flex-shrink: 0;
}

.intro-glossary-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.intro-glossary-item {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.intro-glossary-term {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
}

.intro-glossary-ref {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.intro-glossary a,
.intro-glossary-ref a {
  color: var(--text-dim);
  text-decoration: underline;
  word-break: break-all;
  transition: color var(--transition-fast);
}

.intro-glossary a:hover,
.intro-glossary-ref a:hover {
  color: var(--text-main);
}

.intro-highlight-term {
  color: var(--primary);
  font-weight: 600;
}

/* Post-study Slider custom styling */
.slider-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-top: 8px;
  width: 100%;
}

.slider-track-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.slider-input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  background: var(--slider-track);
  border-radius: var(--radius-sm);
  outline: none;
  transition: background 0.3s ease;
  margin: 7px 0;
}

.slider-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: var(--slider-track);
  border-radius: var(--radius-sm);
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
  margin-top: -7px;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  background: var(--primary-hover);
  transform: scale(1.15);
}

.slider-input::-moz-range-track {
  width: 100%;
  height: 6px;
  background: var(--slider-track);
  border-radius: var(--radius-sm);
}

.slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.slider-input::-moz-range-thumb:hover {
  background: var(--primary-hover);
  transform: scale(1.15);
}

.slider-value-display {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
  align-self: center;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0 2px;
  margin-top: 6px;
}

/* Guidance Notice Callout (Adblocker-Resilient) */
.clinical-guidance-callout,
.no-aids-banner,
.intro-notice-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--item-bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 20px;
}

[data-theme="light"] .clinical-guidance-callout,
[data-theme="light"] .no-aids-banner,
[data-theme="light"] .intro-notice-box {
  background: var(--item-bg);
  border-color: var(--primary);
}

.clinical-guidance-callout svg,
.no-aids-banner svg,
.intro-notice-box svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--primary);
}

/* Copy Prevention Styling */
.survey-card,
.question-text,
.option-label-text,
.intro-text,
.ai-suggestion-box,
.ai-confidence-box {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Allow text editing inside form inputs */
input, textarea, select {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* ==================================================== */
/* Unified Mobile Responsive Adjustments (Max 580px)   */
/* ==================================================== */
@media(max-width: 580px) {
  body {
    padding: 10px 8px;
  }

  .app-container {
    gap: 10px;
  }

  /* Header compacting */
  .survey-header {
    gap: 8px;
  }

  .brand-area {
    gap: 8px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-logo svg {
    width: 14px;
    height: 14px;
  }

  .study-title {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .theme-toggle-btn {
    width: 30px;
    height: 30px;
  }
  
  .theme-toggle-btn svg {
    width: 14px;
    height: 14px;
  }

  .progress-container {
    gap: 6px;
  }

  .progress-bar-container {
    height: 4px;
  }

  .progress-text {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  /* Survey Card compacting */
  .survey-card {
    padding: 14px 12px;
    gap: 12px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  /* Stage / Phase Indicator */
  .stage-indicator {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
  }
  
  .stage-left {
    width: 100%;
    gap: 6px;
  }

  .stage-badge {
    font-size: 0.68rem;
    padding: 2px 8px;
  }

  .stage-badge-pill {
    align-self: flex-start;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 6px;
  }

  .stage-label {
    font-size: 0.80rem;
  }

  /* Question Section */
  #question-section {
    gap: 10px;
  }

  .question-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .question-text {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-top: 2px;
  }

  /* AI Assistant Box */
  .ai-card {
    padding: 8px 10px;
    margin-top: 0;
    margin-bottom: 6px;
    gap: 6px;
    border-radius: var(--radius-sm);
  }

  .ai-header {
    gap: 6px;
  }

  .ai-logo {
    width: 20px;
    height: 20px;
  }

  .ai-logo svg {
    width: 11px;
    height: 11px;
  }

  .ai-badge {
    font-size: 0.76rem;
    line-height: 1.1;
  }

  .ai-status {
    font-size: 0.58rem;
    gap: 4px;
  }

  .pulse-dot {
    width: 4px;
    height: 4px;
  }

  .ai-body {
    gap: 5px;
  }

  .ai-suggestion-box,
  .ai-confidence-box {
    gap: 2px;
  }

  .ai-label {
    font-size: 0.68rem;
  }

  .ai-value {
    font-size: 0.90rem;
  }

  .ai-confidence-meter-container {
    gap: 8px;
  }

  .ai-confidence-value {
    font-size: 0.92rem;
    width: 42px;
  }

  .ai-confidence-track {
    height: 4px;
  }

  /* Form & Option Grid */
  .options-grid {
    gap: 6px;
    margin-top: 6px;
  }

  .option-card {
    padding: 8px 12px;
    min-height: 42px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .option-left-content {
    gap: 8px;
  }

  .option-radio-visual {
    width: 16px;
    height: 16px;
    border-width: 1.5px;
  }

  .option-radio-visual::after {
    width: 8px;
    height: 8px;
  }

  .option-label-text {
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .badge-item {
    font-size: 0.58rem;
    padding: 2px 5px;
  }

  /* Utility Spacing */
  .mt-medium {
    margin-top: 8px;
  }

  .mt-large {
    margin-top: 10px;
  }

  .form-group {
    gap: 4px;
  }

  .input-label {
    font-size: 0.80rem;
    margin-bottom: 2px;
  }

  /* Certainty Selector */
  .certainty-selector {
    gap: 4px;
    margin-top: 4px;
  }
  
  .certainty-pill {
    padding: 6px 2px;
    border-radius: var(--radius-sm);
  }
  
  .certainty-pill .num {
    font-size: 0.92rem;
  }
  
  .certainty-pill .label {
    font-size: 0.48rem;
    word-break: break-word;
    hyphens: auto;
    letter-spacing: -0.02em;
    line-height: 1.05;
  }

  /* Buttons & Action Containers */
  .card-actions,
  .agreement-actions {
    justify-content: stretch;
  }
  
  .card-actions .btn,
  .agreement-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    gap: 6px;
  }

  /* Introduction Screen Elements & Typography Consistency */
  .section-title {
    font-size: 1.18rem;
  }

  .rich-text {
    font-size: 0.90rem;
    line-height: 1.45;
  }

  .rich-text p {
    margin-bottom: 8px;
    font-size: 0.90rem;
  }

  .intro-lead {
    font-size: 0.90rem;
    line-height: 1.45;
  }

  .intro-notice-box {
    padding: 8px 10px;
    gap: 8px;
    font-size: 0.84rem;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .intro-notice-box svg {
    width: 16px;
    height: 16px;
  }

  .intro-glossary {
    margin-top: 10px;
    padding: 10px;
    gap: 6px;
    border-radius: var(--radius-sm);
  }

  .intro-glossary-header {
    font-size: 0.92rem;
    gap: 6px;
  }

  .intro-glossary-header svg {
    width: 15px;
    height: 15px;
  }

  .intro-glossary-body {
    font-size: 0.84rem;
    line-height: 1.4;
    gap: 6px;
  }

  .intro-glossary-item {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .intro-glossary-term {
    font-size: 0.84rem;
  }

  .intro-glossary-ref {
    font-size: 0.74rem;
    line-height: 1.35;
    margin-top: 2px;
  }

  .expect-cards {
    gap: 6px;
  }

  .expect-card {
    padding: 9px 10px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .expect-card-icon {
    width: 28px;
    height: 28px;
  }

  .expect-card-icon svg {
    width: 14px;
    height: 14px;
  }

  .expect-card-content {
    gap: 2px;
  }

  .expect-card-content h4 {
    font-size: 0.88rem;
  }

  .expect-card-content p {
    font-size: 0.80rem;
    line-height: 1.3;
  }

  .intro-action-callout {
    padding: 8px 10px;
    gap: 8px;
    margin-top: 6px;
  }

  .callout-icon svg {
    width: 16px;
    height: 16px;
  }

  .callout-text {
    font-size: 0.80rem;
    line-height: 1.35;
  }

  .study-agreement-box {
    padding: 10px 12px;
    gap: 8px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
  }

  .agreement-text {
    font-size: 0.80rem;
    line-height: 1.32;
  }

  /* Demographics & Inputs */
  .demographic-subtext {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .input-control {
    padding: 9px 10px;
    font-size: 0.86rem;
    border-radius: var(--radius-sm);
  }

  /* Likert Scale on Mobile */
  .likert-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px;
    gap: 6px 10px;
    border-radius: var(--radius-sm);
  }

  .likert-label-edge {
    max-width: none !important;
    font-size: 0.70rem;
    line-height: 1.2;
  }

  .likert-label-edge:first-of-type {
    grid-row: 1;
    grid-column: 1;
    text-align: left !important;
    justify-self: start;
  }

  .likert-label-edge:last-of-type {
    grid-row: 1;
    grid-column: 2;
    text-align: right !important;
    justify-self: end;
  }

  .likert-options {
    grid-row: 2;
    grid-column: 1 / span 2;
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
  }

  .likert-pill {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
  }

  /* Post-questionnaire Sliders */
  .slider-row {
    gap: 10px;
    margin-top: 4px;
  }

  .slider-value-display {
    font-size: 1.05rem;
    min-width: 44px;
  }

  .slider-labels {
    font-size: 0.68rem;
    margin-top: 3px;
  }

  /* Completion screen */
  .success-ring {
    width: 52px;
    height: 52px;
  }

  .checkmark-icon {
    width: 28px;
    height: 28px;
  }

  .outro-text {
    font-size: 1.02rem;
  }

  .outro-subtext {
    font-size: 0.82rem;
    margin-top: 4px;
  }

  /* Footer */
  .survey-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    margin-top: 10px;
    padding: 4px 0;
    font-size: 0.75rem;
  }
  
  .footer-divider {
    display: none;
  }

  /* Modals */
  .modal-content {
    padding: 16px;
    width: 95%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    gap: 12px;
  }

  .modal-close {
    top: 10px;
    right: 14px;
    font-size: 22px;
  }

  .modal-content h3 {
    font-size: 1.05rem;
    padding-bottom: 6px;
    padding-right: 20px;
  }

  .modal-body-scroll {
    max-height: 60vh;
    gap: 10px;
  }

  .modal-body-scroll p,
  .modal-body-scroll ul,
  .modal-body-scroll ol {
    font-size: 0.82rem;
    line-height: 1.45;
  }
}

/* Extra small devices (like older iPhone SE, 320px-375px) */
@media(max-width: 375px) {
  body {
    padding: 6px 4px;
  }

  .survey-card {
    padding: 10px 8px;
    gap: 8px;
  }

  .question-text {
    font-size: 0.96rem;
    line-height: 1.3;
  }

  .option-card {
    padding: 7px 8px;
    gap: 6px;
  }

  .certainty-pill .label {
    display: none;
  }

  .certainty-pill {
    padding: 6px 2px;
  }

  .certainty-pill .num {
    font-size: 0.95rem;
  }

  .card-actions .btn,
  .agreement-actions .btn {
    padding: 9px 10px;
    font-size: 0.82rem;
  }
}
