/* RadDraft interface. System fonts only: no external requests. */
:root {
  --ink: #1b2533; --text: #344054; --muted: #667085; --line: #e4e7ec; --line-strong: #cfd4dc;
  --bg: #f4f5f7; --paper: #fff; --accent: #0f5f73; --accent-dark: #0b4a5a; --accent-soft: #e6f1f4;
  --warn: #9a6200; --warn-soft: #fff4d6; --warn-line: #f0d48a;
  --good: #1a7a45; --good-soft: #e3f5ea; --danger: #b42318; --danger-soft: #fdecea;
  --radius: 6px; --sidebar: 15rem;
}
* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.3; }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .9rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem .75rem; z-index: 50; }
:focus-visible { outline: 3px solid #7cc4d6; outline-offset: 1px; }

/* Shell */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--paper); border-right: 1px solid var(--line); padding: 1rem .75rem; overflow-y: auto; }
.shell { margin-left: var(--sidebar); min-height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; padding: .15rem .5rem 1rem; margin: 0; }
.brand-mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--accent); color: #fff; font-size: 1.05rem; }
.nav-heading { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 1rem .6rem .35rem; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sidebar svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 1rem; height: 4rem; padding: 0 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb a { color: var(--muted); }
.account { display: flex; align-items: center; gap: .7rem; }
.avatar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.who { display: grid; line-height: 1.25; }
.who strong { color: var(--ink); }
.who span { font-size: .85rem; color: var(--muted); }
/* Pages are full-width and fluid: no max-width on the page container (see AGENTS.md). */
main { padding: 1.5rem; display: grid; gap: 1.25rem; }
.guest-main { display: block; padding: 0; }

/* Sign-in */
.login { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 3rem; color: #fff; background: linear-gradient(155deg, var(--accent) 0%, #0a3e4c 100%); }
.login-brand .brand { color: #fff; padding: 0; font-size: 1.5rem; }
.login-brand .brand-mark { background: #fff; color: var(--accent-dark); width: 2.3rem; height: 2.3rem; font-size: 1.25rem; }
.login-tagline { font-size: 2rem; font-weight: 700; line-height: 1.25; max-width: 22ch; margin: 0 0 1.5rem; }
.login-brand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; font-size: 1.1rem; color: #d7ebf0; }
.login-brand li { padding-left: 1.6rem; position: relative; }
.login-brand li::before { content: ""; position: absolute; left: 0; top: .5em; width: .6rem; height: .6rem; border-radius: 50%; background: #7fd0e0; }
.login-foot { margin: 0; color: #b5d8e0; font-size: .95rem; }
.login-form { display: grid; place-items: center; padding: 2rem; background: var(--paper); }
.login-form > div { width: 100%; max-width: 26rem; }
.login-form h1 { font-size: 1.9rem; margin-bottom: .3rem; }
.login-form .muted { font-size: 1.05rem; margin-bottom: 1.5rem; }
.login-form label { font-size: 1.05rem; margin-top: 1.2rem; }
.login-form input:not([type=hidden]) { padding: .85rem .9rem; font-size: 1.15rem; }
.login-form .btn { margin-top: 1.75rem; padding: .85rem; font-size: 1.1rem; }
.login-form .help { margin-top: 1.25rem; text-align: center; }
@media (max-width: 800px) {
  .login { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-brand { padding: 1.5rem; gap: 1rem; }
  .login-brand > div, .login-foot { display: none; }
  .login-form { padding: 2rem 1.25rem; }
}

/* Page furniture */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.columns { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.25rem; align-items: start; }
.columns.wide-left { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); }
.stack { display: grid; gap: 1.25rem; }
.sticky { position: sticky; top: 5.25rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 1.15rem; }

/* Forms and buttons */
label, legend { display: block; font-weight: 600; color: var(--ink); margin: .9rem 0 .35rem; padding: 0; }
.card-body > label:first-child, .grid label, .section:first-child label { margin-top: 0; }
.req { color: var(--danger); }
.help { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }
input:not([type=radio]):not([type=checkbox]), textarea { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; color: var(--ink); background: #fff; }
textarea { resize: vertical; font-size: 1.07rem; line-height: 1.6; }
fieldset { border: 0; padding: 0; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .55rem .95rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { border-color: transparent; color: var(--accent-dark); }
.btn.small { padding: .3rem .65rem; font-size: .9rem; }
.btn.block { width: 100%; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.chips legend { width: 100%; margin-top: 0; }
.chip { margin: 0; font-weight: 500; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; gap: .4rem; align-items: center; padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); }
.chip small { color: var(--muted); font-size: .8rem; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid #7cc4d6; outline-offset: 1px; }
.js .js-hide { display: none; }
#search-form .btn { margin-top: 1rem; }

/* Badges and notices */
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0 0; }
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 4px; font-size: .82rem; font-weight: 600; background: #eef0f3; color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.badge.soft { background: #f7f8fa; color: var(--muted); font-weight: 500; }
.badge.accent { background: var(--accent-soft); color: var(--accent-dark); border-color: #b9d9e1; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: #b5e0c5; }
.alert { padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); margin: .75rem 0 0; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #5c3c00; }
.alert.danger { background: var(--danger-soft); border-color: #f3c0bb; color: var(--danger); }
.empty { padding: 2rem 1.15rem; text-align: center; }

/* Search results */
.results { list-style: none; margin: 0; padding: 0; max-height: 32rem; overflow-y: auto; }
.results li { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.15rem; border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.results li:hover { background: #fafbfc; }
.result { display: grid; gap: .25rem; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.result-title { font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.result:hover .result-title { color: var(--accent-dark); text-decoration: underline; }
.result .badges { margin: 0; }
.snippet { color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .85rem; font-weight: 600; color: var(--muted); background: #fafbfc; padding: .6rem 1.15rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem 1.15rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* Past report */
.paper { padding: 1.5rem 1.75rem; color: var(--ink); font-size: 1.07rem; line-height: 1.65; }
.paper-title { text-align: center; text-transform: uppercase; letter-spacing: .03em; font-size: 1.1rem; margin-bottom: 1rem; }
.pre { white-space: pre-wrap; margin: 0 0 1rem; overflow-wrap: anywhere; }
.ticks { margin: .6rem 0 1.1rem; padding-left: 1.1rem; color: var(--muted); display: grid; gap: .25rem; }

/* Editor */
.keys { color: var(--muted); font-size: .85rem; }
kbd { font: inherit; font-size: .8rem; padding: .05rem .35rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: #fafbfc; color: var(--ink); }
.section { position: relative; }
.section textarea { overflow: hidden; min-height: 3.6rem; }
.suggestions { list-style: none; margin: .25rem 0 0; padding: .3rem; border: 1px solid var(--accent); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 22px rgba(20, 40, 60, .16); position: absolute; left: 0; right: 0; z-index: 5; max-height: 17rem; overflow-y: auto; }
.suggestions li { padding: .45rem .6rem; border-radius: 4px; cursor: pointer; color: var(--ink); }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--accent-soft); }
.checklist { list-style: none; margin: 0; padding: .4rem 0; }
.checklist li { display: flex; align-items: center; gap: .6rem; padding: .35rem 1.15rem; }
.checklist li::before { content: ""; width: .95rem; height: .95rem; border-radius: 50%; border: 2px solid var(--warn-line); background: var(--warn-soft); flex: none; }
.checklist li.done::before { border-color: var(--good); background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.checklist a { color: var(--ink); text-decoration: none; font-weight: 500; }
.checklist li.done a { color: var(--muted); font-weight: 400; }
.checklist a:hover { text-decoration: underline; }
.carried-group h3 { margin: 1rem 0 .4rem; color: var(--muted); }
.carried-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.carried-item { display: flex; align-items: flex-start; gap: .4rem; padding: .5rem .55rem; border: 1px solid var(--warn-line); background: #fffaf0; border-radius: var(--radius); }
.carried-item:has(input:checked) { border-color: var(--line); background: #fafbfc; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; margin: 0; flex: 1; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.check input { width: 1.05rem; height: 1.05rem; margin: .2rem 0 0; flex: none; accent-color: var(--accent); }
mark { background: #ffd96b; color: inherit; padding: 0 .15em; border-radius: 3px; font-weight: 600; }
[hidden] { display: none !important; }

@media (max-width: 1000px) {
  .columns, .columns.wide-left { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .6rem .75rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
  .sidebar .brand { padding: 0 .5rem 0 0; }
  .sidebar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
  .nav-heading { display: none; }
  .shell { margin-left: 0; }
  .topbar { position: static; padding: 0 1rem; }
  .who { display: none; }
  main { padding: 1rem; }
}

/* Team and forms */
.columns.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .columns.even { grid-template-columns: minmax(0, 1fr); } }
.form-narrow { max-width: 34rem; }
.field + .field { margin-top: 1rem; }
.field label { margin-top: 0; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field-error { color: var(--danger); font-weight: 600; margin: .3rem 0 0; }
select { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; color: var(--ink); background: #fff; }
input:disabled, select:disabled { background: var(--bg); color: var(--muted); }
.form-actions { margin-top: 1.4rem; }
.field .check { align-items: center; font-weight: 600; }
.field .check input { margin: 0; }
.actions-cell { text-align: right; }
.alert.success { background: var(--good-soft); border-color: #b5e0c5; color: #0f5130; margin: 0; }
.alert.error { background: var(--danger-soft); border-color: #f3c0bb; color: var(--danger); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* AI drafting */
#findings-form .btn { margin-top: 1rem; }
.btn:disabled { opacity: .7; cursor: progress; }
code { font-size: .92em; background: #eef0f3; padding: .05rem .3rem; border-radius: 4px; }
.pasted { background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; margin: 0; color: var(--ink); max-height: 16rem; overflow-y: auto; }
.pasted + h3 { margin-top: 1rem; }
.notes { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; color: var(--ink); }
main > .alert { margin: 0; }

/* AI suggestions beside the draft */
.suggestion-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .6rem; }
.suggestion { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; display: grid; gap: .35rem; }
.suggestion p { margin: 0; }
.suggestion .small { font-size: .8rem; }

/* The report as it prints. On screen it fills its card; on paper it is the whole page. */
.nav-count { margin-left: auto; }
/* On screen the report sits on an A4 sheet, at paper size and with the paper margins, so it reads as it will print. */
.paper-desk { background: #e7e9ee; border-radius: var(--radius); padding: 1.5rem; overflow-x: auto; }
.paper-note { margin: 0 0 .8rem; text-align: center; color: #555; font-size: .85rem; }
.sheet { color: #000; font: 12pt/1.5 Cambria, Georgia, "Times New Roman", serif; }
.paper-desk .sheet { position: relative; box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 0 auto; padding: var(--sheet-top, 15mm) 15mm 18mm; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.12); }
.paper-desk .sheet::after { content: "End of page 1"; position: absolute; left: 0; right: 0; top: calc(297mm - 18mm); border-top: 1px dashed #b9bdc7; padding: 1mm 15mm 0; text-align: right; font: 8pt/1.2 system-ui, sans-serif; color: #8a8f9a; pointer-events: none; }
.sheet-head { display: grid; grid-template-columns: repeat(var(--sheet-columns, 3), minmax(0, 1fr)); border-top: 1px solid #888; border-left: 1px solid #888; margin: 0 0 1.4em; }
.sheet-head div { border-right: 1px solid #888; border-bottom: 1px solid #888; padding: .35em .6em; font-weight: 700; overflow-wrap: anywhere; }
.sheet-title { font: 700 1.15em/1.3 Calibri, "Segoe UI", system-ui, sans-serif; text-align: center; text-transform: uppercase; text-decoration: underline; margin: 0 0 .7em; color: #000; }
.sheet-section { margin: 0 0 1em; }
.sheet-section h3 { font: 700 1.1em/1.4 Cambria, Georgia, serif; text-decoration: underline; margin: 0 0 .4em; color: #000; }
.sheet-section p { margin: 0 0 .45em; overflow-wrap: anywhere; }
.sheet-justify .sheet-section p { text-align: justify; }
.sheet-label { font: 700 1.05em/1.4 Calibri, "Segoe UI", system-ui, sans-serif; }
.sheet-section ul { margin: .3em 0 .6em; padding-left: 2.6em; }
.sheet-section li { margin: 0 0 .25em; padding-left: .4em; }
.sheet-strong { font-weight: 700; }
.sheet-advice { margin-top: 1.6em; }
.sheet-sign { display: grid; justify-items: start; margin-top: 3em; font-weight: 700; break-inside: avoid; }

/* Page designs. Every design shares the blocks above; these rules draw each design's shell. */
.paper-desk .sheet { display: flex; flex-direction: column; }
.sheet { --sans: Calibri, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.sh-foot { margin-top: auto; padding-top: .5em; border-top: 1px solid #555; display: grid; gap: .15em; text-align: center; font-size: .78em; color: #444; }
.sheet-sign + .sh-foot { margin-top: 1.2em; }
.paper-desk .sheet-sign { margin-top: auto; padding-top: 2.5em; }
.sheet-sign:empty { display: none; }

/* Classic letterhead */
.d-classic .sh-head { text-align: center; padding-bottom: .8em; margin-bottom: 1.2em; border-bottom: 3px double #111; }
.d-classic .sh-name { font-size: 1.65em; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.2; }
.d-classic .sh-tag { margin-top: .2em; font-size: .82em; letter-spacing: .1em; text-transform: uppercase; }
.d-classic .sh-contact { margin-top: .3em; font-size: .82em; color: #444; }

/* Shared by the three sans-serif designs */
.d-band, .d-lab, .d-modern { font-family: var(--sans); font-size: 11pt; }
.d-band .sheet-label, .d-lab .sheet-label, .d-modern .sheet-label { font: inherit; font-weight: 700; }
.d-band .sheet-section h3, .d-lab .sheet-section h3, .d-modern .sheet-section h3 { font: 700 .8em/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--accent); }
.d-band.sheet-justify .sheet-section p, .d-modern.sheet-justify .sheet-section p { text-align: left; }
.sh-key { font-size: .8em; letter-spacing: .05em; text-transform: uppercase; color: #4a5560; }
.sh-value { font-weight: 700; overflow-wrap: anywhere; }

/* Hospital band */
.d-band .sh-head { display: flex; justify-content: space-between; align-items: center; gap: 1.5em; padding: 1.1em 1.3em; margin-bottom: 1.1em; background: var(--accent); color: #fff; border-radius: 6px; }
.d-band .sh-name { font-size: 1.55em; font-weight: 700; line-height: 1.2; }
.d-band .sh-tag { font-size: .85em; opacity: .92; }
.d-band .sh-contact { text-align: right; font-size: .82em; line-height: 1.45; }
.d-band .sh-patient { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7em 1.4em; padding: .8em 1.1em; background: #eef3f5; border-radius: 6px; }
.d-band .sheet-title { margin: 1.2em 0 .5em; padding-bottom: .3em; text-align: left; text-decoration: none; text-transform: none; font: 700 1.3em/1.3 var(--sans); color: var(--accent); border-bottom: 2px solid var(--accent); }
.sh-rows { display: grid; }
.sh-row { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 0 1em; padding: .42em 0; border-bottom: 1px solid #d5dde0; break-inside: avoid; }
.sh-row-label { font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.sh-row-full { grid-template-columns: minmax(0, 1fr); }
.sh-row ul { margin: 0; }
.d-band .sh-box { margin-top: 1.2em; padding: .8em 1.1em; border: 1.5px solid var(--accent); border-radius: 6px; break-inside: avoid; }
.d-band .sh-box ul { margin: 0; padding-left: 1.3em; }
.d-band .sh-box p { margin: 0 0 .2em; }
.d-band .sheet-sign, .d-modern .sheet-sign { justify-items: end; text-align: right; }

/* Diagnostic centre */
.d-lab .sh-head { margin-bottom: .9em; }
.d-lab .sh-name { font-size: 1.7em; font-weight: 700; line-height: 1.15; color: var(--accent); text-transform: uppercase; }
.d-lab .sh-tag { font-size: .82em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #b4400f; }
.d-lab .sh-contact { font-size: .8em; color: #44506a; }
.d-lab .sh-patient { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15em 2em; padding: .6em 0; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.d-lab .sh-line { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: .5em; }
.d-lab .sh-line .sh-key { font-size: 1em; letter-spacing: 0; text-transform: none; }
.d-lab .sheet-title { margin: 1em 0 .2em; text-decoration: none; font: 700 1.2em/1.3 var(--sans); letter-spacing: .05em; color: var(--accent); }
.d-lab .sheet-section { margin-bottom: .3em; }
.d-lab .sheet-section h3.sh-bar { margin: .9em 0 .5em; padding: .3em .7em; background: #e9edf5; }
.d-lab .sh-in { padding: 0 .7em; }
.d-lab .sheet-advice { margin-top: 0; }
.sh-end { margin: 1em 0 0; text-align: center; font-size: .8em; letter-spacing: .12em; text-transform: uppercase; color: #44506a; }
.d-lab .sheet-sign { justify-items: end; text-align: right; }
.d-lab .sh-foot { border-top: 0; padding-top: 0; gap: .5em; }
.sh-foot-band { display: block; padding: .6em 1em; background: var(--accent); color: #fff; border-radius: 4px; }

/* Modern, impression first */
.d-modern .sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5em; padding-bottom: .8em; border-bottom: 2px solid var(--accent); }
.d-modern .sh-tag { font-size: .8em; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #5b6168; }
.d-modern .sheet-title { margin: .15em 0 0; text-align: left; text-decoration: none; text-transform: none; font: 700 2.1em/1.1 var(--sans); letter-spacing: -.01em; }
.d-modern .sh-contact { font-size: .8em; color: #5b6168; text-align: right; }
.d-modern .sh-patient { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5em, 1fr)); gap: .6em 1.2em; margin: .9em 0 0; }
.d-modern .sh-key { letter-spacing: 0; text-transform: none; }
.d-modern .sh-box { margin: 1.3em 0 0; padding: 1em 1.3em; background: #f1f3f5; border-radius: 8px; break-inside: avoid; }
.d-modern .sh-box h3 { color: #5b6168; }
.d-modern .sh-box ul { margin: 0; padding: 0; list-style: none; }
.d-modern .sh-box > ul li { padding: 0; font-weight: 400; font-size: 1.05em; }
.d-modern .sh-box > ul li:first-child { font-size: 1.45em; font-weight: 700; line-height: 1.3; }
.d-modern .sh-box p { margin: 0 0 .2em; }
.d-modern .sh-advice { margin-top: .6em; }
.d-modern .sheet-section { margin-top: 1.4em; margin-bottom: 0; }
.d-modern .sheet-section h3 { color: #5b6168; }
.sh-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2em; }
.sh-cell { padding: .5em 0; border-top: 1px solid #d9dce0; break-inside: avoid; }
.sh-cell-full { grid-column: 1 / -1; }
.sh-cell ul { margin: 0; padding-left: 1.3em; }

/* Modern runs tighter so a full abdomen report, with the female lines and remarks, stays on one page. */
.d-modern .sh-box { margin-top: 1em; padding: .75em 1.1em; }
.d-modern .sh-box > ul li:first-child { font-size: 1.3em; }
.d-modern .sheet-section { margin-top: 1em; }
.d-modern .sh-cell { padding: .32em 0; font-size: 10pt; line-height: 1.35; }
.d-modern .sh-cell .sheet-label { font-size: 10.5pt; }
.paper-desk .d-modern .sheet-sign { padding-top: 1.4em; }

/* The design page: pick a design, fill the clinic details, see the page. */
.design-pick { display: grid; gap: .6rem; margin: 0 0 1rem; padding: 0; border: 0; }
.design-pick legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.design-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .6rem; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; cursor: pointer; margin: 0; }
.design-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.design-option input { margin-top: .25rem; }
.design-option strong { font-weight: 600; }
.design-option .help { grid-column: 2; margin: 0; }

@media print {
  html { font-size: 11pt; }
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .skip, main > .alert { display: none !important; }
  .shell { margin: 0; min-height: 0; }
  main { padding: 0 !important; display: block !important; }
  .card, .card-body { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; background: none !important; }
  .paper-desk { background: none; padding: 0; overflow: visible; }
  .paper-desk .sheet { display: block; width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .paper-desk .sheet-sign { margin-top: 3em; padding-top: 0; }
  .sh-foot { margin-top: 1.5em; }
  .paper-desk .sheet::after, .paper-note { display: none; }
  .sheet-section p, .sheet-section li { break-inside: avoid; }
  .sheet-section h3 { break-after: avoid; }
  .sheet-section p { orphans: 3; widows: 3; }
}
.btn.blocked:disabled { opacity: .5; cursor: not-allowed; }
