/* The web viewer's own page (fhir/shl/web-viewer). The perspective inside the frame brings Save as HTML's stylesheet;
   these colors follow it so the two read as one page. */
:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #ffffff; --text: #1c1f24; --muted: #5d6673; --border: #dde1e7; --accent: #1a5fb4;
  --error: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171b; --surface: #1e2227; --text: #e8eaed; --muted: #a0a8b3; --border: #343a42; --accent: #7ab0ff;
    --error: #ff8a80; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar-inner { max-width: 52rem; margin-inline: auto; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap;
  align-items: center; gap: 0.5rem 1rem; }
.brand { font-weight: 600; color: var(--accent); flex-basis: 100%; font-size: 0.85rem; letter-spacing: 0.02em; }
.heading { flex: 1 1 14rem; min-width: 0; }
h1 { font-size: 1.3rem; line-height: 1.25; margin: 0; }
.muted { color: var(--muted); margin: 0.15rem 0 0; font-size: 0.9rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

button { font: inherit; font-size: 0.9rem; padding: 0.45rem 0.9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--accent); }
button:hover { border-color: var(--accent); }
form button { background: var(--accent); color: var(--surface); border-color: var(--accent); }

main { display: block; }
.panel { width: calc(100% - 2rem); max-width: 32rem; margin: 2rem auto; padding: 1.25rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; }
.panel.error #message-text { color: var(--error); }
form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
label { font-weight: 600; }
input { font: inherit; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); width: 9rem; }

/* The frame grows to its content's height (viewer.js), so the page scrolls as one document. */
#content { display: block; width: 100%; border: 0; min-height: 60vh; background: var(--bg); }

@media print {
  .actions, .brand, .panel { display: none !important; }
  .bar { border: 0; }
  body, #content { background: #fff; }
}
