:root {
  color-scheme: light;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182b35;
  background: #f5f7f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; line-height: 1.55; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #236c75; outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #073e46;
}
.skip-link:focus { top: 12px; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header, main, .site-footer { width: min(100% - 40px, 1040px); margin-inline: auto; }
.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 24px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: #0e5962;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: bold;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy span { margin-top: 4px; color: #60727b; font-size: 12px; }
.secure-pill {
  margin-left: auto;
  padding: 6px 11px;
  border: 1px solid #cfdfdc;
  border-radius: 100px;
  background: #eff7f3;
  color: #2e6256;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.secure-pill span { margin-right: 5px; font-size: 8px; vertical-align: 2px; }

main { flex: 1; padding-block: 30px 48px; }
.screen { max-width: 820px; margin-inline: auto; }
.card, .document-card {
  border: 1px solid #dce5e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(24, 43, 53, .05);
}
.card { max-width: 620px; padding: clamp(25px, 5vw, 48px); }
.eyebrow { margin-bottom: 10px; color: #287b7a; font-size: 12px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(30px, 5vw, 42px); line-height: 1.14; letter-spacing: -.045em; }
.lede { max-width: 56ch; margin-bottom: 28px; color: #526873; font-size: 16px; }
.privacy-box { padding: 20px; border: 1px solid #dce7e7; border-radius: 12px; background: #f8fbfa; }
.privacy-box h2 { margin-bottom: 8px; font-size: 17px; letter-spacing: -.02em; }
.privacy-box p { margin-bottom: 16px; color: #4d636b; font-size: 14px; }
.consent-row { display: flex; align-items: flex-start; gap: 11px; color: #263b43; font-size: 14px; font-weight: 600; cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: #0e6870; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  transition: background .15s ease, transform .15s ease;
}
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { margin-top: 24px; background: #0b626b; color: #fff; }
.button-primary:not(:disabled):hover { background: #084f57; }
.button-secondary { background: #fff; border-color: #b9d1d2; color: #145a61; }
.button-secondary:not(:disabled):hover { background: #eef7f7; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.small-note { margin: 17px 0 0; color: #697b82; font-size: 13px; }

.detail-list { margin: 0 0 26px; padding: 0; border-block: 1px solid #e2e9eb; }
.detail-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #e9eef0; }
.detail-list > div:last-child { border-bottom: 0; }
dt { color: #657983; }
dd { margin: 0; }
.detail-list dt, .detail-list dd { font-size: 14px; }
.detail-list dd { max-width: 65%; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.field-label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.code-input { width: min(100%, 220px); min-height: 56px; padding: 8px 14px; border: 1px solid #aebfc4; border-radius: 10px; background: #fff; color: #182b35; font-size: 24px; font-weight: 650; letter-spacing: .25em; }
.code-input:focus { border-color: #0b626b; }
.field-help { margin: 8px 0 0; color: #637680; font-size: 13px; }
#verify-form .button { display: flex; margin-top: 20px; }

.document-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
.document-toolbar h1 { margin-bottom: 4px; }
.toolbar-subtitle { margin: 0; color: #5e727b; font-size: 14px; }
.document-card { position: relative; overflow: hidden; }
.document-content { position: relative; z-index: 1; padding: clamp(22px, 5vw, 48px); }
.watermark {
  position: absolute;
  z-index: 0;
  inset: 10% -15%;
  display: grid;
  place-items: center;
  transform: rotate(-25deg);
  color: rgba(24, 88, 94, .075);
  font-size: clamp(22px, 4vw, 44px);
  font-weight: 750;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  user-select: none;
}
.document-header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 2px solid #0b626b; }
.document-header .eyebrow { margin-bottom: 6px; }
.document-header h2 { margin-bottom: 4px; font-size: 24px; letter-spacing: -.03em; }
.document-header p { margin: 0; color: #5e727b; }
.issued-block { display: flex; flex-direction: column; align-items: end; min-width: 140px; font-size: 13px; text-align: right; }
.issued-block span { color: #657983; }
.issued-block strong { font-size: 14px; }
.patient-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 24px 0; border-bottom: 1px solid #e0e8e9; }
.patient-details div { min-width: 0; }
.patient-details dt { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.patient-details dd { margin-top: 4px; font-weight: 700; overflow-wrap: anywhere; }
.clinical-section { padding: 24px 0; border-bottom: 1px solid #e2e9eb; }
.section-title { margin-bottom: 12px; font-size: 17px; letter-spacing: -.02em; }
.clinical-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.record-item { padding: 15px 18px; border: 1px solid #e0e8e9; border-radius: 10px; background: rgba(248, 251, 250, .86); }
.record-name { display: block; margin-bottom: 6px; overflow-wrap: anywhere; }
.record-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; }
.record-detail { display: flex; gap: 5px; font-size: 13px; overflow-wrap: anywhere; }
.record-detail dt { flex: none; }
.record-detail dt::after { content: ":"; }
.record-detail dd { font-weight: 600; }
.empty-document { padding: 24px 0; color: #526873; }
.document-footer { padding-top: 24px; color: #667983; font-size: 12px; }
.document-footer p { margin-bottom: 0; }
.privacy-reminder { margin: 16px 0 0; color: #5e727b; font-size: 13px; text-align: center; }
.print-only { display: none; }
.privacy-blur #document { filter: blur(22px); }
#document { user-select: none; -webkit-user-select: none; }
.status-message { max-width: 620px; min-height: 24px; margin: 18px auto 0; color: #286a5e; font-size: 14px; }
.status-message.is-error { color: #9c3333; }
.site-footer { padding-block: 18px 28px; border-top: 1px solid #dce5e7; color: #70818a; font-size: 12px; text-align: center; }

@media (max-width: 620px) {
  .site-header, main, .site-footer { width: min(100% - 28px, 1040px); }
  .site-header { padding-block: 17px; }
  .secure-pill { padding-inline: 8px; font-size: 11px; }
  main { padding-top: 16px; }
  .document-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .document-toolbar .button { align-self: flex-start; }
  .document-header { flex-direction: column; gap: 12px; }
  .issued-block { align-items: start; text-align: left; }
  .patient-details, .record-details { grid-template-columns: 1fr; }
  .detail-list > div { flex-direction: column; gap: 2px; }
  .detail-list dd { max-width: none; text-align: left; }
}

@media print {
  @page { size: auto; margin: 16mm; }
  :root, body { background: #fff; color: #000; }
  .site-header, .site-footer, .document-toolbar, .privacy-reminder, .status-message, .skip-link { display: none !important; }
  main, .screen { width: 100%; max-width: none; margin: 0; padding: 0; }
  .document-card { border: 0; border-radius: 0; box-shadow: none; overflow: visible; filter: none !important; }
  .document-content { padding: 0; }
  .watermark { color: rgba(0, 0, 0, .10); inset: 5% -10%; }
  #document { user-select: text; -webkit-user-select: text; }
  .record-item, .clinical-section, .document-header { break-inside: avoid; }
  .print-only { display: block; margin-top: 12px !important; }
  body.print-disabled #document { display: none !important; }
  body.print-disabled #view-screen::before {
    content: "Printing is disabled for this document.";
    display: block;
    font-size: 16px;
    font-weight: 700;
  }
}
