@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */

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

:root {
  color-scheme: light only;

  /* Core palette */
  --salmon: #8caef4;
  --salmon-light: #c5d6f8;
  --salmon-dark: #467ded;
  --sand: #e1e9f4;
  --sand-light: #f1f4f8;
  --sand-dark: #adbcd2;
  --terracotta: #111162;
  --terracotta-dark: #07072f;
  --brown: #08091e;
  --cream: #fafbfc;
  --input-fill: #ffffff;
  --text: #1d1d30;
  --text-light: #3c3c5d;
  --text-muted: #7a7a96;
  --teal: #d27b4b;
  --teal-dark: #c15f29;

  /* Background void gradient (separate from card surface) */
  --void-1: #e2ecf2;
  --void-2: #d1e2ed;
  --void-3: #eff4f8;

  /* Status: Error */
  --error: #d64545;
  --error-light: #fee;

  /* Status: Success */
  --success: #2d8a4e;
  --success-light: #e8f5e9;
  --success-medium: #c8e6c9;
  --success-dark: #1b5e20;

  /* Status: Warning (amber) */
  --warning: #f59e0b;
  --warning-light: #fff8e1;
  --warning-medium: #ffecb3;
  --warning-dark: #92400e;

  /* Status: Danger (red) */
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-medium: #fecaca;
  --danger-dark: #b91c1c;
  --danger-darker: #991b1b;

  /* Status: Info (blue) */
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --info-medium: #bae6fd;
  --info-dark: #0369a1;

  /* RGB components for rgba() opacity variants */
  --brown-rgb: 8, 9, 30;
  --terracotta-rgb: 17, 17, 98;
  --salmon-rgb: 140, 174, 244;
  --sand-rgb: 225, 233, 244;
  --cream-rgb: 250, 251, 252;
  --text-rgb: 29, 29, 48;
  --muted-rgb: 141, 154, 180;
  --text-muted-rgb: 122, 122, 150;
  --void-1-rgb: 226, 236, 242;
  --void-2-rgb: 209, 226, 237;
  --warning-rgb: 245, 158, 11;
  --danger-rgb: 220, 38, 38;
  --success-rgb: 45, 138, 78;

  /* Negative outline - outer stroke using fill color (main containers only) */
  --outline-width: 6px;

  /* Sidebar layout dimensions */
  --sidebar-padding-top: 40px;
  --sidebar-h2-height: 48px; /* Fixed height - "Monitoring Cultureel" on 2 lines */
  --divider-margin: 12px;
  --divider-height: 1px;
  --progress-bar-height: 8px;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--void-1) 0%, var(--void-2) 50%, var(--void-3) 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
  transition: background 0.5s ease;
}

/* ==========================================================================
   SPA View Transitions
   ========================================================================== */

.view {
  opacity: 0;
  transition: opacity 0.3s linear;
}

.view-active {
  opacity: 1;
}

.view-fade-out {
  opacity: 0;
}

/* Container Transform Animation - survey card expands from button */
.container-transform-active {
  will-change: clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 40px;
  position: relative;
}

.login-card {
  position: relative;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  user-select: none;
  -webkit-user-select: none;
  /* No overflow:hidden - header needs explicit border-radius */
}

/* Compound shape: unified background + outer stroke as single pseudo-element */
.login-card::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--outline-width));
  left: calc(-1 * var(--outline-width));
  right: calc(-1 * var(--outline-width));
  bottom: calc(-1 * var(--outline-width));
  background: var(--cream);
  border-radius: calc(16px + var(--outline-width));
  box-shadow:
    0 8px 32px rgba(var(--brown-rgb), 0.15),
    0 2px 8px rgba(var(--brown-rgb), 0.1);
  mix-blend-mode: screen;
  z-index: -1;
}

.login-header {
  background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
  padding: 40px 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.87);
  border-radius: 16px 16px 0 0;
}

.logo-icon {
  width: 56px;
  height: 64px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.logo-icon svg {
  width: auto;
  height: 38px;
  opacity: 0.87;
}

.login-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.87);
}

.year-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.login-body {
  padding: 32px;
}

.login-intro {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.login-body .field {
  text-align: center;
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

.login-footer a {
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

.contact-email {
  color: var(--terracotta);
  font-weight: 500;
  user-select: all;
  cursor: default;
}

/* Demo Mode Styles */
.demo-banner {
  background: linear-gradient(135deg, var(--info-light) 0%, var(--info-medium) 100%);
  border: 1px solid var(--info);
  color: var(--info-dark);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.public-access {
  margin-top: 16px;
  text-align: center;
}

.preview-link {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.7;
  transition: all 0.2s;
}

.preview-link:hover {
  opacity: 1;
  color: var(--terracotta);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--sand-dark);
}

.divider span {
  padding: 0 12px;
}

.login-info {
  max-width: 360px;
  color: var(--text);
}

.login-info h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.login-info p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.login-info ul {
  list-style: none;
  margin-bottom: 20px;
}

.login-info li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-light);
}

.login-info li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--terracotta);
  font-weight: bold;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

/* Dark terracotta highlight for specific label words */
.label-highlight {
  color: var(--terracotta-dark);
  font-weight: 600;
}

/* Extra spacing after field group (visual paragraph break) */
.field-group-end {
  margin-bottom: 32px;
}

.field-indent {
  padding-left: 24px;
}

/* Vertical divider for sub-questions within question groups */
.question-group .field-indent {
  margin-left: 8px;
  padding-left: 20px;
  border-left: 1px solid var(--sand);
  position: relative;
}

/* Remove gap between consecutive indented fields for continuous line */
.question-group .field-indent {
  margin-bottom: 0;
}

.question-group .field-indent + .field-indent {
  padding-top: 8px;
}

/* First indented field gets top padding for visual breathing room */
.question-group .field:not(.field-indent) + .field-indent {
  margin-top: 8px;
  padding-top: 12px;
}

/* Last indented field in group gets bottom padding */
.question-group .field-indent:last-child {
  padding-bottom: 4px;
  margin-bottom: 24px;
}

/* Info block for definitions and explanatory text */
.info-block {
  background: var(--sand-light);
  border-left: 3px solid var(--terracotta);
  padding: 16px 20px;
  margin: 8px 0 24px 0;
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-light);
}

.info-block p {
  margin: 0 0 8px 0;
}

.info-block p:last-child {
  margin-bottom: 0;
}

.info-block-list {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.info-block-list li {
  margin-bottom: 4px;
}

/* Step intro text */
.step-intro {
  margin: -4px 0 20px 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--input-fill);
  color: var(--text);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.field input:not(:placeholder-shown),
.field textarea:not(:placeholder-shown),
.field select:not([value=""]) {
  opacity: 1;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(var(--salmon-rgb), 0.25);
  opacity: 1;
}

.field input.error,
.field textarea.error {
  border-color: var(--error);
}

.field-validation {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
  animation: validation-fade-in 0.2s ease;
}

@keyframes validation-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Split code input (e.g. ABC — DEF) */
.code-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.code-input-group .code-input {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  padding: 10px 8px;
}

.code-input-group .code-input::placeholder {
  letter-spacing: 5px;
  font-weight: 400;
  color: var(--sand-dark);
}

.code-separator {
  font-size: 18px;
  font-weight: 400;
  color: var(--sand-dark);
  user-select: none;
  flex-shrink: 0;
}

/* Visual state when both code fields are selected as a group */
.code-input-group.code-input-selected .code-input {
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(var(--salmon-rgb), 0.25);
  opacity: 1;
}

/* Checkbox label styling */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-light);
  opacity: 0.7;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--terracotta);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.checkbox-label:has(input:checked) {
  opacity: 1;
}

/* Multi-input group for repeated text fields */
.multi-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.multi-input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--input-fill);
  color: var(--text);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.multi-input-group input:not(:placeholder-shown) {
  opacity: 1;
}

.multi-input-group input:focus {
  outline: none;
  border-color: var(--salmon);
  box-shadow: 0 0 0 3px rgba(var(--salmon-rgb), 0.25);
  opacity: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  padding: 12px 36px;
  font-size: 14px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  background: var(--cream);
  border: 2px solid var(--sand-dark);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--sand-light);
  border-color: var(--salmon);
}

.btn-tertiary {
  background: transparent;
  border: 2px solid var(--terracotta);
  color: var(--terracotta);
}

.btn-tertiary:hover {
  background: rgba(var(--terracotta-rgb), 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 12px rgba(var(--terracotta-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--terracotta-rgb), 0.4);
}

.btn-primary:disabled {
  background: var(--sand-dark);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.btn-disabled-top {
  background: var(--sand-dark);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   Error & Success Messages
   ========================================================================== */

.error-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--error-light);
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--error);
}

.error-message svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.success-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--success-light);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--success);
}

/* ==========================================================================
   Retry Progress Indicator
   ========================================================================== */

.retry-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  animation: retryFadeIn 0.3s ease;
}

.retry-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--sand);
  border-radius: 3px;
  overflow: hidden;
}

.retry-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--salmon), var(--terracotta));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.retry-progress-text {
  font-size: 12px;
  color: var(--text-light);
}

@keyframes retryFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Survey Page - Container
   ========================================================================== */

.survey-body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  position: relative;
  border-radius: 12px;
  width: 900px;
  max-width: calc(100vw - 40px);
  min-height: 540px;
  display: flex;
  /* No overflow:hidden - sidebar needs explicit border-radius */
}

/* Alignment rig removed: the divider line was rendering on top of Likert table content */

/* Compound shape: unified background + outer stroke as single pseudo-element */
.container::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--outline-width));
  left: calc(-1 * var(--outline-width));
  right: calc(-1 * var(--outline-width));
  bottom: calc(-1 * var(--outline-width));
  background: var(--cream);
  border-radius: calc(12px + var(--outline-width));
  box-shadow:
    0 8px 32px rgba(var(--brown-rgb), 0.15),
    0 2px 8px rgba(var(--brown-rgb), 0.1);
  z-index: -1;
}

/* ==========================================================================
   Survey Page - Index Sidebar
   ========================================================================== */

.index {
  flex: 0 0 260px;
  padding: var(--sidebar-padding-top) 20px;
  background: linear-gradient(180deg, rgba(var(--salmon-rgb), 0.15) 0%, rgba(var(--sand-rgb), 0.3) 100%);
  display: flex;
  flex-direction: column;
  border-radius: 12px 0 0 12px;
  position: relative; /* For highlighter positioning */
  z-index: 1; /* Above content so question gradients slide under sidebar */
  overflow: visible; /* Allow outcrop to extend left */
  user-select: none;
}

/* Desktop Highlighter - moves behind active item */
.mobile-highlighter {
  position: absolute;
  left: -20px; /* Extend into outcrop area beyond sidebar */
  top: 0;
  right: 8px;
  height: 38px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 19px 8px 8px 19px; /* Fully rounded left, normal right */
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(1);
  transform-origin: right center;
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.6s ease-out,
    box-shadow 0.6s ease-out;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mobile-highlighter.active {
  opacity: 1;
}

/* Highlighter shape for regular items - fully rounded left */
.mobile-highlighter.highlighter-item {
  left: -20px; /* Extend beyond sidebar left edge */
  border-radius: 19px 8px 8px 19px;
}

/* Highlighter shape for section dividers - matches hover element style */
.mobile-highlighter.highlighter-divider {
  left: -20px;
  right: 8px;
  border-radius: 19px 8px 8px 19px;
}

/* Highlighter shape for subsection headers - centered with mild rounded corners */
.mobile-highlighter.highlighter-subsection {
  left: 50%;
  right: auto;
  width: 120px;
  transform: translateX(-50%);
  border-radius: 6px;
  height: 28px !important;
  /* Offset to center on text: border-top (1px) + padding-top (12px) - half padding difference */
  margin-top: 5px;
}

/* Highlighter hover effect - scale up when hovering on active item */
.index:has(.index-item.active:hover) .mobile-highlighter.highlighter-item,
.index:has(.index-divider-clickable.active:hover) .mobile-highlighter:not(.highlighter-item) {
  transform: scale(1.015);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

/* Subsection highlighter hover - needs different transform-origin */
.index:has(.index-divider-sub.active:hover) .mobile-highlighter.highlighter-subsection {
  transform: translateX(-50%) scale(1.015);
  transform-origin: center center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition:
    top 0.35s ease-in-out,
    height 0.35s ease-in-out,
    left 0.35s ease-in-out,
    border-radius 0.35s ease-in-out,
    opacity 0.2s ease,
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.index h2 {
  font-size: 16px;
  font-weight: 600;
  height: var(--sidebar-h2-height);
  color: var(--text);
  opacity: 0.55;
  margin-bottom: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.index-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  z-index: 1; /* Above highlighter */
  -webkit-tap-highlight-color: transparent;
}

.index-item:hover {
  background: rgba(255, 255, 255, 0.3);
}

.index-item.active {
  background: transparent; /* Highlighter handles this */
}

.index-item .status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
  transition:
    transform 0.6s ease-out,
    background 0.3s ease-out;
}

/* Push status icon into outcrop when active + enlarge + teal */
.index-item.active .status {
  transform: translateX(-42px) scale(1.15);
  background: var(--teal);
}

/* Scale up icon further on hover - shift left to follow highlighter expansion */
.index-item.active:hover .status {
  transition: transform 0.15s ease-out;
  transform: translateX(-46px) scale(1.18);
}

/* Completed but not active - darker terracotta */
.index-item.complete .status {
  background: var(--terracotta);
}

/* Active AND complete - more saturated teal to show prominence */
.index-item.active.complete .status {
  background: var(--teal-dark);
}

.index-item.partial .status {
  background: var(--salmon);
}

/* Active AND partial - teal */
.index-item.active.partial .status {
  background: var(--teal);
}

.index-item.conditional-incomplete .status {
  background: var(--salmon);
}

.index-item .label {
  font-size: 13px;
  color: var(--text);
  transition: transform 0.6s ease-out;
}

/* Gentle nudge on hover for non-active items */
.index-item:not(.active):not(.passing):hover .label {
  transform: translateX(3px);
  transition: transform 0.15s ease-out;
}

.index-item.active .label {
  font-weight: 600;
  transform: translateX(-32px) scale(1.1);
}

/* Scale up label further on hover - shift left to follow highlighter expansion */
.index-item.active:hover .label {
  transform: translateX(-36px) scale(1.12);
  transition: transform 0.15s ease-out;
}

/* Passing state - triggered briefly as highlighter travels over item */
.index-item.passing .status {
  transform: translateX(-12px) scale(1.05);
  transition: transform 0.06s ease-out;
}

.index-item.passing .label {
  transform: translateX(-8px) scale(1.02);
  transition: transform 0.06s ease-out;
}

/* Extend hit areas to fill gaps between sidebar items (seamless hover/click) */
.index-item::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
}

.index-divider-sub.index-divider-clickable::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

/* Index dividers for grouping navigation items */
.index-divider {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 12px 6px;
  margin-top: 8px;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  border-top: 1px solid rgba(var(--muted-rgb), 0.3);
}

/* Clickable divider that navigates to a step */
.index-divider-clickable {
  cursor: pointer;
  transition: all 0.35s ease-in-out;
  border-radius: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding: 12px 20px;
  position: relative;
  z-index: 1; /* Above highlighter */
}

.index-divider-clickable:hover {
  background: rgba(255, 255, 255, 0.3);
  color: var(--terracotta);
}

.index-divider-clickable.active {
  background: transparent; /* Highlighter handles this */
  color: var(--terracotta);
}

/* Full-width divider line */
.index-divider-full {
  height: var(--divider-height);
  background: rgba(var(--muted-rgb), 0.3);
  margin: var(--divider-margin) -20px;
}

/* Subsection divider - 80% width, centered */
.index-divider-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0 6px;
  margin: 8px auto 0;
  width: 80%;
  border-top: 1px solid rgba(var(--muted-rgb), 0.3);
  text-align: center;
}

.index-divider-sub.index-divider-clickable {
  cursor: pointer;
  transition: all 0.35s ease-in-out;
  position: relative;
  z-index: 1;
}

.index-divider-sub.index-divider-clickable:hover {
  color: var(--terracotta);
}

.index-divider-sub.index-divider-clickable.active {
  color: var(--terracotta);
}

/* Scale up subsection text on hover when active */
.index-divider-sub.index-divider-clickable.active:hover {
  transform: scale(1.03);
}

.org-info {
  margin-top: 12px;
  padding-top: 12px;
}

.org-info .org-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.org-info .org-code {
  font-size: 11px;
  color: var(--text-light);
}

.sidebar-privacy-link {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-light);
  text-decoration: underline;
  cursor: pointer;
}

.sidebar-privacy-link:hover {
  color: var(--terracotta);
}

.back-to-login-banner {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 0;
  padding: 0 16px;
}

.back-to-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--terracotta);
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid var(--salmon-light);
  border-radius: 10px;
  background: var(--cream);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.back-to-login-link:hover {
  background: var(--sand);
  border-color: var(--terracotta);
  color: var(--salmon-dark);
  text-decoration: none;
}

/* ==========================================================================
   Survey Page - Content Area
   ========================================================================== */

.content {
  flex: 1;
  min-width: 0;
  padding: 20px 60px 20px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Progress dots at very top of content */
.progress-dots-top {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.content-header {
  flex-shrink: 0;
  margin-bottom: 32px;
  padding-bottom: 20px;
  user-select: none;
}

/* Two-column header layout: Inkijkexemplaar | Nav buttons */
.content-header .header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 40px;
}

/* Small button variant for top nav */
.btn-small {
  padding: 6px 16px;
  font-size: 12px;
  height: 32px;
  min-width: 80px;
}

.nav-buttons-top {
  display: flex;
  gap: 8px;
}

.content-scrollable {
  position: relative;
  /* Much taller max-height - allows card to expand significantly */
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: clip; /* Clip but allow positioned elements to paint outside */
  scroll-behavior: smooth;
  /* Vertical spacing - top matches mask height, relaxed at bottom */
  padding-top: 12px;
  padding-bottom: 24px;
  padding-right: 40px; /* Space for checkmarks to overflow into */
  /* Extend scroll container so its clip boundary (padding-box) reaches
     the card edges. .content has padding left:20px right:60px.
     Left absorbs 20px to reach sidebar edge (not further).
     Right absorbs 60px + outline-width to cover the card stroke. */
  margin-left: -20px;
  margin-right: calc(-60px - var(--outline-width));
  padding-left: 20px;
  padding-right: calc(100px + var(--outline-width)); /* 40px + 60px content + stroke */
  /* Hide native scrollbar - we use custom one */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

/* Hide WebKit scrollbar */
.content-scrollable::-webkit-scrollbar {
  display: none;
}

/* During step animation, allow content to overflow so slide animation isn't clipped */
.content-scrollable.animating {
  overflow: visible;
}

/* Custom scrollbar - completely decoupled, position anywhere */
.custom-scrollbar {
  position: absolute;
  top: 80px; /* Below header area */
  right: -40px; /* Positioned well outside the content area */
  bottom: 80px; /* Above footer area */
  width: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

/* Show scrollbar when content is scrollable */
.content-scrollable-wrapper:hover .custom-scrollbar,
.content-scrollable-wrapper.scrolling .custom-scrollbar {
  opacity: 1;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 30px;
  background: var(--salmon);
  border-radius: 2px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease;
}

.custom-scrollbar-thumb:hover {
  background: var(--terracotta);
}

/* Gradient fade mask container */
.content-scrollable-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* Gradient fade masks — fade content at top/bottom scroll edges */
.content-scrollable-wrapper::before,
.content-scrollable-wrapper::after {
  content: '';
  position: absolute;
  left: 0;
  right: 40px; /* Don't cover scrollbar */
  height: 32px;
  pointer-events: none;
  z-index: 2;
}

.content-scrollable-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, var(--cream) 0%, transparent 100%);
  opacity: 0; /* Start hidden until user scrolls */
  transition: opacity 0.3s ease;
}

.content-scrollable-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, var(--cream) 0%, transparent 100%);
  opacity: 0; /* Start hidden until user scrolls */
  transition: opacity 0.3s ease;
}

/* Show gradients once user has scrolled */
.content-scrollable-wrapper.has-scrolled::before,
.content-scrollable-wrapper.has-scrolled::after {
  opacity: 1;
}

/* Hide gradients when at scroll limits */
.content-scrollable-wrapper.has-scrolled.at-top::before {
  opacity: 0;
}

.content-scrollable-wrapper.has-scrolled.at-bottom::after {
  opacity: 0;
}

.content-footer {
  flex-shrink: 0;
  margin-top: 24px;
  padding-top: 20px;
  user-select: none;
}

/* Two-column footer layout: Inkijkexemplaar | Nav buttons */
.content-footer .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

.content-footer .nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Progress dots at very bottom */
.progress-dots-bottom {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

/* Hide inkijkexemplaar when 3 buttons visible (controle shown) */
.content-footer.has-review-btn .preview-info-box-bottom {
  visibility: hidden;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.login-header h1 {
  color: rgba(255, 255, 255, 0.87);
}

.section-num {
  color: var(--terracotta-dark);
}

.subtitle {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.55;
  margin-bottom: 32px;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.welcome-intro {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.info-box {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--sand) 100%);
  border-left: 3px solid var(--terracotta);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text);
  border-radius: 0 8px 8px 0;
}

.info-box-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.info-box-link:hover {
  background: linear-gradient(135deg, var(--sand) 0%, #e8dcc8 100%);
  border-left-color: var(--terracotta-dark, #c55a3a);
  transform: translateX(2px);
}

.info-box-link .info-box-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.info-box-link:hover .info-box-icon {
  opacity: 1;
}

/* Larger info box for intro/informational pages */
.info-box-large {
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
}

.info-box-large p {
  margin-bottom: 12px;
}

.info-box-large p:last-child {
  margin-bottom: 0;
}

/* Answer categories box for qualitative intro */
.answer-categories-box {
  background: white;
  border: 2px solid var(--terracotta);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.answer-categories-box h3 {
  color: var(--terracotta);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.answer-categories-box p {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text);
}

.answer-categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.answer-categories-list li {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--sand) 100%);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 600px) {
  .answer-categories-list {
    grid-template-columns: 1fr;
  }
}

.form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  overflow: visible; /* Allow checkmarks to overflow */
  isolation: isolate; /* Stacking context for question gradient pseudo-elements */
}

.form-section > * {
  min-width: 0;
  max-width: 100%;
}

.form-section::-webkit-scrollbar {
  width: 6px;
}

.form-section::-webkit-scrollbar-track {
  background: var(--sand-light);
  border-radius: 3px;
}

.form-section::-webkit-scrollbar-thumb {
  background: var(--salmon);
  border-radius: 3px;
}

/* ==========================================================================
   Question Group Gradient — "luxaflex" bands
   Subtle white-to-transparent gradient behind each question.
   Extends far left (under sidebar, masked by its z-index) and far right
   (contained by .content overflow-x: clip). Horizontal mask fades edges
   so bands appear to have no beginning or end.
   ========================================================================== */

.form-section > .field:not(.checkbox-field),
.form-section > .question-header,
.form-section > .likert-header,
.form-section > .question-group {
  position: relative;
  padding-top: 12px;
}

.form-section > .field:not(.checkbox-field)::before,
.form-section > .question-header::before,
.form-section > .likert-header::before,
.form-section > .question-group::before {
  content: '';
  position: absolute;
  top: -16px;
  /* Left: clip = 20px left of field (sidebar edge). Extend 40px past for mask fade.
     Right: clip = 100px + stroke right of field. Extend 40px past for mask fade. */
  left: -60px;
  right: calc(-140px - var(--outline-width));
  bottom: -24px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), transparent 80%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
  -webkit-mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
  mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
}

/* ==========================================================================
   Question Numbering
   ========================================================================== */

.q-num {
  color: var(--terracotta);
  font-weight: 600;
  display: inline-block;
  min-width: 2.5em;
  margin-left: -2.5em;
}

.field label .q-num,
.question-text .q-num,
.likert-table td .q-num {
  margin-left: 0;
  margin-right: 0.5em;
  min-width: auto;
}

/* ==========================================================================
   Survey Page - Question Elements
   ========================================================================== */

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.question-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.reset-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--sand);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.question-header.has-value .reset-btn {
  opacity: 1;
  pointer-events: auto;
}

.reset-btn:hover {
  background: var(--salmon-light);
  color: var(--terracotta);
}

/* ==========================================================================
   Survey Page - Option Cards
   ========================================================================== */

.option-cards {
  margin-bottom: 16px;
}

.option-card {
  border: 2px solid var(--sand-dark);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--cream);
  opacity: 0.6;
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-card:hover {
  border-color: var(--salmon);
  background: var(--sand-light);
  opacity: 0.85;
}

.option-card.selected {
  border-color: var(--terracotta);
  background: var(--sand-light);
  opacity: 1;
  box-shadow: 0 4px 16px rgba(var(--terracotta-rgb), 0.15);
  transform: translateY(-2px);
}

/* Option card with unfilled conditional - waiting state */
.option-card.selected.awaiting-conditional {
  border-color: var(--salmon);
  box-shadow: 0 2px 8px rgba(var(--salmon-rgb), 0.2);
  transform: translateY(-1px);
}

/* Full completion - satisfied conditional */
.option-card.selected.conditional-satisfied {
  border-color: var(--terracotta);
  box-shadow: 0 6px 20px rgba(var(--terracotta-rgb), 0.2);
  transform: translateY(-3px);
}

.option-card input {
  display: none;
}

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-light);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

/* Hover shade on radio dot */
.option-card:hover .option-radio {
  background: rgba(var(--terracotta-rgb), 0.12);
  border-color: var(--salmon);
}

.option-card.selected .option-radio {
  border-color: transparent;
  background: transparent;
}

/* Contracting outer ring - target lock effect */
@keyframes ring-contract {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Inner dot rapid fade in */
@keyframes dot-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.option-card.selected .option-radio::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--terracotta);
  border-radius: 50%;
  box-sizing: border-box;
  animation: ring-contract 0.25s linear forwards;
}

.option-card.selected .option-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--terracotta);
  border-radius: 50%;
  animation: dot-fade-in 0.12s linear forwards;
}

.option-content h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.option-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Survey Page - Conditional Fields
   ========================================================================== */

.conditional {
  margin-left: 32px;
  padding: 16px;
  padding-right: 0;
  border-left: 2px solid var(--salmon);
  margin-top: 0;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(var(--salmon-rgb), 0.08) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s linear, padding 0.3s ease-out;
  visibility: hidden;
  width: calc(100% - 32px);
}

.conditional.show {
  max-height: 500px;
  opacity: 1;
  padding-top: 16px;
  padding-bottom: 16px;
  visibility: visible;
}

/* Compact inline fields for conditionals */
.conditional .field-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px;
  margin-bottom: 12px;
}

.conditional .field-compact label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 13px;
}

.conditional .field-compact .input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conditional .field-compact input {
  width: 104px;
  padding: 6px 10px;
  font-size: 14px;
  text-align: center;
  border-radius: 6px;
}

.field-suffix {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

/* Hide number input spinners */
input[inputmode="numeric"]::-webkit-outer-spin-button,
input[inputmode="numeric"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[inputmode="numeric"] {
  -moz-appearance: textfield;
}

/* Consistent styling for all numeric inputs */
.field input[inputmode="numeric"] {
  width: 104px;
  padding: 6px 10px;
  font-size: 14px;
  text-align: center;
  border-radius: 6px;
}

.field .input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Non-compact fields in conditionals */
.conditional .field:not(.field-compact) {
  margin-bottom: 12px;
}

.conditional .field:not(.field-compact) input:not([inputmode="numeric"]) {
  width: 100%;
}

/* ==========================================================================
   Survey Page - Likert Scale Table
   ========================================================================== */

.likert-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-bottom: 16px;
  overflow: visible;
  table-layout: fixed; /* Ensures column widths are respected for pill rig */
}

.likert-table tbody {
  overflow: visible;
}

.likert-table th {
  background: var(--sand);
  padding: 10px 4px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  border-bottom: 2px solid var(--sand-dark);
}

.likert-table th:first-child {
  text-align: left;
  width: 45%;
  padding-left: 8px;
  border-radius: 8px 0 0 0;
}

/* Equal width for all option columns */
.likert-table th:not(:first-child) {
  width: 13.75%;
}

.likert-table th.likert-header-label {
  color: var(--terracotta-dark);
}

.likert-table th:last-child {
  border-radius: 0 8px 0 0;
}

.likert-table td {
  padding: 12px 4px;
  border-bottom: 1px solid var(--sand);
  text-align: center;
  color: var(--text-light);
  position: relative;
  z-index: 1;
}

.likert-table td:first-child {
  text-align: left;
  padding-left: 8px;
}

.likert-table tbody tr {
  opacity: 0.85;
  transition: opacity 0.2s ease, background 0.2s ease;
  position: relative;
}

.likert-table tbody tr.answered {
  opacity: 1;
}

/* Pill highlight - positioned by JS in first radio cell */
.likert-pill-highlight {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  background: rgba(var(--muted-rgb), 0.12);
  border-radius: 100px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: pill-fade-in 0.2s linear forwards;
  /* left and width set by JS based on actual measurements */
}

.likert-pill-highlight.fade-out {
  animation: pill-fade-out 0.2s linear forwards;
}

@keyframes pill-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pill-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.likert-table input[type="radio"] {
  position: relative;
  z-index: 2;
}

.likert-table tbody tr.answered::after {
  content: '✓';
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--terracotta);
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.4;
}

.likert-table tbody tr.answered.just-answered::after {
  animation: checkmark-pop 0.25s linear;
}

@keyframes checkmark-pop {
  0% {
    transform: translateY(-50%) scale(0.5);
    opacity: 0;
  }
  70% {
    transform: translateY(-50%) scale(1.15);
    opacity: 0.5;
  }
  100% {
    transform: translateY(-50%) scale(1);
    opacity: 0.4;
  }
}

/* Bouncing arrow for unfilled rows */
.likert-table.has-missing tbody tr:not(.answered)::after {
  content: '‹';
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal-dark);
  font-weight: 900;
  font-size: 20px;
  pointer-events: none;
  opacity: 0.5;
  animation: arrow-bounce 2s ease-in-out infinite;
}

@keyframes arrow-bounce {
  0%, 100% {
    transform: translateY(-50%) translateX(0px);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-50%) translateX(-3px);
    opacity: 0.7;
  }
}

/* ==========================================================================
   Custom Likert Radio - Built from scratch
   ========================================================================== */

/* Hide native radio but keep it functional for form data */
.likert-table input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Custom radio container */
.likert-radio {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  cursor: pointer;
  z-index: 1;
}

/* Base circle - the stable dot */
.likert-radio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--text-light);
  border-radius: 50%;
  background: white;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

/* Hover: darken border */
.likert-radio:hover::before {
  border-color: var(--text);
}

/* Ghost dot on hover */
.likert-radio::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.likert-radio:hover::after {
  opacity: 0.4;
}

/* Selected state - hide ghost, show fill */
.likert-radio.selected::after {
  background: var(--terracotta);
  opacity: 1;
}

.likert-radio.selected::before {
  border-color: var(--terracotta);
}

/* Target ring element for homing animation */
.likert-radio .target-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--terracotta);
  border-radius: 50%;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
}

.likert-radio.selected .target-ring {
  animation: likert-ring-contract 0.25s linear forwards;
}

@keyframes likert-ring-contract {
  0% {
    opacity: 1;
    transform: scale(1.8);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.likert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.likert-header .reset-btn {
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.likert-header.has-value .reset-btn {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Likert segmented controls - hidden on desktop */
.likert-segment {
  display: none;
}

/* ==========================================================================
   Survey Page - Section Headers
   ========================================================================== */

.section-header {
  background: linear-gradient(135deg, var(--sand) 0%, var(--sand-light) 100%);
  padding: 10px 14px;
  margin: 20px 0 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-light);
  border-left: 3px solid var(--salmon);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s ease;
  opacity: 0.6;
}

.section-header .status-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  font-size: 12px;
}

.section-header.complete {
  opacity: 1;
  border-left-color: var(--terracotta);
  background: linear-gradient(135deg, rgba(var(--salmon-rgb), 0.2) 0%, var(--sand-light) 100%);
}

.section-header.complete .status-icon {
  background: var(--terracotta);
  color: white;
}

.section-header.partial {
  opacity: 0.8;
  border-left-color: var(--salmon);
}

.section-header.partial .status-icon {
  background: var(--salmon);
  color: white;
}

/* Half-done state: conditional fields not yet filled */
.section-header.conditional-incomplete {
  opacity: 0.85;
  border-left-color: var(--salmon);
}

.section-header.conditional-incomplete .status-icon {
  background: var(--salmon);
  color: white;
}

/* Section description/toelichting text */
.section-description {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -8px 0 16px;
  padding: 0 2px;
  line-height: 1.5;
  font-style: italic;
}

/* ==========================================================================
   Question Group Completion Effects - Lift & Shadow
   ========================================================================== */

/* Question group wrapper — exists for shared gradient ::before.
   Spacing between groups replaces the old .field-group-end margin. */
.question-group {
  /* position: relative is set in the gradient section above */
  margin-bottom: 12px;
}

/* Field group with shared label (e.g., "Wat zijn redenen..." with sub-fields) */
.field-group-labeled {
  margin-bottom: 24px;
}

.field-group-labeled .group-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.field-group-labeled .field {
  margin-bottom: 12px;
}

.field-group-labeled .field:last-child {
  margin-bottom: 0;
}

/* Completed section header gets extra visual polish */
.section-header.complete {
  box-shadow: 0 2px 8px rgba(var(--terracotta-rgb), 0.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   Survey Page - Navigation
   ========================================================================== */

.nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.progress-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand-dark);
  transition: all 0.3s;
}

.progress-dots span.active {
  background: var(--terracotta);
  width: 24px;
  border-radius: 4px;
}

.progress-dots span.done {
  background: var(--salmon);
}


/* ==========================================================================
   Survey Page - Steps
   ========================================================================== */

.step {
  display: none;
  flex-direction: column;
  width: 100%;
}

.step.active {
  display: flex;
  flex: 1;
  width: 100%;
}

/* ==========================================================================
   Slide Transitions for Steps
   ========================================================================== */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step.slide-up {
  animation: slideInUp 0.35s linear forwards;
}

.step.slide-down {
  animation: slideInDown 0.35s linear forwards;
}

/* ==========================================================================
   Survey Page - Success State
   ========================================================================== */

.success {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--salmon-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 4px 16px rgba(var(--terracotta-rgb), 0.2);
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: var(--terracotta);
}

/* ==========================================================================
   Comments Section - Subtle fallback for edge cases
   ========================================================================== */

.form-section .comments-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sand);
}

.form-section .comments-section button.comments-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  background-color: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-section .comments-section button.comments-toggle:hover {
  opacity: 1;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.form-section .comments-section .comments-label {
  font-size: 12px;
  font-weight: 400;
}

.form-section .comments-section .comments-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s linear;
  margin-top: 0;
}

.form-section .comments-section .comments-field.show {
  max-height: 150px;
  opacity: 1;
  margin-top: 8px;
}

.form-section .comments-section .comments-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sand-dark);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--sand-light);
  color: var(--text);
  resize: none;
  min-height: 60px;
  transition: all 0.2s;
}

.form-section .comments-section .comments-field textarea:focus {
  outline: none;
  border-color: var(--salmon);
  background: var(--input-fill);
}

.form-section .comments-section .comments-field textarea::placeholder {
  color: var(--text-light);
  opacity: 0.6;
  font-size: 12px;
}

/* ==========================================================================
   Progress Bar in Sidebar
   ========================================================================== */

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.progress-bar {
  flex: 1;
  height: var(--progress-bar-height);
  background: var(--sand-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--salmon) 0%, var(--terracotta) 100%);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-percentage {
  font-size: 12px;
  font-weight: 600;
  color: var(--terracotta);
  min-width: 36px;
  text-align: right;
}

/* ==========================================================================
   Print Button
   ========================================================================== */

.btn-print {
  background: var(--cream);
  border: 2px solid var(--sand-dark);
  color: var(--text-light);
  padding: 10px 12px;
}

.btn-print:hover {
  background: var(--sand-light);
  border-color: var(--salmon);
  color: var(--terracotta);
}

.btn-print svg {
  display: block;
}

.btn-print-small {
  padding: 6px 8px;
  border-width: 1px;
}

.btn-print-small svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  /* Reset page */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .survey-body {
    padding: 0 !important;
  }

  /* Hide non-print elements */
  .index,
  .progress-dots,
  .progress-dots-top,
  .progress-dots-bottom,
  .nav-buttons,
  .btn-print,
  .comments-section,
  .back-to-login-banner {
    display: none !important;
  }

  /* Container styling for print */
  .container {
    box-shadow: none !important;
    background: white !important;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 0 !important;
    min-height: auto !important;
  }

  /* Hide compound shape pseudo-elements for print */
  .container::before,
  .login-card::before {
    display: none !important;
  }

  .content {
    padding: 20px !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  /* Reset horizontal swipe layout for print */
  .content-scrollable.swipe-horizontal {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }

  .content-scrollable.swipe-horizontal > form {
    display: block !important;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step {
    overflow: visible !important;
    min-width: 0 !important;
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: white !important;
  }

  /* Show all steps for printing */
  .step {
    display: flex !important;
    page-break-inside: avoid;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
  }

  .step:last-child {
    border-bottom: none;
  }

  /* Hide review and success steps in print */
  .step[data-step="13"],
  .step[data-step="14"] {
    display: none !important;
  }

  /* Remove question gradients in print */
  .form-section > .field:not(.checkbox-field)::before,
  .form-section > .question-header::before,
  .form-section > .likert-header::before,
  .form-section > .question-group::before {
    display: none !important;
  }

  /* Form sections */
  .form-section {
    overflow: visible !important;
    max-height: none !important;
  }

  /* Option cards */
  .option-card {
    opacity: 1 !important;
    break-inside: avoid;
  }

  .option-card.selected {
    border-color: var(--terracotta) !important;
    background: #f5f5f5 !important;
  }

  /* Conditionals */
  .conditional {
    display: block !important;
    max-height: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .conditional:not(.show) {
    display: none !important;
  }

  /* Tables */
  .likert-table {
    width: 100% !important;
  }

  .likert-table tr {
    opacity: 1 !important;
  }

  /* Page breaks */
  h1 {
    page-break-after: avoid;
  }

  .form-section {
    page-break-inside: avoid;
  }

  /* Print header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--terracotta);
  }

  .print-header h1 {
    font-size: 18px;
    margin-bottom: 5px;
  }

  .print-header p {
    font-size: 12px;
    color: #666;
  }
}

/* Hide print header in normal view */
.print-header {
  display: none;
}

/* ==========================================================================
   Review Step Styles
   ========================================================================== */

.review-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

/* Complete state - all fields filled */
.review-complete {
  background: linear-gradient(135deg, var(--success-light) 0%, var(--success-medium) 100%);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
}

.review-complete-icon {
  width: 60px;
  height: 60px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.review-complete-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.review-complete h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 8px;
}

.review-complete p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 24px;
}

/* Incomplete state - some fields missing */
.review-incomplete {
  background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning-medium) 100%);
  border: 2px solid var(--warning);
  border-radius: 12px;
  padding: 24px;
}

.review-incomplete-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-incomplete-header svg {
  color: var(--warning);
  flex-shrink: 0;
}

.review-incomplete-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--warning-dark);
  margin: 0;
}

.review-incomplete-subtitle {
  font-size: 14px;
  color: var(--warning-dark);
  margin-bottom: 20px;
  padding-left: 36px;
}

/* State when all originally incomplete items are now complete */
.review-now-complete {
  background: linear-gradient(135deg, var(--success-light) 0%, var(--success-medium) 100%);
  border: 2px solid var(--success);
  border-radius: 12px;
  padding: 24px;
}

.review-all-complete-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-all-complete-header svg {
  color: var(--success);
  flex-shrink: 0;
}

.review-all-complete-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--success);
  margin: 0;
}

.review-now-complete .review-incomplete-subtitle {
  color: var(--success-dark);
}

/* Individual review items with accordion */
.review-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.review-item-accordion {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(var(--warning-rgb), 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.review-item-accordion:hover {
  border-color: rgba(var(--warning-rgb), 0.5);
}

.review-item-accordion.accordion-complete {
  background: rgba(var(--success-rgb), 0.1);
  border-color: var(--success);
}

.review-item-accordion.accordion-complete .review-item-step {
  color: var(--success);
}

.review-item-accordion.accordion-complete .review-item-label::after {
  content: ' ✓';
  color: var(--success);
}

.review-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.review-item-header:hover {
  background: rgba(var(--warning-rgb), 0.05);
}

.review-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.review-item-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--warning-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.review-item-count {
  font-size: 12px;
  color: var(--text-light);
}

.review-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Accordion chevron */
.accordion-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.accordion-chevron:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.accordion-chevron.open {
  transform: rotate(180deg);
}

/* Accordion content */
.review-item-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid transparent;
}

.review-item-content.open {
  max-height: 2000px;
  padding: 16px;
  border-top-color: rgba(245, 158, 11, 0.2);
}

/* Go to step button */
.btn-review-goto {
  padding: 6px 14px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Likert table in review accordion */
.likert-table-review {
  width: 100%;
  font-size: 13px;
}

.likert-table-review th {
  padding: 8px 4px;
  font-size: 11px;
}

.likert-table-review td {
  padding: 8px 4px;
}

.likert-table-review tr.row-incomplete {
  background: rgba(245, 158, 11, 0.1);
}

.likert-table-review tr.row-incomplete td:first-child {
  font-weight: 500;
}

.likert-table-review tr.row-complete {
  background: rgba(16, 185, 129, 0.05);
  color: var(--text-light);
}

/* Review fields container */
.review-fields-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-field.field-complete {
  opacity: 0.7;
}

.review-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.review-field input[type="text"],
.review-field input[type="number"],
.review-field input[type="date"],
.review-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 14px;
  background: var(--input-fill);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-field input:focus,
.review-field textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(194, 117, 94, 0.1);
}

/* Review radio group */
.review-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-option-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  background: white;
  transition: all 0.2s ease;
}

.review-option-card:hover {
  border-color: var(--terracotta);
}

.review-option-card input[type="radio"] {
  accent-color: var(--terracotta);
}

.review-option-card:has(input:checked) {
  border-color: var(--terracotta);
  background: rgba(194, 117, 94, 0.05);
}

/* Review checkbox label */
.review-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.review-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--terracotta);
}

/* Confirmation checkbox */
.review-confirm {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.review-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.review-confirm-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--terracotta);
  flex-shrink: 0;
}

/* Submit button on review page */
.btn-submit-review {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
}

.btn-submit-review:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
  }

  .login-info {
    max-width: 420px;
  }

  .container {
    flex-direction: column;
  }

  .index {
    flex: none;
    padding: 20px;
    border-radius: 12px 12px 0 0;
  }

  .content {
    padding: 30px 20px;
  }
}

@media (max-width: 600px) {
  .login-card {
    max-width: 100%;
  }

  .login-header {
    padding: 30px 24px;
  }

  .login-body {
    padding: 24px;
  }

  .login-info {
    display: none;
  }
}

/* ==========================================================================
   Modal Overlays
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s linear;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
}

.modal-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.modal-text-warning {
  color: var(--warning-dark);
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-icon-info {
  background: linear-gradient(135deg, var(--sand-light) 0%, var(--salmon-light) 100%);
}

.modal-icon-info svg {
  color: var(--terracotta);
}

.modal-icon-warning {
  background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning-medium) 100%);
}

.modal-icon-warning svg {
  color: var(--warning);
}

.modal-icon-error {
  background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger-medium) 100%);
}

.modal-icon-error svg {
  color: var(--danger);
}

/* Modal Link */
.modal-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--terracotta);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.modal-link:hover {
  color: var(--terracotta-dark, #a85c46);
  text-decoration: underline;
}

/* Modal Options (stacked buttons) */
.modal-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  font-size: 15px;
  width: 100%;
}

.modal-btn-subtitle {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 4px;
}

/* Modal Buttons (side by side) */
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-buttons .btn {
  flex: 1;
  padding: 12px 20px;
}

/* Danger button */
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger-darker) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--danger-rgb), 0.3);
}

/* Mobile responsive modals */
@media (max-width: 500px) {
  .modal-content {
    padding: 30px 24px;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-buttons {
    flex-direction: column;
  }

  .modal-buttons .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Archived Forms Section
   ========================================================================== */

.modal-content-wide {
  max-width: 560px;
}

.archived-forms-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sand);
}

.archived-forms-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.archived-forms-divider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.archived-forms-divider::before,
.archived-forms-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand);
}

.archived-forms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.archived-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: 8px;
  text-align: left;
  transition: all 0.2s ease;
}

.archived-form-item:hover {
  border-color: var(--terracotta-light);
  background: white;
}

.archived-form-latest {
  background: linear-gradient(135deg, rgba(194, 117, 94, 0.05) 0%, rgba(194, 117, 94, 0.1) 100%);
  border-color: var(--terracotta-light);
}

.archived-form-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.archived-form-org {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archived-form-date {
  font-size: 12px;
  color: var(--text-light);
}

.archived-form-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--terracotta);
  background: rgba(194, 117, 94, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  width: fit-content;
}

.archived-form-actions {
  flex-shrink: 0;
}

.archived-form-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.archived-form-actions .btn svg {
  flex-shrink: 0;
}

/* Mobile responsive for archived forms */
@media (max-width: 500px) {
  .archived-form-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .archived-form-actions {
    width: 100%;
  }

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

/* ==========================================================================
   Preview Mode Info Boxes (Public Access / Inkijkexemplaar)
   Watermark/stamp effect - clean, no background fill
   ========================================================================== */

.preview-info-box {
  display: none; /* Hidden by default, shown via JS for public sessions */
  text-align: center;
  padding: 6px 20px;
  border: 2px solid rgba(17, 17, 98, 0.4);
  border-radius: 4px;
  opacity: 0.7;
}

.preview-info-box.visible {
  display: block;
}


/* Bottom preview box is in flex row with nav buttons */
.preview-info-box-bottom {
  /* Positioned via flexbox in .nav-row */
}

.preview-info-box-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0;
  line-height: 1.2;
}

.preview-info-box-subtitle {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--terracotta);
  margin: 2px 0 0 0;
  opacity: 0.8;
}

/* Preview exit banners in sidebar (inkijkexemplaar only) */
.preview-exit-banner {
  display: none; /* Hidden by default, shown via JS for public sessions */
  text-align: center;
  padding: 8px 12px;
  border: 1.5px solid rgba(17, 17, 98, 0.3);
  border-radius: 6px;
  background: rgba(17, 17, 98, 0.04);
  margin-bottom: 10px;
}

.preview-exit-banner.visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-exit-banner-bottom.visible {
  justify-content: center;
}

.preview-exit-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--terracotta);
  opacity: 0.8;
}

.preview-exit-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--terracotta);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.preview-exit-link:hover {
  color: var(--salmon-dark);
  text-decoration: underline;
}

.preview-exit-banner-bottom {
  margin-top: 12px;
  margin-bottom: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  /* Hide bottom preview box on mobile - only show top as fixed banner */
  .preview-info-box-bottom {
    display: none !important;
  }

  /* Top preview box becomes fixed banner at top */
  .preview-info-box-top {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    padding: 5px 14px;
  }

  .preview-info-box-title {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .preview-info-box-subtitle {
    font-size: 8px;
  }

  /* Preview exit banners: hide bottom in mobile, top stays in drawer */
  .preview-exit-banner-bottom {
    display: none !important;
  }
}

/* ==========================================================================
   MOBILE-FRIENDLY REDESIGN
   All styles below are mobile-only and don't affect desktop
   ========================================================================== */

/* Hide mobile elements on desktop */
.mobile-menu-btn,
.mobile-overlay {
  display: none;
}

/* ==========================================================================
   Mobile Styles (768px and below)
   ========================================================================== */
@media (max-width: 768px) {

  /* Mobile Menu Button - Floating pill on left side */
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: fixed;
    left: -24px;
    /* Use svh (small viewport height) so position doesn't jump when browser UI hides/shows */
    top: 50svh;
    transform: translateY(-50%);
    z-index: 1000;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--salmon) 0%, var(--terracotta) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(var(--terracotta-rgb), 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Only transition transform and box-shadow, not position (prevents jitter when mobile address bar shows/hides) */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-menu-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 24px rgba(var(--terracotta-rgb), 0.5), 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .mobile-menu-btn:active {
    transform: translateY(-50%) scale(0.95);
  }

  /* Hamburger lines */
  .hamburger-line {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* Animate to X when open */
  .mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Mobile Overlay - Semi-transparent backdrop with blur */
  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--text-rgb), 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Index Sidebar - Slide-out drawer */
  .index {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 24px 20px;
    background: linear-gradient(180deg, var(--cream) 0%, var(--sand) 100%);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 20px 20px 0;
    /* Styled scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--muted-rgb), 0.5) transparent;
  }

  /* WebKit scrollbar styling for sidebar */
  .index::-webkit-scrollbar {
    width: 6px;
  }

  .index::-webkit-scrollbar-track {
    background: transparent;
  }

  .index::-webkit-scrollbar-thumb {
    background: rgba(var(--muted-rgb), 0.5);
    border-radius: 3px;
  }

  .index::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--muted-rgb), 0.7);
  }

  .index.mobile-open {
    transform: translateX(0);
  }

  /* Close hint at top of drawer */
  .index::before {
    content: 'Tik buiten menu om te sluiten';
    display: block;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    padding: 8px 0 16px;
    margin: -8px -20px 12px;
    border-bottom: 1px solid rgba(var(--muted-rgb), 0.3);
    opacity: 0.7;
  }

  /* Hide highlighter on mobile - use simple backgrounds instead */
  .mobile-highlighter {
    display: none;
  }

  /* Reset desktop outcrop padding on mobile */
  .index {
    padding-left: 20px;
  }

  /* Make index items more touch-friendly */
  .index-item {
    padding: 14px 16px;
    margin-bottom: 6px;
    min-height: 48px;
    border-radius: 12px;
  }

  .index-item .label,
  .index-item.active .label,
  .index-item.active:hover .label {
    font-size: 14px;
    transform: none; /* Reset desktop outcrop/scale transforms */
  }

  .index-item .status {
    width: 24px;
    height: 24px;
    font-size: 11px;
    transform: none; /* Reset desktop transform */
  }

  /* Simple background highlighting on mobile */
  .index-item.active {
    background: rgba(255, 255, 255, 0.7);
  }

  .index-item.active .status,
  .index-item.active:hover .status {
    transform: none; /* No outcrop on mobile */
  }

  .index-item:hover {
    background: rgba(255, 255, 255, 0.5);
  }

  .index-item:not(.active):not(.passing):hover .label {
    transform: none; /* No nudge on mobile */
  }

  /* Adjust hit area extension for mobile gap size */
  .index-item::after {
    bottom: -6px;
    height: 6px;
  }

  .index-divider {
    padding: 16px 16px 8px;
    margin-top: 12px;
    margin-left: 0;
    margin-right: 0;
    font-size: 11px;
  }

  .index-divider-clickable {
    padding: 14px 16px;
    margin-left: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Simple background on active dividers for mobile */
  .index-divider-clickable.active {
    background: rgba(255, 255, 255, 0.7);
  }

  /* Progress bar in drawer */
  .progress-bar-container {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }

  .progress-bar {
    height: 10px;
  }

  .progress-percentage {
    font-size: 14px;
    min-width: 42px;
  }

  /* Org info at bottom of drawer */
  .org-info {
    margin-top: auto;
    padding-top: 16px;
  }

  .back-to-login-banner {
    margin-top: 16px;
    padding: 0 12px;
  }

  .back-to-login-link {
    font-size: 14px;
    padding: 12px 16px;
  }

  /* Main container adjustments */
  .survey-body {
    padding: 16px 12px;
  }

  /* In swipe mode, body padding is zero — cards handle their own inset */
  .survey-body:has(.swipe-horizontal) {
    padding: 0;
  }

  .container {
    flex-direction: column;
    border-radius: 16px;
    min-height: auto;
    /* Remove backdrop-filter to prevent stacking context that traps sidebar z-index */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Update pseudo-element border-radius to match */
  .container::before {
    border-radius: calc(16px + var(--outline-width));
  }

  /* Content area - full width on mobile */
  .content {
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .content-header {
    display: none; /* Hide header on mobile - using drawer instead */
  }

  .content-scrollable:not(.swipe-horizontal) {
    max-height: none; /* No height limit on mobile - page scrolls naturally */
    overflow: visible;
    padding: 0;
    margin: 0;
  }

  .content-footer {
    margin-top: 24px;
  }

  /* Hide footer-row elements on mobile (using fixed nav instead) */
  .content-footer .footer-row {
    display: block;
  }

  .content-footer .preview-info-box-bottom,
  .content-footer .progress-dots-bottom,
  .progress-dots-top,
  .nav-buttons-top {
    display: none;
  }

  /* Headings */
  h1 {
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1.25;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 20px;
  }

  /* Buttons - larger touch targets */
  .btn {
    padding: 14px 24px;
    font-size: 15px;
    min-height: 48px;
    border-radius: 12px;
  }

  /* Fixed bottom navigation bar for thumb comfort */
  .nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(var(--cream-rgb), 0.95) 0%, rgba(var(--sand-rgb), 0.98) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(var(--muted-rgb), 0.2);
  }

  .nav-buttons .btn {
    flex: 1;
    min-height: 50px;
    font-size: 16px;
    font-weight: 600;
  }

  /* Reset scrollable on mobile - page scrolls normally (unless swipe mode) */
  .content-scrollable:not(.swipe-horizontal) {
    max-height: none;
    overflow: visible;
  }

  /* Form fields - larger touch targets */
  .field {
    margin-bottom: 24px;
  }

  .field label {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .field input[type="text"],
  .field input[type="number"],
  .field input[type="date"],
  .field input[type="email"],
  .field input[type="password"],
  .field textarea,
  .field select {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 12px;
  }

  /* Keep numeric inputs compact on mobile */
  .field input[inputmode="numeric"] {
    width: 104px;
    padding: 8px 12px;
    font-size: 16px;
    text-align: center;
    border-radius: 6px;
  }

  /* Option cards - more touch-friendly */
  .option-card {
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: 14px;
    min-height: 60px;
    flex-shrink: 1;
  }

  .option-radio {
    width: 24px;
    height: 24px;
  }

  .option-card.selected .option-radio::after {
    width: 12px;
    height: 12px;
  }

  .option-content h3 {
    font-size: 15px;
  }

  .option-content p {
    font-size: 13px;
  }

  /* Conditional fields */
  .conditional {
    margin-left: 24px;
    padding: 18px 16px;
    width: calc(100% - 24px);
    border-radius: 0 14px 14px 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Stack compact fields vertically on mobile */
  .conditional .field-compact {
    display: flex;
    flex-wrap: wrap;
    margin-right: 0;
  }

  .conditional .field-compact label {
    white-space: normal;
  }

  .conditional .field-compact input {
    width: 80px;
  }

  /* ==========================================================================
     Mobile Likert Scale - Card-based with Segmented Controls
     Best practice for mobile survey forms
     ========================================================================== */

  .likert-table {
    display: block;
    margin: 0 0 20px;
    border-collapse: separate;
  }

  /* Hide the table header on mobile - we'll show labels in segmented control */
  .likert-table thead {
    display: none;
  }

  .likert-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Each row becomes a card */
  .likert-table tbody tr {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--sand);
    opacity: 1;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .likert-table tbody tr:not(.answered) {
    opacity: 0.9;
  }

  .likert-table tbody tr.answered {
    border-color: var(--terracotta);
    box-shadow: 0 2px 8px rgba(var(--terracotta-rgb), 0.15);
  }

  /* Statement text - first cell */
  .likert-table tbody td:first-child {
    display: block;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    padding: 0 0 14px 0;
    border: none;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .likert-table tbody td:first-child .q-num {
    color: var(--terracotta);
    font-weight: 700;
    margin-right: 6px;
  }

  /* Hide radio cells, we'll use labels instead */
  .likert-table tbody td:not(:first-child) {
    display: none;
  }

  /* Hide desktop checkmark on mobile - replaced by reset button */
  .likert-table tbody tr.answered::after {
    display: none;
  }

  /* Bouncing arrow for unfilled rows - mobile position */
  .likert-table.has-missing tbody tr:not(.answered)::after {
    right: 12px;
    top: 14px;
    transform: none;
    font-size: 22px;
  }

  @keyframes arrow-bounce {
    0%, 100% {
      transform: translateX(0px);
      opacity: 0.5;
    }
    50% {
      transform: translateX(-3px);
      opacity: 0.7;
    }
  }

  /* Hide the reset button on mobile - cleaner experience */
  .likert-header .reset-btn {
    display: none;
  }

  /* Segmented control for Likert options */
  .likert-segment {
    position: relative;
    display: flex;
    width: 100%;
    background: var(--sand);
    border-radius: 10px;
    padding: 4px;
    gap: 0;
  }

  /* Sliding indicator background */
  .likert-segment-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(25% - 2px);
    height: calc(100% - 8px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
  }

  .likert-segment-slider.no-transition {
    transition: none;
  }

  .likert-segment.has-selection .likert-segment-slider {
    opacity: 1;
  }

  .likert-segment.is-dragging .likert-segment-slider {
    transition: transform 0.1s ease-out;
  }

  .likert-segment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
  }

  /* Subtle fill for unselected options when no selection yet */
  .likert-segment:not(.has-selection) .likert-segment-option {
    background: rgba(255, 255, 255, 0.5);
    margin: 0 2px;
  }

  .likert-segment:not(.has-selection) .likert-segment-option:first-of-type {
    margin-left: 0;
  }

  .likert-segment:not(.has-selection) .likert-segment-option:last-of-type {
    margin-right: 0;
  }

  .likert-segment-option:active {
    transform: scale(0.96);
  }

  .likert-segment:not(.has-selection) .likert-segment-option:active {
    background: rgba(255, 255, 255, 0.8);
  }

  /* Selected option text styling */
  .likert-segment-option.selected .likert-segment-label {
    color: var(--terracotta);
    font-weight: 600;
  }

  /* Hover state during drag */
  .likert-segment-option.hover .likert-segment-label {
    color: var(--terracotta);
    font-weight: 600;
  }

  .likert-segment-label {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
  }

  /* Likert header with scale legend on mobile */
  .likert-scale-legend {
    display: flex;
    justify-content: space-between;
    padding: 0 8px 12px;
    font-size: 11px;
    color: var(--text-light);
  }

  .likert-scale-legend span {
    opacity: 0.7;
  }

  /* Section headers */
  .section-header {
    padding: 14px 16px;
    margin: 24px -16px 18px;
    border-radius: 0;
    font-size: 12px;
  }

  /* Question groups — no extra spacing on mobile either */
  .question-group {
    /* layout-invisible */
  }

  /* Info boxes */
  .info-box {
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    border-radius: 0 12px 12px 0;
  }

  .info-box-large {
    padding: 20px 20px;
  }

  /* Answer categories box */
  .answer-categories-box {
    padding: 20px;
    border-radius: 14px;
  }

  .answer-categories-box h3 {
    font-size: 17px;
  }

  .answer-categories-list li {
    padding: 14px 18px;
    font-size: 15px;
  }

  /* Bottom bar */
  .bottom-bar {
    margin-top: 20px;
    padding-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Progress dots at bottom */
  .progress-dots-bottom-container {
    padding: 16px 0 8px;
  }

  .progress-dots span {
    width: 10px;
    height: 10px;
  }

  .progress-dots span.active {
    width: 28px;
  }

  /* Success page */
  .success {
    padding: 40px 20px;
  }

  .success-icon {
    width: 70px;
    height: 70px;
  }

  .success-icon svg {
    width: 36px;
    height: 36px;
  }

  /* Review step */
  .review-item-header {
    padding: 14px 16px;
  }

  .review-item-content.open {
    padding: 18px 16px;
  }

  .btn-review-goto {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Comments section */
  .comments-section {
    margin-top: 20px;
    padding-top: 14px;
  }

  .comments-toggle {
    padding: 8px 0;
  }

  /* Multi-input groups */
  .multi-input-group {
    gap: 14px;
  }

  .multi-input-group input {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 12px;
  }

  /* Checkbox labels */
  .checkbox-label {
    font-size: 14px;
    padding: 8px 0;
  }

  .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  /* Question numbers */
  .q-num {
    font-size: 13px;
  }

  /* Reset buttons */
  .reset-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* Print button - hide on mobile */
  .btn-print {
    display: none;
  }

  /* --- Mobile-first: Snappier step transitions --- */
  .step.slide-up {
    animation: slideInUp 0.2s ease-out forwards;
  }

  .step.slide-down {
    animation: slideInDown 0.2s ease-out forwards;
  }

  /* Reduce the distance of the slide to feel lighter on mobile */
  @keyframes slideInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes slideInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* --- Disable desktop-only sidebar passing effect --- */
  .index-item.passing .status,
  .index-item.passing .label {
    transform: none;
    transition: none;
  }

  /* --- Bottom padding so content isn't hidden behind fixed nav bar --- */
  .survey-body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  /* --- Hide desktop custom scrollbar on mobile --- */
  .custom-scrollbar {
    display: none !important;
  }

  /* --- Fade gradients not needed on mobile (natural scroll) --- */
  .content-scrollable-wrapper::before,
  .content-scrollable-wrapper::after {
    display: none;
  }

  /* ==========================================================================
     Horizontal Swipe Navigation (mobile only)
     Each step becomes its own card that physically slides across the screen.
     The parent container becomes invisible — the cards ARE the UI.
     ========================================================================== */

  /* --- Strip the container of all card styling in swipe mode --- */
  .container:has(.swipe-horizontal) {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    min-height: 0;
    overflow: visible;
    /* Full-bleed: remove the 40px margin so cards can peek at the edges */
    width: 100vw;
    max-width: 100vw;
    /* Remove backdrop-filter stacking context */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Kill the pseudo-element that draws the card outline + shadow */
  .container:has(.swipe-horizontal)::before {
    display: none;
  }

  /* Content wrapper becomes a transparent full-bleed column */
  .container:has(.swipe-horizontal) > .content {
    padding: 0;
    width: 100%;
  }

  /* Content header hidden (already hidden on mobile, but be explicit) */
  .container:has(.swipe-horizontal) .content-header {
    display: none;
  }

  /* Show progress dots above cards in swipe mode. */
  .container:has(.swipe-horizontal) .progress-dots-top {
    display: flex !important;
    padding: 12px 0 0;
    margin-bottom: 0;
  }

  /* The scrollable wrapper stretches to fill available viewport.
     Subtract 74px bottom nav + 22px dots row (12px pad + 10px dots). */
  .content-scrollable-wrapper:has(.swipe-horizontal) {
    overflow: visible;
    height: calc(100dvh - 74px - 22px - env(safe-area-inset-bottom, 0px));
  }

  /* --- The scroll-snap container (full viewport width) --- */
  .content-scrollable.swipe-horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    /* Native scroll-snap for GPU-accelerated snapping */
    scroll-snap-type: x mandatory;
    /* Hide native scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Full height — same as wrapper */
    height: calc(100dvh - 74px - 22px - env(safe-area-inset-bottom, 0px));
    max-height: none;
    padding: 0;
    margin: 0;
  }

  .content-scrollable.swipe-horizontal::-webkit-scrollbar {
    display: none;
  }

  /* The form inside is a horizontal flex track */
  .content-scrollable.swipe-horizontal > form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    min-width: fit-content;
    height: 100%;
    /* Horizontal padding = (100vw - cardWidth) / 2 = (56px / 2) = 28px.
       Vertical padding just enough for box-shadow to render. */
    gap: 12px;
    padding: 8px 28px;
    box-sizing: border-box;
  }

  /* --- Each step = its own card --- */
  .content-scrollable.swipe-horizontal .step.swipe-step {
    /* Card geometry tokens — masks derive from these so they're always flush */
    --card-radius: 20px;
    --card-pad-top: 24px;
    --card-pad-bottom: 24px;
    --card-pad-x: 20px;

    display: flex;
    flex-direction: column;
    /* Slightly less than full viewport width so the next card peeks in */
    flex: 0 0 calc(100vw - 56px);
    width: calc(100vw - 56px);
    min-width: calc(100vw - 56px);
    max-width: calc(100vw - 56px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Card styling */
    background: var(--cream);
    border-radius: var(--card-radius);
    /* No vertical padding — the sticky ::before / ::after masks provide it.
       This eliminates the negative-margin trick and makes top:0 / bottom:0 trivially correct. */
    padding: 0 var(--card-pad-x);
    box-sizing: border-box;
    box-shadow:
      0 4px 24px rgba(var(--brown-rgb), 0.12),
      0 1px 4px rgba(var(--brown-rgb), 0.08);
    /* Subtle border like the main container */
    border: 1px solid rgba(var(--salmon-rgb), 0.15);
    /* Force compositing layer so overflow clips to border-radius in Safari */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Hide native scrollbar — it extends past the card's border-radius */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step::-webkit-scrollbar {
    display: none;
  }

  /* Prevent any child from causing horizontal overflow inside cards */
  .content-scrollable.swipe-horizontal .step.swipe-step * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step input,
  .content-scrollable.swipe-horizontal .step.swipe-step textarea,
  .content-scrollable.swipe-horizontal .step.swipe-step select {
    max-width: 100%;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step .survey-body {
    min-width: 0;
    overflow: hidden;
  }

  /* Curved inner masks for swipe cards.
     The card has NO vertical padding.  Instead, ::before and ::after are the
     first / last flex children, sized to the desired padding height.  They sit
     right at the scrollport edge (no negative margins needed), so simple
     top: 0 / bottom: 0 keeps them pinned while content scrolls under them. */
  .content-scrollable.swipe-horizontal .step.swipe-step::before,
  .content-scrollable.swipe-horizontal .step.swipe-step::after {
    content: '';
    display: block;
    position: sticky;
    /* Extend into horizontal padding so mask spans full inner card width */
    margin-left: calc(-1 * var(--card-pad-x));
    margin-right: calc(-1 * var(--card-pad-x));
    z-index: 10;
    pointer-events: none;
    flex-shrink: 0;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step::before {
    height: var(--card-pad-top);
    top: 0;
    background: linear-gradient(to bottom, var(--cream) 30%, transparent 100%);
  }

  .content-scrollable.swipe-horizontal .step.swipe-step::after {
    height: var(--card-pad-bottom);
    bottom: 0;
    background: linear-gradient(to top, var(--cream) 30%, transparent 100%);
  }

  /* Disable the old slide animations when swiping */
  .content-scrollable.swipe-horizontal .step.slide-up,
  .content-scrollable.swipe-horizontal .step.slide-down {
    animation: none;
  }

  /* The footer stays outside the swipe area */
  .swipe-horizontal + .content-footer,
  .content-scrollable.swipe-horizontal ~ .content-footer {
    margin-top: 0;
  }
}

/* ==========================================================================
   Extra Small Mobile (< 400px)
   ========================================================================== */
@media (max-width: 400px) {
  .mobile-menu-btn {
    left: -22px;
    width: 44px;
    height: 44px;
  }

  .hamburger-line {
    width: 18px;
  }

  .survey-body:not(:has(.swipe-horizontal)) {
    padding: 12px 8px;
  }

  /* On extra small screens, cards are a bit narrower with tighter gaps.
     Horizontal padding = (100vw - cardWidth) / 2 = (36px / 2) = 18px */
  .content-scrollable.swipe-horizontal > form {
    gap: 8px;
    padding: 6px 18px;
  }

  .content-scrollable.swipe-horizontal .step.swipe-step {
    /* Override card geometry — masks auto-adjust via custom properties */
    --card-radius: 16px;
    --card-pad-top: 20px;
    --card-pad-bottom: 20px;
    --card-pad-x: 16px;
    flex: 0 0 calc(100vw - 36px);
    width: calc(100vw - 36px);
    min-width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
  }

  .content-scrollable:not(.swipe-horizontal) {
    max-height: none;
    overflow: visible;
  }

  h1 {
    font-size: 20px;
  }

  .option-card {
    padding: 14px 14px;
  }

  .index {
    width: 260px;
  }

  .btn {
    padding: 12px 20px;
  }

  /* Likert cards - extra small screens */
  .likert-table tbody td:first-child {
    font-size: 13px;
    padding: 0 0 12px 0;
  }

  .likert-table tbody tr {
    padding: 14px;
  }

  .likert-segment-option {
    padding: 10px 2px;
    min-height: 48px;
  }

  .likert-segment-label {
    font-size: 10px;
  }
}

/* ==========================================================================
   Prevent body scroll when drawer is open
   ========================================================================== */
body.mobile-drawer-open {
  overflow: hidden;
  /* Position is set via JS (open/close) with scroll position save/restore for iOS */
  touch-action: none;
}

/* ==========================================================================
   Decorative Logo Shapes - Background Elements
   ========================================================================== */

/* Container for decorative elements - fixed positioning */
.logo-decor {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Gentle floating animations - serene blob-like paths */
@keyframes float-1 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  20% {
    transform: translate(15px, -20px) scale(1.03);
  }
  40% {
    transform: translate(-10px, -13px);
  }
  60% {
    transform: translate(-20px, 10px) scale(0.97);
  }
  80% {
    transform: translate(8px, 15px);
  }
}

@keyframes float-2 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-18px, -10px) scale(1.03);
  }
  50% {
    transform: translate(13px, -23px);
  }
  75% {
    transform: translate(-8px, 13px) scale(0.97);
  }
}

@keyframes float-3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  30% {
    transform: translate(13px, 18px) scale(1.03);
  }
  60% {
    transform: translate(-15px, -8px) scale(0.97);
  }
}

/* The complete logo shape (person + chevron as one unit) */
.logo-decor-shape {
  position: absolute;
  width: 450px;
  height: 520px;
  opacity: 0.18;
}

.logo-decor-shape svg {
  width: 100%;
  height: 100%;
}

/* Bottom-left positioning - logo peeking up from corner */
.logo-decor-bottom-left {
  bottom: -180px;
  left: -120px;
  -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(135deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  animation: float-1 20s ease-in-out infinite;
}

/* Top-right positioning - logo peeking from corner */
.logo-decor-top-right {
  top: -200px;
  right: -140px;
  -webkit-mask-image: linear-gradient(315deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(315deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0) 100%);
  animation: float-2 25s ease-in-out infinite;
}

/* Center-right positioning - third decorative element */
.logo-decor-center-right {
  top: 50%;
  right: -200px;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
  animation: float-3 22s ease-in-out infinite;
}

/* On mobile: hide decorative shapes entirely (battery drain from infinite animations) */
@media (max-width: 768px) {
  .logo-decor {
    display: none;
  }
}

/* On tablets/small desktops: reduce decorations, stop animations */
@media (max-width: 900px) and (min-width: 769px) {
  .logo-decor-shape {
    width: 320px;
    height: 370px;
    opacity: 0.12;
    animation: none !important;
  }

  .logo-decor-center-right {
    display: none;
  }
}

/* Hide decorations when printing */
@media print {
  .logo-decor {
    display: none !important;
  }
}

/* ==========================================================================
   Word Counter
   ========================================================================== */

.word-counter {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

.word-counter .hint-success {
  color: var(--success);
  font-weight: 500;
}

.word-counter .hint-error {
  color: var(--error);
  font-weight: 500;
}

/* Contenteditable field (textarea replacement for word limit styling) */
.contenteditable-wrapper {
  position: relative;
}

.contenteditable-field {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  background: var(--input-fill);
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  color: var(--text);
  transition: all 0.2s;
  overflow-y: auto;
  resize: vertical;
}

.contenteditable-field:focus {
  outline: none;
  border-color: var(--salmon);
  background: var(--input-fill);
}

.contenteditable-field:empty::before {
  content: attr(data-placeholder);
  color: var(--text-light);
  opacity: 0.6;
  pointer-events: none;
}

.contenteditable-field .word-excess {
  color: var(--error);
  font-weight: 600;
}

/* Textarea word counters (toelichting, motivatie, comments) */
.textarea-word-counter {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

/* ==========================================================================
   Reduced Motion - Respect user preference for less animation
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo-decor {
    display: none;
  }

  .step.slide-up,
  .step.slide-down {
    animation: none;
    opacity: 1;
  }

  .view {
    transition: none;
  }
}

/* ==========================================================================
   Contextual Help — Hover-triggered popovers for survey guidance
   ========================================================================== */

/* Help bar: sits between subtitle and form content */
.ch-help-bar {
  margin: -4px 0 16px 0;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

/* Inline trigger text */
.ch-trigger {
  color: var(--text-light);
  font-weight: 400;
  border-bottom: 1px dashed rgba(122, 101, 85, 0.4);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, opacity 0.15s;
  user-select: none;
  -webkit-user-select: none;
  font-size: 13px;
  opacity: 0.7;
}

.ch-trigger:hover,
.ch-trigger.is-active {
  border-bottom-style: solid;
  color: var(--text);
  border-bottom-color: var(--text);
  opacity: 1;
}

/* Hide original trigger when clone is shown */
.ch-trigger.is-hidden {
  opacity: 0;
}

/* Inactive triggers stay visible (but blurred) when blur layer is active */
body:has(.ch-blur-layer.is-active) .ch-trigger:not(.is-hidden) {
  opacity: 1;
}

/* Clone of active trigger - sits above blur layer */
.ch-trigger-clone {
  position: absolute;
  z-index: 7999;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ch-trigger-clone.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ch-trigger-sep {
  color: var(--text-light);
  opacity: 0.4;
  font-size: 13px;
}

/* Popover panel - absolute so it scrolls with page */
.ch-popover {
  position: absolute;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: rgba(var(--cream-rgb), 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 24px 28px;
  box-shadow:
    0 8px 32px rgba(var(--brown-rgb), 0.18),
    0 0 0 1px rgba(var(--terracotta-rgb), 0.08);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  z-index: 8000;
  opacity: 0;
  visibility: hidden;
  display: none;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ch-popover.is-open {
  opacity: 1;
  visibility: visible;
  display: block;
  animation: ch-mask-reveal 0.3s ease-out forwards;
}

@keyframes ch-mask-reveal {
  from {
    clip-path: inset(-50px -50px calc(100% + 50px) -50px round 14px);
  }
  to {
    clip-path: inset(-50px -50px -50px -50px round 14px);
  }
}

/* Arrow down (popover above trigger) */
.ch-popover::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: rgba(var(--cream-rgb), 0.96);
  border-radius: 2px;
  box-shadow: 2px 2px 4px rgba(var(--brown-rgb), 0.04);
}

/* Arrow up (popover below trigger) */
.ch-popover.ch-arrow-up::after {
  bottom: auto;
  top: -7px;
  box-shadow: -1px -1px 4px rgba(var(--brown-rgb), 0.04);
}

/* Popover typography */
.ch-popover p {
  margin: 0 0 8px 0;
}

.ch-popover p:last-child {
  margin-bottom: 0;
}

/* Safe zone (invisible) */
.ch-safezone {
  position: absolute;
  z-index: 7999;
  display: none;
  pointer-events: auto;
}

.ch-safezone.is-visible {
  display: block;
}

/* Blur layer behind popovers */
.ch-blur-layer {
  position: fixed;
  inset: 0;
  z-index: 7998;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(var(--brown-rgb), 0.03);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ch-blur-layer.is-active {
  opacity: 1;
}

/* Lead paragraph */
.ch-lead {
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 4px 0;
  color: var(--text);
}

/* Divider */
.ch-divider {
  height: 1px;
  background: var(--sand);
  margin: 12px 0;
}

/* Reveal sections (expand on hover) */
.ch-reveal {
  margin: 4px 0;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.ch-reveal.is-expanded {
  background: rgba(var(--sand-rgb), 0.35);
}

@media (hover: hover) and (min-width: 769px) {
  .ch-reveal:hover {
    background: rgba(var(--sand-rgb), 0.35);
  }
}

.ch-reveal-label {
  display: block;
  padding: 6px 10px;
  color: var(--terracotta);
  font-weight: 600;
  font-size: 13px;
  cursor: default;
  transition: color 0.15s;
}

.ch-reveal-label::after {
  content: ' \203A';
  opacity: 0.5;
}

.ch-reveal.is-expanded .ch-reveal-label {
  color: var(--text);
}

.ch-reveal.is-expanded .ch-reveal-label::after {
  content: ' \2193';
  opacity: 0.3;
}

@media (hover: hover) and (min-width: 769px) {
  .ch-reveal:hover .ch-reveal-label {
    color: var(--text);
  }

  .ch-reveal:hover .ch-reveal-label::after {
    content: ' \2193';
    opacity: 0.3;
  }
}

/* Grid-based height transition for smooth expand */
.ch-reveal-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 1.05s ease;
  overflow: hidden;
}

.ch-reveal.is-expanded .ch-reveal-body {
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;
}

.ch-reveal-inner {
  min-height: 0;
  transform: translateY(-100%);
  transition: transform 1.05s ease;
}

.ch-reveal.is-expanded .ch-reveal-inner {
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.ch-reveal-inner p {
  padding: 2px 10px 10px;
  margin: 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.65;
}

.ch-reveal-inner p:last-child {
  padding-bottom: 6px;
}

/* Scale items (Likert level display) */
.ch-scale {
  margin: 4px 0 8px;
}

.ch-scale-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 7px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}

@media (hover: hover) and (min-width: 769px) {
  .ch-scale-item:hover {
    background: rgba(var(--sand-rgb), 0.5);
  }
}

.ch-scale-badge {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.ch-badge-0 { background: var(--sand); color: var(--text-light); }
.ch-badge-1 { background: rgba(var(--salmon-rgb), 0.25); color: var(--terracotta); }
.ch-badge-2 { background: rgba(var(--salmon-rgb), 0.4); color: var(--terracotta-dark); }
.ch-badge-3 { background: rgba(var(--success-rgb), 0.2); color: var(--success-dark); }

.ch-scale-quote {
  font-style: italic;
  font-size: 13px;
  color: var(--text);
}

.ch-scale-desc {
  flex-basis: 100%;
  font-size: 12.5px;
  color: var(--text-light);
}

.ch-scale-compact .ch-scale-desc {
  flex-basis: auto;
}

.ch-scale-compact .ch-scale-item {
  padding: 4px 10px;
}

/* Scale accordion (Likert levels as reveals) */
.ch-scale-accordion {
  margin: 0;
}

.ch-scale-reveal {
  margin: 2px 0;
}

.ch-scale-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
}

.ch-scale-label::after {
  content: none;
}

.ch-scale-label-quote {
  font-style: italic;
  font-size: 13px;
  color: var(--text-light);
  transition: color 0.15s;
}

.ch-scale-reveal.is-expanded .ch-scale-label-quote {
  color: var(--text);
}

@media (hover: hover) and (min-width: 769px) {
  .ch-scale-reveal:hover .ch-scale-label-quote {
    color: var(--text);
  }
}

.ch-scale-detail {
  padding: 0 10px 6px 10px;
  margin: 0;
  margin-left: 60px;
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Two-column layout (telt mee / telt niet mee) */
.ch-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 10px 10px;
}

.ch-col strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.ch-col-yes strong { color: var(--success); }
.ch-col-no strong { color: var(--text-light); }

.ch-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ch-col li {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light);
  padding: 2px 0;
}

.ch-col li::before {
  content: '\00b7\2002';
  font-weight: 700;
}

.ch-col-yes li::before { color: var(--success); }
.ch-col-no li::before { color: var(--text-light); opacity: 0.5; }

/* Footnote */
.ch-footnote {
  font-size: 12px;
  color: var(--text-light);
  opacity: 0.7;
  margin: 12px 0 0;
  font-style: italic;
  padding: 0 10px;
}

/* Grab bar — visible on touch devices as a flick-to-dismiss affordance */
.ch-grab-bar {
  display: none;
}

@media (hover: none) {
  .ch-grab-bar {
    display: flex;
    justify-content: center;
    padding: 4px 0 8px;
    cursor: grab;
  }

  .ch-grab-bar span {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: rgba(var(--brown-rgb), 0.15);
  }

  /* On touch devices, blur layer must intercept taps */
  .ch-blur-layer.is-active {
    pointer-events: auto;
  }

  /* Reveal labels get a tap cursor */
  .ch-reveal-label {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .ch-popover {
    width: calc(100vw - 32px);
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Active tap feedback for reveal labels (replaces hover) */
  .ch-reveal-label:active {
    color: var(--text);
    opacity: 0.7;
  }

  .ch-two-col {
    grid-template-columns: 1fr;
  }

  .ch-scale-desc {
    flex-basis: 100%;
  }
}

/* Print: hide help elements */
@media print {
  .ch-help-bar,
  .ch-trigger,
  .ch-trigger-sep,
  .ch-popover,
  .ch-safezone {
    display: none !important;
  }
}
