/* Atlas UI hotfix pass (dist-safe override) */

:root {
  --atlas-panel-bg: color-mix(in srgb, var(--card) 92%, var(--background));
  --atlas-panel-bg-strong: color-mix(in srgb, var(--card) 96%, var(--background));
  --atlas-panel-border: color-mix(in srgb, var(--border) 82%, transparent);
  --atlas-soft-shadow: 0 14px 34px rgba(6, 21, 32, 0.08);
}

.dark {
  --atlas-panel-bg: color-mix(in srgb, var(--card) 95%, #050b12);
  --atlas-panel-bg-strong: color-mix(in srgb, var(--card) 98%, #04090f);
  --atlas-soft-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.site-main h1 {
  line-height: 1.08;
}

.site-main h1 span,
.site-main h1 .word,
.site-main h1 .char {
  margin-right: 0.08em;
}

/* Global panel finish for newly wired modules */
.surface-panel,
.form-panel,
.results-panel,
.reference-card,
.info-card,
.summary-card,
.callout-card {
  background: linear-gradient(180deg, var(--atlas-panel-bg-strong), var(--atlas-panel-bg));
  border: 1px solid var(--atlas-panel-border);
  box-shadow: var(--atlas-soft-shadow);
}

/* New trajectory module */
.module-tabs {
  background: var(--atlas-panel-bg);
  border: 1px solid var(--atlas-panel-border);
  border-radius: 1rem;
  padding: 1rem;
}

.tab-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-button {
  border-radius: 999px;
  border: 1px solid var(--atlas-panel-border);
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.2;
  color: hsl(var(--muted-foreground));
  background: color-mix(in srgb, var(--card) 94%, transparent);
}

.tab-button-active {
  border-color: color-mix(in srgb, var(--primary) 70%, white 10%);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent) inset;
}

.form-grid {
  gap: 0.92rem;
}

.field-help {
  opacity: 0.9;
  line-height: 1.42;
}

.site-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.site-input,
.site-select {
  min-height: 42px;
}

.trajectory-results-grid {
  gap: 1rem;
}

.trajectory-chart-panel .chart-shell {
  border-radius: 1.05rem;
  padding: 0.75rem;
}

.summary-card-value {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Trials readability */
.site-main .overflow-x-auto {
  border: 1px solid var(--atlas-panel-border);
  border-radius: 1rem;
  background: var(--atlas-panel-bg);
  padding: 0.35rem;
}

.site-main table {
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
}

.site-main th,
.site-main td {
  padding: 0.72rem 0.85rem;
  vertical-align: top;
}

.site-main thead th {
  background: color-mix(in srgb, var(--atlas-panel-bg-strong) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 1;
}

.site-main tbody tr td {
  border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.site-main tbody tr:hover td {
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

/* Treatment decision (second newly wired page) */
.decision-grid {
  gap: 0.55rem;
}

.decision-pill {
  min-height: 2.55rem;
  border-color: var(--atlas-panel-border);
  background: color-mix(in srgb, var(--card) 94%, transparent);
}

.decision-pill-active.decision-pill-yes {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 16%, transparent);
}

.verdict-band {
  border-width: 1px;
  border-radius: 1.1rem;
}

/* Trials page: restore compact accordion feel + trial color accents */
.site-main .overflow-x-auto table tbody tr:nth-child(1) td:first-child {
  border-left: 3px solid #3b82f6;
}

.site-main .overflow-x-auto table tbody tr:nth-child(2) td:first-child {
  border-left: 3px solid #0ea5e9;
}

.site-main .overflow-x-auto table tbody tr:nth-child(3) td:first-child {
  border-left: 3px solid #8b5cf6;
}

.site-main .overflow-x-auto table tbody tr:nth-child(4) td:first-child {
  border-left: 3px solid #f43f5e;
}

.site-main .overflow-x-auto table tbody tr td:first-child {
  padding-left: 0.75rem;
}

.site-main .overflow-x-auto table tbody tr td:first-child .font-bold {
  letter-spacing: -0.01em;
}

.site-main button.w-full.text-left.grid.gap-4 {
  border: 1px solid var(--atlas-panel-border);
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: color-mix(in srgb, var(--atlas-panel-bg-strong) 95%, transparent);
}

.site-main button.w-full.text-left.grid.gap-4:hover {
  background: color-mix(in srgb, var(--primary) 4%, var(--atlas-panel-bg-strong));
}

/* Mobile quality */
@media (max-width: 900px) {
  .site-main {
    overflow-x: clip;
  }

  .tab-list {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 0.84rem;
  }

  .module-tabs,
  .form-panel,
  .surface-panel,
  .results-panel,
  .site-main .overflow-x-auto {
    border-radius: 0.86rem;
  }

  .summary-card,
  .callout-card {
    padding: 0.95rem;
  }

  .summary-card-value {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }

  .decision-pill {
    width: 100%;
    justify-content: flex-start;
    padding-inline: 0.85rem;
  }
}
