#survey-dialog { width: min(800px, calc(100vw - 32px), calc((100dvh - 32px) * 4 / 3)); aspect-ratio: 4 / 3; max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 24px 28px; overflow: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 80px rgb(15 23 42 / 20%); font-size: 13px; }
#survey-dialog::backdrop { background: rgb(15 23 42 / 48%); backdrop-filter: blur(3px); }
#survey-form { display: grid; gap: 4px; }
#survey-form h2, #survey-form p { margin: 0; }
#survey-form h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.02em; }
#survey-form .survey-intro { font-size: 12px; color: var(--muted); line-height: 1.45; }
#survey-form .survey-module { min-width: 0; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; display: grid; grid-template-columns: 278px minmax(0, 1fr); gap: 4px 20px; align-items: center; }
#survey-form .survey-module legend { padding: 0 8px 0 0; font-size: 13px; font-weight: 600; }
.survey-rating { display: grid; grid-template-columns: 64px repeat(4, 30px) 64px; align-items: center; gap: 6px; margin: 0; }
#survey-form .survey-question { font-size: 12px; line-height: 1.4; color: var(--text); margin: 2px 0 4px; }
#survey-form .survey-rating .survey-scale-label { font-size: 10px; line-height: 1.25; font-weight: 400; color: var(--muted); }
.survey-scale-label:first-child { text-align: right; }
.survey-scale-label:last-child { text-align: left; }
#survey-form .survey-rating label { position: relative; display: grid; place-items: center; width: 30px; height: 30px; box-sizing: border-box; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.survey-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.survey-rating span { font-size: 13px; font-weight: 600; line-height: 1; }
#survey-form .survey-rating label:hover { border-color: var(--accent); color: var(--accent); }
#survey-form .survey-rating .is-selected { color: var(--surface); background: var(--accent); border-color: var(--accent); }
#survey-form .survey-rating .is-selected span { color: var(--surface); }
.survey-rating label:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
#survey-form .survey-module > label { display: grid; gap: 2px; margin: 0; font-size: 11px; color: var(--muted); }
#survey-form .survey-module textarea { width: 100%; min-height: 30px; height: 30px; box-sizing: border-box; resize: vertical; font: inherit; font-size: 12px; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; }
#survey-form .survey-module textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.survey-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
#survey-form .survey-preference { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 12px; cursor: pointer; }
#survey-form .survey-preference input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
#survey-form .survey-preference small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
#survey-form .survey-actions button { font-size: 12px; padding: 9px 13px; border-radius: 8px; }
#survey-status { font-size: 12px; line-height: 1.4; }
#survey-status:empty { display: none; }
@media (max-width: 600px) {
  #survey-dialog { padding: 16px; }
  #survey-form { gap: 8px; }
  #survey-form h2 { font-size: 17px; }
  #survey-form .survey-module { grid-template-columns: 1fr; gap: 8px; }
  .survey-actions { justify-content: stretch; }
  #survey-form .survey-actions button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { #survey-form .survey-rating label { transition: none; } }

.survey-followups { display: grid; gap: 8px; margin-top: 8px; }
#survey-form .survey-followup { min-width: 0; margin: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; }
#survey-form .survey-followup legend { padding: 0 4px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.survey-answer-options { display: flex; gap: 20px; }
#survey-form .survey-answer-options label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; cursor: pointer; }
#survey-form .survey-answer-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

#survey-form .survey-extra { display: grid; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 600; }
#survey-form .survey-extra textarea { width: 100%; box-sizing: border-box; min-height: 70px; padding: 9px; resize: vertical; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface-muted); font: inherit; font-weight: 400; }

#survey-thanks { width: min(400px, calc(100vw - 40px)); box-sizing: border-box; padding: 30px; overflow: visible; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 24px 80px rgb(15 23 42 / 20%); }
#survey-thanks::backdrop { background: rgb(15 23 42 / 45%); backdrop-filter: blur(3px); }
#survey-thanks h2 { margin: 0 0 12px; font-size: 22px; }
#survey-thanks p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
#survey-thanks button { padding: 10px 24px; font-size: 13px; }
.survey-confetti { position: absolute; inset: 0; pointer-events: none; }
.survey-confetti span { position: absolute; left: 50%; top: 45%; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: survey-confetti-burst 2.2s ease-out forwards; }
@keyframes survey-confetti-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 35% { opacity: 1; transform: translate(var(--confetti-x), var(--confetti-y)) rotate(var(--confetti-spin)); } 100% { opacity: 0; transform: translate(var(--confetti-x), calc(var(--confetti-y) + 320px)) rotate(var(--confetti-spin)); } }
@media (prefers-reduced-motion: reduce) { .survey-confetti { display: none; } }
