:root {
  color-scheme: light;
  --page: oklch(98.5% 0.003 265);
  --surface: oklch(99.6% 0.003 265);
  --surface-muted: oklch(96.8% 0.006 265);
  --ink: oklch(20.5% 0.015 270);
  --ink-muted: oklch(48% 0.02 270);
  --border: oklch(90.5% 0.009 270);
  --border-strong: oklch(75% 0.018 270);
  --action: oklch(54.6% 0.245 263);
  --action-dark: oklch(48.8% 0.23 263);
  --action-soft: oklch(96.8% 0.025 263);
  --error: oklch(45% 0.18 27);
  --error-soft: oklch(96.5% 0.025 27);
  --success: oklch(46% 0.145 145);
  --success-soft: oklch(96.5% 0.025 145);
  --focus: oklch(65% 0.18 263 / 0.32);
  --shadow-low: 0 1px 2px oklch(20.5% 0.015 270 / 0.04);
  --radius-control: 6px;
  --radius-surface: 8px;
  --content-width: 760px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--action-dark);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--action);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  width: min(100% - 40px, 1040px);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 190px;
  height: 52px;
  object-fit: contain;
}

.brand span {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.event-name {
  color: var(--ink-muted);
  font-size: 14px;
}

.page-shell {
  width: min(100% - 40px, var(--content-width));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.intro {
  max-width: 680px;
  margin-bottom: 28px;
}

.intro h1,
.admin-title h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.intro > p {
  max-width: 64ch;
  margin: 14px 0 0;
  color: var(--ink-muted);
}

.privacy-note {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid oklch(88% 0.04 263);
  border-radius: var(--radius-control);
  background: var(--action-soft);
  color: oklch(33% 0.09 263);
  font-size: 14px;
}

.privacy-note svg {
  margin-top: 2px;
  fill: currentColor;
}

.privacy-note p {
  margin: 0;
}

.survey,
.login-panel,
.admin-content,
.success-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.survey {
  overflow: hidden;
}

.progress-region {
  padding: 18px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 13px;
}

#step-counter {
  color: var(--ink-muted);
}

#step-name {
  color: var(--ink);
  font-weight: 600;
}

progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--border);
  accent-color: var(--action);
}

progress::-webkit-progress-bar {
  background: var(--border);
}

progress::-webkit-progress-value {
  background: var(--action);
  transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

progress::-moz-progress-bar {
  background: var(--action);
}

.form-step {
  padding: 28px;
}

.step-heading {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
}

.step-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step-heading h2,
.success-panel h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.step-heading p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.question {
  min-width: 0;
  margin: 0;
  padding: 26px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.question:last-child {
  border-bottom: 0;
}

.question legend,
.text-question > label {
  display: block;
  max-width: 68ch;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
}

.required-mark {
  margin-left: 5px;
  color: var(--error);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.rating-scale {
  margin-top: 18px;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 8px;
}

.rating-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.rating-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.rating-face {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.rating-check {
  position: absolute;
  top: -5px;
  right: -5px;
  display: none;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--action-dark);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.rating-choice:hover .rating-face {
  border-color: var(--action);
  background: var(--action-soft);
}

.rating-choice input:checked + .rating-face {
  border-color: var(--action);
  background: var(--action);
  color: var(--surface);
}

.rating-choice input:checked ~ .rating-check {
  display: grid;
}

.rating-choice input:focus-visible + .rating-face {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.rating-endpoints {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.rating-endpoints span:last-child {
  text-align: right;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.rating-matrix-hint {
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}

.rating-matrix-scroll {
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overscroll-behavior-inline: contain;
}

.rating-matrix-scroll:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.rating-matrix {
  min-width: 420px;
  table-layout: fixed;
  font-size: 14px;
}

.rating-matrix th,
.rating-matrix td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.rating-matrix thead th {
  height: 42px;
  color: var(--ink-muted);
  font-weight: 600;
}

.rating-matrix .matrix-location-heading,
.rating-matrix .matrix-row-label {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 170px;
  padding: 10px 12px;
  background: var(--surface-muted);
  color: var(--ink);
  text-align: left;
  line-height: 1.4;
}

.rating-matrix .matrix-location-heading {
  z-index: 2;
  color: var(--ink-muted);
}

.rating-matrix tbody tr:last-child th,
.rating-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.matrix-choice {
  position: relative;
  display: grid;
  min-width: 44px;
  min-height: 52px;
  place-items: center;
  cursor: pointer;
}

.matrix-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.matrix-radio {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.matrix-choice:hover .matrix-radio {
  border-color: var(--action);
  background: var(--action-soft);
}

.matrix-choice input:checked + .matrix-radio {
  border-color: var(--action);
  background: var(--action);
  box-shadow: inset 0 0 0 5px var(--surface);
}

.matrix-choice input:focus-visible + .matrix-radio {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.not-used-choice {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 14px;
}

.not-used-choice input,
.acknowledgement input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--action);
}

.field-hint {
  margin: 4px 0 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

textarea,
.password-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

textarea {
  resize: vertical;
}

textarea:hover,
.password-input:hover {
  border-color: oklch(63% 0.035 270);
}

textarea:focus,
.password-input:focus {
  border-color: var(--action);
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.character-count {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.acknowledgement {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 26px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  font-size: 14px;
}

.acknowledgement input {
  margin: 2px 0 0;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
}

.button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button-primary {
  border-color: var(--action);
  background: var(--action);
  color: var(--surface);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--action-dark);
  background: var(--action-dark);
  color: var(--surface);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--ink-muted);
  background: var(--surface-muted);
}

.button-danger,
.button-danger-secondary {
  border-color: var(--error);
}

.button-danger {
  background: var(--error);
  color: var(--surface);
}

.button-danger:hover:not(:disabled) {
  border-color: oklch(39% 0.17 27);
  background: oklch(39% 0.17 27);
  color: var(--surface);
}

.button-danger-secondary {
  background: var(--surface);
  color: var(--error);
}

.button-danger-secondary:hover:not(:disabled) {
  background: var(--error-soft);
  color: var(--error);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.message {
  margin: 20px 28px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: 14px;
}

.message-error {
  border-color: oklch(78% 0.08 27);
  background: var(--error-soft);
  color: var(--error);
}

.message-success {
  border-color: oklch(78% 0.08 145);
  background: var(--success-soft);
  color: var(--success);
}

.success-panel {
  padding: 48px 28px;
  text-align: center;
}

.success-icon {
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid oklch(78% 0.08 145);
  border-radius: 50%;
  background: var(--success-soft);
  fill: var(--success);
}

.success-panel p {
  margin: 8px 0 0;
  color: var(--ink-muted);
}

.site-footer {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

/* Admin */

.admin-page .page-shell {
  width: min(100% - 40px, 1120px);
}

.admin-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.admin-title p {
  margin: 8px 0 0;
  color: var(--ink-muted);
}

.login-panel {
  max-width: 440px;
  padding: 28px;
}

.login-panel h2,
.admin-section h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.4;
}

.login-panel > p {
  margin: 8px 0 22px;
  color: var(--ink-muted);
  font-size: 14px;
}

.login-panel label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

.login-panel .button {
  width: 100%;
  margin-top: 14px;
}

.login-panel .message {
  margin: 14px 0 0;
}

.admin-content {
  overflow: hidden;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.admin-summary div {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}

.admin-summary div:last-child {
  border-right: 0;
}

.admin-summary dt {
  color: var(--ink-muted);
  font-size: 12px;
}

.admin-summary dd {
  margin: 3px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.admin-section {
  padding: 26px 28px;
  border-bottom: 1px solid var(--border);
}

.admin-section:last-child {
  border-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-header p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.average-value {
  font-weight: 600;
}

.venue-values {
  min-width: 250px;
  white-space: normal;
  line-height: 1.5;
}

.danger-section .section-header {
  margin-bottom: 0;
}

.reset-confirmation {
  max-width: 680px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.reset-confirmation p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.reset-confirmation strong {
  color: var(--ink);
}

.reset-confirmation form > label {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.reset-confirmation code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.95em;
}

#reset-confirmation-help {
  margin-top: 4px;
  font-size: 12px;
}

.confirmation-input {
  width: min(100%, 360px);
  min-height: 48px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.confirmation-input:hover {
  border-color: oklch(63% 0.035 270);
}

.confirmation-input:focus {
  border-color: var(--error);
  outline: 3px solid oklch(65% 0.16 27 / 0.25);
  outline-offset: 1px;
}

.confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.danger-section > .message {
  margin: 18px 0 0;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list details {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.comment-list summary {
  min-height: 44px;
  padding: 10px 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.comment-body {
  padding: 0 13px 13px;
  color: var(--ink-muted);
  font-size: 14px;
  white-space: pre-wrap;
}

.comment-body p {
  margin: 8px 0 0;
}

.comment-body strong {
  color: var(--ink);
}

.empty-state {
  margin: 0;
  padding: 28px 0;
  color: var(--ink-muted);
  text-align: center;
}

@media (max-width: 680px) {
  .header-inner,
  .page-shell,
  .admin-page .page-shell,
  .site-footer {
    width: min(100% - 28px, var(--content-width));
  }

  .header-inner {
    min-height: 62px;
  }

  .brand img {
    width: 166px;
    height: 46px;
  }

  .event-name {
    font-size: 12px;
  }

  .page-shell {
    padding: 34px 0 52px;
  }

  .intro h1,
  .admin-title h1 {
    font-size: 1.7rem;
  }

  .progress-region,
  .form-step,
  .form-actions,
  .admin-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .step-heading {
    grid-template-columns: 36px 1fr;
    gap: 12px;
  }

  .step-number {
    width: 36px;
    height: 36px;
  }

  .rating-options {
    gap: 6px;
  }

  .rating-face {
    min-height: 46px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    flex: 1;
  }

  .site-footer,
  .admin-title,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-title .button,
  .section-header .button {
    width: 100%;
  }

  .confirmation-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .confirmation-actions .button {
    width: 100%;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .admin-summary div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  .brand span {
    display: none;
  }

  .rating-endpoints {
    font-size: 11px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
