:root {
  --ink: #0c3139;
  --text: #253c42;
  --muted: #536a70;
  --line: #dbe4e5;
  --teal: #136670;
  --teal-100: #e2f0ef;
  --lime: #d6ee8f;
  --red: #a51f30;
  --red-50: #fdf1f2;
  --amber-50: #fbf6ea;
  --amber: #835711;
  --serif: "Source Serif", Georgia, serif;
  --sans: "Inter", "Segoe UI", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e4e9ea;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon .dot,
.icon-sprite .dot {
  fill: currentColor;
  stroke: none;
}

/* Screen toolbar */
.print-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(12 49 57 / 0.96);
  color: #cfe0dd;
  backdrop-filter: blur(10px);
}
.print-controls-inner {
  max-width: calc(210mm + 40px);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}
.print-controls p {
  display: grid;
  margin: 0;
  text-align: center;
}
.print-controls p strong {
  color: #fff;
}
.print-controls a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.print-controls a .icon {
  transform: rotate(180deg);
}
.print-controls button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lime);
  color: var(--ink);
  border: 0;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Paper */
.paper {
  width: 210mm;
  min-height: 297mm;
  margin: 24px auto;
  background: #fff;
  padding: 12mm 15mm 10mm;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 30px 60px -30px rgb(12 49 57 / 0.4),
    0 4px 12px rgb(12 49 57 / 0.06);
}
.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4mm;
  border-bottom: 0.3mm solid var(--ink);
}
.paper-brand {
  display: flex;
  align-items: center;
  gap: 3mm;
}
.paper-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 10mm;
  height: 10mm;
  border-radius: 2.6mm;
  background: var(--ink);
  color: #fff;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16pt;
  line-height: 1;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.paper-mark span {
  transform: translateY(-0.5mm);
}
.paper-mark b {
  position: absolute;
  top: 0.6mm;
  right: 1.2mm;
  font-family: var(--sans);
  font-size: 7pt;
  color: var(--lime);
}
.print-brand {
  font-size: 14pt;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.paper-brand p {
  font-size: 6.5pt;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin: 0.5mm 0 0;
  color: var(--muted);
  font-weight: 600;
}
.paper-tag {
  display: grid;
  justify-items: end;
  gap: 1mm;
  font-size: 8.5pt;
}
.paper-tag > span:first-child {
  background: var(--teal-100);
  color: var(--teal);
  padding: 0.8mm 3mm;
  border-radius: 10mm;
  font-weight: 650;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.paper-page {
  font-size: 7pt;
  color: var(--muted);
}
.print-draft {
  font-size: 7.5pt;
  font-weight: 600;
  color: #6b4a0c;
  background: #fff3d6;
  padding: 1.6mm 3mm;
  margin-top: 3mm;
  border-radius: 1.5mm;
}
.print-title h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30pt;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--ink);
  margin: 5mm 0 1.5mm;
}
.print-title h1 span {
  font-style: italic;
  font-size: 14pt;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 2mm;
}
.print-title h2 {
  font-size: 11.5pt;
  font-weight: 600;
  margin: 0 0 4mm;
  color: var(--teal);
}
.print-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5mm;
  margin: 0 0 4mm;
}
.print-facts > div {
  border: 0.25mm solid var(--line);
  border-radius: 2.5mm;
  padding: 2mm 3mm;
}
.print-facts dt {
  display: flex;
  align-items: center;
  gap: 1.5mm;
  font-size: 7.5pt;
  color: var(--muted);
}
.print-facts dt .icon {
  color: var(--teal);
}
.print-facts dd {
  margin: 0.5mm 0 0;
  font-weight: 650;
  font-size: 10pt;
  color: var(--ink);
}
.print-sections section {
  margin: 0 0 2.5mm;
  padding: 0 0 2.5mm;
  border-bottom: 0.25mm solid var(--line);
  break-inside: avoid;
}
.print-sections h3 {
  display: flex;
  align-items: center;
  gap: 2mm;
  font-size: 11.5pt;
  margin: 0 0 1.5mm;
  line-height: 1.3;
  color: var(--ink);
}
.print-sections p {
  font-size: 10pt;
  line-height: 1.45;
  white-space: pre-line;
  margin: 0;
}
.print-sections .urgent {
  background: var(--red-50);
  border: 0;
  border-left: 1.2mm solid var(--red);
  border-radius: 0 2.5mm 2.5mm 0;
  padding: 3mm 4mm;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-sections .urgent h3 {
  color: var(--red);
}
.print-sections .urgent.emergency {
  background: var(--red);
  color: #fff;
}
.print-sections .urgent.emergency h3 {
  color: #fff;
  font-size: 13pt;
}
.print-sections .urgent.emergency .print-refs {
  color: #ffd5da;
}
.print-sections .caution {
  background: var(--amber-50);
  border: 0;
  border-radius: 2.5mm;
  padding: 3mm 4mm;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-sections .caution h3 .icon {
  color: var(--amber);
}
.print-refs {
  font-size: 7.5pt;
  color: var(--muted);
}
.print-doses {
  list-style: none;
  padding: 0;
  margin: 0 0 2mm;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1.2mm;
  align-items: end;
}
.print-doses li {
  display: grid;
  text-align: center;
  padding: 1.2mm 0.5mm;
  border-radius: 1.5mm;
  border: 0.25mm dashed #8cc3c4;
  font-size: 7pt;
  color: var(--muted);
  line-height: 1.25;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-doses strong {
  font-size: 9.5pt;
  color: var(--ink);
}
.print-doses .stage-start,
.print-doses .stage-next {
  border: 0;
  background: var(--teal);
  color: #e2f0ef;
}
.print-doses .stage-next {
  background: #3b9298;
}
.print-doses .stage-start strong,
.print-doses .stage-next strong {
  color: #fff;
}
.print-frequency {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  margin: 0 0 1.5mm;
}
.print-frequency caption {
  text-align: left;
  font-size: 7.5pt;
  color: var(--muted);
  padding-bottom: 0.8mm;
}
.print-frequency th,
.print-frequency td {
  text-align: left;
  padding: 0.6mm 1mm;
  border-bottom: 0.25mm solid var(--line);
  vertical-align: middle;
}
.print-frequency th {
  width: 24mm;
  font-weight: 650;
  color: var(--ink);
}
.pf-bar {
  width: 52%;
}
.pf-bar svg {
  display: block;
  width: 100%;
  height: 2mm;
  border-radius: 1mm;
  overflow: hidden;
}
.pf-track {
  fill: #e6eded;
}
.pf-fill {
  fill: var(--teal);
}
.print-frequency .pf-one {
  white-space: nowrap;
  color: var(--muted);
}
.print-frequency .pf-pct {
  text-align: right;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.print-notes {
  flex: 1 1 0;
  min-height: 0;
  margin: 1mm 0 3mm;
  border: 0.25mm solid var(--line);
  border-radius: 2.5mm;
  padding: 3mm 4mm;
  background-image: repeating-linear-gradient(
    transparent 0,
    transparent 7.4mm,
    var(--line) 7.4mm,
    var(--line) 7.65mm
  );
  background-position: 0 9mm;
  background-origin: content-box;
  background-clip: content-box;
  overflow: hidden;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-notes h3 {
  margin: 0;
  font-size: 9pt;
  color: var(--muted);
  font-weight: 650;
  background: #fff;
  width: max-content;
}
.paper footer {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  margin-top: auto;
  border-top: 0.3mm solid var(--ink);
  padding-top: 3mm;
  font-size: 7.2pt;
  line-height: 1.55;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.paper footer strong {
  color: var(--ink);
}
.paper footer > span {
  white-space: nowrap;
  font-weight: 650;
  color: var(--ink);
}
@page {
  size: A4;
  margin: 0;
}
@media print {
  body {
    background: white;
  }
  .print-controls {
    display: none;
  }
  .paper {
    margin: 0;
    box-shadow: none;
    min-height: 297mm;
    height: 297mm;
    break-after: page;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .paper:last-child {
    break-after: auto;
  }
}
@media screen and (max-width: 820px) {
  .print-controls-inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .print-controls p {
    order: 3;
    width: 100%;
    text-align: left;
  }
  .paper {
    width: auto;
    min-height: 0;
    padding: 22px 18px;
    margin: 12px;
    border-radius: 10px;
  }
  .print-title h1 {
    font-size: 28pt;
  }
  .print-title h1 span {
    display: block;
    margin: 4px 0 0;
  }
  .print-facts {
    grid-template-columns: 1fr;
  }
  .print-doses {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
  }
  .print-notes {
    display: none;
  }
  .paper footer {
    margin-top: 20px;
  }
  .paper-head {
    gap: 16px;
  }
}

/* Frequency categories (label ranges) */
.print-bands {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  margin: 0 0 1.5mm;
}
.print-bands caption {
  text-align: left;
  font-size: 7.5pt;
  color: var(--muted);
  padding-bottom: 0.8mm;
}
.print-bands th,
.print-bands td {
  text-align: left;
  padding: 0.7mm 1mm;
  border-bottom: 0.25mm solid var(--line);
  vertical-align: middle;
}
.print-bands th {
  width: 31mm;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
}
.print-bands th small {
  display: block;
  font-weight: 450;
  font-size: 7pt;
  color: var(--muted);
}
.print-bands .pb-meter {
  width: 15mm;
  white-space: nowrap;
}
.print-bands .pb-meter span {
  display: inline-flex;
  gap: 0.5mm;
}
.print-bands .pb-meter i {
  width: 2.4mm;
  height: 1.5mm;
  border-radius: 0.75mm;
  background: #e1e9e9;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.print-bands .pb-meter i.on {
  background: var(--teal);
}
.print-title h1 span.brands {
  font-size: 10.5pt;
}
