:root {
  color-scheme: light;
  --surface-page: #eaf6f6;
  --surface-panel: #ffffff;
  --surface-muted: #f3faf9;
  --surface-strong: #0f3142;
  --border-soft: #c9dde0;
  --border-strong: #9fbfc5;
  --text-main: #0f3142;
  --text-muted: #5d7281;
  --text-faint: #8497a4;
  --accent-primary: #0b72b5;
  --accent-primary-dark: #07578d;
  --accent-primary-soft: #e6f3fb;
  --accent-teal: #008c84;
  --accent-teal-dark: #006d67;
  --accent-teal-soft: #e3f6f3;
  --accent-amber: #b7791f;
  --accent-danger: #cf2e3a;
  --shadow-dialog: 0 22px 54px rgba(15, 49, 66, 0.12), 0 8px 18px rgba(15, 49, 66, 0.06);
  --shadow-panel: 0 14px 34px rgba(15, 49, 66, 0.08);
  --radius-control: 8px;
  --radius-panel: 8px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(232, 247, 247, 0.96) 0%, rgba(238, 248, 252, 0.92) 48%, rgba(246, 251, 250, 0.98) 100%),
    repeating-linear-gradient(0deg, rgba(11, 114, 181, 0.028) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(0, 140, 132, 0.026) 0 1px, transparent 1px 32px),
    var(--surface-page);
}

.auth-frame {
  display: grid;
  width: min(100%, 430px);
  align-items: center;
}

.login-dialog,
.entry-panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-panel);
}

.context-header {
  display: flex;
  gap: 13px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-control);
  box-shadow: 0 8px 18px rgba(0, 140, 132, 0.2);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-mark path,
.brand-mark circle,
.brand-mark rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-teal);
  text-transform: uppercase;
}

.context-header h1,
.dialog-header h2,
.entry-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.context-header h1 {
  font-size: 21px;
  line-height: 1.1;
  font-weight: 700;
}

.context-header h1 span {
  color: var(--accent-primary);
}

.login-dialog {
  position: relative;
  min-height: auto;
  padding: 30px 32px 24px;
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.login-dialog::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal));
}

.login-dialog .context-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.form-row,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-topline {
  display: flex;
  justify-content: flex-end;
}

.env-badge {
  display: inline-flex;
  height: 26px;
  align-items: center;
  padding: 0 10px;
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.language-switch {
  display: inline-flex;
  width: 66px;
  flex: 0 0 auto;
}

.language-select {
  width: 100%;
  height: 32px;
  padding: 0 26px 0 10px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.language-select:hover,
.language-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.14);
}

.dialog-header {
  padding: 36px 0 22px;
}

.dialog-header h2 {
  font-size: 26px;
  line-height: 1.15;
}

.dialog-header p:last-child {
  max-width: 32rem;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.alert {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 42px;
  margin: 20px 0 16px;
  padding: 11px 12px;
  color: var(--accent-danger);
  background: #fff3f4;
  border: 1px solid rgba(207, 46, 58, 0.28);
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.4;
}

.alert.hidden {
  display: none;
}

.alert svg,
.input-shell > svg,
.icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert svg {
  width: 18px;
  height: 18px;
}

.login-form {
  display: grid;
  gap: 15px;
  padding-top: 24px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span:first-child {
  color: var(--surface-strong);
  font-size: 13px;
  font-weight: 600;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell > svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 43px;
  padding: 0 14px 0 42px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  outline: none;
}

.input-shell.has-action input {
  padding-right: 48px;
}

.input-shell input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.16);
}

.input-shell input::placeholder {
  color: var(--text-faint);
}

.icon-button {
  position: absolute;
  right: 5px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--text-main);
  background: var(--accent-teal-soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.form-row {
  margin: 0 0 4px;
  font-size: 13px;
}

.remember-control {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.remember-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.primary-action {
  position: relative;
  display: inline-flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-control);
  box-shadow: 0 8px 16px rgba(0, 140, 132, 0.18);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.primary-action:hover {
  background: linear-gradient(135deg, var(--accent-primary-dark), var(--accent-teal-dark));
  border-color: var(--accent-teal-dark);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.primary-action.is-loading .button-label {
  display: none;
}

.primary-action.is-loading .button-spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dialog-footer {
  margin-top: 22px;
  padding-top: 16px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mockup-entry {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.entry-panel {
  width: min(100%, 420px);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-dialog);
}

.entry-panel .brand-mark {
  margin: 0 auto 16px;
}

.entry-panel p {
  color: var(--text-muted);
}

.entry-link {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  margin: 10px 4px 0;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border-radius: var(--radius-control);
  font-weight: 800;
}

.entry-link:hover {
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent-primary-dark), var(--accent-teal-dark));
}

.entry-link-secondary {
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  box-shadow: none;
}

.entry-link-secondary:hover {
  background: var(--surface-muted);
}

.app-page {
  min-height: 100vh;
  background: #eef6f6;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  width: 244px;
  flex: 0 0 244px;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.78);
  background: #0f3142;
  transition: width 180ms ease, flex-basis 180ms ease;
}

.sidebar-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border-radius: var(--radius-control);
  box-shadow: 0 8px 18px rgba(0, 140, 132, 0.24);
}

.sidebar-logo-icon svg,
.nav-item-icon svg,
.topbar svg,
.btn-primary-compact svg,
.search-field svg,
.modal-close svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-logo-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-app-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-app-name span {
  color: #62d4ca;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  padding: 18px 16px 8px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.68);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-item.active {
  color: #ffffff;
  background: rgba(0, 140, 132, 0.18);
  border-left-color: #62d4ca;
}

.nav-item-icon {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
}

.nav-item-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  min-width: 20px;
  padding: 1px 7px;
  color: #ffffff;
  background: var(--accent-primary);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.nav-badge.danger {
  background: var(--accent-danger);
}

.sidebar-footer {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.sidebar-footer strong {
  color: rgba(255, 255, 255, 0.74);
}

.app-layout.sidebar-collapsed .sidebar {
  width: 76px;
  flex-basis: 76px;
}

.app-layout.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}

.app-layout.sidebar-collapsed .sidebar-header > div:last-child,
.app-layout.sidebar-collapsed .nav-section-label,
.app-layout.sidebar-collapsed .nav-item-label,
.app-layout.sidebar-collapsed .nav-badge {
  display: none;
}

.app-layout.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
  border-left: 0;
  border-right: 3px solid transparent;
}

.app-layout.sidebar-collapsed .nav-item.active {
  border-right-color: #62d4ca;
}

.app-layout.sidebar-collapsed .nav-item-icon {
  width: 42px;
  height: 38px;
}

.app-layout.sidebar-collapsed .sidebar-footer {
  display: grid;
  justify-items: center;
  padding: 12px 4px;
  text-align: center;
}

.app-layout.sidebar-collapsed .sidebar-footer strong {
  display: none;
}

.app-layout.sidebar-collapsed .sidebar-footer span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  white-space: nowrap;
}

.main-area {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.topbar {
  display: flex;
  height: 52px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 2px rgba(15, 49, 66, 0.04);
}

.topbar-leading,
.topbar-breadcrumb,
.topbar-actions,
.topbar-user {
  display: flex;
  align-items: center;
}

.topbar-user-wrap {
  position: relative;
}

.topbar-leading {
  min-width: 0;
  gap: 12px;
}

.sidebar-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-color: var(--border-soft);
  outline: none;
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.topbar-breadcrumb {
  min-width: 0;
  gap: 8px;
}

.breadcrumb-item {
  color: var(--text-muted);
  font-size: 13px;
}

.breadcrumb-item.current {
  color: var(--text-main);
  font-weight: 600;
}

.breadcrumb-sep {
  color: var(--text-faint);
  font-size: 12px;
}

.topbar-actions {
  gap: 10px;
}

.topbar-language {
  width: 66px;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border-soft);
}

.topbar-user {
  min-height: 36px;
  gap: 8px;
  padding: 3px 6px 3px 4px;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.topbar-user:hover,
.topbar-user:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border-soft);
  outline: none;
}

.topbar-user-chevron {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: var(--text-muted);
}

.topbar-user-chevron svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.topbar-user-wrap.open .topbar-user-chevron svg {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: none;
  width: 224px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(15, 49, 66, 0.14);
}

.user-menu.open {
  display: grid;
}

.user-menu-header {
  display: grid;
  gap: 3px;
  padding: 9px 10px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.user-menu-name {
  color: var(--text-main);
  font-size: 12px;
}

.user-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: var(--surface-muted);
  outline: none;
}

.user-menu-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.user-menu-item.danger,
.user-menu-item.danger svg {
  color: var(--accent-danger);
}

.user-menu-divider {
  height: 1px;
  margin: 5px 4px;
  background: var(--border-soft);
}

.avatar-sm,
.avatar {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border-radius: 999px;
  font-weight: 700;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.page-content {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  color: var(--text-main);
  font-size: 24px;
  font-weight: 700;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.content-card,
.toolbar-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-panel);
  box-shadow: 0 8px 24px rgba(15, 49, 66, 0.06);
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.stat-card span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-card strong {
  color: var(--text-main);
  font-size: 28px;
  line-height: 1;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.dashboard-stat-card {
  min-height: 132px;
  gap: 12px;
  border-top: 3px solid var(--accent-primary);
}

.dashboard-stat-card.stat-card-teal {
  border-top-color: var(--accent-teal);
}

.dashboard-stat-card.stat-card-amber {
  border-top-color: var(--accent-amber);
}

.dashboard-stat-card.stat-card-slate {
  border-top-color: #577785;
}

.stat-card-heading,
.stat-card-value-row,
.content-card-header,
.progress-summary,
.overview-list > div,
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-card-heading {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-card-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
  border-radius: 50%;
}

.stat-card-teal .stat-card-icon {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
}

.stat-card-amber .stat-card-icon {
  color: var(--accent-amber);
  background: #fff7e6;
}

.stat-card-slate .stat-card-icon {
  color: #577785;
  background: #edf3f5;
}

.stat-card-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.stat-card-value-row {
  justify-content: flex-start;
  align-items: baseline;
}

.stat-card-value-row span {
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-stat-card small {
  color: var(--text-faint);
  font-size: 11px;
}

.page-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 5px;
}

.sync-status,
.period-label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.period-label {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
}

.sync-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-teal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-teal-soft);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.dashboard-side-stack {
  display: grid;
  gap: 20px;
}

.monitoring-queue,
.dashboard-side-card {
  min-width: 0;
}

.content-card-header {
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7eff1;
}

.content-card-header.compact {
  min-height: 66px;
}

.content-card-title {
  margin: 0;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
}

.content-card-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.queue-filter .select-control {
  width: auto;
  min-width: 154px;
  height: 34px;
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
}

.monitoring-table {
  min-width: 790px;
}

.monitoring-table th,
.monitoring-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.patient-cell {
  display: flex;
  min-width: 158px;
  align-items: center;
  gap: 10px;
}

.patient-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.patient-avatar-teal {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
}

.patient-avatar-blue {
  color: #466c92;
  background: #eaf1f8;
}

.patient-avatar-amber {
  color: var(--accent-amber);
  background: #fff7e6;
}

.patient-avatar-slate {
  color: #577785;
  background: #edf3f5;
}

.patient-cell strong,
.patient-cell span,
.cell-main,
.cell-sub {
  display: block;
}

.patient-cell strong,
.cell-main {
  color: var(--text-main);
  font-weight: 600;
}

.patient-cell span,
.cell-sub {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11px;
}

.status-badge.info {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
}

.progress-summary {
  align-items: flex-end;
  padding: 18px 18px 10px;
}

.progress-summary div {
  display: grid;
  gap: 3px;
}

.progress-summary strong {
  color: var(--text-main);
  font-size: 26px;
  line-height: 1;
}

.progress-summary span {
  color: var(--text-muted);
  font-size: 11px;
}

.progress-summary > span {
  font-weight: 700;
}

.progress-track {
  height: 8px;
  margin: 0 18px 16px;
  overflow: hidden;
  background: #e6eff0;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal));
  border-radius: inherit;
}

.overview-list {
  display: grid;
  gap: 11px;
  padding: 15px 18px 18px;
  border-top: 1px solid #e7eff1;
}

.overview-list > div {
  color: var(--text-muted);
  font-size: 12px;
}

.overview-list strong {
  color: var(--text-main);
  font-size: 13px;
}

.overview-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.pending {
  background: var(--accent-amber);
}

.legend-dot.in-progress {
  background: var(--accent-primary);
}

.legend-dot.completed {
  background: var(--accent-teal);
}

.activity-list {
  display: grid;
  gap: 0;
  padding: 3px 18px 7px;
}

.activity-item {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #e7eff1;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.activity-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.activity-icon.teal {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
}

.activity-icon.blue {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
}

.activity-icon.amber {
  color: var(--accent-amber);
  background: #fff7e6;
}

.activity-item > div {
  display: grid;
  gap: 3px;
}

.activity-item strong {
  color: var(--text-main);
  font-size: 12px;
}

.activity-item div span {
  color: var(--text-faint);
  font-size: 11px;
}

[data-monitor-row][hidden] {
  display: none;
}

.toolbar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.search-field {
  position: relative;
  display: flex;
  min-width: 260px;
  flex: 1;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
}

.search-field input,
.select-control,
.user-form-field input,
.user-form-field select {
  width: 100%;
  height: 38px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  outline: none;
}

.search-field input {
  padding: 0 14px 0 40px;
}

.select-control {
  max-width: 190px;
  padding: 0 12px;
}

.search-field input:focus,
.select-control:focus,
.user-form-field input:focus,
.user-form-field select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.12);
}

.content-card {
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #e7eff1;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-muted);
  background: #f7fbfb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #f8fcfc;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.error-log-header {
  align-items: flex-end;
}

.error-status-filter {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
}

.error-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.error-filter-button.active {
  color: #ffffff;
  background: var(--surface-strong);
}

.error-log-row {
  cursor: pointer;
}

.error-log-row:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.error-log-actions-column,
.error-log-actions-cell {
  width: 52px;
  text-align: right !important;
}

.error-reopen-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  cursor: pointer;
}

.error-reopen-button:hover {
  color: var(--accent-primary-dark);
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.error-reopen-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.align-right {
  text-align: right !important;
}

.empty-cell {
  padding: 28px 16px !important;
  color: var(--text-muted);
  text-align: center !important;
}

.user-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.user-person-main,
.user-person-sub {
  display: block;
}

.user-person-main {
  color: var(--text-main);
  font-weight: 600;
}

.user-person-sub {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge.ok {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
}

.status-badge.warn {
  color: var(--accent-amber);
  background: #fff7e6;
}

.status-badge.danger {
  color: var(--accent-danger);
  background: #fff3f4;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
}

.user-icon-btn,
.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.user-icon-btn:hover,
.modal-close:hover {
  color: var(--text-main);
  background: var(--accent-teal-soft);
}

.user-icon-btn svg,
.modal-close svg {
  width: 17px;
  height: 17px;
}

.btn-primary-compact,
.btn-secondary {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.btn-primary-compact {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal));
  border: 1px solid var(--accent-primary);
  box-shadow: 0 8px 16px rgba(0, 140, 132, 0.14);
}

.btn-primary-compact:hover {
  background: linear-gradient(135deg, var(--accent-primary-dark), var(--accent-teal-dark));
}

.btn-primary-compact svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.btn-secondary:hover {
  background: var(--surface-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 49, 66, 0.32);
}

.modal-backdrop.open {
  display: flex;
}

.user-modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-dialog);
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-soft);
}

.profile-summary .avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  font-size: 16px;
}

.profile-summary-name {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
  padding: 16px 18px;
  color: var(--text-main);
  font-size: 12px;
}

.profile-grid dt {
  color: var(--text-muted);
}

.profile-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.user-modal .account-modal-actions {
  margin-top: 0;
  padding: 0 18px 18px;
}

.modal-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-eyebrow {
  margin: 0 0 2px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.error-detail-modal {
  width: min(100%, 680px);
}

.error-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.error-detail-grid div { min-width: 0; }
.error-detail-grid dt { color: var(--text-muted); font-size: 11px; }
.error-detail-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--text-main); font-size: 12px; font-weight: 600; }
.error-detail-section { padding: 16px 18px 0; }
.error-detail-section h3 { margin: 0 0 6px; color: var(--text-main); font-size: 12px; }
.error-detail-section p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.error-detail-section pre { margin: 0; padding: 10px; overflow: auto; color: var(--text-main); background: var(--surface-muted); border: 1px solid var(--border-soft); border-radius: 4px; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.error-detail-actions { margin: 0; padding: 18px; }
.error-detail-actions form { margin: 0; }
.error-ignore-button { color: var(--accent-danger); }
.error-resolution-history { padding-bottom: 2px; }
.error-resolution-entry { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-soft); color: var(--text-main); font-size: 12px; }
.error-resolution-entry span { color: var(--text-muted); font-size: 11px; text-align: right; }

.user-form {
  padding: 18px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.user-form-grid-single {
  grid-template-columns: 1fr;
}

.user-form-field {
  display: grid;
  gap: 6px;
}

[data-password-form] .user-form-field + .user-form-field {
  margin-top: 14px;
}

.user-form-field-wide {
  grid-column: 1 / -1;
}

.user-form-field span {
  color: var(--surface-strong);
  font-size: 13px;
  font-weight: 600;
}

.user-form-field input,
.user-form-field select {
  padding: 0 12px;
}

.user-form-field .remember-control input[type='checkbox'] {
  width: 16px;
  height: 16px;
  padding: 0;
}

.user-form-note {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.evaluation-queue-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border: 1px solid rgba(0, 140, 132, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.evaluation-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.7fr);
  gap: 20px;
  align-items: start;
}

body.evaluation-shell {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.app-layout[data-view="evaluation"],
.app-layout[data-view="monitoring-dev"] {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app-layout[data-view="evaluation"] .main-area,
.app-layout[data-view="monitoring-dev"] .main-area {
  min-height: 0;
}

.app-layout[data-view="evaluation"] .page-content,
.app-layout[data-view="monitoring-dev"] .page-content {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px;
}

.monitoring-dev-heading {
  min-width: 0;
}

.monitoring-dev-header {
  display: block;
}

.monitoring-dev-form {
  display: grid;
  grid-template-areas:
    "title user system"
    "uuid uuid submit";
  grid-template-columns: minmax(0, 1fr) minmax(112px, 120px) minmax(96px, 110px);
  align-items: flex-end;
  gap: 8px 10px;
}

.monitoring-dev-form .page-title {
  grid-area: title;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
}

.monitoring-dev-input {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.monitoring-dev-input-compact {
  grid-area: user;
}

.monitoring-dev-input-system {
  grid-area: system;
}

.monitoring-dev-input-uuid {
  grid-area: uuid;
  min-width: 0;
}

.monitoring-dev-form .btn-primary-compact {
  grid-area: submit;
  width: 100%;
}

.monitoring-dev-input select.input-control {
  appearance: auto;
}

.monitoring-dev-input .input-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  outline: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.monitoring-dev-input .input-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.12);
}

.monitoring-dev-status {
  margin-top: 6px;
}

.monitoring-dev-status.is-error {
  color: var(--accent-danger);
}

.evaluation-page .page-header {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.evaluation-page .evaluation-workspace {
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.evaluation-page .content-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.evaluation-page .strip-list {
  min-height: 0;
  flex: 1;
  align-content: start;
  overflow: auto;
}

.evaluation-page .strip-preview-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.evaluation-page .record-detail-section-top {
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-top: 0;
  border-bottom: 1px solid #e7eff1;
}

.evaluation-page .ecg-preview-frame {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.evaluation-page .ecg-row-list {
  min-height: 0;
  flex: 1;
  grid-auto-rows: 164px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.evaluation-page .preview-card-header {
  min-height: 62px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.evaluation-page .preview-title-block h2 {
  font-size: 14px;
}

.evaluation-page .preview-title-block p {
  margin-top: 3px;
  font-size: 10px;
}

.evaluation-page .strip-preview-body {
  padding: 10px 14px 12px;
}

.evaluation-page .preview-toolbar {
  gap: 8px;
  margin-bottom: 8px;
}

.evaluation-page .preview-record {
  gap: 2px;
}

.evaluation-page .preview-record > span {
  font-size: 9px;
}

.evaluation-page .preview-record strong {
  font-size: 11px;
}

.evaluation-page .preview-toolbar-tags {
  gap: 4px;
}

.evaluation-page .preview-tag {
  min-height: 22px;
  padding: 0 6px;
  font-size: 9px;
}

.evaluation-page .record-detail-section-top {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.evaluation-page .record-detail-section-top h3 {
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
}

.evaluation-page .record-detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
}

.evaluation-page .record-detail-grid div {
  gap: 2px;
}

.evaluation-page .record-detail-grid dt {
  font-size: 9px;
}

.evaluation-page .record-detail-grid dd {
  font-size: 11px;
}

.evaluation-page .rating-code-inline {
  min-width: 30px;
  height: 20px;
  padding: 0 5px;
  font-size: 9px;
}

.evaluation-page .ecg-preview-frame {
  padding: 10px 12px 12px;
}

.evaluation-page .ecg-frame-header {
  margin-bottom: 8px;
}

.evaluation-page .ecg-row-list {
  gap: 10px;
}

.evaluation-page .ecg-row {
  height: 164px;
  min-height: 164px;
  grid-template-rows: 14px 112px 30px;
  gap: 3px;
}

.evaluation-page .ecg-row-header {
  min-height: 14px;
}

.evaluation-page .ecg-row-plot {
  position: relative;
  height: 112px;
  min-height: 112px;
}

.evaluation-page .qrs-marker-track {
  height: 30px;
  min-height: 30px;
  align-items: flex-start;
  padding-top: 2px;
}

.evaluation-page .qrs-dot-lane {
  height: 26px;
}

.strip-list-card,
.strip-preview-card {
  min-width: 0;
}

[data-strip-preview-target] {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

[data-strip-preview-target] > .strip-preview-card {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

[data-strip-preview-target].is-loading {
  opacity: 0.58;
  pointer-events: none;
}

.monitoring-records-workspace {
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.62fr);
  align-items: stretch;
}

.monitoring-dev-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.62fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 20px;
}

.monitoring-dev-left-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.monitoring-dev-left-column .monitoring-dev-header {
  flex: 0 0 auto;
}

.monitoring-dev-left-column .monitoring-records-card {
  flex: 1 1 auto;
}

.monitoring-dev-layout > [data-strip-preview-target] {
  min-height: 0;
}

.monitoring-records-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.strip-list.monitoring-record-list {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
}

.monitoring-records-card .strip-pagination {
  flex: 0 0 auto;
  margin-top: auto;
}

.page-button.disabled {
  color: var(--text-faint);
  background: var(--surface-muted);
  border-color: var(--border-soft);
  cursor: not-allowed;
  opacity: 0.65;
}

.strip-list-header {
  min-height: 76px;
}

.strip-list-count {
  display: grid;
  min-width: 46px;
  height: 28px;
  place-items: center;
  padding: 0 8px;
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.monitoring-record-tabs {
  display: flex;
  align-items: end;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-soft);
}

.monitoring-record-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 9px 6px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.monitoring-record-tab:hover {
  color: var(--text-main);
}

.monitoring-record-tab.active {
  color: var(--accent-primary-dark);
  border-bottom-color: var(--accent-primary);
}

.monitoring-record-tab span {
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  color: inherit;
  background: var(--surface-muted);
  border-radius: 50%;
  font-size: 10px;
}

.monitoring-record-tab.active span {
  background: var(--accent-primary-soft);
}

.monitoring-record-tab:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.strip-list {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.strip-pagination {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--border-soft);
}

.strip-pagination-summary,
.strip-pagination-page {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.strip-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.page-size-control select {
  width: 60px;
  height: 30px;
  padding: 0 8px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  font: inherit;
  font-weight: 700;
}

.page-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border: 1px solid rgba(11, 114, 181, 0.16);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.page-button:hover:not(:disabled),
.page-button:focus-visible:not(:disabled) {
  background: #d8eef7;
  outline: none;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.page-button svg {
  width: 15px;
  height: 15px;
}

.strip-list-item {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 11px;
  color: var(--text-main);
  text-align: left;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

a.strip-list-item {
  text-decoration: none;
}

.strip-list-item:hover {
  background: var(--surface-muted);
  border-color: var(--border-soft);
}

.strip-list-item.active {
  background: #e5f3fb;
  border-color: #0b72b5;
  box-shadow: inset 5px 0 0 #0b72b5, 0 0 0 2px rgba(11, 114, 181, 0.24);
}

.strip-list-item.has-user-assessment:not(.has-severe-assessment) {
  background: #e9f8ef;
  border-color: rgba(34, 146, 83, 0.42);
  box-shadow: inset 5px 0 0 #35a866;
}

.strip-list-item.has-user-assessment:not(.has-severe-assessment):hover {
  background: #dcf4e6;
  border-color: rgba(34, 146, 83, 0.64);
}

.strip-list-item.has-user-assessment:not(.has-severe-assessment).active {
  background: #d7f1e2;
  border-color: #249557;
  box-shadow: inset 5px 0 0 #249557, 0 0 0 2px rgba(11, 114, 181, 0.32);
}

.strip-list-item.has-severe-assessment {
  background: #fff8f8;
  border-color: rgba(207, 46, 58, 0.26);
  box-shadow: inset 3px 0 0 rgba(207, 46, 58, 0.64);
}

.strip-list-item.has-severe-assessment:hover,
.strip-list-item.has-severe-assessment.active {
  background: #fff3f4;
  border-color: rgba(207, 46, 58, 0.44);
  box-shadow: inset 5px 0 0 var(--accent-danger);
}

.strip-list-item.has-severe-assessment.active {
  border-color: var(--accent-danger);
  box-shadow: inset 5px 0 0 var(--accent-danger), 0 0 0 2px rgba(11, 114, 181, 0.32);
}

.strip-list-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.strip-list-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.strip-list-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strip-list-title-row strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-list-title-row .status-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  font-size: 10px;
}

.rating-code,
.rating-code-inline {
  display: grid;
  min-width: 48px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border: 1px solid rgba(0, 140, 132, 0.18);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.rating-code-amber {
  color: var(--accent-amber);
  background: #fff7e6;
  border-color: rgba(183, 121, 31, 0.2);
}

.rating-code-danger {
  color: var(--accent-danger);
  background: #fff3f4;
  border-color: rgba(207, 46, 58, 0.2);
}

.rating-code-blue {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-color: rgba(11, 114, 181, 0.18);
}

.strip-list-rating-label {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-list-clinical {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.strip-list-clinical-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
}

.strip-list-clinical .status-badge {
  padding: 3px 7px;
  font-size: 10px;
  white-space: nowrap;
}

.strip-list-bpm {
  flex: 0 0 auto;
  color: var(--accent-primary-dark);
  font-size: 10px;
  font-weight: 800;
}

.strip-list-meta,
.strip-list-id {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.strip-list-id {
  color: var(--text-faint);
  font-size: 10px;
}

.ecg-mini {
  display: none;
  width: 100%;
  height: 36px;
  padding: 5px 0;
  background:
    linear-gradient(rgba(0, 140, 132, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 140, 132, 0.1) 1px, transparent 1px);
  background-size: 9px 9px;
  border: 1px solid #d6e8e7;
  border-radius: 4px;
}

.ecg-mini path {
  fill: none;
  stroke: var(--accent-teal-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.preview-card-header {
  display: flex;
  min-height: 92px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7eff1;
}

.preview-title-block {
  min-width: 0;
}

.preview-title-block .eyebrow {
  margin-bottom: 6px;
}

.preview-title-block h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.2;
}

.preview-title-block p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.preview-title-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 12px;
}

.preview-title-summary strong {
  color: var(--text-main);
  font-weight: 700;
}

.preview-title-summary .preview-meta-muted,
.preview-meta-device > span {
  color: var(--text-faint);
}

.preview-uuid-copy {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
}

.preview-uuid-copy [data-preview-uuid] {
  overflow-wrap: anywhere;
}

.preview-copy-button {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.preview-copy-button:hover,
.preview-copy-button:focus-visible {
  color: var(--accent-primary);
  background: var(--accent-primary-soft);
  outline: none;
}

.preview-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.preview-copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.preview-meta-device {
  color: var(--text-faint);
}

.preview-separator {
  padding: 0 5px;
  color: var(--text-faint);
}

.strip-preview-body {
  padding: 18px 20px 20px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.preview-record {
  display: grid;
  gap: 3px;
}

.preview-record > span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-record strong {
  color: var(--text-main);
  font-size: 12px;
}

.preview-rating-code {
  color: var(--accent-teal-dark);
  font-size: 11px;
  font-weight: 800;
}

.preview-toolbar-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.preview-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.clinical-assessment-panel {
  margin: 0 0 14px;
  padding: 13px 14px;
  background: #faffff;
  border: 1px solid #cfe5e3;
  border-radius: 6px;
}

.clinical-assessment-header {
  display: flex;
  min-height: 32px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.clinical-assessment-header h3,
.clinical-assessment-group h4 {
  margin: 0;
  color: var(--text-main);
}

.clinical-assessment-header h3 {
  font-size: 13px;
}

.clinical-assessment-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.clinical-assessment-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.clinical-assessment-header .btn-primary-compact {
  flex: 0 0 auto;
}

.clinical-assessment-delete {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-danger);
  background: #fff3f4;
  border: 1px solid rgba(207, 46, 58, 0.28);
  border-radius: 4px;
  cursor: pointer;
}

.clinical-assessment-delete:hover,
.clinical-assessment-delete:focus-visible {
  background: #ffe6e9;
  border-color: rgba(207, 46, 58, 0.5);
  outline: none;
}

.clinical-assessment-delete:disabled {
  cursor: wait;
  opacity: 0.55;
}

.clinical-assessment-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.clinical-assessment-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 18px;
}

.clinical-assessment-group {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.clinical-assessment-group.is-full-width {
  width: 100%;
  flex: 0 0 100%;
}

.clinical-assessment-group:not(.is-full-width) {
  grid-template-columns: 104px max-content;
  flex: 0 0 auto;
}

.clinical-assessment-group:not(.is-full-width) .clinical-finding-list {
  flex-wrap: nowrap;
}

.clinical-assessment-group h4 {
  padding-top: 7px;
  font-size: 11px;
}

.clinical-finding-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.clinical-assessment-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-top: 13px;
}

.clinical-assessment-notes label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.clinical-assessment-notes input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.clinical-assessment-notes input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.12);
}

.clinical-assessment-actions {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: flex-end;
}

.clinical-assessment-actions .btn-primary-compact {
  min-height: 36px;
}

.clinical-assessment-actions .btn-primary-compact:disabled {
  color: #8a9ba1;
  background: #e4ecee;
  border-color: #d6e2e4;
  box-shadow: none;
  cursor: not-allowed;
}

.clinical-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.clinical-visibility-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-primary);
}

.clinical-visibility-toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.48;
}

.clinical-finding-toggle {
  min-height: 30px;
  padding: 0 9px;
  color: #5e7178;
  background: #ffffff;
  border: 1px solid #d6e2e4;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.clinical-finding-toggle:hover,
.clinical-finding-toggle:focus-visible {
  border-color: #82aca9;
  outline: none;
}

.clinical-finding-toggle.is-selected {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-color: rgba(11, 114, 181, 0.42);
}

.clinical-finding-toggle[data-clinical-finding="SR"].is-selected {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border-color: rgba(0, 140, 132, 0.38);
}

.clinical-finding-toggle[data-clinical-finding="SVES"].is-selected,
.clinical-finding-toggle[data-clinical-finding="SVES_BIGEMINY"].is-selected,
.clinical-finding-toggle[data-clinical-finding="SVES_TRIGEMINY"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC_COUPLET"].is-selected {
  color: #8a651e;
  background: #fff7e6;
  border-color: rgba(183, 121, 31, 0.4);
}

.clinical-finding-toggle[data-clinical-finding="AF"].is-selected,
.clinical-finding-toggle[data-clinical-finding="FLUTTER"].is-selected,
.clinical-finding-toggle[data-clinical-finding="VT"].is-selected,
.clinical-finding-toggle[data-clinical-finding="NSVT"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC_TRIPLET"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC_BIGEMINY"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC_TRIGEMINY"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PVC_POLYMORPHIC"].is-selected,
.clinical-finding-toggle[data-clinical-finding="AVB_II"].is-selected,
.clinical-finding-toggle[data-clinical-finding="AVB_III"].is-selected,
.clinical-finding-toggle[data-clinical-finding="PAUSE_GT_2S"].is-selected,
.clinical-finding-toggle[data-clinical-finding="SA_PAUSE"].is-selected {
  color: var(--accent-danger);
  background: #fff3f4;
  border-color: rgba(207, 46, 58, 0.4);
}

.clinical-finding-toggle[data-clinical-finding="NOISE"].is-selected {
  color: #55666d;
  background: #f2f5f5;
  border-color: #b9c7c9;
}

.clinical-finding-toggle.is-solver {
  color: #647c87;
  background: #f5f9fa;
  border-color: #b7cbd3;
  border-style: dashed;
  font-weight: 600;
}

.clinical-finding-toggle.is-selected.is-solver-match {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border-color: rgba(0, 140, 132, 0.5);
  border-style: solid;
  box-shadow: inset 0 0 0 1px rgba(0, 140, 132, 0.08);
}

.clinical-finding-toggle.is-selected.is-user-only {
  color: var(--accent-primary-dark);
  background: var(--accent-primary-soft);
  border-color: rgba(11, 114, 181, 0.52);
  border-style: solid;
}

.ecg-preview-frame {
  position: relative;
  min-height: 286px;
  overflow: hidden;
  padding: 16px 16px 28px 36px;
  background-color: #fbffff;
  background-image:
    linear-gradient(rgba(0, 140, 132, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 140, 132, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(11, 114, 181, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 114, 181, 0.05) 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px;
  border: 1px solid #cfe5e3;
  border-radius: 6px;
}

.ecg-large {
  display: block;
  width: 100%;
  height: 236px;
}

.ecg-baseline {
  fill: none;
  stroke: rgba(0, 140, 132, 0.14);
  stroke-width: 1;
}

.ecg-waveform {
  fill: none;
  stroke: #087c76;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.ecg-axis-labels,
.ecg-time-labels {
  position: absolute;
  display: flex;
  color: #73918f;
  font-size: 9px;
  pointer-events: none;
}

.ecg-axis-labels {
  inset: 18px auto 35px 8px;
  flex-direction: column;
  justify-content: space-between;
}

.ecg-time-labels {
  right: 16px;
  bottom: 9px;
  left: 36px;
  justify-content: space-between;
}

.ecg-preview-frame {
  min-height: 0;
  overflow: visible;
  padding: 14px 16px 16px;
  background: #fbffff;
  background-image: none;
}

.ecg-preview-frame > .ecg-axis-labels,
.ecg-preview-frame > .ecg-large,
.ecg-preview-frame > .ecg-time-labels {
  display: none;
}

.ecg-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ecg-frame-header-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px 6px;
}

.ecg-frame-header .preview-tag {
  min-height: 22px;
  padding: 0 6px;
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
}

.ecg-frame-header [data-ecg-row-count] {
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.ecg-row-list {
  display: grid;
  gap: 15px;
}

.ecg-row {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ecg-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
}

.ecg-row-plot {
  height: 112px;
  overflow: hidden;
  background:
    linear-gradient(rgba(0, 140, 132, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 140, 132, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(11, 114, 181, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 114, 181, 0.05) 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px;
  border: 1px solid #cfe5e3;
  border-radius: 5px;
}

.ecg-row-plot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ecg-row-baseline {
  fill: none;
  stroke: rgba(0, 140, 132, 0.18);
  stroke-width: 1;
}

.ecg-qrs-count {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(82, 142, 145, 0.9);
}

.ecg-row-waveform {
  fill: none;
  stroke: #087c76;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.qrs-marker-track {
  position: relative;
  min-height: 22px;
}

.qrs-track-label {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
  transform: translateY(-50%);
}

.qrs-dot-lane {
  position: relative;
  width: 100%;
  height: 20px;
}

.qrs-dot {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  padding: 0;
  background: var(--accent-primary);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(11, 114, 181, 0.35);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.qrs-dot:hover,
.qrs-dot:focus-visible {
  background: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0, 140, 132, 0.18);
  outline: none;
  transform: translate(-50%, -50%) scale(1.2);
}

.qrs-dot::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  display: none;
  width: max-content;
  max-width: 220px;
  padding: 7px 9px;
  color: #ffffff;
  background: var(--surface-strong);
  border-radius: 5px;
  box-shadow: var(--shadow-panel);
  content: attr(data-average-label);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
  transform: translateX(-50%);
}

.qrs-dot:hover::after,
.qrs-dot:focus-visible::after {
  display: block;
}

.evaluation-page .qrs-dot {
  top: 6px;
  width: 7px;
  height: 7px;
  background: #82abad;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(82, 142, 145, 0.18);
  cursor: default;
  opacity: 0.72;
}

.evaluation-page .qrs-dot:hover,
.evaluation-page .qrs-dot:focus-visible {
  background: #82abad;
  box-shadow: 0 0 0 1px rgba(82, 142, 145, 0.18);
  outline: none;
  transform: translate(-50%, -50%);
}

.evaluation-page .qrs-dot:hover::after,
.evaluation-page .qrs-dot:focus-visible::after {
  display: none;
}

.evaluation-page .qrs-dot.in-average {
  width: 9px;
  height: 9px;
  background: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(0, 140, 132, 0.2);
  opacity: 1;
}

.evaluation-page .qrs-dot-kes {
  color: var(--accent-danger);
  background: var(--accent-danger);
  box-shadow: 0 0 0 1px rgba(207, 46, 58, 0.3);
  opacity: 0.95;
}

.evaluation-page .qrs-dot-sves {
  color: var(--accent-amber);
  background: var(--accent-amber);
  box-shadow: 0 0 0 1px rgba(183, 121, 31, 0.3);
  opacity: 0.95;
}

.evaluation-page .qrs-dot-sr_fis {
  color: var(--accent-primary);
  background: var(--accent-primary);
  box-shadow: 0 0 0 1px rgba(11, 114, 181, 0.3);
  opacity: 0.95;
}

.evaluation-page .qrs-dot-kes.in-average,
.evaluation-page .qrs-dot-sves.in-average,
.evaluation-page .qrs-dot-sr_fis.in-average {
  box-shadow: 0 0 0 2px currentColor;
}

.qrs-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.qrs-guide {
  position: absolute;
  top: 24px;
  bottom: 10px;
  width: 1px;
  background: var(--accent-teal);
  opacity: 0;
  transition: opacity 120ms ease;
}

.qrs-guide.in-average {
  opacity: 0.42;
}

.qrs-guide-kes {
  background: var(--accent-danger);
}

.qrs-guide-sves {
  background: var(--accent-amber);
}

.qrs-guide-sr_fis {
  background: var(--accent-primary);
}

.qrs-interval {
  position: absolute;
  top: 14px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.ecg-hover-summary {
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 3;
  display: none;
  max-width: calc(100% - 14px);
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 140, 132, 0.28);
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(15, 49, 66, 0.12);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ecg-row-plot:hover .ecg-hover-summary {
  display: flex;
}

.document-preview {
  height: min(72vh, 980px);
  min-height: 560px;
  overflow: hidden;
  background: #f4f8f9;
  border: 1px solid var(--border-soft, #d9e7ea);
  border-radius: 6px;
}

.document-record-summary {
  margin: 0 0 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid #e7eff1;
}

.document-record-summary dl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
}

.document-record-summary dl > div {
  min-width: 150px;
}

.document-record-summary dt {
  margin-bottom: 2px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.document-record-summary dd {
  margin: 0;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
}

.document-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.edf-window-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--surface-muted, #f4f8f9);
  border: 1px solid var(--border-soft, #d9e7ea);
  border-radius: 6px;
}

.edf-window-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #1a2e32);
  letter-spacing: 0.02em;
}

.edf-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--surface-base, #fff);
  border: 1px solid var(--border-soft, #d9e7ea);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #3a5a62);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.edf-nav-btn:hover:not(:disabled) {
  background: #e8f4f3;
  border-color: #a3cece;
}

.edf-nav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.edf-hr-panel {
  margin: 0 0 18px;
  padding: 14px 16px 12px;
  background: #fbffff;
  border: 1px solid #c9dde0;
  border-radius: 6px;
}

.edf-hr-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.edf-hr-panel h3 {
  margin: 0;
  color: var(--text-main, #0f3142);
  font-size: 13px;
}

.edf-hr-panel p {
  margin: 3px 0 0;
  color: var(--text-muted, #5d7281);
  font-size: 11px;
}

.edf-hr-readout {
  color: var(--accent-teal-dark, #006d67);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.edf-hr-plot {
  display: block;
  width: calc(100% - 44px);
  height: 190px;
  margin: 0 0 0 34px;
  padding: 0;
  overflow: visible;
  background: #fff;
  border: 1px solid #d5e8e7;
  border-radius: 5px;
  cursor: crosshair;
}

.edf-hr-plot:focus-visible {
  outline: 3px solid rgba(11, 114, 181, 0.24);
  outline-offset: 3px;
}

.edf-hr-plot svg {
  display: block;
  width: 100%;
  height: 100%;
}

.edf-hr-grid {
  fill: none;
  stroke: rgba(0, 140, 132, 0.14);
  stroke-width: 1;
}

.edf-hr-point {
  fill: #0b72b5;
  opacity: 0.25;
}

.edf-hr-selection {
  stroke: #cf2e3a;
  stroke-dasharray: 5 4;
  stroke-width: 2;
}

.edf-hr-axis {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  margin: 5px 0 0 34px;
  color: var(--text-faint, #8497a4);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.edf-hr-axis span:nth-child(2) {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  transform: translateY(-190px);
}

.edf-hr-axis span:nth-child(3) {
  grid-column: 1;
}

.edf-hr-axis span:nth-child(4) {
  grid-column: 2;
  text-align: right;
}

.edf-hr-days {
  display: flex;
  width: calc(100% - 44px);
  height: 25px;
  margin: 5px 0 0 34px;
  overflow: hidden;
  border: 1px solid #bdd7df;
  border-radius: 3px;
}

.edf-hr-day {
  display: grid;
  align-items: center;
  min-width: 0;
  flex-grow: 0;
  flex-shrink: 0;
  overflow: hidden;
  container-type: inline-size;
  color: #365261;
  background: #d9edf6;
  border-right: 1px solid #9bc6d4;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.edf-hr-day:nth-child(even) {
  background: #dcefe8;
}

.edf-hr-day:last-child {
  border-right: 0;
}

.edf-hr-day-compact {
  display: none;
}

@container (max-width: 110px) {
  .edf-hr-day-full {
    display: none;
  }

  .edf-hr-day-compact {
    display: grid;
    line-height: 11px;
  }
}

@media (prefers-color-scheme: dark) {
  .edf-window-nav {
    background: #1c2e31;
    border-color: #2e484d;
  }
  .edf-nav-btn {
    background: #223438;
    border-color: #2e484d;
    color: #b0cdd1;
  }
  .edf-nav-btn:hover:not(:disabled) {
    background: #2a4246;
    border-color: #4a7880;
  }

  .edf-hr-panel {
    background: #1c2e31;
    border-color: #2e484d;
  }

  .edf-hr-plot {
    background: #223438;
    border-color: #2e484d;
  }

  .edf-hr-days {
    border-color: #456971;
  }

  .edf-hr-day {
    color: #d9edf1;
    background: #254b58;
    border-color: #456971;
  }

  .edf-hr-day:nth-child(even) {
    background: #285247;
  }
}

.record-detail-section {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid #e7eff1;
}

.record-detail-section h3 {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 13px;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px 18px;
  margin: 0;
}

.record-detail-grid div {
  display: grid;
  gap: 4px;
}

.record-detail-grid dt {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.record-detail-grid dd {
  margin: 0;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
}

.preview-rating-value {
  display: inline-flex !important;
  align-items: center;
  gap: 7px !important;
  flex-wrap: wrap;
}

.rating-code-inline {
  width: auto;
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  font-size: 10px;
}

.quality-value {
  display: inline-flex !important;
  align-items: center;
  gap: 6px !important;
}

.quality-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-teal);
  border-radius: 50%;
}

@media (max-width: 820px) {
  .auth-frame {
    max-width: 430px;
  }

  .login-dialog {
    min-height: auto;
  }

  .app-layout {
    display: block;
  }

  .app-layout.sidebar-collapsed .sidebar {
    display: none;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
  }

  .nav-section-label,
  .sidebar-footer {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    border-left: 0;
    border-radius: var(--radius-control);
    padding: 0 12px;
  }

  .topbar,
  .page-header,
  .toolbar-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    padding: 14px 16px;
  }

  .topbar-leading,
  .topbar-actions {
    width: 100%;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .page-content {
    padding: 16px;
  }

  .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .evaluation-workspace {
    grid-template-columns: 1fr;
  }

  .monitoring-records-workspace {
    grid-template-columns: 1fr;
  }

  .app-layout[data-view="evaluation"],
  .app-layout[data-view="monitoring-dev"] {
    height: 100vh;
  }

  .app-layout[data-view="evaluation"] .main-area,
  .app-layout[data-view="monitoring-dev"] .main-area {
    height: 100%;
  }

  .evaluation-page .evaluation-workspace {
    grid-template-rows: minmax(220px, 0.85fr) minmax(0, 1.15fr);
  }

  .page-header-meta {
    padding-top: 0;
  }

  .monitoring-dev-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .select-control {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 14px;
  }

  .login-dialog {
    padding: 24px 20px 20px;
  }

  .dialog-header {
    padding: 26px 0 18px;
  }

  .dialog-header h2 {
    font-size: 23px;
  }

  .form-row,
  .dialog-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-stat-grid {
    grid-template-columns: 1fr;
  }

  .page-header-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .content-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-card-header {
    flex-direction: column;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-toolbar-tags {
    justify-content: flex-start;
  }

  .record-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-filter,
  .queue-filter .select-control {
    width: 100%;
  }

  .data-table {
    min-width: 680px;
  }

  .error-log-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .error-detail-grid {
    grid-template-columns: 1fr;
  }

  .content-card {
    overflow-x: auto;
  }

  .strip-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .strip-pagination-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .user-menu {
    right: -4px;
  }

  .evaluation-page .record-detail-section-top {
    display: block;
  }

  .evaluation-page .record-detail-section-top h3 {
    margin-bottom: 6px;
  }

  .evaluation-page .record-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoring-dev-form {
    display: flex;
    max-width: none;
    align-items: stretch;
    flex-direction: column;
  }

  .monitoring-dev-input {
    min-width: 0;
  }

  .monitoring-dev-form .btn-primary-compact {
    width: 100%;
  }

  .user-form-grid {
    grid-template-columns: 1fr;
  }

  .user-form-actions {
    flex-direction: column-reverse;
  }

.btn-primary-compact,
.btn-secondary {
    width: 100%;
  }
}

/* Functional Blade views keep the mockup visual system while retaining server behavior. */
.auth-demo-note {
  margin: 14px 0 0;
  padding: 9px 10px;
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border: 1px solid rgba(0, 140, 132, 0.18);
  border-radius: var(--radius-control);
  font-size: 11px;
  line-height: 1.4;
}

.auth-success {
  color: var(--accent-teal-dark);
  background: var(--accent-teal-soft);
  border-color: rgba(0, 140, 132, 0.28);
}

.flash {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
  font-size: 12px;
}

.flash.success { color: var(--accent-teal-dark); background: var(--accent-teal-soft); }
.flash.error { color: var(--accent-danger); background: #fff3f4; border-color: rgba(207, 46, 58, 0.28); }
.flash ul { margin: 0; padding-left: 18px; }

.template-notice {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: var(--accent-amber);
  background: #fff7e6;
  border: 1px solid rgba(183, 121, 31, 0.24);
  border-radius: var(--radius-control);
}

.template-notice > span { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; color: var(--accent-amber); }
.template-notice > span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.template-notice strong, .template-notice small { display: block; }
.template-notice strong { font-size: 12px; }
.template-notice small { margin-top: 3px; color: #8f6c2d; font-size: 11px; }

.btn { border: 0; text-decoration: none; }
.btn.primary { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; color: #fff; background: linear-gradient(135deg, var(--accent-primary), var(--accent-teal)); border: 1px solid var(--accent-primary); border-radius: var(--radius-control); box-shadow: 0 8px 16px rgba(0, 140, 132, 0.14); cursor: pointer; font-size: 13px; font-weight: 700; }
.btn.primary:hover { background: linear-gradient(135deg, var(--accent-primary-dark), var(--accent-teal-dark)); }
.btn.secondary, .btn.danger { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: var(--radius-control); cursor: pointer; font-size: 13px; font-weight: 700; }
.btn.secondary { color: var(--text-main); background: #fff; border: 1px solid var(--border-soft); }
.btn.secondary:hover { background: var(--surface-muted); }
.btn.danger { color: var(--accent-danger); background: #fff; border: 1px solid rgba(207, 46, 58, 0.28); }

.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; min-width: 680px; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 13px 16px; border-bottom: 1px solid #e7eff1; font-size: 13px; text-align: left; vertical-align: middle; }
.table-wrap th { color: var(--text-muted); background: #f7fbfb; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.table-wrap tbody tr:hover { background: #f8fcfc; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

.card-header { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e7eff1; }
.card-header h2 { margin: 0; color: var(--text-main); font-size: 15px; font-weight: 700; }
.card-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 14px; background: var(--surface-muted); border-bottom: 1px solid var(--border-soft); }
.toolbar form { display: flex; flex: 1; align-items: center; gap: 10px; }
.toolbar input, .toolbar select { height: 38px; padding: 0 12px; color: var(--text-main); background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-control); outline: none; }
.toolbar input { min-width: 240px; flex: 1; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.12); }
.muted { color: var(--text-muted); }
.block { display: block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.pagination { display: flex; justify-content: flex-end; padding: 14px 16px 0; color: var(--text-muted); font-size: 12px; }
.pagination nav { display: flex; gap: 6px; }
.pagination a, .pagination span { display: inline-flex; min-width: 30px; height: 30px; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-control); }
.pagination .active span { color: #fff; background: var(--accent-primary); border-color: var(--accent-primary); }

.dev-page .page-content { min-height: 0; }
.dev-heading { min-width: 0; flex: 1 1 auto; }
.dev-form { display: flex; max-width: 640px; align-items: flex-end; gap: 10px; margin-top: 10px; }
.dev-form label { display: flex; min-width: 300px; flex: 1; flex-direction: column; gap: 5px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.dev-form input { width: 100%; height: 38px; padding: 0 12px; color: var(--text-main); background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-control); outline: none; font-size: 12px; text-transform: none; }
.dev-form input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(11, 114, 181, 0.12); }
.dev-summary { display: grid; min-width: 430px; max-width: 620px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 14px; padding: 10px 12px; background: var(--surface-muted); border: 1px solid var(--border-soft); border-radius: var(--radius-control); }
.dev-summary div { min-width: 0; }
.dev-summary dt { overflow: hidden; color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: 0.03em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.dev-summary dd { overflow: hidden; margin: 2px 0 0; color: var(--text-main); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dev-grid { display: grid; min-height: 0; grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.65fr); gap: 20px; align-items: stretch; }
.dev-grid .content-card { min-width: 0; overflow: hidden; }
.strip-list { display: grid; gap: 4px; max-height: 560px; overflow: auto; padding: 8px; }
.strip-row { display: grid; gap: 4px; padding: 11px; color: var(--text-main); border: 1px solid transparent; border-radius: 7px; text-decoration: none; }
.strip-row:hover { background: var(--surface-muted); border-color: var(--border-soft); text-decoration: none; }
.strip-row.active { background: #f1faf9; border-color: rgba(0, 140, 132, 0.42); box-shadow: inset 3px 0 0 var(--accent-teal); }
.strip-row strong { font-size: 12px; }
.strip-row small, .record-meta { color: var(--text-muted); font-size: 10px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; padding: 0 18px; }
.detail-meta div { display: grid; gap: 4px; }
.detail-meta dt { color: var(--text-faint); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.detail-meta dd { margin: 0; color: var(--text-main); font-size: 12px; font-weight: 600; }
.waveform-box { margin: 0 18px; padding: 12px; background: #f7fbfb; border: 1px solid var(--border-soft); border-radius: var(--radius-control); }
.waveform-box svg { display: block; width: 100%; height: 220px; background: repeating-linear-gradient(0deg, rgba(0, 140, 132, 0.08) 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, rgba(0, 140, 132, 0.08) 0 1px, transparent 1px 22px); }
.qrs-row { display: flex; min-height: 22px; align-items: center; justify-content: space-around; padding-top: 6px; }
.qrs-row span { width: 7px; height: 7px; background: var(--accent-teal); border-radius: 50%; opacity: 0.55; }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 18px 18px; }
.analysis-grid div { display: grid; gap: 4px; padding: 10px; background: var(--surface-muted); border: 1px solid var(--border-soft); border-radius: var(--radius-control); }
.analysis-grid small { color: var(--text-faint); font-size: 10px; }
.analysis-grid strong { color: var(--text-main); font-size: 15px; }
.section-gap { margin: 18px 18px 10px; color: var(--text-main); font-size: 13px; }
.empty-state { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 8px; padding: 30px; color: var(--text-muted); text-align: center; }
.empty-state > span { color: var(--accent-teal); font-size: 28px; }
.empty-state h2, .empty-state p { margin: 0; }

@media (max-width: 820px) {
  .dev-grid { grid-template-columns: 1fr; }
  .dev-summary { width: 100%; min-width: 0; max-width: none; }
  .dev-form { max-width: none; align-items: stretch; flex-direction: column; }
  .dev-form label { min-width: 0; }
  .dev-form .btn-primary-compact, .dev-form .btn.primary { width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar form { width: 100%; }
}

@media (max-width: 520px) {
  .toolbar form { align-items: stretch; flex-direction: column; }
  .toolbar input { min-width: 0; width: 100%; }
  .detail-meta, .analysis-grid { grid-template-columns: 1fr; }
  .clinical-assessment-header { align-items: stretch; flex-direction: column; }
  .clinical-assessment-header .btn-primary-compact { width: 100%; }
  .clinical-assessment-group { grid-template-columns: 1fr; gap: 4px; }
  .clinical-assessment-group h4 { padding-top: 0; }
  .clinical-assessment-notes { grid-template-columns: 1fr; }
  .clinical-assessment-actions { align-items: stretch; flex-direction: column; gap: 8px; }
  .clinical-assessment-actions .btn-primary-compact { width: 100%; }
}

@media (max-width: 520px) and (orientation: portrait) {
  .monitoring-dev-layout { grid-template-columns: 1fr; }
}
