/* Deliberately neutral styling, so the survey frame does not favour any version. */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #d9d9d6;
  --accent: #2f3a44;
  --focus: #1a73e8;
  --ok: #1e6b3a;
  --bad: #a1261b;
  --on-accent: #fff;
  --field-line: #b9b9b5;
  --head: #efefec;
  --chip: #e9e9e6;
  color-scheme: light;
}
/* Dark mode follows the device setting unless the toggle (theme.js) has set
   data-theme. It styles the lab's own pages only; the versions inside frames
   keep their own colours. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121314;
    --surface: #1c1d1f;
    --text: #ececec;
    --muted: #a3a7ad;
    --line: #34363a;
    --accent: #c8d3de;
    --focus: #8ab4f8;
    --ok: #6fcf8f;
    --bad: #f28b82;
    --on-accent: #121314;
    --field-line: #6b6e73;
    --head: #25272a;
    --chip: #2c2e31;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121314;
  --surface: #1c1d1f;
  --text: #ececec;
  --muted: #a3a7ad;
  --line: #34363a;
  --accent: #c8d3de;
  --focus: #8ab4f8;
  --ok: #6fcf8f;
  --bad: #f28b82;
  --on-accent: #121314;
  --field-line: #6b6e73;
  --head: #25272a;
  --chip: #2c2e31;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { width: min(100% - 32px, 720px); margin: 0 auto; padding: 32px 0 64px; }
.theme-bar { width: min(100% - 32px, 1200px); margin: 0 auto; padding-top: 12px; display: flex; justify-content: flex-end; }
.theme-bar + main { padding-top: 12px; }
.theme-toggle { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 .875rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
main.wide { width: min(100% - 32px, 1200px); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 0 0 16px; }
.card > h2:first-child { margin-top: 0; }
.narrow { max-width: 420px; margin: 10vh auto 0; }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin: 0 0 24px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.step-label { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem; }

label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input[type="text"], input[type="password"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 88px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin: 0 0 .5rem; }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.choice + .choice { margin-top: 8px; }
.choice input { margin-top: .3em; flex: none; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale .choice { justify-content: center; padding: 10px 0; flex-direction: column; align-items: center; gap: 4px; }
.scale .choice input { margin: 0; }
.scale .choice + .choice, .thumbs .choice + .choice { margin-top: 0; }
.choice .name { flex: 1; display: grid; gap: 6px; }
.scale-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 4px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 1rem/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.error { color: var(--bad); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: .75rem 0 0; cursor: pointer; }
.check input { margin-top: .3em; flex: none; width: 18px; height: 18px; }
.share input[readonly] { font-variant-numeric: tabular-nums; }
.pitches { list-style: none; padding: 0; margin: 0; }
.pitches > li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.pitches > li + li { margin-top: 12px; }
.pitches h3 { margin: .25rem 0 .5rem; }
.pitches .text { white-space: pre-wrap; margin: 0 0 .75rem; }
.pitches .review { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.pitches .review label { margin: 0 0 .25rem; }
.pitches .review .grow { flex: 1 1 240px; }
.pitches .review textarea { min-height: 44px; }
.rules ol { padding-left: 1.25rem; }
.rules li + li { margin-top: .5rem; }
.placeholder { background: var(--chip); border-radius: 4px; padding: 0 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Full-viewport version viewer used by the survey. */
.viewer { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.viewer .frame-wrap { flex: 1; position: relative; }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: #111; color: #fff; font-size: .9rem; }
.viewer .bar .button { min-height: 40px; background: #fff; color: #111; }
.viewer.locked iframe { pointer-events: none; }
.countdown { font-variant-numeric: tabular-nums; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); }

.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.rank-list li + li { margin-top: 8px; }
.rank-list .pos { font-weight: 700; width: 1.5em; }
.rank-list .name { flex: 1; }
.rank-list button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 8px; font: inherit; cursor: pointer; }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thumbs .choice { flex-direction: column; align-items: stretch; padding: 8px; }
.thumbs img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); display: block; }
.swatches { display: flex; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.swatches span { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--head); }
tbody th { background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 0 0 16px; }
.toolbar label { margin: 0 0 .25rem; }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere; }
.comments li + li { margin-top: 8px; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); margin-right: 6px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare .pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.compare .frame { height: 75vh; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.compare iframe { border: 0; display: block; transform-origin: 0 0; }
@media (max-width: 700px) {
  .compare { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}

/* Owner sign-in and passkeys. */
.fallback { margin-top: 20px; }
.card form .button { margin-top: 16px; }
.fallback summary { cursor: pointer; color: var(--accent); }
.passkeys { margin-top: 40px; }
.passkeys h2 { margin-top: 0; }
.plain { list-style: none; padding: 0; margin: 0 0 16px; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.card .error:empty, .passkeys .muted:empty { display: none; }
