:root {
  --ink: #1f2925;
  --paper: #f4f1e9;
  --panel: #fffdfa;
  --line: #cec6b6;
  --muted: #63716a;
  --green: #263932;
  --brick: #9b4a3d;
  --blue: #315b73;
  --amber: #c28b2c;
  --shadow: 0 18px 54px rgba(31, 41, 37, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(38, 57, 50, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(38, 57, 50, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
.application-button {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--panel);
  color: var(--green);
  padding: 0 14px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:hover,
.application-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 41, 37, 0.12);
}

.primary {
  background: var(--green);
  color: white;
}

.application-topbar {
  min-height: 68px;
  border-bottom: 1px solid rgba(38, 57, 50, 0.2);
  background: rgba(244, 241, 233, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.application-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.application-brand span {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--brick);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.application-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 36px;
  align-items: center;
  padding: 54px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brick);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7.6vw, 84px);
  line-height: 0.97;
  letter-spacing: 0;
}

.lede {
  max-width: 820px;
  color: #4b5a55;
  font-size: 18px;
  line-height: 1.62;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.packet-ledger,
.application-panel,
.application-sheet,
.demand-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.93);
  box-shadow: var(--shadow);
}

.packet-ledger {
  padding: 22px;
  transform: rotate(0.45deg);
}

.packet-ledger dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.packet-ledger div,
.summary-strip div,
.signature-row div {
  border-left: 4px solid var(--brick);
  background: #fbf7ef;
  padding: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  font-size: 23px;
  font-weight: 900;
}

.demand-note {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-left: 6px solid var(--amber);
  box-shadow: none;
}

.demand-note p {
  margin: 0;
  color: #41514b;
  line-height: 1.55;
}

.application-workflow {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: start;
  padding: 24px 0 52px;
}

.application-panel {
  padding: 20px;
}

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 20px 0 8px;
}

fieldset:first-child {
  border-top: 0;
  padding-top: 0;
}

legend {
  padding-right: 12px;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  color: #33413d;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c8c0b4;
  border-radius: 6px;
  background: #fffaf0;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
  letter-spacing: 0;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.field-grid,
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.compact {
  margin-bottom: 14px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  margin-top: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.status-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--blue);
  font-weight: 800;
}

.instrumentation {
  margin-top: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f1e5;
  padding: 14px;
}

.instrumentation h2 {
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

code {
  border-radius: 4px;
  background: #ece4d6;
  color: #5d392f;
  padding: 2px 5px;
  font-size: 0.92em;
}

.fine-print {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.application-sheet {
  min-height: 620px;
  padding: 18px;
  position: sticky;
  top: 86px;
}

.sheet-label {
  margin: -2px 0 12px;
  color: var(--brick);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.application-document {
  border: 1px solid #c9c0ae;
  background: #fffefb;
  padding: 22px;
  box-shadow: 0 12px 34px rgba(31, 41, 37, 0.08);
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 3px solid var(--green);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.document-header h2 {
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.document-header strong {
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  padding: 8px 10px;
  white-space: nowrap;
}

.summary-strip,
.report-grid,
.signature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.summary-strip span,
.signature-row span {
  display: block;
  margin-top: 4px;
  color: #4b5a55;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.report-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-block {
  border: 1px solid #ded6c8;
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
  line-height: 1.55;
}

.report-block h3 {
  margin-bottom: 8px;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.acknowledgement-block {
  border-left: 5px solid var(--amber);
}

.signature-row div {
  min-height: 76px;
}

@media (max-width: 920px) {
  .application-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  nav {
    justify-content: flex-start;
  }

  .application-hero,
  .application-workflow,
  .field-grid,
  .two-column,
  .report-grid,
  .summary-strip,
  .signature-row {
    grid-template-columns: 1fr;
  }

  .application-hero {
    min-height: auto;
    padding-top: 36px;
  }

  .application-sheet {
    position: static;
  }
}

@media print {
  body {
    background: white;
  }

  .application-topbar,
  .application-panel,
  .demand-note,
  .sheet-label {
    display: none;
  }

  main,
  .application-workflow {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
  }

  .application-sheet,
  .application-document {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}
