:root {
  --bg: #0d0c17;
  --bg-deep: #05050c;
  --panel: #050c1c;
  --panel-soft: rgba(9, 19, 37, 0.9);
  --line: rgba(116, 151, 227, 0.18);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.92);
  --accent: #3aa8ff;
  --accent-soft: #74c1ff;
  --highlight: #7fa63a;
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(58, 168, 255, 0.05), transparent 26%),
    radial-gradient(circle at top right, rgba(167, 212, 77, 0.03), transparent 16%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
}

.dashboard {
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  padding: 62px 22px 18px;
}

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1440px, calc(100% - 44px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(116, 151, 227, 0.12);
  background: rgba(5, 12, 28, 0.9);
  backdrop-filter: blur(14px);
  z-index: 40;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secure-vault-control {
  position: relative;
  z-index: 31;
}

.settings-control {
  position: relative;
  z-index: 31;
}

.secure-vault-btn {
  width: auto;
  height: 30px;
  min-width: 118px;
  padding: 5px 16px;
  border-radius: 9px;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-btn {
  width: auto;
  height: 30px;
  min-width: 84px;
  padding: 5px 14px;
  border-radius: 9px;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.secure-vault-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  overflow-y: auto;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(7, 16, 33, 0.98);
  box-shadow: var(--shadow);
  z-index: 45;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  overflow-y: auto;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(7, 16, 33, 0.98);
  box-shadow: var(--shadow);
  z-index: 45;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-wordmark {
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22rem;
}

.brand-logo {
  width: 35px;
  height: 35px;
  filter: drop-shadow(0 8px 16px rgba(58, 168, 255, 0.16));
}

.app-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
  font-size: 0.59rem;
  font-weight: 600;
}

.app-action-btn:hover:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.24);
  background: rgba(255, 255, 255, 0.09);
}

.assistant-fab {
  position: fixed;
  z-index: 61;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 124px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(116, 151, 227, 0.18);
  background: linear-gradient(180deg, rgba(26, 49, 92, 0.88), rgba(17, 30, 58, 0.94));
  color: var(--text);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.assistant-fab:hover:not(:disabled) {
  transform: none;
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.32);
  background: linear-gradient(180deg, rgba(34, 65, 121, 0.92), rgba(19, 35, 68, 0.98));
}

.assistant-fab.is-dragging {
  cursor: grabbing;
  transition: none;
}

.assistant-fab[data-corner="top-left"] {
  top: 78px;
  left: 22px;
}

.assistant-fab[data-corner="top-right"] {
  top: 78px;
  right: 22px;
}

.assistant-fab[data-corner="bottom-left"] {
  bottom: 22px;
  left: 22px;
}

.assistant-fab[data-corner="bottom-right"] {
  right: 22px;
  bottom: 22px;
}

.assistant-fab[aria-expanded="true"] {
  border-color: rgba(116, 193, 255, 0.52);
  background: linear-gradient(180deg, rgba(36, 79, 149, 0.96), rgba(24, 45, 84, 0.98));
}

.info-control {
  position: relative;
  z-index: 31;
}

.info-control.has-update .app-action-btn {
  border-color: rgba(255, 124, 124, 0.56);
  background: linear-gradient(180deg, rgba(148, 36, 36, 0.96), rgba(86, 18, 18, 0.98));
  box-shadow: 0 0 0 0 rgba(255, 94, 94, 0.42);
  animation: info-attention-pulse 1.8s ease-in-out infinite;
}

.info-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 300px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(7, 16, 33, 0.96);
  color: var(--text);
  font-size: 0.61rem;
  line-height: 1.45;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 40;
}

.info-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.info-tooltip-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(223, 234, 255, 0.9);
}

.info-tooltip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 9px;
  background: rgba(255, 87, 87, 0.18);
  border: 1px solid rgba(255, 107, 107, 0.32);
  color: rgba(255, 197, 197, 0.98);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-tooltip-badge.is-hidden {
  display: none;
}

.info-tooltip-line + .info-tooltip-line {
  margin-top: 2px;
}

.info-tooltip-section-label {
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(166, 187, 224, 0.78);
}

.info-tooltip-commits {
  display: grid;
  gap: 7px;
}

.info-tooltip-commit {
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(112, 144, 212, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.info-tooltip-commit-hash {
  display: inline-block;
  margin-bottom: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.58rem;
  color: rgba(137, 204, 255, 0.94);
}

.info-tooltip-commit-message {
  color: rgba(232, 238, 250, 0.92);
  line-height: 1.45;
}

.info-control:hover .info-tooltip,
.info-control:focus-within .info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@keyframes info-attention-pulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(255, 94, 94, 0.36);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 8px rgba(255, 94, 94, 0);
  }
}

.topbar {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 26px;
  border: 1px solid rgba(133, 161, 207, 0.12);
  background: rgba(18, 22, 38, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.assistant-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 12, 0.54);
  backdrop-filter: blur(8px);
  z-index: 55;
}

.assistant-drawer {
  position: fixed;
  width: min(500px, calc(100vw - 32px));
  height: calc(100vh - 78px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(116, 151, 227, 0.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(58, 168, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(7, 16, 33, 0.98), rgba(4, 10, 24, 0.99));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  z-index: 60;
  overflow: hidden;
}

.assistant-drawer[data-corner="top-right"] {
  top: 60px;
  right: 22px;
}

.assistant-drawer[data-corner="top-left"] {
  top: 60px;
  left: 22px;
}

.assistant-drawer[data-corner="bottom-right"] {
  right: 22px;
  bottom: 22px;
}

.assistant-drawer[data-corner="bottom-left"] {
  left: 22px;
  bottom: 22px;
}

.assistant-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(116, 151, 227, 0.12);
}

.assistant-drawer-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.15;
}

.assistant-drawer-subtitle {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  line-height: 1.55;
}

.assistant-close-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.assistant-close-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.12);
}

.assistant-drawer-body {
  overflow-y: auto;
  padding: 18px 22px 22px;
  display: grid;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
}

.assistant-drawer-body::-webkit-scrollbar {
  width: 10px;
}

.assistant-drawer-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  background-clip: padding-box;
}

.assistant-hero,
.assistant-section,
.assistant-response-card,
.assistant-error-option {
  border: 1px solid rgba(116, 151, 227, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.assistant-hero,
.assistant-section {
  border-radius: 18px;
  padding: 16px;
}

.assistant-runtime-panel {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.assistant-runtime-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-runtime-label {
  color: rgba(169, 217, 255, 0.92);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}

.assistant-runtime-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.assistant-runtime-badge.is-idle,
.assistant-runtime-badge.is-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.assistant-runtime-badge.is-checking-cache,
.assistant-runtime-badge.is-loading-runtime,
.assistant-runtime-badge.is-loading-model,
.assistant-runtime-badge.is-warming-model {
  background: rgba(242, 210, 106, 0.16);
  color: #f2d26a;
}

.assistant-runtime-badge.is-ready {
  background: rgba(78, 173, 91, 0.18);
  color: #7fe38d;
}

.assistant-runtime-badge.is-error {
  background: rgba(255, 157, 157, 0.16);
  color: #ffb0b0;
}

.assistant-runtime-copy {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6rem;
  line-height: 1.5;
}

.assistant-runtime-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.52rem;
}

.assistant-section p,
.assistant-response-card {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.63rem;
  line-height: 1.55;
}

.assistant-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.assistant-section-heading h3 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.assistant-response-card {
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.assistant-response-label {
  color: rgba(169, 217, 255, 0.92);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}

.assistant-response-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.61rem;
  line-height: 1.55;
}
.assistant-response-copy code {
  color: #d6efff;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.58rem;
}

.assistant-error-list {
  display: grid;
  gap: 10px;
}

.assistant-error-option {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

.assistant-error-option:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.055);
}

.assistant-error-option.is-selected {
  border-color: rgba(116, 193, 255, 0.44);
  background: linear-gradient(180deg, rgba(24, 51, 92, 0.54), rgba(13, 24, 46, 0.78));
}

.assistant-error-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assistant-error-title {
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
}

.assistant-error-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.assistant-error-tag.is-warning {
  background: rgba(242, 210, 106, 0.16);
  color: #f2d26a;
}

.assistant-error-tag.is-danger {
  background: rgba(255, 157, 157, 0.14);
  color: #ffb0b0;
}

.assistant-error-tag.is-info {
  background: rgba(116, 193, 255, 0.14);
  color: #a9d9ff;
}

.assistant-error-message {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.6rem;
  line-height: 1.45;
}

.assistant-error-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.52rem;
}

.assistant-response-section {
  display: grid;
  gap: 6px;
}

.assistant-response-list {
  display: grid;
  gap: 6px;
}

.assistant-response-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.assistant-response-bullet {
  color: #7fc5ff;
  font-size: 0.76rem;
  line-height: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-name {
  font-size: 1.07rem;
  letter-spacing: 0.32rem;
  font-weight: 600;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.68rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(0, 2.25fr) minmax(280px, 1.35fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

.workspace.is-image-viewer-mode {
  grid-template-columns: minmax(0, 2.5fr) minmax(320px, 1.15fr);
}

.workspace.is-image-viewer-mode .control-card,
.workspace.is-image-viewer-mode .pipeline-card {
  display: none;
}

.workspace.is-image-viewer-mode .image-viewer-card {
  display: flex;
}

.workspace.is-phi-vault-mode {
  grid-template-columns: minmax(240px, 1.05fr) minmax(0, 2.55fr);
}

.workspace.is-phi-vault-mode .pipeline-card,
.workspace.is-phi-vault-mode .error-card,
.workspace.is-phi-vault-mode .image-viewer-card {
  display: none;
}

.workspace.is-phi-vault-mode .phi-vault-card {
  display: flex;
}

.image-viewer-card {
  display: none;
  min-width: 0;
  flex: 1 1 auto;
}

.phi-vault-card {
  display: none;
  min-width: 0;
}

.image-viewer-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.image-viewer-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.image-viewer-tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.image-viewer-tab-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(116, 193, 255, 0.18);
  background: rgba(116, 193, 255, 0.06);
  color: rgba(228, 241, 255, 0.82);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  box-shadow: none;
}

.image-viewer-tab-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(116, 193, 255, 0.12);
}

.image-viewer-tab-btn[aria-selected="true"] {
  border-color: rgba(242, 210, 106, 0.4);
  background: linear-gradient(180deg, rgba(96, 78, 22, 0.82), rgba(62, 48, 12, 0.92));
  color: #f6dea0;
}

.image-viewer-tab-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.image-viewer-tab-panel.is-hidden {
  display: none;
}

.image-viewer-main {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.image-viewer-main.is-ecg-layout {
  grid-template-columns: minmax(0, 1fr);
}

.image-viewer-main.is-ecg-layout .image-viewer-series-panel {
  display: none;
}

.image-viewer-series-panel,
.image-viewer-footer {
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.image-viewer-series-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
}

.image-viewer-panel-title {
  margin-bottom: 0;
  color: rgba(169, 217, 255, 0.92);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.image-viewer-series-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
}

.image-viewer-series-list::-webkit-scrollbar {
  width: 10px;
}

.image-viewer-series-list::-webkit-scrollbar-track {
  background: transparent;
}

.image-viewer-series-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  background-clip: padding-box;
}

.image-viewer-series-row {
  display: inline-flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(40, 52, 92, 0.28);
  color: var(--text);
  position: relative;
}

.image-viewer-series-btn {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  gap: 0;
  min-height: 0;
  padding: 0;
  text-align: left;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.image-viewer-series-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: transparent;
}

.image-viewer-series-row.is-active {
  border-color: rgba(242, 210, 106, 0.96);
  background: rgba(120, 97, 28, 0.22);
  box-shadow: 0 0 0 1px rgba(242, 210, 106, 0.28);
}

.image-viewer-series-row.is-excluded {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(40, 52, 92, 0.28);
}

.image-viewer-series-toggle {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  align-self: flex-start;
}

.image-viewer-series-toggle:hover:not(:disabled) {
  transform: none;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.image-viewer-series-toggle.is-excluded {
  border-color: rgba(255, 126, 126, 0.34);
  background: rgba(119, 27, 27, 0.78);
  color: #ffd6d6;
}

.image-viewer-series-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.image-viewer-series-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.image-viewer-series-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  border: 1px solid rgba(255, 126, 126, 0.34);
  background: rgb(119, 27, 27);
  color: #ffd6d6;
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  line-height: 1;
  margin-top: 2px;
}

.image-viewer-series-title {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
}

.image-viewer-series-meta {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.49rem;
  line-height: 1.35;
}

.image-viewer-stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.image-viewer-stage {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background:
    radial-gradient(circle at top left, rgba(58, 168, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(6, 18, 38, 0.98), rgba(4, 10, 22, 0.98));
  display: block;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.image-viewer-stage.is-ecg-active {
  border-color: rgba(116, 193, 255, 0.24);
  background:
    radial-gradient(circle at top left, rgba(58, 168, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(7, 19, 39, 0.98), rgba(5, 13, 29, 0.99));
}

.image-viewer-stage.is-ecg-focused {
  box-shadow: inset 0 0 0 1px rgba(246, 222, 160, 0.14);
}

.image-viewer-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  border: 1px solid rgba(116, 193, 255, 0.24);
  background: rgba(7, 17, 34, 0.82);
  color: rgba(228, 241, 255, 0.96);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  font-size: 0.6rem;
  line-height: 1;
}

.image-viewer-stage-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.image-viewer-ecg-controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.image-viewer-ecg-control-stack {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.image-viewer-play-btn:hover:not(:disabled) {
  background: rgba(16, 33, 66, 0.9);
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.32);
}

.image-viewer-play-btn[aria-pressed="true"] {
  border-color: rgba(116, 193, 255, 0.4);
  background: linear-gradient(180deg, rgba(28, 71, 135, 0.96), rgba(17, 42, 82, 0.96));
  color: #f3f9ff;
}

.image-viewer-mask-btn {
  min-width: 72px;
}

.image-viewer-mask-btn[aria-pressed="true"] {
  border-color: rgba(255, 174, 92, 0.55);
  background: linear-gradient(180deg, rgba(165, 84, 18, 0.96), rgba(105, 47, 9, 0.96));
}

.image-viewer-blank-btn {
  min-width: 92px;
}

.image-viewer-reset-btn {
  min-width: 68px;
}

.image-viewer-apply-series-btn {
  min-width: 110px;
  border-color: rgba(255, 174, 92, 0.28);
  color: #ffd3a0;
}

.image-viewer-apply-series-btn:not(:disabled) {
  border-color: rgba(255, 174, 92, 0.55);
  background: linear-gradient(180deg, rgba(165, 84, 18, 0.96), rgba(105, 47, 9, 0.96));
  color: #fff5ea;
}

.image-viewer-apply-series-btn.is-ready {
  border-color: rgba(255, 174, 92, 0.55);
  background: linear-gradient(180deg, rgba(165, 84, 18, 0.96), rgba(105, 47, 9, 0.96));
  color: #fff5ea;
}

.image-viewer-mask-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.image-viewer-mask-toggle-label {
  padding: 0 10px;
}

.image-viewer-mask-toggle-btn {
  min-width: 58px;
  padding: 0 11px;
  box-shadow: none;
  backdrop-filter: none;
}

.image-viewer-mask-toggle-btn[aria-pressed="true"] {
  border-color: rgba(255, 174, 92, 0.55);
  background: linear-gradient(180deg, rgba(165, 84, 18, 0.96), rgba(105, 47, 9, 0.96));
  color: #fff5ea;
}

.image-viewer-ecg-btn {
  min-width: 74px;
}

.image-viewer-ecg-split-btn {
  display: inline-grid;
  grid-template-columns: 32px auto 32px;
  align-items: center;
  min-width: 122px;
  padding: 0;
  overflow: hidden;
}

.image-viewer-ecg-split-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  font-size: 0.82rem;
  line-height: 1;
}

.image-viewer-ecg-split-side-minus {
  border-right: 1px solid rgba(116, 193, 255, 0.18);
}

.image-viewer-ecg-split-side-plus {
  border-left: 1px solid rgba(116, 193, 255, 0.18);
}

.image-viewer-ecg-split-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 8px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.03rem;
}

.image-viewer-ecg-reset-btn {
  min-width: 94px;
  border-color: rgba(246, 222, 160, 0.28);
  color: #f6dea0;
}

.image-viewer-ecg-cursor-label {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(116, 193, 255, 0.22);
  background: rgba(7, 17, 34, 0.82);
  color: rgba(228, 241, 255, 0.88);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  font-size: 0.56rem;
  line-height: 1.45;
  text-align: left;
  margin-bottom: 10px;
}

.image-viewer-mask-size-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
  min-width: 210px;
  max-width: 360px;
  margin-left: auto;
  min-height: 28px;
}

.image-viewer-mask-size-slider {
  flex: 1 1 160px;
  min-width: 120px;
  margin: 0;
}

.image-viewer-mask-size-control .image-viewer-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .image-viewer-stage {
    padding: 20px 16px;
  }

  .image-viewer-stage-controls-row {
    gap: 8px;
  }

  .image-viewer-play-btn {
    padding: 0 12px;
    min-height: 32px;
    font-size: 0.58rem;
  }

  .image-viewer-ecg-cursor-label {
    min-height: 32px;
    margin-bottom: 8px;
  }
}

.image-viewer-canvas {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  border-radius: 10px;
  display: block;
  cursor: default;
}

.image-viewer-canvas.is-ecg {
  cursor: crosshair;
}

.image-viewer-canvas.is-ecg-dragging {
  cursor: grabbing;
}

.image-viewer-canvas.is-hidden {
  display: none;
}

.image-viewer-canvas.is-masking {
  cursor: crosshair;
}

.image-viewer-advanced-host {
  position: absolute;
  inset: 12px;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.image-viewer-advanced-host canvas {
  max-width: 100%;
  max-height: 100%;
}

.image-viewer-advanced-overlay {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  touch-action: none;
}

.image-viewer-advanced-overlay.is-hidden {
  display: none;
}

.image-viewer-advanced-overlay.is-interactive {
  pointer-events: auto;
  cursor: none;
}

.image-viewer-advanced-overlay-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: calc(100% - 8px);
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 174, 92, 0.32);
  background: rgba(124, 69, 16, 0.84);
  color: #ffd3a0;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.025rem;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.image-viewer-advanced-overlay-badge.is-hidden {
  display: none;
}

.image-viewer-source-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: calc(100% - 8px);
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid rgba(242, 210, 106, 0.28);
  background: rgba(96, 78, 22, 0.82);
  color: #f6dea0;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.025rem;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.image-viewer-mask-saving-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: auto;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(6, 13, 25, 0.76), rgba(6, 13, 25, 0.88)),
    radial-gradient(circle at top, rgba(255, 174, 92, 0.18), transparent 48%);
  backdrop-filter: blur(10px);
}

.image-viewer-mask-saving-overlay.is-hidden {
  display: none;
}

.image-viewer-mask-saving-overlay-copy {
  display: grid;
  gap: 8px;
  min-width: min(320px, calc(100% - 32px));
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 174, 92, 0.24);
  background: rgba(9, 18, 34, 0.88);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.image-viewer-mask-saving-overlay-title {
  color: #ffd3a0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
}

.image-viewer-mask-saving-overlay-meta {
  color: rgba(228, 241, 255, 0.82);
  font-size: 0.62rem;
  line-height: 1.45;
}

.image-viewer-source-badge.is-original {
  border-color: rgba(242, 210, 106, 0.28);
  background: rgba(96, 78, 22, 0.82);
  color: #f6dea0;
}

.image-viewer-source-badge.is-filtered {
  border-color: rgba(248, 188, 96, 0.34);
  background: rgba(120, 78, 18, 0.84);
  color: #ffd7a1;
}

.image-viewer-source-badge.is-processed {
  border-color: rgba(109, 203, 162, 0.34);
  background: rgba(21, 91, 64, 0.84);
  color: #bbf3d7;
}

.image-viewer-placeholder {
  width: min(520px, 100%);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  position: absolute;
  inset: 24px;
  align-content: center;
}

.image-viewer-placeholder h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.image-viewer-placeholder p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  line-height: 1.6;
}

.image-viewer-placeholder-badge,
.image-viewer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(116, 193, 255, 0.18);
  background: rgba(116, 193, 255, 0.08);
  color: #a9d9ff;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.image-viewer-metadata-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.image-viewer-metadata-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.image-viewer-metadata-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.63rem;
  line-height: 1.5;
}

.image-viewer-metadata-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.image-viewer-metadata-search {
  flex: 1 1 auto;
  padding-right: 12px;
}

.image-viewer-metadata-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.image-viewer-metadata-status-copy {
  min-height: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.58rem;
  line-height: 1.45;
}

.image-viewer-metadata-status-copy.is-error {
  color: #ffd6d6;
}

.image-viewer-metadata-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(116, 151, 227, 0.14);
  background: rgba(6, 12, 24, 0.62);
}

.image-viewer-metadata-content.progress-table-wrap {
  min-height: 0;
  max-height: none;
  height: 100%;
  margin-bottom: 0;
}

.image-viewer-metadata-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.62rem;
}

.image-viewer-metadata-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(116, 151, 227, 0.14);
  background: rgba(7, 16, 33, 0.98);
  color: rgba(169, 217, 255, 0.92);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  text-align: left;
}

.image-viewer-metadata-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(116, 151, 227, 0.1);
  vertical-align: top;
  line-height: 1.45;
}

.image-viewer-metadata-table tbody tr:last-child td {
  border-bottom: 0;
}

.image-viewer-metadata-key {
  width: 20%;
  color: rgba(169, 217, 255, 0.9);
  font-weight: 600;
}

.image-viewer-metadata-value,
.image-viewer-metadata-original,
.image-viewer-metadata-status,
.image-viewer-metadata-editability {
  color: rgba(255, 255, 255, 0.86);
  word-break: break-word;
}

.image-viewer-metadata-original {
  color: rgba(255, 255, 255, 0.62);
}

.image-viewer-metadata-status,
.image-viewer-metadata-editability {
  white-space: nowrap;
}

.image-viewer-metadata-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid rgba(116, 193, 255, 0.18);
  background: rgba(116, 193, 255, 0.08);
  color: rgba(228, 241, 255, 0.88);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
}

.image-viewer-metadata-badge.is-changed {
  border-color: rgba(109, 203, 162, 0.34);
  background: rgba(21, 91, 64, 0.84);
  color: #bbf3d7;
}

.image-viewer-metadata-badge.is-unchanged {
  border-color: rgba(242, 210, 106, 0.28);
  background: rgba(96, 78, 22, 0.82);
  color: #f6dea0;
}

.image-viewer-metadata-badge.is-generated {
  border-color: rgba(116, 193, 255, 0.28);
  background: rgba(18, 55, 104, 0.82);
  color: #a9d9ff;
}

.image-viewer-metadata-badge.is-readonly {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
}

.image-viewer-metadata-input {
  width: 100%;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(116, 193, 255, 0.2);
  background: rgba(7, 16, 33, 0.88);
  color: var(--text);
  font: inherit;
}

.image-viewer-metadata-input:focus-visible {
  outline: 2px solid rgba(116, 193, 255, 0.28);
  outline-offset: 2px;
}

.image-viewer-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.image-viewer-toolbar-row {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.image-viewer-transport-row {
  justify-content: center;
}

.image-viewer-transport-btn {
  min-width: 42px;
  padding: 0 12px;
}

#imageViewerPlayPauseBtn.image-viewer-transport-btn {
  min-width: 132px;
}

.image-viewer-slider {
  flex: 1 1 220px;
  accent-color: #74c1ff;
  height: 16px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.image-viewer-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(116, 193, 255, 0.4), rgba(116, 193, 255, 0.18));
}

.image-viewer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 999px;
  border: 1px solid rgba(190, 227, 255, 0.78);
  background: #dff3ff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.image-viewer-slider::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(116, 193, 255, 0.4), rgba(116, 193, 255, 0.18));
}

.image-viewer-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(190, 227, 255, 0.78);
  border-radius: 999px;
  background: #dff3ff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.image-viewer-slider::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(116, 193, 255, 0.48);
}

.image-viewer-subheading {
  color: #f6dea0;
}

.image-viewer-subheading-promoted {
  margin: 0;
  color: #f6dea0;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02rem;
  line-height: 1.4;
  text-transform: none;
}

.card-heading.image-viewer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.image-viewer-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.image-viewer-empty-state {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.6rem;
  line-height: 1.5;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(8, 16, 31, 0.98), rgba(5, 12, 28, 0.99)),
    radial-gradient(circle at top right, rgba(58, 168, 255, 0.07), transparent 28%);
  box-shadow: var(--shadow);
}

.control-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
}

.card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 151, 227, 0.22), transparent);
}

.card-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.pipeline-heading,
.status-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.6rem;
  font-weight: 600;
}

.input-subheading {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.62rem;
  line-height: 1.4;
}

.card-heading h2 {
  margin: 0;
  font-weight: 500;
  line-height: 1.08;
}

.upload-panel {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: 9px;
  border: 1px dashed #3C4976;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  justify-items: center;
  text-align: center;
}

.upload-panel-shell {
  position: relative;
}

.upload-panel.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.upload-panel input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.upload-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.upload-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.single-study-lookup-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  pointer-events: none;
}

.single-study-lookup-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(116, 193, 255, 0.28);
  background: rgba(7, 18, 38, 0.94);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
  text-align: left;
}

.single-study-lookup-label {
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(166, 214, 255, 0.9);
}

.single-study-lookup-input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

.single-study-lookup-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.single-study-lookup-input:focus-visible {
  outline: 2px solid rgba(116, 193, 255, 0.28);
  outline-offset: 2px;
}

.single-study-lookup-hint {
  font-size: 0.52rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
}

.lookup-panel {
  background: rgba(255, 255, 255, 0.02);
  gap: 8px;
  padding: 16px 18px;
}

.lookup-icon {
  background: rgba(127, 166, 58, 0.08);
  width: 42px;
  height: 42px;
}

.lookup-icon svg {
  width: 22px;
  height: 22px;
}

.lookup-section {
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  gap: 12px;
}

.lookup-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lookup-toggle-btn {
  align-self: start;
  justify-self: start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.lookup-toggle-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
}

.lookup-section-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.reconciliation-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 14px;
  border: 0;
  background: transparent;
}

.settings-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 14px;
  border: 0;
  background: transparent;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.18);
  background:
    radial-gradient(circle at top right, rgba(58, 168, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(10, 22, 42, 0.92), rgba(7, 14, 28, 0.96));
}

.settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-heading span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
}

.settings-copy,
.settings-footer {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.58rem;
  line-height: 1.55;
}

.settings-whitelist-policy,
.settings-whitelist-group-copy {
  color: rgba(210, 230, 255, 0.78);
  font-size: 0.56rem;
  line-height: 1.5;
}

.settings-whitelist-policy {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(116, 151, 227, 0.18);
  background: rgba(12, 24, 44, 0.5);
}

.settings-whitelist-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-number-input {
  padding-right: 12px;
}

.settings-action-buttons > button {
  flex: 1 1 160px;
}

.settings-whitelist-groups {
  display: grid;
  gap: 12px;
}

.settings-whitelist-group {
  display: grid;
  gap: 8px;
}

.settings-whitelist-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-whitelist-group-heading span:first-child {
  color: rgba(242, 247, 255, 0.95);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.settings-whitelist-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(116, 193, 255, 0.24);
  color: rgba(166, 214, 255, 0.92);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(9, 25, 48, 0.72);
}

.settings-whitelist-list {
  display: grid;
  gap: 10px;
}

.settings-whitelist-empty {
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(116, 151, 227, 0.24);
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.57rem;
  line-height: 1.45;
}

.settings-whitelist-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.settings-whitelist-entry-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-whitelist-entry-title {
  min-width: 0;
  color: rgba(242, 247, 255, 0.96);
  font-size: 0.6rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.settings-whitelist-entry-meta {
  color: rgba(166, 214, 255, 0.82);
  font-size: 0.54rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-whitelist-remove-btn {
  flex: 0 0 auto;
  min-width: 92px;
}

.reconciliation-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.59rem;
  line-height: 1.55;
}

.reconciliation-field {
  display: grid;
  gap: 8px;
}

.reconciliation-label {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 10px 40px 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 12, 24, 0.88);
  color: var(--text);
  font: inherit;
}

.password-input::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.password-input:focus-visible {
  outline: 2px solid rgba(116, 193, 255, 0.28);
  outline-offset: 2px;
}

.password-toggle-btn,
.reconciliation-save-btn {
  box-shadow: none;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 999px;
  border: 0;
  background: transparent;
}

.password-toggle-btn:hover:not(:disabled),
.reconciliation-save-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
}

.passphrase-strength {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.passphrase-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.passphrase-strength-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.passphrase-strength-copy {
  display: grid;
  gap: 3px;
}

.passphrase-strength-copy strong {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.94);
}

.passphrase-strength-copy span {
  font-size: 0.54rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.passphrase-strength.is-weak {
  border-color: rgba(255, 122, 122, 0.22);
  background: rgba(120, 22, 22, 0.12);
}

.passphrase-strength.is-fair {
  border-color: rgba(255, 188, 84, 0.24);
  background: rgba(99, 62, 8, 0.14);
}

.passphrase-strength.is-strong {
  border-color: rgba(116, 193, 255, 0.24);
  background: rgba(25, 63, 112, 0.14);
}

.passphrase-strength.is-excellent {
  border-color: rgba(157, 219, 120, 0.26);
  background: rgba(33, 73, 23, 0.15);
}

.passphrase-strength[data-score="1"] .passphrase-strength-bar:nth-child(-n+1) {
  background: #f06a6a;
}

.passphrase-strength[data-score="2"] .passphrase-strength-bar:nth-child(-n+2) {
  background: #e1a24c;
}

.passphrase-strength[data-score="3"] .passphrase-strength-bar:nth-child(-n+3) {
  background: #4bb6ff;
}

.passphrase-strength[data-score="4"] .passphrase-strength-bar:nth-child(-n+4) {
  background: #8fcd64;
}

.secure-strategy-list {
  display: grid;
  gap: 12px;
}

.secure-strategy-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(116, 151, 227, 0.18);
  background:
    linear-gradient(180deg, rgba(10, 22, 42, 0.92), rgba(7, 14, 28, 0.96));
}

.secure-strategy-card-lookup {
  border-color: rgba(157, 219, 120, 0.34);
  background:
    radial-gradient(circle at top right, rgba(127, 166, 58, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(18, 31, 18, 0.94), rgba(8, 16, 12, 0.97));
}

.secure-strategy-card-file {
  border-color: rgba(116, 193, 255, 0.3);
  background:
    radial-gradient(circle at top right, rgba(58, 168, 255, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(13, 25, 47, 0.95), rgba(7, 14, 28, 0.98));
}

.secure-strategy-card-browser {
  border-color: rgba(255, 140, 140, 0.36);
  background:
    radial-gradient(circle at top right, rgba(176, 52, 52, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(42, 15, 20, 0.95), rgba(24, 9, 12, 0.98));
}

.secure-strategy-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.secure-strategy-heading span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
}

.secure-strategy-copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.58rem;
  line-height: 1.55;
}

.secure-vault-lookup-panel {
  gap: 8px;
  padding: 18px 16px;
  border-style: dashed;
}

.reconciliation-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.reconciliation-action-buttons > button {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.reconciliation-session-actions > button {
  flex-basis: 100%;
}

.reconciliation-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.reconciliation-loaded-notice {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(116, 193, 255, 0.24);
  background: rgba(28, 63, 112, 0.22);
  color: rgba(229, 241, 255, 0.96);
  font-size: 0.57rem;
  line-height: 1.45;
}

.reconciliation-loaded-notice.is-hidden {
  display: none;
}

.reconciliation-loaded-notice strong {
  font-size: 0.54rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(166, 214, 255, 0.92);
}

.reconciliation-loaded-notice span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#reconciliationSummary {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

#reconciliationSummary .study-chip {
  min-width: 0;
  max-width: 100%;
}

#reconciliationSummary .study-chip-copy,
#reconciliationSummary .study-chip-label-row,
#reconciliationSummary .study-chip-label,
#reconciliationSummary .study-chip-note {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#reconciliationSummary .study-chip-label {
  white-space: normal;
}

.reconciliation-save-btn {
  justify-self: start;
  background: rgba(58, 168, 255, 0.16);
  border: 1px solid rgba(116, 193, 255, 0.32);
}

.reconciliation-save-btn-danger {
  background: rgba(171, 39, 39, 0.22);
  border: 1px solid rgba(255, 122, 122, 0.42);
  color: rgba(255, 222, 222, 0.98);
}

.reconciliation-save-btn-danger:hover:not(:disabled) {
  background: rgba(186, 49, 49, 0.3);
}

.reconciliation-warning {
  color: rgba(255, 184, 184, 0.9);
  font-size: 0.56rem;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .secure-strategy-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

.phi-vault-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

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

.phi-vault-search {
  max-width: 420px;
}

.phi-vault-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.phi-vault-table td {
  vertical-align: top;
}

.upload-title {
  font-size: 0.69rem;
  font-weight: 600;
}

.upload-dropcopy {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.55;
}

.upload-selection {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(116, 151, 227, 0.16);
  background: rgba(40, 52, 92, 0.2);
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.upload-selection-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-content: flex-start;
  font-size: 0.58rem;
  gap: 10px;
  margin-top: 12px;
  min-height: 120px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
  color: var(--muted);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
  position: relative;
}

#selectionSummary {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

#lookupSummary {
  min-height: 46px;
  max-height: 64px;
  margin-top: 0;
}

#reconciliationSummary {
  min-height: 46px;
  max-height: 96px;
  margin-top: 0;
}

.study-chip {
  display: inline-flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(40, 52, 92, 0.28);
  color: var(--text);
  font-size: 0.58rem;
  line-height: 1.2;
}

.study-chip-toggle {
  display: inline-flex;
  align-items: flex-start;
  margin-top: 2px;
}

.study-chip.is-processed {
  border-color: rgba(112, 186, 109, 0.46);
  background: rgba(48, 88, 58, 0.18);
}

.study-chip.is-reviewing {
  border-color: rgba(242, 210, 106, 0.96);
  background: rgba(120, 97, 28, 0.22);
  box-shadow: 0 0 0 1px rgba(242, 210, 106, 0.28);
}

.study-chip.is-scanning {
  animation: study-chip-pulse 1.6s ease-in-out infinite;
}

.study-chip-copy {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.study-chip-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.study-chip-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-chip-note {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.53rem;
  line-height: 1.3;
}

.study-chip-review-badge {
  align-self: start;
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 9px;
  background: rgba(242, 210, 106, 0.18);
  color: #f2d26a;
  font-size: 0.47rem;
  font-weight: 700;
  letter-spacing: 0.02rem;
  text-transform: uppercase;
}

.study-chip-status {
  flex: 0 0 auto;
  color: #74d66f;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.study-chip-checkbox {
  appearance: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  position: relative;
}

.study-chip-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid rgba(255, 255, 255, 0.96);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.study-chip-checkbox:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.32);
  outline-offset: 2px;
}

.study-chip-remove {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
  font-size: 0.66rem;
  line-height: 1;
  aspect-ratio: 1 / 1;
}

.study-chip-remove:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.14);
}

@keyframes study-chip-pulse {
  0%,
  100% {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(40, 52, 92, 0.28);
    box-shadow: 0 0 0 0 rgba(58, 168, 255, 0);
  }
  50% {
    border-color: rgba(116, 193, 255, 0.38);
    background: rgba(52, 75, 120, 0.34);
    box-shadow: 0 0 0 1px rgba(58, 168, 255, 0.12);
  }
}

.selection-empty {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 0.58rem;
}

.upload-panel.dragover {
  border-color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.panel-actions {
  margin-top: 16px;
  justify-content: flex-start;
}

.pipeline-card .panel-actions {
  margin-top: auto;
  padding-top: 16px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: #4EAD5B;
  box-shadow: 0 14px 24px rgba(127, 166, 58, 0.18);
  font-size: 0.68rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  position: relative;
  overflow: hidden;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 28px rgba(127, 166, 58, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button.is-attention {
  animation: completion-btn-pulse 1.9s ease-in-out infinite;
}

button.is-attention::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.02) 36%, rgba(255, 255, 255, 0.26) 48%, rgba(255, 255, 255, 0.02) 60%, transparent 100%);
  transform: translateX(-140%);
  animation: completion-btn-sparkle 2.6s ease-in-out infinite;
  pointer-events: none;
}

button.is-busy {
  opacity: 0.92;
  cursor: progress;
  box-shadow: 0 16px 28px rgba(127, 166, 58, 0.22);
}

button.is-busy::before {
  content: "";
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin-right: 8px;
  vertical-align: -0.08em;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: rgba(255, 255, 255, 0.96);
  animation: button-spinner 0.8s linear infinite;
}

@keyframes completion-btn-pulse {
  0%,
  100% {
    box-shadow: 0 14px 24px rgba(127, 166, 58, 0.18), 0 0 0 0 rgba(127, 166, 58, 0);
  }
  50% {
    box-shadow: 0 18px 28px rgba(127, 166, 58, 0.26), 0 0 0 1px rgba(183, 222, 119, 0.2);
  }
}

@keyframes completion-btn-sparkle {
  0%,
  70%,
  100% {
    transform: translateX(-140%);
    opacity: 0;
  }
  20%,
  45% {
    opacity: 1;
  }
  55% {
    transform: translateX(140%);
    opacity: 0;
  }
}

@keyframes button-spinner {
  to {
    transform: rotate(360deg);
  }
}

.is-hidden {
  display: none !important;
}

#cancelBtn {
  color: var(--text);
  background: linear-gradient(180deg, rgba(87, 118, 206, 0.88), rgba(62, 89, 167, 0.92));
  box-shadow: 0 14px 24px rgba(84, 107, 191, 0.2);
}

.log-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  border: 1px solid rgba(116, 151, 227, 0.18);
  background: rgba(42, 54, 92, 0.5);
  color: var(--muted);
  padding: 8px 14px;
  font-size: 0.62rem;
}

#progress-container {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 118px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.idle-manta-wrap {
  position: absolute;
  inset: 18px 18px auto 18px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.idle-manta {
  width: 124px;
  height: 124px;
  opacity: 0.92;
  filter: drop-shadow(0 16px 28px rgba(58, 168, 255, 0.2));
}

.error-log-body {
  display: grid;
  grid-template-rows: minmax(0, 240px) minmax(0, 1fr) auto;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.error-log-body.is-review-summary-collapsed {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.review-summary-wrap {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(116, 151, 227, 0.16);
}

.review-summary-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.review-summary-wrap .section-heading {
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: 0;
}

.review-summary-toggle-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.review-summary-toggle-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: transparent;
  color: var(--text);
}

.review-summary-toggle-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.error-log-body.is-review-summary-collapsed .review-summary-toggle-caret {
  transform: rotate(0deg);
}

.review-summary-wrap .progress-table-wrap {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  max-height: none;
  margin-bottom: 0;
}

.error-log-body.is-review-summary-collapsed .review-summary-wrap {
  height: auto;
  padding-bottom: 6px;
  overflow: visible;
}

.error-log-body.is-review-summary-collapsed .review-summary-wrap .progress-table-wrap {
  display: none;
}

.error-log-body.is-review-summary-collapsed .review-summary-heading {
  margin-bottom: 0;
}

.review-pane {
  display: block;
}

.review-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding-top: 10px;
}

.review-pane.is-hidden {
  display: none;
}

.review-nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
  width: 100%;
  min-width: 0;
}

.review-nav-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.review-nav-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.1);
}

.review-study-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  margin-bottom: 0;
  border-radius: 999px;
  border: 1px solid rgba(242, 210, 106, 0.38);
  background: rgba(242, 210, 106, 0.14);
  color: #f2d26a;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02rem;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-study-status {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.study-review-inline-note {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.64rem;
  line-height: 1.4;
  text-align: center;
  max-width: 38rem;
}

.review-study-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.review-table-wrap {
  min-height: 0;
  max-height: none;
  overflow: auto;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  padding: 8px 0 0;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
  position: relative;
}

.review-table-wrap {
  display: grid;
  gap: 12px;
}

.review-table-wrap > table,
.review-table-wrap > .review-status-block,
.review-table-wrap > .study-status-section {
  width: 100%;
  min-width: 100%;
}

.review-empty-state {
  color: var(--muted);
  font-size: 0.6rem;
  text-align: center;
}

.review-metadata-table td {
  white-space: normal;
  vertical-align: top;
}

.review-metadata-table th,
.review-metadata-table td,
.review-identity-table th,
.review-identity-table td {
  padding: 3px 8px;
}

.review-identity-table td:first-child {
  width: 35%;
}

.review-identity-table td:last-child {
  width: 65%;
}

.sensitive-value {
  display: inline-block;
  min-width: 84px;
  margin-right: 8px;
  letter-spacing: 0.08rem;
}

.eye-toggle-btn {
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.64rem;
  line-height: 1;
}

.eye-toggle-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  color: var(--text);
}

.study-status-section {
  display: grid;
  gap: 10px;
}

.review-status-block {
  display: grid;
  min-width: 0;
  overflow-x: hidden;
}

.study-status-section-heading {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
}

.study-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.56rem;
}

.study-status-table th,
.study-status-table td {
  padding: 6px 8px;
  text-align: left;
}

.study-status-table th:last-child,
.study-status-table td:last-child {
  text-align: right;
}

.study-status-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.03);
}

.study-status-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.study-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.02rem;
}

.study-status-badge.is-success {
  background: rgba(78, 173, 91, 0.22);
  color: #7fe38d;
}

.study-status-badge.is-warning {
  background: rgba(214, 173, 79, 0.18);
  color: #f2d26a;
}

.study-status-badge.is-danger {
  background: rgba(210, 84, 84, 0.18);
  color: #ff9d9d;
}

.study-review-issues {
  display: grid;
  margin-top: 10px;
  min-width: 0;
  width: 100%;
}

.study-review-issues[disabled] {
  pointer-events: none;
}

.study-review-issues-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.02rem;
  cursor: pointer;
  list-style: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-review-issues-summary::-webkit-details-marker {
  display: none;
}

.study-review-issues-summary.is-empty {
  color: rgba(255, 255, 255, 0.6);
}

.study-review-issues-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  transition: transform 0.18s ease;
}

.study-review-issues[open] .study-review-issues-caret {
  transform: rotate(90deg);
}

.study-review-issues-title {
  color: inherit;
}

.study-review-issues-count {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.5rem;
}

.study-review-issues-body {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 6px;
}

.study-review-issues-body::-webkit-scrollbar {
  width: 8px;
}

.study-review-issues-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9px;
}

.study-review-issues-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.study-review-issue-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.study-review-issue-group-title {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
}

.study-review-issue-group-title.is-error {
  color: #ff9d9d;
}

.study-review-issue-group-title.is-skip {
  color: #7fe38d;
}

.study-review-issue {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
  width: 100%;
}

.report-card-actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(116, 151, 227, 0.16);
}

.viewer-mode-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(116, 193, 255, 0.22);
  background: rgba(18, 47, 86, 0.84);
  color: #d6efff;
  box-shadow: none;
  white-space: nowrap;
}

.viewer-mode-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: rgba(30, 66, 118, 0.94);
}

.viewer-mode-btn[aria-pressed="true"] {
  border-color: rgba(242, 210, 106, 0.42);
  background: rgba(110, 88, 26, 0.44);
  color: #f6dea0;
}

.viewer-mode-btn.is-danger {
  border-color: rgba(255, 122, 122, 0.34);
  background: rgba(102, 32, 32, 0.86);
  color: #ffd0d0;
}

.viewer-mode-btn.is-danger:hover:not(:disabled) {
  background: rgba(130, 40, 40, 0.94);
}

.viewer-mode-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}

.viewer-mode-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.review-action-btn {
  min-height: 30px;
  padding: 0 11px;
  border-color: rgba(255, 255, 255, 0.34);
  background: transparent;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.56rem;
  letter-spacing: 0.03rem;
}

.study-linkage-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.study-linkage-panel.is-pending {
  border-color: rgba(242, 210, 106, 0.28);
  background: rgba(133, 101, 24, 0.14);
}

.study-linkage-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.study-linkage-copy {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.58rem;
  line-height: 1.5;
}

.study-linkage-grid {
  display: grid;
  gap: 8px;
}

.study-linkage-row {
  display: grid;
  gap: 2px;
}

.study-linkage-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.5rem;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
}

.study-linkage-value {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.62rem;
  overflow-wrap: anywhere;
}

.review-linkage-actions {
  justify-content: flex-start;
}

.study-ocr-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(116, 193, 255, 0.18);
  border-radius: 12px;
  background: rgba(15, 40, 68, 0.34);
}

.study-ocr-panel.is-flagged {
  border-color: rgba(242, 210, 106, 0.26);
  background: rgba(97, 73, 18, 0.14);
}

.study-ocr-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.study-ocr-copy,
.study-ocr-progress,
.study-ocr-warning,
.study-ocr-finding-meta {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.57rem;
  line-height: 1.5;
}

.study-ocr-warnings,
.study-ocr-findings {
  display: grid;
  gap: 8px;
}

.study-ocr-warning,
.study-ocr-finding {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.study-ocr-finding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.study-ocr-finding-label {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.6rem;
  font-weight: 600;
}

.study-ocr-finding-text {
  color: #fff1b8;
  font-family: "SFMono-Regular", "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.6rem;
  overflow-wrap: anywhere;
}

.study-ocr-box-map {
  position: relative;
  width: min(160px, 100%);
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 20px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 20px
    );
  overflow: hidden;
}

.study-ocr-box-map-rect {
  position: absolute;
  border: 2px solid rgba(255, 212, 97, 0.95);
  background: rgba(255, 212, 97, 0.16);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(13, 19, 31, 0.42);
}

.study-ocr-actions {
  justify-content: flex-start;
}

.review-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.review-action-btn[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.review-action-btn.is-excluded,
.review-action-btn.is-excluded[aria-pressed="true"] {
  border-color: rgba(255, 126, 126, 0.34);
  background: rgba(119, 27, 27, 0.78);
  color: #ffd6d6;
}

.log-storage {
  display: none;
}

.study-review-issue.is-error {
  border-left: 2px solid rgba(255, 157, 157, 0.9);
}

.study-review-issue.is-skip {
  border-left: 2px solid rgba(242, 210, 106, 0.9);
}

.study-review-issue.is-success {
  border-left: 2px solid rgba(127, 227, 141, 0.9);
}

.study-review-issue-type {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-review-issue-message {
  color: var(--text);
  font-size: 0.56rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.pipeline-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.68rem;
}

#progress {
  width: 100%;
  height: 16px;
  border: 1px solid rgba(116, 151, 227, 0.12);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: block;
}

#progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

#progress::-webkit-progress-value {
  background: linear-gradient(90deg, #050c1c, #37608D);
  border-radius: 999px;
}

#progress::-moz-progress-bar {
  background: linear-gradient(90deg, #050c1c, #37608D);
  border-radius: 999px;
}

.progress-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 2px 6px;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

.progress-meta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-status {
  margin: 12px 2px 6px;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03rem;
  text-align: center;
}

.section-heading {
  margin: 14px 0 10px;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04rem;
}

.pipeline-tables-wrap > .section-heading:first-child {
  margin-top: 4px;
}

.progress-table-wrap {
  min-height: 132px;
  max-height: 132px;
  overflow: auto;
  margin-bottom: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
  position: relative;
}

.pipeline-tables-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-bottom: 16px;
  padding-right: 4px;
  background: rgba(8, 16, 31, 0.9);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.88) transparent;
  position: relative;
  isolation: isolate;
}

.pipeline-tables-wrap::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 52px;
  margin-bottom: -52px;
  background:
    linear-gradient(180deg, rgba(8, 16, 31, 0.99), rgba(8, 16, 31, 0.94)),
    rgba(8, 16, 31, 0.98);
  pointer-events: none;
  z-index: 1;
}

.upload-selection-list.is-scrollable,
.review-table-wrap.is-scrollable,
.progress-table-wrap.is-scrollable,
#progress-container .pipeline-tables-wrap.is-scrollable,
#log.is-scrollable {
  box-shadow:
    inset 0 10px 10px -12px rgba(255, 255, 255, 0.22),
    inset 0 -12px 12px -14px rgba(255, 255, 255, 0.22);
}

.upload-selection-list,
.review-table-wrap,
.progress-table-wrap,
.pipeline-tables-wrap,
#log {
  position: relative;
}

.upload-selection-list.has-scroll-cue::after,
.review-table-wrap.has-scroll-cue::after,
.progress-table-wrap.has-scroll-cue::after,
.pipeline-tables-wrap.has-scroll-cue::after,
#log.has-scroll-cue::after {
  content: "⌄";
  position: sticky;
  left: 50%;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: calc(50% - 11px);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(8, 16, 31, 0.94), rgba(8, 16, 31, 0.8)),
    rgba(8, 16, 31, 0.88);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.24),
    inset 0 0 0 1px rgba(116, 151, 227, 0.16);
  color: rgba(229, 238, 255, 0.92);
  font-size: 0.78rem;
  line-height: 1;
  pointer-events: none;
  z-index: 4;
  opacity: 0.92;
}

.pipeline-card .progress-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.quarantine-section {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(116, 151, 227, 0.14);
}

.quarantine-section-heading {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 0 8px;
  padding: 9px 0 8px;
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(8, 16, 31, 0.98), rgba(8, 16, 31, 0.92)),
    rgba(8, 16, 31, 0.96);
  box-shadow: 0 1px 0 rgba(116, 151, 227, 0.14);
  backdrop-filter: blur(8px);
}

.quarantine-section-heading::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(8, 16, 31, 0.96);
  pointer-events: none;
}

#quarantineTable {
  table-layout: fixed;
}

#quarantineTable thead th {
  top: 42px;
}

#quarantineTable th:nth-child(1),
#quarantineTable td:nth-child(1) {
  width: 14%;
}

#quarantineTable th:nth-child(2),
#quarantineTable td:nth-child(2) {
  width: 14%;
}

#quarantineTable th:nth-child(3),
#quarantineTable td:nth-child(3) {
  width: 14%;
}

#quarantineTable th:nth-child(4),
#quarantineTable td:nth-child(4) {
  width: 18%;
}

#quarantineTable th:nth-child(5),
#quarantineTable td:nth-child(5) {
  width: 40%;
}

.upload-selection-list::-webkit-scrollbar,
.review-table-wrap::-webkit-scrollbar,
.progress-table-wrap::-webkit-scrollbar,
.pipeline-tables-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.upload-selection-list::-webkit-scrollbar-track,
.review-table-wrap::-webkit-scrollbar-track,
.progress-table-wrap::-webkit-scrollbar-track,
.pipeline-tables-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.upload-selection-list::-webkit-scrollbar-thumb,
.review-table-wrap::-webkit-scrollbar-thumb,
.progress-table-wrap::-webkit-scrollbar-thumb,
.pipeline-tables-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  background-clip: padding-box;
}

.progress-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text);
  font-size: 0.65rem;
  table-layout: fixed;
  background: rgba(8, 16, 31, 0.96);
}

.progress-table th,
.progress-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.progress-table thead {
  background: rgba(255, 255, 255, 0.03);
}

.progress-table thead th,
.study-status-table thead th,
.review-metadata-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(8, 16, 31, 0.96);
  background-clip: padding-box;
  box-shadow: 0 1px 0 rgba(116, 151, 227, 0.14);
  backdrop-filter: blur(8px);
}

.progress-table thead th::before,
.study-status-table thead th::before,
.review-metadata-table thead th::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(8, 16, 31, 0.96);
  pointer-events: none;
}


.progress-table tbody tr + tr {
  border-top: 1px solid rgba(116, 151, 227, 0.12);
}

.processing-summary-row.is-expandable {
  cursor: pointer;
}

.processing-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  width: 18px;
  min-width: 18px;
}

.processing-expand-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  color: var(--text);
}

.processing-expand-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  transition: transform 0.18s ease;
}

.processing-summary-row.is-expanded .processing-expand-caret {
  transform: rotate(90deg);
}

.processing-detail-row td {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.02);
}

.processing-detail-label {
  padding-left: 28px !important;
  color: rgba(255, 255, 255, 0.72);
}

.processing-expand-cell {
  text-align: center;
}

#progressTable th:nth-child(1),
#progressTable td:nth-child(1) {
  width: 5%;
}

#progressTable th:nth-child(2),
#progressTable td:nth-child(2) {
  width: 14%;
}

#progressTable th:nth-child(3),
#progressTable td:nth-child(3) {
  width: 12%;
}

#progressTable th:nth-child(4),
#progressTable td:nth-child(4) {
  width: 13%;
}

#progressTable th:nth-child(5),
#progressTable td:nth-child(5) {
  width: 24%;
}

#progressTable th:nth-child(6),
#progressTable td:nth-child(6) {
  width: 32%;
  white-space: nowrap;
}

#reviewTable {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  font-size: 0.58rem;
}

.review-metadata-table,
.study-status-table,
.review-status-block {
  width: 100%;
}

@supports (-webkit-touch-callout: none) {
  .review-summary-wrap,
  .review-summary-wrap .progress-table-wrap,
  .review-pane,
  .review-table-wrap,
  #reviewTable,
  .review-metadata-table,
  .study-status-table,
  .review-status-block {
    width: -webkit-fill-available;
    min-width: -webkit-fill-available;
  }
}

#reviewTable th:nth-child(1),
#reviewTable td:nth-child(1) {
  width: 18%;
}

#reviewTable th:nth-child(2),
#reviewTable td:nth-child(2),
#reviewTable th:nth-child(3),
#reviewTable td:nth-child(3) {
  width: 15%;
}

#reviewTable th:nth-child(4),
#reviewTable td:nth-child(4) {
  width: 15%;
}

#reviewTable th:nth-child(5),
#reviewTable td:nth-child(5) {
  width: 17%;
}

#reviewTable th:nth-child(6),
#reviewTable td:nth-child(6) {
  width: 20%;
  min-width: 40px;
}

#reviewTable th,
#reviewTable td {
  padding: 6px 6px;
}

#reviewTable th:last-child,
#reviewTable td:last-child {
  text-align: center;
}

#reviewTable .review-group-row td {
  padding-top: 8px;
  padding-bottom: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: none;
  text-align: left;
}

#reviewTable tbody tr:not(.review-group-row):nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

#reviewTable tbody tr:not(.review-group-row):nth-child(odd) td {
  background: rgba(255, 255, 255, 0.015);
}

#arc-svg {
  position: absolute;
  inset: 18px 18px auto 18px;
  width: calc(100% - 36px);
  pointer-events: none;
  overflow: visible;
}

#arc-path {
  fill: none;
  stroke: rgba(107, 176, 255, 0.88);
  stroke-width: 2.4;
  stroke-dasharray: 14 10;
  stroke-linecap: round;
  filter: drop-shadow(0 0 14px rgba(58, 168, 255, 0.2));
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -200;
  }
}

#arc-path.flowing {
  animation: dash-flow 3s linear infinite;
}

.manta {
  width: 62px;
  height: 62px;
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 10px 18px rgba(58, 168, 255, 0.2));
}

#progress-container:not(.active) #arc-svg,
#progress-container:not(.active) .manta {
  display: none;
}

#progress-container.active .idle-manta-wrap {
  display: none;
}

#log {
  margin: 12px 0 0;
  min-height: 240px;
  max-height: 320px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(116, 151, 227, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: 500 0.68rem/1.65 "SFMono-Regular", "Menlo", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr);
  }

  .error-card {
    grid-column: 1 / -1;
  }

  .workspace.is-image-viewer-mode {
    grid-template-columns: 1fr;
  }

  .workspace.is-phi-vault-mode {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  .app-header {
    min-height: 50px;
    padding-top: 10px;
  }

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

  .assistant-fab[data-corner="top-left"],
  .assistant-fab[data-corner="top-right"] {
    top: 82px;
  }

  .assistant-fab[data-corner="top-left"],
  .assistant-drawer[data-corner="top-left"] {
    left: 16px;
  }

  .assistant-fab[data-corner="top-right"],
  .assistant-drawer[data-corner="top-right"] {
    right: 16px;
  }

  .assistant-fab[data-corner="bottom-left"],
  .assistant-drawer[data-corner="bottom-left"] {
    left: 16px;
  }

  .assistant-fab[data-corner="bottom-right"],
  .assistant-drawer[data-corner="bottom-right"] {
    right: 16px;
  }

  .assistant-fab[data-corner="bottom-left"],
  .assistant-fab[data-corner="bottom-right"],
  .assistant-drawer[data-corner="bottom-left"],
  .assistant-drawer[data-corner="bottom-right"] {
    bottom: 16px;
  }

  .assistant-drawer[data-corner="top-left"],
  .assistant-drawer[data-corner="top-right"] {
    top: 66px;
    height: calc(100vh - 82px);
  }

  .assistant-drawer[data-corner="bottom-left"],
  .assistant-drawer[data-corner="bottom-right"] {
    height: calc(100vh - 82px);
  }
}

@media (max-width: 760px) {
  .dashboard {
    padding: 0 16px 16px;
  }

  .app-header {
    min-height: 46px;
    padding: 10px 0 2px;
    width: calc(100% - 32px);
  }

  .topbar,
  .card {
    padding: 20px;
  }

  .pipeline-heading,
  .status-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-row {
    flex-wrap: wrap;
  }

  .image-viewer-heading {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .review-study-actions {
    width: 100%;
  }

  .viewer-mode-btn {
    width: 100%;
    justify-content: center;
  }

  .pipeline-labels {
    font-size: 0.59rem;
  }

  .progress-meta {
    flex-direction: column;
    gap: 8px;
  }

  .manta {
    width: 52px;
    height: 52px;
  }

  .idle-manta {
    width: 104px;
    height: 104px;
  }

  .app-actions {
    gap: 6px;
  }

  .settings-btn,
  .secure-vault-btn {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

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

  .assistant-fab {
    min-height: 38px;
    min-width: 112px;
    padding: 0 12px;
    font-size: 0.56rem;
  }

  .assistant-fab[data-corner="top-left"],
  .assistant-fab[data-corner="top-right"] {
    top: 58px;
  }

  .assistant-fab[data-corner="top-left"],
  .assistant-drawer[data-corner="top-left"] {
    left: 8px;
  }

  .assistant-fab[data-corner="top-right"],
  .assistant-drawer[data-corner="top-right"] {
    right: 8px;
  }

  .assistant-fab[data-corner="bottom-left"],
  .assistant-drawer[data-corner="bottom-left"] {
    left: 8px;
  }

  .assistant-fab[data-corner="bottom-right"],
  .assistant-drawer[data-corner="bottom-right"] {
    right: 8px;
  }

  .assistant-fab[data-corner="bottom-left"],
  .assistant-fab[data-corner="bottom-right"],
  .assistant-drawer[data-corner="bottom-left"],
  .assistant-drawer[data-corner="bottom-right"] {
    bottom: 8px;
  }

  .assistant-drawer {
    width: auto;
    height: calc(100vh - 66px);
    border-radius: 18px;
  }

  .assistant-drawer-header,
  .assistant-drawer-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
