/* Form styles, copied from register.html (which keeps its own inline copy). */

  :root {
    --ground: #F7F8FB;
    --surface: #FFFFFF;
    --ink: #14171E;
    --ink-soft: #3D4453;
    --pencil: #676E7D;
    --pencil-faint: #949BAA;
    --rule: #E1E4EB;
    --rule-strong: #C9CFDA;
    --pen: #2547A8;
    --pen-bright: #2E58CC;
    --pen-wash: #ECF1FC;
    --keep: #2E6B4F;
    --keep-wash: #ECF6F0;
    --warn: #A32C2C;
    --warn-wash: #FAEEED;
    --on-accent: #FFFFFF;
    --shadow: 0 1px 2px rgba(20,23,30,.04), 0 8px 24px rgba(20,23,30,.06);

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  }

  /* Light is the default. Dark applies only when the reader asks for it,
     via the toggle, which stamps data-theme on the root element. */
  :root[data-theme="dark"] {
    --ground: #0E1015;
    --surface: #151921;
    --ink: #E9EBF0;
    --ink-soft: #C0C6D2;
    --pencil: #99A0AF;
    --pencil-faint: #6F7787;
    --rule: #242935;
    --rule-strong: #3A4150;
    --pen: #8AA6F2;
    --pen-bright: #9DB5F7;
    --pen-wash: #181E2D;
    --keep: #7FBF9E;
    --keep-wash: #14211B;
    --warn: #E8908C;
    --warn-wash: #2A1B1B;
    --on-accent: #0E1015;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }

  * { box-sizing: border-box; }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.6;
    margin: 0;
    padding: 0 1.5rem 5rem;
    -webkit-font-smoothing: antialiased;
  }

  .wrap { max-width: 47rem; margin: 0 auto; }

  .eyebrow {
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--pen);
    margin: 0;
  }

  /* ---------- top bar ---------- */

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 0 0;
  }

  .brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }

  .brand img {
    height: 2.1rem;
    width: auto;
    max-width: 60vw;
    display: block;
  }

  /* The mark is black type on transparency, so on the dark ground it needs
     its own light plate rather than an invert filter that would wreck the blue. */
  :root[data-theme="dark"] .brand img {
    background: #fff;
    padding: .3rem .45rem;
    border-radius: 3px;
  }

  @media (max-width: 26rem) {
    .brand img { height: 1.7rem; }
    .brand span { display: none; }
  }

  .brand span {
    font-family: var(--mono);
    font-size: .63rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pencil);
    line-height: 1.35;
  }

  .theme-toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 1px solid var(--rule-strong);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 3px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
  }

  .theme-toggle:hover { border-color: var(--pen); color: var(--pen); }
  .theme-toggle:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
  .theme-toggle svg { width: 1.05rem; height: 1.05rem; display: block; }

  .theme-toggle .i-sun { display: none; }
  :root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
  :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

  /* ---------- masthead ---------- */

  header.top {
    padding: 2.25rem 0 2rem;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 2.5rem;
  }

  header.top h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 5.5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -.018em;
    font-weight: 600;
    text-wrap: balance;
    margin: 1.2rem 0 0;
  }

  header.top .deck {
    font-size: 1.02rem;
    color: var(--ink-soft);
    margin: 1rem 0 0;
    max-width: 38rem;
  }

  .logistics {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.6rem;
    margin: 1.5rem 0 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid var(--rule);
    font-size: .88rem;
    color: var(--pencil);
  }

  .logistics b { color: var(--ink); font-weight: 600; }

  /* ---------- form structure ---------- */

  form { display: flex; flex-direction: column; gap: 2.75rem; }

  section.grp { display: flex; flex-direction: column; gap: 1.75rem; }

  .grp-head {
    display: flex;
    align-items: baseline;
    gap: .8rem;
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: .5rem;
  }

  .grp-head h2 {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
  }

  .grp-head .n {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pencil-faint);
    margin-left: auto;
  }

  fieldset {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
  }

  .q { display: flex; flex-direction: column; gap: .65rem; }

  legend, .qlabel {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink);
    padding: 0;
    display: block;
  }

  .req {
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--pencil-faint);
    margin-left: .5rem;
    vertical-align: middle;
    white-space: nowrap;
  }

  .req.opt { color: var(--keep); }

  .help {
    font-size: .88rem;
    color: var(--pencil);
    margin: -.15rem 0 0;
  }

  /* ---------- text inputs ---------- */

  input[type="text"], input[type="email"], textarea {
    font: inherit;
    font-size: .97rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 3px;
    padding: .65rem .8rem;
    width: 100%;
    max-width: 32rem;
    transition: border-color .15s ease, box-shadow .15s ease;
  }

  textarea { max-width: 100%; min-height: 6.5rem; resize: vertical; }

  input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    outline: none;
    border-color: var(--pen);
    box-shadow: 0 0 0 3px var(--pen-wash);
  }

  /* ---------- choice chips ---------- */

  .scale { display: flex; flex-wrap: wrap; gap: .5rem; }

  .scale label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
  }

  .scale input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
  }

  .scale span {
    display: inline-block;
    border: 1px solid var(--rule-strong);
    background: var(--surface);
    border-radius: 3px;
    padding: .45rem .85rem;
    font-size: .89rem;
    color: var(--ink-soft);
    line-height: 1.35;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
  }

  .scale label:hover span { border-color: var(--pen); color: var(--ink); }

  .scale input:checked + span {
    background: var(--pen);
    border-color: var(--pen);
    color: var(--on-accent);
    font-weight: 600;
  }

  .scale input:focus-visible + span {
    outline: 2px solid var(--pen);
    outline-offset: 2px;
  }

  /* ---------- rating rows ---------- */

  .rate {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 1rem 1.1rem;
    gap: .7rem;
  }

  .rate legend {
    font-size: 1rem;
    font-weight: 500;
    float: left;
    width: 100%;
    margin-bottom: .7rem;
  }

  .rate .scale span { font-size: .84rem; padding: .38rem .7rem; }

  .rates { display: flex; flex-direction: column; gap: .75rem; }

  /* ---------- validation ---------- */

  .q.invalid .qlabel,
  fieldset.invalid legend { color: var(--warn); }

  .q.invalid input[type="text"],
  .q.invalid input[type="email"],
  .q.invalid textarea { border-color: var(--warn); }

  .err {
    font-size: .85rem;
    color: var(--warn);
    font-weight: 500;
    margin: 0;
  }

  .err:empty { display: none; }

  /* ---------- honeypot ---------- */

  .hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* ---------- submit ---------- */

  .submit-row {
    border-top: 2px solid var(--ink);
    padding-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  button.btn {
    font: inherit;
    font-weight: 600;
    font-size: .98rem;
    background: var(--pen);
    color: var(--on-accent);
    border: none;
    border-radius: 3px;
    padding: .85rem 1.9rem;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
  }

  button.btn:hover:not(:disabled) { background: var(--pen-bright); transform: translateY(-1px); }
  button.btn:disabled { opacity: .55; cursor: progress; transform: none; }
  button.btn:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }

  #status { margin: 0; font-size: .92rem; color: var(--pencil); }
  #status.bad { color: var(--warn); font-weight: 500; }

  /* ---------- success ---------- */

  #done {
    border: 1px solid var(--keep);
    background: var(--keep-wash);
    border-radius: 4px;
    padding: 2.25rem 2rem;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
  }

  #done h2 {
    font-family: var(--serif);
    font-size: 1.65rem;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
  }

  #done p { margin: 0; color: var(--ink-soft); max-width: 38rem; }
  #done ul { margin: .2rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); }
  #done li { margin-bottom: .35rem; }

  [hidden] { display: none !important; }

  footer.foot {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .05em;
    color: var(--pencil-faint);
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.75rem;
  }

  a { color: var(--pen); }
  a:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

  @media (max-width: 34rem) {
    body { padding: 0 1.1rem 4rem; }
    .scale span { font-size: .86rem; }
  }
