/* Pulse survey modal (T-422, revised T-458). survey-* prefix, tokens only, so dark mode and
   the extra themes inherit. Shell modelled on demos.css. */

.survey-overlay {
  position: fixed;
  inset: 0;
  /* Above the FAB, feedback pill, dials and the 9000-9100 modals; BELOW the
     legal-consent modal (9999). It covers the
     viewport and takes pointer events, so nothing behind it is clickable. */
  z-index: 9400;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--shadow-rgb), 0.4);
  animation: survey-fade var(--speed) ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .survey-overlay { animation: none; }
}

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

.survey-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  width: min(560px, 92vw);
  max-height: 90vh;            /* fallback for browsers without dvh */
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.28);
}

.survey-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.survey-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.survey-progress { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.survey-thanks { margin: 14px 0; font-size: 15px; color: var(--text); }

.survey-body {
  padding: 8px 20px 4px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.survey-q { padding: 10px 0; }
.survey-q-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.survey-hint { font-weight: 400; font-size: 12.5px; color: var(--text-muted); }
.survey-req { color: var(--red); }

.survey-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.survey-chip {
  padding: 7px 12px;
  font: 600 13px/1 var(--font-body);
  color: var(--text);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--speed) ease, border-color var(--speed) ease;
}
.survey-chip:hover { background: var(--gold-soft); }
.survey-chip.is-active { background: var(--gold-soft); border-color: var(--gold); }
.survey-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.survey-text {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: 14px/1.45 var(--font-body);
  color: var(--text);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  resize: vertical;
  box-sizing: border-box;
}
.survey-text:focus { outline: none; border-color: var(--gold); }

.survey-status {
  flex-shrink: 0;
  margin: 4px 20px 0;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--bg-warm);
}
.survey-status.is-ok { color: var(--green); background: var(--green-soft); }
.survey-status.is-error { color: var(--red); background: var(--red-soft); }

.survey-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 16px;
  flex-shrink: 0;
}
.survey-skip { margin-right: auto; }
