:root {
  --paper: #eee9dc;
  --paper-dark: #ddd5c3;
  --ink: #25373f;
  --muted: #7d8674;
  --red: #a72b2b;
  --line: #cfc5af;
  --panel: #f8f6ee;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.55), transparent 22rem),
    linear-gradient(90deg, rgba(37, 55, 63, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 55, 63, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 5px 5px, 5px 5px, auto;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(70, 61, 48, 0.05) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(70, 61, 48, 0.025) 8px 9px);
  mix-blend-mode: multiply;
}

.document {
  width: min(830px, calc(100vw - 32px));
  margin: 30px auto 72px;
}

.masthead {
  padding-bottom: 34px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 22px;
}

.seal {
  width: 62px;
  height: 62px;
  border: 3px double var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 7px;
  line-height: 1.05;
  transform: rotate(-6deg);
  color: var(--ink);
}

.seal strong {
  color: var(--red);
  font-size: 9px;
}

.overline,
.subtitle,
.meta-line,
.red-label,
.section-title span,
label span,
.fine-print,
.chart-card p,
.footer {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.overline {
  margin: 0 0 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 51px);
  line-height: 0.95;
  text-shadow: 1px 1px 0 rgba(37, 55, 63, 0.14);
}

.subtitle {
  margin: 13px 0 0;
  text-transform: none;
  letter-spacing: 0;
}

.rule {
  margin: 20px 0 10px;
  height: 5px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  opacity: 0.78;
}

.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.hero {
  position: relative;
  min-height: 310px;
  padding: 36px 0 50px;
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 42px;
  align-items: start;
}

.hero-copy {
  max-width: 590px;
}

.red-label {
  margin-bottom: 8px;
  color: var(--red);
}

h2 {
  margin-bottom: 23px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 61px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead {
  margin-bottom: 26px;
  max-width: 660px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.chips,
.link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips span,
.link-grid a {
  border: 1px solid var(--ink);
  background: rgba(248, 246, 238, 0.62);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
}

.stamp {
  width: 130px;
  height: 130px;
  margin: 48px auto 0;
  border: 4px double var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-14deg);
}

.file-section {
  margin: 0 0 34px;
  border: 1px solid var(--line);
  background: rgba(248, 246, 238, 0.68);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.section-title {
  min-height: 48px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
}

.section-title span {
  flex: 0 0 auto;
  color: #9cab9b;
}

h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.1;
  color: var(--paper);
}

.section-body {
  padding: 28px 23px 31px;
}

.section-body > p {
  color: #727a69;
  font-size: 13px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  font-size: 14px;
}

th {
  color: var(--ink);
  font-size: 13px;
  text-align: left;
}

td,
th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
  color: var(--red);
  font-weight: 800;
}

.fine-print {
  margin: 18px 0 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-style: italic;
}

.worksheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 22px 0 24px;
}

label {
  display: grid;
  gap: 9px;
}

input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 2px solid #9fa7a7;
  background: #fbfbf8;
  color: var(--ink);
  font: 700 15px "Courier New", Courier, monospace;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

label strong {
  color: var(--red);
}

.redaction-preview {
  padding: 17px;
  border: 1px dashed #87908e;
  background: #fbfaf5;
}

.redaction-preview p {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.7fr;
  gap: 10px;
  margin: 0 0 10px;
}

.redaction-preview p:last-child {
  margin-bottom: 0;
}

.redaction-preview span,
.redaction-preview b {
  height: 13px;
  display: block;
  background: #d9d2c1;
}

.redaction-preview b {
  background: var(--ink);
}

.output-table td:nth-child(2),
.output-table th:nth-child(2) {
  text-align: right;
  font-weight: 800;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 23px;
  margin-top: 22px;
}

.chart-card {
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.chart-card p {
  margin: 18px 0 0;
}

h4 {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

.grid {
  fill: none;
  stroke: #d4cab7;
  stroke-width: 2;
}

.dotted {
  fill: none;
  stroke: var(--red);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4;
}

.bars {
  height: 170px;
  margin-bottom: 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 21px;
  align-items: end;
}

.bars div {
  position: relative;
  height: var(--h);
  min-height: 42px;
  background: var(--ink);
}

.bars strong {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  color: var(--red);
  font-size: 13px;
  transform: translateX(-50%);
}

.bars span {
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
}

.primary {
  display: block;
  min-width: 300px;
  margin: 32px auto 0;
  padding: 17px 24px;
  border: 0;
  background: var(--red);
  color: var(--paper);
  cursor: pointer;
  font: 800 17px Georgia, "Times New Roman", serif;
}

.generated-card {
  width: min(430px, 100%);
  margin: 22px auto 0;
  padding: 18px 20px;
  border: 2px dashed var(--ink);
  background: #fbfaf5;
  text-align: center;
  transform: rotate(-1deg);
}

.generated-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.generated-card strong {
  display: block;
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.ca-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #87908e;
  background: #fbfaf5;
}

code {
  align-self: center;
  overflow-wrap: anywhere;
  font-weight: 800;
}

button {
  text-transform: uppercase;
}

.ca-box button {
  min-width: 74px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font: 800 13px "Courier New", Courier, monospace;
}

.slip {
  display: inline-block;
  margin: 16px 0 0;
  padding: 7px 13px;
  border: 2px solid #747c62;
  background: rgba(244, 244, 226, 0.92);
  color: #6a715e;
  font-weight: 800;
  transform: rotate(-3deg);
}

.channels {
  margin-bottom: 38px;
}

.link-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.link-grid a {
  min-height: 61px;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.footer {
  display: grid;
  gap: 18px;
  place-items: center;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

.footer span {
  width: 100%;
  height: 1px;
  border-top: 2px dashed var(--line);
}

.footer p {
  width: min(560px, 100%);
  color: #979181;
}

@media (max-width: 760px) {
  .document {
    width: min(100% - 20px, 830px);
    margin-top: 18px;
  }

  .brand-row,
  .hero,
  .worksheet,
  .chart-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .meta-line {
    display: grid;
  }

  .stamp {
    margin: 10px 0 0;
  }

  .section-body {
    padding: 22px 16px 25px;
  }

  .primary {
    min-width: 0;
    width: 100%;
  }
}
