:root {
  --primary: #08788a;
  --primary-dark: #0b6775;
  --text: #25313a;
  --muted: #66737d;
  --border: #dfe9ec;
  --warning: #9a5b00;
  --warning-soft: #fff4df;
  --danger: #bd3e45;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: #f4f8fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.card {
  width: min(100%, 420px);
  padding: 40px 28px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(27, 76, 88, .10);
  text-align: center;
}
.survey-card { width: min(100%, 680px); text-align: left; }
.logo { display: block; width: 180px; max-width: 75%; height: auto; margin: 0 auto 30px; }
.survey-logo { width: 142px; margin-bottom: 24px; }
h1 { margin: 0 0 12px; font-size: 21px; line-height: 1.45; text-align: center; }
#survey-title {
  position: relative;
  margin-bottom: 22px;
  color: #1a2c32;
  font-size: clamp(32px, 8vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  text-wrap: balance;
}
#survey-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}
.survey-schema-v5 > #survey-title {
  max-width: 100%;
  font-size: min(32px, 6.2vw);
  letter-spacing: 0;
  white-space: nowrap;
}
.survey-schema-v5 > #survey-title::after {
  width: min(76%, 340px);
  height: 3px;
  margin-top: 14px;
}
h2 { margin: 12px 0; font-size: 20px; text-align: center; }
p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.7; }
#link-view > p, #survey-description { min-height: 3.4em; text-align: center; }
#survey-description:empty { display: none; min-height: 0; margin: 0; }
#survey-description.auth-warning {
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid rgba(154, 91, 0, .28);
  border-radius: 12px;
  color: var(--warning);
  background: var(--warning-soft);
  font-weight: 700;
  text-align: left;
}
.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 20px;
  border: 4px solid #dce9ec;
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: grid; gap: 12px; }
.button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:focus-visible, .ranking-option:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.button:disabled { cursor: wait; opacity: .65; }
.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 12px rgba(8, 120, 138, .25);
}
.primary.ready { box-shadow: 0 0 0 4px rgba(8, 120, 138, .18), 0 4px 12px rgba(8, 120, 138, .25); }
.secondary { color: var(--primary-dark); background: #eaf7f9; }
.oauth-actions {
  position: relative;
  left: 50%;
  width: min(92vw, 420px);
  gap: 14px;
  transform: translateX(-50%);
}
.oauth {
  display: flex;
  width: 100%;
  height: 52px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 4px 18px;
  border: 1px solid #747775;
  border-radius: 12px;
  color: #1f1f1f;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .10);
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}
.oauth:active { opacity: .9; }
.oauth.google { font-family: Roboto, Arial, sans-serif; font-weight: 500; }
.oauth-icon { flex: 0 0 auto; object-fit: contain; }
.apple-icon { width: 20px; height: 24px; }
.google-icon { width: 24px; height: 24px; }
.oauth span { flex: 0 1 auto; text-align: left; }
.oauth-provider { display: grid; gap: 6px; }
.apple-login-note {
  margin: 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}
.guest {
  min-height: 52px;
  border: 2px solid var(--primary);
  border-radius: 14px;
  color: var(--primary-dark);
  background: #fff;
  font-size: 16px;
}
.stores { display: grid; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e7ecef; }
.store { color: #fff; background: #101214; border-radius: 12px; }
.login-notice {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 18px 18px 18px 38px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: #f4fcfd;
  font-size: 14px;
  line-height: 1.7;
}
.login-heading { margin: 0 0 14px; }
.survey-form { display: grid; gap: 20px; scroll-padding-block: 72px 140px; }
.survey-progress { position: sticky; top: 0; z-index: 2; margin: 0 -4px; padding: 10px 4px 12px; background: rgba(255, 255, 255, .96); }
.survey-progress-copy { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.survey-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4eef1; }
.survey-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); transition: width .2s ease; }
.survey-step-page { display: grid; gap: 14px; }
.voice-step-page { animation: step-in .18s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(5px); } }
.voice-page-title { margin: 2px 0 0; text-align: left; font-size: 20px; }
.voice-page-title:focus, .voice-intro h2:focus { outline: none; }
.voice-page-description { margin: -4px 0 2px; }
.voice-intro { padding: 22px; background: linear-gradient(145deg, #f4fcfd, #fff); }
.voice-intro h2 { margin-top: 0; color: var(--primary-dark); }
.voice-intro p { text-align: center; }
.voice-intro ul { display: grid; gap: 10px; margin: 16px 0 0; padding-left: 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.question { margin: 0; border: 0; }
.question-card { padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 4px 16px rgba(27, 76, 88, .06); scroll-margin-block: 72px 140px; }
[data-error-id] { scroll-margin-block: 72px 140px; }
.question-card[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(189, 62, 69, .10); }
.question legend { width: 100%; margin-bottom: 14px; font-size: 16px; font-weight: 700; line-height: 1.6; }
.required { margin-left: 8px; color: var(--danger); font-size: 12px; }
.schema-v5-step .v5-question-heading,
.schema-v6-step .v5-question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
  color: #17363d;
  font-size: 17px;
  line-height: 1.55;
  text-align: left;
}
.schema-v5-step .v5-question-heading .required,
.schema-v6-step .v5-question-heading .required {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  line-height: 1.3;
}
.schema-v5-step .v5-question-controls,
.schema-v6-step .v5-question-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice { display: flex; min-height: 48px; gap: 12px; align-items: center; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; line-height: 1.45; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary-dark); background: #eaf7f9; }
.choice input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--primary-dark); }
.choice-grid { display: grid; gap: 8px; }
.choice-grid .choice { margin: 0; }
.described-choice > span { display: grid; gap: 3px; min-width: 0; }
.described-choice small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.45; }
.option-section { display: grid; gap: 8px; margin-top: 16px; }
.option-section:first-of-type { margin-top: 0; }
.option-section h3 { margin: 0; color: var(--primary-dark); font-size: 14px; line-height: 1.5; }
.primary-option-section { display: grid; gap: 8px; }
.exclusive-option-section {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  background: #f6f8f9;
}
.exclusive-option-section h3 { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.feature-choice-row { display: grid; gap: 8px; }
.feature-comment-label { display: grid; gap: 6px; margin: -2px 0 8px; color: var(--text); font-size: 13px; font-weight: 700; }
.feature-comment-label textarea { min-height: 92px; border-color: #a9c7cd; background: #fbfefe; }
.feature-comment-label .comment-count { color: var(--muted); font-weight: 400; }
.schema-v6-step .feature-comment-section { display: grid; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 2px solid var(--border); }
.schema-v6-step .feature-comment-section > h3 { margin: 0; color: var(--primary-dark); font-size: 16px; }
.schema-v6-step .feature-comment-section > .question-hint { margin: -4px 0 0; }
.schema-v6-step .feature-comment-section .feature-comment-label { margin: 0; }
.selection-limit-status { margin: 0 0 8px; color: var(--primary-dark); font-size: 13px; font-weight: 700; text-align: right; }
.question-hint { margin: -4px 0 12px; font-size: 12px; }
.optional-panel { padding: 0 16px 16px; }
.optional-panel > summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
}
.optional-panel[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.text-button { min-height: 44px; padding: 8px 0; border: 0; color: var(--primary-dark); background: transparent; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.privacy-note { padding: 12px; border-radius: 12px; color: var(--primary-dark); background: #eaf7f9; font-weight: 700; }
.compact-options { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.compact-options .choice { position: relative; justify-content: center; min-height: 58px; padding: 6px 2px; font-size: 14px; font-weight: 800; text-align: center; }
.compact-options .choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.compact-options .choice:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.rating-copy { display: grid; gap: 1px; justify-items: center; pointer-events: none; }
.rating-number { font-size: 16px; line-height: 1; }
.rating-label { font-size: 10px; font-weight: 700; line-height: 1.15; }
.scale-key { display: grid; gap: 4px; margin: 0; padding: 12px 12px 12px 34px; border-radius: 12px; color: var(--muted); background: #f4f8fa; font-size: 12px; line-height: 1.45; }
.feature-card > legend { font-size: 17px; }
.comment-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.comment-details summary { min-height: 48px; display: flex; align-items: center; color: var(--primary-dark); font-size: 14px; font-weight: 700; cursor: pointer; }
.comment-details textarea { margin-top: 6px; min-height: 88px; }
.comment-count { display: block; }
.optional-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.optional-note > summary { display: flex; min-height: 44px; align-items: center; color: var(--primary-dark); font-size: 14px; font-weight: 700; cursor: pointer; }
.optional-note-label { display: grid; gap: 6px; margin-top: 6px; color: var(--text); font-size: 13px; font-weight: 700; }
.optional-note textarea { min-height: 92px; }
.schema-v6-step .optional-note-heading { margin: 0; color: var(--primary-dark); font-size: 14px; line-height: 1.55; }
.schema-v6-step .unused-reason-section { display: grid; }
.schema-v6-step .unused-reason-group { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--border); }
.schema-v6-step .unused-reason-group:last-of-type { border-bottom: 0; }
.schema-v6-step .unused-reason-group > legend { width: 100%; margin-bottom: 10px; color: var(--primary-dark); font-size: 15px; font-weight: 700; line-height: 1.5; }
.schema-v6-step .voice-section-title { margin: 10px 0 0; color: var(--primary-dark); font-size: 18px; line-height: 1.5; }
.note-specific-copy { margin-top: 18px; }
.reason-board { display: grid; gap: 14px; }
.reason-help { margin: 0; font-size: 13px; }
.reason-source, .reason-bucket { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.reason-source { position: sticky; top: 68px; z-index: 1; border-color: #a9cbd1; background: #f2fbfc; box-shadow: 0 4px 12px rgba(27, 76, 88, .08); }
.reason-source h3, .reason-bucket h3 { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.reason-buckets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reason-bucket.drag-over { border-color: var(--primary); background: #eaf7f9; box-shadow: 0 0 0 3px rgba(8, 120, 138, .12); }
.reason-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.reason-feature-chip, .reason-assign-button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #a9c7cd;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.reason-feature-chip { display: inline-flex; align-items: center; gap: 8px; }
.reason-drag-handle { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; color: var(--primary-dark); background: #e8f4f6; font-size: 16px; touch-action: none; }
.reason-feature-chip[aria-pressed="true"], .reason-feature-chip.dragging { border-color: var(--primary); background: #dff4f6; box-shadow: 0 0 0 3px rgba(8, 120, 138, .12); }
.reason-assign-button { width: 100%; margin-bottom: 8px; color: var(--primary-dark); background: #eef8fa; }
.reason-assign-button:disabled { color: var(--muted); cursor: default; opacity: .7; }
.reason-empty { margin: 0; font-size: 12px; }
.reason-undo { justify-self: start; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.ranking-hint { margin: -4px 0 12px; font-size: 12px; }
.ranking-options { display: grid; gap: 8px; }
.ranking-option {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.ranking-option[aria-pressed="true"] { border-color: var(--primary); background: #eaf7f9; }
.ranking-option:disabled { cursor: not-allowed; opacity: .48; }
.ranking-option-copy { display: grid; gap: 3px; }
.ranking-option-copy small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; }
.rank-badge { display: grid; min-width: 32px; height: 32px; place-items: center; padding: 0 7px; border-radius: 999px; color: var(--primary-dark); background: #eaf7f9; font-size: 12px; }
.ranking-option[aria-pressed="true"] .rank-badge { color: #fff; background: var(--primary-dark); }
.detail-feature > h3 { margin: 0 0 14px; font-size: 18px; }
.nested-question { padding: 12px 0; box-shadow: none; border-width: 1px 0 0; border-radius: 0; }
.nested-question legend { font-size: 14px; }
.detail-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-options .choice { min-height: 52px; margin: 0; padding: 8px 10px; font-size: 13px; }
.future-rankings { display: grid; gap: 12px; }
.review-card { display: grid; gap: 12px; background: #f4fcfd; }
.review-card strong { color: var(--primary-dark); }
.review-card p { margin: 0; }
textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #bdcbd0;
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}
.hint { margin: 6px 0 0; font-size: 12px; text-align: right; }
.error { margin: 0; color: var(--danger); font-weight: 700; text-align: center; }
#survey-questions { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.survey-navigation { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: minmax(92px, .4fr) 1fr; gap: 10px; margin: 0 -8px -12px; padding: 14px 8px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255, 255, 255, .98); box-shadow: 0 -8px 20px rgba(27, 76, 88, .08); }
.survey-navigation .secondary.hidden + .primary:not(.hidden) { grid-column: 1 / -1; }
.result { text-align: center; }
.result-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin: 4px auto 12px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 30px;
  font-weight: 700;
}
.reward { margin-top: 24px; padding: 20px; border-radius: 16px; background: #eaf7f9; text-align: center; }
.reward-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.reward strong { color: var(--primary-dark); font-size: 20px; }
.hidden { display: none !important; }

@media (max-width: 520px) {
  main { padding: 0; align-items: stretch; }
  .card { width: 100%; min-height: 100vh; min-height: 100dvh; border-radius: 0; padding: max(24px, env(safe-area-inset-top)) 16px 24px; }
  .survey-logo { width: 124px; margin-bottom: 16px; }
  .survey-card.survey-in-progress { padding-top: max(8px, env(safe-area-inset-top)); }
  .survey-in-progress > .survey-logo,
  .survey-in-progress > #survey-title,
  .survey-in-progress > #survey-description { display: none; }
  .survey-in-progress .survey-progress { padding-top: 8px; }
  .question-card { padding: 16px 14px; }
  .reason-buckets { grid-template-columns: 1fr; }
  .compact-options { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 2px; }
  .compact-options .choice { min-height: 60px; }
  .nested-question { padding: 12px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
