:root {
  --text: #1d1d1f;
  --muted: #555;
  --accent: #0b5d6b;
  --line: #c9c9c9;
  --soft: #eef5f6;
  --error: #b00020;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 18px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #fff;
}

header, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
footer { border: 0; border-top: 1px solid var(--line); font-size: 15px; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
main:focus { outline: none; }

h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 21px; margin-top: 32px; }

a { color: var(--accent); }

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

fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
fieldset.missing legend { color: var(--error); }
fieldset.missing legend::after { content: " (please answer)"; font-weight: 400; }

label { display: block; margin: 8px 0; }

input, select, textarea, button {
  font: inherit;
  color: inherit;
}
input:not([type=radio]):not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #767676;
  border-radius: 6px;
}

label.choice, label.check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
}
label.choice input, label.check input { width: 22px; height: 22px; flex: none; }

.scale {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}
.scale label { margin: 0; }
.scale input {
  position: absolute;
  opacity: 0;
}
.scale span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #767676;
  border-radius: 6px;
}
.scale input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.scale input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.ends {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--muted);
}

.why {
  margin: -12px 0 24px;
  padding: 12px;
  background: var(--soft);
  border-radius: 6px;
}

details.note { margin: -12px 0 24px; font-size: 16px; }
details.note summary { color: var(--accent); cursor: pointer; min-height: 44px; display: flex; align-items: center; }

button {
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
button.secondary { background: #fff; color: var(--accent); border: 2px solid var(--accent); }
button:disabled { opacity: 0.6; }

.alert {
  padding: 16px;
  border: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
}

.note { color: var(--muted); }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }

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

header .logo { display: block; height: 52px; width: auto; }
header .brand { display: flex; align-items: center; gap: 8px; }
.hero-logo { display: block; width: 260px; max-width: 70%; height: auto; margin: 16px 0 0; }

#totop { position: fixed; right: 16px; bottom: 20px; width: 48px; height: 48px; padding: 0; border-radius: 50%;
  font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 10; }
#totop[hidden] { display: none; }
