:root {
  --ink: #17211c;
  --paper: #f2efe6;
  --sheet: #fffdf7;
  --moss: #315c48;
  --moss-dark: #214234;
  --thread: #d84a3a;
  --thread-text: #b43629;
  --line: #d9d3c5;
  --muted: #59615b;
  --error: #a52d25;
  --serif: "Shippori Mincho", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --mono: "DM Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: .025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  color: white;
  background: var(--ink);
}
.skip-link:focus { top: 1rem; }

.masthead {
  min-height: 76px;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid rgba(23, 33, 28, .18);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--sheet);
  background: var(--ink);
  font-size: .9rem;
  line-height: 1;
  transform: rotate(-3deg);
}
.masthead > p {
  margin: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font: .68rem var(--mono);
  letter-spacing: .16em;
}
.draft-state {
  margin-left: auto;
  color: var(--muted);
  font-size: .72rem;
}

.layout {
  width: min(1240px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 7.5rem) 0 6rem;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 760px);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: start;
}
.editorial-rail {
  position: sticky;
  top: 3rem;
  container-type: inline-size;
  opacity: 0;
  animation: reveal .6s .08s ease-out forwards;
}
.eyebrow, .sheet-number, .memo-label {
  margin: 0 0 1.3rem;
  color: var(--thread-text);
  font: 500 .7rem var(--mono);
  letter-spacing: .12em;
}
.editorial-rail h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 14cqi, 3.3rem);
  line-height: 1.38;
  letter-spacing: -.03em;
}
.title-phrase { white-space: nowrap; }
.lead {
  margin: 2rem 0 3.25rem;
  max-width: 32rem;
  color: #4e5852;
  font-size: .95rem;
}
.lead .title-phrase { display: inline-block; }
.steps {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--line);
}
.steps li { position: relative; }
.steps button {
  width: 100%;
  padding: .68rem 0 .68rem 2.7rem;
  border: 0;
  color: var(--muted);
  background: none;
  text-align: left;
  cursor: default;
}
.steps button span {
  position: absolute;
  left: 0;
  top: .85rem;
  width: 25px;
  height: 25px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font: .56rem var(--mono);
}
.steps li.is-active button { color: var(--ink); font-weight: 700; }
.steps li.is-active button span { color: white; border-color: var(--thread-text); background: var(--thread-text); }
.steps li.is-complete button { cursor: pointer; color: var(--moss); }
.steps li.is-complete button span { color: white; border-color: var(--moss); background: var(--moss); }
.rail-note {
  margin: 2.4rem 0 0 2.7rem;
  color: var(--muted);
  font-size: .72rem;
}
.rail-note .title-phrase { display: inline-block; }

.workbench {
  position: relative;
  min-height: 720px;
  padding: clamp(2rem, 5vw, 4.6rem);
  background: var(--sheet);
  border: 1px solid rgba(23, 33, 28, .13);
  box-shadow: 14px 14px 0 rgba(49, 92, 72, .08), 0 28px 70px rgba(23, 33, 28, .08);
  opacity: 0;
  transform: translateY(18px);
  animation: reveal .7s .18s ease-out forwards;
}
.workbench::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(1rem, 2.5vw, 2.2rem);
  width: 1px;
  height: 100%;
  background: rgba(216, 74, 58, .3);
}
.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}
.sheet-heading h2, .success h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.45;
  letter-spacing: -.02em;
}
.sheet-heading h2 .title-phrase { display: inline-block; }
.text-button {
  flex: 0 0 auto;
  padding: .15rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  background: transparent;
  font-size: .72rem;
  cursor: pointer;
}
.form-message {
  margin: 1.5rem 0 0;
  padding: .8rem 1rem;
  color: var(--error);
  border-left: 3px solid var(--error);
  background: #fff3ef;
  font-size: .88rem;
}
.panel {
  min-width: 0;
  margin: 0;
  padding: 2.8rem 0 0;
  border: 0;
  animation: panel-in .26s ease-out;
}
.field { margin-bottom: 2.4rem; }
.field > label, .field > .label {
  display: block;
  margin-bottom: .6rem;
  font-size: .94rem;
  font-weight: 700;
}
.required {
  margin-left: .4rem;
  color: var(--thread-text);
  font: .62rem var(--mono);
}

.choice-group { min-width: 0; padding: 0; border: 0; }
.choice-group > legend { display: block; width: 100%; margin-bottom: .55rem; font-weight: 700; }
.intake-summary, .privacy-note { color: var(--muted); font-size: .9rem; line-height: 1.75; }
.intake-summary { margin: 1rem 0 1.4rem; }
.privacy-note { margin-top: 1.4rem; padding: 1rem 1.1rem; border-left: 3px solid var(--moss); background: rgba(66, 94, 75, .06); }
.privacy-note p { margin: .35rem 0 0; }
.steps button:disabled { cursor: default; opacity: .58; }
.hint {
  margin: -.2rem 0 .65rem;
  color: var(--muted);
  font-size: .76rem;
}
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #a8aaa2;
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  transition: border-color .18s, box-shadow .18s;
}
input[type="text"], input[type="email"], input[type="tel"], select {
  min-height: 48px;
  padding: .6rem .15rem;
}
textarea { min-height: 110px; padding: .7rem .15rem; resize: vertical; line-height: 1.75; }
select { cursor: pointer; }
input:focus, textarea:focus, select:focus {
  border-color: var(--moss);
  box-shadow: 0 2px 0 var(--moss);
}
[aria-invalid="true"] { border-color: var(--error) !important; }
.error { min-height: 1.2em; margin: .4rem 0 0; color: var(--error); font-size: .72rem; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; }
.field-meta > span { margin-top: .4rem; color: var(--muted); font: .64rem var(--mono); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.compact-field { max-width: 50%; }

.choice-grid, .tag-grid { display: grid; gap: .7rem; }
.choice-grid { grid-template-columns: 1fr 1fr; }
.tag-grid { grid-template-columns: repeat(3, 1fr); }
.choice input, .tag-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span, .tag-grid label > span {
  min-height: 100%;
  display: flex;
  border: 1px solid var(--line);
  background: rgba(242, 239, 230, .24);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.choice > span { padding: 1rem 1.1rem; flex-direction: column; }
.choice b { font-size: .86rem; }
.choice small { margin-top: .25rem; color: var(--muted); font-size: .68rem; }
.tag-grid label > span { min-height: 48px; align-items: center; justify-content: center; padding: .65rem; font-size: .76rem; text-align: center; }
.choice input:checked + span, .tag-grid input:checked + span {
  border-color: var(--moss);
  background: #edf2ec;
  box-shadow: inset 3px 0 0 var(--moss);
}
.choice input:focus-visible + span, .tag-grid input:focus-visible + span, .consent input:focus-visible {
  outline: 3px solid rgba(216, 74, 58, .28);
  outline-offset: 2px;
}
.choice > span:hover, .tag-grid label > span:hover { border-color: var(--moss); transform: translateY(-1px); }
.consent { display: flex; align-items: flex-start; gap: .7rem; font-size: .82rem; cursor: pointer; }
.consent input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: .3rem; accent-color: var(--moss); }
.human-check {
  max-width: 34rem;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(242, 239, 230, .24);
  transition: border-color .2s ease, background-color .2s ease;
}
.human-check.is-checking { border-color: var(--moss); }
.human-check.is-complete { border-color: var(--moss); background: rgba(104, 128, 111, .09); }
.human-check.is-complete .human-check-status::before { content: "✓ "; font-weight: 700; color: var(--moss); }
.human-check.is-error { border-color: var(--red); }
.human-check-status { margin: .5rem 0 0 1.55rem; color: var(--muted); font-size: .72rem; line-height: 1.6; }
.human-check .error { margin-left: 1.55rem; }

.actions { display: flex; justify-content: flex-end; gap: .8rem; padding-top: 2.8rem; border-top: 1px solid var(--line); }
.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: .8rem 1.3rem;
  border: 1px solid var(--moss);
  border-radius: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .text-button:focus-visible, .steps button:focus-visible, .history-open:focus-visible { outline: 3px solid rgba(216, 74, 58, .35); outline-offset: 3px; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { margin-left: auto; min-width: 190px; color: white; background: var(--moss); }
.button-primary:hover { background: var(--moss-dark); }
.button-primary span { color: #ff8d7f; }
.button-secondary { color: var(--moss); background: transparent; }

.review { padding-top: 2.7rem; }
.review h3 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.2rem) var(--serif); }
.review-intro { margin: .7rem 0 2.6rem; color: var(--muted); font-size: .84rem; }
.review-group { position: relative; padding: 1.4rem 5rem 1.4rem 0; border-top: 1px solid var(--line); }
.review-group:last-child { border-bottom: 1px solid var(--line); }
.review-group dt { margin-bottom: .3rem; color: var(--muted); font: .66rem var(--mono); letter-spacing: .08em; }
.review-group dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-edit { position: absolute; top: 1.35rem; right: 0; border: 0; border-bottom: 1px solid; color: var(--moss); background: transparent; font-size: .7rem; cursor: pointer; }

.success { padding: 5rem 0 1rem; text-align: center; }
.success-mark { width: 58px; height: 58px; margin: 0 auto 2rem; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--moss); font-size: 1.5rem; }
.success > p:not(.success-mark):not(.sheet-number) { max-width: 32rem; margin: 1.3rem auto 2.2rem; color: var(--muted); }
.success dl { width: min(100%, 390px); margin: 0 auto 2.5rem; padding: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.success dt { color: var(--muted); font-size: .7rem; }
.success dd { margin: .25rem 0 0; font: 500 .83rem var(--mono); overflow-wrap: anywhere; }
.request-history { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.request-history h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.request-history > p { margin: 0 0 1rem; color: var(--muted); }
.request-history ul { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.request-history li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line); font: 500 .75rem var(--mono); overflow-wrap: anywhere; }
.history-open { flex: 0 0 auto; border: 0; border-bottom: 1px solid currentColor; padding: .25rem 0; color: var(--moss); background: transparent; font: 700 .78rem var(--sans); cursor: pointer; }

.honey { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
footer { padding: 1.5rem clamp(1.25rem, 4vw, 4.5rem); display: flex; justify-content: space-between; border-top: 1px solid rgba(23, 33, 28, .18); color: var(--muted); font: .62rem var(--mono); letter-spacing: .12em; }

.policy-layout {
  width: min(860px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) 0;
}
.policy-sheet {
  padding: clamp(1.6rem, 5vw, 4.5rem);
  border: 1px solid var(--line);
  background: var(--sheet);
  box-shadow: 12px 12px 0 rgba(49, 92, 72, .08);
}
.policy-sheet h1 { margin: 0 0 1rem; font: 700 clamp(2rem, 6vw, 3.8rem)/1.35 var(--serif); }
.policy-lead { margin: 0 0 3.5rem; color: var(--muted); }
.policy-section { padding: 2rem 0; border-top: 1px solid var(--line); }
.policy-section h2 { margin: 0 0 1rem; font: 600 1.3rem/1.5 var(--serif); }
.policy-section p, .policy-section li { color: #4e5852; }
.policy-section ul { margin: .75rem 0 0; padding-left: 1.4rem; }
.policy-section a, .policy-back { color: var(--moss); text-underline-offset: .18em; }
.policy-meta { margin: 2.5rem 0 0; color: var(--muted); font-size: .82rem; }
.policy-back { display: inline-block; margin-bottom: 1.5rem; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1024px) {
  .masthead { min-height: 64px; gap: 1rem; }
  .masthead > p { display: none; }
  .layout { width: min(100% - 2rem, 680px); padding-top: 2.4rem; display: block; }
  .editorial-rail { position: static; }
  .editorial-rail h1 { font-size: clamp(2rem, 9vw, 3rem); }
  .lead { margin: 1.2rem 0 2rem; }
  .steps { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 1.4rem; }
  .steps::before { left: 10%; right: 10%; top: 12px; bottom: auto; width: auto; height: 1px; }
  .steps button { padding: 2.1rem .1rem 0; text-align: center; font-size: .62rem; white-space: nowrap; }
  .steps button span { top: 0; left: 50%; transform: translateX(-50%); }
  .rail-note { display: none; }
  .workbench { min-height: 0; padding: 2rem 1.5rem 2.3rem; box-shadow: 8px 8px 0 rgba(49, 92, 72, .08); }
  .workbench::before { left: .75rem; }
}

@media (max-width: 560px) {
  .masthead { padding-inline: 1rem; }
  .draft-state { max-width: 9rem; text-align: right; line-height: 1.35; }
  .layout { width: calc(100% - 1rem); }
  .eyebrow { margin-bottom: .8rem; }
  .editorial-rail { padding: 0 .55rem; }
  .lead { font-size: .85rem; }
  .steps button { font-size: 0; }
  .steps button span { font-size: .56rem; }
  .workbench { padding: 1.65rem 1.35rem 2rem; }
  .sheet-heading { flex-direction: column; gap: .8rem; padding-bottom: 1.5rem; }
  .sheet-heading > div { width: 100%; }
  .sheet-heading .text-button { align-self: flex-end; }
  .sheet-heading h2 { font-size: 1.48rem; }
  .sheet-number { margin-bottom: .8rem; }
  .panel { padding-top: 2rem; }
  .field { margin-bottom: 2rem; }
  .choice-grid, .two-columns { grid-template-columns: 1fr; gap: .7rem; }
  .tag-grid { grid-template-columns: 1fr 1fr; }
  .compact-field { max-width: none; }
  .actions { flex-wrap: wrap; }
  .button { flex: 1; padding-inline: .9rem; gap: .7rem; }
  .button-primary { min-width: 175px; }
  .request-history li { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
