:root {
  --navy: #082744;
  --blue: #123f73;
  --orange: #ff9700;
  --ink: #142238;
  --muted: #64748b;
  --line: #d8e2ee;
  --bg: #f3f6fa;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 Arial, sans-serif; }
header { height: 106px; padding: 0 max(24px, calc((100vw - 1040px) / 2)); display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
header img { display: block; width: 82px; height: 82px; object-fit: contain; }
header span { font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
main { max-width: 1040px; margin: 46px auto; padding: 0 20px; }
.survey-card { background: white; border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 46px); box-shadow: 0 14px 42px #173a5c12; }
.survey-card h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.08; margin: 10px 0 16px; }
.intro { color: var(--muted); margin-bottom: 28px; }
.survey-page-header { margin: -14px -14px 32px; padding: 28px 30px 30px; border-radius: 19px; background: linear-gradient(135deg, #f4f8fc 0%, #fffaf1 100%); }
.section-count { display: block; margin-top: 12px; color: #9a5b00; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-description { max-width: 760px; margin: 0; color: var(--muted); font-size: 19px; }
.progress { height: 8px; background: #e5edf5; border-radius: 20px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--orange); }
label { display: block; font-weight: 700; margin: 18px 0 7px; }
input, select, textarea { width: 100%; padding: 14px; border: 1px solid #b9c9db; border-radius: 10px; font: inherit; }
.identity { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.survey-question-list { display: grid; gap: 22px; }
.survey-question { min-inline-size: 0; border: 0; border-radius: 18px; padding: 26px; margin: 0; background: #f7fafd; box-shadow: inset 0 0 0 1px var(--line); }
.survey-question:nth-child(3n+2) { background: #fffaf2; }
.survey-question:nth-child(3n+3) { background: #f5faf8; }
.survey-question::after { content: ""; display: block; clear: both; }
.survey-question legend { float: left; width: 100%; padding: 0; margin: 0 0 20px; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.3; font-weight: 800; }
.survey-question-label { display: block; margin-bottom: 7px; color: #a96400; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.survey-subquestion-letter { display: none; }
.survey-question legend + * { clear: both; }
.survey-question legend b { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #fff0ee; color: #b42318; font-size: 15px; vertical-align: 2px; }
.survey-question p { clear: both; margin: 0 0 18px; color: var(--muted); }
.choice { display: flex; align-items: center; gap: 12px; margin: 10px 0; border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; background: white; font-weight: 600; }
.choice:hover { border-color: #8ba8c5; background: #fafdff; }
.choice input, .rating-scale input { width: auto; }
.checkbox-choice-group { clear: both; }
.checkbox-choice-limit { margin: 0 0 12px !important; color: var(--muted); font-size: 14px; font-weight: 700; }
.checkbox-choice-limit.is-at-limit { color: #176b43; }
.checkbox-choice-group .choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.rating-scale { clear: both; display: flex; align-items: center; gap: 10px; }
.rating-scale label { margin: 0; }
.rating-scale span { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.matrix { clear: both; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.matrix table { border-collapse: collapse; width: 100%; }
.matrix th, .matrix td { padding: 13px 11px; border-bottom: 1px solid #e5ebf2; text-align: center; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix th:first-child { min-width: 230px; text-align: left; }
.matrix input { width: auto; }
.rank-row { display: grid; grid-template-columns: 1fr 100px; align-items: center; gap: 16px; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.rank-row select { padding: 9px; }
.ranking-board { clear: both; }
.ranking-instructions { display: grid; gap: 3px; margin-bottom: 14px; padding: 14px 16px; border-radius: 12px; background: #eaf2fa; color: var(--blue); }
.ranking-instructions span { color: var(--muted); font-size: 15px; }
.ranking-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ranking-column { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.ranking-column.is-over { border-color: var(--orange); box-shadow: 0 0 0 3px #ff970026; }
.ranking-column-header { min-height: 62px; margin-bottom: 13px; }
.ranking-column-header strong,.ranking-column-header span { display: block; }
.ranking-column-header span { margin-top: 3px; color: var(--muted); font-size: 14px; }
.ranking-zone { display: grid; align-content: start; gap: 10px; min-height: 230px; margin: 0; padding: 10px; border: 2px dashed #d7e2ed; border-radius: 13px; background: #f7fafd; list-style: none; }
.ranking-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: grab; box-shadow: 0 3px 9px #173a5c0b; }
.ranking-item:active { cursor: grabbing; }.ranking-item.is-dragging { opacity: .45; }.ranking-pool .rank-position { display: none; }
.ranking-pool .ranking-item { grid-template-columns: minmax(0, 1fr) auto; }
.rank-position { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--navy); color: white; font-size: 18px; font-weight: 800; }
.rank-actions { display: flex; gap: 5px; }
button.rank-move { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid #b9c9db; border-radius: 9px; background: white; color: var(--blue); font-size: 12px; }
button.rank-move[hidden] { display: none !important; }
.survey-question[hidden] { display: none !important; }
button.rank-move:hover:not(:disabled) { border-color: var(--blue); background: #f3f7fb; }
button.rank-move:disabled { opacity: .35; cursor: not-allowed; }
.ranking-empty { display: none; place-items: center; min-height: 190px; padding: 20px; color: var(--muted); text-align: center; }.ranking-zone:empty + .ranking-empty { display: grid; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
button { background: var(--blue); color: white; border: 0; border-radius: 11px; padding: 14px 24px; font-weight: 800; font-size: 16px; }
button.secondary { background: white; color: var(--blue); border: 1px solid var(--line); }
.error { background: #fff0ee; color: #a92820; padding: 14px; border-radius: 10px; margin: 16px 0; }
.completion { max-width: 760px; margin: 9vh auto 0; padding-block: clamp(44px, 8vw, 78px); text-align: center; background: linear-gradient(145deg, #fff 0%, #f5f9fd 100%); }
.completion-mark { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 22px; border-radius: 50%; background: #e4f5ec; color: #16734a; font-size: 43px; font-weight: 800; box-shadow: 0 0 0 10px #f2faf6; }
.completion-eyebrow { color: #a96400; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.completion-message h1, .completion-message h2 { margin: 10px 0 14px; font-size: clamp(34px, 5vw, 50px); line-height: 1.1; }
.completion-message p { margin: 0 auto; color: var(--muted); font-size: 19px; }
.completion-note { max-width: 540px; margin: 26px auto 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.completion-close { display: inline-flex; align-items: center; justify-content: center; min-width: 190px; margin-top: 24px; border-radius: 11px; padding: 14px 24px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 800; text-decoration: none; }
.completion-close-help { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 650px) {
  header { height: 82px; } header img { width: 66px; height: 66px; }
  main { margin: 22px auto; padding: 0 12px; }
  .identity { grid-template-columns: 1fr; }
  .survey-card { border-radius: 16px; padding: 18px; }
  .survey-page-header { margin: -6px -6px 24px; padding: 22px 20px; }
  .survey-question { padding: 20px 16px; }
  .rating-scale { flex-wrap: wrap; }
  .matrix { font-size: 14px; }
  .matrix th:first-child { min-width: 170px; }
  .ranking-columns { grid-template-columns: 1fr; }.ranking-zone { min-height: 150px; }.ranking-item { grid-template-columns: 40px minmax(0, 1fr); }
  .rank-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
