@font-face {
  font-family: Source;
  src: url("assets/body.ttf") format("truetype");
  font-display: swap;
}
:root {
  --ink: #183244;
  --muted: #53636d;
  --accent: #163b51;
  --bg: #f2f4f4;
  --paper: #fff;
  --line: #d5dde1;
  --light: #e9eff2;
  --error: #9b3527;
  --text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.82rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.95rem);
  --text-base: clamp(1rem, 0.98rem + 0.1vw, 1.06rem);
  --text-lg: clamp(1.2rem, 1.1rem + 0.3vw, 1.4rem);
  --text-xl: clamp(1.6rem, 1.4rem + 0.55vw, 2rem);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --font-body: Source, "Segoe UI", Arial, sans-serif;
  --font-display: Georgia, serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}
button:hover {
  background: var(--light);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover {
  background: #0f2d3f;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #b17c32;
  outline-offset: 3px;
}
input,
select,
textarea {
  min-height: 46px;
  width: 100%;
  border: 1px solid #9aaab4;
  border-radius: 3px;
  background: white;
  padding: var(--space-2) var(--space-3);
  color: var(--ink);
  margin-top: var(--space-2);
  font-size: var(--text-base);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  min-height: 20px;
  margin: 0;
  flex: 0 0 20px;
  accent-color: var(--accent);
}
input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
label {
  font-size: var(--text-sm);
  font-weight: 600;
  display: block;
}
p {
  margin: var(--space-2) 0 var(--space-4);
}
.masthead {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.identity {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.identity img {
  width: 100px;
  height: auto;
}
.identity strong {
  display: block;
  font-size: var(--text-lg);
}
.identity span,
.edition {
  font-size: var(--text-xs);
  color: var(--muted);
}
.edition {
  letter-spacing: 0.09em;
}
.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1500px;
  margin: auto;
  min-height: calc(100vh - 92px);
}
aside {
  padding: var(--space-10) var(--space-6);
  border-right: 1px solid var(--line);
}
h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  margin: var(--space-2) 0 var(--space-4);
}
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.11em;
  font-weight: 700;
  color: var(--muted);
}
.aside-intro {
  font-size: var(--text-sm);
  color: var(--muted);
}
nav {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-8) 0;
}
nav button {
  display: flex;
  gap: var(--space-3);
  text-align: left;
  padding: var(--space-4);
  background: transparent;
  border: 1px solid transparent;
  align-items: center;
}
nav button[aria-current="true"] {
  background: var(--paper);
  border-color: var(--line);
}
.nav-num {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 400;
}
.draft-tools {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.small,
footer,
.institution {
  font-size: var(--text-xs);
  color: var(--muted);
}
.small {
  margin-top: var(--space-4);
}
.institution {
  margin-top: var(--space-8);
}
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
footer {
  margin-top: var(--space-10);
}
main {
  padding: var(--space-10) var(--space-12);
  max-width: 1100px;
  width: 100%;
  min-width: 0;
}
.topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
#status:empty {
  display: none;
}
#send-page .heading {
  margin-bottom: var(--space-6);
}
.return-tools {
  border-top: 1px solid var(--line);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
}
.return-tools > summary {
  font-size: var(--text-sm);
  cursor: pointer;
}
.form-section + .form-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin: var(--space-4) 0 var(--space-6);
}
h2 {
  font-size: var(--text-xl);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
}
.heading p {
  color: var(--muted);
  font-size: var(--text-sm);
  max-width: 540px;
}
.heading button {
  flex-shrink: 0;
}
#steps {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
#steps button {
  font-weight: 400;
  font-size: var(--text-xs);
  background: transparent;
}
#steps button[aria-pressed="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
form {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: var(--space-8);
  border-radius: 5px;
}
h3 {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-6);
  font-weight: 600;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-6);
}
legend {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.choices,
.check {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.choices label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
.wide {
  grid-column: 1/-1;
}
.check {
  font-weight: 400;
  font-size: var(--text-sm);
  margin: var(--space-5) 0;
}
.check input {
  margin-top: var(--space-1);
}
.notice {
  font-size: var(--text-sm);
  color: var(--muted);
  background: var(--light);
  padding: var(--space-4);
  border-radius: 3px;
}
.notice.warning {
  color: #733b21;
  background: #fbf2e6;
}
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.delivery {
  border-top: 1px solid var(--line);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
}
.delivery h3 {
  margin-bottom: var(--space-3);
}
.delivery > label:not(.check) {
  max-width: 440px;
}
.delivery p {
  font-size: var(--text-sm);
}
.money-group {
  margin-top: var(--space-8);
}
.money-group:first-child {
  margin-top: 0;
}
.money-group h3 {
  font-size: var(--text-base);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.money-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
.money-row input {
  margin: 0;
}
.money-row label {
  font-weight: 400;
}
.money-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: var(--text-base);
}
.money-row.total {
  background: var(--light);
  padding: var(--space-4) var(--space-3);
  margin-top: var(--space-2);
  border-bottom: 0;
}
.money-row.total label {
  font-weight: 600;
}
.zero-note {
  font-size: var(--text-xs);
  color: var(--muted);
}
.balance-check {
  margin: var(--space-6) 0 0;
  font-weight: 600;
}
.error {
  color: var(--error);
}
#status {
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: var(--space-8);
  max-width: 640px;
  width: calc(100% - 32px);
  color: var(--ink);
}
dialog::backdrop {
  background: #18324480;
}
dialog p {
  font-size: var(--text-sm);
}
.skip {
  position: absolute;
  top: -100px;
}
.skip:focus {
  top: 0;
  background: white;
  padding: var(--space-4);
  z-index: 5;
}
.office {
  margin-top: var(--space-6);
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}
.office summary {
  font-size: var(--text-sm);
  font-weight: 600;
}
.export-actions {
  margin-top: var(--space-6);
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  main {
    padding: var(--space-8);
  }
  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .masthead {
    padding-inline: var(--space-6);
  }
  .edition {
    display: none;
  }
  .heading {
    flex-direction: column;
    gap: var(--space-3);
  }
}
.encryption {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  border-radius: 4px;
}
.encryption summary {
  font-size: var(--text-sm);
  font-weight: 600;
}
.encryption p {
  font-size: var(--text-sm);
}
.encryption .small {
  font-size: var(--text-xs);
}
.unlock-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.unlock-section > label {
  margin-bottom: var(--space-5);
}
.unlock-section h3 {
  margin-bottom: var(--space-3);
}
#opened-files {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
#opened-files button {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: left;
}
.notice {
  overflow-wrap: anywhere;
}
#cryptostatus {
  overflow-wrap: anywhere;
}
input[type="file"] {
  min-width: 0;
  font-size: var(--text-sm);
}
.encryption .step-actions {
  flex-wrap: wrap;
}
.encryption input[type="password"] {
  letter-spacing: 0.07em;
}
.signature-section {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border: 1px solid var(--line);
  background: white;
  border-radius: 4px;
}
.signature-section h3 {
  margin-bottom: var(--space-3);
}
.signature-section > label {
  margin-top: var(--space-4);
}
#signature-canvas {
  display: block;
  border: 1px solid #9aaab4;
  border-radius: 3px;
  width: 100%;
  height: 150px;
  background: #fff;
  touch-action: none;
  margin: var(--space-3) 0;
}
.official-notice {
  padding: var(--space-5);
  border-left: 3px solid var(--accent);
  background: var(--light);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.7;
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
#signature-status {
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .masthead {
    padding: var(--space-3) var(--space-4);
  }
  .identity img {
    width: 75px;
  }
  .identity {
    gap: var(--space-3);
  }
  .identity strong {
    font-size: var(--text-base);
  }
  aside {
    padding: var(--space-6) var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  aside h1 {
    margin-bottom: var(--space-2);
  }
  .aside-intro {
    margin-bottom: var(--space-3);
  }
  nav {
    margin: var(--space-4) 0;
    gap: var(--space-1);
  }
  nav button {
    padding: var(--space-3);
    min-height: 44px;
  }
  .institution,
  aside footer {
    display: none;
  }
  .small {
    margin-bottom: 0;
  }
  main {
    padding: var(--space-6) var(--space-4);
  }
  form {
    padding: var(--space-5);
  }
  .fields {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .money-row {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: var(--space-3);
  }
  .money-row input {
    padding: var(--space-2);
  }
  .money-row label {
    font-size: var(--text-sm);
  }
  .topline {
    font-size: var(--text-xs);
  }
  .delivery {
    margin-top: var(--space-8);
  }
}
