
:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef4f7;
  color: #15313a;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, #d5f0eb 0, transparent 38%), #eef4f7; }
main { width: min(920px, calc(100% - 32px)); margin: 48px auto; display: grid; gap: 20px; }
.card { background: rgba(255,255,255,.96); border: 1px solid #d8e3e7; border-radius: 18px; padding: 28px; box-shadow: 0 18px 50px rgba(26,61,72,.08); }
.hero { padding: 38px; }
.eyebrow { margin: 0 0 8px; color: #08786e; font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; line-height: 1.12; color: #102d35; }
h1 { font-size: clamp(2rem, 6vw, 3.8rem); max-width: 720px; }
h2 { font-size: 1.35rem; }
.lede { max-width: 720px; font-size: 1.1rem; line-height: 1.65; color: #45616a; }
.status { margin: 24px 0 16px; padding: 14px 16px; border-radius: 12px; background: #edf4f5; font-weight: 650; }
.status.connected { color: #08655d; background: #def4ee; }
.status.error { color: #8a2d2d; background: #fbe8e8; }
.status.warning { color: #704d08; background: #fff1c9; }
button, .button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: #08786e; color: white; padding: 11px 16px; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #065e57; }
.secondary { background: #e6eff1; color: #21444e; }
.secondary:hover { background: #d6e5e8; }
.danger { color: #8b2828; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.search-row { display: grid; grid-template-columns: auto minmax(180px,1fr) auto 90px auto; align-items: center; gap: 10px; }
.resource-id-control { display: grid; grid-column: 3 / 5; grid-template-columns: auto minmax(140px, 1fr); align-items: center; gap: 8px 10px; }
.resource-id-control .hint { grid-column: 1 / -1; margin: 0; }
.careplan-type-control { grid-column: 1 / -1; padding: 12px 14px; border-radius: 10px; background: #edf4f5; }
.careplan-type-control label { display: block; margin-bottom: 6px; }
.careplan-type-control .hint { margin: 8px 0 0; }
.search-constraints { grid-column: 1 / -1; padding: 12px 14px; border-radius: 10px; background: #edf4f5; }
.search-constraint-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.constraint-field label { display: block; margin-bottom: 6px; }
.search-constraints .hint { margin: 8px 0 0; }
label { font-size: .86rem; font-weight: 750; color: #49636b; }
select, input { width: 100%; border: 1px solid #c8d7db; border-radius: 9px; background: white; padding: 10px; font: inherit; color: #15313a; }
.hint { color: #5d747b; font-size: .9rem; line-height: 1.5; }
.granted-access { margin: 12px 0 16px; color: #49636b; font-size: .86rem; }
.granted-access summary { cursor: pointer; font-weight: 750; }
.granted-access code { display: block; margin-top: 10px; color: #36545d; line-height: 1.55; overflow-wrap: anywhere; }
.scope-warning { margin: 10px 0 0; padding: 10px 12px; border-radius: 9px; background: #fff1c9; color: #704d08; line-height: 1.5; }
.result-message { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #edf4f5; color: #36545d; line-height: 1.5; }
.result-error { margin: 12px 0 0; }
.temporal-graph { margin-top: 16px; padding: 18px; border: 1px solid #cfe0e3; border-radius: 14px; background: linear-gradient(145deg, #f8fcfb, #f2f8f9); }
.temporal-graph-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.temporal-graph-heading h3 { margin: 0; color: #15313a; font-size: 1.08rem; }
.temporal-graph-heading button { flex: 0 0 auto; padding: 8px 12px; }
.temporal-graph > .hint { margin: 8px 0 2px; }
.temporal-graph-list { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.timeline-event { position: relative; display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 16px; padding: 0 0 20px 34px; }
.timeline-event:last-child { padding-bottom: 0; }
.timeline-event::after { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 10px; width: 2px; border-radius: 2px; background: #9bc9c3; }
.timeline-event::before { content: ""; position: absolute; z-index: 1; top: 5px; left: 4px; width: 10px; height: 10px; border: 3px solid white; border-radius: 50%; background: #08786e; box-shadow: 0 0 0 2px #69aaa2; }
.timeline-event-undated::before, .timeline-event-undated::after { display: none; }
.timeline-time-empty { min-height: 1px; }
.timeline-time-range { color: #08655d; font-size: .84rem; font-weight: 800; line-height: 1.45; }
.timeline-time-range time { color: inherit; font: inherit; white-space: nowrap; }
.timeline-event time { color: #08655d; font-size: .84rem; font-weight: 800; line-height: 1.45; }
.timeline-event article { min-width: 0; padding: 12px 14px; border: 1px solid #d8e3e7; border-radius: 10px; background: white; box-shadow: 0 5px 18px rgba(26,61,72,.05); }
.timeline-event .resource-kind { margin: 0 0 4px; color: #08786e; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.timeline-event h4 { margin: 0; color: #15313a; font-size: .98rem; line-height: 1.35; overflow-wrap: anywhere; }
.timeline-event .timeline-date-kind { margin: 7px 0 0; color: #5d747b; font-size: .82rem; line-height: 1.4; }
.timeline-event-card dl { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 5px 14px; margin: 12px 0 0; }
.timeline-event-card dt { color: #5d747b; font-size: .84rem; font-weight: 750; }
.timeline-event-card dd { min-width: 0; margin: 0; color: #36545d; overflow-wrap: anywhere; }
.timeline-event-card button { margin-top: 14px; }
.result-list { display: grid; gap: 12px; margin-top: 16px; }
.result-card { padding: 16px; border: 1px solid #d8e3e7; border-radius: 12px; background: #fbfdfd; }
.result-card .resource-kind { margin: 0 0 5px; color: #08786e; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.result-card h3 { margin: 0; color: #15313a; font-size: 1.05rem; }
.resource-semantics-warning { margin: 10px 0 0; }
.patient-profile-note { margin: 10px 0 0; color: #526c74; font-size: .9rem; line-height: 1.5; }
.result-card dl { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 5px 14px; margin: 12px 0 0; }
.result-card dt { color: #5d747b; font-size: .84rem; font-weight: 750; }
.result-card dd { min-width: 0; margin: 0; color: #36545d; overflow-wrap: anywhere; }
.result-card dd.patient-field-value,
.result-card dd.location-field-value,
.timeline-event-card dd.location-field-value { white-space: pre-wrap; }
.patient-profile-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.patient-profile-section { min-width: 0; padding: 18px; border: 1px solid #d8e3e7; border-radius: 10px; background: white; }
.patient-profile-section h4 { margin: 0; color: #15313a; font-size: .98rem; }
.result-card .patient-profile-section dl { grid-template-columns: 1fr; gap: 4px; }
.patient-profile-section dd + dt { margin-top: 12px; }
.result-card dd.patient-field-missing { color: #63777d; font-style: italic; }
.result-card button { margin-top: 14px; }
.empty-result { margin: 0; padding: 16px; border: 1px dashed #c8d7db; border-radius: 12px; color: #526c74; }
.result-warning { margin: 0; padding: 13px 15px; border-radius: 10px; background: #fff1c9; color: #704d08; line-height: 1.5; }
.response-trace { margin-top: 16px; padding: 14px 16px; border: 1px solid #cfe0e3; border-radius: 12px; background: #f7fbfb; }
.response-trace summary { cursor: pointer; color: #21444e; font-weight: 800; }
.response-trace > .hint { margin: 10px 0; }
.response-trace-stages { display: grid; gap: 10px; margin: 14px 0; padding-left: 22px; }
.response-trace-stages li { color: #36545d; line-height: 1.5; }
.response-trace-stages strong { display: block; color: #15313a; }
.response-trace-stages span { display: block; }
.field-check-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid #d8e3e7; }
.field-check-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; margin-top: 7px; }
.field-check-form .hint { margin: 8px 0 0; }
.field-check-result { min-height: 1.5em; margin: 10px 0 0; color: #21444e; font-weight: 700; line-height: 1.5; }
.advanced-result { margin-top: 16px; }
.advanced-result summary { cursor: pointer; color: #36545d; font-weight: 750; }
.advanced-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.advanced-actions button { padding: 8px 12px; }
.copy-status { color: #49636b; font-size: .86rem; line-height: 1.4; }
.pagination-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pagination-controls .page-label { color: #5d747b; font-size: .9rem; font-weight: 700; }
.hub-panel { margin-top: 16px; padding: 16px; border: 1px solid #d8e3e7; border-radius: 12px; background: #fbfdfd; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hub-counts { margin: 0 0 14px; color: #36545d; line-height: 1.5; }
.hub-intelligence-view { margin-top: 16px; padding-top: 4px; }
.hub-intelligence-view h3 { margin: 18px 0 4px; color: #15313a; font-size: 1.05rem; }
.hub-intelligence-view pre { min-height: 160px; }
.hub-delete-panel { margin-top: 16px; padding: 16px; border: 1px solid #e7b9b9; border-radius: 12px; background: #fff5f5; color: #623434; }
.hub-delete-panel p { margin-top: 0; line-height: 1.55; }
.hub-delete-panel button { margin-right: 8px; }
.hub-delete-panel .danger { background: #8b2828; color: white; }
.hub-delete-panel .danger:hover { background: #6f2020; }
pre { min-height: 240px; max-height: 620px; overflow: auto; border-radius: 12px; background: #0f2931; color: #d9f1ec; padding: 18px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.note p { margin-bottom: 0; color: #526c74; line-height: 1.65; }
.legal-notice { max-width: 760px; margin: 18px 0; padding: 14px 16px; border-left: 4px solid #08786e; border-radius: 8px; background: #f0f8f6; color: #36545d; line-height: 1.55; }
.consent-control { max-width: 760px; margin: 0 0 16px; }
.consent-control label { display: flex; align-items: flex-start; gap: 10px; color: #36545d; font-size: .94rem; line-height: 1.5; cursor: pointer; }
.consent-control input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: #08786e; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: #076c64; text-underline-offset: 2px; }
a:hover { color: #064f4a; }
.legal-main { width: min(840px, calc(100% - 32px)); }
.legal-document { padding: clamp(24px, 5vw, 52px); }
.legal-document h1 { margin-top: 6px; font-size: clamp(2rem, 6vw, 3.25rem); }
.legal-document h2 { margin-top: 34px; font-size: 1.35rem; }
.legal-document h3 { margin: 24px 0 6px; color: #21444e; font-size: 1rem; }
.legal-document p, .legal-document li { color: #405e67; line-height: 1.72; }
.legal-document ul { padding-left: 22px; }
.legal-meta { margin: 12px 0 30px; color: #61777e; font-size: .9rem; }
.back-link { display: inline-block; margin-bottom: 28px; font-weight: 700; text-decoration: none; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; padding: 8px 16px 24px; color: #60767d; font-size: .88rem; }
.site-footer a { font-weight: 700; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
  .patient-profile-sections { grid-template-columns: 1fr; }
  main { margin: 20px auto; }
  .card, .hero { padding: 22px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .search-row { grid-template-columns: 1fr; }
  .resource-id-control { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .temporal-graph-heading { flex-direction: column; }
  .timeline-event { grid-template-columns: 1fr; gap: 5px; }
  .timeline-event-undated .timeline-time-empty { display: none; }
  .field-check-row { grid-template-columns: 1fr; }
  .result-card dl, .timeline-event-card dl { grid-template-columns: 1fr; gap: 3px; }
  .result-card dd + dt, .timeline-event-card dd + dt { margin-top: 7px; }
}
