@font-face {
  font-family: Manrope;
  src: url("./assets/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --cream: #fffaf2;
  --ink: #241d18;
  --brick: #8b3f35;
  --sage-light: #dce5d6;
  --sage-ink: #33493a;
  --muted: #4f453c;
  --fine: #665a50;
  --rule: #e8dccb;
  --border: #d9c6ad;
  --control: #8a7b6e;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: #faf9f5;
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
[hidden], #printout { display: none !important; }
a { color: var(--brick); text-underline-offset: 3px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
:where(button, input, a):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

#calculator {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 22px 36px;
  background: var(--cream);
}

.app-header {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; gap: 12px; font: 21px/1.4 var(--serif); letter-spacing: -.01em; }
.mark {
  position: relative;
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--brick);
}
.mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: #c1785f; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.small { gap: 8px; }
.actions { gap: 12px; }
h1 { font: 400 36px/1.05 var(--serif); letter-spacing: -.03em; }
h1:focus { outline: none; }
h2 { font-size: 17px; font-weight: 800; }
.welcome-title { font-size: 42px; line-height: 1; }
.eyebrow { color: var(--brick); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.intro { color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.fine { color: var(--fine); font-size: 14px; }
.ruled { padding-top: 14px; border-top: 1px solid var(--rule); }

.card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.primary, .secondary {
  min-height: 54px;
  padding: 12px 18px;
  border: 2px solid var(--brick);
  border-radius: 12px;
  color: #fff;
  background: var(--brick);
  font-size: 17px;
  font-weight: 700;
}
.secondary { color: var(--brick); background: transparent; }
.text {
  align-self: flex-start;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: none; }
legend { padding: 0; margin-bottom: 8px; }
legend { font-size: 17px; font-weight: 700; line-height: 1.35; }
.doctor { padding: 18px 20px; border-radius: 16px; background: var(--sage-light); }
.doctor .eyebrow { color: var(--sage-ink); }
.doctor p { font-size: 18px; line-height: 1.4; font-weight: 700; }
.letter-link, .return-address a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
#share-fallback { margin-top: 10px; }
#share-url { width: 100%; min-height: 44px; padding: 6px 10px; border: 2px solid var(--control); border-radius: 8px; }
.return-address { overflow-wrap: anywhere; }
.return-address a { display: flex; }

.checklist-items { list-style: none; margin: 0; padding: 6px 18px; }
.checklist-items li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.checklist-items li:last-child { border: 0; }
.checklist-items p { color: var(--muted); font-size: 15px; }

@page { size: letter portrait; margin: .65in .75in; }

@media print {
  :root { --ink: #111; --muted: #333; --control: #555; background: #fff; }
  body:has(#printout:not(:empty)) #calculator { display: none; }
  #printout:not(:empty) { display: flex !important; flex-direction: column; gap: 14px; font-size: 11pt; line-height: 1.4; }
  #printout h1 { font-size: 23pt; }
  #printout h2 { font-size: 13pt; }
  #printout p + p { margin-top: 6px; }
  .print-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 12px; border-bottom: 1.5px solid #111; }
  .print-header > :last-child { text-align: right; font-size: 10pt; }
  .mark { border-color: #111; color: #111; }
  .mark::after { display: none; }
  #printout .doctor { border: 1.5px solid #111; padding: 10px 14px; background: #fff; }
  #printout .eyebrow { color: #111; }
  #printout .doctor p { font-size: 14pt; }
  #printout .return-address { font-size: 9pt; color: #333; }
  #printout .return-address a { min-height: 0; display: inline; color: #111; }
  #printout .checklist-items { border-color: #555; }
  #printout .checklist-items li { padding: 8px 0; border-color: #999; break-inside: avoid; }
  #printout .checklist-items p { font-size: 10pt; }
}
.checklist-choices { margin-top: 12px; }
.checklist-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--control);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.checklist-choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brick); }
.checklist-choice:has(input:checked) { background: var(--sage-light); }
.checklist-choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.primary:disabled { color: var(--muted); background: var(--rule); border-color: var(--border); cursor: default; }
