/* KenwickPad v5 live stage 1 stylesheet. Keep legacy app patches out. */
@import url("/v5-concept.css");

.v5-live-shell .sync-pill b {
  color: #0756b7;
}

.v5-live-shell .sync-pill span {
  background: #0b73df;
}

.v5-live-shell .case-tabs {
  min-width: 0;
}

.v5-live-shell .selected-case-strip {
  display: none;
}

.v5-live-shell .case-tab {
  cursor: pointer;
}

.v5-live-shell .case-tab.draft:not(.active) {
  background: #ffffff;
}

.v5-live-shell .case-tab .close {
  pointer-events: auto;
}

.v5-live-shell .case-tab.status-draft {
  border-color: #d7e0ec;
  box-shadow: inset 5px 0 0 #94a3b8;
}

.v5-live-shell .case-tab.status-draft::before,
.v5-live-shell .status-key .draft {
  background: #94a3b8;
}

.v5-live-shell .case-tab.status-active-case {
  border-color: #bcd9f8;
  box-shadow: inset 5px 0 0 #0967d2;
}

.v5-live-shell .case-tab.status-active-case::before {
  background: #0967d2;
}

.v5-live-shell .case-tab.status-review {
  border-color: #f4d28c;
  background: #fffaf0;
  box-shadow: inset 5px 0 0 #f59e0b;
}

.v5-live-shell .case-tab.status-review::before {
  background: #f59e0b;
}

.v5-live-shell .case-tab.status-saved {
  border-color: #b9e8c5;
  background: #f1fbf4;
  box-shadow: inset 5px 0 0 #16a34a;
}

.v5-live-shell .case-tab.status-saved::before {
  background: #16a34a;
}

.v5-live-shell .case-tab.status-problem {
  border-color: #fecaca;
  background: #fff5f5;
  box-shadow: inset 5px 0 0 #ef4444;
}

.v5-live-shell .case-tab.status-problem::before {
  background: #ef4444;
}

.v5-live-shell .case-tab.active {
  box-shadow: inset 5px 0 0 #0967d2, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .case-tab.status-draft.active {
  box-shadow: inset 5px 0 0 #94a3b8, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .case-tab.status-active-case.active {
  box-shadow: inset 5px 0 0 #0967d2, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .case-tab.status-review.active {
  box-shadow: inset 5px 0 0 #f59e0b, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .case-tab.status-saved.active {
  box-shadow: inset 5px 0 0 #16a34a, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .case-tab.status-problem.active {
  box-shadow: inset 5px 0 0 #ef4444, 0 12px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .tab-close {
  position: absolute;
  right: 11px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cbdced;
  border-radius: 999px;
  background: #fff;
  color: #30435f;
  font-weight: 950;
  font-size: .78rem;
}

.v5-live-shell .status-card[aria-pressed="true"] {
  background: #f1f9ff;
  box-shadow: 0 0 0 3px rgba(9, 103, 210, .1);
}

.v5-live-shell .status-card.saved[aria-pressed="true"] {
  background: #effaf2;
}

.v5-live-shell .status-card.review[aria-pressed="true"] {
  background: #fff8e7;
}

.v5-live-shell .local-empty {
  padding: 16px;
  color: #5b6d8a;
  text-align: center;
  font-weight: 800;
}

.v5-live-shell .vitals-table-wrap {
  overflow-x: auto;
}

.v5-live-shell .vitals-draft-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff7ff, #f7fbff);
  color: #174a7a;
  padding: 8px 10px;
}

.v5-live-shell .medication-draft-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border: 1px solid #c7ddf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #fff);
  color: #174a7a;
  padding: 8px 10px;
}

.v5-live-shell .recovery-draft-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #fff);
  color: #174a7a;
  padding: 8px 10px;
}

.v5-live-shell .photo-draft-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #fff);
  color: #174a7a;
  padding: 8px 10px;
}

.v5-live-shell .pdf-draft-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border: 1px solid #c7ddf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbff, #fff);
  color: #174a7a;
  padding: 8px 10px;
}

.v5-live-shell .medication-draft-panel b {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v5-live-shell .recovery-draft-panel b {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v5-live-shell .photo-draft-panel b {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v5-live-shell .pdf-draft-panel b {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v5-live-shell .medication-draft-panel span {
  color: #496782;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell .recovery-draft-panel span {
  color: #496782;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell .photo-draft-panel span {
  color: #496782;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell .pdf-draft-panel span {
  color: #496782;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell .task-chip-field {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e5f2;
  border-radius: 9px;
  background: #fbfdff;
  padding: 9px;
}

.v5-live-shell .task-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v5-live-shell .task-chip-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #d9e4ee;
  border-radius: 999px;
  background: #fff;
  color: #315676;
  padding: 0 11px;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell .task-chip-grid input {
  width: 15px;
  height: 15px;
  accent-color: #0b73df;
}

.v5-live-shell .medication-grid {
  grid-template-columns: minmax(90px, .7fr) minmax(150px, 1.1fr) minmax(190px, 1.45fr) minmax(120px, .85fr);
  border: 1px dashed #c7ddf4;
  border-radius: 16px;
  background: rgba(248, 251, 255, .7);
  padding: 8px;
}

.v5-live-shell .medication-grid label:nth-child(5),
.v5-live-shell .medication-grid label:nth-child(6) {
  min-width: 120px;
}

.v5-live-shell .recovery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px dashed #d7e4ef;
  border-radius: 16px;
  background: rgba(248, 251, 255, .7);
  padding: 8px;
}

.v5-live-shell .recovery-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.v5-live-shell .pdf-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px dashed #c7ddf4;
  border-radius: 16px;
  background: rgba(248, 251, 255, .7);
  padding: 8px;
}

.v5-live-shell .checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
}

.v5-live-shell .checkbox-card input {
  width: 20px;
  height: 20px;
  accent-color: #0967d2;
}

.v5-live-shell .checkbox-card span {
  color: #09284f;
  font-size: .85rem;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}

.v5-live-shell .medication-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.v5-live-shell .recovery-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.v5-live-shell .photo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.v5-live-shell .pdf-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.v5-live-shell .danger-action {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b42318;
}

.v5-live-shell .photo-count {
  color: #496782;
  font-size: .78rem;
  font-weight: 900;
}

.v5-live-shell .hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.v5-live-shell .photo-gallery-panel {
  margin-top: 10px;
}

.v5-live-shell .photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.v5-live-shell .photo-card {
  display: grid;
  gap: 7px;
  border: 1px solid #d8e8f5;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 8px;
  box-shadow: 0 5px 14px rgba(8, 70, 130, .06);
}

.v5-live-shell .photo-card img,
.v5-live-shell .photo-missing {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: #eef5fb;
  object-fit: cover;
}

.v5-live-shell .photo-missing {
  display: grid;
  place-items: center;
  color: #6b7d92;
  font-size: .76rem;
  font-weight: 850;
  text-align: center;
  padding: 10px;
}

.v5-live-shell .photo-card b {
  color: #09284f;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

.v5-live-shell .photo-card small {
  color: #5f7190;
  font-size: .72rem;
  font-weight: 800;
}

.v5-live-shell .photo-card button {
  min-height: 34px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff7f7;
  color: #b42318;
  font-weight: 900;
}

.v5-live-shell .photo-empty {
  border: 1px dashed #cfe0f2;
  border-radius: 13px;
  color: #5b6d8a;
  font-weight: 850;
  padding: 20px;
  text-align: center;
}

.v5-live-shell .pdf-workflow-panel {
  margin-top: 10px;
}

.v5-live-shell .pdf-manual-note {
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
  padding: 10px 12px;
}

.v5-live-shell .pdf-manual-note b {
  display: block;
  color: #9a3412;
  font-size: .84rem;
}

.v5-live-shell .pdf-manual-note p {
  margin: 4px 0 0;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.45;
}

.v5-live-shell .pdf-local-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.v5-live-shell .pdf-local-checklist div {
  border: 1px solid #d8e8f5;
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
}

.v5-live-shell .pdf-local-checklist b {
  display: block;
  color: #09284f;
  font-size: .82rem;
}

.v5-live-shell .pdf-local-checklist small {
  display: block;
  margin-top: 3px;
  color: #5f7190;
  font-size: .72rem;
  font-weight: 850;
}

.v5-live-shell .pdf-local-checklist .ready b {
  color: #166534;
}

.v5-live-shell .pdf-local-checklist .attention b {
  color: #9a3412;
}

.v5-live-shell .recovery-status-panel {
  margin-top: 10px;
}

.v5-live-shell .recovery-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.v5-live-shell .recovery-summary div {
  border: 1px solid #d8e8f5;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 9px 10px;
}

.v5-live-shell .recovery-summary small {
  display: block;
  color: #5f7190;
  font-size: .65rem;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v5-live-shell .recovery-summary b {
  display: block;
  margin-top: 3px;
  color: #09284f;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.v5-live-shell .med-group-entry {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #d8e8f5;
  border-radius: 15px;
  background: #fbfdff;
  padding: 10px;
}

.v5-live-shell .med-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.v5-live-shell .med-group-head b {
  color: #09284f;
  font-size: .9rem;
}

.v5-live-shell .med-group-head span {
  color: #61738a;
  font-size: .74rem;
  font-weight: 800;
  max-width: 520px;
}

.v5-live-shell .med-group-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(82px, .65fr) minmax(70px, .5fr) minmax(130px, 1fr);
  gap: 7px;
}

.v5-live-shell .med-group-grid label {
  display: grid;
  gap: 3px;
  border: 1px solid #dce8f4;
  border-radius: 11px;
  background: #fff;
  padding: 6px 8px;
}

.v5-live-shell .med-group-grid span {
  color: #5f7190;
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v5-live-shell .med-group-grid input,
.v5-live-shell .med-group-grid select {
  width: 100%;
  border: 0;
  background: transparent;
  color: #09284f;
  font-weight: 850;
  outline: none;
}

.v5-live-shell .med-group-total {
  justify-self: start;
  border: 1px solid #b9e8c5;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  padding: 6px 11px;
  font-size: .78rem;
  font-weight: 950;
}

.v5-live-shell .med-record-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.v5-live-shell .med-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  border: 1px solid #d8e8f5;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 10px;
  box-shadow: 0 5px 14px rgba(8, 70, 130, .06);
}

.v5-live-shell .med-record-label {
  color: #5f7190;
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.v5-live-shell .med-record-name {
  color: #09284f;
  font-size: .96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.v5-live-shell .med-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v5-live-shell .med-record-meta span {
  border: 1px solid #d8e8f5;
  border-radius: 999px;
  background: #f8fbff;
  color: #294866;
  padding: 4px 8px;
  font-size: .74rem;
  font-weight: 850;
}

.v5-live-shell .med-record-notes,
.v5-live-shell .med-record-total {
  color: #496782;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell .med-record-total {
  color: #166534;
}

.v5-live-shell .med-record-items {
  display: grid;
  gap: 5px;
}

.v5-live-shell .med-record-item {
  display: grid;
  gap: 3px;
  border: 1px solid #e2ebf5;
  border-radius: 10px;
  background: #fff;
  padding: 7px 8px;
}

.v5-live-shell .med-record-item b {
  color: #09284f;
  overflow-wrap: anywhere;
}

.v5-live-shell .med-record-item span {
  color: #496782;
  font-size: .75rem;
  font-weight: 850;
}

.v5-live-shell .med-record-empty {
  color: #5b6d8a;
  text-align: center;
  font-weight: 800;
  padding: 14px;
}

.v5-live-shell .vitals-draft-panel b {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.v5-live-shell .vitals-draft-panel span {
  color: #496782;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell .draft-vitals-grid {
  border: 1px dashed #9dccf1;
  border-radius: 16px;
  background: rgba(239, 247, 255, .45);
  padding: 8px;
}

.v5-live-shell .vitals-actions,
.v5-live-shell .case-time-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.v5-live-shell .secondary-action {
  min-height: 38px;
  border: 1px solid #cfe0f2;
  border-radius: 12px;
  background: #fff;
  color: #0a4f96;
  font-weight: 900;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(8, 70, 130, .06);
}

.v5-live-shell .secondary-action:active {
  transform: translateY(1px);
}

.v5-live-shell .vitals-notice {
  color: #496782;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell .vitals-notice.warning {
  color: #9a5a00;
}

.v5-live-shell .vitals-table .empty-row td {
  color: #5b6d8a;
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.v5-live-shell .overview-vitals-grid .overview-note {
  grid-column: span 5;
}

.v5-live-shell .overview-vitals-grid .muted-card b {
  color: #7a8ba4;
}

.v5-live-shell .ready-chip.saved {
  color: #19763a;
  background: #e8f8ed;
}

.v5-live-shell .ready-chip.dirty {
  color: #9a6300;
  background: #fff6df;
}

.v5-live-shell .confirm-btn.demo-confirmed {
  background: linear-gradient(135deg, #26a64d, #16843a);
}

.time-helper.v5-time-helper {
  position: fixed;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 6px;
  width: min(320px, calc(100vw - 16px));
  padding: 8px;
  border: 1px solid rgba(13, 95, 170, .18);
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 44px rgba(15, 45, 80, .20);
  backdrop-filter: blur(14px);
}

.time-helper.v5-time-helper.hidden {
  display: none;
}

.time-helper.v5-time-helper button {
  min-height: 38px;
  border: 1px solid #cfe0f2;
  border-radius: 10px;
  background: #f8fbff;
  color: #0a4f96;
  font-weight: 900;
}

.time-helper.v5-time-helper button[data-time-clear] {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.v5-live-shell .completed-panel {
  margin-top: 8px;
  border: 1px solid rgba(22, 163, 74, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(15, 45, 80, .08);
  overflow: hidden;
}

.v5-live-shell .completed-panel.hidden {
  display: none;
}

.v5-live-shell .completed-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 0;
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
  color: #166534;
  padding: 8px 12px;
  text-align: left;
}

.v5-live-shell .completed-toggle b {
  font-size: .86rem;
}

.v5-live-shell .completed-toggle span {
  color: #557064;
  font-size: .75rem;
  font-weight: 850;
}

.v5-live-shell .completed-list {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.v5-live-shell .completed-panel.open .completed-list {
  display: flex;
}

.v5-live-shell .completed-case {
  flex: 0 0 230px;
  border: 1px solid #b9e8c5;
  border-radius: 11px;
  background: #fff;
  color: #0f3b29;
  padding: 9px 10px;
  text-align: left;
}

.v5-live-shell .completed-case b,
.v5-live-shell .completed-case small {
  display: block;
}

.v5-live-shell .completed-case small {
  margin-top: 3px;
  color: #5f746b;
  font-size: .72rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .v5-live-shell .medication-grid,
  .v5-live-shell .med-group-grid,
  .v5-live-shell .recovery-grid,
  .v5-live-shell .recovery-summary,
  .v5-live-shell .pdf-grid,
  .v5-live-shell .pdf-local-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* V5 live control refinement: flatter modules, clearer button hierarchy. */
body:has(.v5-live-shell) {
  background:
    linear-gradient(180deg, rgba(245, 250, 255, .96), rgba(247, 250, 252, .98)),
    #f6f9fc;
}

.v5-live-shell {
  --v5-radius-panel: 10px;
  --v5-radius-control: 7px;
  --v5-line-soft: #dce7f2;
  --v5-line-blue: #bad5f2;
  --v5-surface: rgba(255, 255, 255, .94);
  --v5-shadow-flat: 0 4px 12px rgba(20, 58, 101, .045);
}

.v5-live-shell.left-rail,
.v5-live-shell .left-rail,
.v5-live-shell .topbar,
.v5-live-shell .case-strip,
.v5-live-shell .work-panel,
.v5-live-shell .summary-card,
.v5-live-shell .trends-card,
.v5-live-shell .timeline-card,
.v5-live-shell .readiness-card,
.v5-live-shell .bottom-warning {
  border-color: var(--v5-line-soft);
  border-radius: var(--v5-radius-panel);
  box-shadow: var(--v5-shadow-flat);
  background: var(--v5-surface);
}

.v5-live-shell .record-app {
  grid-template-rows: minmax(78px, auto) 62px minmax(0, 1fr) 32px;
  gap: 7px;
}

.v5-live-shell .topbar {
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content) 148px;
  padding: 7px 10px;
  gap: 9px;
  align-items: center;
  min-height: 78px;
}

.v5-live-shell .title-lockup {
  min-width: 0;
  gap: 10px;
}

.v5-live-shell .title-lockup img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.v5-live-shell .eyebrow {
  font-size: .68rem;
  letter-spacing: .08em;
}

.v5-live-shell .title-lockup h1 {
  font-size: 1.22rem;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v5-live-shell .title-lockup p {
  margin-top: 3px;
  font-size: .82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v5-live-shell .top-status {
  min-width: 0;
  justify-self: end;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.v5-live-shell .status-card,
.v5-live-shell .pdf-chip,
.v5-live-shell .primary-action,
.v5-live-shell .confirm-btn,
.v5-live-shell .ready-chip,
.v5-live-shell .table-more,
.v5-live-shell .secondary-action {
  min-height: 34px;
  border-radius: var(--v5-radius-control);
  box-shadow: none;
}

.v5-live-shell .status-card {
  min-width: 88px;
  grid-template-columns: 12px 1fr;
  gap: 0 7px;
  padding: 5px 8px;
  background: #fff;
  border-color: var(--v5-line-soft);
  font-size: .78rem;
}

.v5-live-shell .status-card span {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

.v5-live-shell .status-card small {
  font-size: .66rem;
  color: #657790;
}

.v5-live-shell .status-card[aria-pressed="true"] {
  background: #f7fbff;
  box-shadow: inset 0 0 0 1px rgba(9, 103, 210, .12);
}

.v5-live-shell .pdf-chip {
  min-width: auto;
  padding: 0 10px;
  background: #fff;
  color: #254768;
  border-color: var(--v5-line-soft);
  font-size: .82rem;
}

.v5-live-shell #pdfSectionBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v5-live-shell #pdfSectionBtn::before {
  content: "";
  width: 11px;
  height: 14px;
  border: 1.7px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 4px 0 rgba(11, 115, 223, .08);
}

.v5-live-shell #closeCaseBtn {
  color: #6b7b8e;
  background: #f9fbfd;
  border-color: #e1e8f0;
  font-weight: 800;
}

.v5-live-shell .primary-action,
.v5-live-shell .confirm-btn {
  border-color: #0b73df;
  background: linear-gradient(180deg, #167ee9, #0967d2);
  color: #fff;
  font-weight: 900;
}

.v5-live-shell .primary-action {
  min-width: 146px;
  padding: 0 12px;
}

.v5-live-shell .time-block {
  justify-self: end;
  min-width: 112px;
  min-height: 48px;
  padding: 5px 8px;
  border-radius: 10px;
  line-height: 1;
}

.v5-live-shell .time-block .live-clock-date {
  display: block;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 900;
  white-space: nowrap;
}

.v5-live-shell .time-block .live-clock-time {
  display: block;
  font-size: 1.52rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.v5-live-shell .secondary-action {
  border-color: var(--v5-line-soft);
  background: #f9fbfd;
  color: #375a7a;
  font-weight: 850;
  padding: 7px 11px;
}

.v5-live-shell .danger-action,
.v5-live-shell .photo-card button {
  border-color: #f2c8c8;
  background: #fffafa;
  color: #a83b3b;
}

.v5-live-shell .left-rail {
  padding: 10px 8px;
  gap: 8px;
}

.v5-live-shell .rail-brand img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.v5-live-shell .rail-nav {
  gap: 6px;
}

.v5-live-shell .rail-nav button {
  min-height: 58px;
  gap: 3px;
  border-radius: 9px;
  color: #315676;
  font-size: .68rem;
}

.v5-live-shell .rail-nav button span {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f0f6fc;
}

.v5-live-shell .rail-nav button.active {
  background: #0b73df;
  box-shadow: 0 5px 14px rgba(9, 103, 210, .16);
}

.v5-live-shell .rail-nav button.active span {
  color: #0b63ce;
  background: #fff;
}

.v5-live-shell .case-tab,
.v5-live-shell .new-case-card {
  border-radius: 8px;
  box-shadow: none;
}

.v5-live-shell .case-tab.active {
  box-shadow: inset 4px 0 0 #0967d2, 0 5px 12px rgba(9, 103, 210, .1);
}

.v5-live-shell .panel-head {
  min-height: 48px;
  padding: 7px 11px;
  border-bottom-color: var(--v5-line-soft);
}

.v5-live-shell .ready-chip {
  padding: 0 11px;
  font-size: .76rem;
  background: #f7fafc;
}

.v5-live-shell .vitals-draft-panel,
.v5-live-shell .medication-draft-panel,
.v5-live-shell .recovery-draft-panel,
.v5-live-shell .photo-draft-panel,
.v5-live-shell .pdf-draft-panel {
  border-color: var(--v5-line-blue);
  border-radius: 8px;
  background: #f8fbff;
  padding: 7px 9px;
}

.v5-live-shell .draft-vitals-grid,
.v5-live-shell .medication-grid,
.v5-live-shell .recovery-grid,
.v5-live-shell .pdf-grid {
  border-color: #d8e5f2;
  border-style: solid;
  border-radius: 9px;
  background: #fbfdff;
}

.v5-live-shell .vitals-actions {
  margin-top: 0;
  padding: 8px;
  border: 1px solid #d8e5f2;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: #fbfdff;
}

.v5-live-shell .draft-vitals-grid {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.v5-live-shell .vital-card,
.v5-live-shell .form-grid label,
.v5-live-shell .med-group-grid label,
.v5-live-shell .photo-card,
.v5-live-shell .med-record-card,
.v5-live-shell .recovery-summary div,
.v5-live-shell .pdf-local-checklist div,
.v5-live-shell .ready-grid div,
.v5-live-shell .med-timeline article,
.v5-live-shell .confirmed-panel {
  border-color: #dfe8f1;
  border-radius: 8px;
  box-shadow: none;
  background: #fff;
}

.v5-live-shell .vital-card input,
.v5-live-shell .vital-card select,
.v5-live-shell .form-grid input,
.v5-live-shell .form-grid textarea,
.v5-live-shell .form-grid select {
  border-radius: 7px;
  border-color: #d9e4ee;
  box-shadow: none;
}

.v5-live-shell .summary-card,
.v5-live-shell .trends-card,
.v5-live-shell .timeline-card,
.v5-live-shell .readiness-card {
  padding: 8px 10px;
  border-radius: 9px;
}

.v5-live-shell .workspace,
.v5-live-shell .right-stack,
.v5-live-shell .summary-card,
.v5-live-shell .trends-card,
.v5-live-shell .timeline-card,
.v5-live-shell .readiness-card {
  min-height: 0;
}

.v5-live-shell .right-stack {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.v5-live-shell .trends-card,
.v5-live-shell .timeline-card,
.v5-live-shell .readiness-card {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
}

.v5-live-shell .med-timeline {
  min-height: 0;
  max-height: min(32vh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.v5-live-shell .overview-vitals-grid div,
.v5-live-shell .mini-chart,
.v5-live-shell .pdf-manual-note,
.v5-live-shell .completed-panel,
.v5-live-shell .completed-case {
  border-radius: 8px;
  box-shadow: none;
}

.time-helper.v5-time-helper {
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(15, 45, 80, .15);
}

.time-helper.v5-time-helper button {
  border-radius: 7px;
}

.v5-live-shell[data-section="cases"] .case-tabs {
  display: flex;
}

.v5-live-shell[data-section="cases"] .selected-case-strip {
  display: none;
}

.v5-live-shell:not([data-section="cases"]) .case-tabs {
  display: none;
}

.v5-live-shell:not([data-section="cases"]) .selected-case-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex-wrap: nowrap;
}

.v5-live-shell:not([data-section="cases"]) .selected-case-strip > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.v5-live-shell .selected-case-strip small {
  color: #5f7190;
  font-size: .64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.v5-live-shell .selected-case-strip b {
  color: #09284f;
  font-size: .92rem;
  min-width: 0;
    white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v5-live-shell .selected-case-strip b span {
  color: #496782;
  font-weight: 850;
}

.v5-live-shell .selected-task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.v5-live-shell .selected-task-list i {
  border: 1px solid #d8e5f2;
  border-radius: 999px;
  background: #fff;
  color: #315676;
  padding: 4px 8px;
  font-size: .7rem;
  font-style: normal;
  font-weight: 850;
}

.v5-live-shell .selected-status {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid #d8e5f2;
  border-radius: 999px;
  background: #fff;
  color: #315676;
  padding: 5px 9px;
  font-size: .72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.v5-live-shell .selected-status.status-saved {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.v5-live-shell .selected-status.status-review {
  color: #92400e;
  background: #fff7ed;
  border-color: #fed7aa;
}

.v5-live-shell .selected-status.status-problem {
  color: #991b1b;
  background: #fff1f2;
  border-color: #fecdd3;
}

@media (max-width: 1500px) {
  .v5-live-shell .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) 138px;
  }

  .v5-live-shell .status-card {
    min-width: 82px;
  }

  .v5-live-shell .title-lockup h1 {
    font-size: 1.16rem;
  }

  .v5-live-shell .primary-action {
    min-width: 136px;
  }
}

@media (max-width: 1360px) {
  .v5-live-shell .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) 126px;
  }

  .v5-live-shell .title-lockup h1 {
    font-size: 1.08rem;
  }

  .v5-live-shell .status-card {
    min-width: 78px;
    padding-inline: 7px;
  }

  .v5-live-shell .status-card small {
    display: none;
  }

  .v5-live-shell .pdf-chip {
    padding-inline: 9px;
  }

  .v5-live-shell .primary-action {
    min-width: 128px;
  }
}

@media (max-width: 1220px) {
  .v5-live-shell .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) 116px;
  }

  .v5-live-shell .title-lockup p {
    max-width: 100%;
  }

  .v5-live-shell .top-status {
    gap: 4px;
  }

  .v5-live-shell .status-card {
    min-width: 70px;
    padding-inline: 6px;
  }

  .v5-live-shell .pdf-chip {
    padding-inline: 8px;
  }

  .v5-live-shell .primary-action {
    min-width: 120px;
    padding-inline: 10px;
  }
}

.v5-live-shell .readiness-card,
.v5-live-shell[data-section="pdf"] .readiness-card {
  display: none;
}

.v5-live-shell:not([data-section="cases"]) .right-stack {
  grid-template-rows: none;
}

.v5-live-shell .floating-ai-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(9, 103, 210, .22);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #eef7ff);
  color: #0756b7;
  box-shadow: 0 8px 22px rgba(9, 103, 210, .16);
}

.v5-live-shell .floating-ai-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #0b73df;
  color: #fff;
  font-size: .72rem;
  font-weight: 950;
}

.v5-live-shell .floating-ai-button:active {
  transform: translateY(1px);
}

.v5-live-shell .task-chip-field {
  border-radius: 8px;
  box-shadow: none;
}

.v5-live-shell .task-chip-grid label {
  display: inline-flex;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
}

.v5-live-shell[data-section="cases"] .record-app {
  grid-template-rows: 64px minmax(0, 1fr) 30px;
}

.v5-live-shell[data-section="cases"] .case-strip {
  display: none;
}

.v5-live-shell[data-section="cases"] .completed-panel {
  display: none;
}

.v5-live-shell[data-section="cases"] .workspace {
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 14px 8px;
}

.v5-live-shell[data-section="cases"] .right-stack {
  display: none;
}

.v5-live-shell[data-section="cases"] .work-panel {
  background: linear-gradient(180deg, #f7fbff 0%, #f1f6fb 100%);
  border-color: #d7e5f3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.v5-live-shell[data-section="cases"] .panel-head {
  min-height: 42px;
  padding: 8px 14px;
  background: transparent;
}

.v5-live-shell[data-section="cases"] .panel-head h2 {
  font-size: 1.24rem;
}

.v5-live-shell[data-section="cases"] .section-view[data-view="cases"] {
  padding: 0 14px 14px;
}

.v5-live-shell .cases-command {
  display: grid;
  gap: 12px;
}

.v5-live-shell .cases-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.v5-live-shell .cases-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: rgba(255,255,255,.86);
  padding: 10px 12px;
}

.v5-live-shell .cases-metric > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #eaf3ff;
  color: #0b73df;
  font-weight: 950;
}

.v5-live-shell .cases-metric.metric-review > span {
  background: #fff4dd;
  color: #b45309;
}

.v5-live-shell .cases-metric.metric-saved > span,
.v5-live-shell .cases-metric.metric-completed > span {
  background: #e7f8ee;
  color: #16803a;
}

.v5-live-shell .cases-metric b {
  display: block;
  color: #071f46;
  font-size: 1.25rem;
  line-height: 1;
}

.v5-live-shell .cases-metric small {
  color: #425b7a;
  font-size: .76rem;
  font-weight: 850;
}

.v5-live-shell .cases-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v5-live-shell .cases-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.v5-live-shell .case-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid #d8e4f2;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  color: #233f60;
  padding: 0 11px;
  font-size: .77rem;
  font-weight: 850;
}

.v5-live-shell .case-filter b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #edf4ff;
  color: #0756b7;
  font-size: .72rem;
}

.v5-live-shell .compact-new-case {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
}

.v5-live-shell .cases-list {
  display: grid;
  gap: 8px;
}

.v5-live-shell .case-command-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(260px, 1.35fr) minmax(250px, .75fr) 150px 130px;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  border: 1px solid #d9e5f2;
  border-left: 4px solid #94a3b8;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  padding: 10px 12px;
  box-shadow: 0 8px 18px rgba(43, 80, 118, .06);
}

.v5-live-shell .case-command-card.selected {
  border-color: #91c5ff;
  border-left-color: #0967d2;
  box-shadow: 0 10px 24px rgba(9, 103, 210, .1);
}

.v5-live-shell .case-command-card.status-active-case {
  border-left-color: #0967d2;
}

.v5-live-shell .case-command-card.status-review {
  border-left-color: #f59e0b;
}

.v5-live-shell .case-command-card.status-saved {
  border-left-color: #16a34a;
}

.v5-live-shell .case-command-card.status-problem {
  border-left-color: #ef4444;
}

.v5-live-shell .case-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.9), transparent 32%),
    linear-gradient(145deg, #cfe6ff, #6ca9ee);
  color: #073f89;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.v5-live-shell .case-avatar span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  font-size: .9rem;
}

.v5-live-shell .case-card-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.v5-live-shell .case-card-title {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.v5-live-shell .case-card-title h3 {
  margin: 0;
  color: #071f46;
  font-size: 1rem;
  line-height: 1.1;
}

.v5-live-shell .case-card-title p,
.v5-live-shell .case-card-title small {
  display: block;
  margin: 4px 0 0;
  color: #344d70;
  font-weight: 800;
}

.v5-live-shell .case-card-title small {
  color: #61728a;
  font-size: .74rem;
}

.v5-live-shell .case-task-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.v5-live-shell .case-task-chips span {
  border: 1px solid #d2e5ff;
  border-radius: 7px;
  background: #eaf4ff;
  color: #0756b7;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 900;
}

.v5-live-shell .case-phase-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  align-items: start;
  gap: 0;
}

.v5-live-shell .case-phase-track span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #4f6380;
  font-size: .66rem;
  font-weight: 900;
}

.v5-live-shell .case-phase-track span::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #cbd9e9;
}

.v5-live-shell .case-phase-track span:first-child::before {
  display: none;
}

.v5-live-shell .case-phase-track i {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 2px solid #adc1d8;
  border-radius: 999px;
  background: #fff;
}

.v5-live-shell .case-phase-track .done::before,
.v5-live-shell .case-phase-track .current::before {
  background: #0b73df;
}

.v5-live-shell .case-phase-track .done i,
.v5-live-shell .case-phase-track .current i {
  border-color: #0b73df;
  background: #0b73df;
}

.v5-live-shell .case-phase-track .done i::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.v5-live-shell .case-latest-vitals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  min-width: 0;
  border-left: 1px solid #dce8f4;
  padding-left: 16px;
}

.v5-live-shell .case-latest-vitals small {
  grid-column: 1 / -1;
  color: #49617e;
  font-size: .7rem;
  font-weight: 900;
}

.v5-live-shell .case-latest-vitals span {
  display: grid;
  gap: 2px;
}

.v5-live-shell .case-latest-vitals b {
  color: #49617e;
  font-size: .66rem;
  text-transform: uppercase;
}

.v5-live-shell .case-latest-vitals em {
  color: #071f46;
  font-size: .95rem;
  font-style: normal;
  font-weight: 950;
}

.v5-live-shell .case-latest-vitals.empty em {
  color: #7a8798;
}

.v5-live-shell .case-status-panel {
  display: grid;
  gap: 7px;
}

.v5-live-shell .case-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid #d8e4f2;
  border-radius: 8px;
  background: #f7fafc;
  color: #344d70;
  padding: 0 10px;
  font-size: .75rem;
  font-style: normal;
  font-weight: 950;
}

.v5-live-shell .case-status-badge.status-active-case {
  background: #eaf4ff;
  border-color: #b9d8ff;
  color: #0756b7;
}

.v5-live-shell .case-status-badge.status-review {
  background: #fff6df;
  border-color: #f8d694;
  color: #92400e;
}

.v5-live-shell .case-status-badge.status-saved {
  background: #eaf8ef;
  border-color: #bfe8ca;
  color: #166534;
}

.v5-live-shell .case-status-badge.status-problem {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #991b1b;
}

.v5-live-shell .case-status-panel small {
  color: #61728a;
  font-size: .72rem;
  font-weight: 850;
}

.v5-live-shell .case-card-actions {
  display: grid;
  gap: 6px;
}

.v5-live-shell .case-card-actions button {
  min-height: 31px;
  border: 1px solid #cfe0f3;
  border-radius: 7px;
  background: #fff;
  color: #0756b7;
  font-weight: 950;
  cursor: pointer;
}

.v5-live-shell .case-card-actions .case-open-action {
  background: #0b73df;
  border-color: #0b73df;
  color: #fff;
}

.v5-live-shell .cases-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed #bdd3ec;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  padding: 28px;
  color: #49617e;
  text-align: center;
  font-weight: 850;
}

.v5-live-shell .cases-completed-block {
  border: 1px solid #d8e4f2;
  border-radius: 10px;
  background: rgba(255,255,255,.84);
  overflow: hidden;
}

.v5-live-shell .cases-completed-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #071f46;
  padding: 0 13px;
  font-weight: 950;
  cursor: pointer;
}

.v5-live-shell .cases-completed-toggle b {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0756b7;
}

.v5-live-shell .cases-completed-list {
  display: none;
  padding: 0 12px 12px;
}

.v5-live-shell .cases-completed-block.open .cases-completed-list {
  display: grid;
  gap: 6px;
}

.v5-live-shell .cases-completed-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 90px 120px 92px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-top: 1px solid #edf3f9;
  color: #344d70;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell .cases-completed-row b {
  display: block;
  color: #071f46;
}

.v5-live-shell .cases-completed-row em {
  justify-self: start;
  border-radius: 6px;
  background: #eaf8ef;
  color: #166534;
  padding: 5px 9px;
  font-style: normal;
  font-weight: 950;
}

.v5-live-shell .cases-completed-row button {
  min-height: 30px;
  border: 1px solid #cfe0f3;
  border-radius: 7px;
  background: #fff;
  color: #0756b7;
  font-weight: 950;
  cursor: pointer;
}

.v5-live-shell .cases-completed-empty {
  padding: 11px 0;
  color: #61728a;
  font-weight: 850;
}

.v5-live-shell[data-section="patient"] .work-panel {
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  border-color: #d8e5f2;
}

.v5-live-shell[data-section="patient"] .panel-head {
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
}

.v5-live-shell[data-section="patient"] .panel-head h2 {
  font-size: 1.22rem;
}

.v5-live-shell[data-section="patient"] .section-view[data-view="patient"] {
  padding: 0 14px 14px;
  min-width: 0;
}

.v5-live-shell .patient-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1.08fr) minmax(154px, .42fr);
  grid-template-areas:
    "identity procedures team"
    "timing timing notes"
    "hints hints hints";
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.v5-live-shell .patient-module {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9e5f2;
  border-radius: 10px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 7px 18px rgba(43,80,118,.055);
  padding: 13px;
}

.v5-live-shell .patient-identity-card {
  grid-area: identity;
}

.v5-live-shell .patient-procedures-card {
  grid-area: procedures;
}

.v5-live-shell .patient-team-card {
  grid-area: team;
  padding: 10px;
}

.v5-live-shell .patient-timing-card {
  grid-area: timing;
}

.v5-live-shell .patient-notes-card {
  grid-area: notes;
}

.v5-live-shell .patient-completion-card {
  grid-area: hints;
}

.v5-live-shell .module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.v5-live-shell .module-head h3 {
  margin: 0;
  color: #071f46;
  font-size: .96rem;
  line-height: 1.1;
}

.v5-live-shell .module-head p {
  margin: 5px 0 0;
  color: #49617e;
  font-size: .76rem;
  font-weight: 800;
}

.v5-live-shell .patient-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #bfe8ca;
  border-radius: 999px;
  background: #eaf8ef;
  color: #166534;
  padding: 0 9px;
  font-size: .68rem;
  font-weight: 950;
  white-space: nowrap;
}

.v5-live-shell .patient-state-chip.status-active-case {
  border-color: #b9d8ff;
  background: #eaf4ff;
  color: #0756b7;
}

.v5-live-shell .patient-state-chip.status-review {
  border-color: #f8d694;
  background: #fff6df;
  color: #92400e;
}

.v5-live-shell .patient-state-chip.status-problem {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #991b1b;
}

.v5-live-shell .patient-state-chip.status-draft {
  border-color: #d8e4f2;
  background: #f7fafc;
  color: #425b7a;
}

.v5-live-shell .patient-identity-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.v5-live-shell .patient-identity-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.v5-live-shell .patient-photo-placeholder {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 84px;
  border: 1px dashed #bfd4ee;
  border-radius: 10px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255,255,255,.92), transparent 30%),
    linear-gradient(145deg, #dcecff, #edf6ff);
  color: #315676;
  padding: 7px 5px;
  text-align: center;
}

.v5-live-shell .patient-photo-placeholder span,
.v5-live-shell .patient-photo-placeholder small {
  color: #5d7290;
  font-size: .58rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.v5-live-shell .patient-photo-placeholder b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #0756b7;
  font-size: .9rem;
  box-shadow: inset 0 0 0 1px rgba(9,103,210,.12);
}

.v5-live-shell .patient-photo-placeholder small {
  max-width: 64px;
  line-height: 1.12;
  text-transform: none;
  letter-spacing: 0;
}

.v5-live-shell .patient-primary-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.v5-live-shell .patient-identity-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.v5-live-shell .patient-identity-grid label:has(#recordDate) {
  grid-column: 1 / -1;
}

.v5-live-shell .patient-team-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.v5-live-shell .patient-primary-grid label,
.v5-live-shell .patient-identity-grid label,
.v5-live-shell .patient-team-grid label,
.v5-live-shell .procedure-primary-field,
.v5-live-shell .patient-time-grid label,
.v5-live-shell .patient-notes-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  max-width: 100%;
  box-sizing: border-box;
}

.v5-live-shell .patient-team-grid label {
  padding: 7px;
}

.v5-live-shell .patient-primary-grid span,
.v5-live-shell .patient-identity-grid span,
.v5-live-shell .patient-team-grid span,
.v5-live-shell .procedure-primary-field span,
.v5-live-shell .patient-time-grid span,
.v5-live-shell .patient-notes-field span {
  color: #46617f;
  font-size: .68rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.v5-live-shell .patient-primary-grid input,
.v5-live-shell .patient-identity-grid input,
.v5-live-shell .patient-team-grid input,
.v5-live-shell .procedure-primary-field input,
.v5-live-shell .patient-time-grid input,
.v5-live-shell .patient-notes-field textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d9e4ee;
  border-radius: 7px;
  background: #fbfdff;
  color: #071f46;
  padding: 0 9px;
  font: inherit;
  font-size: .92rem;
  font-weight: 850;
  max-width: 100%;
  box-sizing: border-box;
  text-overflow: clip;
}

.v5-live-shell .patient-team-grid input {
  min-height: 32px;
  font-size: .84rem;
  padding: 0 7px;
}

.v5-live-shell .patient-notes-field textarea {
  min-height: 112px;
  padding: 10px;
  resize: vertical;
}

.v5-live-shell .patient-procedures-card .task-chip-field {
  margin-top: 10px;
  border-style: dashed;
  background: #f8fbff;
}

.v5-live-shell .patient-procedures-card .task-chip-grid {
  gap: 7px;
}

.v5-live-shell .patient-procedures-card .task-chip-grid label {
  min-width: 0;
  min-height: 34px;
  border-radius: 8px;
  background: #fff;
}

.v5-live-shell .patient-procedures-card .task-chip-grid input:checked + span {
  color: #0756b7;
}

.v5-live-shell .patient-procedures-card .task-chip-grid label:has(input:checked) {
  border-color: #9cc8ff;
  background: #eaf4ff;
  box-shadow: inset 0 0 0 1px rgba(9,103,210,.12);
}

.v5-live-shell .patient-procedure-summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-top: 10px;
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  background: #f8fbff;
  color: #0b3f82;
  padding: 0 11px;
  font-size: .8rem;
  font-weight: 900;
  line-height: 1.2;
}

.v5-live-shell .patient-time-grid {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(112px, .72fr) minmax(118px, 1fr) minmax(112px, .72fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.v5-live-shell .patient-time-grid button {
  min-height: 58px;
  align-self: stretch;
  border-radius: 8px;
}

.v5-live-shell .patient-hints {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.v5-live-shell .patient-hints span {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid #d8e4f2;
  border-radius: 8px;
  background: #fbfdff;
  color: #5f7190;
  padding: 0 12px 0 36px;
  font-size: .78rem;
  font-weight: 900;
}

.v5-live-shell .patient-hints span::before {
  content: "";
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  border: 2px solid #adc1d8;
  border-radius: 999px;
  background: #fff;
}

.v5-live-shell .patient-hints span.complete {
  color: #166534;
  background: #f0fbf4;
  border-color: #bfe8ca;
}

.v5-live-shell .patient-hints span.complete::before {
  border-color: #16a34a;
  background: #16a34a;
  box-shadow: inset 0 0 0 3px #fff;
}

.v5-live-shell[data-section="vitals"] .work-panel {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%);
  border-color: #d8e5f2;
}

.v5-live-shell[data-section="vitals"] .panel-head {
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
}

.v5-live-shell[data-section="vitals"] .panel-head h2 {
  font-size: 1.22rem;
}

.v5-live-shell[data-section="vitals"] .section-view[data-view="vitals"] {
  display: none;
  padding: 0 14px 14px;
}

.v5-live-shell[data-section="vitals"] .section-view[data-view="vitals"].active {
  display: grid;
  gap: 10px;
}

.v5-live-shell[data-section="vitals"] .vitals-draft-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border: 1px solid #bfd7f2;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #edf6ff, #f8fbff);
  color: #174a7a;
  padding: 9px 11px;
}

.v5-live-shell[data-section="vitals"] .vitals-draft-panel b {
  color: #071f46;
  font-size: .86rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="vitals"] .vitals-draft-panel span {
  color: #49617e;
  font-size: .78rem;
  font-weight: 850;
  text-align: right;
}

.v5-live-shell[data-section="vitals"] .draft-vitals-grid {
  display: grid;
  grid-template-columns: 1.15fr repeat(5, minmax(86px, 1fr));
  gap: 0;
  border: 1px solid #bfd7f2;
  border-top: 0;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.v5-live-shell[data-section="vitals"] .vital-card {
  position: relative;
  min-height: 92px;
  border: 0;
  border-right: 1px solid #e0e9f3;
  border-bottom: 1px solid #e0e9f3;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(251,253,255,.94)),
    radial-gradient(circle at 92% 16%, rgba(9,103,210,.08), transparent 34%);
  padding: 10px;
  box-shadow: none;
  overflow: hidden;
}

.v5-live-shell[data-section="vitals"] .vital-card::before {
  content: "";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-bottom: 5px;
  border: 1px solid #cfe0f3;
  border-radius: 7px;
  background: #eef6ff;
  color: #0756b7;
  font-size: .58rem;
  font-weight: 950;
}

.v5-live-shell[data-section="vitals"] .vital-card::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 13px;
  width: 42px;
  height: 18px;
  opacity: .54;
  background:
    linear-gradient(135deg, transparent 0 17%, #82b6ec 18% 22%, transparent 23% 38%, #82b6ec 39% 43%, transparent 44% 60%, #82b6ec 61% 65%, transparent 66% 100%);
  pointer-events: none;
}

.v5-live-shell[data-section="vitals"] .vital-card:nth-child(1)::before { content: "T"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(2)::before { content: "HR"; color: #c82039; background: #fff0f3; border-color: #ffd1d9; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(3)::before { content: "RR"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(4)::before { content: "O2"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(5)::before { content: "CO2"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(6)::before { content: "C"; color: #b42318; background: #fff4f2; border-color: #ffd8d2; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(7)::before,
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(8)::before,
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(9)::before { content: "BP"; color: #0f766e; background: #eefdf9; border-color: #bdeee4; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(10)::before { content: "ISO"; color: #6d4fc2; background: #f5f2ff; border-color: #ded6ff; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(11)::before { content: "O2"; color: #15803d; background: #effaf2; border-color: #c3eccd; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(12)::before { content: "ML"; color: #0284c7; background: #eef9ff; border-color: #bae6fd; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(13)::before { content: "MM"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(14)::before { content: "CRT"; }
.v5-live-shell[data-section="vitals"] .vital-card:nth-child(15)::before { content: "N"; }

.v5-live-shell[data-section="vitals"] .notes-card::after {
  display: none;
}

.v5-live-shell[data-section="vitals"] .vital-card:nth-child(6n) {
  border-right: 0;
}

.v5-live-shell[data-section="vitals"] .vital-card span {
  position: relative;
  z-index: 1;
  color: #315676;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="vitals"] .vital-card input,
.v5-live-shell[data-section="vitals"] .vital-card select {
  position: relative;
  z-index: 1;
  min-height: 40px;
  border: 1px solid #d9e4ee;
  border-radius: 7px;
  background: #fbfdff;
  color: #071f46;
  font-size: 1.08rem;
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.v5-live-shell[data-section="vitals"] .vital-card small {
  position: relative;
  z-index: 1;
  color: #536d8d;
  font-size: .68rem;
  font-weight: 850;
  text-align: right;
}

.v5-live-shell[data-section="vitals"] .time-card input {
  color: #0756b7;
  font-size: 1.2rem;
}

.v5-live-shell[data-section="vitals"] .notes-card {
  grid-column: span 3;
}

.v5-live-shell[data-section="vitals"] .notes-card input {
  text-align: left;
  font-size: .9rem;
  font-weight: 800;
}

.v5-live-shell[data-section="vitals"] .vitals-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  border: 1px solid #bfd7f2;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #f8fbff;
  padding: 9px 10px;
}

.v5-live-shell[data-section="vitals"] .vitals-actions .confirm-btn {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 15px;
  box-shadow: 0 5px 12px rgba(9, 103, 210, .12);
}

.v5-live-shell[data-section="vitals"] .vitals-actions .secondary-action {
  min-height: 36px;
  border-radius: 7px;
  background: #fff;
}

.v5-live-shell[data-section="vitals"] .vitals-notice {
  margin-left: auto;
  color: #49617e;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell[data-section="vitals"] .confirmed-panel {
  margin-top: 2px;
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 7px 18px rgba(43,80,118,.055);
  padding: 10px;
}

.v5-live-shell[data-section="vitals"] .confirmed-panel .subhead {
  margin-bottom: 8px;
}

.v5-live-shell[data-section="vitals"] .confirmed-panel .subhead b {
  color: #071f46;
  font-size: .92rem;
}

.v5-live-shell[data-section="vitals"] .confirmed-panel .subhead span {
  color: #536d8d;
  font-size: .76rem;
  font-weight: 850;
}

.v5-live-shell[data-section="vitals"] .vitals-table-wrap {
  max-height: 324px;
  border: 1px solid #e0e9f3;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.v5-live-shell[data-section="vitals"] .vitals-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  min-width: 66px;
  border-bottom: 1px solid #d8e5f2;
  background: #f4f8fc;
  color: #315676;
  font-size: .67rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: bottom;
}

.v5-live-shell[data-section="vitals"] .vitals-table th span {
  display: block;
  margin-top: 2px;
  color: #6b7f99;
  font-size: .55rem;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: none;
}

.v5-live-shell[data-section="vitals"] .vitals-table td {
  border-bottom: 1px solid #edf3f9;
  color: #071f46;
  font-size: .78rem;
  font-weight: 850;
}

.v5-live-shell[data-section="vitals"] .vitals-table tbody tr:nth-child(odd) td {
  background: #fbfdff;
}

.v5-live-shell[data-section="vitals"] .vitals-table tbody tr:first-child td {
  background: #eef8f1;
}

.v5-live-shell[data-section="vitals"] .table-more {
  margin-top: 9px;
  border-radius: 7px;
}

@media (max-width: 1280px) {
  .v5-live-shell[data-section="vitals"] .draft-vitals-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vital-card:nth-child(6n) {
    border-right: 1px solid #e0e9f3;
  }

  .v5-live-shell[data-section="vitals"] .vital-card:nth-child(4n) {
    border-right: 0;
  }

  .v5-live-shell[data-section="vitals"] .notes-card {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .v5-live-shell[data-section="vitals"] .draft-vitals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vital-card:nth-child(4n),
  .v5-live-shell[data-section="vitals"] .vital-card:nth-child(6n) {
    border-right: 1px solid #e0e9f3;
  }

  .v5-live-shell[data-section="vitals"] .vital-card:nth-child(2n) {
    border-right: 0;
  }

  .v5-live-shell[data-section="vitals"] .notes-card {
    grid-column: 1 / -1;
  }

  .v5-live-shell[data-section="vitals"] .vitals-draft-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .v5-live-shell[data-section="vitals"] .vitals-draft-panel span {
    text-align: left;
  }

  .v5-live-shell[data-section="vitals"] .vitals-notice {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 1240px) {
  .v5-live-shell .patient-cockpit {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "identity procedures"
      "team team"
      "timing timing"
      "notes notes"
      "hints hints";
  }

  .v5-live-shell .patient-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .v5-live-shell .patient-cockpit,
  .v5-live-shell .patient-identity-layout,
  .v5-live-shell .patient-identity-top,
  .v5-live-shell .patient-primary-grid,
  .v5-live-shell .patient-identity-grid,
  .v5-live-shell .patient-team-grid,
  .v5-live-shell .patient-time-grid,
  .v5-live-shell .patient-hints {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .v5-live-shell .patient-module {
    grid-area: auto;
  }

  .v5-live-shell .patient-photo-placeholder {
    min-height: 82px;
  }

  .v5-live-shell .patient-notes-field textarea {
    min-height: 96px;
  }
}

/* Vitals v5 dashboard structure. Scoped here so the stable route and other v5-live tabs keep their behaviour. */
.v5-live-shell[data-section="vitals"] .vitals-dashboard {
  display: grid;
  gap: 12px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card {
  border: 1px solid #d8e5f2;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(43,80,118,.055);
  overflow: hidden;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e0e9f3;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 10px 12px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel {
  display: grid;
  gap: 3px;
  min-width: 190px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel b {
  color: #071f46;
  font-size: .94rem;
  letter-spacing: 0;
  text-transform: none;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel span {
  color: #536d8d;
  font-size: .76rem;
  font-weight: 800;
  text-align: left;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: min(100%, 560px);
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions .confirm-btn {
  order: 3;
  min-height: 36px;
  border-radius: 7px;
  padding: 0 15px;
  box-shadow: 0 5px 12px rgba(9,103,210,.14);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions .secondary-action {
  min-height: 34px;
  border-radius: 7px;
  background: #fff;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-notice {
  flex-basis: 100%;
  order: 4;
  margin-left: 0;
  color: #49617e;
  font-size: .75rem;
  font-weight: 850;
  text-align: right;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: visible;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 104px;
  border: 0;
  border-right: 1px solid #e0e9f3;
  border-bottom: 1px solid #e0e9f3;
  border-radius: 0;
  background:
    radial-gradient(circle at 92% 16%, rgba(9,103,210,.08), transparent 34%),
    linear-gradient(180deg, #fff, #fbfdff);
  padding: 11px;
  box-shadow: none;
  overflow: hidden;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::before {
  content: attr(data-metric);
  display: inline-grid;
  place-items: center;
  width: auto;
  min-width: 22px;
  height: 22px;
  justify-self: start;
  margin: 0;
  border: 1px solid #cfe0f3;
  border-radius: 7px;
  background: #eef6ff;
  color: #0756b7;
  padding: 0 5px;
  font-size: .58rem;
  font-weight: 950;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 15px;
  width: 42px;
  height: 18px;
  opacity: .5;
  background:
    linear-gradient(135deg, transparent 0 17%, #82b6ec 18% 22%, transparent 23% 38%, #82b6ec 39% 43%, transparent 44% 60%, #82b6ec 61% 65%, transparent 66% 100%);
  pointer-events: none;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-hr::before {
  color: #c82039;
  background: #fff0f3;
  border-color: #ffd1d9;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-temp::before {
  color: #b42318;
  background: #fff4f2;
  border-color: #ffd8d2;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-bp::before {
  color: #0f766e;
  background: #eefdf9;
  border-color: #bdeee4;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-iso::before {
  color: #6d4fc2;
  background: #f5f2ff;
  border-color: #ded6ff;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-o2::before {
  color: #15803d;
  background: #effaf2;
  border-color: #c3eccd;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid::before {
  color: #0284c7;
  background: #eef9ff;
  border-color: #bae6fd;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card span {
  color: #315676;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card input,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card select {
  min-height: 40px;
  border: 1px solid #d9e4ee;
  border-radius: 7px;
  background: #fbfdff;
  color: #071f46;
  font-size: 1.08rem;
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card small {
  color: #536d8d;
  font-size: .68rem;
  font-weight: 850;
  text-align: right;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .time-card input {
  color: #0756b7;
  font-size: 1.18rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
  grid-column: span 4;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card::after {
  display: none;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card input {
  text-align: left;
  font-size: .9rem;
  font-weight: 800;
}

.v5-live-shell[data-section="vitals"] .vitals-log-panel {
  margin: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.v5-live-shell[data-section="vitals"] .vitals-log-head .subhead {
  margin: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-log-head .table-more {
  margin: 0;
}

@media (max-width: 1280px) {
  .v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .v5-live-shell[data-section="vitals"] .vitals-entry-head {
    align-items: stretch;
    flex-direction: column;
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-notice {
    text-align: left;
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .v5-live-shell .case-command-card {
    grid-template-columns: 66px minmax(220px, 1fr) minmax(190px, .8fr) 128px;
  }

  .v5-live-shell .case-card-actions {
    grid-column: 2 / -1;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 900px) {
  .v5-live-shell .cases-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v5-live-shell .case-command-card,
  .v5-live-shell .cases-completed-row {
    grid-template-columns: 1fr;
  }

  .v5-live-shell .case-latest-vitals {
    border-left: 0;
    border-top: 1px solid #dce8f4;
    padding: 10px 0 0;
  }

  .v5-live-shell .case-task-chips {
    justify-content: flex-start;
  }
}

/* Stronger Vitals concept alignment: scoped to v5-live only. */
.v5-live-shell[data-section="vitals"] .section-view[data-view="vitals"] {
  display: block;
}

.v5-live-shell[data-section="vitals"] .vitals-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.v5-live-shell[data-section="vitals"] .vitals-section-title h2 {
  margin: 0;
  color: #071f46;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.v5-live-shell[data-section="vitals"] .vitals-section-title p {
  margin: 5px 0 0;
  color: #536d8d;
  font-size: .82rem;
  font-weight: 850;
}

.v5-live-shell[data-section="vitals"] .vitals-section-title span {
  border: 1px solid #d7e7fb;
  border-radius: 999px;
  background: #f6fbff;
  color: #0756b7;
  padding: 6px 10px;
  font-size: .72rem;
  font-weight: 950;
  white-space: nowrap;
}

.v5-live-shell[data-section="vitals"] .vitals-dashboard {
  gap: 10px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card {
  border-color: #d7e4f1;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(239, 247, 255, .7) 0 1px, transparent 1px) 0 0 / 16.66% 100%,
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 6px 18px rgba(25, 62, 102, .045);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head {
  min-height: 50px;
  border-bottom-color: #dce8f4;
  background: linear-gradient(180deg, #fff, #f9fcff);
  padding: 8px 10px 8px 12px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel b {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel b::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #0b73df;
  box-shadow: 0 0 0 4px rgba(11, 115, 223, .11);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions {
  min-width: min(100%, 650px);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions .confirm-btn {
  order: 4;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 14px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions .secondary-action {
  min-height: 34px;
  border-color: #d9e6f3;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: none;
}

.v5-live-shell[data-section="vitals"] #fluidCalcBtn {
  order: 1;
}

.v5-live-shell[data-section="vitals"] #vitalsTimeHelperBtn {
  order: 2;
}

.v5-live-shell[data-section="vitals"] #clearVitalsBtn {
  order: 3;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-notice {
  order: 5;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
  grid-template-columns: repeat(6, minmax(98px, 1fr));
  background:
    linear-gradient(#eef4fa 1px, transparent 1px) 0 0 / 100% 33.333%,
    linear-gradient(90deg, #eef4fa 1px, transparent 1px) 0 0 / 16.666% 100%,
    #fff;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card {
  min-height: 101px;
  gap: 5px;
  border-color: #e5edf5;
  background:
    radial-gradient(circle at 92% 17%, rgba(13, 116, 223, .09), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(250, 253, 255, .96));
  padding: 10px;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::before {
  width: 23px;
  min-width: 23px;
  height: 23px;
  border-radius: 8px;
  padding: 0;
  font-size: .52rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::after {
  right: 10px;
  top: 17px;
  width: 52px;
  height: 20px;
  opacity: .62;
  background:
    linear-gradient(180deg, transparent 45%, rgba(120, 168, 220, .22) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 12%, #7fb8f0 13% 16%, transparent 17% 32%, #7fb8f0 33% 36%, transparent 37% 53%, #7fb8f0 54% 57%, transparent 58% 74%, #7fb8f0 75% 78%, transparent 79% 100%);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-temp::after {
  background:
    linear-gradient(180deg, transparent 45%, rgba(255, 169, 135, .2) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 14%, #f97373 15% 18%, transparent 19% 38%, #f97373 39% 42%, transparent 43% 65%, #f97373 66% 69%, transparent 70% 100%);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-bp::after {
  background:
    linear-gradient(180deg, transparent 45%, rgba(45, 177, 151, .18) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 11%, #2db197 12% 15%, transparent 16% 34%, #2db197 35% 38%, transparent 39% 54%, #2db197 55% 58%, transparent 59% 100%);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid::after,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-o2::after {
  background:
    linear-gradient(180deg, transparent 45%, rgba(74, 191, 255, .2) 46% 54%, transparent 55%),
    linear-gradient(135deg, transparent 0 15%, #32aaf5 16% 19%, transparent 20% 36%, #32aaf5 37% 40%, transparent 41% 64%, #32aaf5 65% 68%, transparent 69% 100%);
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card span {
  color: #2c4d72;
  font-size: .66rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card input,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card select {
  min-height: 38px;
  border-color: #dce7f2;
  border-radius: 7px;
  background: rgba(255, 255, 255, .86);
  font-size: 1.12rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .time-card input {
  border-color: #b8d7fb;
  color: #0756b7;
  font-size: 1.24rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
  grid-column: span 4;
  min-height: 101px;
}

.v5-live-shell[data-section="vitals"] .vitals-log-panel {
  border-radius: 7px;
  padding: 9px 10px 10px;
}

.v5-live-shell[data-section="vitals"] .vitals-table th,
.v5-live-shell[data-section="vitals"] .vitals-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.v5-live-shell[data-section="vitals"] .vitals-table th:first-child,
.v5-live-shell[data-section="vitals"] .vitals-table td:first-child {
  width: 32px;
  min-width: 32px;
  padding-left: 8px;
  padding-right: 6px;
  text-align: center;
}

.v5-live-shell[data-section="vitals"] .vitals-row-check span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #bdeee4;
  border-radius: 999px;
  background: #effdf8;
  color: #0f766e;
  font-size: .72rem;
  font-weight: 950;
}

.v5-live-shell[data-section="vitals"] .vitals-table .latest-vitals-row td {
  background: #eef8f1;
}

.v5-live-shell[data-section="vitals"] .overview-vitals-grid div {
  border-radius: 7px;
  background:
    radial-gradient(circle at 90% 14%, rgba(9, 103, 210, .075), transparent 35%),
    linear-gradient(180deg, #fff, #fbfdff);
}

.v5-live-shell[data-section="vitals"] .mini-chart {
  border-radius: 7px;
  background:
    linear-gradient(#edf3f9 1px, transparent 1px) 0 35px / 100% 25px,
    linear-gradient(90deg, rgba(237, 243, 249, .74) 1px, transparent 1px) 0 0 / 56px 100%,
    linear-gradient(180deg, #fff, #fbfdff);
}

.v5-live-shell[data-section="vitals"] .mini-chart-axis {
  color: #617896;
  font-size: .56rem;
  font-weight: 850;
}

.v5-live-shell[data-section="vitals"] .mini-chart.purple polyline {
  stroke: #7c3aed;
}

.v5-live-shell[data-section="vitals"] .mini-chart.red polyline {
  stroke: #ef4444;
}

/* Shared clinical context panel for every non-Cases tab. Vitals remains the visual source of truth. */
.v5-live-shell:not([data-section="cases"]) .right-stack {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.v5-live-shell:not([data-section="cases"]) .summary-card,
.v5-live-shell:not([data-section="cases"]) .trends-card,
.v5-live-shell:not([data-section="cases"]) .timeline-card {
  min-height: 0;
  border-color: #d8e5f2;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(43,80,118,.055);
}

.v5-live-shell:not([data-section="cases"]) .summary-card .card-head h2,
.v5-live-shell:not([data-section="cases"]) .trends-card .card-head h2,
.v5-live-shell:not([data-section="cases"]) .timeline-card .card-head h2 {
  color: #071f46;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid {
  gap: 7px;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid div {
  position: relative;
  min-height: 74px;
  border-color: #dfe8f1;
  border-radius: 7px;
  background:
    radial-gradient(circle at 90% 14%, rgba(9, 103, 210, .075), transparent 35%),
    linear-gradient(180deg, #fff, #fbfdff);
  padding: 8px 9px 8px 34px;
  overflow: hidden;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid div::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 11px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #cfe0f3;
  border-radius: 6px;
  background: #eef6ff;
  color: #0756b7;
  font-size: .48rem;
  font-weight: 950;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .overview-card::before {
  content: attr(data-metric);
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-time::before {
  content: "\25F4";
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-hr::before {
  content: "\2665";
  color: #c82039;
  background: #fff0f3;
  border-color: #ffd1d9;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-rr::before {
  content: "\223F";
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-spo2::before {
  content: "\25C7";
  color: #0284c7;
  background: #eef9ff;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-etco2::before {
  content: "CO2";
  color: #6d4fc2;
  background: #f5f2ff;
  border-color: #ded6ff;
  font-size: .42rem;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-temp::before {
  content: "\00B0";
  color: #b42318;
  background: #fff4f2;
  border-color: #ffd8d2;
  font-size: .72rem;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-sap::before,
.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-dap::before,
.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-map::before {
  content: "BP";
  color: #0f766e;
  background: #eefdf9;
  border-color: #bdeee4;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-iso::before {
  content: "ISO";
  color: #6d4fc2;
  background: #f5f2ff;
  border-color: #ded6ff;
  font-size: .4rem;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-o2::before {
  content: "O2";
  color: #15803d;
  background: #effaf2;
  border-color: #c3eccd;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-fluid::before {
  content: "\25CC";
  color: #0284c7;
  background: #eef9ff;
  border-color: #bae6fd;
  font-size: .64rem;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-mm::before {
  content: "MM";
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-crt::before {
  content: "\21BA";
  color: #0284c7;
  background: #eef9ff;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid .metric-notes::before {
  content: "\270E";
  color: #536d8d;
  background: #f6f8fb;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid small {
  color: #315676;
  font-size: .65rem;
  font-weight: 950;
  text-transform: uppercase;
}

.v5-live-shell:not([data-section="cases"]) .overview-vitals-grid b {
  color: #071f46;
  font-size: 1rem;
}

.v5-live-shell:not([data-section="cases"]) .trends-card {
  display: grid;
  gap: 9px;
}

.v5-live-shell:not([data-section="cases"]) .trends-card .card-head {
  border-bottom: 1px solid #edf3f9;
  padding-bottom: 7px;
}

.v5-live-shell:not([data-section="cases"]) .trends-card .card-head button,
.v5-live-shell:not([data-section="cases"]) .summary-card .overview-subhead button,
.v5-live-shell:not([data-section="cases"]) .timeline-card .card-head button {
  border-radius: 6px;
  background: #f6faff;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart {
  position: relative;
  min-height: 112px;
  border: 1px solid #dfe8f1;
  border-radius: 7px;
  background:
    linear-gradient(#edf3f9 1px, transparent 1px) 0 35px / 100% 25px,
    linear-gradient(90deg, rgba(237, 243, 249, .74) 1px, transparent 1px) 0 0 / 56px 100%,
    linear-gradient(180deg, #fff, #fbfdff);
  padding: 8px;
  overflow: hidden;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart b {
  display: flex;
  justify-content: space-between;
  color: #12345d;
  font-size: .73rem;
  font-weight: 950;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart b span {
  color: #071f46;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart svg {
  width: 100%;
  height: 62px;
  margin-top: 5px;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  min-height: 12px;
  margin-top: 1px;
  color: #617896;
  font-size: .56rem;
  font-weight: 850;
  white-space: nowrap;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart-axis [data-trend-axis="mid"] {
  display: none;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart polyline {
  fill: none;
  stroke: #0b73df;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.green polyline {
  stroke: #16a34a;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.purple polyline {
  stroke: #7c3aed;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.red polyline {
  stroke: #ef4444;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart .trend-dots circle {
  fill: #fff;
  stroke: #0b73df;
  stroke-width: 1.7;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.green .trend-dots circle {
  stroke: #16a34a;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.purple .trend-dots circle {
  stroke: #7c3aed;
}

.v5-live-shell:not([data-section="cases"]) .mini-chart.red .trend-dots circle {
  stroke: #ef4444;
}

.v5-live-shell .readiness-card,
.v5-live-shell[data-section="pdf"] .readiness-card {
  display: none;
}

/* Charts tab: confirmed-vitals dashboard. Scoped to avoid changing Vitals entry. */
.v5-live-shell[data-section="charts"] .charts-dashboard {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.v5-live-shell[data-section="charts"] .charts-toolbar,
.v5-live-shell[data-section="charts"] .chart-main-card,
.v5-live-shell[data-section="charts"] .chart-points-card {
  min-width: 0;
  border: 1px solid #dce7f2;
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(33, 64, 99, .052);
}

.v5-live-shell[data-section="charts"] .charts-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
}

.v5-live-shell[data-section="charts"] .section-kicker {
  display: block;
  color: #0b66d4;
  font-size: .67rem;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="charts"] .charts-toolbar h2 {
  margin: 2px 0;
  color: #071f46;
  font-size: 1.34rem;
  letter-spacing: -.04em;
}

.v5-live-shell[data-section="charts"] .charts-toolbar p {
  margin: 0;
  color: #5b6d83;
  font-size: .8rem;
  font-weight: 800;
}

.v5-live-shell[data-section="charts"] .charts-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.v5-live-shell[data-section="charts"] .charts-controls button {
  min-height: 32px;
  border: 1px solid #d7e5f4;
  border-radius: 7px;
  padding: 0 11px;
  background: #f7fbff;
  color: #24405f;
  font-size: .74rem;
  font-weight: 900;
  box-shadow: none;
}

.v5-live-shell[data-section="charts"] .charts-controls button.active {
  border-color: #9fc8ff;
  background: #0b73df;
  color: #fff;
}

.v5-live-shell[data-section="charts"] .chart-metric-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(78px, 1fr));
  gap: 8px;
  min-width: 0;
}

.v5-live-shell[data-section="charts"] .chart-metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  grid-template-rows: auto auto auto;
  gap: 1px 8px;
  min-width: 0;
  min-height: 58px;
  border: 1px solid #dce7f2;
  border-radius: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  color: #0d2750;
  text-align: left;
  box-shadow: 0 6px 16px rgba(29, 66, 107, .04);
}

.v5-live-shell[data-section="charts"] .chart-metric-card::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 9%, #fff);
}

.v5-live-shell[data-section="charts"] .chart-metric-card::after {
  content: "\25C9";
  grid-column: 3;
  grid-row: 1 / span 3;
  align-self: center;
  justify-self: end;
  color: currentColor;
  font-size: .72rem;
}

.v5-live-shell[data-section="charts"] .chart-metric-card:not(.active) {
  opacity: .58;
}

.v5-live-shell[data-section="charts"] .chart-metric-card span {
  grid-column: 2;
  min-width: 0;
  color: #526a88;
  font-size: .67rem;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="charts"] .chart-metric-card b {
  grid-column: 2;
  color: #071f46;
  font-size: 1.02rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.v5-live-shell[data-section="charts"] .chart-metric-card small {
  grid-column: 2;
  color: #72839a;
  font-size: .58rem;
  font-weight: 850;
}

.v5-live-shell[data-section="charts"] .chart-metric-card.metric-hr { color: #0b73df; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-rr { color: #0891b2; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-spo2 { color: #16a34a; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-etco2 { color: #7c3aed; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-temp { color: #f97316; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-sap { color: #ec4899; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-dap { color: #be185d; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-map { color: #9d174d; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-iso { color: #0f766e; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-o2 { color: #0284c7; }
.v5-live-shell[data-section="charts"] .chart-metric-card.metric-fluid { color: #2563eb; }

.v5-live-shell[data-section="charts"] .chart-main-card,
.v5-live-shell[data-section="charts"] .chart-points-card {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.v5-live-shell[data-section="charts"] .chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.v5-live-shell[data-section="charts"] .chart-card-head b {
  display: block;
  color: #071f46;
  font-size: .98rem;
}

.v5-live-shell[data-section="charts"] .chart-card-head span {
  display: block;
  color: #687a91;
  font-size: .74rem;
  font-weight: 800;
}

.v5-live-shell[data-section="charts"] .chart-local-pill {
  flex: 0 0 auto;
  border: 1px solid #cfe6d5;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f0fbf3;
  color: #12813a !important;
  font-size: .68rem !important;
  font-weight: 950 !important;
}

.v5-live-shell[data-section="charts"] .chart-stage {
  position: relative;
  min-height: 352px;
  overflow: hidden;
  border: 1px solid #dde8f4;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(196, 214, 235, .68) 1px, transparent 1px) 0 0 / 10% 100%,
    linear-gradient(180deg, rgba(220, 232, 244, .78) 1px, transparent 1px) 0 0 / 100% calc(100% / var(--chart-series-count, 11)),
    radial-gradient(circle at 16% 24%, rgba(11, 115, 223, .08), transparent 24%),
    radial-gradient(circle at 92% 78%, rgba(22, 163, 74, .07), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.v5-live-shell[data-section="charts"] .chart-series-rail {
  position: absolute;
  left: 10px;
  top: 14px;
  bottom: 14px;
  z-index: 1;
  display: grid;
  grid-template-rows: repeat(var(--chart-series-count, 11), minmax(0, 1fr));
  width: 58px;
}

.v5-live-shell[data-section="charts"] .chart-rail-item {
  display: grid;
  align-content: center;
  gap: 1px;
  color: #0b73df;
  font-size: .58rem;
  font-weight: 950;
  line-height: 1.05;
}

.v5-live-shell[data-section="charts"] .chart-rail-item b {
  color: currentColor;
  font-size: .68rem;
}

.v5-live-shell[data-section="charts"] .chart-rail-item small,
.v5-live-shell[data-section="charts"] .chart-rail-item em {
  color: currentColor;
  font-style: normal;
  opacity: .9;
}

.v5-live-shell[data-section="charts"] .chart-rail-rr { color: #0891b2; }
.v5-live-shell[data-section="charts"] .chart-rail-spo2 { color: #16a34a; }
.v5-live-shell[data-section="charts"] .chart-rail-etco2 { color: #7c3aed; }
.v5-live-shell[data-section="charts"] .chart-rail-temp { color: #f97316; }
.v5-live-shell[data-section="charts"] .chart-rail-sap { color: #ec4899; }
.v5-live-shell[data-section="charts"] .chart-rail-dap { color: #be185d; }
.v5-live-shell[data-section="charts"] .chart-rail-map { color: #9d174d; }
.v5-live-shell[data-section="charts"] .chart-rail-iso { color: #0f766e; }
.v5-live-shell[data-section="charts"] .chart-rail-o2 { color: #0284c7; }
.v5-live-shell[data-section="charts"] .chart-rail-fluid { color: #2563eb; }

.v5-live-shell[data-section="charts"] .chart-event-markers {
  position: absolute;
  inset: 14px 82px 14px 78px;
  z-index: 2;
  pointer-events: none;
}

.v5-live-shell[data-section="charts"] .chart-event-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(180deg, rgba(88, 122, 164, .3) 0 4px, transparent 4px 8px);
}

.v5-live-shell[data-section="charts"] .chart-event-marker i {
  position: absolute;
  top: 13%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #74859e;
  box-shadow: 0 0 0 3px rgba(116, 133, 158, .14);
  transform: rotate(45deg);
}

.v5-live-shell[data-section="charts"] .chart-main-svg {
  position: absolute;
  inset: 14px 82px 14px 78px;
  z-index: 3;
  width: calc(100% - 160px);
  height: calc(100% - 28px);
  overflow: visible;
}

.v5-live-shell[data-section="charts"] .chart-series {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 2px 4px rgba(15, 42, 78, .12));
}

.v5-live-shell[data-section="charts"] .chart-series.disabled {
  opacity: 0;
}

.v5-live-shell[data-section="charts"] .chart-series-hr { stroke: #0b73df; }
.v5-live-shell[data-section="charts"] .chart-series-rr { stroke: #0891b2; }
.v5-live-shell[data-section="charts"] .chart-series-spo2 { stroke: #16a34a; }
.v5-live-shell[data-section="charts"] .chart-series-etco2 { stroke: #7c3aed; }
.v5-live-shell[data-section="charts"] .chart-series-temp { stroke: #f97316; }
.v5-live-shell[data-section="charts"] .chart-series-sap { stroke: #ec4899; }
.v5-live-shell[data-section="charts"] .chart-series-dap { stroke: #be185d; }
.v5-live-shell[data-section="charts"] .chart-series-map { stroke: #9d174d; }
.v5-live-shell[data-section="charts"] .chart-series-iso { stroke: #0f766e; }
.v5-live-shell[data-section="charts"] .chart-series-o2 { stroke: #0284c7; }
.v5-live-shell[data-section="charts"] .chart-series-fluid { stroke: #2563eb; }

.v5-live-shell[data-section="charts"] .chart-edge-values {
  position: absolute;
  top: 14px;
  right: 11px;
  width: 70px;
  height: calc(100% - 28px);
  z-index: 4;
}

.v5-live-shell[data-section="charts"] .chart-value-pill {
  position: absolute;
  top: calc(((var(--chart-row, 0) + .5) * 100%) / var(--chart-series-count, 11));
  right: 0;
  display: block;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 28%, #fff);
  border-radius: 999px;
  padding: 4px 6px;
  background: rgba(255,255,255,.93);
  color: #0d2750;
  font-size: .57rem;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.v5-live-shell[data-section="charts"] .chart-value-pill.disabled,
.v5-live-shell[data-section="charts"] .chart-value-pill.empty {
  opacity: .42;
}

.v5-live-shell[data-section="charts"] .chart-pill-hr { color: #0b73df; }
.v5-live-shell[data-section="charts"] .chart-pill-rr { color: #0e7490; }
.v5-live-shell[data-section="charts"] .chart-pill-spo2 { color: #15803d; }
.v5-live-shell[data-section="charts"] .chart-pill-etco2 { color: #6d28d9; }
.v5-live-shell[data-section="charts"] .chart-pill-temp { color: #ea580c; }
.v5-live-shell[data-section="charts"] .chart-pill-sap { color: #db2777; }
.v5-live-shell[data-section="charts"] .chart-pill-dap { color: #be185d; }
.v5-live-shell[data-section="charts"] .chart-pill-map { color: #9d174d; }
.v5-live-shell[data-section="charts"] .chart-pill-iso { color: #0f766e; }
.v5-live-shell[data-section="charts"] .chart-pill-o2 { color: #0369a1; }
.v5-live-shell[data-section="charts"] .chart-pill-fluid { color: #1d4ed8; }

.v5-live-shell[data-section="charts"] .charts-empty-state {
  position: absolute;
  left: calc(50% + 24px);
  top: 50%;
  z-index: 2;
  display: grid;
  gap: 4px;
  width: min(320px, calc(100% - 54px));
  transform: translate(-50%, -50%);
  border: 1px dashed #bdd5ee;
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,.93);
  color: #536d8d;
  text-align: center;
}

.v5-live-shell[data-section="charts"] .charts-empty-state[hidden] {
  display: none;
}

.v5-live-shell[data-section="charts"] .charts-empty-state b {
  color: #0d2750;
}

.v5-live-shell[data-section="charts"] .chart-axis-row {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  padding: 0 88px 0 78px;
  color: #71839a;
  font-size: .68rem;
  font-weight: 850;
}

.v5-live-shell[data-section="charts"] .chart-brush {
  position: relative;
  height: 21px;
  margin: 0 88px 0 78px;
  border-top: 1px solid #d9e6f4;
}

.v5-live-shell[data-section="charts"] .chart-brush span {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 1px;
  background:
    repeating-linear-gradient(90deg, #b6cbe4 0 1px, transparent 1px 40px),
    #dce8f4;
}

.v5-live-shell[data-section="charts"] .chart-brush i {
  position: absolute;
  top: 3px;
  height: 12px;
  min-width: 14px;
  border: 2px solid #0b73df;
  border-radius: 5px;
  background: rgba(11, 115, 223, .08);
}

.v5-live-shell[data-section="charts"] .chart-brush i::before,
.v5-live-shell[data-section="charts"] .chart-brush i::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 8px;
  height: 20px;
  border: 2px solid #0b73df;
  border-radius: 5px;
  background: #fff;
}

.v5-live-shell[data-section="charts"] .chart-brush i::before {
  left: -5px;
}

.v5-live-shell[data-section="charts"] .chart-brush i::after {
  right: -5px;
}

.v5-live-shell[data-section="charts"] .chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: #536d8d;
  font-size: .72rem;
  font-weight: 900;
}

.v5-live-shell[data-section="charts"] .chart-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 999px;
  background: currentColor;
}

.v5-live-shell[data-section="charts"] .legend-hr { color: #0b73df; }
.v5-live-shell[data-section="charts"] .legend-rr { color: #0891b2; }
.v5-live-shell[data-section="charts"] .legend-spo2 { color: #16a34a; }
.v5-live-shell[data-section="charts"] .legend-etco2 { color: #7c3aed; }
.v5-live-shell[data-section="charts"] .legend-temp { color: #f97316; }
.v5-live-shell[data-section="charts"] .legend-sap { color: #ec4899; }
.v5-live-shell[data-section="charts"] .legend-dap { color: #be185d; }
.v5-live-shell[data-section="charts"] .legend-map { color: #9d174d; }
.v5-live-shell[data-section="charts"] .legend-iso { color: #0f766e; }
.v5-live-shell[data-section="charts"] .legend-o2 { color: #0284c7; }
.v5-live-shell[data-section="charts"] .legend-fluid { color: #2563eb; }

.v5-live-shell[data-section="charts"] .chart-points-table-wrap {
  min-width: 0;
  overflow: hidden;
}

.v5-live-shell[data-section="charts"] .chart-points-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.v5-live-shell[data-section="charts"] .chart-points-table th,
.v5-live-shell[data-section="charts"] .chart-points-table td {
  border-bottom: 1px solid #eef3f8;
  padding: 8px 7px;
  color: #10264b;
  font-size: .72rem;
  font-weight: 850;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.v5-live-shell[data-section="charts"] .chart-points-table th {
  color: #5a708d;
  font-size: .6rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.v5-live-shell[data-section="charts"] .chart-points-table th:last-child,
.v5-live-shell[data-section="charts"] .chart-points-table td:last-child {
  width: 23%;
}

.v5-live-shell[data-section="charts"] .chart-points-table tr:last-child td {
  border-bottom: 0;
}

.v5-live-shell[data-section="charts"] .chart-cell-hr { color: #0b73df; }
.v5-live-shell[data-section="charts"] .chart-cell-rr { color: #0e7490; }
.v5-live-shell[data-section="charts"] .chart-cell-spo2 { color: #15803d; }
.v5-live-shell[data-section="charts"] .chart-cell-etco2 { color: #6d28d9; }
.v5-live-shell[data-section="charts"] .chart-cell-temp { color: #ea580c; }
.v5-live-shell[data-section="charts"] .chart-cell-sap { color: #db2777; }
.v5-live-shell[data-section="charts"] .chart-cell-dap { color: #be185d; }
.v5-live-shell[data-section="charts"] .chart-cell-map { color: #9d174d; }
.v5-live-shell[data-section="charts"] .chart-cell-iso { color: #0f766e; }
.v5-live-shell[data-section="charts"] .chart-cell-o2 { color: #0369a1; }
.v5-live-shell[data-section="charts"] .chart-cell-fluid { color: #1d4ed8; }

.v5-live-shell[data-section="charts"] .chart-points-table .empty-row td {
  color: #687a91;
  text-align: center;
}

@media (max-width: 1280px) {
  .v5-live-shell[data-section="charts"] .charts-toolbar {
    grid-template-columns: 1fr;
  }

  .v5-live-shell[data-section="charts"] .charts-controls {
    justify-content: flex-start;
  }

  .v5-live-shell[data-section="charts"] .chart-metric-strip {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
  }
}

@media (max-width: 900px) {
  .v5-live-shell[data-section="charts"] .chart-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v5-live-shell[data-section="charts"] .chart-main-svg {
    inset-right: 18px;
    width: calc(100% - 96px);
  }

  .v5-live-shell[data-section="charts"] .chart-edge-values {
    position: static;
    width: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
  }

  .v5-live-shell[data-section="charts"] .chart-stage {
    min-height: 390px;
  }

  .v5-live-shell[data-section="charts"] .chart-axis-row {
    padding-right: 18px;
  }

  .v5-live-shell[data-section="charts"] .chart-event-markers {
    right: 18px;
  }
}

@media (max-width: 1280px) {
  .v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v5-live-shell[data-section="vitals"] .vitals-entry-card .notes-card {
    grid-column: 1 / -1;
  }
}

/* Metric icon layer for the Vitals concept. CSS-only: no image assets or logic changes. */
.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-time::before {
  content: "\25F4";
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-hr::before {
  content: "\2665";
  font-size: .76rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-rr::before {
  content: "\223F";
  color: #2563eb;
  background: #eff6ff;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-spo2::before {
  content: "\25C7";
  color: #0284c7;
  background: #eef9ff;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-etco2::before {
  content: "CO2";
  color: #6d4fc2;
  background: #f5f2ff;
  font-size: .48rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-temp::before {
  content: "\00B0";
  font-size: .82rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-bp::before {
  content: "BP";
  font-size: .5rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-iso::before {
  content: "ISO";
  font-size: .45rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-o2::before {
  content: "O2";
  font-size: .5rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid::before {
  content: "\25CC";
  font-size: .7rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-mm::before {
  content: "MM";
  color: #0756b7;
  background: #eef6ff;
  font-size: .5rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-crt::before {
  content: "\21BA";
  color: #0284c7;
  background: #eef9ff;
  font-size: .7rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-notes::before {
  content: "\270E";
  color: #536d8d;
  background: #f6f8fb;
  font-size: .68rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-time::after,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-mm::after,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-crt::after,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-notes::after {
  opacity: .28;
}

/* Draft vitals tiles are inputs, not charts: keep real trends in the right panel. */
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::after {
  display: none;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-temp::before {
  content: "Temp";
  min-width: 34px;
  padding: 0 5px;
  color: #b42318;
  background: #fff4f2;
  border-color: #ffd8d2;
  font-size: .46rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid::before {
  content: "mL";
  color: #0284c7;
  background: #eef9ff;
  border-color: #bae6fd;
  font-size: .56rem;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid #fluidCalcBtn {
  width: 100%;
  min-height: 31px;
  margin-top: 3px;
  justify-self: stretch;
  border-radius: 6px;
  padding: 0 9px;
  font-size: .72rem;
  box-shadow: none;
}

/* Keep the Vitals workspace inside the main column beside the shared overview panel. */
.v5-live-shell[data-section="vitals"] .section-view[data-view="vitals"].active {
  grid-template-columns: minmax(0, 1fr);
}

.v5-live-shell[data-section="vitals"] .vitals-section-title,
.v5-live-shell[data-section="vitals"] .vitals-dashboard,
.v5-live-shell[data-section="vitals"] .vitals-entry-card,
.v5-live-shell[data-section="vitals"] .vitals-log-panel,
.v5-live-shell[data-section="vitals"] .vitals-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head,
.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-draft-panel,
.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .draft-vitals-grid,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card input,
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card select {
  max-width: 100%;
  min-width: 0;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-head .vitals-actions {
  flex: 1 1 320px;
}

.v5-live-shell[data-section="vitals"] .vitals-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.v5-live-shell[data-section="vitals"] .vitals-table th,
.v5-live-shell[data-section="vitals"] .vitals-table td {
  min-width: 0;
  padding-inline: 3px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.v5-live-shell[data-section="vitals"] .vitals-table th {
  font-size: .62rem;
}

.v5-live-shell[data-section="vitals"] .vitals-table td {
  font-size: .72rem;
}

.v5-live-shell[data-section="vitals"] .vitals-table th:first-child,
.v5-live-shell[data-section="vitals"] .vitals-table td:first-child {
  width: 28px;
  min-width: 0;
  padding-left: 5px;
  padding-right: 3px;
}

.v5-live-shell[data-section="vitals"] .vitals-table th:nth-child(2),
.v5-live-shell[data-section="vitals"] .vitals-table td:nth-child(2) {
  width: 54px;
}

/* Replace text badges with the supplied vitals SVG icon pack. */
.v5-live-shell[data-section="vitals"] .vitals-entry-card .vital-card::before {
  content: "" !important;
  display: inline-block;
  justify-self: start;
  align-self: start;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 0 !important;
  border-radius: 6px;
  background: currentColor !important;
  -webkit-mask: var(--vitals-icon) center / 16px 16px no-repeat !important;
  mask: var(--vitals-icon) center / 16px 16px no-repeat !important;
  opacity: .96 !important;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-time {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%228.5%22%2F%3E%3Cpath%20d%3D%22M12%207.5v5l3.2%202%22%2F%3E%3C%2Fsvg%3E");
  color: #0b73df;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-hr {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19.4%205.8a5%205%200%200%200-7.1%200L12%206.1l-.3-.3a5%205%200%200%200-7.1%207.1l.3.3L12%2020.3l7.1-7.1.3-.3a5%205%200%200%200%200-7.1Z%22%2F%3E%3Cpath%20d%3D%22M4%2012h4l1.5-3%203%206%201.6-3H20%22%2F%3E%3C%2Fsvg%3E");
  color: #c82039;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-rr {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%204v8%22%2F%3E%3Cpath%20d%3D%22M12%208c-2.4.7-4.1%202.7-5%205.8L5.8%2018c-.3%201%20.5%202%201.6%202%202.6%200%204.6-2.1%204.6-4.7V8Z%22%2F%3E%3Cpath%20d%3D%22M12%208c2.4.7%204.1%202.7%205%205.8l1.2%204.2c.3%201-.5%202-1.6%202-2.6%200-4.6-2.1-4.6-4.7V8Z%22%2F%3E%3C%2Fsvg%3E");
  color: #2563eb;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-spo2 {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2013c2.1%200%202.1-4%204.2-4s2.1%208%204.2%208%202.1-8%204.2-8%202.1%204%205.4%204%22%2F%3E%3Cpath%20d%3D%22M4%2019h16%22%2F%3E%3Cpath%20d%3D%22M5%205h14%22%2F%3E%3C%2Fsvg%3E");
  color: #0284c7;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-etco2 {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2017h3V8h5v9h3v-5h4v5h3%22%2F%3E%3Cpath%20d%3D%22M5%2021h14%22%2F%3E%3Cpath%20d%3D%22M6%204h12%22%2F%3E%3C%2Fsvg%3E");
  color: #6d4fc2;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-temp {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%2014.7V5.5a3%203%200%200%200-6%200v9.2a5%205%200%201%200%206%200Z%22%2F%3E%3Cpath%20d%3D%22M11%206v9%22%2F%3E%3Cpath%20d%3D%22M10%2018h2%22%2F%3E%3C%2Fsvg%3E");
  color: #b42318;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-sap {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2018a7%207%200%201%201%2014%200%22%2F%3E%3Cpath%20d%3D%22M12%2018l3.6-6%22%2F%3E%3Cpath%20d%3D%22M8%2018h8%22%2F%3E%3Cpath%20d%3D%22M7%205l2%202%22%2F%3E%3Cpath%20d%3D%22M17%205l-2%202%22%2F%3E%3Cpath%20d%3D%22M12%203v3%22%2F%3E%3C%2Fsvg%3E");
  color: #0f766e;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-dap {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2018a7%207%200%201%201%2014%200%22%2F%3E%3Cpath%20d%3D%22M12%2018l-2.8-4.5%22%2F%3E%3Cpath%20d%3D%22M8%2018h8%22%2F%3E%3Cpath%20d%3D%22M7%205l2%202%22%2F%3E%3Cpath%20d%3D%22M17%205l-2%202%22%2F%3E%3Cpath%20d%3D%22M12%203v3%22%2F%3E%3C%2Fsvg%3E");
  color: #0f766e;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-map {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2018a7%207%200%201%201%2014%200%22%2F%3E%3Cpath%20d%3D%22M12%2018v-6%22%2F%3E%3Cpath%20d%3D%22M9.5%2014.5h5%22%2F%3E%3Cpath%20d%3D%22M8%2018h8%22%2F%3E%3Cpath%20d%3D%22M12%203v3%22%2F%3E%3C%2Fsvg%3E");
  color: #0f766e;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-iso {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%205c2%201.7%202%203.3%200%205s-2%203.3%200%205%22%2F%3E%3Cpath%20d%3D%22M13%205c2%201.7%202%203.3%200%205s-2%203.3%200%205%22%2F%3E%3Cpath%20d%3D%22M18%205c2%201.7%202%203.3%200%205s-2%203.3%200%205%22%2F%3E%3Cpath%20d%3D%22M5%2020h14%22%2F%3E%3C%2Fsvg%3E");
  color: #6d4fc2;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-o2 {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2215%22%20r%3D%223.5%22%2F%3E%3Ccircle%20cx%3D%2215.5%22%20cy%3D%229%22%20r%3D%224%22%2F%3E%3Ccircle%20cx%3D%2217.5%22%20cy%3D%2218%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22M7.2%2015.4h1.6%22%2F%3E%3Cpath%20d%3D%22M14.5%209h2%22%2F%3E%3C%2Fsvg%3E");
  color: #15803d;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-fluid {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203.5s6%206.2%206%2010.6a6%206%200%200%201-12%200C6%209.7%2012%203.5%2012%203.5Z%22%2F%3E%3Cpath%20d%3D%22M9.5%2015.2a2.8%202.8%200%200%200%202.8%202.4%22%2F%3E%3Cpath%20d%3D%22M15.5%206.5h4%22%2F%3E%3Cpath%20d%3D%22M17.5%204.5v4%22%2F%3E%3C%2Fsvg%3E");
  color: #0284c7;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-mm {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2012c2.5-3.2%205.2-4.8%208-4.8s5.5%201.6%208%204.8c-2.5%203.2-5.2%204.8-8%204.8S6.5%2015.2%204%2012Z%22%2F%3E%3Cpath%20d%3D%22M5%2012h14%22%2F%3E%3Cpath%20d%3D%22M8.5%209.4c1.1.8%202.2%201.2%203.5%201.2s2.4-.4%203.5-1.2%22%2F%3E%3C%2Fsvg%3E");
  color: #0756b7;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-crt {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2213%22%20r%3D%226.5%22%2F%3E%3Cpath%20d%3D%22M9%203h6%22%2F%3E%3Cpath%20d%3D%22M12%203v3%22%2F%3E%3Cpath%20d%3D%22M12%2013l3-2%22%2F%3E%3Cpath%20d%3D%22M8.2%2017.2h7.6%22%2F%3E%3C%2Fsvg%3E");
  color: #0284c7;
}

.v5-live-shell[data-section="vitals"] .vitals-entry-card .metric-notes {
  --vitals-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%204h10l4%204v12H5Z%22%2F%3E%3Cpath%20d%3D%22M15%204v4h4%22%2F%3E%3Cpath%20d%3D%22M8%2013h5%22%2F%3E%3Cpath%20d%3D%22M8%2017h8%22%2F%3E%3Cpath%20d%3D%22M14.5%2012.5l4-4%202%202-4%204-2.5.5Z%22%2F%3E%3C%2Fsvg%3E");
  color: #536d8d;
}

/* Medication tab grouped workflow. Scoped to standalone V5 Medication only. */
.v5-live-shell[data-section="medications"] .work-panel {
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%);
  border-color: #d8e5f2;
}

.v5-live-shell[data-section="medications"] .panel-head {
  display: none;
}

.v5-live-shell[data-section="medications"] .section-view[data-view="medications"] {
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.v5-live-shell[data-section="medications"] .medication-workspace,
.v5-live-shell[data-section="medications"] .medication-page-head,
.v5-live-shell[data-section="medications"] .medication-entry-card,
.v5-live-shell[data-section="medications"] .medication-groups,
.v5-live-shell[data-section="medications"] .medication-confirmed-panel,
.v5-live-shell[data-section="medications"] .medication-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.v5-live-shell[data-section="medications"] .medication-workspace {
  display: grid;
  gap: 12px;
}

.v5-live-shell[data-section="medications"] .medication-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.v5-live-shell[data-section="medications"] .medication-page-head h2 {
  margin: 0;
  color: #071f46;
  font-size: clamp(1.35rem, 2vw, 1.74rem);
  line-height: 1;
}

.v5-live-shell[data-section="medications"] .medication-page-head p {
  margin: 7px 0 0;
  color: #536d8d;
  font-size: .86rem;
  font-weight: 850;
}

.v5-live-shell[data-section="medications"] .medication-saved-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #bfe8ca;
  border-radius: 999px;
  background: #effaf2;
  color: #166534;
  padding: 0 13px;
  font-size: .74rem;
  font-weight: 950;
  white-space: nowrap;
}

.v5-live-shell[data-section="medications"] .medication-entry-card,
.v5-live-shell[data-section="medications"] .med-group-card,
.v5-live-shell[data-section="medications"] .medication-confirmed-panel {
  border: 1px solid #dce8f4;
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 7px 18px rgba(43, 80, 118, .045);
}

.v5-live-shell[data-section="medications"] .medication-entry-card {
  padding: 12px;
}

.v5-live-shell[data-section="medications"] .medication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(142px, 100%), 1fr));
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.v5-live-shell[data-section="medications"] .medication-grid label,
.v5-live-shell[data-section="medications"] .med-group-table td,
.v5-live-shell[data-section="medications"] .medication-table td {
  min-width: 0;
}

.v5-live-shell[data-section="medications"] .medication-grid label {
  display: grid;
  gap: 8px;
}

.v5-live-shell[data-section="medications"] .medication-grid span {
  color: #203b68;
  font-size: .72rem;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .medication-grid input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #dce8f4;
  border-radius: 7px;
  background: #fff;
  color: #071f46;
  padding: 0 12px;
  font-size: .88rem;
  font-weight: 850;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
}

.v5-live-shell[data-section="medications"] .med-entry-draft {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid #e2ebf5;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-head b {
  display: block;
  color: #071f46;
  font-size: .86rem;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-head span {
  color: #536d8d;
  font-size: .72rem;
  font-weight: 850;
}

.v5-live-shell[data-section="medications"] .med-entry-total,
.v5-live-shell[data-section="medications"] .med-entry-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #dfd7ff;
  border-radius: 999px;
  background: #f5f1ff;
  color: #5b21b6;
  padding: 0 9px;
  font-size: .68rem;
  font-weight: 950;
  white-space: nowrap;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-table {
  border: 1px solid #e0e9f3;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-table table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-table th,
.v5-live-shell[data-section="medications"] .med-entry-draft-table td {
  border-bottom: 1px solid #edf3f9;
  color: #071f46;
  padding: 7px 8px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .72rem;
  font-weight: 850;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-table th {
  color: #49668c;
  background: #fbfdff;
  font-size: .62rem;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-entry-draft-table th:last-child,
.v5-live-shell[data-section="medications"] .med-entry-draft-table td:last-child {
  width: 42px;
  text-align: center;
}

.v5-live-shell[data-section="medications"] .med-draft-empty td {
  color: #5b6d8a;
  text-align: center;
}

.v5-live-shell[data-section="medications"] .medication-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.v5-live-shell[data-section="medications"] .medication-actions .confirm-btn {
  min-width: 204px;
  min-height: 40px;
  border-radius: 7px;
}

.v5-live-shell[data-section="medications"] .medication-actions .secondary-action {
  min-width: 118px;
  min-height: 40px;
  border-radius: 7px;
  background: #fff;
}

.v5-live-shell[data-section="medications"] .medication-actions .vitals-notice {
  flex-basis: 100%;
  color: #496782;
  text-align: center;
}

.v5-live-shell[data-section="medications"] .medication-groups {
  display: grid;
  gap: 8px;
}

.v5-live-shell[data-section="medications"] .med-group-card {
  overflow: hidden;
}

.v5-live-shell[data-section="medications"] .med-group-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
}

.v5-live-shell[data-section="medications"] .med-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-width: 0;
}

.v5-live-shell[data-section="medications"] .med-group-title b {
  color: #071f46;
  font-size: 1rem;
}

.v5-live-shell[data-section="medications"] .med-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, .11);
}

.v5-live-shell[data-section="medications"] .med-dot.purple { background: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .12); }
.v5-live-shell[data-section="medications"] .med-dot.green { background: #18a66a; box-shadow: 0 0 0 4px rgba(24, 166, 106, .12); }
.v5-live-shell[data-section="medications"] .med-dot.blue { background: #1478e8; box-shadow: 0 0 0 4px rgba(20, 120, 232, .12); }
.v5-live-shell[data-section="medications"] .med-dot.orange { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .14); }

.v5-live-shell[data-section="medications"] .med-group-total,
.v5-live-shell[data-section="medications"] .med-group-foot span {
  border: 1px solid #e1e9f3;
  border-radius: 999px;
  background: #f4f7fb;
  color: #48617e;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-group-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v5-live-shell[data-section="medications"] .med-icon-button,
.v5-live-shell[data-section="medications"] .med-row-menu {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #dce8f4;
  border-radius: 7px;
  background: #fff;
  color: #18365f;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-icon-button.danger {
  color: #b42318;
}

.v5-live-shell[data-section="medications"] .med-icon-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.v5-live-shell[data-section="medications"] .med-group-body {
  border-top: 1px solid #e6eef7;
  padding: 0 12px 10px;
}

.v5-live-shell[data-section="medications"] .med-entry-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid #d8caff;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fcfbff);
  padding: 8px;
}

.v5-live-shell[data-section="medications"] .med-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.v5-live-shell[data-section="medications"] .med-entry-title,
.v5-live-shell[data-section="medications"] .med-entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.v5-live-shell[data-section="medications"] .med-entry-title b {
  color: #071f46;
  font-size: .82rem;
}

.v5-live-shell[data-section="medications"] .med-entry-meta span,
.v5-live-shell[data-section="medications"] .med-entry-meta b,
.v5-live-shell[data-section="medications"] .med-group-latest {
  color: #18365f;
  font-size: .72rem;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-entry-foot {
  display: flex;
  justify-content: flex-start;
}

.v5-live-shell[data-section="medications"] .med-group-table-wrap,
.v5-live-shell[data-section="medications"] .medication-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #e0e9f3;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.v5-live-shell[data-section="medications"] .med-group-table,
.v5-live-shell[data-section="medications"] .medication-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.v5-live-shell[data-section="medications"] .med-group-table th,
.v5-live-shell[data-section="medications"] .med-group-table td,
.v5-live-shell[data-section="medications"] .medication-table th,
.v5-live-shell[data-section="medications"] .medication-table td {
  border-bottom: 1px solid #edf3f9;
  color: #071f46;
  padding: 9px 8px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .76rem;
  font-weight: 850;
}

.v5-live-shell[data-section="medications"] .med-group-table th,
.v5-live-shell[data-section="medications"] .medication-table th {
  color: #49668c;
  background: #fbfdff;
  font-size: .66rem;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .medication-table th:first-child,
.v5-live-shell[data-section="medications"] .medication-table td:first-child {
  width: 82px;
}

.v5-live-shell[data-section="medications"] .medication-table th:nth-child(3),
.v5-live-shell[data-section="medications"] .medication-table td:nth-child(3) {
  width: 80px;
}

.v5-live-shell[data-section="medications"] .med-group-table th:last-child,
.v5-live-shell[data-section="medications"] .med-group-table td:last-child,
.v5-live-shell[data-section="medications"] .medication-table th:last-child,
.v5-live-shell[data-section="medications"] .medication-table td:last-child {
  width: 42px;
  text-align: center;
}

.v5-live-shell[data-section="medications"] .med-time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #dce8f4;
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  color: #0d2a59;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-group-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
}

.v5-live-shell[data-section="medications"] .med-add-to-group,
.v5-live-shell[data-section="medications"] .med-add-to-entry {
  min-height: 31px;
  border-radius: 7px;
  background: #fff;
}

.v5-live-shell[data-section="medications"] .med-group-empty {
  border: 1px dashed #dce8f4;
  border-radius: 8px;
  background: #fbfdff;
  color: #5b6d8a;
  padding: 14px;
  font-size: .82rem;
  font-weight: 850;
}

.v5-live-shell[data-section="medications"] .medication-confirmed-panel {
  margin: 10px 0 0;
  padding: 12px;
}

.v5-live-shell[data-section="medications"] .medication-confirmed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.v5-live-shell[data-section="medications"] .medication-confirmed-head .subhead {
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

.v5-live-shell[data-section="medications"] .medication-confirmed-head .subhead b {
  color: #071f46;
  font-size: 1.02rem;
}

.v5-live-shell[data-section="medications"] .medication-confirmed-head .subhead em {
  border: 1px solid #e1e9f3;
  border-radius: 999px;
  background: #f4f7fb;
  color: #5b6d8a;
  padding: 4px 9px;
  font-size: .68rem;
  font-style: normal;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid #bfd8ff;
  border-radius: 7px;
  background: #eaf3ff;
  color: #0967d2;
  padding: 0 9px;
  font-weight: 950;
}

.v5-live-shell[data-section="medications"] .med-record-empty td {
  color: #5b6d8a;
  padding: 18px;
  text-align: center;
}

@media (max-width: 1280px) {
  .v5-live-shell[data-section="medications"] .medication-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .v5-live-shell[data-section="medications"] .medication-page-head,
  .v5-live-shell[data-section="medications"] .medication-confirmed-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .v5-live-shell[data-section="medications"] .medication-grid {
    grid-template-columns: 1fr;
  }

  .v5-live-shell[data-section="medications"] .med-group-table th,
  .v5-live-shell[data-section="medications"] .med-group-table td,
  .v5-live-shell[data-section="medications"] .medication-table th,
  .v5-live-shell[data-section="medications"] .medication-table td {
    padding-inline: 5px;
    font-size: .7rem;
  }
}

/* Stable compact v5-live header: identity and clock first, actions below. */
.v5-live-shell .record-app {
  grid-template-rows: minmax(94px, auto) 62px minmax(0, 1fr) 32px;
}

.v5-live-shell[data-section="cases"] .record-app {
  grid-template-rows: minmax(94px, auto) minmax(0, 1fr) 30px;
}

.v5-live-shell .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, max-content);
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  gap: 5px 12px;
  min-height: 94px;
  padding-block: 6px;
  overflow: visible;
}

.v5-live-shell .title-lockup {
  grid-column: 1;
  grid-row: 1;
}

.v5-live-shell .time-block {
  grid-column: 2;
  grid-row: 1;
  min-width: 112px;
  min-height: 48px;
  padding: 5px 8px;
  border-radius: 10px;
}

.v5-live-shell .time-block .live-clock-time {
  font-size: 1.52rem;
}

.v5-live-shell .time-block .live-clock-date {
  font-size: .66rem;
}

.v5-live-shell .top-status {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  overflow: visible;
  max-width: 100%;
}

.v5-live-shell .top-status .status-card {
  min-height: 30px;
  min-width: 86px;
  padding-block: 4px;
}

.v5-live-shell .top-status .pdf-chip,
.v5-live-shell .top-status .primary-action {
  min-height: 30px;
}

.v5-live-shell .top-status .primary-action {
  min-width: 142px;
}

.v5-live-shell .top-status > * {
  flex: 0 0 auto;
}

@media (max-width: 1360px) {
  .v5-live-shell .record-app {
    grid-template-rows: minmax(98px, auto) 62px minmax(0, 1fr) 32px;
  }

  .v5-live-shell[data-section="cases"] .record-app {
    grid-template-rows: minmax(98px, auto) minmax(0, 1fr) 30px;
  }

  .v5-live-shell .topbar {
    min-height: 98px;
    grid-template-columns: minmax(0, 1fr) minmax(108px, max-content);
  }

  .v5-live-shell .time-block {
    min-width: 108px;
  }

  .v5-live-shell .top-status .primary-action {
    min-width: 130px;
  }
}

@media (max-width: 1120px) {
  .v5-live-shell .record-app {
    grid-template-rows: auto 62px minmax(0, 1fr) 32px;
  }

  .v5-live-shell[data-section="cases"] .record-app {
    grid-template-rows: auto minmax(0, 1fr) 30px;
  }

  .v5-live-shell .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(104px, max-content);
  }

  .v5-live-shell .time-block {
    min-width: 104px;
  }
}
