:root {
  --paper: #fff;
  --ink: #17191d;
  --muted: #505661;
  --line: #e2e4e9;
  --surface: #f5f6f8;
  --action: #1749bd;
  --action-hover: #123993;
  --edge: clamp(20px, 5vw, 76px);
  --heading: Georgia, "Times New Roman", serif;
  --radius: 6px;
  color-scheme: light;
  font: 15px/1.5 Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
[hidden] { display: none !important; }

.site-header {
  padding-inline: var(--edge);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
}

.brand {
  color: var(--ink);
  font: 32px/1 var(--heading);
  letter-spacing: -.045em;
  text-decoration: none;
}

.brand span {
  display: block;
  margin-top: 7px;
  font: 600 9px/1.4 Arial, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.languages { display: flex; gap: 2px; }
.languages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.languages a[aria-current] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 5px;
}

main {
  width: 100%;
  max-width: 910px;
  margin-inline: auto;
  padding: clamp(30px, 5vw, 64px) var(--edge) 64px;
}

h1, h2 {
  font-family: var(--heading);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.045em;
}

h1 { margin: 0 0 20px; font-size: clamp(36px, 4.5vw, 62px); }
h2 { font-size: clamp(26px, 3vw, 36px); }
h1, h2, h3, p, a, label { overflow-wrap: anywhere; }
p { margin: 0 0 14px; }

main > form:not(#response), article {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

article { margin-block: 16px; }
article h2 { margin: 8px 0 12px; }
form label { display: block; margin-bottom: 14px; font-weight: 600; }

input, textarea, select, button { font: inherit; }
input:not([type=hidden], [type=checkbox]), textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid #aeb4bf;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

textarea { resize: vertical; }
fieldset { margin: 18px 0; padding: 16px; border: 1px solid var(--line); }
legend { padding-inline: 8px; font-weight: 600; }
input[type=checkbox] { margin: 0 8px 0 0; accent-color: var(--action); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--action);
  border-radius: var(--radius);
  background: var(--action);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--action-hover); }
.quiet { border-color: #aeb4bf; background: var(--paper); color: var(--ink); }
.quiet:hover { background: var(--surface); }
button:disabled { opacity: .6; cursor: default; }
.hint, small { color: var(--muted); font-size: 12px; font-weight: 400; }
.links, .line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.line { justify-content: space-between; }
.preserve { white-space: pre-wrap; }

.respondent:has(#response) {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(30px, 6vw, 94px);
  max-width: 1310px;
}
.survey-intro > .preserve { color: var(--muted); line-height: 1.75; max-width: 41ch; }

.preview-note {
  margin-block: 20px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.recording-notice { line-height: 1.7; }

#response {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.question-card, .response-footer { margin: 0; padding: clamp(16px, 3vw, 28px); }
.question-card + .question-card, .question-card + .response-footer { border-top: 1px solid var(--line); }
.response-footer { background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.question-card .prompt { margin-bottom: 12px; font-size: 16px; line-height: 1.45; }
.question-card textarea { margin-top: 0; }
.voice-controls { margin-top: 10px; }
.voice-controls p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.voice-controls p:empty { display: none; }
.voice-controls label { display: flex; align-items: baseline; margin: 12px 0 0; font-size: 13px; }
.completion p { color: var(--muted); }

.recording-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #ebc4c0;
  border-radius: var(--radius);
  color: #84281f;
  background: #fff8f7;
  font-size: 13px;
  font-weight: 600;
}
.recording-dot { width: 8px; height: 8px; border-radius: 50%; background: #bc3025; }
.recording-clock { margin-inline-start: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-controls.is-recording [data-record] { border-color: #9c3028; color: #84281f; }

@media (max-width: 760px) {
  .topbar { min-height: 70px; }
  .brand { font-size: 29px; }
  .respondent:has(#response) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .survey-intro p:last-child { margin-bottom: 0; }
}

@media (max-width: 520px) {
  #submit { width: 100%; }
}
