@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
:root {
  --ink: #173344;
  --muted: #526574;
  --line: #dce3e7;
  --paper: #f5f6f6;
  --nav: #102c3b;
  --teal: #22586c;
  --gold: #805524;
  --radius: 10px;
  font:
    14px/1.5 "Instrument Sans",
    sans-serif;
  color: var(--ink);
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid #aa783c;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.7px;
}
h2 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
small {
  font-size: 12px;
  color: var(--muted);
}
strong {
  font-weight: 600;
}
svg.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  background: white;
  padding: 12px;
  z-index: 100;
}
.skip-link:focus {
  top: 12px;
}
button,
a,
input,
select,
textarea {
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
}
input,
select,
textarea {
  background: #fff;
  border: 1px solid #bac7ce;
  border-radius: 6px;
  padding: 9px 11px;
  min-height: 40px;
  max-width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: #677680;
}
input[type="checkbox"] {
  accent-color: var(--teal);
  min-height: 18px;
  width: 18px;
  flex: 0 0 auto;
  margin: 2px 0;
}
input[readonly] {
  background: #f5f7f8;
}
textarea {
  resize: vertical;
}
button {
  border: 0;
  background: none;
}
a {
  text-decoration: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  min-height: 40px;
  padding: 9px 15px;
  background: var(--ink);
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.button:hover:not(:disabled) {
  background: #294d60;
  border-color: #294d60;
}
.button.secondary {
  background: #fff;
  border-color: #bdcad1;
  color: var(--ink);
}
.button.secondary:hover:not(:disabled) {
  background: #f0f4f6;
  border-color: #7d949f;
}
.button.compact {
  font-size: 13px;
  min-height: 36px;
  padding: 7px 12px;
}
.button > .icon:last-child:not(:first-child) {
  display: none;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.text-link:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link .icon {
  width: 15px;
  height: 15px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 36px;
  min-height: 36px;
  flex-shrink: 0;
}
.icon-button:hover:not(:disabled) {
  background: #edf1f3;
  border-color: var(--line);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: var(--nav);
  color: #e5edf1;
  display: flex;
  flex-direction: column;
  padding: 24px 12px 14px;
  overflow: hidden;
  z-index: 10;
}
.brand {
  display: inline-flex;
  width: 133px;
  margin: 0 10px 26px;
  flex-shrink: 0;
}
.brand-logo {
  width: 100%;
  height: auto;
  display: block;
}
.workspace {
  display: flex;
  gap: 9px;
  padding: 0 8px 14px;
  align-items: center;
  min-width: 0;
}
.workspace > .icon {
  color: #a8bec9;
}
.workspace > div {
  min-width: 0;
}
.workspace strong {
  font-size: 13px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.workspace small {
  color: #afc2cb;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.sidebar-navigation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #47616f transparent;
  padding: 0 2px 12px;
}
.nav-group + .nav-group {
  margin-top: 22px;
}
.nav-group-label {
  padding: 0 10px 7px;
  color: #9fb4c0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  line-height: 1.4;
  text-transform: uppercase;
}
.nav-group-links,
.sidebar-utilities {
  display: grid;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  width: 100%;
  border-radius: 5px;
  color: #c1d0d8;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 20px;
  text-decoration: none;
}
.nav-item:hover {
  color: #fff;
  background: #203e4d;
}
.nav-item.active {
  background: #2d4c5c;
  color: white;
  font-weight: 600;
}
.nav-item .icon {
  width: 16px;
  height: 16px;
}
.nav-item > span {
  min-width: 0;
}
.nav-item b {
  margin-left: auto;
  background: #dceaf0;
  color: #173344;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
}
.sidebar-bottom {
  flex-shrink: 0;
  margin-top: auto;
  padding: 16px 2px 0;
  border-top: 1px solid #35505e;
}
.profile {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 0 8px;
}
.avatar {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  background: #eaf0f3;
  color: #254757;
}
.profile > .avatar {
  background: #385260;
  color: #fff;
}
.profile > div:last-child {
  min-width: 0;
}
.profile strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-link {
  display: block;
  font-size: 12px;
  color: #b8cbd4;
  margin-top: 2px;
}
.account-link:hover {
  text-decoration: underline;
}
.main-shell {
  margin-left: 224px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.breadcrumb {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb strong {
  color: var(--ink);
}
.breadcrumb > span {
  color: #a2afb6;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-date {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.topbar form {
  margin: 0;
}
.sign-out {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 8px;
}
.sign-out:hover {
  color: var(--gold);
}
#main {
  padding: 32px 36px 40px;
  flex: 1;
  min-width: 0;
  outline: none;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-heading p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 7px;
  max-width: 70ch;
}
.footer {
  padding: 18px 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 26px;
  overflow: hidden;
}
.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 19px 22px;
  border-right: 1px solid var(--line);
  gap: 6px;
}
.metric:last-child {
  border-right: 0;
}
.metric > span {
  font-size: 13px;
  color: var(--muted);
}
.metric > strong {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.metric > .icon {
  position: absolute;
  right: 20px;
  bottom: 25px;
  color: #536f7d;
}
.metric:hover {
  background: #f3f6f7;
}
.queue-heading,
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
}
.queue-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.count {
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 7px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.queue-tools {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 0 22px 17px;
  flex-wrap: wrap;
}
.panel > .queue-tools:first-child {
  padding-top: 17px;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.tabs > button {
  padding: 8px 11px;
  min-height: 36px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.tabs > button:hover {
  background: #f0f4f6;
  color: var(--ink);
}
.tabs > button.active,
.tabs > button[aria-pressed="true"] {
  background: #eaf0f4;
  color: var(--ink);
  font-weight: 600;
}
.search {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #bdcad1;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  max-width: 100%;
}
.search .icon {
  width: 16px;
  color: var(--muted);
}
.search input {
  border: 0;
  padding: 8px 0;
  min-height: 36px;
  min-width: 0;
  width: 190px;
  background: transparent;
}
.search:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.search input:focus {
  outline: none;
}
.table-wrap {
  position: relative;
  overflow: auto;
  border-top: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
th {
  background: #f7f9fa;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 22px;
  border-bottom: 1px solid #e7ecef;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafcfc;
}
td small {
  display: block;
  margin-top: 3px;
}
td:last-child {
  white-space: nowrap;
}
.patient-cell {
  display: flex;
  text-align: left;
  padding: 0;
  gap: 10px;
  min-width: 185px;
}
.patient-cell strong {
  display: block;
  font-size: 14px;
}
.patient-cell:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.patient-cell small {
  font-size: 12px;
  color: var(--muted);
}
.cell-owner {
  font-size: 13px;
  font-weight: 500;
}
.cell-date {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.past-due {
  color: #9b372b;
}
.priority-dot {
  color: #9b372b;
  text-transform: capitalize;
}
.badge,
.quiet-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #dae2e6;
  background: #f4f6f7;
  color: #526574;
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
  line-height: 1.5;
}
.badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.blue {
  background: #edf4f9;
  color: #285671;
  border-color: #d6e5ee;
}
.badge.purple {
  background: #f3f0f7;
  color: #605077;
  border-color: #e4dfee;
}
.badge.amber {
  background: #fbf4e8;
  color: #77541b;
  border-color: #eddec1;
}
.badge.red {
  background: #fcefeb;
  color: #943c2f;
  border-color: #f0d8d2;
}
.badge.green {
  background: #edf5ef;
  color: #356045;
  border-color: #d7e6da;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.workspace-empty {
  text-align: center;
  padding: 65px 24px 72px;
}
.workspace-empty h3 {
  font-size: 16px;
  margin-bottom: 7px;
}
.workspace-empty p {
  color: var(--muted);
  max-width: 48ch;
  margin: auto;
}
.quiet-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #75511f;
  background: #fbf5e9;
  border: 1px solid #e9dbbd;
  border-radius: 7px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}
.quiet-notice .icon {
  width: 16px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.4px;
}
.operations-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.settings-panel {
  padding: 24px;
}
.settings-panel > p {
  color: var(--muted);
  margin: 8px 0 20px;
  font-size: 13px;
  max-width: 65ch;
}
.settings-panel .operations-form {
  margin-top: 22px;
}
.team-panel {
  margin-top: 24px;
}
.member-list {
  margin: 16px 0;
}
.member-list > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.member-list .quiet-badge {
  margin-left: auto;
}
.pipeline-stats {
  margin: 20px 0;
}
.pipeline-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.pipeline-stats dt {
  font-size: 13px;
  color: var(--muted);
}
.pipeline-stats dd {
  margin: 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.activity-row {
  display: flex;
  gap: 14px;
  padding: 17px 22px;
  border-top: 1px solid var(--line);
}
.activity-row .timeline-symbol {
  color: var(--muted);
  padding-top: 2px;
}
.activity-row > div {
  flex: 1;
  min-width: 0;
}
.activity-row p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.activity-row time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.availability-empty {
  padding: 30px;
  color: var(--muted);
}
.calendar-panel {
  margin-bottom: 26px;
  overflow: hidden;
}
.calendar-toolbar {
  padding: 17px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  flex-wrap: wrap;
}
.calendar-controls h2 {
  margin-left: 7px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.calendar-controls select {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 13px;
  max-width: 190px;
}
.calendar-switch {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  gap: 1px;
}
.calendar-switch > button {
  padding: 5px 10px;
  min-height: 30px;
}
.calendar-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: #fafbfc;
}
.calendar-source .text-link {
  font-size: 12px;
}
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--line);
}
.calendar-day {
  min-height: 235px;
  border-right: 1px solid var(--line);
}
.calendar-day:last-child {
  border: 0;
}
.calendar-day h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.calendar-day h3 b {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.calendar-day.is-today h3 {
  background: #edf3f6;
}
.calendar-day.is-today h3 b {
  color: #1d526b;
}
.calendar-day > div {
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.calendar-slot {
  padding: 10px;
  text-align: left;
  border: 1px solid #d4e3eb;
  background: #f0f6f9;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  width: 100%;
  font-size: 12px;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.calendar-slot strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.calendar-slot span {
  color: #35566a;
}
.calendar-slot small {
  font-size: 12px;
  color: #32614e;
  margin-top: 3px;
}
.calendar-slot:hover {
  border-color: #698e9f;
  background: #e5f0f6;
}
.calendar-slot.held {
  background: #fbf5e9;
  border-color: #e5d4b8;
}
.calendar-slot.held small {
  color: #77541b;
}
.day-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 12px 4px;
}
.calendar-footnote {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.calendar-agenda .calendar-day {
  min-height: 0;
  border: 0;
  display: grid;
  grid-template-columns: 130px 1fr;
  border-top: 1px solid var(--line);
}
.calendar-agenda .calendar-day h3 {
  border: 0;
  align-items: flex-start;
  padding: 20px;
}
.calendar-agenda .calendar-day > div {
  display: flex;
  flex-wrap: wrap;
  padding: 12px;
  gap: 12px;
}
.calendar-agenda .calendar-slot {
  width: 220px;
}
.sync-status {
  padding: 10px 36px;
  background: #fff4db;
  color: #75511f;
  border-bottom: 1px solid #e5d4b8;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
.loading {
  padding: 12vh 8vw;
}
.loading p {
  margin: 12px 0 25px;
}
.modal-open {
  overflow: hidden;
}
.scrim {
  position: fixed;
  inset: 0;
  background: #0e273854;
  z-index: 40;
}
.adapter-modal {
  position: fixed;
  z-index: 41;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d4dfe5;
  border-radius: 12px;
  box-shadow: 0 20px 70px #102c3b24;
  padding: 24px;
}
.wide-modal {
  width: min(820px, calc(100vw - 32px));
}
.adapter-modal > .section-top {
  padding: 0 0 20px;
  align-items: flex-start;
}
.adapter-modal > .section-top h2 {
  font-size: 21px;
  padding-top: 4px;
}
.adapter-modal > p {
  margin: 4px 0 20px;
  color: var(--muted);
}
.operations-form {
  display: grid;
  gap: 20px;
}
.operations-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  align-content: start;
  min-width: 0;
}
.operations-form label small {
  font-weight: 400;
  font-size: 12px;
}
.operations-form label input,
.operations-form label select,
.operations-form label textarea {
  width: 100%;
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
}
.form-divider {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-top: 4px;
  letter-spacing: 0.4px;
}
.operations-form .check-label,
.check-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 400;
}
.check-label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.check-label input[type="checkbox"] {
  width: 18px;
}
.form-note {
  font-size: 13px;
  color: var(--muted);
  background: #f5f8fa;
  border: 1px solid #e1e9ed;
  border-radius: 6px;
  padding: 12px 14px;
  line-height: 1.6;
}
.form-error {
  color: #a13b2a;
  font-size: 13px;
}
.form-error:empty {
  display: none;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.context-list {
  margin: 0 0 20px;
}
.context-list > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid #e5ebee;
  font-size: 14px;
}
.context-list dt {
  color: var(--muted);
  font-size: 13px;
}
.context-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.request-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-tabs {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.detail-content {
  padding: 20px 0;
  min-height: 230px;
}
.detail-bottom {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.detail-bottom .text-link {
  margin-left: auto;
}
.check-gap {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: #8d5024;
  padding-top: 12px;
}
.workflow-plan {
  padding: 0;
  list-style: none;
  margin: 20px 0;
}
.workflow-plan li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.workflow-plan li > span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}
.workflow-plan small {
  display: block;
  margin-top: 5px;
}
.plan-version {
  font-size: 12px;
}
.evidence-event,
.review-record,
.command-record {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.evidence-event time {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.evidence-event p,
.review-record p {
  margin: 7px 0;
  color: var(--muted);
}
.command-record strong {
  display: block;
  margin-bottom: 7px;
}
.command-record small {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.linked-request {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  width: 100%;
  text-align: left;
}
.linked-request > .icon {
  margin-left: auto;
}
.connection-intro {
  font-size: 14px;
  line-height: 1.7;
  margin: 18px 0;
}
.connection-checklist {
  padding-left: 22px;
  line-height: 1.7;
  margin: 18px 0;
}
.adapter-modal > .form-note {
  margin-bottom: 20px;
}
.jobs-list > article {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.jobs-list small {
  width: 100%;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 80px);
  transform: translateX(-50%);
  background: #173344;
  color: white;
  z-index: 100;
  border-radius: 7px;
  padding: 12px 20px;
  font-size: 14px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 4px 20px #102c3b22;
  display: none;
}
#toast.show {
  display: block;
}
/* Voice controls share the workspace hierarchy; the transcript is the main surface. */
.studio-engine {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.studio-engine i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93713d;
}
.studio-engine.online i {
  background: #477458;
}
.studio-scenarios {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 22px;
  overflow: hidden;
}
.studio-scenarios button {
  flex: 1;
  text-align: left;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
}
.studio-scenarios button:last-child {
  border-right: 0;
}
.studio-scenarios button.selected {
  background: #eef4f7;
  border-bottom-color: #315f73;
}
.studio-scenarios strong {
  display: block;
  font-size: 14px;
}
.studio-scenarios small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  max-width: 45ch;
}
.studio-scenarios button:hover:not(:disabled) {
  background: #f1f5f7;
}
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.studio-conversation {
  overflow: hidden;
}
.studio-call-top {
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.voice-stage {
  display: grid;
  grid-template-columns: 32px 1fr;
  padding: 20px 22px 14px;
  gap: 3px 12px;
  align-items: center;
}
.voice-orb {
  width: 32px;
  height: 32px;
  border: 1px solid #cddde5;
  border-radius: 50%;
  background: #eff5f7;
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #396379;
}
.voice-orb svg {
  width: 16px;
  height: 16px;
}
.voice-stage h2 {
  font-size: 16px;
}
.voice-stage > p {
  font-size: 13px;
  color: var(--muted);
}
.voice-stage.listening .voice-orb {
  border-color: #638b77;
  background: #e7f1ea;
}
.voice-stage.speaking .voice-orb {
  background: #dfedf5;
  border-color: #668ea4;
}
.studio-start {
  padding: 6px 22px 22px;
  display: grid;
  gap: 16px;
}
.studio-start > .button {
  justify-self: start;
}
.studio-start select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
}
.studio-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 7px 22px 18px;
}
.studio-controls .button {
  font-size: 13px;
  min-height: 36px;
  padding: 7px 11px;
}
.studio-controls .text-link {
  margin-left: auto;
}
.voice-transcript {
  border-top: 1px solid var(--line);
  padding: 22px;
  min-height: 300px;
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 17px;
  background: #fafcfc;
}
.voice-message {
  max-width: 85%;
  align-self: flex-start;
}
.voice-message > span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.voice-message p {
  margin-top: 5px;
  padding: 12px 15px;
  border: 1px solid #dfe7eb;
  border-radius: 8px;
  background: #fff;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.voice-message.user {
  align-self: flex-end;
}
.voice-message.user p {
  background: #edf3f6;
  border-color: #d7e3ea;
}
.voice-message small {
  font-size: 12px;
  display: block;
  margin-top: 5px;
}
.voice-empty {
  margin: auto;
  text-align: center;
  max-width: 40ch;
  color: var(--muted);
  font-size: 14px;
}
.voice-compose {
  display: flex;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}
.voice-compose input {
  min-width: 0;
  flex: 1;
}
.voice-error {
  margin: 0 22px 15px;
  padding: 10px 12px;
  background: #fcf0ec;
  border: 1px solid #edcfc6;
  border-radius: 6px;
  color: #8b392b;
  font-size: 13px;
}
.voice-error:empty {
  display: none;
}
.studio-context {
  display: grid;
  gap: 18px;
}
.studio-patient,
.studio-work {
  padding: 20px;
}
.studio-patient-name {
  margin-top: 9px;
}
.studio-patient-name h2 {
  font-size: 19px;
}
.studio-patient dl {
  margin: 14px 0;
}
.studio-patient dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.studio-patient dt {
  color: var(--muted);
}
.studio-patient dd {
  margin: 0;
  text-align: right;
}
.studio-patient > p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.studio-work > .eyebrow {
  display: none;
}
.studio-work h2 {
  margin-bottom: 14px;
}
.studio-work-empty {
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 15px;
}
.studio-boundary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.voice-work-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.voice-work-item summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.voice-work-item strong {
  font-size: 13px;
}
.voice-work-item small {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.voice-work-item > div {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  padding-top: 10px;
}
.voice-work-item ol,
.voice-work-item ul {
  padding-left: 18px;
}
.voice-work-item li + li {
  margin-top: 5px;
}
.studio-stack {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
}
.studio-stack summary {
  cursor: pointer;
}
.studio-stack p {
  margin-top: 8px;
}
.studio-stack > small {
  display: block;
  margin-top: 10px;
}
.voice-thinking {
  display: flex;
  gap: 4px;
  padding: 7px 0;
}
.voice-thinking i {
  width: 5px;
  height: 5px;
  background: #698292;
  border-radius: 50%;
  animation: thinking 1s ease-in-out infinite alternate;
}
.voice-thinking i:nth-child(2) {
  animation-delay: 0.2s;
}
.voice-thinking i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes thinking {
  to {
    opacity: 0.25;
  }
}
@media (min-width: 1700px) {
  #main {
    padding: 36px 48px 48px;
  }
  .topbar,
  .footer {
    padding-left: 48px;
    padding-right: 48px;
  }
  .calendar-day {
    min-height: 290px;
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
@media (max-width: 1180px) {
  .sidebar {
    width: 200px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .main-shell {
    margin-left: 200px;
  }
  .topbar {
    padding: 0 24px;
  }
  #main {
    padding: 26px 24px 36px;
  }
  .footer {
    padding: 16px 24px;
  }
  .queue-tools {
    gap: 12px;
  }
  .search {
    width: 100%;
  }
  .search input {
    width: 100%;
  }
  td,
  th {
    padding-left: 16px;
    padding-right: 16px;
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 16px;
  }
  .studio-scenarios small {
    display: none;
  }
}
@media (max-width: 850px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 17px 20px 12px;
    display: block;
    overflow: visible;
  }
  .brand {
    width: 112px;
    margin: 0 0 17px;
  }
  .workspace,
  .sidebar-bottom {
    display: none;
  }
  .sidebar-navigation {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 6px;
    gap: 8px;
  }
  .nav-group {
    flex: 0 0 auto;
  }
  .nav-group + .nav-group {
    margin: 0;
    border-left: 1px solid #35505e;
    padding-left: 8px;
  }
  .nav-group-label {
    display: none;
  }
  .nav-group-links {
    display: flex;
  }
  .nav-item {
    width: auto;
    flex-shrink: 0;
    min-height: 40px;
    padding: 8px 11px;
    font-size: 13px;
    gap: 7px;
    white-space: nowrap;
  }
  .main-shell {
    margin: 0;
  }
  .topbar {
    height: 54px;
    padding: 0 20px;
  }
  .top-date {
    display: none;
  }
  #main {
    padding: 25px 20px 30px;
  }
  .footer {
    padding: 15px 20px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    border-bottom: 1px solid var(--line);
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric:nth-child(n + 3) {
    border-bottom: 0;
  }
  .operations-columns {
    grid-template-columns: 1fr;
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-context {
    grid-template-columns: 1fr 1fr;
  }
  .studio-stack {
    grid-column: 1/-1;
  }
  .calendar-week {
    grid-template-columns: repeat(7, 150px);
  }
  #toast {
    left: 50%;
  }
}
@media (max-width: 540px) {
  h1 {
    font-size: 25px;
  }
  .page-heading {
    gap: 12px;
    align-items: flex-start;
  }
  .page-heading > .button {
    font-size: 12px;
    min-height: 36px;
    padding: 8px 11px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .metric {
    padding: 15px;
  }
  .metric > span {
    font-size: 12px;
  }
  .metric > strong {
    font-size: 27px;
  }
  .metric > .icon {
    right: 15px;
    bottom: 20px;
    width: 15px;
  }
  .queue-heading {
    padding: 17px;
  }
  .queue-tools {
    padding: 0 14px 14px;
  }
  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .pagination {
    align-self: flex-end;
  }
  .footer {
    flex-direction: column;
    gap: 5px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .adapter-modal {
    padding: 20px;
    max-height: calc(100dvh - 24px);
  }
  .context-list > div {
    grid-template-columns: 110px 1fr;
    gap: 12px;
  }
  .detail-bottom .text-link {
    margin-left: 0;
  }
  .calendar-toolbar {
    padding: 14px;
  }
  .calendar-controls h2 {
    font-size: 14px;
  }
  .calendar-source {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
  }
  .calendar-agenda .calendar-day {
    grid-template-columns: 80px 1fr;
  }
  .calendar-agenda .calendar-day h3 {
    padding: 18px 10px;
  }
  .calendar-agenda .calendar-slot {
    width: 100%;
  }
  .studio-context {
    grid-template-columns: 1fr;
  }
  .studio-scenarios button {
    padding: 12px 9px;
  }
  .studio-scenarios strong {
    font-size: 12px;
  }
  .page-heading .studio-engine {
    max-width: 130px;
  }
  .studio-call-top,
  .voice-stage,
  .studio-start,
  .studio-controls,
  .voice-transcript,
  .voice-compose {
    padding-left: 16px;
    padding-right: 16px;
  }
  .voice-compose {
    flex-wrap: wrap;
  }
  .voice-compose input {
    width: 100%;
  }
  .voice-message {
    max-width: 95%;
  }
  .activity-row {
    flex-wrap: wrap;
  }
  .activity-row time {
    padding-left: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Overview activity: a quiet, bounded rail; only real worker leases animate. */
.overview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
#overview-requests {
  min-width: 0;
}
#overview-requests .table-wrap {
  overflow-x: auto;
}
#overview-requests th:nth-child(2),
#overview-requests td:nth-child(2) {
  display: none;
}
#overview-requests td,
#overview-requests th {
  padding-left: 18px;
  padding-right: 18px;
}
#overview-requests .patient-cell {
  min-width: 160px;
}
#overview-requests .cell-date {
  white-space: normal;
}
.overview-activity {
  overflow: hidden;
}
.activity-heading {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.activity-connection {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.activity-connection::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9d8c6c;
}
.activity-connection.is-live::before {
  background: #47765a;
}
.activity-subheading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.activity-subheading h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.activity-subheading > span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.activity-processes {
  padding: 0 20px 18px;
  border-bottom: 1px solid var(--line);
}
.activity-idle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.activity-placeholder {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 20px 25px;
}
.process-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 15px;
}
.process-list > li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.process-indicator {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #ad935e;
  flex: 0 0 auto;
  margin-top: 7px;
}
.process-indicator.is-running {
  background: #3b7459;
  animation: process-breathe 2s ease-in-out infinite;
}
.activity-request {
  display: block;
  min-width: 0;
  text-align: left;
  padding: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.activity-request strong {
  font-size: 13px;
  line-height: 1.5;
  display: block;
  font-weight: 500;
}
.activity-request > span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.activity-request > small {
  font-size: 12px;
  line-height: 1.6;
  display: block;
  margin-top: 3px;
}
button.activity-request:hover strong {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.process-more {
  margin-top: 10px;
  font-size: 12px;
}
.activity-attention {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #8b5025;
  margin-top: 14px;
}
.activity-attention .icon {
  width: 14px;
}
.activity-recent {
  padding: 17px 20px 0;
}
.recent-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.recent-activity-list > li {
  padding: 0 0 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #e9edef;
}
.recent-activity-list > li:last-child {
  margin-bottom: 0;
  border: 0;
}
.activity-event-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.activity-event-head > strong {
  font-size: 13px;
  font-weight: 500;
}
.activity-event-head time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 1px;
}
.activity-event-context {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.activity-actor {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.activity-waiting {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
}
.activity-waiting a {
  font-size: 12px;
  color: var(--muted);
}
.activity-waiting a:hover {
  color: var(--teal);
  text-decoration: underline;
}
.activity-panel-footer {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 20px;
}
.activity-panel-footer > span {
  font-size: 12px;
  color: var(--muted);
}
.activity-panel-footer .text-link {
  font-size: 12px;
}
@keyframes process-breathe {
  50% {
    box-shadow: 0 0 0 3px #3b74591a;
  }
}
@media (min-width: 1700px) {
  .overview-workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}
@media (max-width: 1180px) {
  .overview-workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
  }
  #overview-requests th:nth-child(4),
  #overview-requests td:nth-child(4) {
    display: none;
  }
}
@media (max-width: 950px) {
  .overview-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .overview-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .activity-heading,
  .activity-panel-footer,
  .activity-waiting {
    grid-column: 1/-1;
  }
  .activity-processes {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    margin-bottom: 18px;
  }
  .activity-recent {
    padding-top: 0;
  }
  #overview-requests th:nth-child(4),
  #overview-requests td:nth-child(4) {
    display: table-cell;
  }
  .recent-activity-list > li:nth-child(n + 4) {
    display: none;
  }
}
@media (max-width: 540px) {
  .overview-activity {
    display: block;
  }
  .activity-processes {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
  }
  .activity-recent {
    padding-top: 17px;
  }
  .overview-workspace {
    gap: 20px;
  }
  #overview-requests th:nth-child(4),
  #overview-requests td:nth-child(4) {
    display: none;
  }
  #overview-requests td,
  #overview-requests th {
    padding-left: 12px;
    padding-right: 12px;
  }
  #overview-requests .patient-cell {
    min-width: 130px;
  }
  .activity-processes,
  .activity-recent {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .process-indicator.is-running {
    animation: none;
  }
}
/* Retained audit history stays a table, with filters above and details on demand. */
.log-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 22px;
}
.log-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  min-width: 120px;
}
.log-filters input,
.log-filters select {
  font-size: 13px;
  min-height: 36px;
  padding: 7px 9px;
}
.log-filters .log-search {
  flex: 1;
  min-width: 210px;
}
.log-filter-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.log-scope {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  font-size: 12px;
  color: var(--muted);
}
.logs-table {
  min-width: 730px;
}
.logs-table td {
  padding-top: 16px;
  padding-bottom: 16px;
}
.logs-table time {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.log-event {
  padding: 0;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  max-width: 280px;
  overflow-wrap: anywhere;
}
.log-event:hover {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.logs-table td > strong {
  font-size: 13px;
  font-weight: 500;
}
.log-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}
#logs-page-info {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.log-error {
  padding: 25px 22px;
  color: #943c2f;
  font-size: 14px;
}
.log-detail-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 540px) {
  .log-filters {
    padding: 18px;
    gap: 12px;
  }
  .log-filters label {
    min-width: 130px;
    flex: 1;
  }
  .log-filters .log-search {
    flex-basis: 100%;
  }
  .log-filter-actions {
    flex-basis: 100%;
  }
  .log-scope {
    padding: 10px 18px;
    flex-wrap: wrap;
    gap: 5px;
  }
  .log-navigation {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
  .log-navigation .button {
    font-size: 12px;
  }
  #logs-page-info {
    order: 3;
    flex-basis: 100%;
    text-align: center;
  }
}

.logs-panel #logs-results .table-wrap {
  max-height: min(65vh, 700px);
  overflow: auto;
  overscroll-behavior: contain;
}
.logs-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.logs-panel #logs-results {
  scroll-margin-top: 18px;
}
/* Connected clinical workspaces use the same quiet operational surfaces. */
.clinic-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.clinic-actions > .button {
  font-size: 13px;
}
.empty-action {
  margin-top: 20px;
}
.clinic-search {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
}
.clinic-search label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  max-width: 440px;
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}
.clinic-search > span {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  align-self: center;
}
.clinic-footnote {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 18px;
  max-width: 100ch;
}
.clinic-panel-note {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
}
.clinic-muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.clinic-subtitle {
  font-size: 14px;
  margin: 25px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.clinic-links {
  display: grid;
  gap: 5px;
}
.clinic-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.clinic-timeline li {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.clinic-timeline li:last-child {
  border: 0;
}
.clinic-timeline strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.clinic-timeline span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.clinic-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.clinic-settings-grid table {
  font-size: 13px;
}
.clinic-settings-grid th,
.clinic-settings-grid td {
  padding-left: 18px;
  padding-right: 18px;
}
.clinic-checklist {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 0;
  padding: 15px;
  display: grid;
  gap: 12px;
}
.clinic-checklist legend {
  font-size: 13px;
  color: var(--muted);
  padding: 0 5px;
}
.clinic-issues {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  border-left: 2px solid #c2a065;
}
.clinic-issues li {
  padding: 6px 13px;
  font-size: 13px;
  color: #79501e;
}
.clinic-transcript {
  max-height: 410px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfc;
  padding: 15px;
}
.transcript-segment {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.transcript-segment:last-child {
  padding: 0;
  margin: 0;
  border: 0;
}
.transcript-segment > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.transcript-segment p {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.segment-recording {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}
.segment-recording audio {
  max-width: 100%;
  width: 100%;
  height: 36px;
}
.segment-recording small {
  font-size: 12px;
}
.clinic-handoff {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.clinic-handoff strong {
  font-size: 14px;
  display: block;
  margin-bottom: 5px;
}
.clinic-handoff p {
  font-size: 13px;
  margin: 6px 0;
  line-height: 1.6;
}
.clinic-handoff small {
  display: block;
  line-height: 1.6;
}
.scribe-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  margin-top: 25px;
  align-items: start;
}
.scribe-editor > section {
  min-width: 0;
}
.scribe-editor h3 {
  font-size: 14px;
  margin-bottom: 13px;
}
.scribe-editor .operations-form {
  gap: 15px;
}
.scribe-editor textarea {
  font-size: 14px;
  line-height: 1.65;
  min-height: 105px;
}
.scribe-editor .clinic-transcript {
  max-height: 650px;
}
.scribe-editor .clinic-actions {
  margin-top: 14px;
}
.signed-note {
  margin: 0;
}
.signed-note > div {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.signed-note dt {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.signed-note dd {
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
  white-space: pre-wrap;
}
.note-versions {
  display: grid;
  gap: 10px;
}
.note-versions > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.note-versions strong {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.invitation-code {
  display: block;
  overflow-wrap: anywhere;
  background: #f0f5f7;
  border: 1px solid #cad9e0;
  border-radius: 7px;
  padding: 18px;
  font-size: 14px;
  margin: 18px 0;
  user-select: all;
}
.capture-status {
  padding: 18px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafb;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.loading-state {
  padding: 40px 0;
  color: var(--muted);
  font-size: 14px;
}
.clinic-actions + .clinic-issues {
  margin-top: 18px;
}
#clinic-workspace .table-wrap {
  max-width: 100%;
}
#clinic-workspace .table-footer {
  flex-wrap: wrap;
}
#clinic-workspace td > small {
  max-width: 36ch;
  white-space: normal;
}
#clinic-workspace td > small:not(.cell-date) {
  line-height: 1.6;
}
@media (max-width: 1180px) {
  .clinic-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .clinic-settings-grid .table-wrap {
    overflow: auto;
  }
}
@media (max-width: 640px) {
  .scribe-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .scribe-editor .clinic-transcript {
    max-height: 300px;
  }
  .clinic-actions {
    gap: 8px;
  }
  .clinic-actions > .button {
    font-size: 12px;
    white-space: normal;
  }
  .clinic-handoff {
    flex-wrap: wrap;
  }
  .note-versions > div {
    flex-direction: column;
    gap: 2px;
  }
  .clinic-search {
    padding: 16px;
  }
  .clinic-search label {
    min-width: 180px;
  }
  .page-heading .clinic-actions {
    justify-content: flex-end;
  }
  .page-heading:has(.clinic-actions) {
    align-items: flex-start;
  }
}
.transcript-history { margin-top: 16px; }
.transcript-history summary { color: var(--muted, #667681); font-size: 12px; cursor: pointer; padding: 10px 0; }
.transcript-history[open] summary { margin-bottom: 8px; }
/* Patient chart: source identity stays visible throughout the clinical record. */
.chart-breadcrumb {margin-bottom:20px;}
.chart-heading .eyebrow {font-size:11px;text-transform:uppercase;letter-spacing:.08em;margin-bottom:6px;color:var(--muted);}
.chart-context {display:grid;grid-template-columns:1fr 1fr;gap:20px;border:1px solid var(--line);background:#fff;padding:18px 20px;border-radius:8px;margin-bottom:20px;}
.chart-context strong,.chart-context span {display:block;}
.chart-context strong {font-size:13px;font-weight:600;}
.chart-context span {font-size:12px;color:var(--muted);margin-top:4px;}
.chart-linked {padding:0 0 18px;font-size:12px;color:var(--muted);}
.chart-linked button {font-size:12px;}
.chart-tabs {display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--line);margin-bottom:22px;padding-bottom:10px;}
.chart-tabs button {border:0;background:transparent;padding:9px 11px;white-space:nowrap;border-radius:5px;font-size:13px;color:var(--muted);}
.chart-tabs button[aria-pressed="true"] {background:#173344;color:#fff;}
.chart-tabs button span {font-size:11px;margin-left:3px;opacity:.7;}
.chart-tabs button:disabled {opacity:.45;}
.chart-overview-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:20px;margin-bottom:20px;}
.chart-overview-grid > .chart-summary {display:flex;flex-direction:column;}
.chart-overview-grid .chart-record {display:flex;flex-direction:column;flex:1;}
.chart-overview-grid .chart-source {margin-top:0;}
.chart-summary {overflow:hidden;min-width:0;}
.chart-summary .queue-heading {padding:17px 20px;}
.chart-record {padding:20px;border-bottom:1px solid var(--line);}
.chart-record:last-child {border-bottom:0;}
.chart-record-title {display:flex;justify-content:space-between;align-items:start;gap:14px;margin-bottom:13px;}
.chart-record-title strong {font-size:15px;font-weight:600;overflow-wrap:anywhere;}
.chart-record-title small {display:block;font-size:12px;margin-top:3px;}
.chart-record-title .badge {flex-shrink:0;}
.chart-facts {margin:0 0 14px;display:grid;gap:9px;}
.chart-facts>div {display:grid;grid-template-columns:125px minmax(0,1fr);gap:12px;}
.chart-facts dt {color:var(--muted);font-size:12px;}
.chart-facts dd {margin:0;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;}
.chart-document-text {max-height:300px;overflow-y:auto;}
.chart-source {font-size:11px;line-height:1.7;color:var(--muted);overflow-wrap:anywhere;}
.chart-source strong {font-weight:600;}
.chart-record .clinic-actions {margin-top:15px;}
.chart-empty {padding:24px 20px;}
.chart-empty h3 {font-size:14px;margin-bottom:7px;}
.chart-empty p {font-size:13px;line-height:1.6;color:var(--muted);}
.chart-record-error {background:#faf8f8;}
.chart-record-error .chart-record-title strong {text-decoration:line-through;}
.chart-recent {width:100%;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:20px;padding:16px 20px;border:0;border-bottom:1px solid var(--line);background:#fff;}
.chart-recent:last-child {border-bottom:0;}
button.chart-recent:hover {background:#f8fafa;}
.chart-recent strong {font-size:13px;font-weight:500;}
.chart-recent small {display:block;margin-top:4px;font-size:12px;}
.chart-recent>span:last-child {font-size:12px;color:var(--muted);}
.chart-version {border-top:1px solid var(--line);padding:15px 0;}
.chart-version summary {cursor:pointer;font-size:13px;font-weight:500;}
.chart-version p {margin:12px 0;}
@media(max-width:1050px) {
  .chart-overview-grid {grid-template-columns:1fr;}
  .chart-overview-grid .chart-source {min-height:0;}
}
@media(max-width:650px) {
  .chart-context {grid-template-columns:1fr;gap:16px;}
  .chart-record-title {flex-direction:column;gap:8px;}
  .chart-facts>div {grid-template-columns:1fr;gap:3px;}
  .chart-heading {flex-direction:column;align-items:start;gap:16px;}
  .chart-recent {flex-wrap:wrap;gap:10px;}
}

/* Patient overview sections share the chart typography and neutral palette. */
.patient-insight-sections { display:flex; flex-direction:column; gap:20px; margin-bottom:20px; }
.patient-insight-sections > .panel { margin:0; min-width:0; padding:0; overflow:hidden; }
.patient-insight-sections > .chart-overview-grid { margin:0; }
.patient-insight-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 20px; border-bottom:1px solid var(--line); }
.patient-private-label { font-size:12px; color:var(--muted); white-space:nowrap; }
.patient-summary-content { padding:0 20px 8px; }
.patient-briefing-facts { margin:0; padding:0; list-style:none; }
.patient-briefing-facts li { padding:12px 0; border-bottom:1px solid var(--line); }
.patient-briefing-facts li:last-child { border:0; }
.patient-briefing-facts p { font-size:13px; line-height:1.6; margin:0 0 5px; color:var(--ink); overflow-wrap:anywhere; white-space:pre-wrap; }
.patient-citations { display:flex; flex-wrap:wrap; gap:6px 14px; }
.patient-source-link { appearance:none; border:0; background:transparent; color:var(--muted); padding:0; font:inherit; font-size:11px; text-align:left; text-decoration:underline; text-underline-offset:3px; cursor:pointer; max-width:100%; overflow-wrap:anywhere; }
.patient-source-link:hover { color:var(--ink); }
.patient-insight-footer { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; border-top:1px solid var(--line); padding:12px 20px; font-size:11px; line-height:1.6; color:var(--muted); }
.patient-insight-footer span { white-space:nowrap; }
.patient-messages { max-height:400px; overflow-y:auto; overscroll-behavior:contain; padding:20px; }
.patient-chat-empty { font-size:13px; color:var(--muted); }
.patient-message { font-size:13px; line-height:1.6; margin-bottom:16px; }
.patient-message:last-child { margin-bottom:0; }
.patient-message > span { display:block; font-size:12px; font-weight:600; margin-bottom:5px; color:var(--muted); }
.patient-message > p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.patient-message-user { background:var(--paper); border-left:2px solid var(--line); padding:12px 16px; }
.patient-message-answer .patient-briefing-facts li { padding:4px 0 8px; border:0; }
.patient-question-form { border:1px solid var(--line); border-radius:6px; margin:0 20px; padding:12px; background:#fff; }
.patient-question-form:focus-within { border-color:var(--muted); }
.patient-question-form textarea { width:100%; resize:vertical; min-height:48px; max-height:160px; border:0; outline:0; box-shadow:none; padding:0; border-radius:0; font:inherit; font-size:13px; line-height:1.6; color:var(--ink); background:transparent; }
.patient-question-form textarea:focus { box-shadow:none; outline:none; }
.patient-question-form textarea::placeholder { color:var(--muted); }
.patient-question-form textarea:disabled { opacity:.6; }
.patient-question-form > div { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:8px; }
.patient-question-form > div > span { font-size:11px; line-height:1.6; color:var(--muted); }
.patient-insight-caption { font-size:11px; line-height:1.6; color:var(--muted); margin:12px 0 0; }
.patient-question-panel > .patient-insight-caption { margin:12px 20px; }
.patient-insight-empty { margin:20px 0; font-size:13px; line-height:1.6; color:var(--muted); }
.patient-insight-error { border:1px solid var(--line); color:var(--ink); background:#fff; padding:14px 20px; border-radius:6px; margin-bottom:20px; font-size:13px; line-height:1.6; }
.patient-summary-skeleton { padding:20px 0 0; max-width:760px; }
.patient-summary-skeleton i { display:block; height:10px; background:linear-gradient(100deg,var(--paper) 20%,var(--line) 45%,var(--paper) 70%); background-size:220% 100%; animation:patient-summary-shimmer 1.6s linear infinite; border-radius:3px; margin-bottom:16px; }
.patient-summary-skeleton i:nth-child(2) { width:85%; }
.patient-summary-skeleton i:nth-child(4) { width:65%; }
.patient-response-loading { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.patient-response-dots { display:inline-flex; gap:4px; }
.patient-response-dots i { width:5px; height:5px; background:var(--muted); border-radius:50%; animation:patient-response-pulse 1.1s infinite; }
.patient-response-dots i:nth-child(2) { animation-delay:.14s; }
.patient-response-dots i:nth-child(3) { animation-delay:.28s; }
@keyframes patient-response-pulse { 0%,70%,100% { opacity:.3; transform:translateY(0); } 35% { opacity:1; transform:translateY(-3px); } }
@keyframes patient-summary-shimmer { to { background-position:-220% 0; } }
@media (prefers-reduced-motion:reduce) { .patient-summary-skeleton i,.patient-response-dots i { animation:none; } }
@media(max-width:600px) {
  .patient-insight-heading { gap:12px; }
  .patient-question-form > div { align-items:flex-end; }
  .patient-question-form > div > span { max-width:145px; }
}

/* Settings and support stay above the current workspace. */
.sidebar-utilities { padding:12px 0 0; margin-top:12px; border-top:1px solid #35505e; }
.sidebar-utilities .nav-item { font-size:13px; min-height:32px; }
.account-role { display:block; font-size:11px; color:#afc2cb; margin-top:3px; }
.workspace-scrim { background:#102332a8; backdrop-filter:blur(3px); }
.workspace-modal { width:min(1080px,calc(100vw - 64px)); height:min(780px,calc(100dvh - 64px)); max-height:calc(100dvh - 64px); padding:0; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 30px 120px #07172466; border-radius:12px; }
.workspace-modal > .section-top { padding:20px 24px; margin:0; border-bottom:1px solid var(--line); align-items:center; flex-shrink:0; }
.workspace-modal > .section-top h2 { font-size:20px; padding:0; }
.workspace-dialog-layout { display:grid; grid-template-columns:210px minmax(0,1fr); flex:1; min-height:0; height:100%; }
.workspace-dialog-nav { padding:20px 12px; background:#f7f8f8; border-right:1px solid var(--line); display:flex; flex-direction:column; gap:5px; }
.workspace-dialog-nav button { text-align:left; border-radius:6px; padding:10px 12px; font-size:13px; color:var(--muted); line-height:1.5; }
.workspace-dialog-nav button:hover { background:#eaf0f2; color:var(--ink); }
.workspace-dialog-nav button[aria-current="page"] { background:#e7edef; color:var(--ink); font-weight:600; }
.workspace-dialog-content { overflow-y:auto; padding:30px 32px; min-width:0; min-height:0; }
.workspace-dialog-content [hidden] { display:none !important; }
.workspace-section-heading { margin-bottom:24px; }
.workspace-section-heading h3,.workspace-security h3 { font-size:17px; margin:0 0 8px; }
.workspace-section-heading p,.workspace-security p { font-size:13px; line-height:1.65; color:var(--muted); max-width:620px; }
.workspace-account-details { margin:0 0 30px; }
.workspace-account-details > div { display:grid; grid-template-columns:130px minmax(0,1fr); gap:20px; padding:14px 0; border-bottom:1px solid var(--line); font-size:13px; }
.workspace-account-details dt { color:var(--muted); }
.workspace-account-details dd { margin:0; overflow-wrap:anywhere; }
.workspace-security { padding-top:10px; }
.workspace-security .button { margin-top:16px; }
.workspace-dialog-content .settings-panel { padding:0; border:0; box-shadow:none; margin:0 0 24px; background:transparent; }
.workspace-dialog-content .settings-panel h2 { font-size:17px; }
.workspace-dialog-content .operations-form { max-width:560px; }
.workspace-dialog-content .member-list { margin-top:20px; }
.workspace-dialog-content .member-list > div { padding:14px 0; }
#workspace-help { flex:1; min-height:0; }
.help-content { display:flex; flex-direction:column; }
.help-content .workspace-section-heading { margin-bottom:16px; flex-shrink:0; }
.help-connection-note { font-size:12px; line-height:1.6; color:var(--muted); padding:12px 14px; border:1px solid var(--line); border-radius:6px; margin-bottom:16px; }
.help-messages { flex:1; overflow-y:auto; min-height:100px; padding:4px 2px 16px; overscroll-behavior:contain; }
.help-empty { font-size:13px; color:var(--muted); line-height:1.7; padding:14px 0; }
.help-message { font-size:13px; line-height:1.7; padding:12px 0; }
.help-message strong { display:block; font-size:12px; color:var(--muted); margin-bottom:5px; }
.help-message p { white-space:pre-wrap; overflow-wrap:anywhere; }
.help-message-user { background:var(--paper); border-radius:6px; padding:12px 16px; margin:8px 0; }
.help-message-status { font-size:11px; color:var(--muted); margin:5px 0 14px; }
.help-message-pending { display:flex; align-items:center; gap:10px; color:var(--muted); }
.help-sources { display:flex; flex-wrap:wrap; gap:8px 16px; margin-top:8px; }
.help-sources .text-link { font-size:12px; font-weight:400; text-decoration:underline; text-underline-offset:3px; padding:0; color:var(--muted); }
.support-composer { border:1px solid #bac7ce; border-radius:8px; padding:12px; flex-shrink:0; margin-top:12px; }
.support-composer:focus-within { border-color:var(--ink); }
.support-composer textarea { border:0; box-shadow:none; outline:none; width:100%; min-height:70px; max-height:160px; padding:0; font-size:13px; resize:vertical; }
.support-composer textarea:focus { outline:none; box-shadow:none; }
.support-composer > div { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:10px; }
.support-composer > div > span { font-size:11px; line-height:1.5; color:var(--muted); max-width:330px; }
.help-error { font-size:12px; line-height:1.6; color:var(--ink); margin-top:12px; }
.help-error .text-link { font-size:12px; }
.help-article-list { border-top:1px solid var(--line); }
.help-article-list > button { display:flex; justify-content:space-between; gap:20px; width:100%; padding:16px 0; border-bottom:1px solid var(--line); font-size:13px; text-align:left; }
.help-article-list > button:hover { color:var(--teal); }
.help-article { font-size:13px; line-height:1.8; }
.help-article h3 { margin:20px 0 16px; font-size:18px; }
.help-article .button { margin-top:24px; }
@media(max-width:850px) {
  .sidebar-utilities { display:flex !important; gap:8px; border:0; padding:0; margin:0; }
  .sidebar-utilities .nav-item { width:auto; padding:8px; }
  .workspace-modal { width:calc(100vw - 24px); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); }
  .workspace-dialog-layout { grid-template-columns:170px minmax(0,1fr); }
  .workspace-dialog-content { padding:24px; }
}
@media(max-width:600px) {
  .workspace-modal { width:100%; height:100dvh; max-height:100dvh; border-radius:0; }
  .workspace-modal > .section-top { padding:14px 16px; }
  .workspace-dialog-layout { display:flex; flex-direction:column; }
  .workspace-dialog-nav { flex-direction:row; overflow-x:auto; padding:10px; border-right:0; border-bottom:1px solid var(--line); flex-shrink:0; }
  .workspace-dialog-nav button { white-space:nowrap; font-size:12px; padding:8px 10px; }
  .workspace-dialog-content { padding:20px 16px; flex:1; }
  .workspace-account-details > div { grid-template-columns:90px minmax(0,1fr); gap:10px; }
  .support-composer > div { align-items:flex-end; gap:8px; }
  .support-composer > div > span { max-width:170px; }
}
@media(max-width:850px) {
  .sidebar-bottom { display:block; padding:8px 0 0; border:0; }
  .sidebar-bottom .profile { display:none; }
}
.agent-job-status {display:flex;align-items:center;gap:12px;font-size:13px;color:var(--muted);padding:24px 0;}
.agent-handoff-form {border-top:1px solid var(--line);padding-top:20px;margin-top:20px;}
#agent-runtime-form fieldset {border:0;padding:0;margin:0;display:grid;gap:20px;min-width:0;}
#agent-runtime-form .form-grid {grid-template-columns:1fr 1fr;}
#agent-runtime-form .button {justify-self:start;}
@media(max-width:600px){#agent-runtime-form .form-grid {grid-template-columns:1fr;}}

/* Practice administration uses the same type, surfaces and spacing as clinical work. */
.admin-heading { align-items:center; }
.admin-heading-actions { display:flex; align-items:center; gap:10px; }
.admin-period select { min-height:34px; padding:6px 28px 6px 10px; font-size:12px; width:auto; background-color:white; }
.admin-section { padding:0; margin-bottom:20px; overflow:hidden; }
.admin-section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:17px 20px; border-bottom:1px solid var(--line); }
.admin-section-heading h2 { font-size:15px; }
.admin-section-heading .text-link { font-size:12px; }
.admin-state { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:500; line-height:1.5; color:var(--muted); white-space:nowrap; }
.admin-state i { width:5px; height:5px; background:#8c9ba4; border-radius:50%; flex-shrink:0; }
.admin-state.green { color:#31694e; }
.admin-state.green i { background:#3b7459; }
.admin-notice { padding:12px 16px; border:1px solid var(--line); background:#eef2f3; border-radius:6px; font-size:12px; color:var(--muted); line-height:1.7; margin-bottom:20px; }
.admin-channel-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.admin-channel-list .admin-section { margin:0; }
.admin-channel-body { padding:20px; }
.admin-channel-body > p { font-size:13px; color:var(--muted); margin-bottom:20px; }
.admin-inline-details { margin:0 0 24px; display:grid; gap:12px; }
.admin-inline-details > div { display:grid; grid-template-columns:115px minmax(0,1fr); gap:12px; font-size:12px; }
.admin-inline-details dt { color:var(--muted); }
.admin-inline-details dd { margin:0; overflow-wrap:anywhere; }
.admin-row-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.admin-row-actions .text-link { font-size:12px; }
.admin-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border:1px solid var(--line); border-radius:var(--radius); background:white; margin-bottom:20px; overflow:hidden; }
.admin-metrics > div { padding:20px; border-right:1px solid var(--line); }
.admin-metrics > div:last-child { border:0; }
.admin-metrics span { display:block; font-size:12px; color:var(--muted); }
.admin-metrics strong { display:block; font-size:27px; font-weight:500; letter-spacing:-.7px; line-height:1.4; margin:8px 0; }
.admin-metrics small { display:block; font-size:11px; color:var(--muted); }
.admin-table td,.admin-table th { font-size:12px; padding:15px 20px; vertical-align:middle; }
.admin-table td strong { font-size:13px; display:block; font-weight:500; }
.admin-table td small { display:block; font-size:11px; color:var(--muted); max-width:440px; margin-top:4px; line-height:1.6; white-space:normal; }
.admin-table td:first-child { white-space:normal; }
.admin-table td:last-child .button { white-space:nowrap; }
.admin-empty { padding:32px 20px; color:var(--muted); font-size:13px; }
.admin-budget { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 20px 14px; }
.admin-budget strong { font-size:20px; font-weight:500; }
.admin-budget strong span { font-size:13px; color:var(--muted); }
.admin-budget p { font-size:12px; color:var(--muted); margin-top:4px; }
.admin-progress { display:block; appearance:none; width:calc(100% - 40px); height:5px; border:0; border-radius:4px; overflow:hidden; margin:0 20px; background:var(--line); accent-color:var(--teal); }
.admin-progress::-webkit-progress-bar { background:var(--line); }
.admin-progress::-webkit-progress-value { background:var(--teal); }
.admin-progress::-moz-progress-bar { background:var(--teal); }
.admin-budget-footer { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 20px 20px; font-size:11px; color:var(--muted); }
.admin-chart { display:flex; gap:3px; height:182px; margin:24px 20px 12px; border-bottom:1px solid var(--line); }
.admin-chart-column { display:flex; flex-direction:column; flex:1; min-width:0; position:relative; }
.admin-chart-column > div { flex:1; display:flex; align-items:flex-end; }
.admin-chart-column > div > svg { display:block; width:100%; height:100%; }
.admin-chart-column rect { fill:var(--teal); }
.admin-chart-column small { display:block; position:absolute; top:calc(100% + 8px); white-space:nowrap; color:var(--muted); font-size:10px; }
.admin-chart-column:last-child small { right:0; }
.admin-chart-data { margin:38px 20px 16px; font-size:11px; color:var(--muted); }
.admin-chart-data summary { cursor:pointer; }
.admin-chart-data .table-wrap { max-height:260px; overflow:auto; margin-top:12px; }
.admin-caption { font-size:11px; line-height:1.7; color:var(--muted); margin:12px 0 20px; }
.admin-section > .admin-caption { margin:0; padding:0 20px 20px; }
.admin-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; }
.admin-toolbar > span { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; }
.admin-toolbar-note { color:var(--muted); font-size:11px; }
.admin-toolbar .text-link { font-size:12px; white-space:nowrap; }
.admin-split { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.admin-outcome { display:flex; align-items:center; justify-content:space-between; padding:20px; gap:20px; }
.admin-outcome > div { display:flex; align-items:center; gap:16px; }
.admin-outcome strong { font-size:27px; font-weight:500; }
.admin-outcome span { font-size:12px; color:var(--muted); }
.admin-control-list { margin:0; padding:0 20px; }
.admin-control-list > div { padding:16px 0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; border-bottom:1px solid var(--line); font-size:12px; }
.admin-control-list > div:last-child { border:0; }
.admin-control-list dt { color:var(--muted); }
.admin-control-list dd { margin:0; display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; overflow-wrap:anywhere; }
.admin-pagination { display:flex; align-items:center; justify-content:flex-end; gap:16px; padding:16px 20px; font-size:12px; color:var(--muted); }
.admin-updated { color:var(--muted); font-size:10px; margin-top:20px; }
.admin-loading { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--muted); padding:36px 0; }
.admin-spinner { width:14px; height:14px; border:1.5px solid var(--line); border-top-color:var(--teal); border-radius:50%; animation:admin-spin .8s linear infinite; }
@keyframes admin-spin { to { transform:rotate(360deg); } }
.admin-error { font-size:13px; padding:20px; border:1px solid var(--line); border-radius:6px; }
.admin-error .text-link { margin-left:12px; }
.admin-day-picker { border:0; padding:0; margin:0; }
.admin-day-picker legend { font-size:12px; margin-bottom:8px; }
.admin-day-picker > label { display:inline-flex; align-items:center; gap:5px; margin:0 12px 8px 0; font-size:12px; }
.admin-day-picker input { width:auto; min-height:0; }
.admin-agent-description { color:var(--muted); font-size:13px; line-height:1.7; margin-bottom:16px; }
.operations-modal > .admin-control-list { padding:0; }
.admin-instructions { margin:20px 0; font-size:12px; }
.admin-instructions summary { cursor:pointer; color:var(--muted); }
.admin-instructions pre { font:12px/1.7 "Instrument Sans",sans-serif; white-space:pre-wrap; overflow-wrap:anywhere; background:var(--paper); border:1px solid var(--line); padding:16px; border-radius:6px; max-height:260px; overflow-y:auto; margin-top:12px; }
@media(min-width:851px) {
  .sidebar { width:194px; padding:22px 8px 12px; }
  .main-shell { margin-left:194px; }
  .brand { width:112px; margin:0 10px 22px; }
  .nav-item { font-size:12px; min-height:30px; padding:5px 8px; gap:8px; }
  .nav-item .icon { width:15px; height:15px; }
  .nav-group + .nav-group { margin-top:17px; }
  .nav-group-label { font-size:9px; padding:0 8px 6px; }
  .sidebar-utilities .nav-item { font-size:12px; min-height:30px; }
  .sidebar-bottom { padding-top:12px; }
  .workspace { padding:0 6px 12px; gap:8px; }
  .workspace strong { font-size:11px; }
  .workspace small,.account-role { font-size:10px; }
  .profile { padding:0 6px; gap:8px; }
  .profile strong { font-size:11px; }
  .profile .avatar { width:28px; height:28px; font-size:10px; }
  .sidebar-utilities { padding-top:8px; margin-top:10px; }
}
@media(min-width:1700px) { .sidebar { width:208px; } .main-shell { margin-left:208px; } }
@media(max-width:1100px) { .admin-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-metrics > div:nth-child(2) { border-right:0; } .admin-metrics > div:nth-child(-n+2) { border-bottom:1px solid var(--line); } }
@media(max-width:700px) {
  .admin-heading { align-items:flex-start; gap:16px; }
  .admin-heading-actions { flex-wrap:wrap; }
  .admin-channel-list,.admin-split { grid-template-columns:1fr; }
  .admin-section-heading { align-items:flex-start; }
  .admin-toolbar,.admin-outcome { align-items:flex-start; flex-direction:column; }
  .admin-control-list > div { grid-template-columns:1fr; gap:6px; }
  .admin-budget { align-items:flex-start; }
  .admin-budget-footer { flex-wrap:wrap; }
  .admin-metrics > div { padding:16px; }
}
@media(prefers-reduced-motion:reduce) { .admin-spinner { animation:none; } }

/* Keep daily work visible; reveal secondary navigation on demand. */
.sidebar-disclosure > summary { list-style:none; cursor:pointer; user-select:none; }
.sidebar-disclosure > summary::-webkit-details-marker { display:none; }
.sidebar-disclosure > summary::marker { content:""; }
.sidebar-disclosure > summary > .icon:last-child { margin-left:auto; width:12px; height:12px; color:#8fa7b4; }
.sidebar-disclosure[open] > summary > .icon:last-child { transform:rotate(90deg); }
.sidebar-disclosure > summary.contains-active { color:#fff; }
.sidebar-disclosure > .nav-group-links { margin-top:4px; padding-left:12px; }
.sidebar-disclosure:not([open]) > .nav-group-links { display:none; }
.sidebar-disclosure[open] > summary > b { display:none; }
.sidebar-disclosure > .nav-group-links .nav-item { font-size:11px; }
.sidebar-disclosure > summary b { font-size:10px; padding:0 5px; line-height:17px; }
.sidebar-disclosure > summary b + .icon { margin-left:2px; }
.sidebar .nav-group + .nav-group { margin-top:10px; }
.sidebar .nav-item b { font-size:10px; }
.sidebar-bottom .workspace { padding-bottom:10px; }
.sidebar-bottom .profile { margin-bottom:2px; }
@media(min-width:851px) {
  .sidebar .nav-item { font-size:11px; line-height:18px; min-height:29px; padding:5px 8px; }
  .sidebar .nav-item .icon { width:14px; height:14px; }
  .sidebar .nav-item > span { white-space:nowrap; }
  .sidebar-disclosure > .nav-group-links .nav-item { font-size:10.5px; }
  .sidebar .brand { width:104px; margin-bottom:23px; }
  .sidebar .workspace strong,.sidebar .profile strong { font-size:10px; font-weight:500; }
  .sidebar .workspace > .icon { width:14px; height:14px; }
  .sidebar .profile .avatar { width:24px; height:24px; font-size:9px; }
  .sidebar .sidebar-utilities { border-top:0; margin-top:8px; padding-top:0; }
}
@media(max-width:850px) {
  .sidebar .nav-group + .nav-group { margin-top:0; }
  .sidebar-disclosure > summary { min-height:40px; }
  .sidebar-disclosure > .nav-group-links { padding-left:0; }
  .sidebar-disclosure:not([open]) > .nav-group-links { display:none; }
}

.chart-context-structured { font-size:12px; line-height:1.7; overflow-wrap:anywhere; margin-top:16px; }
.chart-context-structured summary { cursor:pointer; color:var(--muted); margin-bottom:12px; }
.chart-record-text { font-size:13px; line-height:1.7; overflow-wrap:anywhere; }

/* Guided demo: restrained, sequential, and explicitly fictional. */
.demo-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:20px; }
.demo-tabs button { border:1px solid var(--line); border-radius:7px; background:white; padding:16px; text-align:left; font-size:12px; line-height:1.5; }
.demo-tabs button > span { color:var(--muted); display:block; font-size:10px; margin-bottom:7px; }
.demo-tabs button[aria-current="page"] { border-color:var(--teal); background:#edf3f4; }
.demo-tabs small { display:block; color:#31694e; font-size:10px; margin-top:5px; }
.demo-panel { padding:0; overflow:hidden; }
.demo-panel-header { padding:24px; border-bottom:1px solid var(--line); }
.demo-panel-header h2 { font-size:18px; margin-bottom:8px; }
.demo-panel-header p { font-size:13px; color:var(--muted); max-width:760px; line-height:1.7; }
.demo-progress { list-style:none; padding:18px 24px; margin:0; display:flex; gap:18px; border-bottom:1px solid var(--line); background:#fafbfb; }
.demo-progress li { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; flex:1; }
.demo-progress li > span { border:1px solid var(--line); border-radius:50%; width:22px; height:22px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:10px; }
.demo-progress .current { color:var(--ink); font-weight:600; }
.demo-progress .current > span { border-color:var(--teal); background:var(--teal); color:white; }
.demo-progress .done > span { border-color:#bcd4c7; background:#eaf4ee; color:#31694e; }
.demo-body { padding:24px; max-width:900px; }
.demo-patient { display:flex; gap:8px 16px; flex-wrap:wrap; align-items:center; margin-bottom:24px; font-size:12px; padding-bottom:16px; border-bottom:1px solid var(--line); }
.demo-patient span { color:var(--muted); }
.demo-patient .text-link { margin-left:auto; font-size:11px; }
.demo-form { max-width:none; }
.demo-form fieldset { border:0; padding:0; margin:0; min-width:0; display:grid; gap:20px; }
.demo-form p,.demo-intro { font-size:13px; line-height:1.7; color:var(--muted); }
.demo-intro { margin-bottom:20px; }
.demo-form label { max-width:720px; }
.demo-source-card { display:grid; gap:6px; padding:16px; border:1px solid var(--line); background:var(--paper); border-radius:6px; font-size:13px; }
.demo-source-card span { color:var(--muted); font-size:12px; }
.demo-source-card small { font-size:11px; }
.demo-source { border:1px solid var(--line); border-radius:6px; font-size:12px; overflow:hidden; }
.demo-source summary { cursor:pointer; padding:12px 16px; color:var(--muted); }
.demo-source > div { padding:16px; border-top:1px solid var(--line); font-size:13px; line-height:1.8; max-height:360px; overflow-y:auto; }
.demo-request { border:1px solid var(--line); border-radius:6px; padding:16px; font-size:12px; }
.demo-request > div:first-child { display:flex; justify-content:space-between; gap:12px; margin-bottom:12px; }
.demo-request dl { margin:0; }
.demo-request dl > div { display:grid; grid-template-columns:140px minmax(0,1fr); gap:12px; padding:7px 0; }
.demo-request dt { color:var(--muted); }
.demo-request dd { margin:0; overflow-wrap:anywhere; }
.demo-request ul { padding-left:18px; color:#805524; }
.demo-action-row { display:flex; flex-wrap:wrap; gap:12px; margin-top:4px; }
.demo-result > h2 { margin:12px 0; }
.demo-result > p { color:var(--muted); font-size:13px; line-height:1.7; margin-bottom:20px; }
.demo-note-section { padding:16px 0; border-top:1px solid var(--line); }
.demo-note-section h3 { font-size:13px; margin-bottom:8px; }
.demo-note-section p { font-size:13px; line-height:1.7; }
.demo-saving { display:flex; align-items:center; gap:10px; font-size:12px; color:var(--muted); margin-top:16px; }
.demo-draft-origin { font-size:11px!important; }
@media(max-width:750px) {
  .demo-tabs { grid-template-columns:1fr; gap:8px; }
  .demo-tabs button { padding:12px 16px; }
  .demo-tabs button > span { display:inline; margin-right:12px; }
  .demo-progress { flex-wrap:wrap; gap:12px; }
  .demo-progress li { flex:0 0 calc(50% - 12px); }
  .demo-panel-header,.demo-body { padding:20px; }
  .demo-request dl > div { grid-template-columns:1fr; gap:3px; }
}

/* Shared gold interaction treatment for every sidebar destination and disclosure. */
.sidebar .nav-item:hover,
.sidebar .nav-item:focus-visible {
  color: #f4dfbc;
  background: #aa783c26;
  box-shadow: inset 2px 0 0 #c49a60;
}
.sidebar .nav-item.active {
  color: #fae7c8;
  background: #aa783c38;
  box-shadow: inset 2px 0 0 #d4ad75;
}
.sidebar .nav-item:focus-visible {
  outline: 2px solid #d4ad75;
  outline-offset: 2px;
}
.sidebar .nav-item:is(:hover, :focus-visible, .active) > .icon {
  color: #d4ad75;
}

.fluent-assistant { display: grid; gap: 0.85rem; margin-bottom: 1rem; padding: 1rem; min-width: 0; }
.fluent-assistant-history { display: grid; gap: 1rem; overflow-wrap: anywhere; }
.fluent-assistant-history article { border-top: 1px solid currentColor; padding-top: 0.75rem; }
.fluent-assistant form { display: grid; gap: 0.65rem; justify-items: start; }
.fluent-assistant form label { display: grid; gap: 0.35rem; width: 100%; }
.fluent-assistant label.fluent-assistant-check { display: flex; align-items: start; }
.fluent-assistant textarea, .fluent-assistant input:not([type=checkbox]) { width: 100%; }
.fluent-assistant-status { min-height: 1.2em; }
.fluent-assistant-print { display: none; }
@media print {
  body:has(> .fluent-assistant-print) > :not(.fluent-assistant-print) { display: none !important; }
  body:has(> .fluent-assistant-print) { background: white !important; color: black !important; }
  .fluent-assistant-print { display: block; color: black; background: white; font: 12pt/1.5 serif; overflow-wrap: anywhere; }
  .fluent-assistant-print p { white-space: pre-wrap; }
  .fluent-assistant-print a { color: black; }
}

/* The iPhone supplies native navigation around the same scribe editor. */
.native-scribe .sidebar,
.native-scribe .topbar,
.native-scribe .footer { display: none; }
.native-scribe .main-shell { margin-left: 0; min-height: 100dvh; }
.native-scribe #main { padding: 16px; }
.native-scribe .encounter-steps { display: none; }
