@font-face { font-family: "Kaya Record Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/dm-sans-400-e61ddb36.ttf") format("truetype"); }
@font-face { font-family: "Kaya Record Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/dm-sans-500-de24c3d4.ttf") format("truetype"); }
@font-face { font-family: "Kaya Record Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/dm-sans-600-6abe779a.ttf") format("truetype"); }
@font-face { font-family: "Kaya Record Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/dm-sans-700-e810d4d0.ttf") format("truetype"); }
@font-face { font-family: "Kaya Record Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/dm-serif-display-regular-ae10d956.ttf") format("truetype"); }

/* Compact patient identity, followed by the complete clinical history. */
.patient-breadcrumb { margin: -.5rem 0 .5rem; color: var(--muted); font-size: .875rem; }
.patient-breadcrumb ol { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.patient-breadcrumb li + li::before { content: "/"; padding-right: .75rem; font-weight: 400; }
.patient-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.patient-breadcrumb a:hover { text-decoration: underline; }
.patient-breadcrumb [aria-current] { font-weight: 600; overflow-wrap: anywhere; }
#patient-profile-header .patient-identity-banner { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 1rem; padding: 1.25rem 1.5rem; border: 0; border-radius: 16px; background: var(--navy); color: var(--surface); }
.patient-identity-avatar { display: grid; place-items: center; width: 3rem; height: 3rem; flex: 0 0 3rem; border-radius: 50%; background: var(--lilac); color: var(--navy); font-weight: 600; }
.patient-identity-banner .patient-detail-identity { flex: 1 1 13rem; gap: .25rem; }
.patient-identity-banner .patient-detail-name h1 { color: var(--surface); font-size: clamp(1.625rem, 2.2vw, 2rem); }
.patient-identity-banner .patient-detail-name { flex-wrap: wrap; gap: .125rem 1rem; }
.patient-identity-banner .patient-profile-edit-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--lilac); font-size: .8125rem; text-decoration: underline; text-underline-offset: .2em; }
.patient-identity-banner .patient-profile-edit-link:hover { color: var(--surface); }
.patient-identity-banner .patient-profile-edit-link:focus-visible { outline-color: var(--lilac); }
.patient-identity-banner .patient-detail-facts.patient-facts-inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
.patient-identity-banner .patient-detail-facts > div { display: flex; align-items: center; gap: .375rem; }
.patient-identity-banner .patient-detail-facts > div > dt { color: var(--lilac); }
.patient-identity-banner .patient-detail-facts > div > dd { margin: 0; color: var(--lilac-soft); }
.patient-identity-banner .patient-detail-facts > div > dd > a,
.patient-identity-banner .patient-detail-facts > div > dd > button { color: var(--lilac-soft); text-underline-offset: .2em; }
.patient-identity-banner .patient-detail-facts > div > dd > button { margin-left: .5rem; }
.patient-identity-banner .patient-detail-actions { gap: .5rem; }
.patient-identity-banner .patient-detail-actions .patient-communications-trigger { background: var(--lilac-soft); border-color: var(--lilac-soft); color: var(--navy); }
.patient-identity-banner .patient-detail-actions .patient-communications-trigger:hover { background: var(--lilac); border-color: var(--lilac); }
.patient-identity-banner .patient-detail-actions .button:focus-visible { outline-color: var(--lilac); }
.patient-identity-banner dialog { color: var(--ink); }
.history-workspace { container: history-workspace / inline-size; }
@media (min-width: 651px) {
  .patient-directory-page .cycle-creation-workspace:has(.history-workspace),
  .patient-directory-page .cycle-creation-workspace:has(.history-workspace) > [data-cycle-creation-target="content"] { height: 100%; min-height: 0; }
}
.history-workspace-grid { display: grid; grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.history-navigation, .history-reading-panel, .history-panels { min-width: 0; }
.history-navigation { position: sticky; top: var(--history-navigation-top, 1rem); max-height: calc(100dvh - var(--history-navigation-top, 1rem) - 1rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; z-index: 2; border-radius: 16px; }
.history-completion { padding: 1.25rem; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.history-completion > summary { list-style: none; cursor: pointer; }
.history-completion > summary::-webkit-details-marker { display: none; }
.history-completion-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .875rem; font-weight: 600; }
.history-completion-title strong { color: var(--periwinkle); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-completion progress { appearance: none; display: block; width: 100%; height: .375rem; margin: .75rem 0; border: 0; border-radius: 1rem; background: var(--lilac-soft); color: var(--periwinkle); overflow: hidden; }
.history-completion progress::-webkit-progress-bar { background: var(--lilac-soft); }
.history-completion progress::-webkit-progress-value { background: var(--periwinkle); border-radius: 1rem; }
.history-completion progress::-moz-progress-bar { background: var(--periwinkle); border-radius: 1rem; }
.history-completion-caption { display: block; margin-top: .375rem; color: var(--muted); font-size: .75rem; }
.history-group-list { list-style: none; margin: 1rem -1.25rem 0; padding: 0; }
.history-group-list li + li { border-top: 1px solid var(--line); }
.history-group-list a { display: grid; grid-template-columns: 1rem minmax(0, 1fr) 1rem; align-items: start; gap: .5rem; padding: .75rem 1.25rem; min-height: 44px; color: var(--ink); text-decoration: none; line-height: 1.4; }
.history-group-list a:focus-visible { outline-offset: -3px; }
.history-group-list a:hover { background: var(--paper); }
.history-group-list a[aria-current] { background: var(--lilac-soft); }
.history-group-list strong { display: block; font-size: .8125rem; font-weight: 500; }
.history-group-list small { display: block; margin-top: .25rem; color: var(--muted); font-size: .75rem; }
.history-group-list [data-history-incomplete="true"] strong { font-weight: 600; }
.history-group-list [data-history-incomplete="true"] small { display: inline-block; padding: .125rem .375rem; border-radius: 4px; background: var(--warning-soft); color: var(--warning-ink); font-weight: 500; }
.history-group-list [data-history-incomplete="true"] .history-group-icon { color: var(--warning-ink); }
.history-group-icon, .history-group-list a > svg { margin-top: .125rem; color: var(--periwinkle); }
.history-group-icon[data-state="complete"] { color: var(--success); }
.history-group-icon .ui-icon, .history-group-list a > .ui-icon { width: 1rem; height: 1rem; }
.history-reading-panel { container: history-reading / inline-size; }
.history-reading-section { scroll-margin-top: var(--history-scroll-offset, 1rem); }
.history-reading-section + .history-reading-section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line-strong); }
.history-panel-heading { margin-bottom: 1.25rem; }
.history-panel-heading h2 { margin: 0; font-family: var(--font-sans); font-size: 1.5rem; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.history-panel-heading h2:focus { outline: none; }
.history-panel-heading h2:focus-visible { outline: 2px solid var(--periwinkle); outline-offset: 4px; }
.history-panel-heading > p { margin: .5rem 0 0; color: var(--muted); font-size: .75rem; }
.history-panel-layout { display: grid; gap: 1rem; align-items: start; }
.history-panels { container: history-panels / inline-size; display: grid; gap: 1rem; }
.history-panel { padding: 1.25rem; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); overflow-wrap: anywhere; }
.history-panel h3 { margin: 0 0 1rem; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.history-panel p { margin: 0; max-width: 70ch; font-size: .875rem; line-height: 1.7; }
.history-panel p + p { margin-top: .75rem; }
.history-panel .history-reason { font-size: 1rem; line-height: 1.75; white-space: pre-line; }
.history-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; margin: 0; }
.history-facts > div { min-width: 0; padding: .75rem 1rem; background: var(--paper); border-radius: 10px; }
.history-facts dt { margin-bottom: .375rem; color: var(--muted); font-size: .75rem; font-weight: 400; line-height: 1.4; }
.history-facts dd { margin: 0; color: var(--ink); font-size: .875rem; line-height: 1.6; white-space: pre-line; }
.history-metrics .history-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
.history-metrics dd { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-metric-date { display: block; font-size: .875rem; font-weight: 500; }
.history-condition-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.history-condition-list li { padding: .5rem .75rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); font-size: .8125rem; }
.history-panel.history-records-panel { padding: 0; }
.history-record-section { display: grid; gap: 1rem; padding: 1.25rem; }
.history-record-section + .history-record-section { border-top: 1px solid var(--line-strong); }
.history-record-section h3 { margin: 0; font-size: .9375rem; }
.history-record-section > * { min-width: 0; }
.history-record-list { margin: 0; padding: 0; list-style: none; }
.history-record-list li + li { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.history-record-list strong { font-size: .875rem; font-weight: 600; line-height: 1.5; }
.history-record-list dl { display: flex; flex-wrap: wrap; gap: .25rem 0; margin: .25rem 0 0; }
.history-record-list dl > div + div { margin-left: .75rem; padding-left: .75rem; border-left: 1px solid var(--line-strong); }
.history-record-list dd { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.history-context { padding: 1.25rem; border-radius: 16px; background: var(--navy); color: var(--surface); overflow-wrap: anywhere; }
.history-context h3 { margin: 0 0 1rem; color: inherit; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; }
.history-context p { margin: 0; color: var(--lilac-soft); font-size: .875rem; line-height: 1.7; }
.history-context p + p { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--periwinkle); }
.history-inline-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: .75rem; font-size: .8125rem; }
.history-document-list { list-style: none; margin: 0; padding: 0; }
.history-document-list li { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.history-document-list li + li { border-top: 1px solid var(--line); }
.history-document-list li > span { flex: 1; min-width: 0; }
.history-document-list strong { display: block; font-size: .875rem; font-weight: 500; }
.history-document-list small { display: block; margin-top: .25rem; color: var(--muted); font-size: .75rem; }
.history-document-list li > a { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 44px; font-size: .8125rem; }
.history-panel .history-note-meta { margin: -.5rem 0 1rem; color: var(--muted); font-size: .75rem; }
.history-empty p { color: var(--muted); }
.history-workspace a, .history-workspace button { text-underline-offset: .2em; }
.history-workspace button { min-height: 44px; }
.history-workspace :focus-visible { outline: 2px solid var(--periwinkle); outline-offset: 3px; }
.history-workspace ::selection { background: var(--lilac-soft); color: var(--navy); }
.history-mobile-label { display: none; }
.history-completion:not([open]) .history-mobile-label { display: block; margin-top: .75rem; color: var(--periwinkle); font-size: .8125rem; }
@container history-reading (min-width: 900px) {
  .history-panel-layout.has-context { grid-template-columns: minmax(0, 1fr) 15rem; }
}
@container history-panels (min-width: 600px) {
  .history-record-section { grid-template-columns: 12rem minmax(0, 1fr); gap: 1.5rem; }
}
@container history-workspace (max-width: 720px) {
  .history-workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .history-completion { padding: 1rem; }
  .history-group-list { margin-left: -1rem; margin-right: -1rem; }
  .history-group-list a { padding-left: 1rem; padding-right: 1rem; }
}
@container history-reading (max-width: 450px) {
  .history-panel { padding: 1rem; border-radius: 12px; }
  .history-panel-heading h2 { font-size: 1.375rem; }
  .history-metrics .history-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-facts > div { padding: .75rem; }
  .history-record-section { padding: 1rem; }
}
@container patient-workspace (max-width: 600px) {
  #patient-profile-header .patient-identity-banner { padding: 1rem; gap: .75rem; }
  .patient-identity-banner .patient-detail-identity { flex-basis: calc(100% - 4rem); }
  .patient-identity-banner .patient-detail-actions { justify-content: flex-start; }
}
.patient-identity-banner, .history-workspace { --font-sans: "Kaya Record Sans", "DM Sans", sans-serif; --font-serif: "Kaya Record Serif", "DM Serif Display", serif; font-family: var(--font-sans); }
.patient-identity-banner .patient-detail-actions .button { font-size: .8125rem; padding: .625rem .875rem; }
@media (max-width: 650px) {
  .patient-record-layout:not(.clinical-review-layout) > .patient-sidebar { display: none; }
  .patient-identity-banner .patient-detail-actions .button { width: auto; min-height: 44px; }
  .patient-identity-banner .patient-detail-actions { width: 100%; }
}
