  :root {
    --paper: #f3efe6;
    --sheet: #fbf9f4;
    --ink: #1d2430;
    --muted: #5d6470;
    --rule: #b9b2a3;
    --stamp: #8a2b22;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--paper); color: var(--ink);
    font-family: var(--serif); font-size: 17px; line-height: 1.55;
  }
  .page { max-width: 640px; margin: 0 auto; padding: 28px 20px 56px; }

  header { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 3px double var(--ink); }
  #sigil { width: 54px; height: 54px; flex: none; cursor: default; background: none; border: 0; padding: 0; color: var(--ink); }
  .org { font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: .01em; }
  .dept { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

  .ref { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 26px; }

  h1 { font-size: 26px; line-height: 1.2; margin: 0 0 14px; font-weight: 700; }
  p { margin: 0 0 14px; }
  .lede { font-size: 18px; }
  .quiet { color: var(--muted); font-size: 15px; }

  dl.facts { margin: 22px 0 30px; border-top: 1px solid var(--rule); }
  dl.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
  dl.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
  dl.facts dd { margin: 0; }

  form, .receipt { background: var(--sheet); border: 1px solid var(--ink); padding: 20px 18px 22px; }
  .formhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
  .formhead strong { font-size: 18px; }
  .formhead span { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

  .item { margin-bottom: 18px; border: 0; padding: 0; min-width: 0; }
  .item > label, .item > legend { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; padding: 0; }
  .item .n { color: var(--muted); margin-right: 6px; }
  input[type=text], input[type=email], select, textarea {
    width: 100%; font: inherit; font-family: var(--mono); font-size: 16px; color: var(--ink);
    background: #fff; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink);
    border-radius: 0; padding: 10px; -webkit-appearance: none; appearance: none;
  }
  textarea { min-height: 76px; resize: vertical; }
  input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .slot input:focus-visible + span {
    outline: 2px solid var(--stamp); outline-offset: 2px;
  }

  .slot { display: block; margin-bottom: 6px; cursor: pointer; }
  .slot input { position: absolute; opacity: 0; }
  .slot span { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); background: #fff; }
  .slot b { font-weight: 600; }
  .slot small { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
  .slot input:checked + span { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--ink); }
  .slot.full { cursor: not-allowed; }
  .slot.full span { color: var(--muted); background: transparent; text-decoration: line-through; }
  .slot.full small { text-decoration: none; display: inline-block; }

  .trap { position: absolute; left: -9999px; }

  button.submit {
    width: 100%; font-family: var(--mono); font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
    background: var(--ink); color: var(--sheet); border: 0; border-radius: 0; padding: 15px; cursor: pointer;
  }
  button.submit[disabled] { opacity: .55; cursor: wait; }
  .error { font-family: var(--mono); font-size: 13px; color: var(--stamp); margin: 0 0 14px; }
  .error:empty { display: none; }

  .receipt { position: relative; }
  .receipt .big { font-family: var(--mono); font-size: 34px; letter-spacing: .06em; margin: 6px 0 14px; }
  .stamp {
    display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--stamp); border: 2px solid var(--stamp); padding: 4px 10px; transform: rotate(-3deg); margin-bottom: 12px;
  }

  .preview { font-family: var(--mono); font-size: 12px; background: #fff3c4; border: 1px dashed #8a6d00; color: #5c4800; padding: 8px 10px; margin-bottom: 18px; }

  footer { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
  footer a { color: inherit; }
  [hidden] { display: none !important; }

  /* --- multi-page additions --- */
  a.submit { display: block; text-align: center; text-decoration: none; font-family: var(--mono); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: var(--sheet); padding: 15px; margin-top: 8px; }
  h2 { font-size: 19px; margin: 28px 0 8px; }
  .back { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
  .back a, footer a { color: inherit; }
  footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  footer nav a[aria-current] { text-decoration: none; font-weight: 700; }
  ul.plain { list-style: none; padding: 0; margin: 0 0 14px; border-top: 1px solid var(--rule); }
  ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; }
  ul.plain small { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
  dl.faq dt { font-weight: 700; margin-top: 14px; }
  dl.faq dd { margin: 2px 0 0; }
  .unseen { color: var(--paper); }
  .unseen::selection { color: var(--sheet); background: var(--ink); }

  /* --- top bar (all Foundation pages) --- */
  .topbar { position: sticky; top: 0; z-index: 10; background: var(--sheet); border-bottom: 3px double var(--ink); }
  .topbar-inner { max-width: 960px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
  /* Emblem: /emblem.svg used as a mask so it takes the text colour (dark bar on home, light bar elsewhere) */
  .topbar #sigil { width: 38px; height: 38px; background-color: currentColor;
    -webkit-mask: url(/emblem.svg) center / contain no-repeat; mask: url(/emblem.svg) center / contain no-repeat; }
  .topbar .brand { font-weight: 700; font-size: 15px; line-height: 1.2; color: inherit; text-decoration: none; margin-right: auto; }
  .topbar .brand span { font-weight: 400; color: var(--muted); }
  .topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
  .topbar nav a { color: inherit; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
  .topbar nav a:hover { border-bottom-color: var(--rule); }
  .topbar nav a[aria-current] { font-weight: 700; border-bottom-color: var(--ink); }
  @media (max-width: 560px) { .topbar .brand span { display: none; } }

  /* --- home: animated emblem (see home.js) --- */
  body.home { background: var(--paper); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .stage { --glow: 29, 36, 48; position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, var(--sheet) 0%, var(--paper) 60%, #e6e0d2 100%); }
  #motes { position: absolute; inset: 0; width: 100%; height: 100%; }
  .scan { position: absolute; left: 0; right: 0; top: 0; height: 22%; pointer-events: none;
    background: linear-gradient(transparent, rgba(var(--glow), .045), transparent); animation: scan 9s linear infinite; }
  .emblem { position: relative; width: min(70vmin, 540px); aspect-ratio: 1; }
  .emblem svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; animation: breathe 7s ease-in-out infinite, flicker 13s linear infinite; }
  .mark { fill: var(--ink); }
  .pupil { fill: var(--ink); transform-box: fill-box; transform-origin: center; animation: heartbeat 6s ease-in-out infinite; }
  .ghost { opacity: 0; mix-blend-mode: multiply; }
  .ga { fill: #c2453a; animation: glitch-a 9s steps(1) infinite; }
  .gb { fill: #3a64b8; animation: glitch-b 9s steps(1) infinite; }
  .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(var(--glow), .35); opacity: 0; pointer-events: none;
    animation: ripple 6s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: calc(var(--i) * 1.5s); }

  @keyframes ripple { 0% { transform: scale(.2); opacity: 0; } 8% { opacity: .6; } 100% { transform: scale(3.4); opacity: 0; } }
  @keyframes breathe { 0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--glow), 0)); } 50% { filter: drop-shadow(0 4px 14px rgba(var(--glow), .28)); } }
  @keyframes heartbeat { 0%, 100% { transform: scale(1); } 6% { transform: scale(1.14); } 14% { transform: scale(.96); } 22% { transform: scale(1); } }
  @keyframes flicker { 0%, 61%, 65%, 100% { opacity: 1; } 62% { opacity: .55; } 63% { opacity: .95; } 64% { opacity: .4; } }
  @keyframes glitch-a { 0%, 90%, 94%, 100% { opacity: 0; transform: none; } 91% { opacity: .8; transform: translate(70px, 0); } 92% { opacity: .8; transform: translate(-50px, 20px); } 93% { opacity: .6; transform: translate(30px, -10px); } }
  @keyframes glitch-b { 0%, 90%, 94%, 100% { opacity: 0; transform: none; } 91% { opacity: .8; transform: translate(-70px, 0); } 92% { opacity: .8; transform: translate(50px, -20px); } 93% { opacity: .6; transform: translate(-30px, 10px); } }
  @keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(460%); } }

  @media (prefers-reduced-motion: reduce) {
    .scan, .ring, .ghost, .pupil, .emblem svg { animation: none; }
    .ring { display: none; }
  }
