:root {
  --ink: #1a1a1a;
  --paper: #f6f1e4;
  --rule: #1a4480;
  --stamp: #c81d25;
  --canary: #ffe56a;
  --pink: #f3b7c8;
  --blotter: #1e3a30;
  --quiet: #3e4a44;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  padding: 12px 8px 28px;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(255, 255, 255, 0.07), transparent 46%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 8px),
    var(--blotter);
  color: var(--ink);
  font-family: "Courier Prime", "Courier New", Courier, monospace;
  font-size: 1.02rem;
  line-height: 1.45;
  overflow-x: clip;
}
a { color: var(--rule); }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
p, h1, h2, h3, li, pre { overflow-wrap: break-word; max-width: 100%; }

.frame {
  width: min(740px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  position: relative;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 7px 9px 0 rgba(0, 0, 0, 0.28);
  padding: 0 0.95rem 1.15rem 1.65rem;
}
.frame::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  border-right: 1px dashed var(--rule);
  background:
    radial-gradient(circle at 8px 12px, var(--blotter) 3.2px, transparent 3.5px) 0 0 / 16px 26px repeat-y,
    var(--pink);
}
.wax {
  height: 0;
  margin: 0.55rem 0 0;
  border-top: 3px double var(--rule);
}

header.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem 0.6rem;
  min-width: 0;
  padding: 0.7rem 0 0.45rem;
  border-bottom: 2px solid var(--rule);
}
.brand { line-height: 0; min-width: 0; max-width: 100%; }
.brand img { height: 40px; width: auto; max-width: 100%; display: block; }
nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; justify-content: flex-end; }
nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid var(--stamp);
}

.file {
  margin: 0.7rem 0 0;
  color: var(--rule);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
h1 {
  font-weight: 700;
  font-size: clamp(1.55rem, 5.4vw, 2.35rem);
  line-height: 1.18;
  margin: 0.45rem 0 0.55rem;
}
.lede { margin: 0 0 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

button.primary, a.primary, .card button, .pay button, button.hot {
  background: var(--stamp);
  color: #fff;
  border: 2px solid #1a1a1a;
  border-radius: 0;
  min-height: 3rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}
button.ghost, .choices button {
  background: #fffdf8;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  min-height: 2.8rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}
button:disabled { opacity: 0.55; cursor: wait; }
.fine { color: var(--quiet); font-size: 0.92rem; margin: 0.35rem 0; }

.sample { margin: 1rem 0 0.2rem; }
.sample .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.sample .head span, .lab {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--rule);
}
.stamp {
  flex: 0 0 auto;
  width: 4.6rem;
  height: 4.6rem;
  border: 3px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  transform: rotate(-8deg);
}
.pad, .slip, .sample pre {
  margin: 0;
  background-color: var(--canary);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.55rem - 1px),
    rgba(26, 68, 128, 0.45) calc(1.55rem - 1px),
    rgba(26, 68, 128, 0.45) 1.55rem
  );
  background-position: 0 0.72rem;
  color: var(--ink);
  font-family: "Courier Prime", "Courier New", Courier, monospace;
  font-size: 1rem;
  line-height: 1.55rem;
  padding: 0.72rem 0.7rem 0.35rem;
  white-space: pre-wrap;
  border: 1px solid var(--rule);
}
.slip { margin: 0.45rem 0; max-width: 40rem; }

.lines {
  list-style: none;
  margin: 0.3rem 0 0.2rem;
  padding: 0;
  border-top: 2px solid var(--rule);
}
.lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0.15rem;
}
.lines b { display: block; }
.lines .amt {
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--stamp);
  padding-top: 0.15rem;
}
.lines li.tear {
  background: var(--canary);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.lines li.tear .amt { color: var(--ink); }

.rules { margin: 0.2rem 0 0; padding: 0; list-style: none; }
.rules li {
  border-top: 1px dashed var(--rule);
  padding: 0.65rem 0;
}

h2, .q h2, .sec {
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 1.15rem 0 0.4rem;
  color: var(--rule);
}
.split { display: block; }
.progress { height: 4px; background: #ddd6c6; margin: 0.2rem 0 0.7rem; }
.progress span { display: block; height: 100%; background: var(--stamp); }
.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--rule);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.choices { display: grid; gap: 0.4rem; }
.choices button[aria-pressed="true"] {
  background: var(--canary);
  border-color: var(--ink);
}
.cards { display: grid; gap: 0.65rem; margin-top: 0.7rem; }
.card {
  border: 1px solid var(--rule);
  background: #fffdf8;
  padding: 0.75rem;
}
.card .price {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--stamp);
  margin: 0.15rem 0;
}
.card.best {
  background: var(--canary);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.card.best .price { color: var(--ink); }
.note { color: var(--rule); font-weight: 700; }
.error { color: var(--stamp); font-weight: 700; }
.move { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.move h3 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.move a.out { font-weight: 700; }
.panel {
  border: 1px dashed var(--rule);
  padding: 0.8rem;
  background: #fffdf8;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  border-top: 2px solid var(--rule);
  margin-top: 1rem;
  padding-top: 0.7rem;
  color: var(--quiet);
  font-size: 0.85rem;
}
footer a { margin-right: 0.8rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--rule); }

.doc h1 { margin-top: 0.7rem; }
.doc h2 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.15rem;
}
.doc { font-family: Georgia, "Iowan Old Style", Palatino, "Palatino Linotype", serif; font-size: 1.05rem; }
.doc h1, .doc h2 { font-family: Georgia, "Iowan Old Style", Palatino, serif; }

@media (max-width: 640px) {
  body { padding: 8px 6px 20px; }
  .frame { padding-right: 0.65rem; padding-left: 1.35rem; }
  .stamp { width: 3.5rem; height: 3.5rem; font-size: 0.52rem; }
  .lines li { grid-template-columns: minmax(0, 1fr); }
  .lines .amt { font-size: 1.35rem; padding-top: 0; }
  button.primary, a.primary, .card button, .choices button, button.hot { width: 100%; }
  header.top { align-items: flex-start; }
  .brand img { height: 32px; }
  nav { width: 100%; justify-content: flex-start; }
}
