.emr-toolbar, .emr-patient, .emr-patient-actions, .emr-section-header, .migration-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.emr-toolbar { margin-bottom: 13px; }
.emr-toolbar h1 { font: 700 24px/1.2 var(--sans); letter-spacing: -.035em; }
.emr-toolbar h1 span { color: var(--muted); font-size: 16px; font-weight: 500; letter-spacing: normal; }
.emr-toolbar .clinic-segment button { min-height: 44px; font-size: 15px; }
.emr-frame { --emr-line: #d4e2dc; background: #fdfefc; border: 1px solid var(--emr-line); border-radius: 11px; }
.emr-sticky { position: sticky; top: 0; z-index: 2; border-radius: inherit; background: #fdfefc; }
.emr-patient { padding: 18px 22px; background: #e9f1ee; border-bottom: 1px solid var(--emr-line); border-radius: 10px 10px 0 0; }
.emr-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.emr-avatar { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border: 1px solid #b8cec3; border-radius: 10px; background: #d8e9e0; font-size: 17px; font-weight: 750; }
.emr-identity h2 { margin: 2px 0 3px; font-size: clamp(25px, 3vw, 34px); }
.emr-metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 14px; }
.emr-metadata > span:first-child { font-weight: 680; }
.emr-patient-actions { gap: 9px 12px; align-items: end; }
.emr-patient-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.emr-select { display: grid; gap: 3px; max-width: 100%; color: var(--muted); font-size: 14px; font-weight: 650; }
.emr-select select { width: 100%; min-height: 44px; padding: 6px 9px; border: 1px solid #aebfb4; border-radius: 6px; background: #fdfefa; color: var(--ink); font-size: 15px; }
.emr-tabs { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 12px; border-bottom: 1px solid var(--emr-line); }
.emr-tabs button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 10px 11px 8px; min-height: 48px; font-size: 15px; font-weight: 630; white-space: nowrap; }
.emr-tabs button:hover { background: #eff5f1; }
.emr-tabs button[aria-pressed="true"] { background: #e9f3ed; border-color: #34775c; color: #174732; }
.emr-body { display: grid; grid-template-columns: minmax(190px, 23%) minmax(0, 1fr); }
.emr-snapshot { border-right: 1px solid var(--emr-line); padding: 18px; border-radius: 0 0 0 10px; background: #f2f7f4; }
.emr-snapshot h2, .emr-section-header h2, .emr-encounter .chart-heading h2 { font-size: 22px; }
.emr-snapshot h2 { margin-bottom: 13px; font-size: 19px; }
.emr-allergies { padding: 10px 11px; border: 1px solid #ead4c5; background: #fbede4; color: #70432e; border-radius: 6px; }
.emr-snapshot dl, .migration-side dl { margin: 8px 0 0; }
.emr-snapshot dl > div, .migration-side dl > div { padding-block: 10px; border-bottom: 1px solid var(--emr-line, var(--rule)); }
.emr-snapshot dl > div:last-child, .migration-side dl > div:last-child { border-bottom: 0; }
.emr-snapshot dt, .migration-side dt { font-size: 14px; font-weight: 670; }
.emr-snapshot dd, .migration-side dd { margin: 1px 0 0; color: var(--muted); font-size: 15px; }
.emr-content { min-width: 0; min-height: 370px; }
.emr-section-header { padding: 17px 19px; }
.emr-section-header p, .emr-empty { color: var(--muted); }
.emr-section-header p { margin-top: 3px; }
.emr-empty, .emr-record-body, .emr-encounter { padding: 0 19px 20px; }
.emr-encounter { padding-top: 18px; }
.emr-encounter-picker { width: fit-content; margin-bottom: 14px; }
.emr-import-heading { margin: 4px 19px 12px; }
.emr-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; }
.emr-table th { background: #edf3ef; color: var(--muted); font-size: 14px; font-weight: 680; }
.emr-table th, .emr-table td { padding: 10px 12px; border-block: 1px solid var(--emr-line); vertical-align: top; }
.emr-table th:first-child, .emr-table td:first-child { padding-left: 19px; white-space: nowrap; }
.emr-table th:last-child, .emr-table td:last-child { padding-right: 19px; }
.emr-table td:nth-child(2) { width: 41%; }
.emr-table td small { display: block; color: var(--muted); font-size: 14px; }
.emr-table tr:hover td { background: #f6faf7; }
.emr-entry-link { padding: 0; min-height: 28px; border: 0; background: transparent; color: #215b45; font-weight: 680; text-align: left; text-decoration: underline; text-underline-offset: .18em; }
.emr-workspace .badge { font-size: 13px; }
.emr-workspace .btn, .migration-grid .btn { min-height: 44px; font-size: 15px; }
.sidebar-bottom [aria-current="page"] { background: #dbe9dc; color: var(--ink); }
.migration-head { align-items: end; margin-bottom: 25px; }
.migration-head h1 { margin: 5px 0 7px; }
.migration-head p:not(.eyebrow), .migration-panel > p, .migration-side p:not(.eyebrow) { color: var(--muted); }
.migration-head a { font-weight: 650; }
.migration-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 0; margin-bottom: 17px; list-style: none; }
.migration-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 3px solid var(--rule); color: var(--muted); font-size: 15px; font-weight: 650; }
.migration-steps span { display: grid; place-items: center; flex: 0 0 31px; height: 31px; background: #e6eee3; border-radius: 50%; font-size: 13px; }
.migration-steps .done { border-color: #9bbba6; }
.migration-steps [aria-current="step"] { border-color: #2d654d; color: var(--ink); }
.migration-steps [aria-current="step"] span { background: var(--ink); color: #fffef7; }
.migration-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 25%); gap: 16px; align-items: start; }
.migration-panel, .migration-side { padding: clamp(15px, 2.2vw, 26px); }
.migration-panel > p, .migration-side h2 { margin-top: 6px; }
.migration-side { background: #edf3e9; }
.migration-side h2 { font-size: 22px; }
.migration-side p:not(.eyebrow) { margin-top: 9px; font-size: 15px; }
.migration-form-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 18px; }
.migration-form-row .field { margin: 0; min-width: min(100%, 220px); }
.migration-form-row select { min-height: 44px; }
.migration-note { margin-top: 18px; padding: 12px 14px; border-left: 3px solid #83aa90; border-radius: 0 6px 6px 0; background: #eef4eb; }
.migration-note p { color: var(--muted); }
.migration-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 17px 0; }
.migration-counts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; background: #edf3ed; border-radius: 7px; padding: 8px 10px; }
.migration-counts dt { font-size: 14px; color: var(--muted); }
.migration-counts dd { margin: 0; font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.migration-row { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(108px, .67fr) minmax(0, 1.5fr); align-items: start; gap: 7px 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.migration-row small { display: block; color: var(--muted); }
.migration-row p { color: var(--muted); font-size: 15px; }
.migration-checks { display: grid; gap: 3px; margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.migration-checks legend { margin-bottom: 4px; font-weight: 690; }
.migration-checks label { display: flex; align-items: center; gap: 9px; min-height: 44px; padding-block: 4px; }
.migration-checks input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--ink); }
@media (max-width: 1090px) {
  .emr-body { grid-template-columns: minmax(158px, 24%) minmax(0, 1fr); }
  .emr-patient, .emr-snapshot { padding-inline: 14px; }
  .emr-tabs button { padding-inline: 7px; }
}
@media (max-width: 860px) {
  .sidebar-bottom { display: flex; align-items: center; }
  .sidebar-bottom .migration-link { width: auto; }
}
@media (max-width: 660px) {
  .emr-sticky { position: static; }
  .emr-body, .migration-grid { grid-template-columns: 1fr; }
  .emr-snapshot { border: 0; border-bottom: 1px solid var(--emr-line); border-radius: 0; }
  .emr-snapshot dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .emr-snapshot dl > div { border-bottom: 0; padding-bottom: 2px; }
  .emr-patient-actions, .emr-patient-actions label { width: 100%; }
  .emr-section-header { padding-inline: 13px; }
  .emr-table td, .emr-table th { padding: 7px 6px; }
  .emr-table td:first-child, .emr-table th:first-child { padding-left: 12px; white-space: normal; }
  .emr-table td:last-child, .emr-table th:last-child { padding-right: 12px; }
  .emr-table th:nth-child(3), .emr-table td:nth-child(3) { display: none; }
  .emr-table td:nth-child(2) { width: 48%; }
  .migration-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 450px) {
  .emr-tabs { padding-inline: 5px; }
  .emr-tabs button { padding-inline: 6px; }
  .migration-row { grid-template-columns: minmax(0, 1fr) auto; }
  .migration-row p { grid-column: 1 / -1; }
  .sidebar-bottom button { font-size: 13px; gap: 5px; padding-inline: 6px; white-space: nowrap; }
  .sidebar-bottom button .icon { display: none; }
}
.migration-launch { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: end; gap: 8px 18px; margin-bottom: 23px; padding: 17px 20px; background: #ebf2e7; }
.migration-launch h2 { margin: 4px 0; font-size: 23px; }
.migration-launch p:not(.eyebrow) { color: var(--muted); }
.migration-launch .actions-row { margin: 0; }
.migration-launch a { text-decoration: none; }
