/* DOC Validator - Professional Medical Theme */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-blue: #0066cc;
  --primary-blue-dark: #004d99;
  --primary-blue-light: #e6f2ff;
  --accent-teal: #00a3a3;
  --text-primary: #1a2b3c;
  --text-secondary: #5a6b7c;
  --text-muted: #8a9bac;
  --border-light: #e0e8f0;
  --border-medium: #c0d0e0;
  --bg-light: #f5f8fb;
  --bg-card: #ffffff;
  --success-green: #00875a;
  --warning-amber: #ff8c00;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #0066cc 0%, #004080 50%, #002855 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--bg-card) !important;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 40px;
  backdrop-filter: blur(10px);
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  overflow: visible;
}

header {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.logo-mark {
  width: 48px;
  height: 48px;
  background: var(--primary-blue-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

h1 {
  color: var(--primary-blue);
  font-size: 1.75em;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95em;
  margin-bottom: 0;
  font-weight: 400;
}

/* Model Selector Banner */
.model-selector-banner {
  background: linear-gradient(135deg, var(--primary-blue-light) 0%, #f0f7ff 100%);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px auto;
  max-width: 700px;
}

.model-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.model-selector-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.model-selector-dropdown {
  padding: 10px 36px 10px 14px;
  border: 2px solid var(--border-medium);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230066cc' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 280px;
}

.model-selector-dropdown:hover {
  border-color: var(--primary-blue);
}

.model-selector-dropdown:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.model-info-tooltip {
  position: relative;
  cursor: help;
  color: var(--text-muted);
}

.model-info-tooltip .tooltip-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  width: 320px;
  z-index: 100;
  margin-top: 8px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.model-info-tooltip:hover .tooltip-content {
  display: block;
}

.model-description {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.model-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

.model-badge.womac-badge {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.model-badge.nrs-badge {
  background: #e6fff5;
  color: var(--success-green);
}

/* Validation Badges */
.validation-badge-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.validation-badge svg {
  color: var(--success-green);
}

.collaboration {
  color: #adb5bd;
  font-size: 0.9em;
  font-style: italic;
}

.privacy-notice {
  background: #e7f3ff;
  border-left: 4px solid #2196f3;
  padding: 15px;
  margin-bottom: 30px;
  border-radius: 4px;
  font-size: 0.9em;
}

.privacy-trust-panel {
  margin: 0 0 24px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #86efac;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.privacy-trust-panel__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.privacy-trust-panel__icon {
  flex-shrink: 0;
  color: #059669;
  margin-top: 2px;
}

.privacy-trust-panel__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #065f46;
  margin: 0 0 4px 0;
}

.privacy-trust-panel__lead {
  font-size: 0.88rem;
  color: #047857;
  margin: 0;
  line-height: 1.45;
}

.privacy-trust-list {
  margin: 0 0 12px 0;
  padding: 0 0 0 1.15rem;
  font-size: 0.86rem;
  color: #1e293b;
  line-height: 1.55;
}

.privacy-trust-list li {
  margin-bottom: 8px;
}

.privacy-trust-list li:last-child {
  margin-bottom: 0;
}

.privacy-trust-panel__footnote {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #bbf7d0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

.validation-badge--privacy {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #86efac !important;
}

.field-privacy-hint {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.82rem;
}

.analyze-privacy-reminder {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 12px 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #047857;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  line-height: 1.4;
}

.analyze-privacy-reminder svg {
  flex-shrink: 0;
  color: #059669;
}

.results-privacy-trust {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #065f46;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  line-height: 1.45;
}

.results-privacy-trust svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #059669;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.main-content .entry-section {
  grid-column: 1 / -1;
}

.upload-section {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.upload-section h2 {
  color: #495057;
  margin-bottom: 15px;
}

.drop-zone {
  border: 3px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin: 20px 0;
}

.drop-zone:hover {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.drop-zone.dragover {
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.drop-zone-content svg {
  color: var(--primary-blue);
  margin-bottom: 15px;
}

.drop-zone-content p {
  margin: 10px 0;
  color: #6c757d;
}

.or {
  font-size: 0.9em;
  color: #adb5bd;
}

.browse-btn {
  padding: 12px 24px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.browse-btn:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #e7f3ff;
  border-radius: 6px;
  margin: 15px 0;
}

.btn-primary {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0077ee 0%, var(--primary-blue) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.btn-primary:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.btn-analyze {
  font-size: 1.1rem;
  padding: 20px 32px;
}

.btn-secondary {
  padding: 14px 20px;
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e0;
  color: #334155;
  transform: translateY(-1px);
}

.requirements {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.requirements h3 {
  color: #495057;
  margin-bottom: 15px;
}

.requirements ul {
  list-style: none;
  padding-left: 0;
}

.requirements li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  color: #6c757d;
}

.requirements li:last-child {
  border-bottom: none;
}

.requirements em {
  color: #adb5bd;
  font-size: 0.9em;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  margin: 30px 0;
}

.loading p {
  color: #64748b;
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 24px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #f1f5f9;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  margin-bottom: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.results {
  margin-top: 40px;
  padding: 40px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.conservative-treatment-section {
  margin-top: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.results h2 {
  color: #1e293b;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 700;
  border-bottom: 3px solid #3b82f6;
  padding-bottom: 12px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Full-width rows inside summary grid (conservative block + research anchors) */
.summary-stats .conservative-treatment-wrap,
.summary-stats .conservative-anchors-panel,
.summary-stats .summary-stats-fullrow,
.summary-stats .surgery-risk-panel {
  grid-column: 1 / -1;
  width: 100%;
}

.surgery-risk-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 28px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 8px;
}

.surgery-risk-panel__headline {
  font-size: 2.75rem;
  font-weight: 700;
  color: #1e40af;
  line-height: 1.1;
  margin: 0;
}

.surgery-risk-panel__sub {
  font-size: 1rem;
  color: #64748b;
  margin: 4px 0 0 0;
}

.surgery-risk-panel__note {
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #92400e;
  line-height: 1.55;
  max-width: 100%;
}

@media (min-width: 769px) {
  .surgery-risk-panel--with-note {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    align-items: start;
    gap: 24px;
  }
}

.demo-preset-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.demo-preset-bar__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
}

.btn-demo-preset {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0369a1;
  background: #fff;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-demo-preset:hover {
  background: #f0f9ff;
  border-color: #0284c7;
}

.relief-goal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.relief-goal-bar__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  flex: 0 0 auto;
}

.relief-goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relief-goal-chip {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.relief-goal-chip:hover {
  border-color: #10b981;
  color: #047857;
}

.relief-goal-chip.active {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.relief-goal-summary {
  flex: 1 1 100%;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
  margin: 4px 0 0 0;
}

.conservative-treatment-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.45;
}

.conservative-treatment-card--selectable {
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.conservative-treatment-card--selectable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.conservative-treatment-card--selectable:focus {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.conservative-treatment-card--selected {
  box-shadow:
    0 0 0 2px #059669,
    0 0 0 4px rgba(5, 150, 105, 0.2) !important;
}

.conservative-treatment-card--goal-match:not(.conservative-treatment-card--selected) {
  box-shadow: 0 0 0 1px #86efac;
}

.conservative-treatment-card--goal-dim {
  opacity: 0.5;
}

#conservativeScoreContextSlot {
  margin-top: 4px;
}

#conservativeScoreContextSlot .score-context-block {
  margin-top: 0;
}

@media (min-width: 769px) {
  .relief-goal-summary {
    flex: 1 1 auto;
    margin: 0 0 0 8px;
  }
}

.stat-card {
  background: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e0;
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--primary-blue);
  margin-bottom: 5px;
}

.stat-label {
  color: #6c757d;
  font-size: 0.9em;
}

.plot-container {
  margin: 30px 0;
  text-align: center;
}

.plot-container img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.validation-metrics {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.validation-metrics h3 {
  color: #495057;
  margin-bottom: 15px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  color: #6c757d;
}

.metric-value {
  font-weight: 600;
  color: #495057;
}

.download-section {
  margin-top: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  text-align: center;
}

.download-btn {
  padding: 12px 30px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
}

.download-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
  text-align: center;
  color: #6c757d;
  font-size: 0.9em;
}

footer a {
  color: var(--primary-blue-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Outcome Prediction Section Styles */
.outcome-section {
  margin-top: 50px;
  padding: 40px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 3px solid #3b82f6;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.outcome-section h2 {
  color: #1e40af;
  margin-bottom: 20px;
}

.info-box {
  background: white;
  padding: 20px;
  border-left: 5px solid #3b82f6;
  border-radius: 8px;
  margin-bottom: 25px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-box p {
  margin: 10px 0;
  color: #475569;
  line-height: 1.6;
}

.outcome-card {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.outcome-card .metric-value {
  color: white;
}

.outcome-card.highlight-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.outcome-card.highlight-card .metric-value {
  color: white;
}

.outcome-card.highlight-card .metric-label {
  color: rgba(255, 255, 255, 0.9);
}

.outcome-card .metric-label {
  color: rgba(255, 255, 255, 0.9);
}

.outcome-results-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.outcome-results-container h3 {
  color: #1e40af;
  border-bottom: 3px solid #3b82f6;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.outcome-results-container h4 {
  color: #2563eb;
  margin: 25px 0 15px 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.plot-caption {
  text-align: center;
  color: #64748b;
  font-style: italic;
  margin-top: 10px;
}

.improvement-bands-table {
  margin: 30px 0;
}

.improvement-bands-table table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.improvement-bands-table th {
  background: #3b82f6;
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.improvement-bands-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
}

.improvement-bands-table tr:hover {
  background: #f8fafc;
}

.success-category-legend {
  background: #f7fafc;
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
  border: 2px solid #e2e8f0;
}

.success-category-legend h4 {
  color: #2d3748;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.legend-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.legend-category {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
}

.legend-description {
  color: #64748b;
  font-size: 0.85rem;
}

.legend-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.6;
}

.clinical-interpretation {
  margin: 30px 0;
}

.interpretation-box {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  padding: 20px;
}

.interpretation-box ul {
  margin: 15px 0;
  padding-left: 20px;
}

.interpretation-box li {
  margin: 10px 0;
  color: #78350f;
  line-height: 1.6;
}

#predictOutcomesBtn {
  width: 100%;
  padding: 18px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

#predictOutcomesBtn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

#predictOutcomesBtn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.plot-section {
  margin: 30px 0;
  text-align: center;
}

.plot-section canvas {
  max-width: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .summary-stats {
    grid-template-columns: 1fr;
  }

  .outcome-section {
    padding: 20px;
  }

  .improvement-bands-table {
    overflow-x: auto;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Manual Entry Form Styles
   ============================================================================ */

.entry-options {
  margin-bottom: 30px;
  grid-column: 1 / -1;
}

.entry-options h2 {
  color: #495057;
  margin-bottom: 15px;
}

.option-tabs {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.option-tab {
  flex: 1;
  padding: 15px 20px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4a5568;
}

.option-tab:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.option-tab.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.option-tab svg {
  flex-shrink: 0;
}

.entry-section {
  background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
  padding: 40px;
  border-radius: 20px;
  margin-bottom: 30px;
  grid-column: 1 / -1;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.entry-section h3 {
  color: #1a1a1a;
  margin-bottom: 12px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.entry-section > p {
  color: #64748b;
  margin-bottom: 32px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.patient-form {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.form-field {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.form-field label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a1a1a;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #1a1a1a;
  font-weight: 400;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):hover,
.form-field select:hover {
  border-color: #cbd5e0;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
  background: #ffffff;
}

/* Checkbox styling - ensure they're visible */
.form-field input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  accent-color: var(--primary-blue);
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  appearance: checkbox !important;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
}

.form-actions .btn-primary {
  flex: 1;
  margin-top: 0;
}

.form-actions .btn-secondary {
  flex: 0 0 auto;
}

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

.form-actions button svg {
  flex-shrink: 0;
}

#patientList {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e2e8f0;
}

#patientList h3 {
  color: #495057;
  margin-bottom: 20px;
}

.patient-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.patient-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.2s;
}

.patient-card:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.patient-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.patient-card-header strong {
  color: #2d3748;
  font-size: 1.1rem;
}

.patient-card-body {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
}

.btn-remove {
  background: #ef4444;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.btn-remove:hover {
  background: #dc2626;
}

.btn-remove svg {
  width: 14px;
  height: 14px;
}

/* Patient Outcome Cards */
.patient-outcome-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.patient-outcome-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filters-container {
  margin-bottom: 20px;
}

.filter-panel,
.sort-panel {
  transition: border-color 0.2s;
}

.filter-panel:hover,
.sort-panel:hover {
  border-color: #cbd5e0;
}

/* Responsive filters */
@media (max-width: 768px) {
  .filters-container {
    grid-template-columns: 1fr !important;
  }
}

.batch-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

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

.batch-actions button svg {
  flex-shrink: 0;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #48bb78;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s;
  z-index: 10000;
  font-weight: 500;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments for manual entry */
/* Mobile-first: Apply to all devices, then override for desktop */
@media (max-width: 1024px) {
  .form-field {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .form-field input[type="text"],
  .form-field input[type="number"],
  .form-field input[type="email"],
  .form-field select,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .patient-cards {
    grid-template-columns: 1fr;
  }

  .option-tabs {
    flex-direction: column;
  }

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

  .batch-actions {
    flex-direction: column;
  }

  /* Mobile input field fixes - ULTRA HIGH SPECIFICITY */
  .form-field input[type="text"],
  .form-field input[type="number"],
  .form-field input[type="email"],
  .form-field select,
  #patientId,
  #age,
  #sex,
  #bmi,
  #womac_r,
  #womac_l,
  #kl_r,
  #kl_l,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin: 0 !important;
    display: block !important;
    flex: 1 1 100% !important;
  }

  /* Override inline styles in VAS fields */
  #vas_r_rest,
  #vas_r_walking,
  #vas_l_rest,
  #vas_l_walking {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .form-field select,
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
  }

  .entry-section {
    padding: 24px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .patient-form {
    padding: 24px 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .container {
    padding: 16px !important;
    border-radius: 16px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: white !important;
    position: relative !important;
    z-index: 1 !important;
  }

  body {
    padding: 10px !important;
  }

  /* Fix VAS field grid on mobile */
  #vas_r_field > div[style*="grid"],
  #vas_l_field > div[style*="grid"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    display: grid !important;
  }

  /* Ensure form-field containers don't constrain width */
  .form-field {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Override any grid column constraints */
  .form-field[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  /* Ensure patient-form doesn't constrain */
  .patient-form {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Override container max-width on mobile */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    background: white !important;
    position: relative !important;
    z-index: 1 !important;
  }

  /* Fix radio button layout on mobile - stack vertically */
  /* Pain score radio buttons - prevent wrapping on desktop */
.pain-score-options {
  display: flex !important;
  gap: 20px;
  flex-wrap: nowrap !important;
  align-items: center;
  overflow-x: auto; /* Allow horizontal scroll on very small screens if needed */
}

.pain-score-options label {
  flex-shrink: 0 !important;
  min-width: fit-content !important;
  white-space: nowrap !important;
}

/* On very small desktop screens, ensure buttons stay in line */
@media (min-width: 768px) {
  .pain-score-options {
    flex-wrap: nowrap !important;
    overflow-x: visible;
  }
  
  .pain-score-options label {
    flex: 0 0 auto;
  }
}

.pain-score-options-old {
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .pain-score-options label {
    width: 100% !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
  }

  .pain-score-options label:hover {
    border-color: #cbd5e0 !important;
    background: #f8fafc !important;
  }

  .pain-score-options label span {
    white-space: normal !important;
    word-wrap: break-word !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
  }
}

/* Radio button styling - make them clearly visible */
.pain-score-options input[type="radio"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  margin: 0 !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  border: 2px solid #94a3b8 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  position: relative !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.pain-score-options input[type="radio"]:checked {
  border-color: var(--primary-blue) !important;
  background: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2) !important;
}

.pain-score-options input[type="radio"]:checked::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
}

.pain-score-options input[type="radio"]:focus {
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2) !important;
}

.pain-score-options label:has(input[type="radio"]:checked) {
  border-color: var(--primary-blue) !important;
  background: var(--primary-blue-light) !important;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1) !important;
}

.pain-score-options label:has(input[type="radio"]:checked) span {
  color: var(--primary-blue) !important;
  font-weight: 600 !important;
}

/* Desktop radio button styling - ensure all buttons fit within container */
@media (min-width: 769px) {
  .pain-score-options {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px !important; /* Reduced gap to fit better */
    align-items: center !important;
    overflow-x: hidden !important; /* Prevent overflow */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .pain-score-options label {
    padding: 8px 10px !important; /* Slightly reduced padding */
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    flex: 1 1 0 !important; /* Allow buttons to share space equally */
    min-width: 0 !important; /* Allow shrinking if needed */
    white-space: nowrap !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  
  .pain-score-options label span {
    font-size: 0.9rem !important; /* Slightly smaller font */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .pain-score-options label:hover {
    border-color: #cbd5e0 !important;
    background: #f8fafc !important;
  }

  .pain-score-options label:has(input[type="radio"]:checked) {
    border-color: var(--primary-blue) !important;
    background: var(--primary-blue-light) !important;
  }
}

/* Desktop: Hide ALL mobile form elements, show desktop form */
@media (min-width: 769px) {
  /* Hide entire mobile form container */
  form.mobile-form,
  #mobilePatientForm,
  .mobile-form {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Hide all mobile steps (including active ones) */
  .mobile-step,
  .mobile-step.active,
  #mobileStep1,
  #mobileStep2,
  #mobileStep3,
  #mobileStep4,
  [id^="mobileStep"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  /* Hide mobile-specific UI elements */
  .step-header,
  .step-indicator,
  .step-dot,
  .step-dot.active,
  .btn-mobile-next,
  .btn-mobile-back,
  .btn-mobile-clear,
  .mobile-form-fields,
  .mobile-form-actions {
    display: none !important;
    visibility: hidden !important;
  }
  
  /* Show desktop form */
  .desktop-form,
  form.desktop-form,
  #patientForm.patient-form.desktop-form {
    display: block !important;
    visibility: visible !important;
  }
}

/* Mobile: Hide desktop form, show mobile form */
@media (max-width: 768px) {
  .desktop-form {
    display: none !important;
  }
  
  .mobile-form {
    display: block !important;
  }
}

/* Mobile Multi-Step Form Styles */
.mobile-form {
  display: none;
  width: 100%;
}

.mobile-step {
  width: 100%;
  padding: 0;
  display: none !important; /* Hide all steps by default */
}

.mobile-step.active {
  display: block !important; /* Show active step */
}

/* Desktop: Force hide mobile form elements */
@media (min-width: 769px) {
  .mobile-form,
  .mobile-step,
  .mobile-step.active,
  .step-header,
  .step-indicator,
  .btn-mobile-next,
  .btn-mobile-back,
  .btn-mobile-clear,
  .mobile-form-fields,
  .mobile-form-actions {
    display: none !important;
    visibility: hidden !important;
  }
}

.step-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.step-header h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.step-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e0;
  transition: all 0.3s ease;
}

.step-dot.active {
  background: #1a1a1a;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.2);
}

.mobile-form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.mobile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 24px;
  border-top: 2px solid #e2e8f0;
  position: sticky;
  bottom: 0;
  background: white;
  padding-bottom: 16px;
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

.btn-mobile-next,
.btn-mobile-back,
.btn-mobile-analyze,
.btn-mobile-clear {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-mobile-next span,
.btn-mobile-back span,
.btn-mobile-analyze span,
.btn-mobile-clear span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-mobile-next {
  background: #1a1a1a;
  color: white;
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
}

.btn-mobile-next:hover {
  transform: translateY(-2px);
  background: #2d2d2d;
  box-shadow: 0 6px 16px rgba(26, 26, 26, 0.4);
}

.btn-mobile-back {
  background: #f5f5f5;
  color: #1a1a1a;
  border: 2px solid #d4d4d4;
}

.btn-mobile-back:hover {
  background: #e5e5e5;
  border-color: #a3a3a3;
}

.btn-mobile-analyze {
  background: #1a1a1a;
  color: white;
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
  flex: 1.5 1 auto;
}

.btn-mobile-analyze:hover {
  transform: translateY(-2px);
  background: #2d2d2d;
  box-shadow: 0 6px 16px rgba(26, 26, 26, 0.4);
}

.btn-mobile-clear {
  background: #fee2e2;
  color: #dc2626;
  border: 2px solid #fecaca;
}

.btn-mobile-clear:hover {
  background: #fecaca;
  border-color: #fca5a5;
}

.mobile-pain-score-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.mobile-radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.2s ease;
  min-height: 56px;
}

.mobile-radio-label:hover {
  border-color: #cbd5e0;
  background: #f8fafc;
}

.mobile-radio-label input[type="radio"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: #ffffff;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-radio-label input[type="radio"]:checked {
  border-color: #1a1a1a;
  background: #1a1a1a;
  box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.2);
}

.mobile-radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
}

.mobile-radio-label:has(input[type="radio"]:checked) {
  border-color: #1a1a1a;
  background: #f5f5f5;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.mobile-radio-label:has(input[type="radio"]:checked) span {
  color: #1a1a1a;
  font-weight: 600;
}

.mobile-radio-label span {
  font-weight: 500;
  color: #1a1a1a;
  flex-grow: 1;
  font-size: 1rem;
}

/* Mobile-specific color scheme improvements */
@media (max-width: 768px) {
  body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  }

  .container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }

  .form-field label {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.95rem;
  }

  .form-field input,
  .form-field select {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #1e293b;
  }

  .form-field input:focus,
  .form-field select:focus {
    background: #ffffff;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.1);
  }
  
  .step-header {
    border-bottom: 2px solid #e5e5e5;
  }
  
  .mobile-form-actions {
    border-top: 2px solid #e5e5e5;
    padding-left: 0;
    padding-right: 0;
  }
  
  .btn-mobile-next,
  .btn-mobile-back,
  .btn-mobile-analyze,
  .btn-mobile-clear {
    font-size: 0.85rem;
    padding: 12px 14px;
    min-height: 44px;
  }
  
  /* Hide privacy notice and intro text on steps 2-4 */
  .mobile-step-1-only {
    display: block;
  }
  
  .mobile-step.active ~ * .mobile-step-1-only,
  .mobile-step[data-step="2"].active ~ * .mobile-step-1-only,
  .mobile-step[data-step="3"].active ~ * .mobile-step-1-only,
  .mobile-step[data-step="4"].active ~ * .mobile-step-1-only,
  body:has(.mobile-step[data-step="2"].active) .mobile-step-1-only,
  body:has(.mobile-step[data-step="3"].active) .mobile-step-1-only,
  body:has(.mobile-step[data-step="4"].active) .mobile-step-1-only {
    display: none !important;
  }
}

/* Hide privacy notice and intro text on mobile steps 2-4 */
@media (max-width: 768px) {
  .mobile-step[data-step="2"].active ~ * .mobile-step-1-only,
  .mobile-step[data-step="3"].active ~ * .mobile-step-1-only,
  .mobile-step[data-step="4"].active ~ * .mobile-step-1-only {
    display: none !important;
  }
  
  /* Use JavaScript to toggle visibility */
  body.mobile-step-2 .mobile-step-1-only,
  body.mobile-step-3 .mobile-step-1-only,
  body.mobile-step-4 .mobile-step-1-only {
    display: none !important;
  }
  
  /* Hide loading spinner on mobile steps 2-4, even if inline style tries to show it */
  body.mobile-step-2 #loading.mobile-step-1-only,
  body.mobile-step-3 #loading.mobile-step-1-only,
  body.mobile-step-4 #loading.mobile-step-1-only {
    display: none !important;
  }
  
  /* Also hide loading when not on step 1, using step active state */
  .mobile-step[data-step="2"].active ~ #loading,
  .mobile-step[data-step="3"].active ~ #loading,
  .mobile-step[data-step="4"].active ~ #loading,
  body:has(.mobile-step[data-step="2"].active) #loading.mobile-step-1-only,
  body:has(.mobile-step[data-step="3"].active) #loading.mobile-step-1-only,
  body:has(.mobile-step[data-step="4"].active) #loading.mobile-step-1-only {
    display: none !important;
  }
}

.mobile-results-content {
  width: 100%;
  min-height: 200px;
  padding: 0;
}

.mobile-results-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.mobile-results-content .summary-stats {
  margin-top: 24px;
}

.mobile-results-content .stat-card {
  margin-bottom: 16px;
}

.desktop-results {
  /* Desktop results stay visible on desktop */
}

/* Calibration Toggle Styles */
.calibration-toggle {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.calibration-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--primary-blue-light) 0%, #f0f7ff 100%);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calibration-option:hover {
  border-color: var(--primary-blue);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.calibration-option input[type="checkbox"] {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  margin-top: 2px;
  padding: 0 !important;
  cursor: pointer;
  accent-color: var(--primary-blue);
  flex-shrink: 0;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  appearance: checkbox !important;
}

.calibration-option input[type="checkbox"]:checked {
  background-color: var(--primary-blue);
}

.calibration-option:has(input[type="checkbox"]:checked) {
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}

.calibration-option label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  flex: 1;
}

.calibration-option .calibration-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.calibration-option .calibration-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.calibration-option .calibration-sources {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Clinical intelligence suite (IQVIA / enterprise) --- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #0c4a6e 100%);
}

.container {
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.clinical-intelligence-suite {
  text-align: left;
  margin: 24px 0 8px;
  padding: 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.suite-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.suite-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.suite-lead {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
  max-width: 52rem;
}

.suite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.suite-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.suite-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.suite-card-static {
  background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
}

.suite-step {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.suite-card-head {
  margin-bottom: 12px;
  padding-right: 32px;
}

.suite-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.suite-tech {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 4px;
}

.suite-select-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.suite-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  background: #fff;
  color: #0f172a;
}

.suite-hint {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
}

.suite-explain-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suite-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
  cursor: pointer;
}

.suite-checkbox-label input {
  margin-top: 2px;
  flex-shrink: 0;
}

.mobile-suite-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: #475569;
  cursor: pointer;
}

.mobile-suite-checkbox input {
  flex-shrink: 0;
}

.risk-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-pill-group--compact .risk-pill {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  padding: 8px 10px;
}

.risk-pill {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.risk-pill:hover {
  border-color: #94a3b8;
}

.risk-pill.active {
  border-color: #0f172a;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.suite-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suite-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.suite-badge-alt {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.suite-evidence-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 0.78rem;
  color: #854d0e;
  line-height: 1.5;
}

.suite-evidence-strip svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #b45309;
}

.analytics-opt-in {
  margin: 12px 0 0;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}

.analytics-opt-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: #475569;
  cursor: pointer;
  line-height: 1.45;
}

.analytics-opt-label input {
  margin-top: 3px;
  accent-color: #0f172a;
}

.mobile-suite-panel {
  grid-column: 1 / -1;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 8px;
}

.mobile-suite-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0 0 10px;
}

.mobile-suite-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.mobile-suite-select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .clinical-intelligence-suite {
    padding: 16px;
  }
  .suite-grid {
    grid-template-columns: 1fr;
  }
}

/* What this score means — educational interpretation layer */
.score-context-block {
  margin: 20px 0 24px;
  padding: 18px 20px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.score-context-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.score-context-header-title {
  color: #475569;
}

.score-context-info-icon {
  cursor: help;
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1;
}

.score-context-current {
  margin-bottom: 14px;
}

.score-context-predicted {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.score-context-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.score-context-current p,
.score-context-predicted p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

.score-context-footer {
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
  line-height: 1.45;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

/* Clinician print summary */
@media print {
  body {
    background: #fff !important;
    padding: 0 !important;
  }
  .clinical-intelligence-suite,
  .patient-form,
  .desktop-form,
  .mobile-form,
  #manualEntrySection,
  .entry-section,
  .privacy-notice,
  .analytics-opt-in,
  .validation-badge-row,
  .no-print,
  .suite-evidence-strip,
  #loading,
  footer {
    display: none !important;
  }
  .container {
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 16px !important;
  }
  #results,
  .results,
  .clinical-print-block {
    display: block !important;
  }
  .clinical-headline-banner {
    border-color: #64748b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
