/* UTMB Clinical Trials Search: Design System
   Tokens: primary UTMB blue, neutral slate, semantic statuses
   Type:   Inter (UI) + Source Serif 4 (display)
*/

:root {
  /* Brand: UTMB Health official palette */
  --utmb-blue: #003767;        /* navy from the official mark */
  --utmb-blue-700: #002951;
  --utmb-blue-800: #001B3A;
  --utmb-blue-50: #E6ECF3;
  --utmb-blue-100: #C2D0DF;
  --utmb-blue-600: #1D4E80;    /* slightly lighter for hover lift on dark surfaces */

  --utmb-orange: #CA4B0C;      /* accent from the mark */
  --utmb-orange-50: #FBEEE6;
  --utmb-orange-700: #A53D09;

  /* Neutrals */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Semantic */
  --success-50: #ECFDF5;
  --success-600: #059669;
  --success-700: #047857;
  --info-50: #EFF6FF;
  --info-600: #2563EB;
  --info-700: #1D4ED8;
  --warning-50: #FFFBEB;
  --warning-600: #D97706;
  --warning-700: #B45309;
  --danger-50: #FEF2F2;
  --danger-600: #DC2626;
  --danger-700: #B91C1C;

  /* Surfaces */
  --bg: #FFFFFF;
  --bg-muted: var(--slate-50);
  --surface: #FFFFFF;
  --border: var(--slate-200);
  --border-strong: var(--slate-300);
  --text: var(--slate-900);
  --text-muted: var(--slate-600);
  --text-subtle: var(--slate-500);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 40px -12px rgba(0, 62, 105, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout */
  --container: 1180px;
  --header-height: 76px;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", "Georgia", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-muted);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--utmb-blue);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover { color: var(--utmb-blue-700); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 85, 140, 0.35);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button { font-family: inherit; }

img { max-width: 100%; height: auto; display: block; }

/* ------- Skip link ------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--utmb-blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ------- Header ------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-xs);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--utmb-blue-800);
  font-weight: 600;
}
.brand:hover { color: var(--utmb-blue-800); }
.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand-divider {
  height: 32px;
  width: 1px;
  background: var(--border);
}
.brand-product {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-product-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--slate-900);
  letter-spacing: -0.01em;
}
.brand-product-sub {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.header-nav a {
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.94rem;
}
.header-nav a:hover { color: var(--utmb-blue); }
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--utmb-blue);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 40px;
  border: 1px solid var(--utmb-blue-700);
}
.header-cta:hover { background: var(--utmb-blue-700); }

/* ------- Layout shells ------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

main { min-height: calc(100vh - var(--header-height) - 120px); }

/* ------- Hero ------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 540px at 85% -10%, rgba(0, 85, 140, 0.10), transparent 60%),
    radial-gradient(900px 460px at 5% 0%, rgba(0, 85, 140, 0.06), transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: end;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--utmb-orange-50);
  color: var(--utmb-orange-700);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(202, 75, 12, 0.18);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--slate-900);
  margin: 20px 0 12px;
  max-width: 22ch;
}
.hero p.lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 28px;
}

/* ------- Search card ------- */
.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.search-card h2 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: 0 0 16px;
  font-weight: 600;
}
.search-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-items: end;            /* line every input up on a common baseline */
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;                /* allow inputs to shrink in narrow columns */
}
.field-condition  { grid-column: span 6; }
.field-location   { grid-column: span 6; }
.field-status     { grid-column: span 3; }
.field-phase      { grid-column: span 3; }
.field-study-type { grid-column: span 3; }
.field-term       { grid-column: span 3; }
.field > label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;            /* same height across fields → inputs align */
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field .helper {
  font-size: 0.78rem;
  color: var(--text-subtle);
}
.input,
.select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 0.97rem;
  background: #fff;
  color: var(--slate-900);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input::placeholder { color: var(--slate-400); }
.input:hover, .select:hover { border-color: var(--slate-400); }
.input:focus, .select:focus {
  border-color: var(--utmb-blue);
  box-shadow: 0 0 0 4px rgba(0, 85, 140, 0.12);
  outline: none;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2364748B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.search-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.search-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.97rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  min-width: 44px;
}
.btn-primary {
  background: var(--utmb-blue);
  color: #fff;
  border-color: var(--utmb-blue-700);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--utmb-blue-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: #fff;
  color: var(--slate-700);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--slate-50); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  height: auto;
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--utmb-blue); background: var(--utmb-blue-50); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ------- Trial Finder promo (homepage) ------- */
.finder-promo {
  position: relative;
  padding: 76px 0;
  background:
    radial-gradient(900px 480px at 12% 0%, rgba(0, 55, 103, 0.10), transparent 60%),
    radial-gradient(700px 420px at 100% 100%, rgba(202, 75, 12, 0.08), transparent 60%),
    linear-gradient(180deg, var(--utmb-blue-50) 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border);
}
.finder-promo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.finder-promo-copy h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--slate-900);
  margin: 18px 0 14px;
  max-width: 22ch;
}
.finder-promo-copy .lede {
  font-size: 1.02rem;
  color: var(--text-muted);
  margin: 0 0 22px;
  max-width: 56ch;
}
.finder-promo-points {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: grid;
  gap: 10px;
}
.finder-promo-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--slate-800);
  font-size: 0.97rem;
  line-height: 1.5;
}
.finder-promo-points svg {
  color: var(--success-600);
  flex: 0 0 auto;
  margin-top: 2px;
}
.finder-promo-cta {
  height: 50px;
  padding: 0 22px;
  font-size: 1rem;
}

/* Mock preview stack */
.finder-promo-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.finder-preview-extract {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--utmb-blue);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
}
.finder-preview-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--utmb-blue-700);
  margin-bottom: 4px;
}
.finder-preview-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--slate-900);
  margin-bottom: 12px;
}
.finder-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.finder-preview-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.finder-preview-tag.stage {
  background: var(--utmb-orange-50);
  color: var(--utmb-orange-700);
  border-color: rgba(202, 75, 12, 0.25);
}
.finder-preview-tag.bio {
  background: var(--utmb-blue-50);
  color: var(--utmb-blue-700);
  border-color: var(--utmb-blue-100);
}
.finder-preview-tag.demo {
  background: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-200);
}

.finder-preview-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease;
}
.finder-preview-card:hover { transform: translateY(-2px); }
.finder-preview-card.subdued {
  background: #FFF8F8;
  border-color: rgba(220, 38, 38, 0.18);
}
.finder-preview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.finder-preview-card-title {
  font-weight: 600;
  color: var(--slate-900);
  font-size: 0.98rem;
  line-height: 1.35;
}
.finder-preview-card-title em {
  font-style: normal;
  background: #FEF3C7;
  color: #78350F;
  padding: 0 4px;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(217, 119, 6, 0.25);
}
.finder-preview-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.finder-preview-card.subdued .finder-preview-card-meta strong {
  color: var(--danger-700);
}

@media (max-width: 960px) {
  .finder-promo { padding: 56px 0; }
  .finder-promo-grid { grid-template-columns: 1fr; gap: 28px; }
  .finder-promo-copy h2 { max-width: none; }
}

/* ------- Feature strip (homepage) ------- */
.features {
  padding: 72px 0;
}
.features-header {
  text-align: center;
  margin-bottom: 40px;
}
.features-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--slate-900);
}
.features-header p {
  color: var(--text-muted);
  margin: 0;
  max-width: 60ch;
  margin-inline: auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.feature:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--utmb-blue-50);
  color: var(--utmb-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--slate-900);
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ------- Results layout ------- */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 28px 0 22px;
}
.page-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--slate-900);
}
.result-count {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}
.result-count strong { color: var(--slate-900); }

.results-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0 64px;
}
.filters {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  align-self: start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}
.filters h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: 0 0 14px;
  font-weight: 600;
}
.filters .field { margin-bottom: 14px; }
.filters .filters-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.filters .filters-actions .btn { flex: 1; height: 42px; padding: 0 14px; font-size: 0.9rem; }

.results { min-width: 0; }

.trial-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  margin-bottom: 14px;
  transition: box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease;
  box-shadow: var(--shadow-xs);
}
.trial-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--slate-300);
}
.trial-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.trial-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--slate-900);
  letter-spacing: -0.005em;
}
.trial-card h3 a { color: inherit; }
.trial-card h3 a:hover { color: var(--utmb-blue); }
.trial-card .summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 8px 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.trial-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trial-meta-item svg { color: var(--slate-400); }
.trial-meta-item.is-matched {
  color: var(--success-700);
  font-weight: 600;
}
.trial-meta-item.is-matched svg { color: var(--success-600); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}
.tag.phase {
  background: var(--utmb-blue-50);
  color: var(--utmb-blue-700);
  border-color: var(--utmb-blue-100);
}

/* status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.status-pill.success { background: var(--success-50); color: var(--success-700); border-color: rgba(5, 150, 105, 0.2); }
.status-pill.info    { background: var(--info-50);    color: var(--info-700);    border-color: rgba(37, 99, 235, 0.2); }
.status-pill.warning { background: var(--warning-50); color: var(--warning-700); border-color: rgba(217, 119, 6, 0.25); }
.status-pill.danger  { background: var(--danger-50);  color: var(--danger-700);  border-color: rgba(220, 38, 38, 0.2); }
.status-pill.neutral { background: var(--slate-100);  color: var(--slate-700);   border-color: var(--slate-200); }

/* pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 12px;
}
.pagination .hint { color: var(--text-subtle); font-size: 0.88rem; }

/* empty / error states */
.empty,
.error-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  color: var(--text-muted);
}
.empty h3,
.error-box h3 {
  margin: 8px 0 6px;
  color: var(--slate-900);
  font-size: 1.15rem;
}
.empty p,
.error-box p { margin: 0 auto; max-width: 52ch; }

.error-box {
  border-color: rgba(220, 38, 38, 0.25);
  background: var(--danger-50);
  color: var(--danger-700);
  text-align: left;
}
.error-box h3 { color: var(--danger-700); }

.inline-error {
  margin-top: 14px;
  background: var(--danger-50);
  color: var(--danger-700);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

/* ------- Match panel (Trial Finder → Trial detail) ------- */
.match-panel {
  background: linear-gradient(180deg, #FFFFFF 0%, var(--utmb-blue-50) 100%);
  border: 1px solid var(--utmb-blue-100);
  border-radius: var(--radius-lg);
  padding: 22px 24px 20px;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.match-panel::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 4px;
  background: var(--utmb-blue);
  border-radius: 0 4px 4px 0;
}
.match-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.match-panel-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--utmb-blue-700);
  margin-bottom: 2px;
}
.match-panel-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--slate-900);
}
.match-back { height: 38px; padding: 0 14px; font-size: 0.88rem; }

.match-section { margin-bottom: 14px; }
.match-section:last-child { margin-bottom: 0; }
.match-sublabel {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 8px;
}

.match-tag.condition {
  background: var(--utmb-blue);
  color: #fff;
  border-color: var(--utmb-blue-700);
}
.match-tag.stage {
  background: var(--utmb-orange-50);
  color: var(--utmb-orange-700);
  border-color: rgba(202, 75, 12, 0.25);
}
.match-tag.biomarker {
  background: var(--utmb-blue-50);
  color: var(--utmb-blue-700);
  border-color: var(--utmb-blue-100);
}
.match-tag.age,
.match-tag.sex {
  background: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-200);
}

/* Ineligibility section in match panel */
.match-ineligible {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--danger-50);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-left: 4px solid var(--danger-600);
  border-radius: var(--radius-md);
}
.match-ineligible-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--danger-700);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.match-ineligible ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.match-ineligible li {
  font-size: 0.9rem;
  color: var(--danger-700);
}
.match-ineligible li strong { color: var(--danger-700); }

.match-confirmed {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-confirmed li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.match-check {
  color: var(--success-600);
  flex: 0 0 auto;
  margin-top: 1px;
}
.match-confirmed-text { display: flex; flex-direction: column; gap: 2px; }
.match-confirmed-text strong {
  font-weight: 600;
  color: var(--slate-900);
  font-size: 0.97rem;
}
.match-where {
  font-size: 0.83rem;
  color: var(--text-muted);
}
.match-noconfirm,
.match-foot {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.match-tip {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

/* Confidence badge */
.match-panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.confidence-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  min-width: 168px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.confidence-bar {
  width: 100%;
  height: 6px;
  background: var(--slate-100);
  border-radius: 3px;
  overflow: hidden;
}
.confidence-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 240ms ease;
}
.confidence-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.confidence-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.confidence-score {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.confidence-badge.high .confidence-bar span { background: var(--success-600); }
.confidence-badge.high .confidence-label    { color: var(--success-700); }
.confidence-badge.high                      { border-color: rgba(5, 150, 105, 0.35); }
.confidence-badge.moderate .confidence-bar span { background: var(--info-600); }
.confidence-badge.moderate .confidence-label    { color: var(--info-700); }
.confidence-badge.moderate                      { border-color: rgba(37, 99, 235, 0.35); }
.confidence-badge.low .confidence-bar span      { background: var(--warning-600); }
.confidence-badge.low .confidence-label         { color: var(--warning-700); }
.confidence-badge.low                           { border-color: rgba(217, 119, 6, 0.35); }
.confidence-badge.indirect .confidence-bar span { background: var(--slate-400); }
.confidence-badge.indirect .confidence-label    { color: var(--slate-700); }

/* Compact confidence pill (used on trial cards in the Finder) */
.trial-card-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.confidence-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.confidence-pill.high {
  background: var(--success-50);
  color: var(--success-700);
  border-color: rgba(5, 150, 105, 0.25);
}
.confidence-pill.moderate {
  background: var(--info-50);
  color: var(--info-700);
  border-color: rgba(37, 99, 235, 0.25);
}
.confidence-pill.low {
  background: var(--warning-50);
  color: var(--warning-700);
  border-color: rgba(217, 119, 6, 0.3);
}
.confidence-pill.indirect {
  background: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-200);
}
.confidence-pill.ineligible {
  background: var(--danger-50);
  color: var(--danger-700);
  border-color: rgba(220, 38, 38, 0.3);
}
.confidence-badge.ineligible .confidence-bar span { background: var(--danger-600); }
.confidence-badge.ineligible .confidence-label    { color: var(--danger-700); }
.confidence-badge.ineligible                      { border-color: rgba(220, 38, 38, 0.35); }

/* Inline highlight markers */
mark.match-highlight {
  background: #FEF3C7;
  color: #78350F;
  padding: 0 4px;
  margin: 0 -1px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: inset 0 -1px 0 rgba(217, 119, 6, 0.25);
}
mark.match-highlight:hover {
  background: #FDE68A;
}

/* ------- Trial detail page ------- */
.detail {
  padding: 32px 0 64px;
}
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.detail-back:hover { color: var(--utmb-blue); }

.detail-hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.detail-hero .nct {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}
.detail-hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 6px 0 14px;
  color: var(--slate-900);
}
.detail-hero .official {
  color: var(--text-muted);
  margin: 0 0 16px;
  font-size: 0.98rem;
}
.detail-hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
.detail-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.detail-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: 0 0 12px;
  font-weight: 600;
}
.detail-section p,
.detail-section pre.criteria {
  margin: 0;
  color: var(--slate-800);
  font-size: 0.97rem;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: inherit;
}
.criteria {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
}

/* Eligibility highlights */
.elig-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.elig-quick-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--slate-600);
}
.elig-quick-item svg { color: var(--utmb-blue); flex: 0 0 auto; margin-top: 2px; }
.elig-quick-k {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.elig-quick-v {
  color: var(--slate-900);
  font-weight: 600;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.elig-block { margin-bottom: 14px; }
.elig-block:last-of-type { margin-bottom: 6px; }
.elig-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 8px;
}
.elig-block-head.inclusion { color: var(--success-700); }
.elig-block-head.inclusion svg { color: var(--success-600); }
.elig-block-head.exclusion { color: var(--danger-700); }
.elig-block-head.exclusion svg { color: var(--danger-600); }
.elig-block-count {
  margin-left: auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.elig-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.elig-list li {
  padding: 10px 12px 10px 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--slate-800);
  font-size: 0.94rem;
  line-height: 1.5;
  position: relative;
}
.elig-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.elig-list.inclusion li::before { background: var(--success-600); }
.elig-list.exclusion li::before { background: var(--danger-600); }
.elig-foot {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-style: italic;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
.kv-grid .k {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 2px;
  font-weight: 600;
}
.kv-grid .v {
  color: var(--slate-900);
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
}

.locations-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}
.locations-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.locations-list .facility {
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 2px;
}
.locations-list .place {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.intervention-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.intervention-list li {
  border-left: 3px solid var(--utmb-blue);
  padding: 4px 0 4px 14px;
}
.intervention-list .iv-type {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--utmb-blue-700);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.intervention-list .iv-name {
  font-weight: 600;
  color: var(--slate-900);
}
.intervention-list .iv-desc { color: var(--text-muted); font-size: 0.92rem; margin-top: 4px; }

/* ------- Footer ------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ------- Loading state for submit button (JS-driven) ------- */
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.6);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------- Responsive ------- */
@media (max-width: 960px) {
  .results-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .field-condition, .field-location { grid-column: span 12; }
  .field-status, .field-phase, .field-study-type, .field-term { grid-column: span 6; }
}
@media (max-width: 640px) {
  .header-nav a:not(.header-cta) { display: none; }
  .hero { padding: 48px 0 36px; }
  .brand-product-sub { display: none; }
  .brand-divider { display: none; }
  .field-status, .field-phase, .field-study-type, .field-term { grid-column: span 12; }
  .kv-grid { grid-template-columns: 1fr; }
}

/* ------- Header nav active state ------- */
.header-nav a.is-active {
  color: var(--utmb-blue);
  position: relative;
}
.header-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -28px;
  height: 3px;
  background: var(--utmb-blue);
  border-radius: 3px 3px 0 0;
}

/* ------- Trial Finder ------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.scroll-anchor {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.finder-layout {
  padding: 28px 0 64px;
}
.finder-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.finder-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}
.finder-toolbar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  white-space: nowrap;
}
.finder-toolbar .select { max-width: 460px; flex: 1; min-width: 240px; }

.epic-logo {
  height: 20px;
  width: auto;
  flex: 0 0 auto;
  vertical-align: middle;
}

.note-textarea {
  width: 100%;
  min-height: 260px;
  height: 320px;
  resize: vertical;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--slate-900);
  background: var(--slate-50);
}
.note-textarea:focus {
  background: #fff;
}
.finder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Extraction summary card */
.finder-extraction { margin-top: 22px; }
.extraction-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--utmb-blue);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.extraction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.extraction-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 4px;
}
.extraction-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--slate-900);
  margin: 0;
}
.extraction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px 24px;
  margin: 0 0 16px;
}
.extraction-grid dt {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 2px;
  font-weight: 600;
}
.extraction-grid dd {
  margin: 0;
  font-size: 1rem;
  color: var(--slate-900);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.extraction-sublabel {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 6px;
  font-weight: 600;
}
.extraction-biomarkers { margin-bottom: 16px; }
.extraction-query {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.extraction-query code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  background: var(--slate-50);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--slate-700);
}
.extraction-query code strong { color: var(--utmb-blue); font-weight: 600; }

/* Finder results */
.finder-results { margin-top: 26px; }
.finder-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.finder-results-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--slate-900);
  margin: 0;
}

@media (max-width: 640px) {
  .header-nav a.is-active::after { display: none; }
  .note-textarea { min-height: 240px; height: 260px; }
}

/* ------- Login screen ------- */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background:
    radial-gradient(900px 540px at 80% -10%, rgba(0, 55, 103, 0.16), transparent 60%),
    radial-gradient(900px 540px at -10% 110%, rgba(202, 75, 12, 0.10), transparent 60%),
    linear-gradient(180deg, #F8FAFC 0%, #EEF2F7 100%);
}
.login-shell {
  margin: auto;
  width: 100%;
  max-width: 460px;
  padding: 40px 20px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.login-brand img { height: 46px; width: auto; }
.login-card h1 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 6px;
  color: var(--slate-900);
}
.login-sub {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}
.login-submit {
  width: 100%;
  margin-top: 6px;
}
.login-footnote {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* ------- Page header actions group ------- */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.scoring-model-btn {
  color: var(--utmb-blue-700);
  border-color: var(--utmb-blue-100);
  background: var(--utmb-blue-50);
  font-size: 0.9rem;
  height: 40px;
  padding: 0 16px;
}
.scoring-model-btn:hover {
  background: var(--utmb-blue-100);
  border-color: var(--utmb-blue-100);
}

/* ------- Match Scoring Model dialog ------- */
.scoring-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 660px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
}
.scoring-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.scoring-modal-inner {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.scoring-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 1;
}
.scoring-modal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--utmb-blue-700);
  margin-bottom: 4px;
}
.scoring-modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--slate-900);
}
.scoring-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-500);
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 150ms ease, color 150ms ease;
}
.scoring-close-btn:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.scoring-modal-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.scoring-intro {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.6;
}

/* Sections */
.scoring-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scoring-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-800);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.scoring-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--utmb-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.scoring-section-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* Scoring table */
.scoring-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.93rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  word-break: break-word;
}
.scoring-table thead th {
  background: var(--slate-50);
  color: var(--text-subtle);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.scoring-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.scoring-table tbody tr:last-child {
  border-bottom: none;
}
.scoring-table tbody td {
  padding: 11px 14px;
  color: var(--slate-700);
  vertical-align: middle;
  line-height: 1.5;
}
.scoring-table tbody td:first-child {
  width: 130px;
}
.scoring-table tfoot td {
  padding: 11px 14px;
  background: var(--slate-50);
  border-top: 2px solid var(--border);
  font-weight: 600;
  color: var(--slate-700);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.scoring-pts-col { width: 80px; }
.scoring-pts {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--utmb-blue-700);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.scoring-max {
  color: var(--slate-800);
  font-size: 1rem;
}
.scoring-note {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 400;
}
.scoring-table-divider td {
  background: var(--utmb-blue-50) !important;
  border-top: 1px solid var(--utmb-blue-100) !important;
  border-bottom: 1px solid var(--utmb-blue-100) !important;
}
.scoring-divider-label {
  color: var(--utmb-blue-700);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 14px !important;
}

/* Signal type chips in extraction table */
.scoring-signal {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.scoring-signal.condition {
  background: var(--utmb-blue);
  color: #fff;
  border-color: var(--utmb-blue-700);
}
.scoring-signal.stage {
  background: var(--utmb-orange-50);
  color: var(--utmb-orange-700);
  border-color: rgba(202, 75, 12, 0.25);
}
.scoring-signal.biomarker {
  background: var(--utmb-blue-50);
  color: var(--utmb-blue-700);
  border-color: var(--utmb-blue-100);
}
.scoring-signal.demo {
  background: var(--slate-100);
  color: var(--slate-700);
  border-color: var(--slate-200);
}

/* Confidence levels list */
.scoring-levels {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.scoring-level {
  padding: 14px 16px;
  background: #fff;
}
.scoring-level:nth-child(even) { background: var(--slate-50); }
.scoring-level-ineligible { background: var(--danger-50) !important; }
.scoring-level-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.scoring-level-range {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}
.scoring-level p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Disclaimer */
.scoring-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-md);
  color: #78350F;
  font-size: 0.88rem;
  line-height: 1.55;
}
.scoring-disclaimer strong { font-weight: 700; color: #92400E; }

@media (max-width: 640px) {
  .scoring-modal-head { padding: 20px 20px 16px; }
  .scoring-modal-body { padding: 20px 20px 24px; gap: 22px; }
  .scoring-dialog { max-height: calc(100dvh - 24px); }
  .scoring-table tbody td:first-child { width: 100px; }
}

/* ------- Reduced motion ------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
