*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #f6f6f4; color: #1c1c1c;
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: .4em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
ul { padding-left: 1.2em; }
li { margin: .35em 0; }
[hidden] { display: none !important; }

button {
  font: inherit; color: inherit; cursor: pointer; border-radius: 10px;
  border: 1px solid #b9b9b4; background: #fff; padding: .7em 1em;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; opacity: .45; }
button.primary {
  display: block; width: 100%; margin: 1.4em 0 .6em; background: #1f4e79; color: #fff;
  border-color: #1f4e79; font-weight: 600; font-size: 1.05rem; padding: .85em 1em;
}
fieldset { border: 0; padding: 0; margin: 0 0 1.1em; }
legend { font-weight: 600; margin-bottom: .5em; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices.two { grid-template-columns: repeat(2, 1fr); }
.choices button[aria-pressed="true"] { background: #1f4e79; color: #fff; border-color: #1f4e79; }
.error { color: #a00; font-weight: 600; }

#trial { display: flex; flex-direction: column; align-items: center; }
.progress { width: 100%; height: 6px; background: #ddd; border-radius: 3px; overflow: hidden; }
#bar { height: 100%; width: 0; background: #1f4e79; transition: width .2s; }
.count { margin: .3em 0 .5em; font-size: .85rem; color: #666; align-self: flex-end; }
.face {
  width: min(100%, 52vh, 460px); aspect-ratio: 1 / 1; background: #e4e4e0;
  border-radius: 12px; overflow: hidden;
}
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.face img.blank { visibility: hidden; }
.labels {
  width: 100%; margin-top: 14px; display: grid; gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}
.labels button { padding: .8em .4em; font-size: 1.05rem; font-weight: 500; min-height: 48px; }
.labels button[data-label="neutral"] { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .labels { grid-template-columns: repeat(7, 1fr); }
  .labels button { font-size: .98rem; }
  .labels button[data-label="neutral"] { grid-column: auto; }
}
@media (hover: hover) { .labels button:not(:disabled):hover { background: #eef3f8; } }
.note { color: #8a5a00; font-size: .9rem; text-align: center; }
