/*
 * EDI Lab shared card styles.
 * Applied to any page that renders decode cards via includes/edi_lab_renderer.php.
 * Mirrors the styles that live inline in edi-lab.php so the cards look identical
 * to what the live Lab produces.
 */

.edi-lab-decode-card,
.edi-lab-decode-card * {
  --navy: #1a2436;
  --navy-mid: #253651;
  --teal: #19bab0;
  --teal-dim: #148f87;
  --gold: #f59e0b;
  --red: #ef4444;
  --font-edi: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --shadow-md: 0 4px 24px rgba(0,0,0,.1);
}

.edi-lab-decode-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 24px 0;
  border: 1px solid var(--gray-200);
  font-family: var(--font-edi);
  color: var(--gray-700);
}

.edi-lab-decode-card .result-card-header {
  background: var(--navy);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.edi-lab-decode-card .code-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.edi-lab-decode-card .code-badge {
  background: var(--teal);
  color: white;
  font-family: 'Courier New', Courier, monospace;
  font-size: 20px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.edi-lab-decode-card .code-type {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.edi-lab-decode-card .code-name {
  color: white;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-top: 4px;
  max-width: 460px;
}

.edi-lab-decode-card .risk-badge {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.edi-lab-decode-card .risk-critical { background: #7f1d1d; color: #fca5a5; }
.edi-lab-decode-card .risk-high     { background: #78350f; color: #fcd34d; }
.edi-lab-decode-card .risk-medium   { background: #1e3a5f; color: #93c5fd; }
.edi-lab-decode-card .risk-low      { background: #14532d; color: #86efac; }
.edi-lab-decode-card .risk-deactivated { background: #450a0a; color: #fca5a5; }

.edi-lab-decode-card .result-card-body { padding: 0; }

.edi-lab-decode-card .result-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.edi-lab-decode-card .result-section:last-child { border-bottom: none; }

.edi-lab-decode-card .rs-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--gray-400);
  margin-bottom: 10px;
}

.edi-lab-decode-card .rs-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--gray-700);
}

.edi-lab-decode-card .rs-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.edi-lab-decode-card .rs-content li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-left: 0;
}

.edi-lab-decode-card .rs-content li::before {
  content: '\2192';
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}

.edi-lab-decode-card .card-verified-line a { color: inherit; text-decoration: underline; }

/* Pairings table (for CARC-solo pages listing common RARCs) */
.edi-pairings {
  margin: 24px 0;
  padding: 20px 24px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fafbfc;
}
.edi-pairings h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--navy);
  font-family: var(--font-edi);
}
.edi-pairings-note {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0 0 14px;
}
.edi-pairings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}
.edi-pairings-table th,
.edi-pairings-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
/* RARC code column narrow, Definition wide, Scenario roomy so labels wrap naturally */
.edi-pairings-table th:nth-child(1),
.edi-pairings-table td:nth-child(1) { width: 9%; }
.edi-pairings-table th:nth-child(2),
.edi-pairings-table td:nth-child(2) { width: 55%; }
.edi-pairings-table th:nth-child(3),
.edi-pairings-table td:nth-child(3) { width: 36%; }
.edi-pairings-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.edi-pairings-table tr:last-child td { border-bottom: none; }
.edi-pairings-table a { color: var(--teal-dim); text-decoration: none; }
.edi-pairings-table a:hover { text-decoration: underline; }

/* Lab CTA card */
.edi-lab-cta {
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0d4775 0%, #1f5489 100%);
  color: #ffffff;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.edi-lab-cta p { margin: 0; font-size: 14.5px; line-height: 1.55; max-width: 640px; color: #eef4fb; }
.edi-lab-cta p strong { color: #ffffff; }
.edi-lab-cta-btn {
  background: #19bab0;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.edi-lab-cta-btn:hover { background: #148f87; }

/* ────────────────────────────────────────────────────────────
   Combined CARC + RARC panel (used on decode pages via the
   shared renderer). Mirrors the .combined-story styles from
   the live EDI Lab so decode pages match pixel-for-pixel.
   On decode pages the panel is always shown, so we override
   the Lab's display:none default via .edi-lab-decode-combined.
   ──────────────────────────────────────────────────────────── */
.edi-lab-decode-combined,
.combined-story.visible.edi-lab-decode-combined {
  display: block;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--gray-200, #e5e7eb);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.edi-lab-decode-combined .cs-header {
  background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%);
  padding: 20px 24px;
}
.edi-lab-decode-combined .cs-equation {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.edi-lab-decode-combined .cs-eq-part {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  font-weight: 700;
  color: white;
}
.edi-lab-decode-combined .cs-eq-part.teal {
  background: #19bab0;
  border-color: #19bab0;
}
.edi-lab-decode-combined .cs-eq-plus,
.edi-lab-decode-combined .cs-eq-equals {
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  font-weight: 300;
}
.edi-lab-decode-combined .cs-headline {
  color: white;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 8px;
}
.edi-lab-decode-combined .cs-subhead {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}
.edi-lab-decode-combined .cs-body { padding: 0; }
.edi-lab-decode-combined .cs-section {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f2f4;
}
.edi-lab-decode-combined .cs-section:last-child { border-bottom: none; }
.edi-lab-decode-combined .cs-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-bottom: 8px;
}
.edi-lab-decode-combined .cs-section-content {
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}
.edi-lab-decode-combined .cs-content-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.edi-lab-decode-combined .cs-content-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.65;
  color: #374151;
}
.edi-lab-decode-combined .cs-content-list li::before {
  content: '\2192';
  color: #19bab0;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
