:root {
  color-scheme: light;
  font:
    14px/1.5 "Segoe UI",
    Arial,
    sans-serif;
  color: #24384b;
  background: #f2f5f8;
  --blue: #176497;
  --navy: #103553;
  --border: #dce4eb;
  --muted: #627587;
  --surface: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.6px;
  line-height: 1.25;
}
h2 {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.35;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #b8ccd9;
  border-radius: 5px;
  padding: 8px 14px;
  color: #185f8b;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}
button:hover,
.button:hover {
  background: #eef6fc;
  border-color: #6b9ab9;
  text-decoration: none;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button.primary,
.search-fields > button,
.login-card button,
.release-panel form > button {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
button.primary:hover,
.search-fields > button:hover,
.login-card button:hover {
  background: #10527f;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #279fe9;
  outline-offset: 3px;
}
input,
select {
  padding: 8px 10px;
  min-height: 38px;
  color: #24384b;
  background: #fff;
  border: 1px solid #bbcbd7;
  border-radius: 4px;
  max-width: 100%;
  min-width: 0;
}
label {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #43596b;
}
form {
  margin: 0;
}
input[type="checkbox"] {
  min-height: auto;
}
small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
code {
  font-size: 12px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    13px/1.7 ui-monospace,
    monospace;
  max-height: 500px;
  overflow: auto;
}
.icon {
  height: 20px;
  width: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.app-header {
  height: 65px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 26px;
  position: relative;
  z-index: 5;
  border-bottom: 3px solid #3898b9;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: #fff;
  font-size: 17px;
  letter-spacing: 1.8px;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 39px;
  height: 39px;
  object-fit: contain;
}
.brand b {
  font-weight: 400;
  opacity: 0.72;
}
.app-name {
  padding-left: 25px;
  border-left: 1px solid #496377;
  font-size: 16px;
  font-weight: 500;
}
.header-readonly {
  display: flex;
  gap: 7px;
  align-items: center;
  background: #234861;
  border: 1px solid #3c627b;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  color: #dceaf2;
}
.header-readonly .icon {
  width: 13px;
  height: 13px;
}
.account {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.account small {
  color: #b9cedd;
  font-size: 10px;
}
.account-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #42627a;
}
.account button {
  margin-left: 15px;
  color: #e2edf4;
  border-color: #4c6b81;
  background: transparent;
  font-size: 11px;
  padding: 4px 10px;
  min-height: 29px;
}
.workspace-body {
  display: flex;
  min-height: calc(100vh - 102px);
}
.app-sidebar {
  width: 205px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav-item,
.nav-form {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 9px 12px;
  border-radius: 5px;
  color: #526678;
  font-size: 13px;
  font-weight: 500;
}
.nav-item:hover {
  text-decoration: none;
  background: #f1f6fa;
}
.nav-item.active,
.nav-form.active {
  background: #e6f1f8;
  color: #125d8a;
  box-shadow: inset 3px 0 #2584b5;
}
.nav-item.muted {
  color: #7e8c98;
}
.nav-form {
  padding: 0 12px;
}
.nav-form form {
  flex: 1;
}
.nav-form button {
  width: 100%;
  justify-content: flex-start;
  padding: 9px 0;
  min-height: 43px;
  background: none;
  border: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}
.sidebar-note {
  margin-top: auto;
  padding: 60px 13px 6px;
  color: #6e808e;
  font-size: 11px;
}
.sidebar-note > .icon {
  margin-bottom: 12px;
  color: #86a4b7;
}
.sidebar-note strong {
  display: block;
  color: #536c7d;
  font-size: 11px;
  margin-bottom: 5px;
}
.sidebar-note p {
  line-height: 1.65;
}
.main-content {
  flex: 1;
  min-width: 0;
  padding: 27px 30px 30px;
  max-width: 2000px;
}
.page-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.page-heading p,
.section-heading p {
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
}
.page-heading .badge {
  margin-top: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9e4ec;
  background: #f3f7fa;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .icon {
  width: 12px;
  height: 12px;
}
.badge.green {
  background: #eef7f2;
  color: #287353;
  border-color: #d3e9dc;
}
.badge.amber {
  background: #fff8e9;
  color: #83600d;
  border-color: #f0e3bd;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 22px;
  overflow: hidden;
  box-shadow: 0 2px 4px #18364703;
}
.panel-heading {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-heading h2 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-heading h2 .icon {
  width: 17px;
  color: #5385a4;
}
.panel-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.search-fields {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 22px 22px 0;
}
.search-fields > label {
  flex: 1;
  min-width: 0;
}
.search-fields input {
  width: 100%;
}
.search-fields > button {
  min-height: 38px;
}
.field-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 22px 20px;
}
.empty-state {
  padding: 68px 25px 75px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 {
  color: #3f576a;
  margin: 16px 0 8px;
}
.empty-state p {
  font-size: 12px;
  max-width: 390px;
  margin: auto;
}
.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #edf4f9;
  color: #7094ad;
}
.empty-icon .icon {
  width: 25px;
  height: 25px;
}
.empty-state button {
  margin-top: 16px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  background: #f6f8fa;
  color: #63788a;
  text-align: left;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
th,
td {
  padding: 14px 20px;
  border-bottom: 1px solid #e7edf2;
  vertical-align: middle;
}
td {
  overflow-wrap: anywhere;
}
td strong {
  font-weight: 600;
}
td button {
  font-size: 11px;
  padding: 6px 11px;
  min-height: 31px;
}
td small {
  margin-top: 4px;
}
tbody tr:hover {
  background: #f8fbfd;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.record-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 165px;
}
.record-title .icon {
  color: #5f8fac;
  width: 17px;
}
.breadcrumb {
  display: flex;
  gap: 9px;
  color: #7b8f9f;
  font-size: 11px;
  margin: -5px 0 18px;
}
.breadcrumb a {
  color: #637c8f;
}
.patient-banner {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 21px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px 7px 0 0;
  border-top: 3px solid #408fb3;
}
.patient-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e9f1f7;
  display: grid;
  place-items: center;
  color: #5f85a0;
  flex-shrink: 0;
}
.patient-avatar .icon {
  width: 27px;
  height: 27px;
}
.patient-name {
  min-width: 160px;
}
.patient-name h1 {
  font-size: 22px;
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}
.patient-name .eyebrow {
  font-size: 9px;
  margin-bottom: 5px;
}
.patient-name > span:last-child {
  font-size: 11px;
  color: #65798a;
}
.patient-name > span strong {
  margin-left: 8px;
  color: #3e5568;
}
.patient-meta {
  display: flex;
  align-self: stretch;
  gap: 30px;
  border-left: 1px solid var(--border);
  padding-left: 25px;
  margin-left: 18px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  min-width: 0;
}
.patient-meta strong {
  font-size: 11px;
  display: block;
  margin-top: 4px;
  color: #43596b;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.patient-banner > .badge {
  margin-left: auto;
}
.chart-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 0;
  margin-bottom: 25px;
  padding: 0 20px;
  border-radius: 0 0 5px 5px;
}
.chart-tabs button {
  border: 0;
  border-radius: 0;
  font-size: 12px;
  padding: 12px 15px;
  background: none;
  color: #61788a;
}
.chart-tabs .selected {
  border-bottom: 3px solid #2281ae;
  margin-bottom: -1px;
}
.chart-tabs .selected button {
  color: #14648d;
  font-weight: 650;
}
.chart-tabs > span {
  margin-left: auto;
  font-size: 10px;
  color: #7a8d9a;
  display: flex;
  align-items: center;
  gap: 5px;
}
.chart-tabs .icon {
  width: 12px;
  height: 12px;
}
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fcfdfe;
}
.filter-bar form:first-child {
  display: flex;
  align-items: flex-end;
  gap: 13px;
}
.filter-bar input {
  font-size: 12px;
  min-width: 155px;
}
.filter-bar button {
  font-size: 11px;
  min-height: 38px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  gap: 8px;
}
.pagination button {
  font-size: 11px;
}
.source-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #6d8393;
}
.source-note .icon {
  height: 15px;
  width: 15px;
}
.encounter-basket {
  position: sticky;
  top: 12px;
  width: 460px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
  z-index: 5;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid #aacbdc;
  border-top: 3px solid #e7ad43;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf0, #fff 65%);
  box-shadow: 0 6px 24px #10355330;
}
.encounter-basket button {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}
.cart-release {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 9px;
  font-size: 11px;
}
.cart-release summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}
.cart-release p {
  margin: 9px 0;
  color: var(--muted);
}
.cart-release form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}
.cart-release label {
  font-size: 11px;
  min-width: 0;
}
.release-request-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  grid-column: 1 / -1;
  flex-basis: 100%;
}
.release-request-fields fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  grid-column: 1 / -1;
}
.release-request-fields legend {
  font-size: 11px;
  font-weight: 600;
  padding: 0 4px;
}
.release-request-fields label {
  min-width: 0;
  font-size: 11px;
}
.release-request-fields input, .release-request-fields select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
}
.release-request-fields small {
  font-size: 10px;
  line-height: 1.4;
}
.release-request-fields .requestor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.requestor-options label {
  position: relative;
  cursor: pointer;
}
.requestor-options input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.requestor-options .third-party-details {
  flex-basis: 100%;
  cursor: default;
}
.requestor-options .third-party-details[hidden] {
  display: none;
}
.requestor-options span {
  display: block;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #b8ccd9;
  border-radius: 4px;
}
.requestor-options input:checked + span {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.requestor-options input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.release-date-range, .release-record-types {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.release-date-range {
  margin: 8px 0;
}
.release-request-fields .release-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.release-request-fields .release-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}
.release-title-filter {
  grid-column: 1 / -1;
}
.release-receipt {
  padding: 18px;
  margin: 16px 0;
}
.release-receipt dl {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr;
  gap: 8px 16px;
  font-size: 12px;
}
.release-receipt dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.cart-release input, .cart-release select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
}
.encounter-basket .cart-release button {
  grid-column: auto;
  grid-row: auto;
  white-space: normal;
  align-self: end;
  background: #ffdc78;
  border-color: #e7ad43;
}
.encounter-basket:has(.cart-release[open]) {
  width: 507.15px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
.basket-summary [data-selected-encounters] {
  display: block;
}
.encounter-basket[hidden], .encounter-select[hidden] {
  display: none;
}
.basket-icon {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  color: var(--blue);
}
.basket-summary {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.basket-summary > strong {
  color: var(--navy);
}
.basket-total {
  display: inline-block;
  margin: 4px 0;
  padding: 2px 12px;
  border-radius: 20px;
  background: #ffdc78;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}
.basket-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}
.encounter-actions, .encounter-select {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.encounter-actions > form, .encounter-actions > label {
  flex: 0 0 auto;
}
.encounter-select {
  min-height: 44px;
  cursor: pointer;
  font-size: 11px;
}
.encounter-select input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.encounter-table tr.encounter-selected {
  background: #eaf4fa;
}
.mfa-qr {
  display: block;
  width: 264px;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  image-rendering: pixelated;
}
.mfa-qr[hidden] { display: none; }
.mfa-enrollment { margin-bottom: 20px; }
.mfa-enrollment summary { cursor: pointer; }
.select-all-encounters {
  min-height: 20px;
}
@media (max-width: 600px) {
  .encounter-basket {
    top: 6px;
    grid-template-columns: 68px minmax(0, 1fr);
    padding: 10px;
    gap: 8px;
  }
  .encounter-basket button {
    grid-column: 2;
    grid-row: 2;
  }
}
.encounter-heading {
  margin-bottom: 16px;
}
.encounter-heading .eyebrow {
  font-size: 10px;
  margin-bottom: 5px;
  color: #4d829f;
}
.encounter-heading h2 {
  font-size: 20px;
}
.encounter-heading p span {
  padding: 0 5px;
  color: #9aadb9;
}
.encounter-heading button {
  font-size: 11px;
}
.source-details {
  background: #fffcf3;
  border: 1px solid #eee5c7;
  border-radius: 5px;
  padding: 9px 13px;
  margin-bottom: 16px;
  font-size: 11px;
  color: #786537;
}
.source-details summary {
  cursor: pointer;
  font-weight: 600;
}
.source-details summary > span {
  font-weight: 400;
  margin-left: 12px;
}
.source-details p {
  margin-top: 7px;
}
.encounter-reader {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  border: 1px solid #cfdbe4;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.document-nav {
  background: #fff;
  border-right: 1px solid var(--border);
  max-height: 78vh;
  overflow: auto;
}
.document-nav-heading {
  padding: 17px 17px 14px;
  border-bottom: 1px solid var(--border);
}
.document-nav-heading h3 {
  font-size: 13px;
}
.document-nav-heading > span {
  font-size: 10px;
  color: var(--muted);
}
.document-jump {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  border: 0;
  border-bottom: 1px solid #e9eef2;
  border-radius: 0;
  width: 100%;
  padding: 16px 15px;
  gap: 9px;
  color: #435f74;
  font-size: 11px;
  line-height: 1.4;
  min-height: 68px;
}
.document-jump .icon {
  width: 16px;
  height: 16px;
  color: #769ab2;
  margin-top: 2px;
}
.document-jump strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.document-jump small {
  font-size: 10px;
  margin-top: 5px;
}
.document-jump.selected {
  background: #eaf4fa;
  color: #155f8a;
  box-shadow: inset 3px 0 #318db5;
}
.document-note {
  padding: 26px 18px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #80929f;
  font-size: 10px;
  line-height: 1.7;
}
.document-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 3px;
}
.reader-main {
  min-width: 0;
}
.reader-toolbar {
  min-height: 54px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 9px 14px;
  background: #fcfdfe;
  font-size: 11px;
  flex-wrap: wrap;
}
.page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-controls button {
  font-size: 20px;
  min-height: 29px;
  height: 29px;
  padding: 0 10px;
}
.page-controls label {
  flex-direction: row;
  align-items: center;
  font-size: 11px;
}
.page-controls input {
  width: 49px;
  padding: 3px;
  min-height: 29px;
  text-align: center;
  font-weight: 400;
}
.zoom-control {
  flex-direction: row;
  align-items: center;
  font-size: 11px;
  margin-left: auto;
}
.zoom-control select {
  font-size: 11px;
  padding: 4px 6px;
  min-height: 29px;
}
.reader-toolbar > button {
  min-height: 29px;
  font-size: 10px;
  padding: 4px 8px;
}
.reader-status {
  padding: 7px 15px;
  border-bottom: 1px solid #dce4ec;
  background: #f6f9fc;
  font-size: 10px;
  color: #607c91;
  min-height: 30px;
}
.reader-status.error {
  color: #9b3d32;
  background: #fff2ef;
}
.page-stack {
  height: 70vh;
  min-height: 420px;
  overflow: auto;
  background: #e7edf2;
  padding: 20px 24px;
  scroll-behavior: auto;
  overscroll-behavior: contain;
}
.record-page {
  margin: 0 auto 24px;
  max-width: 100%;
  scroll-margin-top: 12px;
}
.page-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #657e91;
  font-size: 9px;
  padding: 0 1px 9px;
}
.page-caption strong {
  white-space: nowrap;
  font-weight: 600;
}
.page-caption > span {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.page-surface {
  background: white;
  box-shadow: 0 2px 9px #2b435221;
  min-height: 200px;
  width: 100%;
  overflow: hidden;
}
.page-placeholder {
  height: 800px;
  display: grid;
  place-items: center;
  color: #a2b2be;
  font-size: 13px;
}
.page-surface canvas {
  display: block;
  max-width: none;
}
.reader-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0 17px;
}
.reader-bottom p {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: #788c9d;
}
.reader-bottom p .icon {
  width: 14px;
  height: 14px;
}
.reader-bottom button {
  font-size: 10px;
  min-height: 30px;
  padding: 5px 10px;
}
.release-panel {
  background: #fff;
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 5px;
  font-size: 12px;
}
.release-panel summary {
  cursor: pointer;
  color: #3e6985;
  font-weight: 600;
}
.release-panel p {
  margin-top: 10px;
  color: var(--muted);
}
.release-panel form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.release-panel form > label {
  flex: 1;
}
.release-panel button {
  font-size: 11px;
  min-height: 38px;
}
.notice {
  background: #eaf5f1;
  border: 1px solid #ccdfd7;
  padding: 12px 16px;
  border-radius: 5px;
  color: #336751;
  font-size: 12px;
  margin-bottom: 18px;
}
.login-card .login-notice {
  background: #fff4d6;
  border-color: #e8d398;
  color: #715411;
  margin: 16px 0;
}
.app-footer {
  height: 37px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  background: #fff;
  border-top: 1px solid var(--border);
  color: #8496a3;
  font-size: 9px;
}
.app-footer > span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-footer .icon {
  width: 12px;
  height: 12px;
}
.footer-dot {
  padding: 0 6px;
}
.skip-link {
  position: absolute;
  top: -60px;
  left: 10px;
  z-index: 20;
  background: #fff;
  padding: 10px;
}
.skip-link:focus {
  top: 5px;
}
.login-main {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 90px;
  max-width: 1120px;
  padding: 95px 45px;
  margin: auto;
  min-height: calc(100vh - 102px);
  align-items: center;
}
.login-intro h1 {
  font-size: 42px;
  line-height: 1.2;
  color: #183d58;
  letter-spacing: -1.2px;
}
.login-intro > .eyebrow {
  color: #4d8ba9;
  margin-bottom: 22px;
}
.login-intro > p {
  font-size: 15px;
  line-height: 1.8;
  color: #6b8293;
  margin-top: 23px;
  max-width: 410px;
}
.login-benefits {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 36px;
  color: #56758b;
  font-size: 12px;
}
.login-benefits > span {
  display: flex;
  gap: 11px;
  align-items: center;
}
.login-benefits .icon {
  width: 17px;
  height: 17px;
  color: #5290ad;
}
.login-intro .omega-definition {
  margin-top: 32px;
  border-left: 3px solid #4d8ba9;
  padding: 4px 0 4px 18px;
}
.omega-definition .omega-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #52758a;
}
.omega-definition .omega-words {
  margin: 13px 0 0;
  display: grid;
  gap: 8px;
}
.omega-words > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 13px;
  align-items: center;
}
.omega-words dt {
  margin: 0;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
  color: #126988;
  text-align: center;
}
.omega-words dd {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  color: #183d58;
}
@media (max-width: 700px) {
  .login-intro .omega-definition {
    margin-top: 22px;
    padding-left: 14px;
  }
  .omega-definition .omega-words {
    gap: 6px;
  }
  .omega-words dt {
    font-size: 21px;
  }
  .omega-words dd {
    font-size: 16px;
  }
}
.login-card {
  background: #fff;
  border: 1px solid #dbe5ed;
  border-radius: 9px;
  box-shadow: 0 10px 35px #1b46610a;
  padding: 32px;
}
.login-card h2 {
  font-size: 22px;
  margin-bottom: 10px;
}
.login-card > p {
  color: var(--muted);
  font-size: 12px;
}
.login-card form {
  margin-top: 27px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.login-card label {
  font-size: 12px;
}
.login-card input {
  min-height: 42px;
}
.login-card .trust-browser {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.login-card .trust-browser input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}
.trust-browser small {
  font-size: 11px;
  margin-top: 4px;
}
.login-card button {
  margin-top: 4px;
  min-height: 42px;
  justify-content: space-between;
}
.login-security {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 21px;
  margin-top: 25px;
  font-size: 10px;
  color: #7b8e9d;
}
.login-security .icon {
  height: 16px;
  width: 16px;
}
.secret {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 16px;
  background: #edf3f7;
  padding: 12px;
}
.error-panel {
  padding: 35px;
  grid-column: 1/-1;
}
.error-panel p {
  margin: 20px 0;
}
.main-content > table {
  background: #fff;
}
.main-content > form {
  margin: 15px 0;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.main-content > h2 {
  margin-bottom: 15px;
}
.main-content > p {
  margin-bottom: 15px;
}
.main-content > details {
  overflow-wrap: anywhere;
}
@media (min-width: 1700px) {
  .main-content {
    padding-left: 40px;
    padding-right: 40px;
  }
  .encounter-reader {
    grid-template-columns: 265px minmax(0, 1fr);
  }
}
@media (max-width: 1150px) {
  .app-sidebar {
    width: 175px;
  }
  .main-content {
    padding: 22px;
  }
  .app-header {
    gap: 18px;
    padding: 0 18px;
  }
  .header-readonly {
    display: none;
  }
  .patient-meta {
    gap: 12px;
    padding-left: 15px;
    margin-left: 0;
  }
  .patient-banner {
    gap: 12px;
    padding: 18px;
  }
  .patient-banner > .badge {
    white-space: normal;
    max-width: 120px;
  }
  .encounter-reader {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .search-fields {
    flex-wrap: wrap;
  }
  .search-fields > label {
    min-width: 130px;
  }
  .search-fields > button {
    margin-top: 4px;
  }
  .patient-name h1 {
    font-size: 19px;
  }
  .login-main {
    gap: 45px;
  }
  .login-intro h1 {
    font-size: 36px;
  }
}
@media (max-width: 850px) {
  .app-sidebar {
    width: 62px;
    padding: 23px 8px;
  }
  .sidebar-note {
    display: none;
  }
  .nav-item,
  .nav-form {
    font-size: 0;
    padding: 10px 12px;
    gap: 0;
    min-height: 43px;
    position: relative;
  }
  .nav-form form {
    position: absolute;
    inset: 0;
  }
  .nav-form button {
    font-size: 0;
    min-height: 43px;
  }
  .app-header .brand span {
    display: none;
  }
  .app-name {
    padding-left: 17px;
    font-size: 14px;
  }
  .account {
    font-size: 11px;
  }
  .account button {
    margin-left: 0;
  }
  .main-content {
    padding: 20px 18px;
  }
  .patient-meta {
    display: none;
  }
  .patient-banner > .badge {
    max-width: none;
    white-space: normal;
  }
  .page-stack {
    padding: 14px;
  }
  .reader-toolbar {
    gap: 9px;
  }
  .reader-toolbar > button {
    display: none;
  }
  .encounter-reader {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .zoom-control {
    margin-left: 0;
  }
  .document-jump {
    padding: 13px 10px;
  }
  .document-jump .icon {
    display: none;
  }
  .panel-heading > span {
    font-size: 10px;
  }
  .login-main {
    padding: 55px 30px;
    grid-template-columns: 1fr 350px;
    gap: 30px;
  }
  .login-card {
    padding: 25px;
  }
  .login-intro h1 {
    font-size: 30px;
  }
}
@media (max-width: 600px) {
  .app-header {
    height: 59px;
    padding: 0 12px;
    gap: 11px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .app-name {
    font-size: 12px;
    padding-left: 11px;
  }
  .account-avatar,
  .account > span:not(.account-avatar) {
    display: none;
  }
  .account {
    gap: 0;
  }
  .account button {
    font-size: 10px;
  }
  .workspace-body {
    display: block;
    min-height: calc(100vh - 96px);
  }
  .app-sidebar {
    width: auto;
    flex-direction: row;
    padding: 5px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 6px;
  }
  .nav-item,
  .nav-form {
    font-size: 10px;
    gap: 6px;
    padding: 6px 9px;
    min-height: 33px;
  }
  .nav-form form {
    position: static;
  }
  .nav-form button {
    font-size: 10px;
    min-height: 25px;
    padding: 0;
  }
  .nav-item .icon,
  .nav-form .icon {
    width: 14px;
    height: 14px;
  }
  .nav-item.muted {
    display: none;
  }
  .main-content {
    padding: 19px 12px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 19px;
  }
  .page-heading > .badge {
    display: none;
  }
  h1 {
    font-size: 24px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .search-fields {
    gap: 12px;
    padding: 18px 16px 0;
  }
  .search-fields > label {
    flex-basis: 40%;
    min-width: 115px;
  }
  .search-fields > button {
    width: 100%;
  }
  .panel-heading {
    padding: 13px 16px;
  }
  .panel-heading > span {
    max-width: 135px;
    text-align: right;
  }
  .field-hint {
    padding: 11px 16px 17px;
  }
  .empty-state {
    padding: 45px 20px 55px;
  }
  .patient-banner {
    padding: 15px 12px;
    gap: 11px;
    flex-wrap: wrap;
  }
  .patient-avatar {
    width: 42px;
    height: 42px;
  }
  .patient-name {
    min-width: 0;
    flex: 1;
  }
  .patient-name h1 {
    font-size: 19px;
  }
  .patient-banner > .badge {
    margin-left: 53px;
    font-size: 9px;
  }
  .patient-name .eyebrow {
    font-size: 8px;
  }
  .chart-tabs {
    padding: 0 7px;
    gap: 0;
    margin-bottom: 21px;
  }
  .chart-tabs > span {
    font-size: 9px;
  }
  .chart-tabs button {
    font-size: 11px;
    padding: 10px 12px;
  }
  .section-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .section-heading > .muted {
    display: none;
  }
  .section-heading h2 {
    font-size: 18px;
  }
  .section-heading p {
    font-size: 11px;
  }
  .filter-bar {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .filter-bar form:first-child {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-bar input {
    min-width: 0;
    width: 135px;
  }
  .filter-bar label {
    font-size: 10px;
  }
  .filter-bar button {
    min-height: 34px;
  }
  .encounter-heading {
    flex-direction: column;
  }
  .encounter-heading button {
    min-height: 30px;
  }
  .source-details summary > span {
    display: block;
    margin: 4px 0 0;
  }
  .encounter-reader {
    display: flex;
    flex-direction: column;
  }
  .document-nav {
    max-height: 170px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .document-nav-heading {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .document-jump {
    min-height: 49px;
    padding: 9px 12px;
  }
  .document-jump .icon {
    display: block;
  }
  .document-jump small {
    margin-top: 3px;
  }
  .document-note {
    display: none;
  }
  .reader-toolbar {
    padding: 9px 10px;
    justify-content: space-between;
  }
  .page-stack {
    padding: 12px 8px;
    min-height: 350px;
    height: 65vh;
  }
  .page-caption > span {
    max-width: 170px;
  }
  .reader-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .app-footer {
    height: auto;
    min-height: 37px;
    padding: 10px 13px;
    font-size: 8px;
  }
  .app-footer > span:first-child {
    max-width: 170px;
  }
  .release-panel {
    padding: 13px;
  }
  .release-panel form > label {
    min-width: 100%;
  }
  .login-main {
    display: flex;
    flex-direction: column;
    padding: 34px 20px;
    gap: 28px;
    min-height: calc(100vh - 110px);
    align-items: stretch;
  }
  .login-intro h1 {
    font-size: 29px;
  }
  .login-intro > p {
    font-size: 12px;
    margin-top: 13px;
  }
  .login-intro > .eyebrow {
    font-size: 9px;
    margin-bottom: 13px;
  }
  .login-benefits {
    display: none;
  }
  .login-card {
    padding: 24px;
  }
  .signed-out .app-header .brand span {
    display: inline;
    font-size: 14px;
  }
  .signed-out .app-name {
    margin-left: auto;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .source-note {
    font-size: 10px;
    align-items: flex-start;
  }
}
@media print {
  body {
    display: none;
  }
}
.release-print-pages { display: none; }
@media print {
  @page { size: letter; margin: 0.5in; }
  body.release-print-ready { display: block !important; margin: 0; padding: 0; background: white; }
  body.release-print-ready > :not(.release-print-pages) { display: none !important; }
  body.release-print-ready > .release-print-pages[data-ready="true"] { display: block; }
  .release-print-pages > div { width: 7.5in; height: 10in; break-inside: avoid; break-after: page; }
  .release-print-pages > div:last-child { break-after: auto; }
  .release-print-pages img { display: block; width: 100%; height: 100%; object-fit: contain; }
}
.main-content > table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.main-content > table pre {
  max-width: 450px;
}
.main-content > table td {
  min-width: 100px;
}
.main-content > form {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .patient-name {
    flex-basis: calc(100% - 55px);
  }
  .patient-banner > .badge {
    margin-left: 53px;
  }
}
@media (max-width: 600px) {
  .app-sidebar .nav-item,
  .app-sidebar .nav-form {
    flex: 1;
    min-width: 0;
    padding: 6px 7px;
  }
  .app-sidebar .nav-form form {
    min-width: 0;
  }
  .app-sidebar .nav-form button {
    white-space: normal;
    text-align: left;
  }
}

.account-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; margin-top:.4rem; }
.account-actions form { margin:0; }
.history-pdf-actions { flex-wrap:nowrap; align-items:flex-start; margin-top:0; }
#lookup-history td:nth-last-child(-n+2) { vertical-align:top; }
.account-detail { display:block; font-size:.8rem; color:var(--muted); margin-top:.35rem; }
.button-danger { background:#b42318; border-color:#b42318; color:#fff; }
.button-danger:hover { background:#912018; border-color:#912018; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; padding:.5rem; min-width:2.4rem; }
.account-form { max-width:42rem; padding:2rem; }
.account-form form { display:grid; gap:1rem; margin-bottom:1rem; }
.account-form label { display:grid; gap:.35rem; }
.account-form small { color:var(--muted); }
.account-form .department-choice { display:flex; flex-direction:row; align-items:center; gap:.6rem; margin:.6rem 0; }
.account-form .department-choice input { flex:0 0 auto; width:auto; }
.account-form fieldset { min-width:0; }
.login-main > .password-setup { grid-column:1 / -1; width:min(100%,42rem); justify-self:center; }
[data-password-rule]::after { content:' — ' attr(data-met); }
.requirement-met { color:#187348; }
.account-table { min-width:1050px; }
.account-table th:first-child { width:210px; }
.account-table td:nth-child(2) { white-space:nowrap; }
.account-table th:last-child { width:240px; }
/* The avatar and name share one profile button and hover/focus target. */
.account .profile-link { display:flex; align-items:center; gap:7px; border:0; text-align:left; padding:4px 6px; max-width:210px; margin-left:0; white-space:normal; line-height:1.25; }
.account .profile-link:hover { background:rgba(255,255,255,.12); }
.account .profile-link small { display:block; }
.account .profile-link .account-avatar { display:grid; flex-shrink:0; }
.profile-name { min-width:0; overflow-wrap:anywhere; }
.account > form { min-width:0; }
@media(max-width:600px) {
  .account { gap:4px; }
  .account .profile-link { max-width:125px; gap:5px; padding:4px; font-size:10px; }
  .account .profile-link .account-avatar { width:25px; height:25px; }
  .account button { margin-left:0; }
}

/* Billing demo shares the archive's lookup and table vocabulary. */
.billing-demo-note { display:flex; align-items:center; gap:12px; padding:13px 16px; margin-bottom:20px; background:#fff8e7; border:1px solid #ecdcad; border-radius:8px; color:#675123; }
.billing-demo-note .badge { flex-shrink:0; }
.billing-search-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
.billing-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.billing-summary .panel { padding:20px; margin:0; }
.billing-summary span,.billing-summary small { display:block; color:var(--muted); }
.billing-summary strong { display:block; font-size:26px; color:var(--navy); margin:5px 0; font-variant-numeric:tabular-nums; }
.billing-money { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.billing-accounts { min-width:800px; }
.billing-transactions { min-width:940px; }
.billing-ledger-hint { padding:0 20px 15px; color:var(--muted); }
@media(max-width:800px) { .billing-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } .billing-search-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:500px) { .billing-search-fields { grid-template-columns:1fr; } .billing-demo-note { align-items:flex-start; flex-direction:column; } .billing-summary { gap:10px; } .billing-summary .panel { padding:12px; } .billing-summary strong { font-size:22px; } }
@media(max-width:800px) {
  [aria-label="Billing account identity"] { flex-wrap:wrap; }
  [aria-label="Billing account identity"] .patient-meta { display:flex; flex-basis:100%; border-left:0; border-top:1px solid var(--border); padding:12px 0 0; margin:0; }
}

.billing-period { margin:0 0 16px; color:var(--muted); }

/* Native selects still submit and validate; the combobox provides filtering. */
select.searchable-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  clip-path: inset(50%);
  overflow: hidden;
}
.searchable-select-input {
  width: 100%;
  min-width: 0;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23627587' stroke-width='2'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
}
.searchable-select-input:disabled { opacity: .55; cursor: not-allowed; }
.zoom-control .searchable-select-input { width: 115px; }
.searchable-select-options {
  position: fixed;
  z-index: 10000;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: white;
  border: 1px solid #6b9ab9;
  border-radius: 5px;
  box-shadow: 0 4px 14px #10355326;
  padding: 4px;
}
.searchable-select-options [role="option"],
.searchable-select-options [role="status"] {
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.searchable-select-options [role="option"] { cursor: pointer; }
.searchable-select-options [role="option"]:hover,
.searchable-select-options .active { background: #e5f2fc; color: #103553; }
@media print { .searchable-select-options { display: none !important; } }

.page-surface { position: relative; }
.chart-search-match { background: #ffe36a; color: inherit; padding: 0; }
/* Geometry follows the bundled PDF.js TextLayer CSS variables. */
.search-text-layer {
  position: absolute;
  inset: 0;
  overflow: clip;
  line-height: 1;
  text-align: initial;
  letter-spacing: normal;
  word-spacing: normal;
  text-size-adjust: none;
  transform-origin: 0 0;
  pointer-events: none;
  --min-font-size: 1;
  --scale-round-x: 1px;
  --scale-round-y: 1px;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.search-text-layer > span, .search-text-layer > br {
  position: absolute;
  color: transparent;
  white-space: pre;
  transform-origin: 0 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate, 0deg)) scaleX(var(--scale-x, 1)) scale(var(--min-font-size-inv));
}
.search-text-layer .chart-search-match { background: #ffd60066; color: transparent; }
.search-text-layer[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.search-text-layer[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.search-text-layer[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
@media print {
  .search-text-layer { display: none !important; }
  .chart-search-match { background: transparent; }
}

/* Financial workflows */
.finance-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:18px 0; }
.finance-toolbar .finance-toolbar { margin:0; }
.finance-panel { padding:24px; margin-bottom:20px; }
.finance-panel h2,.finance-panel h3 { margin-top:0; }
.finance-panel p { color:var(--muted); line-height:1.6; }
.finance-panel summary { font-size:18px; font-weight:700; cursor:pointer; color:var(--navy); }
.finance-panel[open] summary { margin-bottom:18px; }
.finance-panel fieldset { border:1px solid #dce4eb; border-radius:8px; padding:18px; margin:20px 0; min-width:0; }
.finance-panel legend { padding:0 8px; font-weight:700; color:var(--navy); }
.finance-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:16px 0; }
.finance-fields label { min-width:0; }
.finance-fields input,.finance-fields select { width:100%; min-width:0; }
.finance-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.finance-columns .finance-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
.finance-warning { background:#fff8e7; padding:14px; border-radius:6px; }
.finance-service { border-bottom:1px solid #dce4eb; padding:12px 0; }
@media(max-width:1000px) { .finance-columns { grid-template-columns:1fr; } .finance-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .finance-fields,.finance-columns .finance-fields { grid-template-columns:1fr; } .finance-panel { padding:16px; } }

/* Intake panels are scoped so existing chart and department layouts are unchanged. */
.intake-panel { padding:24px; margin-top:20px; overflow-x:auto; }
.intake-panel h2 { margin:0 0 12px; }
.intake-panel p { line-height:1.55; margin:10px 0 16px; }
.intake-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:20px 0; }
.intake-summary > div { padding:14px; background:#f3f7fa; border-radius:6px; }
.intake-summary dt { font-size:13px; color:#506576; }
.intake-summary dd { margin:6px 0 0; font-size:26px; font-weight:650; color:#123a53; }
.intake-item { padding:18px; box-shadow:none; }
.intake-item h3 { margin:0; }
.intake-panel form:not(.inline) { max-width:700px; }
@media(max-width:650px) { .intake-panel { padding:16px; } .intake-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* Preserve readable audit columns on narrow screens. */
.audit-report-table { min-width: 1050px; }
.main-content:has(.audit-workspace) { overflow: hidden; min-height: 0; display: flex; flex-direction: column; padding: 18px 24px; }
.audit-workspace { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.audit-heading, .audit-results-header, .audit-pagination, .audit-filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.audit-heading h1 { margin: 0; font-size: 25px; }
.audit-heading .eyebrow { display: none; }
.audit-heading p { margin: 0; color: var(--muted); }
.audit-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-tools form, .audit-results-header form, .audit-pagination form { margin: 0; }
.audit-tools button { padding: 8px 11px; font-size: 12px; }
.audit-filters.panel { padding: 13px 16px; margin: 0; flex-shrink: 0; }
.audit-filters form { margin: 0; }
.audit-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(160px,1fr)) repeat(2,minmax(155px,1.1fr)) repeat(2,minmax(125px,.8fr)); gap: 10px; }
.audit-filter-grid label { font-size: 12px; margin: 0; min-width: 0; }
.audit-filter-grid input, .audit-filter-grid select { width: 100%; min-width: 0; padding: 8px; margin-top: 4px; }
.audit-filter-footer { justify-content: flex-start; margin-top: 10px; font-size: 12px; color: var(--muted); }
.audit-filter-footer button { padding: 8px 16px; }
.audit-advanced { margin-top: 8px; font-size: 12px; }
.audit-advanced .audit-filter-grid { margin-top: 12px; grid-template-columns: repeat(4,minmax(150px,1fr)); max-height: 30vh; overflow: auto; }
.audit-workspace summary { cursor: pointer; color: #234c73; font-weight: 600; }
.audit-results.panel { padding: 0; margin: 0; min-height: 120px; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.audit-results-header { padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.audit-results-header span { font-size: 12px; color: var(--muted); margin-right: auto; }
.audit-results-header button { font-size: 12px; padding: 5px 12px; }
.audit-results-header button, .audit-pagination button { min-height: 28px; }
.audit-scroll { overflow: auto; min-height: 0; flex: 1; }
.audit-activity-table { width: 100%; table-layout: fixed; margin: 0; border-collapse: collapse; }
.audit-activity-table th { position: sticky; top: 0; z-index: 1; background: #f3f6fa; text-align: left; font-size: 12px; }
.audit-activity-table th:nth-child(1) { width: 23%; }
.audit-activity-table th:nth-child(2) { width: 23%; }
.audit-activity-table th:nth-child(3) { width: 34%; }
.audit-activity-table th:nth-child(4) { width: 20%; }
.audit-activity-table td, .audit-activity-table th { padding: 12px 16px; vertical-align: top; overflow-wrap: anywhere; }
.audit-activity-table td { border-bottom: 1px solid #e5eaf0; font-size: 13px; }
.audit-activity-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.audit-activity-table time small { display: inline; margin-left: 5px; }
.audit-activity-table td:first-child > small { display: none; }
.audit-account { display: block; margin-top: 8px; }
.audit-summary { display: block; color: var(--muted); margin-top: 7px; font-size: 12px; }
.audit-outcome { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 650; background: #edf1f6; }
.audit-outcome-success { background: #e7f3ed; color: #245c43; }
.audit-outcome-denied, .audit-outcome-failure { background: #fbe9e9; color: #983939; }
.audit-outcome-warning { background: #fff0d6; color: #775113; }
.audit-evidence { margin-top: 10px; }
.audit-evidence summary { font-size: 12px; }
.audit-evidence summary span { font-weight: 400; color: var(--muted); }
.audit-evidence dl { font-size: 11px; }
.audit-evidence dt { font-weight: 650; margin-top: 7px; }
.audit-evidence dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.audit-evidence p { font-size: 11px; color: var(--muted); }
.audit-evidence pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; font-size: 10px; background: #f3f6fa; padding: 8px; }
.audit-pagination { padding: 8px 16px; flex-shrink: 0; font-size: 11px; color: var(--muted); }
.audit-pagination button { padding: 6px 12px; font-size: 12px; }
.audit-empty { padding: 35px !important; text-align: center; color: var(--muted); }
.audit-review.panel { margin: 0; padding: 10px 16px; flex-shrink: 0; max-height: 35vh; overflow: auto; font-size: 12px; }
.audit-review-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.audit-review-fields select, .audit-review-fields textarea { width: 100%; }
.audit-attestation { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.audit-attestation input { width: auto; margin: 0; }
@media (max-width: 1300px) { .audit-filter-grid { grid-template-columns: repeat(3,minmax(130px,1fr)); } .audit-heading p { font-size: 12px; } }
@media (max-width: 800px) {
 .main-content:has(.audit-workspace) { overflow: auto; display: block; }
 .audit-workspace { display: block; }
 .audit-workspace > * { margin-bottom: 12px !important; }
 .audit-filter-grid, .audit-advanced .audit-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .audit-results.panel { max-height: 70vh; }
 .audit-scroll { max-height: 60vh; }
 .audit-activity-table { min-width: 720px; }
 .audit-review-fields { grid-template-columns: 1fr; }
}


.patient-summary-panel { padding:24px; }
.patient-summary-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:18px; }
.patient-summary-fields div { min-width:0; border-bottom:1px solid var(--border); padding-bottom:12px; }
.patient-summary-fields dt { font-size:12px; color:var(--muted); }
.patient-summary-fields dd { margin:5px 0 0; overflow-wrap:anywhere; }
.demographics-details { columns:3 260px; column-gap:12px; }
.demographics-details:has(> :only-child) { column-count:1; }
.demographics-details:has(> :nth-child(2):last-child) { column-count:2; }
.demographics-card { break-inside:avoid; border:1px solid var(--border); border-radius:6px; padding:8px 12px; margin-bottom:10px; min-width:0; }
.demographics-card h3 { font-size:14px; }
.demographics-entry { margin-top:8px; padding-top:8px; border-top:1px solid var(--border); font-size:12px; overflow-wrap:anywhere; }
.demographics-card h3 + .demographics-entry { margin-top:6px; padding-top:0; border-top:0; }
.demographics-entry strong { color:var(--muted); font-size:11px; }
.demographics-entry p { margin-top:3px; }
.demographics-details.demographics-compact { columns:4 220px; }
.demographics-compact .demographics-card { padding:6px 10px; margin-bottom:8px; }
.demographics-compact .demographics-card h3 { font-size:13px; }
.demographics-compact .demographics-entry { margin-top:5px; padding-top:5px; font-size:11px; line-height:1.3; }
.demographics-compact .demographics-entry strong { font-size:10px; }
.demographics-compact .demographics-entry p { margin-top:2px; }
.workspace .main-content:has(> .demographics) { padding:18px 20px; }
.demographics .demographics-panel { display:flex; flex-direction:column; flex:0 1 auto; min-height:0; padding:16px; margin:0; overflow:auto; overscroll-behavior:contain; }
.demographics-panel > * { flex-shrink:0; }
.demographics-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.demographics-heading > div { min-width:0; }
.demographics-heading h2 { font-size:16px; }
.demographics-heading .button { min-height:32px; padding:5px 12px; font-size:12px; }
.demographics-heading p { margin-top:3px; color:var(--muted); font-size:12px; }
.demographics-panel .patient-summary-fields { display:block; margin:10px 0; font-size:12px; }
.demographics-panel .patient-summary-fields div { display:flex; align-items:baseline; flex-wrap:wrap; gap:3px 10px; padding-bottom:8px; }
.demographics-panel .patient-summary-fields dd { margin:0; }
.demographics-unavailable { display:flex; flex-wrap:wrap; align-items:baseline; gap:5px 12px; padding:10px 12px; background:#f6f8fa; border-radius:6px; }
.demographics-details + .demographics-unavailable { margin-top:12px; }
.demographics-unavailable h3 { color:var(--muted); font-size:12px; }
.demographics-unavailable ul { display:flex; flex-wrap:wrap; gap:4px 14px; list-style:none; margin:0; padding:0; font-size:12px; }
@media (max-width:600px) {
  .workspace .main-content:has(> .demographics) { padding:10px; }
  .demographics .demographics-panel { padding:12px; }
}

/* Keep the current department prominent above the navigation and switch controls. */
.workspace-department { min-width:0; padding:0 12px 14px; border-bottom:1px solid var(--border); }
.workspace-department .department-heading { margin:0 0 6px; color:var(--navy); font-size:16px; font-weight:750; line-height:1.3; letter-spacing:0; }
.workspace-department p { margin:0; color:#43596b; font-size:13px; font-weight:600; line-height:1.45; overflow-wrap:anywhere; }
.workspace-department form { display:grid; gap:8px; margin-top:12px; }
.workspace-department label { display:flex; min-width:0; }
.workspace-department button { width:100%; }
/* Department switching remains available when navigation collapses on phones/tablets. */
@media (max-width:850px) {
  .workspace-body { display:block; }
  .app-sidebar { width:auto; flex-direction:row; flex-wrap:wrap; padding:8px 12px; }
  .workspace-department { flex:0 0 100%; padding:4px 0 10px; }
  .workspace-department form { display:flex; align-items:flex-end; gap:8px; }
  .workspace-department label { flex:1; min-width:0; }
  .workspace-department select, .workspace-department .searchable-select-input { font-size:16px; }
  .workspace-department button { width:auto; min-height:44px; flex-shrink:0; }
}

/* Optional source annotation overlays. */
.annotation-view-option { display:flex; align-items:center; gap:.5rem; padding:.5rem .8rem; font-size:.9rem; }
.annotation-view-option input,.annotation-output-options input { width:auto; }
.annotation-unavailable { opacity:.55; }
.page-surface { position:relative; }
.page-surface .annotation-overlay { position:absolute; z-index:3; pointer-events:none; max-width:none; object-fit:fill; }
.annotation-output-options small { display:block; margin-top:.5rem; }

/* Signed-in screens behave like an application window. Each data pane owns its scroll. */
@media screen {
  body.workspace {
    height:100vh;
    height:100dvh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  .workspace > .app-header,
  .workspace > .app-footer { flex-shrink:0; }
  .workspace > .workspace-body { flex:1; min-height:0; overflow:hidden; }
  .workspace .app-sidebar { min-height:0; overflow:auto; overscroll-behavior:contain; }
  .workspace .app-sidebar > * { flex-shrink:0; }
  .workspace .main-content {
    display:flex;
    flex-direction:column;
    min-height:0;
    overflow:auto;
    overscroll-behavior:contain;
  }
  .workspace .main-content > * { flex-shrink:0; }
  .workspace .main-content > .panel:not(.search-panel):not(details),
  .workspace .main-content > [data-encounter-selection] > .panel {
    display:flex;
    flex-direction:column;
    flex:1 1 0;
    min-height:120px;
    overflow:auto;
  }
  .workspace .main-content > .panel > *,
  .workspace .main-content > [data-encounter-selection] > .panel > * { flex-shrink:0; }
  .workspace .main-content > .panel > .table-scroll,
  .workspace .main-content > [data-encounter-selection] > .panel > .table-scroll {
    flex:1 1 0;
    min-height:60px;
    overflow:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
  .workspace .table-scroll th {
    position:sticky;
    top:0;
    z-index:1;
    background:#f7f9fb;
  }
  .workspace .main-content > .search-panel {
    max-height:40%;
    overflow:auto;
    overscroll-behavior:contain;
  }
  .workspace .main-content > :last-child { margin-bottom:0; }
  .workspace .main-content > [data-encounter-selection] {
    display:flex;
    flex-direction:column;
    flex:1 1 0;
    min-height:180px;
  }
  .workspace [data-encounter-selection] > * { flex-shrink:0; }
  .workspace .encounter-basket { position:static; }
  .workspace .main-content > .encounter-reader {
    flex:1 1 0;
    min-height:260px;
    grid-template-rows:minmax(0,1fr);
  }
  .workspace .encounter-reader .document-nav { min-height:0; max-height:none; }
  .workspace .encounter-reader .reader-main { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
  .workspace .encounter-reader .reader-main > * { flex-shrink:0; }
  .workspace .encounter-reader .page-stack { flex:1 1 0; height:auto; min-height:0; }
}
@media screen and (max-width:850px) {
  .workspace > .workspace-body { display:flex; flex-direction:column; }
  .workspace .app-sidebar { max-height:40%; }
  .workspace .main-content { flex:1; }
}
@media screen and (max-width:600px) {
  .workspace .encounter-reader .document-nav { max-height:100px; flex-shrink:0; }
  .workspace .encounter-reader .reader-main { flex:1; }
}

/* Patient lookup gives the active grid the full remaining workspace. */
.patient-lookup-heading { margin-bottom:14px; }
.patient-lookup-search { margin-bottom:16px; }
.patient-lookup-search > summary { display:none; }
.patient-lookup-search .search-fields { gap:12px; padding:14px 16px 0; }
.patient-lookup-search .field-hint { padding:8px 16px 12px; }
.lookup-tabs { display:flex; gap:4px; padding:0 12px; border-bottom:1px solid var(--border); }
.lookup-tabs button {
  min-height:44px;
  padding:10px 16px;
  border:0;
  border-bottom:3px solid transparent;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-size:13px;
}
.lookup-tabs button[aria-selected="true"] { border-bottom-color:var(--blue); color:var(--navy); font-weight:700; }
.lookup-tabs button:hover { background:#f1f6fa; }
.lookup-tabs button:focus-visible { outline-offset:-4px; }
.lookup-tabs[hidden], .lookup-tab-panel[hidden] { display:none; }
.workspace .main-content > .patient-lookup-pane { min-height:180px; }
.workspace .main-content > .patient-lookup-pane > .lookup-tab-panel:not([hidden]) {
  display:flex;
  flex-direction:column;
  flex:1 1 0;
  min-height:120px;
  overflow:auto;
}
.lookup-tab-panel > * { flex-shrink:0; }
.lookup-tab-panel > .table-scroll {
  flex:1 1 0;
  min-height:60px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.lookup-tab-panel > .empty-state { flex:1; overflow:auto; }
@media (max-width:600px) {
  .patient-lookup-search > summary { display:list-item; padding:11px 16px; color:var(--navy); font-weight:600; cursor:pointer; }
}

/* Chart review keeps patient context compact and reserves the workspace for encounters. */
.chart-review { position:relative; display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
.chart-review > * { flex-shrink:0; }
.chart-review > .breadcrumb { display:none; }
.chart-review .patient-banner { padding:10px 16px; gap:12px; }
.chart-review .patient-avatar { width:36px; height:36px; }
.support-preview-banner { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:8px 16px; padding:8px 14px; margin-bottom:12px; background:#fff5d6; border:1px solid #cfaa42; border-radius:6px; color:#4c3b10; }
.support-preview-banner strong, .support-preview-banner small { display:block; }
.support-preview-banner small { margin-top:3px; font-size:11px; }
.support-preview-banner form { margin:0; flex-shrink:0; }
.support-preview-banner button { padding:7px 10px; white-space:nowrap; }
.chart-review .patient-avatar .icon { width:21px; height:21px; }
.chart-review .patient-name { display:flex; flex:1; flex-wrap:wrap; align-items:baseline; gap:4px 14px; min-width:0; }
.chart-review .patient-name .eyebrow { display:none; }
.chart-review .patient-name h1 { margin:0; font-size:20px; }
.chart-review .patient-name > span:last-child { white-space:nowrap; }
.chart-review .patient-name > span strong { margin-left:4px; }
.chart-review .patient-meta { display:flex; margin:0; padding-left:14px; max-width:35%; }
.chart-review .patient-meta strong { display:inline; margin:0 0 0 6px; }
.chart-review .chart-tabs { flex-wrap:nowrap; gap:0; min-height:42px; margin-bottom:12px; padding:0 4px; overflow-x:auto; }
.chart-review .chart-tabs > * { flex-shrink:0; }
.chart-review .chart-tabs button { padding:10px 12px; white-space:nowrap; }
.chart-review .chart-tabs > span { padding:0 12px; white-space:nowrap; }
.chart-review-results { display:flex; flex-direction:column; flex:1; min-height:0; }
.chart-review .chart-review-pane { display:flex; flex-direction:column; flex:1; min-height:260px; margin:0; overflow:auto; }
.chart-review-pane > * { flex-shrink:0; }
.chart-review-toolbar { position:relative; display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; padding:10px 14px; border-bottom:1px solid var(--border); }
.chart-review-toolbar h2 { margin-right:auto; font-size:16px; }
.chart-review-filters > summary { display:none; }
.chart-review .filter-bar { padding:0; gap:10px; border:0; background:transparent; }
.chart-review .filter-bar form:first-child { gap:10px; }
.chart-review .filter-bar label { flex-direction:row; align-items:center; gap:6px; font-size:11px; }
.chart-review .filter-bar input { min-width:0; min-height:36px; width:140px; padding:7px 8px; }
.chart-review .filter-bar button { padding:7px 10px; min-height:36px; }
.chart-review-help { font-size:11px; color:var(--muted); }
.chart-review-help summary { cursor:pointer; }
.chart-review-help > div { position:absolute; top:100%; left:0; right:0; z-index:3; padding:14px; background:#fff; border-bottom:1px solid var(--border); box-shadow:0 5px 12px #10355320; }
.chart-review-help p + p { margin-top:8px; }
.chart-review-pane > .field-hint { padding:6px 14px; }
.chart-review-selection-scope { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.chart-review-pane > .table-scroll { flex:1 1 0; min-height:100px; overflow:auto; scrollbar-gutter:stable; overscroll-behavior:contain; }
.chart-review .encounter-table th, .chart-review .encounter-table td { padding:10px 14px; }
.chart-review .record-title { min-width:0; }
.chart-review .record-grouping { color:var(--muted); font-size:11px; }
.chart-review .pagination { padding:8px 14px; }
.chart-review .encounter-basket, .chart-review .encounter-basket:has(.cart-release[open]) {
  position:static; display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; width:auto; max-width:none; max-height:none; margin:0; padding:10px 14px; border:0; border-top:1px solid #d9c796; border-radius:0; box-shadow:none; overflow:visible;
}
.chart-review .encounter-basket[hidden] { display:none; }
.chart-review .basket-icon { width:28px; height:28px; flex-shrink:0; }
.chart-review .basket-summary { flex:1; min-width:0; }
.chart-review .basket-summary strong { display:inline; margin-right:8px; font-size:11px; }
.chart-review .basket-summary [role="status"] { display:inline; }
.chart-review .basket-total { font-size:14px; }
.chart-review .basket-summary [data-selected-encounters] { display:inline; }
.chart-review .basket-summary small { margin-top:2px; font-size:10px; }
.chart-review .cart-release { border:0; padding:0; }
.chart-review .cart-release-slot { min-width:116px; min-height:18px; }
.chart-review .cart-release-close { display:none; }
.chart-review .cart-release[open] {
  position:absolute; top:0; right:0; bottom:0; z-index:6; width:min(520px,100%); padding:16px; overflow:auto; background:#fff; border:1px solid var(--border); border-radius:7px; box-shadow:-8px 0 24px #10355325; overscroll-behavior:contain;
}
.chart-review .cart-release[open] > summary { position:sticky; top:-16px; z-index:1; display:flex; justify-content:space-between; gap:12px; padding:14px 0; background:#fff; border-bottom:1px solid var(--border); font-size:14px; }
.chart-review .cart-release[open] .cart-release-close { display:inline; font-size:12px; }
@media (max-width:850px) {
  .chart-review .patient-meta { display:flex; max-width:40%; }
  .chart-review-toolbar h2 { font-size:15px; }
}
@media (max-width:600px) {
  .chart-review .patient-banner { padding:9px 12px; flex-wrap:wrap; gap:6px 10px; }
  .chart-review .patient-name { flex-basis:calc(100% - 46px); }
  .chart-review .patient-name h1 { font-size:17px; }
  .chart-review .patient-meta { max-width:none; margin-left:46px; padding:0; border:0; font-size:10px; }
  .chart-review .chart-tabs { margin-bottom:8px; }
  .chart-review .chart-tabs button { padding:9px 10px; }
  .chart-review-filters > summary { display:list-item; cursor:pointer; font-size:12px; font-weight:600; color:var(--blue); }
  .chart-review-filters[open] { flex-basis:100%; order:2; }
  .chart-review-filters[open] .filter-bar { padding-top:8px; }
  .chart-review .filter-bar input { width:135px; }
  .chart-review .filter-bar label { flex-direction:column; align-items:stretch; }
  .chart-review .encounter-basket { gap:6px 8px; padding:8px 12px; }
  .chart-review .basket-summary strong { display:none; }
  .chart-review .basket-summary [data-selected-encounters] { display:block; }
  .chart-review .basket-summary small { max-width:210px; }
  .chart-review .cart-release:not([open]) { width:100%; text-align:right; }
  .chart-review .cart-release-slot { width:100%; }
}
.growth-controls { display:flex; flex-wrap:wrap; gap:1rem; margin:1.25rem 0; }
.growth-controls label { display:grid; gap:.4rem; min-width:12rem; }
.growth-chart { margin:1rem 0; }
.growth-plot { width:100%; max-width:1000px; height:auto; background:#fff; border:1px solid #dbe3eb; border-radius:8px; }
.growth-plot text { fill:#46556b; font:12px sans-serif; }
.growth-plot .growth-axis-title { font-size:14px; font-weight:600; }
.growth-grid { stroke:#e6ebf0; stroke-width:1; }
.growth-reference { fill:none; stroke:#a6adb8; stroke-width:1.1; }
.growth-median { stroke:#626e80; stroke-width:1.8; }
.growth-observation { fill:#1464b4; stroke:white; stroke-width:1.5; }
.growth-observation:focus { stroke:#172d46; stroke-width:3; }
.growth-outside { fill:#a04a18; stroke:white; stroke-width:1; }
.growth-outside:focus { stroke:#172d46; stroke-width:3; }
.growth-measurements { margin:1.25rem 0; }
.growth-measurements summary { cursor:pointer; font-weight:600; margin-bottom:.8rem; }

/* Collapse only matched pages within one source document and encounter. */
.chart-search .panel-heading { padding:10px 14px; }
.chart-search .panel-heading h2 { font-size:16px; }
.chart-search .search-fields { padding:10px 14px; }
.chart-search-help { padding:0 14px 10px; font-size:11px; color:var(--muted); }
.chart-search-help > summary { cursor:pointer; color:var(--blue); }
.chart-search-help p { margin-top:8px; }
.chart-search-table { min-width:640px; }
.chart-search-table td { vertical-align:top; }
.chart-search-table input[type="checkbox"] { width:18px; height:18px; margin:0; flex-shrink:0; }
.chart-search-table [data-search-select-all][hidden] { display:none; }
.search-page-range { font-weight:600; }
.search-matched-pages { margin-top:6px; font-size:11px; }
.search-matched-pages > summary { cursor:pointer; color:var(--blue); white-space:nowrap; }
.search-page-list { min-width:230px; max-height:240px; margin-top:8px; overflow:auto; overscroll-behavior:contain; }
.search-matched-page { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid var(--border); }
.search-matched-page label { flex-direction:row; align-items:center; gap:8px; white-space:nowrap; }
.search-matched-page small { margin:2px 0 0; font-size:10px; }
.search-matched-page button { white-space:nowrap; }

/* Give the encounter document the full reading pane; supporting controls open on demand. */
.workspace .main-content:has(> .encounter-view) { padding:16px 18px; }
.encounter-view .encounter-heading { gap:12px; margin:0 0 6px; align-items:center; }
.encounter-view .encounter-heading > div { min-width:0; }
.encounter-view .encounter-heading .eyebrow { margin:0 0 3px; font-size:10px; letter-spacing:.4px; }
.encounter-view .encounter-heading h2 { margin:0; font-size:18px; line-height:1.3; overflow-wrap:anywhere; }
.encounter-view .encounter-heading p { margin-top:3px; font-size:11px; }
.encounter-view .encounter-heading > form { flex-shrink:0; }
.encounter-view .encounter-heading button { min-height:32px; padding:6px 10px; font-size:11px; }
.encounter-context { display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; margin-bottom:8px; font-size:11px; }
.encounter-panel-slot { min-height:20px; min-width:120px; }
.encounter-sidepanel { border:0; padding:0; background:transparent; font-size:11px; }
.encounter-sidepanel > summary { cursor:pointer; color:var(--blue); font-weight:600; }
.encounter-panel-close { display:none; }
.encounter-search-notice { color:#346853; }
.encounter-availability { color:#786537; }
.encounter-view .encounter-reader { display:flex; flex-direction:column; flex:1 1 0; min-height:280px; }
.encounter-view .reader-main { flex:1; }
.encounter-view .reader-toolbar { position:relative; gap:8px 14px; min-height:48px; padding:7px 12px; }
.encounter-view .reader-toolbar > button { display:inline-flex; }
.encounter-view .reader-status { min-height:24px; padding:5px 12px; }
.encounter-view .page-stack { scrollbar-gutter:stable; }
.encounter-view .annotation-view-option.annotation-unavailable { display:none; }
.encounter-view .annotation-view-option { font-size:11px; }
.reader-documents { font-size:11px; }
.reader-documents > summary { cursor:pointer; color:var(--blue); font-weight:600; }
.reader-document-list { position:absolute; top:100%; left:0; z-index:4; width:min(360px,100%); max-height:min(240px,20vh); overflow:auto; overscroll-behavior:contain; background:#fff; border:1px solid var(--border); box-shadow:0 6px 16px #10355326; }
.reader-document-list .document-jump { min-height:0; padding:10px 14px; }
.encounter-view .encounter-view-actions { flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px 14px; padding:8px 0 0; }
.encounter-view-actions > p { margin-right:auto; }
.encounter-basket.chart-page-cart { position:static; flex-shrink:0; display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; width:auto; max-width:none; max-height:none; min-height:0; padding:4px 14px; border:0; border-top:1px solid #d9c796; border-radius:0; box-shadow:none; overflow:visible; }
.chart-page-cart .basket-icon { width:28px; height:28px; }
.chart-page-cart .basket-summary { flex:1 1 180px; min-width:0; }
.chart-page-cart .basket-summary > strong { display:inline; margin-right:8px; font-size:11px; }
.chart-page-cart .basket-summary [role="status"] { display:inline; }
.chart-page-cart .basket-total { font-size:14px; }
.chart-page-cart .basket-summary [data-selected-encounters] { display:inline; }
.chart-page-cart .basket-summary small { margin-top:2px; font-size:10px; }
.chart-page-cart form { margin:0; }
.chart-page-cart noscript { flex:1 0 100%; font-size:10px; }
.chart-page-cart [data-generate-pdf] { white-space:nowrap; }
.encounter-view-actions > .chart-page-cart { flex:1 1 600px; min-width:0; margin:0; }
.encounter-view .chart-page-cart .basket-icon, .encounter-view .chart-page-cart .basket-summary > strong { display:none; }
.chart-search .table-scroll { scroll-padding-top:80px; }
.chart-search-table thead th { height:44px; padding-top:0; padding-bottom:0; }
.encounter-view .encounter-basket.chart-page-cart { padding:4px 10px; }
.chart-search > .chart-page-cart { margin-top:0; padding:6px 14px; }
.chart-page-cart .basket-total { margin:0; }
.encounter-view .encounter-sidepanel[open] { position:absolute; top:0; right:0; bottom:0; z-index:5; width:min(460px,100%); padding:0 16px 16px; overflow:auto; overscroll-behavior:contain; background:#fff; border:1px solid var(--border); border-radius:6px; box-shadow:-6px 0 22px #10355326; }
.encounter-view .encounter-sidepanel[open] > summary { position:sticky; top:0; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 0; background:#fff; border-bottom:1px solid var(--border); font-size:14px; }
.encounter-sidepanel[open] .encounter-panel-close { display:inline; font-size:11px; }
.encounter-information-content > p { margin:12px 0; font-size:12px; line-height:1.6; }
.encounter-information-content .source-details { margin-top:12px; }
@media (max-width:600px) {
  .chart-search .search-fields { display:grid; grid-template-columns:1fr 1fr; gap:6px 10px; }
  .chart-search .search-fields > label { min-width:0; }
  .chart-search .search-fields > button { min-height:30px; padding:5px 10px; align-self:end; }
  .chart-search .search-fields input { min-height:30px; padding:5px 8px; }
  .workspace .main-content > .chart-search > .chart-review-pane { min-height:0; overflow:hidden; }
  .chart-search .chart-page-cart { gap:4px 8px; }
  .chart-search .chart-page-cart .basket-summary { flex-basis:70px; }
  .chart-search .chart-page-cart .basket-icon, .chart-search .chart-page-cart .basket-summary > strong,
  .chart-search .chart-page-cart [data-selected-encounters] { display:none; }
  .chart-search .chart-page-cart .basket-summary small { display:none; }
  .workspace .main-content:has(> .encounter-view) { padding:10px; }
  .encounter-view .encounter-heading { align-items:flex-start; }
  .encounter-view .encounter-heading h2 { font-size:16px; }
  .encounter-view .encounter-heading p { font-size:10px; }
  .encounter-view .reader-toolbar { gap:8px 10px; }
  .encounter-view .zoom-control { margin-left:auto; }
  .encounter-view .page-caption > span { max-width:none; }
  .encounter-view .encounter-view-actions > p { flex-basis:100%; }
}

/* Record retirement request picker; all styles stay within this workspace. */
.retirement-workspace { width:100%; min-width:0; display:grid; gap:18px; padding-bottom:24px; }
.retirement-workspace > form { display:grid; gap:18px; min-width:0; }
.retirement-workspace fieldset { min-width:0; }
.retirement-workspace legend { font-weight:700; padding:0 8px; }
.retirement-workspace .retirement-modes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.retirement-workspace .retirement-mode { display:flex; flex-direction:row; align-items:flex-start; gap:10px; padding:16px; border:1px solid var(--border,#ccd7de); border-radius:10px; cursor:pointer; }
.retirement-workspace .retirement-mode:has(:checked) { border-color:#14736b; background:#eef8f5; outline:1px solid #14736b; }
.retirement-workspace .retirement-mode input { width:auto; margin-top:4px; }
.retirement-workspace small { display:block; color:#526875; margin-top:4px; }
.retirement-workspace .retirement-patient-picker { display:grid; gap:18px; }
.retirement-workspace .retirement-search { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; }
.retirement-workspace .retirement-search label { flex:1 1 220px; min-width:0; }
.retirement-workspace .retirement-search select { width:100%; }
.retirement-workspace .retirement-record-picker { display:grid; gap:12px; }
.retirement-workspace .audit-scroll { max-height:360px; overflow:auto; }
.retirement-workspace table { width:100%; }
.retirement-workspace td { overflow-wrap:anywhere; }
.retirement-workspace input[type=checkbox] { width:20px; height:20px; }
.retirement-workspace .retirement-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:14px; }
.retirement-workspace .retirement-help { color:#526875; font-size:.9rem; }
.retirement-workspace [hidden] { display:none !important; }
@media(max-width:850px) { .retirement-workspace .retirement-modes { grid-template-columns:1fr; } }
