/* ===== 全局变量 ===== */
:root {
  --primary: #3d6ba4;
  --primary-light: #5f86ac;
  --primary-dark: #2f567f;
  --gradient-primary: linear-gradient(135deg, #3d6ba4, #4e84c5);
  --accent: #3f8f87;
  --accent-light: #61aaa3;
  --bg-body: #edf3f8;
  --bg-window: #edf3f8;
  --bg-sidebar: #f2f6fa;
  --bg-main: #f7fafc;
  --bg-card: #ffffff;
  --bg-input: #f3f7fb;
  --text: #1e293b;
  --text-secondary: #526274;
  --text-muted: #8b9aab;
  --border: #d8e2ec;
  --border-light: #e8eef5;
  --border-focus: #6f93bc;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow-sm: 0 2px 10px rgba(30, 41, 59, 0.03);
  --shadow: 0 10px 28px rgba(30, 41, 59, 0.05);
  --shadow-lg: 0 16px 40px rgba(30, 41, 59, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --main-content-pad-top: 0.72rem;
  --main-content-pad-right: 1.85rem;
  --main-content-pad-bottom: 6.5rem;
  --main-content-pad-left: 1.65rem;
  --sticky-header-inner-height: 44px;
  --sticky-header-bottom-pad: 0.9rem;
  --sticky-header-height: calc(var(--main-content-pad-top) + var(--sticky-header-inner-height) + var(--sticky-header-bottom-pad));
}

/* ===== 重置与隐藏滚动条 ===== */
::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* 启用现代 View Transitions API，提供极其顺滑的跨页面切换体验 */
  view-transition-name: root;
}

@view-transition {
  navigation: auto;
  /* 允许在同源导航时自动执行过渡动画 */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ===== 页面主体 ===== */
.app-shell {
  width: 100%;
  min-height: 100vh;
}

.app-body {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.page-transitioning .app-body {
  opacity: 0;
  transform: translateY(6px);
}

/* ===== 核心两栏容器 ===== */
.app-body {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.patient-dock {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.patient-dock-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 64px;
  padding: 0.18rem 0.42rem 0;
}

.patient-dock-brand {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  text-decoration: none;
  min-width: 0;
}

.patient-dock-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
}

.patient-dock-brand strong {
  display: block;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.15;
}

.patient-dock-brand span {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.35;
}

.patient-dock-create-btn {
  margin-left: 0.08rem;
  padding: 0.48rem 0.86rem;
  border: 1px solid rgba(61, 107, 164, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 251, 0.96));
  color: #2d5b86;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(61, 107, 164, 0.08);
}

.patient-dock-create-btn:hover {
  background: #fff;
  border-color: rgba(61, 107, 164, 0.26);
}

.patient-dock-create-row {
  display: flex;
  justify-content: flex-start;
  padding: 0.36rem 0.42rem 0.08rem;
}

.patient-dock-create-row .patient-dock-create-btn {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  text-align: center;
  padding: 0.62rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
}

.patient-filter-panel {
  display: block;
  padding: 0.1rem 0.34rem 0.32rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 100%);
}

.patient-filter-panel.is-visible {
  display: block;
}

.patient-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.38rem;
  align-items: center;
}

.patient-filter-field label {
  display: none;
}

.patient-filter-field select,
.patient-filter-field input {
  width: 100%;
  border: 1px solid #ccd8e5;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border-radius: 11px;
  padding: 0.52rem 0.68rem;
  font-size: 0.75rem;
  line-height: 1.2;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.patient-filter-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 1.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23627a93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.68rem center;
  background-size: 10px 6px;
}

.patient-filter-field select:focus,
.patient-filter-field input:focus {
  border-color: #93b3d2;
  box-shadow: 0 0 0 3px rgba(61, 107, 164, 0.10);
}

@media (max-width: 1279px) {
  .patient-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.patient-workbench-list {
  flex: 1;
  flex-basis: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fbfdff;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.patient-workbench-empty {
  padding: 1rem;
  background: rgba(255,255,255,0.76);
  color: var(--text-secondary);
  font-size: 0.84rem;
  border: none;
}

.patient-list-divider {
  display: block;
  padding: 0.45rem 0.62rem 0.28rem;
  background: #eaf0f6;
  border-bottom: 1px solid #d7e1eb;
}

.patient-list-divider-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.patient-list-divider-label {
  color: #5d7186;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.patient-list-divider-chevron {
  color: #6f8398;
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.18s ease, color 0.18s ease;
}

.patient-list-divider.is-collapsed .patient-list-divider-chevron {
  transform: rotate(-90deg);
}

.patient-list-divider-toggle:hover .patient-list-divider-chevron,
.patient-list-divider-toggle:hover .patient-list-divider-label {
  color: #3d6ba4;
}

.patient-list-item {
  position: relative;
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #dbe4ed;
  border-radius: 0;
  min-height: 50px;
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  overflow: hidden;
  touch-action: pan-y;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.patient-list-item-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0.45rem 0.82rem;
  background: inherit;
  transition: transform 0.2s ease;
  will-change: transform;
}

.patient-list-delete-action {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: 0;
  width: 82px;
  border: none;
  border-radius: 0;
  background: #d9534f;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease;
}

.patient-list-delete-action:hover,
.patient-list-delete-action:focus-visible {
  background: #b9403c;
}

.patient-list-delete-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.patient-list-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #5f86ac;
  pointer-events: none;
  transition: width 0.16s ease;
}

.patient-list-item:hover,
.patient-list-item.is-active {
  background: #f3f7fb;
}

.patient-list-item.is-active {
  background: #729bc5;
  border-bottom-color: #628cb7;
}

.patient-list-item.is-active::before {
  width: 4px;
}

.patient-list-item.is-active .patient-list-name,
.patient-list-item.is-active .patient-list-time {
  color: #ffffff;
}

.patient-list-item:last-child {
  border-bottom: none;
}

.patient-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.patient-list-row-head {
  width: 100%;
  min-height: 34px;
  align-items: center;
}

.patient-list-row + .patient-list-row {
  margin-top: 0.26rem;
}

.patient-list-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1f2f3f;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.patient-list-name-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.32rem;
  min-width: 0;
}

.patient-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.patient-list-new-dot {
  width: 8px;
  height: 8px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
  flex: 0 0 auto;
}

.patient-list-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.patient-list-time {
  font-size: 0.7rem;
  color: #7c8da0;
  line-height: 1.3;
}

.patient-list-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.56rem;
  min-height: 25px;
  border-radius: 4px;
  background: #edf4fb;
  color: #3d6ba4;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid #cfdae6;
  align-self: center;
  letter-spacing: 0.02em;
}

.patient-list-badge.status-waiting {
  background: #eef2f7;
  color: #60758b;
  border-color: #d7e0ea;
}

.patient-list-badge.status-waiting-ready {
  background: #fff0f0;
  color: #c24141;
  border-color: #efb9b9;
  box-shadow: 0 0 0 rgba(194, 65, 65, 0.18);
  animation: waiting-ready-pulse 1.8s ease-in-out infinite;
}

@keyframes waiting-ready-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(194, 65, 65, 0.16);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 5px rgba(194, 65, 65, 0.08);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(194, 65, 65, 0);
  }
}

.patient-list-badge.status-pending {
  background: #eaf2fb;
  color: #3d6ba4;
  border-color: #c8d9eb;
}

.patient-list-badge.status-preliminary-running {
  background: #e9f7f4;
  color: #2f7e73;
  border-color: #bfe2da;
}

.patient-list-badge.status-preliminary-done {
  background: #fff5e8;
  color: #b37016;
  border-color: #f0d5a9;
}

.patient-list-badge.status-auxiliary-done {
  background: #fdf0ea;
  color: #b85f3f;
  border-color: #efc8b8;
}

.patient-list-badge.status-revised-running {
  background: #eef4fb;
  color: #4d63a5;
  border-color: #cfd9f2;
}

.patient-list-badge.status-done {
  background: #ebf8ef;
  color: #2f8550;
  border-color: #c5e5cf;
}

.patient-dock-actions {
  min-height: 52px;
  padding: 0.46rem 0.42rem 0.18rem;
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
}

.patient-profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.46rem;
  min-height: 36px;
  padding: 0.44rem 0.7rem;
  border: 1px solid rgba(188, 205, 222, 0.95);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
  cursor: pointer;
  box-shadow:
    0 6px 14px rgba(61, 107, 164, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.patient-profile-trigger:hover {
  background: #ffffff;
  border-color: #b6cce1;
  box-shadow:
    0 10px 22px rgba(61, 107, 164, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.patient-profile-trigger-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4e84c5, #3f8f87);
  color: #fff;
  font-size: 0.48rem;
  box-shadow: 0 4px 10px rgba(61, 107, 164, 0.18);
  flex: 0 0 auto;
}

.patient-profile-trigger-label {
  min-width: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #284760;
  letter-spacing: 0.01em;
}

.patient-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(61, 107, 164, 0.18), rgba(63, 143, 135, 0.18));
  color: #2d5b86;
  font-size: 0.88rem;
  font-weight: 800;
  flex: 0 0 auto;
  border: 1px solid rgba(162, 188, 212, 0.5);
}

.patient-profile-copy {
  min-width: 0;
}

.patient-profile-caption {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #7f93a7;
  margin-bottom: 0.14rem;
  text-transform: uppercase;
}

.patient-dock-user-name {
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #21384e;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.workspace-action-btn {
  padding: 0.52rem 0.92rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.workspace-action-btn:hover {
  background: #fff;
  border-color: #c5d5e6;
  color: var(--text);
}

.workspace-action-btn-danger:hover {
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--error);
}

.patient-dock-logout-btn {
  width: 100%;
  flex-shrink: 0;
  justify-content: center;
  padding: 0.54rem 0.74rem;
  font-size: 0.74rem;
  line-height: 1.1;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
}

.patient-create-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.patient-create-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
}

.patient-create-modal-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  margin: auto;
  padding: 1rem 1rem 0.9rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.patient-create-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.patient-create-modal-kicker {
  color: #6e7c8f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.patient-create-modal-title {
  margin: 0.2rem 0 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.patient-create-modal-close {
  border: none;
  background: none;
  color: #90a0b2;
  font-size: 1rem;
  cursor: pointer;
}

.patient-create-modal-body {
  margin-top: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

.diagnosis-feedback-doctor-summary {
  margin: 0 0 0.85rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 247, 232, 0.92));
}

.diagnosis-feedback-doctor-summary[hidden] {
  display: none;
}

.diagnosis-feedback-doctor-summary-title {
  margin-bottom: 0.42rem;
  color: #8a5a08;
  font-size: 0.78rem;
  font-weight: 800;
}

.diagnosis-feedback-doctor-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem 0.85rem;
}

.diagnosis-feedback-doctor-summary-section {
  display: flex;
  align-items: flex-start;
  gap: 0.38rem;
  min-width: 0;
  color: #6f6250;
  font-size: 0.8rem;
  line-height: 1.45;
}

.diagnosis-feedback-doctor-summary-label {
  flex: 0 0 auto;
  color: #8a5a08;
  font-weight: 750;
}

.diagnosis-feedback-doctor-summary-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  min-width: 0;
}

.diagnosis-feedback-doctor-summary-values span {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.patient-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.patient-create-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.patient-create-field label {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.patient-create-input {
  width: 100%;
  min-height: 42px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d7e1eb;
  border-radius: 12px;
  background: #f7fafe;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.patient-create-input:focus {
  border-color: rgba(26, 110, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(26, 110, 181, 0.08);
  background: #fff;
}

.patient-create-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1rem;
}

.patient-profile-modal-panel {
  width: min(92vw, 460px);
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(78, 132, 197, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 254, 0.98));
}

.patient-profile-modal-card {
  padding: 1rem 1rem 0.95rem;
  border: 1px solid rgba(201, 214, 228, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.patient-profile-modal-actions {
  justify-content: space-between;
  gap: 0.8rem;
}

.patient-profile-modal-actions .btn,
.patient-profile-modal-logout {
  min-width: 120px;
}

.patient-profile-modal-logout {
  width: auto;
  margin-left: auto;
}

.diagnosis-feedback-modal-panel {
  width: min(94vw, 760px);
}

.diagnosis-feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(260px, 0.92fr);
  gap: 1rem;
  align-items: stretch;
  min-height: min(58vh, 520px);
}

.diagnosis-feedback-column {
  min-width: 0;
}

.diagnosis-feedback-column-left,
.diagnosis-feedback-column-right {
  border: 1px solid rgba(208, 219, 231, 0.9);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 0.9rem;
}

.diagnosis-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: calc(min(58vh, 520px) - 1.8rem);
  overflow-y: auto;
}

.diagnosis-feedback-manual-list {
  gap: 0.85rem;
  height: 100%;
}

.diagnosis-feedback-manual-list .doctor-manual-diagnosis-item {
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(214, 223, 233, 0.92);
  border-radius: 16px;
  background: #fff;
}

.diagnosis-feedback-manual-list .form-control {
  min-height: 40px;
}

.diagnosis-feedback-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(208, 219, 231, 0.95);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.diagnosis-feedback-item-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
}

.diagnosis-feedback-item-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 107, 164, 0.14);
  color: #2d5b86;
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.diagnosis-feedback-item-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.4;
}

.diagnosis-feedback-item-category {
  margin-bottom: 0.15rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.diagnosis-feedback-item-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  margin-top: 0;
  margin-left: auto;
  padding-left: 0;
  flex: 0 0 auto;
}

.diagnosis-feedback-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 34px;
  padding: 0.42rem 0.82rem;
  border: 1px solid #d6dee8;
  border-radius: 999px;
  background: #fff;
  color: #5f7185;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

@media (max-width: 640px) {
  .diagnosis-feedback-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .diagnosis-feedback-column-left,
  .diagnosis-feedback-column-right {
    padding: 0.8rem;
  }

  .diagnosis-feedback-list {
    max-height: 320px;
  }

  .diagnosis-feedback-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .diagnosis-feedback-item-actions {
    width: 100%;
    margin-left: 2.05rem;
    justify-content: flex-start;
  }

  .diagnosis-feedback-select-actions {
    flex-wrap: wrap;
    width: auto;
    margin-left: 2.05rem;
  }
}

.diagnosis-feedback-chip:hover {
  border-color: #b8cade;
  color: #314c68;
}

.diagnosis-feedback-chip.is-selected-helpful {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.34);
  color: #18805e;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.10);
}

.diagnosis-feedback-chip.is-selected-adopted {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.3);
  color: #a16207;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.08);
}

.diagnosis-feedback-actions {
  margin-top: 1.1rem;
}

.btn.btn-primary.diagnosis-feedback-trigger {
  box-shadow: inherit;
  flex: 0 0 auto;
  min-height: 40px;
  height: 40px;
  padding: 0 1rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c94c4c;
  border-color: #c94c4c;
  color: #fff;
}

.btn.btn-primary.diagnosis-feedback-trigger:hover,
.btn.btn-primary.diagnosis-feedback-trigger:focus-visible {
  background: #b83b3b;
  border-color: #b83b3b;
  color: #fff;
}

.btn.btn-primary.diagnosis-feedback-trigger:disabled {
  background: #aeb6bf;
  border-color: #aeb6bf;
  color: #f8fafc;
}

.btn.btn-primary.diagnosis-feedback-trigger.stage-action-locked {
  background: #aeb6bf;
  border-color: #aeb6bf;
  color: #f8fafc;
}

#diagnosisFeedbackSubmitBtn:disabled {
  background: #aeb6bf;
  border-color: #aeb6bf;
  color: #f8fafc;
  cursor: not-allowed;
}

.diagnosis-feedback-trigger.feedback-needs-action {
  animation: feedback-attention-pulse 1.8s ease-in-out infinite;
}

@keyframes feedback-attention-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(201, 76, 76, 0.12);
  }
  50% {
    opacity: 0.72;
    box-shadow: 0 0 0 6px rgba(201, 76, 76, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .diagnosis-feedback-trigger.feedback-needs-action {
    animation: none;
  }
}

.stage-action-disabled {
  opacity: 0.55;
  filter: grayscale(0.8);
  cursor: not-allowed !important;
  pointer-events: none;
}

.stage-action-locked {
  opacity: 0.72;
  filter: brightness(0.82);
  cursor: pointer;
}

.workflow-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background: var(--bg-main);
  overflow: hidden;
}

.workflow-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.34rem 1.6rem 0.28rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -ms-overflow-style: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 155, 197, 0.75) rgba(217, 232, 248, 0.45);
}

.workflow-strip-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: max-content;
  overflow: visible;
  flex: 0 0 auto;
  padding: 0.08rem 0 0.12rem;
}

.workflow-strip-user {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.08rem 0 0.12rem 0.7rem;
}

.workflow-profile-trigger {
  min-height: 34px;
  padding: 0.38rem 0.78rem;
  border-radius: 10px;
  white-space: nowrap;
}

.workflow-strip::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

.workflow-strip::-webkit-scrollbar-track {
  background: rgba(217, 232, 248, 0.4);
  border-radius: 999px;
}

.workflow-strip::-webkit-scrollbar-thumb {
  background: rgba(114, 155, 197, 0.78);
  border-radius: 999px;
}

.workflow-strip::-webkit-scrollbar-thumb:hover {
  background: rgba(93, 135, 179, 0.9);
}

.workflow-step {
  display: block;
  min-width: 114px;
  max-width: 114px;
  padding: 0.56rem 0.56rem;
  border-radius: 9px;
  border: 1px solid rgba(214, 224, 235, 0.98);
  background: rgba(245, 249, 253, 0.98);
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(61, 107, 164, 0.03);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.workflow-step.active {
  background: #fbfdff;
  border-color: rgba(145, 176, 210, 0.98);
  box-shadow: 0 4px 14px rgba(61, 107, 164, 0.08);
}

.workflow-step.viewing {
  background: #d9e8f8;
  border-color: #729bc5;
  box-shadow: 0 9px 20px rgba(61, 107, 164, 0.18);
}

.workflow-step.viewing .workflow-step-title {
  color: #1f456d;
}

.workflow-step.done {
  background: rgba(241, 248, 244, 0.98);
  border-color: rgba(192, 220, 204, 0.96);
}

.workflow-step.done.viewing,
.workflow-step.active.viewing {
  background: #d9e8f8;
  border-color: #729bc5;
  box-shadow: 0 9px 20px rgba(61, 107, 164, 0.18);
}

.workflow-step.done.viewing .workflow-step-title,
.workflow-step.active.viewing .workflow-step-title {
  color: #1f456d;
}

.workflow-step.is-clickable {
  cursor: pointer;
}

.workflow-step.is-clickable:hover {
  background: inherit;
  border-color: inherit;
  box-shadow: inherit;
  transform: none;
}

.workflow-step.is-clickable:active {
  transform: translateY(0);
}

.workflow-step.is-disabled {
  opacity: 0.56;
  cursor: default;
}

.workflow-step-copy {
  min-width: 0;
}

.workflow-step-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.28;
  text-align: center;
  letter-spacing: 0.01em;
}

.workflow-arrow {
  display: flex;
  align-items: center;
  width: 44px;
  min-width: 44px;
  color: #b4c3d3;
  flex: 0 0 auto;
}

.workflow-arrow-line {
  display: block;
  width: 32px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.workflow-arrow-head {
  display: block;
  width: 10px;
  height: 10px;
  margin-left: -1px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.workflow-arrow.done {
  color: #77b492;
}

.workflow-arrow.active {
  color: #3d6ba4;
  animation: workflow-arrow-pulse 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(61, 107, 164, 0.22));
}

@keyframes workflow-arrow-pulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.7;
  }

  50% {
    transform: translateX(4px);
    opacity: 1;
  }
}

.main-content {
  flex: 1;
  padding: 0 var(--main-content-pad-right) var(--main-content-pad-bottom) var(--main-content-pad-left);
  overflow-y: auto;
  min-width: 0;
  position: relative;
  transition: opacity 0.16s ease;
}

.main-content.main-content-switching {
  opacity: 0.88;
}

.page-header-bar {
  margin-bottom: 0rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
  flex-shrink: 0;
}

.workflow-fixed-actions {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.workflow-fixed-actions .btn {
  padding: 0.8rem 1.45rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.10);
}

.workflow-fixed-actions .btn.btn-outline {
  background: #eef4fb;
  color: #3d6ba4;
  border: 1px solid #cddced;
}

.workflow-page {
  width: 100%;
  max-width: none;
}

.result-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.result-summary-card {
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--primary);
}

.result-summary-card.result-summary-accent {
  border-left-color: var(--accent);
}

.result-summary-body {
  padding: 1.3rem 1.55rem;
}

.result-summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  color: var(--primary);
}

.result-summary-accent .result-summary-label {
  color: var(--accent);
}

.result-summary-text {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.result-section {
  margin-top: 1.5rem;
}

.result-section .card-body {
  padding: 1.05rem 1.2rem;
}

.patient-info-section {
  margin-top: 1.25rem;
}

.patient-info-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.patient-info-line {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.patient-info-label {
  flex: 0 0 auto;
  min-width: 56px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.patient-info-text {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.patient-info-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.doctor-manual-diagnosis-hint {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(26, 110, 181, 0.06);
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.7;
}

.doctor-manual-diagnosis-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.doctor-manual-diagnosis-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.doctor-manual-diagnosis-column-title {
  padding-bottom: 0.15rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 700px) {
  .doctor-manual-diagnosis-layout {
    grid-template-columns: 1fr;
  }
}

.doctor-manual-diagnosis-item .form-label {
  margin-bottom: 0.35rem;
}

.patient-info-footer {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px dashed rgba(193, 203, 214, 0.9);
}

.patient-manual-diagnosis-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.patient-manual-diagnosis-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.patient-manual-diagnosis-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
  border: 1px solid rgba(206, 216, 227, 0.9);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.patient-manual-diagnosis-item span {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(26, 110, 181, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 0.05rem;
}

.patient-manual-diagnosis-item {
  word-break: break-word;
}

@media (max-width: 1100px) {
  .patient-manual-diagnosis-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .patient-manual-diagnosis-list {
    grid-template-columns: 1fr;
  }
}

.result-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-section-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-section-title h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.disposition-decision-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #13805b;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}

.result-section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.result-inner-section {
  margin-top: 1rem;
  padding: 1rem 1rem 0.35rem;
  border: 1px solid rgba(26, 110, 181, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.96), rgba(244, 248, 252, 0.96));
}

.result-inner-section-header {
  margin-bottom: 0.9rem;
}

.result-inner-section-header .result-section-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.result-round-diagnosis-section #diagnosisCards {
  margin-top: 0;
}

.result-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: 0.9rem;
}

.workflow-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-standard-panel {
  gap: 0;
}

.workflow-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.workflow-panel-header > .page-header-bar {
  width: 100%;
}

.page-sticky-header {
  position: sticky;
  top: 0;
  z-index: 16;
  min-height: var(--sticky-header-height);
  margin-bottom: 0.25rem;
  padding: var(--main-content-pad-top) 0 var(--sticky-header-bottom-pad);
  background: var(--bg-main);
  border-bottom: 1px solid rgba(216, 226, 236, 0.72);
  box-sizing: border-box;
  width: 100%;
}

.page-standard-header-row {
  min-height: var(--sticky-header-inner-height);
  width: 100%;
  align-items: center;
  box-sizing: border-box;
}

.page-standard-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: var(--sticky-header-inner-height);
}

.page-standard-actions {
  flex: 0 0 auto;
  align-items: center;
  min-height: var(--sticky-header-inner-height);
}

.page-standard-actions .btn,
.page-standard-actions .status-badge {
  min-height: 40px;
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.page-standard-body {
  margin-top: 0.25rem;
}

.workflow-panel-header.page-sticky-header {
  align-items: stretch;
  margin-bottom: 0;
}

.result-header.page-sticky-header {
  margin-bottom: 0;
}

.workflow-panel-header.page-sticky-header > .page-header-bar,
.workflow-panel-header.page-sticky-header > .waiting-panel-header-row,
.result-header.page-sticky-header {
  min-height: var(--sticky-header-inner-height);
  width: 100%;
  align-items: center;
  box-sizing: border-box;
}

.workflow-panel-step {
  font-size: 0.78rem;
  font-weight: 800;
  color: #5f86ac;
  margin-bottom: 0.35rem;
}

.workflow-panel-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
}

.workflow-panel-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 0.35rem;
}

.workflow-empty-state {
  min-height: 360px;
  border: 1px dashed rgba(194, 211, 226, 0.95);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,251,255,0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.workspace-empty-state {
  min-height: calc(100vh - var(--sticky-header-height) - 3rem);
  margin: 0;
  border-style: solid;
  border-color: rgba(194, 211, 226, 0.72);
}

.workspace-empty-state h1 {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
}

.workflow-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(79, 121, 166, 0.1);
  color: #4f79a6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.workflow-empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.workflow-empty-text {
  max-width: 34rem;
  margin-top: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.8;
}

.diagnosis-stream-layout {
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  height: calc(100vh - var(--sticky-header-height) - 7rem);
  min-height: calc(100vh - var(--sticky-header-height) - 7rem);
  overflow: hidden;
}

.diagnosis-stream-body {
  margin-top: 0.15rem;
  height: calc(100vh - var(--sticky-header-height) - 7rem);
  min-height: calc(100vh - var(--sticky-header-height) - 7rem);
  overflow: hidden;
}

.diagnosis-stream-sidebar {
  display: grid;
  grid-template-rows: 182px minmax(0, 1fr);
  gap: 1rem;
  align-self: stretch;
  height: 100%;
  min-height: calc(100vh - var(--sticky-header-height) - 7rem);
  overflow: hidden;
}

.diagnosis-stream-main {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.diagnosis-stream-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.diagnosis-stream-panel .card-header {
  flex: 0 0 auto;
}

.diagnosis-stream-panel .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#currentToolStatus {
  flex: 1;
  min-height: 80px;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
}

#agentStream {
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.diagnosis-stream-sticky-header {
  margin-bottom: 0;
}

.diagnosis-stream-header-row {
  width: 100%;
}

.diagnosis-stream-title-wrap h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.diagnosis-stream-actions {
  flex: 0 0 auto;
}

.patient-detail-panel {
  border: 1px solid rgba(212, 225, 237, 0.95);
  border-radius: 22px;
  background: #fff;
  padding: 1.25rem;
}

.patient-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.waiting-panel-title-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.waiting-panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.waiting-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  min-width: 0;
}

.waiting-inline-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
}

.waiting-inline-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: #eef5fc;
  color: #466888;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(209, 223, 236, 0.95);
}

#waitingInlineName,
#waitingInlineAge,
#patientIdentityId,
#patientIdentityName,
#patientIdentityAge,
#patientIdentityComplaint {
  font-size: 1.0rem;
  font-weight: 800;
  color: #2f567f;
}

#patientIdentityCards {
  margin-bottom: 0.75rem;
  gap: 0.85rem;
}

#patientIdentityCards .waiting-inline-chip {
  border-radius: 8px;
  padding: 0.48rem 0.85rem;
}

.waiting-inline-complaint-chip {
  max-width: min(42rem, 100%);
  white-space: normal;
  line-height: 1.45;
}

#waitingInlinePatientId {
  margin-left: auto;
}

.waiting-accept-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.patient-detail-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.patient-detail-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.patient-detail-tag,
.patient-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  background: #eef6ff;
  color: #356c9e;
  font-size: 0.74rem;
  font-weight: 800;
}

.patient-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.patient-intake-sheet {
  margin-top: 0.65rem;
  border-radius: 12px;
  background: #fbfdfe;
  border: 1px solid #dce7ef;
  padding: 0.55rem 0.85rem;
}

.patient-intake-summary {
  margin-top: 0;
  color: var(--text-secondary);
  line-height: 1.9;
}

.waiting-info-sections {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.waiting-info-section {
  padding: 0.05rem 0 0.2rem;
}

.waiting-info-section + .waiting-info-section {
  padding-top: 0.28rem;
  border-top: 1px solid #e3edf2;
}

.waiting-info-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.18rem;
  padding: 0.18rem 0.45rem;
  color: #25465f;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  background: #eef6fa;
  border-radius: 5px;
}

.waiting-info-section-title::before {
  content: '';
  width: 3px;
  height: 0.78rem;
  flex: 0 0 3px;
  border-radius: 1px;
  background: #4f8aa8;
}

.waiting-info-section-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #d7e5ec;
}

.waiting-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}

.waiting-info-item {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.58rem;
  min-width: 0;
  align-items: start;
  padding: 0.24rem 0.2rem;
  border-bottom: 1px solid #edf2f5;
}

.waiting-info-item--wide {
  grid-column: 1 / -1;
}

.waiting-info-label {
  color: #718795;
  font-size: 0.77rem;
  line-height: 1.35;
  white-space: nowrap;
}

.waiting-info-value {
  min-width: 0;
  color: #30495c;
  font-size: 0.88rem;
  line-height: 1.42;
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
}

.waiting-info-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem 0.35rem;
}

.waiting-info-token {
  display: inline-block;
  padding: 0.08rem 0.3rem;
  border-radius: 3px;
  color: #36566b;
  background: #f0f6f9;
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Keep the waiting intake preview compact while presenting each answer as a card. */
.waiting-summary-display {
  min-height: 13.5rem;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 0.7rem 0.8rem;
  border: 1px solid #dce7ef;
  border-radius: 12px;
  background: #fbfdfe;
  scrollbar-width: thin;
}

.form-label.waiting-summary-title {
  margin-bottom: 0.7rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.waiting-summary-display .waiting-info-sections {
  gap: 0.25rem;
}

.waiting-summary-display .waiting-info-section-group + .waiting-info-section-group {
  margin-top: 0.4rem;
}

.waiting-summary-display .waiting-info-section {
  padding: 0.3rem 0.55rem 0.25rem;
  border: 1px solid #e1ebf0;
  border-radius: 9px;
  background: #fff;
}

.waiting-summary-display .waiting-info-section + .waiting-info-section {
  padding-top: 0.45rem;
  border-top: 1px solid #e1ebf0;
}

.waiting-summary-display .waiting-info-section-title {
  margin: 0 0 0.2rem;
  padding: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
  background: transparent;
}

.waiting-summary-display .waiting-info-section-title::after {
  display: none;
}

.waiting-summary-display .waiting-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem 0.55rem;
}

.waiting-summary-display .waiting-info-merged {
  color: #30495c;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.waiting-summary-display .waiting-info-merged-item {
  display: inline;
}

.waiting-summary-display .waiting-info-merged-item strong {
  color: #34495e;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.waiting-summary-display .waiting-info-item--wide {
  grid-column: auto;
}

.waiting-summary-display .waiting-info-item {
  grid-template-columns: 4.8rem minmax(0, 1fr);
  gap: 0.4rem;
  padding: 0.18rem 0.1rem;
  border-bottom: 1px solid #eef3f6;
}

.waiting-summary-display .waiting-info-label {
  font-size: 0.82rem;
}

.waiting-summary-display .waiting-info-value {
  font-size: 0.9rem;
  line-height: 1.45;
}

.waiting-summary-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .waiting-info-grid {
    grid-template-columns: 1fr;
  }

  .waiting-summary-display .waiting-info-grid {
    grid-template-columns: 1fr;
  }

  .waiting-info-item--wide {
    grid-column: auto;
  }

  .patient-intake-sheet {
    padding: 0.58rem 0.7rem;
  }

  .waiting-info-item {
    grid-template-columns: 6rem minmax(0, 1fr);
  }

  .waiting-info-token {
    font-size: 0.8rem;
  }
}

.patient-detail-item {
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #f7fbff;
  border: 1px solid rgba(221, 232, 242, 0.95);
}

.patient-detail-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: #5f86ac;
  margin-bottom: 0.3rem;
}

.patient-detail-value {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

.patient-detail-block {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: #f7fbff;
  border: 1px solid rgba(221, 232, 242, 0.95);
}

.aux-page {
  width: 100%;
}

.aux-panel {
  gap: 1.25rem;
}

.aux-page-header {
  margin-bottom: 0;
}

.aux-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0;
}

.aux-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aux-section-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.aux-card-header {
  padding: 0.75rem 1.25rem;
}

.aux-record-titlebar {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.aux-card-body {
  padding: 1rem 1.25rem;
}

.aux-card-icon {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.aux-card-icon-warn {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

.aux-card-icon-primary {
  background: rgba(26,110,181,0.1);
  color: var(--primary);
}

.aux-custom-add-btn {
  min-height: 34px;
  height: 34px;
  padding: 0 0.9rem;
  font-size: 0.82rem;
}

.aux-suggested-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.aux-suggested-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid rgba(216, 226, 236, 0.95);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.aux-suggested-item:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 110, 181, 0.28);
  box-shadow: 0 10px 22px rgba(30, 41, 59, 0.07);
}

.aux-suggested-index-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 700;
}

.aux-suggested-item.is-reasonable .aux-suggested-index-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #2874b5;
}

.aux-suggested-item.is-unreasonable .aux-suggested-index-badge {
  background: rgba(107, 114, 128, 0.16);
  color: #6b7280;
}

.aux-suggested-item.is-adopted .aux-suggested-index-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.aux-suggested-item.is-filled {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(235, 241, 246, 0.96));
  border-color: rgba(177, 189, 201, 0.9);
  opacity: 0.9;
}

.aux-suggested-item.is-adopted {
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(254, 243, 217, 0.98));
  border-color: rgba(217, 119, 6, 0.34);
  box-shadow: 0 10px 22px rgba(217, 119, 6, 0.10);
}

.aux-suggested-item.is-adopted:hover {
  border-color: rgba(180, 83, 9, 0.42);
  box-shadow: 0 12px 24px rgba(180, 83, 9, 0.12);
}

.aux-suggested-item.is-reasonable {
  background: linear-gradient(180deg, rgba(239, 248, 255, 0.98), rgba(225, 241, 252, 0.98));
  border-color: rgba(91, 163, 211, 0.42);
  box-shadow: 0 8px 18px rgba(70, 145, 194, 0.10);
}

.aux-suggested-item.is-unreasonable {
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.98), rgba(226, 229, 233, 0.98));
  border-color: rgba(148, 163, 184, 0.56);
  color: #64707e;
  box-shadow: 0 6px 14px rgba(71, 85, 105, 0.08);
}

.aux-suggested-item.is-unreasonable .aux-suggested-title {
  color: #64707e;
}

.aux-suggested-item.is-filled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.aux-suggested-item:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.aux-suggested-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.aux-suggested-title {
  min-width: 0;
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aux-suggested-state {
  flex-shrink: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.aux-suggested-item.is-filled .aux-suggested-state {
  color: #6b7b8c;
  font-size: 1.02rem;
  font-weight: 900;
}

.aux-suggested-item.is-adopted .aux-suggested-state {
  color: #a16207;
  font-weight: 700;
}

.aux-custom-test-item {
  border-style: dashed;
}

.aux-custom-test-shell {
  position: relative;
  padding-right: 2.2rem;
}

.aux-custom-test-shell .aux-custom-test-item {
  width: calc(100% - 0.55rem);
}

.aux-custom-test-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(26, 110, 181, 0.14);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.aux-custom-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #7b8794;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.aux-custom-delete-btn:hover {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
  transform: scale(1.04);
}

.aux-custom-delete-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.aux-loading-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.aux-form-group {
  margin-bottom: 0;
}

.aux-form-label {
  margin-bottom: 0.35rem;
}

.aux-round-summary {
  flex-shrink: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.aux-round-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}

.aux-custom-modal {
  max-width: 520px;
}

.aux-form-actions {
  margin-top: 0;
}

.aux-test-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1450;
}

.aux-test-modal {
  width: min(620px, 100%);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(214, 224, 234, 0.92);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.aux-test-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.95));
}

.aux-test-modal-header h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.2rem;
}

.aux-test-modal-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.aux-test-modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.aux-test-modal-close:hover {
  background: #e8eef5;
  color: var(--text);
  transform: translateY(-1px);
}

.aux-test-modal-body {
  padding: 1rem 1.2rem;
}

.aux-test-modal-label {
  display: block;
  margin-bottom: 0.45rem;
}

.aux-test-modal-textarea {
  min-height: 160px;
  resize: vertical;
}

.aux-test-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 0 1.2rem 1.15rem;
}

.ocr-preview-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 1500;
}

.ocr-preview-modal {
  width: min(760px, 100%);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(214, 224, 234, 0.94);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.ocr-preview-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.95));
}

.ocr-preview-modal-header h3 {
  margin: 0 0 0.18rem;
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--text);
}

.ocr-preview-modal-header p {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.ocr-preview-modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.ocr-preview-modal-close:hover {
  background: #e8eef5;
  color: var(--text);
  transform: translateY(-1px);
}

.ocr-preview-modal-body {
  padding: 1rem 1.2rem;
}

.ocr-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.ocr-preview-status {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.ocr-preview-gallery {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.6rem;
  margin-bottom: 0.9rem;
}

.ocr-preview-gallery-empty {
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.96), rgba(239, 244, 249, 0.96));
  border: 1px solid rgba(220, 228, 238, 0.95);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.ocr-thumb-card {
  position: relative;
  min-width: 168px;
  width: 168px;
  border-radius: 16px;
  border: 1px solid rgba(214, 224, 234, 0.94);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  padding: 0.7rem;
  flex-shrink: 0;
}

.ocr-thumb-add {
  min-width: 168px;
  width: 168px;
  min-height: 208px;
  border-radius: 16px;
  border: 1.5px dashed rgba(159, 176, 194, 0.9);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(242, 247, 251, 0.98));
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.ocr-thumb-add:hover {
  border-color: rgba(26, 110, 181, 0.55);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(26, 110, 181, 0.12);
}

.ocr-thumb-add-plus {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 110, 181, 0.1);
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 400;
}

.ocr-thumb-add-text {
  font-size: 0.88rem;
  font-weight: 700;
}

.ocr-thumb-image-wrap {
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.96), rgba(239, 244, 249, 0.96));
  border: 1px solid rgba(220, 228, 238, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.ocr-thumb-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}

.ocr-thumb-remove {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.ocr-thumb-name {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ocr-thumb-parse-btn {
  width: 100%;
  margin-top: 0.65rem;
  min-height: 36px;
  border-radius: 10px;
  font-weight: 700;
}

.ocr-preview-modal-textarea {
  min-height: 220px;
  resize: vertical;
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.98), rgba(240, 245, 250, 0.98));
  border: 1px solid rgba(214, 225, 236, 0.95);
  line-height: 1.8;
  white-space: pre-wrap;
}

.ocr-preview-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0 1.2rem 1.15rem;
}

.ocr-preview-modal-actions .btn + .btn {
  margin-left: 0;
}

.ocr-preview-modal-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.image-cropper-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 1700;
}

.image-cropper-overlay.is-open { display: flex; }

.image-cropper-modal {
  width: min(1400px, 100%);
  height: calc(100vh - 1rem);
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.image-cropper-header,
.image-cropper-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.image-cropper-header { border-bottom: 1px solid #e6edf4; }
.image-cropper-header h3 { margin: 0 0 0.2rem; color: var(--text); font-size: 1.08rem; }
.image-cropper-header p { margin: 0; color: var(--text-secondary); font-size: 0.84rem; }
.image-cropper-close { border: 0; background: #f1f5f9; border-radius: 9px; width: 34px; height: 34px; cursor: pointer; color: var(--text-secondary); }
.image-cropper-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0.75rem 1rem 0.7rem; overflow: hidden; }
.image-cropper-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem; margin-bottom: 0.8rem; }
.image-cropper-reset-btn { border: 1px solid #d6e0ea; background: #f7fafc; color: #3d6ba4; cursor: pointer; }
.image-cropper-reset-btn { padding: 0.38rem 0.7rem; border-radius: 7px; font-size: 0.78rem; }
.image-cropper-reset-btn:hover { background: #edf4fb; border-color: #a9c1d9; }
.image-cropper-zoom-value { min-width: 3.2rem; color: #5d7186; font-size: 0.78rem; font-weight: 700; text-align: center; }
.image-cropper-stage { position: relative; flex: 1 1 auto; margin: 0 auto; overflow: hidden; background: #0f172a; touch-action: none; }
.image-cropper-canvas { position: absolute; display: block; max-width: none; transform-origin: center center; }
.image-cropper-selection { position: absolute; box-sizing: border-box; border: 2px solid #38bdf8; background: rgba(56, 189, 248, 0.12); box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.52); cursor: move; pointer-events: auto; touch-action: none; }
.image-cropper-selection.is-drawing { border-color: #fbbf24; background: rgba(251, 191, 36, 0.14); }
.image-cropper-handle { position: absolute; z-index: 2; display: block; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #1594d0; box-shadow: 0 1px 5px rgba(15, 23, 42, 0.45); touch-action: none; }
.image-cropper-handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.image-cropper-handle.n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; }
.image-cropper-handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.image-cropper-handle.e { right: -8px; top: calc(50% - 7px); cursor: ew-resize; }
.image-cropper-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.image-cropper-handle.s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.image-cropper-handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.image-cropper-handle.w { left: -8px; top: calc(50% - 7px); cursor: ew-resize; }
.image-cropper-hint { margin-top: 0.75rem; color: var(--text-muted); font-size: 0.82rem; text-align: center; }
.image-cropper-actions { justify-content: flex-end; border-top: 1px solid #e6edf4; }

@media (max-width: 600px) {
  .image-cropper-overlay { padding: 0.25rem; }
  .image-cropper-modal { width: 100%; height: calc(100vh - 0.5rem); border-radius: 10px; }
  .image-cropper-header, .image-cropper-body, .image-cropper-actions { padding-left: 0.85rem; padding-right: 0.85rem; }
}

.ocr-image-lightbox-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1550;
}

.ocr-image-lightbox-panel {
  width: min(1120px, 100%);
  max-height: calc(100vh - 2.4rem);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(214, 224, 234, 0.94);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ocr-image-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.95));
}

.ocr-image-lightbox-header h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}

.ocr-image-lightbox-body {
  padding: 1rem;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(245, 248, 252, 0.98), rgba(240, 245, 250, 0.98));
}

.ocr-image-lightbox-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

@keyframes pulse-submit-btn {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 110, 181, 0.5);
    transform: translateY(0);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(26, 110, 181, 0);
    transform: translateY(-2px);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(26, 110, 181, 0);
    transform: translateY(0);
  }
}

.patient-detail-text {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.patient-detail-actions,
.patient-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.patient-delete-btn {
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.18);
}

.patient-stage-form {
  background: #fff;
  border: 1px solid rgba(212, 225, 237, 0.95);
  border-radius: 22px;
  padding: 1.2rem;
}

.patient-intake-editor {
  margin-top: 0.35rem;
}

.visit-type-selector {
  margin-bottom: 1rem;
}

.visit-type-selector-title {
  margin-bottom: 0.6rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.visit-type-options {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.visit-type-option {
  position: relative;
  display: inline-flex;
  min-width: 0;
  cursor: pointer;
}

.visit-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visit-type-option-box {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(194, 208, 222, 0.95);
  border-radius: 8px;
  color: var(--text-secondary);
  background: #fff;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.visit-type-option-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #b8c8d8;
  border-radius: 4px;
  color: transparent;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  transition: all 0.2s ease;
}

.visit-type-option input:checked + .visit-type-option-box {
  border-color: var(--primary);
  background: rgba(61, 107, 164, 0.09);
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(61, 107, 164, 0.1);
}

.visit-type-option input:checked + .visit-type-option-box .visit-type-option-mark {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.visit-type-option input:focus-visible + .visit-type-option-box {
  outline: 3px solid rgba(61, 107, 164, 0.18);
  outline-offset: 2px;
}

.visit-type-option input:disabled + .visit-type-option-box {
  cursor: not-allowed;
  opacity: 0.65;
}

.visit-type-followup-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 250px;
}

.visit-type-followup-note-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.visit-type-followup-note input {
  width: min(30vw, 320px);
  min-height: 34px;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(194, 208, 222, 0.95);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
}

.visit-type-followup-note input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61, 107, 164, 0.12);
}

.visit-type-help {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid rgba(61, 107, 164, 0.55);
  background: rgba(241, 246, 251, 0.72);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.65;
}

.visit-type-help-title {
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 800;
}

.visit-type-help-item {
  display: flex;
  gap: 0.35rem;
}

.visit-type-help-item strong {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 750;
}

.visit-type-help-subitem {
  padding-left: 1.1rem;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .visit-type-help-item {
    display: block;
  }

  .visit-type-help-item strong {
    display: block;
  }

  .visit-type-help-subitem {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .visit-type-options {
    flex-wrap: wrap;
  }

  .visit-type-option {
    flex: 1 1 auto;
  }

  .visit-type-option-box {
    font-size: 0.82rem;
  }

  .visit-type-followup-note {
    width: 100%;
  }

  .visit-type-followup-note input {
    width: 100%;
  }
}

.patient-intake-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0 0 0.7rem;
  flex-wrap: wrap;
}

.patient-intake-editor-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
}

.patient-intake-editor-heading {
  min-width: 0;
}

.patient-intake-editor-note {
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.patient-intake-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.patient-intake-upload-btn {
  min-height: 40px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.aux-ocr-upload-btn {
  min-height: 40px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.aux-modal-ocr-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.aux-modal-ocr-status {
  margin-top: 0.75rem;
}

.patient-intake-editor-body {
  padding: 0;
}

.patient-intake-editor-textarea {
  min-height: 420px;
  resize: vertical;
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.98), rgba(240, 245, 250, 0.98));
  border: 1px solid rgba(214, 225, 236, 0.95);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
  font-size: 0.95rem;
  line-height: 1.85;
  white-space: pre-wrap;
}

.patient-intake-ocr-status {
  margin-top: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  border: 1px solid rgba(214, 225, 236, 0.95);
  background: rgba(248, 250, 252, 0.95);
  color: var(--text-secondary);
}

.patient-intake-ocr-status[data-state="loading"] {
  background: rgba(239, 246, 255, 0.96);
  border-color: rgba(147, 197, 253, 0.7);
  color: #1d4ed8;
}

.patient-intake-ocr-status[data-state="success"] {
  background: rgba(236, 253, 245, 0.96);
  border-color: rgba(110, 231, 183, 0.9);
  color: #047857;
}

.patient-intake-ocr-status[data-state="error"] {
  background: rgba(254, 242, 242, 0.96);
  border-color: rgba(252, 165, 165, 0.9);
  color: #b91c1c;
}

.patient-form-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.6fr;
  gap: 1rem;
}

.patient-form-span-2 {
  grid-column: span 1;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-header .icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.card-body {
  padding: 1.75rem;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-label .required {
  color: var(--error);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-input);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  background: var(--bg-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 16px rgba(61, 107, 164, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 8px 18px rgba(61, 107, 164, 0.22);
  filter: brightness(1.03);
}

.btn-outline {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 2px solid transparent;
}

.btn-outline:hover {
  background: #e2e8f0;
  color: var(--text);
}

.stage-delete-btn {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(254, 242, 240, 0.92);
}

.stage-delete-btn:hover {
  color: #981b12;
  border-color: rgba(180, 35, 24, 0.34);
  background: rgba(254, 226, 226, 0.96);
}

.btn-return {
  background: #e7eff8;
  color: #2f5f92;
  border: 1px solid #b9cee4;
  box-shadow: 0 8px 18px rgba(78, 111, 148, 0.12);
  font-weight: 600;
}

.btn-return:hover {
  background: #dce8f5;
  color: #224c78;
  border-color: #a7c1db;
}

.btn-lg {
  padding: 1rem 3rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== 辅助检查列表 ===== */
.aux-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.aux-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.aux-item-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.aux-item-reason {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* ===== 诊断卡片 ===== */
.diagnosis-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.diagnosis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;           /* 折叠时裁剪 diag-body */
  padding: 0;                 /* 内边距交由子元素处理 */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.2s, box-shadow 0.2s;
}

.diagnosis-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.diagnosis-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow);
}

/* 折叠标题行 hover */
.diag-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background 0.2s ease;
}
.diag-header:hover {
  background: rgba(99, 102, 241, 0.04);
}
.diagnosis-accordion.diag-open .diag-header {
  background: rgba(99, 102, 241, 0.03);
}


.diagnosis-card.rank-1 {
  border-left: 6px solid var(--primary);
}

.diagnosis-card.rank-2 {
  border-left: 6px solid var(--accent);
}

.diagnosis-card.rank-3 {
  border-left: 6px solid var(--warning);
}

.confidence-ring {
  width: 80px;
  height: 80px;
  position: relative;
  flex-shrink: 0;
}

.confidence-ring svg {
  transform: rotate(-90deg);
}

.confidence-ring .track {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 6;
}

.confidence-ring .fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-ring .fill.primary {
  stroke: var(--primary);
}

.confidence-ring .fill.accent {
  stroke: var(--accent);
}

.confidence-ring .fill.warning {
  stroke: var(--warning);
}

.confidence-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.diagnosis-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.diagnosis-rank {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.rank-badge-1 {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.rank-badge-2 {
  background: rgba(20, 184, 166, 0.1);
  color: var(--accent);
}

.rank-badge-3 {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.diagnosis-reason {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.changes-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 10px;
}

/* ===== 工具相关卡片 ===== */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.4s ease;
}

.tool-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-card-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.tool-card-header:hover {
  background: var(--bg-input);
}

.tool-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.tool-bing {
  background: rgba(0, 120, 212, 0.15);
  color: #0078d4;
}

.tool-pubmed {
  background: rgba(0, 150, 80, 0.15);
  color: #009650;
}

.tool-rag {
  background: rgba(120, 80, 200, 0.15);
  color: #7850c8;
}

.tool-card-body {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.tool-card-body.open {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem;
}

.tool-result-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 提示框与组件 ===== */
.agent-stream-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  min-height: 120px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.skeleton-card {
  height: 90px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ===== 页面标题 ===== */
.page-title {
  margin-bottom: 2.5rem;
}

.page-title h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-title p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* ===== 参考文献卡片与抽屉 ===== */
.ref-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.ref-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ref-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.ref-card.highlight {
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.ref-card-badge {
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ref-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.ref-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ref-card-title-inline {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-card-meta,
.ref-card-meta-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
}

.ref-card-meta-inline {
  flex: 0 0 auto;
  max-width: 48%;
}

.ref-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.4;
  text-decoration: none;
}

.ref-meta-pill span {
  color: var(--text-secondary);
  word-break: break-all;
}

.ref-meta-pill-link {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.ref-meta-pill-link span {
  color: #2563eb;
}

.ref-card-snippet {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 参考文献详情弹窗 ===== */
.ref-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
}

.ref-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-modal-badge {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.ref-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ref-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-input);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.ref-modal-close:hover {
  background: #e2e8f0;
}

.ref-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.ref-modal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.ref-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.ref-modal-url {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.ref-modal-url:hover {
  text-decoration: underline;
}

.ref-modal-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.diagnosis-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.diagnosis-overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.diagnosis-overlay-panel {
  position: relative;
  width: min(1160px, calc(100vw - 88px));
  height: calc(100vh - 96px);
  min-height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
  margin: 48px auto;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 8px 20px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.diagnosis-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.95));
}

.diagnosis-overlay-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagnosis-overlay-title-wrap h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.diagnosis-overlay-title-wrap p {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.diagnosis-overlay-layout {
  padding: 18px;
  overflow: auto;
}

.diagnosis-overlay .diagnosis-stream-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.diagnosis-overlay .diagnosis-stream-sidebar {
  grid-template-rows: 220px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.diagnosis-overlay .diagnosis-stream-main {
  min-height: 0;
  max-height: none;
  padding-right: 2px;
}

.diagnosis-overlay .diagnosis-stream-panel {
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: none;
  background: #fff;
}

.diagnosis-overlay .diagnosis-stream-panel .card-header {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  background: #fcfdff;
}

.diagnosis-overlay .diagnosis-stream-panel .card-header h2 {
  font-size: 0.92rem;
}

.diagnosis-overlay .diagnosis-stream-panel .card-body {
  padding: 0.95rem;
}

.diagnosis-overlay #resultsContainer .card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: none;
}

.diagnosis-overlay #currentToolStatus {
  min-height: 108px;
}

.diagnosis-progress-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.diagnosis-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.diagnosis-progress-text {
  min-width: 0;
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.diagnosis-progress-percent {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.diagnosis-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.42);
  overflow: hidden;
}

.diagnosis-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a6eb5 0%, #4aa3df 100%);
  box-shadow: 0 4px 10px rgba(26, 110, 181, 0.18);
  transition: width 0.35s ease;
}

.diagnosis-stage-duration {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  border: 1px solid rgba(203, 213, 225, 0.72);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1;
  white-space: nowrap;
}

.diagnosis-stage-duration::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #b98952;
  box-shadow: 0 0 0 4px rgba(185, 137, 82, 0.12);
  flex-shrink: 0;
}

.diagnosis-overlay #agentStream {
  font-size: 0.77rem;
  line-height: 1.68;
}

.diagnosis-overlay #agentPlaceholder {
  font-size: 0.76rem;
}

.diagnosis-overlay #donePanel h3 {
  font-size: 0.98rem;
  color: var(--text);
}

.diagnosis-overlay .status-badge {
  min-width: 112px;
  justify-content: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.diagnosis-overlay-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.diagnosis-overlay-close:hover {
  border-color: rgba(148, 163, 184, 0.95);
  background: #f8fafc;
  color: #334155;
}

.ref-drawer {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.08);
  z-index: 200;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-light);
}

.ref-drawer.open {
  right: 0;
}

.ref-drawer-header {
  padding: 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ref-drawer-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.ref-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--bg-input);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.ref-drawer-close:hover {
  background: #e2e8f0;
}

.ref-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
}

.ref-item {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.ref-item.highlighted {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.cite-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  border: 1.5px solid;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  top: -3px;
}

.cite-chip:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.42rem 0.88rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status-badge-running {
  background: #edf4fb;
  border-color: #cddded;
  color: #335f8d;
}

.status-badge-success {
  background: #eef8f2;
  border-color: #cfe7d7;
  color: #2f7a56;
}

.status-badge-error {
  background: #fff1f1;
  border-color: #f1caca;
  color: #ba4a4a;
}

.status-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.status-badge-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(51, 95, 141, 0.22);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: badge-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

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

/* ===== 诊断修改变化高亮美化 ===== */
.diagnosis-changes {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-left: 5px solid var(--accent);
  display: block;
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.06);
  position: relative;
  overflow: hidden;
}

.diagnosis-changes .changes-content {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  z-index: 1;
}

.diagnosis-changes .changes-content strong {
  color: var(--accent);
  background: rgba(20, 184, 166, 0.1);
  padding: 0 4px;
  border-radius: 3px;
}

/* ===== 打印专属优化 (@media print) ===== */
/* ============================================================
   响应式布局
   断点：
     ≥ 1280px  大屏桌面（默认）
     1024-1279 普通桌面 / 小笔记本
     768-1023  平板横屏（侧边栏收窄至图标模式）
     < 768     平板竖屏
   ============================================================ */

/* ----- 1024px ~ 1279px：缩减侧边栏和内边距 ----- */
@media (max-width: 1279px) {
  .app-body { grid-template-columns: 220px minmax(0, 1fr); }
}

/* ----- 768px ~ 1023px：平板横屏 ----- */
@media (max-width: 1023px) {
  :root {
    --main-content-pad-top: 0.56rem;
    --main-content-pad-right: 1.15rem;
    --main-content-pad-bottom: 7rem;
    --main-content-pad-left: 1.15rem;
    --sticky-header-inner-height: 40px;
    --sticky-header-bottom-pad: 0.78rem;
    --sticky-header-height: calc(var(--main-content-pad-top) + var(--sticky-header-inner-height) + var(--sticky-header-bottom-pad));
  }
  .app-body {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .patient-dock {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: static;
  }
  .workflow-shell {
    height: auto;
    overflow: visible;
  }
  .workflow-strip {
    position: static;
    padding-top: 0.3rem;
  }
  .workflow-strip-user {
    padding-left: 0.6rem;
  }
  .workflow-fixed-actions {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }
}

/* ----- < 768px：平板竖屏，侧边栏完全隐藏 ----- */
@media (max-width: 767px) {
  .patient-dock-header,
  .patient-detail-head,
  .workflow-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .patient-dock-logout-btn {
    align-self: flex-start;
  }
  .workflow-fixed-actions {
    right: 12px;
    left: 12px;
    bottom: 12px;
    justify-content: flex-end;
    gap: 0.6rem;
  }
  .workflow-fixed-actions .btn {
    padding: 0.72rem 1rem;
    font-size: 0.88rem;
  }
  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-header-bar,
  .page-header-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .diagnosis-stream-layout {
    grid-template-columns: 1fr;
  }
  .diagnosis-stream-body {
    min-height: auto;
  }
  .diagnosis-stream-sidebar {
    grid-template-rows: auto auto;
  }
  .workflow-panel-header.page-sticky-header > .page-header-bar,
  .workflow-panel-header.page-sticky-header > .waiting-panel-header-row,
  .result-header.page-sticky-header {
    min-height: auto;
  }
  #waitingInlinePatientId {
    margin-left: 0;
  }
  .aux-suggested-grid {
    grid-template-columns: 1fr;
  }
  .patient-detail-grid,
  .patient-form-grid,
  .card-body { padding: 1rem; }
  .card-header { padding: 0.85rem 1rem; }
  .form-row,
  .patient-detail-grid,
  .patient-form-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .ref-grid { grid-template-columns: 1fr !important; }
}

@media print {

  /* 1. 基础页面包裹重制 */
  body,
  html {
    background: #fff !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* 消除固定高度和溢出隐藏导致的挤压截断 */
  .app-body {
    overflow: visible !important;
    display: block !important;
    /* 去除 Flex 防止异常横向或纵向拉伸 */
  }

  .main-content {
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  /* 2. 彻底隐藏界面交互控件及边栏 */
  .patient-dock,
  .workflow-strip,
  .btn,
  button {
    display: none !important;
  }

  /* 3. 剥离特效以增强对比度，并设置不可截断规则以防分页导致排版割裂 */
  .card,
  .diagnosis-card,
  .tool-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: transparent !important;
    break-inside: avoid;
    /* 现代属性 */
    page-break-inside: avoid;
    /* 旧版支持 */
    margin-bottom: 24px !important;
    transform: none !important;
    animation: none !important;
  }

  .aux-item {
    background: transparent !important;
    border: 1px solid #eee !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .diagnosis-changes {
    background: transparent !important;
    border: 1px dashed #bbb !important;
    border-left: 5px solid #666 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* 将主要文字强制深色渲染以方便激光/喷墨打印设备 */
  h1,
  h2,
  h3,
  h4,
  h5,
  p,
  span,
  div,
  .reason-text {
    color: #111 !important;
    text-shadow: none !important;
  }

  .cite-chip {
    background: transparent !important;
    border: 1px solid #999 !important;
    color: #333 !important;
  }

  /* 纸张排版调整 */
  @page {
    size: A4 portrait;
    margin: 20mm 15mm;
  }
}
.aux-round-summary {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(26,110,181,0.08), rgba(0,180,166,0.08));
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.revision-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.revision-history-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
}

.revision-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.revision-history-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a6eb5;
  text-decoration: none;
}

.revision-history-link:hover {
  text-decoration: underline;
}

.revision-history-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.revision-history-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.revision-round-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

.revision-round-header-actions {
  gap: 0.85rem;
  justify-content: flex-start;
  margin-left: 0;
  width: 100%;
  flex-wrap: nowrap;
  min-width: 0;
}

.revision-round-card-header {
  justify-content: flex-start;
  flex-wrap: nowrap;
  align-items: center;
}

.revision-round-card-header .result-section-title {
  flex: 0 0 auto;
}

.diagnosis-feedback-item-structured {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.75rem;
}

.diagnosis-feedback-select-actions {
  align-items: center;
  gap: 0;
  width: auto;
  margin-left: auto;
  padding-left: 0;
}

.diagnosis-feedback-select-label {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.diagnosis-feedback-select-label > span {
  display: inline-block;
  width: 2.8rem;
  min-width: 2.8rem;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.25;
  text-align: center;
}

.diagnosis-feedback-select {
  width: 172px;
  min-width: 172px;
  height: 32px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 2rem 0 0.7rem;
  border: 1px solid #d6dee8;
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.diagnosis-feedback-select-label::after,
.diagnosis-feedback-global-select-wrap::after {
  display: none;
}

.feedback-select-control {
  position: relative;
  width: 172px;
  min-width: 172px;
}

.diagnosis-feedback-global-select-wrap .feedback-select-control {
  width: 100%;
}

.feedback-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.feedback-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0.42rem 2rem 0.42rem 0.7rem;
  border: 1px solid #d6dee8;
  border-radius: 9px;
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.feedback-select-trigger::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  right: 11px;
  top: 50%;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  opacity: 0.72;
}

.feedback-select-control.is-open .feedback-select-trigger::after {
  transform: translateY(-30%) rotate(225deg);
}

.feedback-select-control.is-open .feedback-select-trigger {
  border-color: rgba(26, 110, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(26, 110, 181, 0.1);
}

.feedback-select-menu {
  position: fixed !important;
  z-index: 10000;
  top: calc(100% + 5px);
  left: 0;
  display: none;
  width: max(100%, 245px);
  max-height: min(250px, calc(100vh - 20px));
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  padding: 0.3rem;
  border: 1px solid #d6dee8;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(31, 52, 73, 0.16);
}

.feedback-select-control.is-open .feedback-select-menu {
  display: grid;
  gap: 0.25rem;
}

/* 菜单展开时会临时挂到 body，避免被左侧结果列表的滚动区域裁剪。 */
.feedback-select-menu.is-open {
  display: grid;
  gap: 0.25rem;
}

.feedback-select-option {
  width: 100%;
  padding: 0.5rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-secondary);
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.feedback-select-option:hover,
.feedback-select-option:focus-visible {
  border-color: rgba(26, 110, 181, 0.35);
  outline: none;
  filter: brightness(0.98);
}

.feedback-select-option-empty {
  background: #f8fafc;
  color: var(--text-muted);
}

.feedback-select-option-adopted {
  border-color: rgba(217, 119, 6, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(254, 243, 217, 0.98));
  color: #a16207;
}

.feedback-select-option-reasonable {
  background: #eff6ff;
  color: #245b9e;
}

.feedback-select-option-unreasonable {
  background: #f1f3f5;
  color: #64748b;
}

.feedback-select-control.feedback-select-adopted .feedback-select-trigger {
  border-color: rgba(217, 119, 6, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(254, 243, 217, 0.98));
  color: #a16207;
}

.feedback-select-control.feedback-select-reasonable .feedback-select-trigger {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #245b9e;
}

.feedback-select-control.feedback-select-unreasonable .feedback-select-trigger {
  border-color: #cbd5e1;
  background: #f1f3f5;
  color: #64748b;
}

.feedback-select-empty {
  border-color: #d6dee8;
  background: #fff;
  color: var(--text-secondary);
}

.feedback-select-adopted {
  border-color: rgba(217, 119, 6, 0.34);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), rgba(254, 243, 217, 0.98));
  color: #a16207;
}

.feedback-select-reasonable {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #245b9e;
}

.feedback-select-unreasonable {
  border-color: #cbd5e1;
  background: #f1f3f5;
  color: #64748b;
}

.diagnosis-feedback-select:focus {
  border-color: rgba(26, 110, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(26, 110, 181, 0.1);
}

.diagnosis-feedback-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #f4f6f8;
}

.diagnosis-feedback-global {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-top: 1px dashed rgba(193, 203, 214, 0.9);
  background: rgba(248, 250, 252, 0.72);
}

.diagnosis-feedback-global-title {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.5;
}

.diagnosis-feedback-global-select {
  width: 100%;
  min-height: 34px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0 2rem 0 0.7rem;
  border: 1px solid #d6dee8;
  border-radius: 10px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.82rem;
  outline: none;
}

.diagnosis-feedback-global-select-wrap {
  position: relative;
}

.diagnosis-feedback-global-select:focus {
  border-color: rgba(26, 110, 181, 0.55);
  box-shadow: 0 0 0 3px rgba(26, 110, 181, 0.1);
}

.diagnosis-feedback-global-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #f4f6f8;
}

.disposition-feedback-section-title {
  margin-top: 0.2rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(26, 110, 181, 0.14);
  border-radius: 12px;
  background: rgba(26, 110, 181, 0.06);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
}

.disposition-manual-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(214, 223, 233, 0.92);
  border-radius: 12px;
  background: #fff;
}

.disposition-manual-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.disposition-manual-group-header .form-label {
  margin: 0;
}

.disposition-manual-add-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(26, 110, 181, 0.25);
  border-radius: 7px;
  background: rgba(26, 110, 181, 0.08);
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
}

.disposition-manual-add-btn:hover {
  background: rgba(26, 110, 181, 0.16);
}

.disposition-manual-add-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.disposition-manual-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.disposition-manual-input-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.disposition-manual-input-row .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.disposition-manual-remove-btn {
  width: 28px;
  height: 36px;
  flex: 0 0 28px;
  padding: 0;
  border: 1px solid rgba(214, 93, 93, 0.28);
  border-radius: 7px;
  background: rgba(214, 93, 93, 0.07);
  color: #c84b4b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.disposition-manual-remove-btn:hover {
  background: rgba(214, 93, 93, 0.14);
  border-color: rgba(214, 93, 93, 0.42);
}

.disposition-manual-remove-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#diagnosisFeedbackDispositionManualSection .diagnosis-feedback-manual-list {
  gap: 0.55rem;
}

.disposition-feedback-decision-block {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.06);
}


.revision-round-card-header .revision-round-header-actions {
  margin-left: 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

.revision-round-header-actions .revision-round-tabs {
  flex: 0 1 auto;
  min-width: 0;
}

.revision-round-header-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.revision-round-header-actions .diagnosis-feedback-trigger {
  flex: 0 0 auto;
  margin-left: 0;
}

.revision-round-tab {
  border: 1px solid rgba(26,110,181,0.18);
  background: #fff;
  color: #406074;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.revision-round-tab:hover {
  border-color: rgba(26,110,181,0.4);
  color: #1a6eb5;
  transform: translateY(-1px);
}

.revision-round-tab.is-active {
  background: linear-gradient(135deg, #1a6eb5, #00b4a6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px rgba(26,110,181,0.18);
}

.result-section-header.revision-round-header-actions,
.card-header .revision-round-header-actions {
  align-items: center;
}

.revision-round-note {
  margin-top: 0.85rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(26, 110, 181, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(241, 246, 250, 0.96));
}

.revision-round-note-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.revision-round-note-time {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  background: rgba(82, 98, 116, 0.08);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.revision-round-note-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
