:root { font: 16px/1.5 system-ui, sans-serif; color: #182d35; background: #f0f5f4; }
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 54rem; margin: auto; padding: 0 1.25rem; }
.top { background: #123942; color: white; }
.bar, .actions, .row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bar, .row, .toolbar { justify-content: space-between; }
.bar { min-height: 4.25rem; }
.brand { color: white; font-size: 1.28rem; font-weight: 750; text-decoration: none; }
main { padding-block: 1.5rem 3rem !important; }
h1, h2 { line-height: 1.18; margin: 0 0 1rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: 1.3rem; }
a { color: #075d62; text-underline-offset: .2em; }
.card { background: white; border: 1px solid #d4e2e0; border-radius: .9rem; padding: clamp(1rem, 4vw, 2rem); margin: 1rem 0; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; font-weight: 600; }
input, textarea, button, .button { font: inherit; border-radius: .45rem; }
input, textarea { border: 1px solid #90a8a8; padding: .6rem .75rem; width: 100%; color: inherit; }
textarea { resize: vertical; }
button, .button { display: inline-block; justify-self: start; border: 1px solid transparent; background: #086369; color: white; padding: .58rem .9rem; font-weight: 650; text-decoration: none; cursor: pointer; }
button.secondary { background: #e6f1ef; color: #164950; border-color: #bfd5d1; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #b35a24; outline-offset: 3px; }
.toolbar input { width: min(17rem, 53vw); }
.row { padding-block: .8rem; }
.row + .row { border-top: 1px solid #d4e2e0; }
dt { font-weight: bold; }
dd { margin: 0 0 .75rem; }
.med { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: .8rem; border: 1px solid #d4e2e0; border-radius: .5rem; padding: 1rem; }
.med legend { font-weight: 700; }
.med label:first-of-type { grid-column: 1 / -1; }
.med button { align-self: end; }
.error { color: #801a28; background: #fdecef; padding: .75rem; border-radius: .4rem; }
.prescription-header { border-bottom: 1px solid #90a8a8; }
.paper { overflow-wrap: anywhere; }
.paper li { margin-bottom: .8rem; break-inside: avoid; }
.notes { white-space: pre-wrap; }
.signature { margin: 4rem 0 0 auto; padding-top: .45rem; text-align: center; border-top: 1px solid currentColor; max-width: 15rem; break-inside: avoid; }
@media print {
  @page { margin: 16mm; }
  :root { background: white; color: black; font-size: 11pt; }
  .top, .screen { display: none; }
  main.wrap { max-width: none; padding: 0 !important; }
  .paper { margin: 0; padding: 0; border: 0; }
}
