/*
 * The look. Owner-editable: change the tokens at the top for the owner's colours and type.
 * Plain and calm, one question at a time, readable on a phone. Targets are at least 44px.
 */
:root {
  --bg: #fbfaf7;
  --ink: #1d1d1b;
  --muted: #5d5a54;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --line: #d9d5cc;
  /* The edge of anything you type in or pick: at least 3:1 against --bg and --soft (WCAG 1.4.11). */
  --field: #858075;
  --soft: #f0ede6;
  --problem: #9b2c1f;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --ink: #f1efe9;
    --muted: #b6b1a6;
    --accent: #8cc7b3;
    --accent-ink: #10201b;
    --line: #3a3934;
    --field: #77746a;
    --soft: #23231f;
    --problem: #ff9b8c;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { font-size: 18px; line-height: 1.5; -webkit-text-size-adjust: 100%; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-embed { min-height: 0; }
.screen {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 12vh 16px 32px;
  animation: arrive 260ms ease-out;
}
.page-embed .screen { padding: 24px 16px; }
.screen-plain { padding-top: 20vh; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

.progress, .kicker { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.kind { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.kind a { color: var(--accent); }
.ask { font-size: clamp(24px, 4.5vw, 32px); line-height: 1.25; font-weight: 600; margin: 0 0 12px; }
.ask:focus { outline: none; }
.say { font-size: 20px; margin: 0 0 16px; }
.hint { color: var(--muted); margin: 0 0 16px; }
.problem { color: var(--problem); font-weight: 600; margin: 0 0 12px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

input[type='text'], input[type='email'], textarea {
  width: 100%;
  font: inherit;
  font-size: 22px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--field);
  padding: 10px 2px;
  border-radius: 0;
}
textarea { resize: vertical; min-height: 120px; border: 2px solid var(--field); border-radius: var(--radius); padding: 12px; font-size: 20px; }
input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); }
[aria-invalid='true'] { border-color: var(--problem); }

.options { display: grid; gap: 10px; margin: 8px 0 4px; }
.options-row { grid-template-columns: repeat(2, minmax(0, 220px)); }
.options-scale { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 6px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--field);
  border-radius: var(--radius);
  background: var(--soft);
  cursor: pointer;
}
.option-number { justify-content: center; padding: 10px 4px; }
.option input[type='radio'], .option input[type='checkbox'] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--soft)); }
.option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.key {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.option-other { flex-direction: column; align-items: stretch; cursor: default; }
.option-other-pick { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.option-other-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-other:has(input:checked) { border-color: var(--accent); }
.other-box { font-size: 18px !important; }
.scale-labels { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 15px; margin: 6px 0 0; }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 96px;
  padding: 0 22px; font: inherit; font-weight: 600; border-radius: var(--radius); border: 2px solid var(--accent);
  cursor: pointer; text-decoration: none;
}
.next { background: var(--accent); color: var(--accent-ink); }
.skip { background: transparent; color: var(--accent); }
.button:focus-visible, .back:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.back { color: var(--muted); padding: 12px 4px; min-height: 44px; display: inline-flex; align-items: center; }
form[aria-busy='true'] .next { cursor: progress; }
.keys-hint { color: var(--muted); font-size: 14px; margin-top: 14px; }
@media (hover: none) { .keys-hint, .key { display: none !important; } }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 16px; }

/*
 * Practice mode only (`npm run practice`): the line at the top of every page, and the answers
 * and emails pages. Never shown on the live site.
 */
.practice-banner {
  margin: 0;
  padding: 10px 16px;
  background: #f6e27a;
  color: #1d1d1b;
  font-size: 15px;
  text-align: center;
}
.practice-banner a { color: #1d1d1b; font-weight: 600; }
.practice { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; }
.practice h2 { font-size: 22px; margin: 32px 0 8px; }
.practice-item { border-top: 1px solid var(--line); padding: 16px 0; }
.practice pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); padding: 12px; border-radius: var(--radius); font-size: 15px; }
.practice-table { overflow-x: auto; }
.practice table { border-collapse: collapse; font-size: 15px; }
.practice th, .practice td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }

/* The one-question workshop embed belongs to a light checkout, regardless of device theme. */
:root:has(.page-embed #survey-form[action^="/s/ownmind-workshop/answer?embed=1"]) {
  color-scheme: light;
  --bg: #f3efe5;
  --ink: #17322e;
  --muted: #4d5b53;
  --accent: #27594d;
  --accent-ink: #fff;
  --line: #d9d5cc;
  --field: #737b70;
  --soft: #fbf8f1;
  --problem: #9b2c1f;
}
.page-embed #survey-form[action^="/s/ownmind-workshop/answer?embed=1"] > :is(.progress, .kind, #hint) {
  display: none;
}
