:root {
  --ink: #1b1510;
  --paper: #f4ecd9;
  --paper-2: #efe4ce;
  --cream: #fffaf1;
  --night: #100d0a;
  --night-2: #1c1612;
  --gold: #c49a5a;
  --gold-deep: #8d6a32;
  --wine: #7a322c;
  --sage: #3f5344;
  --muted: #6d5f51;
  --rule: #d7c9ae;
  --focus: #1b4d4a;
  --shadow: 0 18px 50px rgba(16, 13, 10, 0.18);
  --serif: "Fraunces", "Palatino Linotype", Palatino, serif;
  --body: "Source Serif 4", Georgia, serif;
  --ui: "Figtree", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

html, body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--cream);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { left: 8px; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: linear-gradient(180deg, #16110e 0%, #100d0a 100%);
  color: var(--paper);
  padding: 28px 20px 40px;
  border-right: 1px solid #2a221c;
}

.mark {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}

.sidebar h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0 0 10px;
  font-optical-sizing: auto;
}

.sidebar .lede {
  color: #d8cbb6;
  font-size: 0.92rem;
  margin: 0 0 22px;
}

.sidebar nav { display: grid; gap: 4px; }
.sidebar a {
  color: #efe4ce;
  text-decoration: none;
  font-family: var(--ui);
  font-size: 0.92rem;
  padding: 8px 10px;
  border-radius: 8px;
}
.sidebar a:hover, .sidebar a:focus-visible, .sidebar a[aria-current] {
  background: #2a221c;
  color: white;
  outline: none;
}

.privacy {
  margin-top: 24px;
  padding: 12px;
  border: 1px solid #3a3028;
  border-radius: 10px;
  color: #cbbba4;
  font-family: var(--ui);
  font-size: 0.78rem;
  line-height: 1.45;
}

.stage {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(196,154,90,0.12), transparent 50%),
    linear-gradient(180deg, #2a2119 0%, #1a1511 28%, #f4ecd9 28%);
  min-width: 0;
}

.hero, .panel, .names {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  color: var(--paper);
  padding: 56px 0 48px;
}

.kicker {
  font-family: var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  margin: 0 0 12px;
}

.hero h2 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 16px;
}

.hero p {
  max-width: 46rem;
  font-size: 1.15rem;
  color: #efe6d6;
  margin: 0;
}

.names {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 28px auto 0;
}

label.field {
  display: grid;
  gap: 6px;
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d8cbb6;
}

input, textarea, select {
  font: inherit;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
}

.names input {
  background: #2a221c;
  color: var(--paper);
  border-color: #4a3d32;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

button, .btn {
  font-family: var(--ui);
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-gold, button.primary {
  background: var(--gold);
  color: var(--night);
  font-weight: 700;
}
.btn-ghost, button.ghost {
  background: transparent;
  color: var(--paper);
  border-color: #6a5a48;
}
.paper-actions button.ghost {
  color: var(--ink);
  border-color: var(--rule);
}

.panel {
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 28px 0 80px;
}

section.block {
  padding: 28px 8px 8px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}
section.block:first-of-type { border-top: 0; }

h3 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 8px;
}

h4 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 22px 0 8px;
  font-weight: 600;
}

.sub {
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 46rem;
}

.grid-2, .grid-3 {
  display: grid;
  gap: 14px;
}
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}

.card h4 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.2rem; }
li { margin: 0.35rem 0; }

.callout {
  border-left: 4px solid var(--wine);
  background: #f8e8dc;
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  margin: 16px 0;
}

.callout.sage {
  border-left-color: var(--sage);
  background: #e7eee6;
}

.checklists label.item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-family: var(--ui);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
}

.checklists input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--sage);
}

.diagram {
  background: #221b16;
  color: #f4ecd9;
  border-radius: 16px;
  padding: 16px;
  overflow: auto;
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption {
  font-family: var(--ui);
  font-size: 0.82rem;
  color: #d8cbb6;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--cream);
  border-radius: 12px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #e9dcc4;
}

blockquote {
  margin: 16px 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--gold-deep);
  font-family: var(--serif);
  font-size: 1.2rem;
  color: #3d3126;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.status {
  font-family: var(--ui);
  font-size: 0.85rem;
  color: var(--sage);
  min-height: 1.2em;
}

.hero .status {
  color: #e8d4b0;
  margin: 10px 0 0;
}

.q-group { margin-bottom: 8px; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
  }
  .names, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .hero, .panel, .names { width: min(980px, calc(100% - 28px)); }
}

@media print {
  .sidebar, .toolbar, .paper-actions, .skip { display: none !important; }
  .app { display: block; }
  .stage, body, html { background: white; }
  .hero { color: black; padding: 0; }
  .panel { background: white; border-radius: 0; }
  .card { box-shadow: none; }
  a { color: black; }
}
