
:root{ --shell-bg:#0b1220; --shell-border:rgba(255,255,255,0.08); --shell-accent:#7dd3fc; --shell-text:#e5e7eb; }
html, body { height: 100%; }
#app-shell { display:flex; flex-direction:column; min-height:100%; background:var(--shell-bg); }
#app-header { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem; border-bottom:1px solid var(--shell-border); position:sticky; top:0; z-index:100; backdrop-filter:saturate(120%) blur(6px); }
#brand { font-weight:600; letter-spacing:.04em; color:var(--shell-text); opacity:.9; }
#brand small{ opacity:.78; margin-left:.1rem; font-weight:500; text-transform: lowercase; }
#brand .brand-mark {
  display: inline-flex;
  align-items: center;
  margin-right: .55rem;
  color: #f8d977;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-shadow: 0 0 18px rgba(248, 217, 119, .34);
  vertical-align: -0.02em;
}

/* Mobile evidence toolbar: compact browse controls without changing desktop. */
@media (max-width: 760px) {
  #evidence-viewer-pane .header-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #search {
    flex: 1 1 calc(100% - 64px) !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin-left: 0 !important;
  }

  #evidence-viewer-pane #header-controls {
    flex: 1 1 100% !important;
    display: grid !important;
    grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #evidence-viewer-pane #stage {
    order: 1 !important;
    grid-column: 1 / -1 !important;
  }

  #evidence-viewer-pane #version {
    order: 2 !important;
    grid-column: 1 !important;
  }

  #evidence-viewer-pane #hypfilter {
    order: 3 !important;
    grid-column: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    font-size: 0.98rem !important;
  }
}

.mobile-detail-back {
  display: none;
}

.mobile-stage-info {
  display: none;
}

@media (max-width: 700px) {
  html,
  body,
  #app-shell,
  #app-content,
  .app-pane {
    max-width: 100%;
    overflow-x: hidden;
  }

  #app-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  #brand {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.98rem;
  }

  #app-tabs {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 3px;
    scrollbar-width: thin;
  }

  .app-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  #evidence-viewer-pane.active {
    min-width: 0;
    overflow: hidden !important;
  }

  #evidence-viewer-pane .header {
    flex: 0 0 auto;
    padding: 9px 10px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(5, 10, 20, 0.82);
  }

  #evidence-viewer-pane .header-inner,
  #evidence-viewer-pane .header-left {
    width: 100%;
    min-width: 0;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #search {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin-left: 0 !important;
  }

  #evidence-viewer-pane #header-controls,
  #evidence-viewer-pane #ev-controls-mount,
  #evidence-viewer-pane #ev-controls-mount #controls {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(92px, 1fr) minmax(0, 2fr) !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #stage {
    order: 1 !important;
    grid-column: 1 / 3 !important;
  }

  #evidence-viewer-pane #version {
    order: 2 !important;
    grid-column: 1 !important;
  }

  #evidence-viewer-pane #hypfilter {
    order: 3 !important;
    grid-column: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    font-size: 0.98rem !important;
  }

  #evidence-viewer-pane .container {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    gap: 10px !important;
    overflow: hidden !important;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .container::before {
    content: "Evidence in this stage";
    display: block;
    border: 0;
    border-radius: 0;
    padding: 0 2px;
    background: transparent;
    color: #8ea7c2;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  #evidence-viewer-pane.mobile-detail-active .mobile-stage-info {
    display: none;
  }

  #evidence-viewer-pane .mobile-stage-info {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #evidence-viewer-pane .mobile-stage-badge {
    width: fit-content;
    margin: 0;
    border: 1px solid rgba(214, 177, 90, 0.34);
    border-radius: 999px;
    padding: 3px 8px;
    color: #d6b15a;
    background: rgba(3, 11, 24, 0.64);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #evidence-viewer-pane .mobile-stage-info-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    border: 1px solid rgba(102, 208, 255, 0.18);
    border-radius: 12px;
    padding: 11px;
    overflow: hidden;
    background:
      radial-gradient(circle at 96% 0%, rgba(214, 177, 90, 0.12), transparent 34%),
      linear-gradient(180deg, rgba(8, 20, 37, 0.88), rgba(3, 11, 24, 0.9));
  }

  #evidence-viewer-pane .mobile-stage-info-accent {
    flex: 0 0 4px;
    align-self: stretch;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(214, 177, 90, 0.94), rgba(102, 208, 255, 0.74));
    box-shadow: 0 0 18px rgba(102, 208, 255, 0.18);
  }

  #evidence-viewer-pane .mobile-stage-info-art {
    position: relative;
    min-width: 0;
    min-height: 92px;
    max-height: 132px;
    margin: 0;
    border: 1px solid rgba(214, 177, 90, 0.18);
    border-radius: 10px;
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 40%, rgba(102, 208, 255, 0.16), transparent 42%),
      rgba(3, 11, 24, 0.9);
  }

  #evidence-viewer-pane .mobile-stage-info-art::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(3, 11, 24, 0.08), rgba(3, 11, 24, 0.46)),
      linear-gradient(90deg, rgba(3, 11, 24, 0.24), transparent 40%);
  }

  #evidence-viewer-pane .mobile-stage-info-art img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 92px;
    object-fit: cover;
    object-position: center;
    opacity: 0.86;
    filter: saturate(0.95) contrast(1.04) brightness(0.82);
  }

  #evidence-viewer-pane .mobile-stage-info-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  #evidence-viewer-pane .mobile-stage-info-label {
    margin: 0;
    color: #8ea7c2;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  #evidence-viewer-pane .mobile-stage-info h2 {
    margin: 0;
    color: #f2f7ff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.04rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  #evidence-viewer-pane .mobile-stage-subtitle {
    color: #f1da8a !important;
    font-size: 0.9rem !important;
    line-height: 1.34 !important;
  }

  #evidence-viewer-pane .mobile-stage-scripture {
    margin: 0;
    border-left: 3px solid rgba(214, 177, 90, 0.72);
    padding: 7px 0 7px 10px;
    background: linear-gradient(90deg, rgba(214, 177, 90, 0.10), transparent);
  }

  #evidence-viewer-pane .mobile-stage-scripture span {
    display: inline-block;
    margin: 0 0 3px;
    color: #94cfff;
    font-size: 0.76rem;
    font-weight: 850;
  }

  #evidence-viewer-pane .mobile-stage-scripture p {
    margin: 0;
    color: #d8e4f2;
    font-size: 0.86rem;
    line-height: 1.38;
  }

  #evidence-viewer-pane .mobile-stage-logos {
    border-bottom: 1px solid rgba(102, 208, 255, 0.12);
    padding-bottom: 8px;
  }

  #evidence-viewer-pane .mobile-stage-info-copy > p:not(.mobile-stage-info-label):not(.mobile-stage-badge) {
    margin: 0;
    color: #aebed2;
    font-size: 0.84rem;
    line-height: 1.34;
  }

  #evidence-viewer-pane .mobile-stage-purpose {
    border-top: 1px solid rgba(102, 208, 255, 0.12);
    padding-top: 7px;
  }

  #evidence-viewer-pane .mobile-stage-purpose strong {
    color: #d6b15a;
  }

  #evidence-viewer-pane .mobile-stage-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  #evidence-viewer-pane .mobile-stage-info-chip {
    display: inline-flex;
    max-width: 100%;
    border: 1px solid rgba(102, 208, 255, 0.18);
    border-radius: 999px;
    padding: 3px 8px;
    color: #bcd0e6;
    background: rgba(10, 24, 48, 0.54);
    font-size: 0.72rem;
    line-height: 1.2;
  }

  #evidence-viewer-pane .mobile-stage-mini-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
    margin-top: 2px;
  }

  #evidence-viewer-pane .mobile-stage-mini-card {
    min-width: 0;
    border: 1px solid rgba(102, 208, 255, 0.12);
    border-radius: 9px;
    padding: 8px 9px;
    background: rgba(3, 11, 24, 0.38);
  }

  #evidence-viewer-pane .mobile-stage-mini-card strong {
    display: block;
    margin: 0 0 3px;
    color: #eaf3ff;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  #evidence-viewer-pane .mobile-stage-mini-card p {
    margin: 0;
    color: #9fb4cb;
    font-size: 0.78rem;
    line-height: 1.34;
  }

  #evidence-viewer-pane .mobile-stage-extra {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin-top: 4px;
    border-top: 1px solid rgba(102, 208, 255, 0.12);
    padding-top: 10px;
  }

  #evidence-viewer-pane .mobile-stage-use .mobile-stage-mini-grid {
    margin-top: 0;
  }

  #evidence-viewer-pane .mobile-stage-extra-label {
    margin: 0;
    color: #9ee7ff;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  #evidence-viewer-pane .mobile-stage-extra h3 {
    margin: 0;
    color: #f2f7ff;
    font-size: 0.96rem;
    line-height: 1.22;
  }

  #evidence-viewer-pane .mobile-stage-journey-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
  }

  #evidence-viewer-pane .mobile-stage-journey-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 8px;
    min-width: 0;
    border: 1px solid rgba(102, 208, 255, 0.12);
    border-radius: 9px;
    padding: 8px 9px;
    background: rgba(3, 11, 24, 0.34);
  }

  #evidence-viewer-pane .mobile-stage-journey-item span {
    grid-row: span 2;
    align-self: start;
    min-width: 34px;
    border: 1px solid rgba(214, 177, 90, 0.32);
    border-radius: 999px;
    padding: 3px 6px;
    color: #f0d98d;
    background: rgba(214, 177, 90, 0.08);
    font-size: 0.7rem;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
  }

  #evidence-viewer-pane .mobile-stage-journey-item strong {
    min-width: 0;
    color: #eaf3ff;
    font-size: 0.8rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  #evidence-viewer-pane .mobile-stage-journey-item p {
    min-width: 0;
    margin: 0;
    color: #9fb4cb;
    font-size: 0.76rem;
    line-height: 1.3;
  }

  #evidence-viewer-pane .mobile-stage-frameworks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  #evidence-viewer-pane .mobile-stage-frameworks span {
    max-width: 100%;
    border: 1px solid rgba(102, 208, 255, 0.16);
    border-radius: 999px;
    padding: 5px 9px;
    color: #bcd0e6;
    background: rgba(10, 24, 48, 0.44);
    font-size: 0.74rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  #evidence-viewer-pane .mobile-stage-note-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    margin-top: 3px;
  }

  #evidence-viewer-pane .mobile-stage-note {
    min-width: 0;
    border: 1px solid rgba(102, 208, 255, 0.12);
    border-radius: 10px;
    padding: 9px;
    background: rgba(8, 20, 37, 0.5);
  }

  #evidence-viewer-pane .mobile-stage-note strong {
    display: block;
    margin: 0 0 4px;
    color: #eaf3ff;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  #evidence-viewer-pane .mobile-stage-note p {
    margin: 0;
    color: #aebed2;
    font-size: 0.78rem;
    line-height: 1.36;
  }

  @media (max-width: 400px) {
    #evidence-viewer-pane .mobile-stage-info-inner {
      grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr);
      gap: 10px;
      padding: 10px;
    }

    #evidence-viewer-pane .mobile-stage-info-art,
    #evidence-viewer-pane .mobile-stage-info-art img {
      min-height: 76px;
    }
  }

  #evidence-viewer-pane:not(.mobile-detail-active) #detailpane {
    display: none !important;
  }

  #evidence-viewer-pane.mobile-detail-active #tree {
    display: none !important;
  }

  #evidence-viewer-pane #tree,
  #evidence-viewer-pane #detailpane {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  #treeScrollFix,
  #detailScrollFix {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #tree .section,
  #tree .section.sub,
  #tree .item {
    max-width: 100%;
    min-width: 0;
  }

  #tree .section.sub {
    margin-left: 6px !important;
    margin-right: 0 !important;
  }

  #tree .section-header {
    grid-template-columns: minmax(0, 1fr) max-content 30px !important;
    min-width: 0;
  }

  #tree .section-title,
  #tree .item h4,
  #tree .tree-ref-count {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #tree .section-header[title="Anthropology"] > .section-title,
  #tree .section-header[title="Archaeology"] > .section-title,
  #tree .section-header[title="History"] > .section-title,
  #tree .section-header[title="Science"] > .section-title,
  #tree .section-header[title="Philosophy"] > .section-title,
  #tree .section-header[title="Scripture / Text"] > .section-title,
  #tree .section-header[title="World Religions"] > .section-title,
  #tree .section-header[title="Mathematics / Logic"] > .section-title,
  #tree .section-header[title="Methodology / Signal Core"] > .section-title {
    min-width: 0 !important;
  }

  .mobile-detail-back {
    position: sticky;
    top: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    border: 1px solid rgba(125, 211, 252, 0.34);
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(4, 12, 24, 0.92);
    color: #dff7ff;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.34);
  }

  .mobile-detail-back::before {
    content: "←";
    margin-right: 8px;
  }

  .detail-dossier,
  .detail-hero-card,
  .detail-mini-card,
  .detail-evidence-card,
  #evidence-viewer-pane .detail .article,
  #evidence-viewer-pane .detail .article .detail-article-block {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .detail-dossier {
    padding: 10px !important;
    gap: 12px;
  }

  .detail-hero-card {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 14px !important;
  }

  #evidence-viewer-pane .detail .detail-hero-card h2 {
    font-size: clamp(1.18rem, 8vw, 1.55rem) !important;
  }

  .detail-thesis,
  #evidence-viewer-pane .detail .article .detail-article-block p {
    max-width: 100%;
    line-height: 1.68;
  }

  .detail-status-strip,
  .detail-bf-strip {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .detail-evidence-card {
    overflow-x: auto;
  }

  .detail-bayes-card .table,
  #evidence-viewer-pane .detail .table {
    min-width: 680px;
  }

  #evidence-viewer-pane .footer {
    display: none;
  }
}

/* Menu order is Landing, Evidence Viewer, Results, More, Settings. */
@media (max-width: 700px) {
  #app-tabs {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr) minmax(0, .78fr) minmax(0, .65fr) 38px !important;
  }
}

@media (max-width: 700px) {
  #evidence-viewer-pane.mobile-detail-active #detailpane {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile stage guide scroll fix: keep the tree primary, but let the
   under-tree stage guide reveal all of its desktop-equivalent content. */
@media (max-width: 700px) {
  #evidence-viewer-pane:not(.mobile-detail-active) .container {
    grid-template-rows: auto auto auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .mobile-stage-info {
    max-height: min(72vh, 680px);
    margin-top: 10px;
    padding-bottom: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: rgba(102, 208, 255, 0.38) rgba(3, 11, 24, 0.42);
    scrollbar-width: thin;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .mobile-stage-info-inner {
    overflow: visible;
  }
}

/* Stage 2 - Coherence Gates overview */
#evidence-viewer-pane .stage2-coherence {
  --stage2-blue: #4a8bff;
  --stage2-cyan: #6fe3ff;
  --stage2-gold: #ffc76a;
  --stage2-purple: #a78bfa;
  --stage2-teal: #4cd5c4;
  padding: clamp(18px, 2vw, 28px);
  border-color: rgba(111, 227, 255, 0.22);
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 199, 106, 0.19), transparent 26%),
    radial-gradient(circle at 26% 30%, rgba(74, 139, 255, 0.22), transparent 33%),
    linear-gradient(180deg, rgba(8, 24, 46, 0.96), rgba(3, 9, 20, 0.94));
}

#evidence-viewer-pane .stage2-coherence::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(111, 227, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 227, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 64% 32%, rgba(255, 199, 106, 0.16), transparent 31%);
  background-size: 42px 42px, 42px 42px, auto;
  opacity: 0.86;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}

#evidence-viewer-pane .stage2-coherence > * {
  position: relative;
  z-index: 1;
}

#evidence-viewer-pane .stage2-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(340px, 1fr);
  gap: clamp(18px, 3vw, 38px);
  align-items: stretch;
  min-height: 290px;
}

#evidence-viewer-pane .stage2-kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 199, 106, 0.54);
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--stage2-gold);
  background: rgba(3, 9, 20, 0.45);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#evidence-viewer-pane .stage2-hero h2 {
  max-width: 620px;
  margin: 0;
  color: #f8fbff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.8vw, 3.05rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
  text-shadow: 0 0 42px rgba(111, 227, 255, 0.18);
}

#evidence-viewer-pane .stage2-hero h2::after {
  content: "";
  display: block;
  width: min(260px, 58vw);
  height: 1px;
  margin: 20px 0 0;
  background: linear-gradient(90deg, rgba(255, 199, 106, 0.9), rgba(255, 199, 106, 0.04));
  box-shadow: 48px 0 18px rgba(255, 199, 106, 0.28);
}

#evidence-viewer-pane .stage2-subtitle,
#evidence-viewer-pane .stage2-summary {
  max-width: 650px;
  color: #c7d6ea;
  line-height: 1.58;
}

#evidence-viewer-pane .stage2-subtitle {
  margin: 18px 0 0;
  color: #e4edf9;
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
}

#evidence-viewer-pane .stage2-summary {
  margin: 12px 0 0;
}

#evidence-viewer-pane .stage2-gate-visual {
  isolation: isolate;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(170px, 22vw, 230px);
  border: 1px solid rgba(111, 227, 255, 0.13);
  border-radius: 22px;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 199, 106, 0.24), transparent 24%),
    radial-gradient(circle at 43% 44%, rgba(111, 227, 255, 0.20), transparent 36%),
    linear-gradient(180deg, rgba(7, 25, 47, 0.74), rgba(2, 7, 17, 0.66));
  box-shadow:
    inset 0 0 62px rgba(2, 6, 23, 0.64),
    0 20px 48px rgba(0, 0, 0, 0.24);
}

#evidence-viewer-pane .stage2-gate-visual::before,
#evidence-viewer-pane .stage2-gate-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#evidence-viewer-pane .stage2-gate-visual::before {
  background:
    radial-gradient(circle at 50% 58%, transparent 34%, rgba(2, 7, 17, 0.10) 58%, rgba(2, 7, 17, 0.68) 100%),
    linear-gradient(90deg, rgba(2, 7, 17, 0.70), rgba(2, 7, 17, 0.06) 22%, rgba(2, 7, 17, 0.06) 76%, rgba(2, 7, 17, 0.64)),
    linear-gradient(180deg, rgba(2, 7, 17, 0.34), transparent 42%, rgba(2, 7, 17, 0.58));
}

#evidence-viewer-pane .stage2-gate-visual::after {
  inset: 12px;
  border: 1px solid rgba(255, 199, 106, 0.20);
  border-radius: 18px;
  box-shadow:
    inset 0 0 54px rgba(111, 227, 255, 0.10),
    inset 0 0 96px rgba(255, 199, 106, 0.08);
}

#evidence-viewer-pane .stage2-gate-visual img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
  filter: saturate(1.08) contrast(1.04) brightness(0.82);
  transform: scale(1.02);
}

#evidence-viewer-pane .stage2-arch {
  position: absolute;
  bottom: 20%;
  width: 14%;
  height: 52%;
  border: 1px solid rgba(255, 199, 106, 0.62);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-shadow: inset 0 0 18px rgba(255, 199, 106, 0.16), 0 0 18px rgba(111, 227, 255, 0.08);
}

#evidence-viewer-pane .stage2-arch i {
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--stage2-gold);
  transform: translateX(-50%);
  box-shadow: 0 0 26px rgba(255, 199, 106, 0.95);
}

#evidence-viewer-pane .stage2-arch.arch-1 { left: 9%; color: var(--stage2-blue); }
#evidence-viewer-pane .stage2-arch.arch-2 { left: 27%; }
#evidence-viewer-pane .stage2-arch.arch-3 { left: 45%; height: 68%; bottom: 13%; border-color: rgba(255, 220, 150, 0.76); }
#evidence-viewer-pane .stage2-arch.arch-4 { left: 63%; border-color: rgba(76, 213, 196, 0.58); }
#evidence-viewer-pane .stage2-arch.arch-5 { left: 81%; border-color: rgba(255, 199, 106, 0.70); }

#evidence-viewer-pane .stage2-floor {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 227, 255, 0.55), rgba(255, 199, 106, 0.85), transparent);
  box-shadow: 0 0 34px rgba(255, 199, 106, 0.52);
}

#evidence-viewer-pane .stage2-gates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(18px, 2.5vw, 28px);
}

#evidence-viewer-pane .stage2-gate-card {
  position: relative;
  min-height: 244px;
  border: 1px solid rgba(125, 211, 252, 0.17);
  border-radius: 16px;
  padding: 18px 14px 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 31, 57, 0.78), rgba(4, 12, 26, 0.72));
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 36px rgba(0,0,0,0.20);
}

#evidence-viewer-pane .stage2-gate-card::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.55;
}

#evidence-viewer-pane .stage2-gate-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, currentColor 22%, transparent), rgba(2,6,23,0.38));
  color: var(--stage2-blue);
  box-shadow: 0 0 24px color-mix(in srgb, currentColor 24%, transparent);
}

#evidence-viewer-pane .stage2-gate-icon svg,
#evidence-viewer-pane .stage2-purpose-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#evidence-viewer-pane .stage2-gate-card h3 {
  margin: 4px 0 9px;
  color: #f5f8ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 1.16;
}

#evidence-viewer-pane .stage2-gate-card p {
  margin: 0;
  color: #b9c8db;
  line-height: 1.5;
  font-size: 0.94rem;
}

#evidence-viewer-pane .stage2-gate-number {
  position: absolute;
  top: 12px;
  left: 12px;
  color: rgba(255, 255, 255, 0.42);
  font-weight: 850;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

#evidence-viewer-pane .stage2-gate-logic { color: var(--stage2-blue); border-color: rgba(74, 139, 255, 0.42); }
#evidence-viewer-pane .stage2-gate-moral { color: var(--stage2-gold); border-color: rgba(255, 199, 106, 0.42); }
#evidence-viewer-pane .stage2-gate-mind { color: var(--stage2-purple); border-color: rgba(167, 139, 250, 0.44); }
#evidence-viewer-pane .stage2-gate-origin { color: var(--stage2-teal); border-color: rgba(76, 213, 196, 0.42); }
#evidence-viewer-pane .stage2-gate-purpose { color: var(--stage2-gold); border-color: rgba(255, 199, 106, 0.50); }

#evidence-viewer-pane .stage2-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 18px;
}

#evidence-viewer-pane .stage2-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid rgba(191, 219, 254, 0.55);
  border-radius: 12px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(74, 139, 255, 0.98), rgba(55, 78, 218, 0.94));
  color: #ffffff;
  font-weight: 850;
  box-shadow: 0 16px 34px rgba(74, 139, 255, 0.25), inset 0 1px 0 rgba(255,255,255,0.22);
  cursor: pointer;
}

#evidence-viewer-pane .stage2-primary::after {
  content: ">";
  margin-left: 14px;
}

#evidence-viewer-pane .stage2-purpose,
#evidence-viewer-pane .stage2-matter {
  border: 1px solid rgba(111, 227, 255, 0.17);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 28, 52, 0.72), rgba(4, 12, 24, 0.64));
}

#evidence-viewer-pane .stage2-purpose {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
}

#evidence-viewer-pane .stage2-purpose-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(111, 227, 255, 0.25);
  border-radius: 13px;
  color: #9ee7ff;
  background: rgba(74, 139, 255, 0.10);
}

#evidence-viewer-pane .stage2-purpose p,
#evidence-viewer-pane .stage2-matter p {
  margin: 0;
  color: #c8d7e9;
  line-height: 1.5;
}

#evidence-viewer-pane .stage2-purpose strong {
  color: var(--stage2-gold);
}

#evidence-viewer-pane .stage2-matter {
  margin-top: 14px;
  padding: 16px 18px;
}

#evidence-viewer-pane .stage2-matter h3 {
  margin: 0 0 8px;
  color: #f8fbff;
  font-size: 1.05rem;
}

@media (max-width: 1180px) {
  #evidence-viewer-pane .stage2-gates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #evidence-viewer-pane .stage2-gate-purpose {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  #evidence-viewer-pane .stage2-hero,
  #evidence-viewer-pane .stage2-actions {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage2-gate-visual {
    min-height: 180px;
  }
  #evidence-viewer-pane .stage2-gate-visual img {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  #evidence-viewer-pane .stage2-coherence {
    padding: 15px;
  }
  #evidence-viewer-pane .stage2-hero h2 {
    font-size: clamp(2.15rem, 13vw, 3.25rem);
  }
  #evidence-viewer-pane .stage2-gates {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage2-gate-card {
    min-height: 0;
    text-align: left;
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
  }
  #evidence-viewer-pane .stage2-gate-card h3,
  #evidence-viewer-pane .stage2-gate-card p {
    grid-column: 2;
  }
  #evidence-viewer-pane .stage2-gate-icon {
    grid-row: 1 / span 3;
    width: 54px;
    height: 54px;
    margin: 0;
  }
  #evidence-viewer-pane .stage2-gate-number {
    display: none;
  }
}

/* Shared premium stage overview panels: Stages 1, 3, 3a, 3b, 4, 5, 6 */
#evidence-viewer-pane .stage-overview {
  --stage-accent: #6fe3ff;
  --stage-accent-2: #ffc76a;
  --stage-accent-3: #a78bfa;
  padding: clamp(18px, 2.1vw, 28px);
  border-color: color-mix(in srgb, var(--stage-accent) 28%, transparent);
  background:
    radial-gradient(circle at 76% 22%, color-mix(in srgb, var(--stage-accent-2) 18%, transparent), transparent 26%),
    radial-gradient(circle at 24% 32%, color-mix(in srgb, var(--stage-accent) 22%, transparent), transparent 35%),
    linear-gradient(180deg, rgba(8, 22, 44, 0.96), rgba(3, 9, 20, 0.94));
}

#evidence-viewer-pane .stage-overview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 20% 18%, rgba(255,255,255,0.82), transparent 60%),
    radial-gradient(1px 1px at 84% 28%, rgba(255,255,255,0.70), transparent 60%),
    radial-gradient(1px 1px at 62% 76%, rgba(255,255,255,0.56), transparent 60%),
    linear-gradient(rgba(111, 227, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 227, 255, 0.028) 1px, transparent 1px);
  background-size: auto, auto, auto, 42px 42px, 42px 42px;
  opacity: 0.78;
  mask-image: radial-gradient(circle at 68% 35%, black, transparent 74%);
}

#evidence-viewer-pane .stage-overview > * {
  position: relative;
  z-index: 1;
}

#evidence-viewer-pane .stage-overview--stage1 { --stage-accent:#6fe3ff; --stage-accent-2:#ffc76a; --stage-accent-3:#a78bfa; }
#evidence-viewer-pane .stage-overview--stage3 { --stage-accent:#7dd3fc; --stage-accent-2:#fbbf24; --stage-accent-3:#60a5fa; }
#evidence-viewer-pane .stage-overview--stage3a { --stage-accent:#67e8f9; --stage-accent-2:#4a8bff; --stage-accent-3:#38bdf8; }
#evidence-viewer-pane .stage-overview--stage3b { --stage-accent:#34d399; --stage-accent-2:#f6c76a; --stage-accent-3:#a7f3d0; }
#evidence-viewer-pane .stage-overview--stage4 { --stage-accent:#93c5fd; --stage-accent-2:#fff0b8; --stage-accent-3:#fbbf24; }
#evidence-viewer-pane .stage-overview--stage5 { --stage-accent:#fbbf24; --stage-accent-2:#fff3c4; --stage-accent-3:#fb7185; }
#evidence-viewer-pane .stage-overview--stage6 { --stage-accent:#ffd76f; --stage-accent-2:#fff8d6; --stage-accent-3:#60a5fa; }

#evidence-viewer-pane .stage-hero {
  display: grid;
  grid-template-columns: minmax(330px, 0.88fr) minmax(340px, 1fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: stretch;
}

#evidence-viewer-pane .stage-kicker,
#evidence-viewer-pane .stage7-return-kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 15px;
  border: 1px solid color-mix(in srgb, var(--stage-accent-2) 55%, transparent);
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--stage-accent-2);
  background: rgba(3, 9, 20, 0.46);
  font-size: 0.76rem;
  font-weight: 870;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#evidence-viewer-pane .stage-hero h2,
#evidence-viewer-pane .stage7-return-hero h2 {
  margin: 0;
  color: #f8fbff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.8vw, 3.05rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
  text-shadow: 0 0 42px color-mix(in srgb, var(--stage-accent) 20%, transparent);
}

#evidence-viewer-pane .stage-hero h2::after,
#evidence-viewer-pane .stage7-return-hero h2::after {
  content: "";
  display: block;
  width: min(300px, 62vw);
  height: 1px;
  margin: 18px 0 0;
  background: linear-gradient(90deg, var(--stage-accent-2), transparent);
  box-shadow: 44px 0 18px color-mix(in srgb, var(--stage-accent-2) 28%, transparent);
}

#evidence-viewer-pane .stage-subtitle,
#evidence-viewer-pane .stage-summary,
#evidence-viewer-pane .stage7-return-subtitle,
#evidence-viewer-pane .stage7-return-summary {
  max-width: 720px;
  color: #c7d6ea;
  line-height: 1.58;
}

#evidence-viewer-pane .stage-subtitle,
#evidence-viewer-pane .stage7-return-subtitle {
  margin: 18px 0 0;
  color: #edf5ff;
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
}

#evidence-viewer-pane .stage-summary,
#evidence-viewer-pane .stage7-return-summary {
  margin: 12px 0 0;
}

#evidence-viewer-pane .stage-chip-row,
#evidence-viewer-pane .stage-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#evidence-viewer-pane .stage-chip-row {
  margin-top: 16px;
}

#evidence-viewer-pane .stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 28%, transparent);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(3, 10, 22, 0.44);
  color: #dff7ff;
  font-size: 0.76rem;
  font-weight: 770;
}

#evidence-viewer-pane .stage-visual {
  isolation: isolate;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(170px, 22vw, 240px);
  border: 1px solid color-mix(in srgb, var(--stage-accent) 18%, transparent);
  border-radius: 22px;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--stage-accent-2) 24%, transparent), transparent 18%),
    radial-gradient(circle at 28% 58%, color-mix(in srgb, var(--stage-accent) 20%, transparent), transparent 30%),
    linear-gradient(180deg, rgba(9, 28, 54, 0.58), rgba(2, 7, 17, 0.42));
  box-shadow: inset 0 0 56px rgba(2, 6, 23, 0.55);
}

#evidence-viewer-pane .stage-visual img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0.86;
  filter: saturate(1.08) contrast(1.04) brightness(0.80);
  transform: scale(1.02);
}

#evidence-viewer-pane .stage-visual-orbit,
#evidence-viewer-pane .stage-visual::before,
#evidence-viewer-pane .stage-visual::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  inset: 14%;
  border: 1px solid color-mix(in srgb, var(--stage-accent-2) 32%, transparent);
  border-radius: 50%;
}

#evidence-viewer-pane .stage-visual::before {
  inset: 24%;
  border-color: color-mix(in srgb, var(--stage-accent) 30%, transparent);
}

#evidence-viewer-pane .stage-visual::after {
  left: 8%;
  right: 8%;
  top: 50%;
  bottom: auto;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, var(--stage-accent), var(--stage-accent-2), transparent);
  box-shadow: 0 0 28px color-mix(in srgb, var(--stage-accent-2) 48%, transparent);
}

#evidence-viewer-pane .stage-visual::before {
  box-shadow:
    inset 0 0 90px rgba(2, 7, 17, 0.24),
    0 0 38px color-mix(in srgb, var(--stage-accent) 10%, transparent);
}

#evidence-viewer-pane .stage-visual-node {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 33%, transparent);
  border-radius: 999px;
  padding: 0 14px;
  color: #f5fbff;
  background: rgba(3, 10, 22, 0.70);
  font-weight: 820;
  box-shadow: 0 0 22px color-mix(in srgb, var(--stage-accent) 14%, transparent);
}

#evidence-viewer-pane .stage-visual-node-1 { left: 9%; top: 46%; }
#evidence-viewer-pane .stage-visual-node-2 { left: 30%; top: 20%; }
#evidence-viewer-pane .stage-visual-node-3 { right: 30%; top: 20%; }
#evidence-viewer-pane .stage-visual-node-4 { right: 9%; top: 46%; border-color: color-mix(in srgb, var(--stage-accent-2) 45%, transparent); color: #fff2be; }

#evidence-viewer-pane .stage-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(18px, 2.4vw, 28px);
}

#evidence-viewer-pane .stage-card {
  position: relative;
  min-height: 210px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 18%, transparent);
  border-radius: 16px;
  padding: 17px 15px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 31, 57, 0.76), rgba(4, 12, 26, 0.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 36px rgba(0,0,0,0.18);
}

#evidence-viewer-pane .stage-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 13px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stage-accent-2), transparent);
  opacity: 0.45;
}

#evidence-viewer-pane .stage-card-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 48%, transparent);
  border-radius: 50%;
  color: var(--stage-accent);
  background: radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--stage-accent) 20%, transparent), rgba(2,6,23,0.35));
  box-shadow: 0 0 24px color-mix(in srgb, var(--stage-accent) 22%, transparent);
}

#evidence-viewer-pane .stage-card-icon svg,
#evidence-viewer-pane .stage-purpose-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#evidence-viewer-pane .stage-card h3 {
  margin: 13px 0 8px;
  color: #f7fbff;
  font-size: 1.05rem;
  line-height: 1.18;
}

#evidence-viewer-pane .stage-card p {
  margin: 0;
  color: #b9c8db;
  line-height: 1.5;
  font-size: 0.94rem;
}

#evidence-viewer-pane .stage-card-tags {
  margin-top: 12px;
}

#evidence-viewer-pane .stage-purpose-strip {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 18%, transparent);
  border-radius: 15px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(10, 28, 52, 0.72), rgba(4, 12, 24, 0.64));
}

#evidence-viewer-pane .stage-purpose-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--stage-accent) 30%, transparent);
  border-radius: 14px;
  color: var(--stage-accent);
  background: rgba(3, 10, 22, 0.35);
}

#evidence-viewer-pane .stage-purpose-strip p {
  margin: 0;
  color: #c8d7e9;
  line-height: 1.5;
}

#evidence-viewer-pane .stage-purpose-strip strong {
  color: var(--stage-accent-2);
}

@media (max-width: 1180px) {
  #evidence-viewer-pane .stage-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  #evidence-viewer-pane .stage-hero {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage-visual {
    min-height: 230px;
  }
}

@media (max-width: 560px) {
  #evidence-viewer-pane .stage-overview {
    padding: 15px;
  }
  #evidence-viewer-pane .stage-hero h2 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }
  #evidence-viewer-pane .stage-card-grid {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage-card {
    min-height: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px 14px;
  }
  #evidence-viewer-pane .stage-card-icon {
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
  }
  #evidence-viewer-pane .stage-card h3,
  #evidence-viewer-pane .stage-card p,
  #evidence-viewer-pane .stage-card-tags {
    grid-column: 2;
    margin-top: 0;
  }
  #evidence-viewer-pane .stage-purpose-strip {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage-visual-node {
    min-width: 76px;
    min-height: 34px;
    font-size: 0.78rem;
  }
}

/* Stage 7 scripture panel */
#evidence-viewer-pane .stage7-return-panel {
  --stage-accent: #d4af37;
  --stage-accent-2: #fff1bd;
  margin-bottom: 14px;
  border-color: rgba(212, 175, 55, 0.34);
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 241, 189, 0.25), transparent 26%),
    radial-gradient(circle at 45% 74%, rgba(212, 175, 55, 0.16), transparent 33%),
    linear-gradient(180deg, rgba(13, 15, 25, 0.97), rgba(3, 8, 18, 0.96));
}

@media (min-width: 701px) {
  #evidence-viewer-pane.stage7-fullscreen .container {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #evidence-viewer-pane.stage7-fullscreen #tree {
    display: none !important;
  }

  #evidence-viewer-pane.stage7-fullscreen #detailpane {
    width: 100% !important;
    max-width: 100% !important;
  }
}

#evidence-viewer-pane .stage7-return-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 20px;
  align-items: center;
}

#evidence-viewer-pane .stage7-return-art {
  isolation: isolate;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(120px, 16vw, 170px);
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 20px;
  margin: 0;
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 241, 189, 0.72), transparent 12%),
    radial-gradient(circle at 50% 52%, rgba(212, 175, 55, 0.26), transparent 34%),
    linear-gradient(180deg, rgba(11, 16, 27, 0.82), rgba(2,6,23,0.58));
  overflow: hidden;
  box-shadow: inset 0 0 64px rgba(2, 6, 23, 0.68), 0 18px 42px rgba(0,0,0,0.24);
}

#evidence-viewer-pane .stage7-return-art::before,
#evidence-viewer-pane .stage7-return-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#evidence-viewer-pane .stage7-return-art::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(2, 7, 17, 0.14) 58%, rgba(2, 7, 17, 0.70) 100%),
    linear-gradient(90deg, rgba(2, 7, 17, 0.56), transparent 28%, transparent 72%, rgba(2, 7, 17, 0.52));
}

#evidence-viewer-pane .stage7-return-art::after {
  inset: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 16px;
  box-shadow: inset 0 0 72px rgba(212, 175, 55, 0.10);
}

#evidence-viewer-pane .stage7-return-art img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  opacity: 0.88;
  filter: saturate(1.08) contrast(1.04) brightness(0.78);
  transform: scale(1.02);
}

#evidence-viewer-pane .stage7-scripture-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

#evidence-viewer-pane .stage7-return-card {
  border: 1px solid rgba(212, 175, 55, 0.34) !important;
  border-radius: 15px !important;
  padding: 16px !important;
  background:
    linear-gradient(180deg, rgba(12, 19, 32, 0.96), rgba(5, 10, 20, 0.94)) !important;
  color: #edf5ff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 32px rgba(0,0,0,0.22);
}

#evidence-viewer-pane .stage7-card-meta {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

#evidence-viewer-pane .stage7-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(212, 175, 55, 0.48);
  border-radius: 50%;
  color: #fff1bd;
  background:
    linear-gradient(rgba(5, 10, 20, 0.12), rgba(5, 10, 20, 0.12)),
    url("../assets/evidence-viewer/stage-panels/stage-7-christ-return-scripture-marker.png") center / cover no-repeat;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.22);
}

#evidence-viewer-pane .stage7-card-icon::before {
  content: "";
  display: none;
}

#evidence-viewer-pane .stage7-return-card .ref {
  color: #fff1bd !important;
  font-weight: 850 !important;
  margin: 0 0 4px !important;
}

#evidence-viewer-pane .stage7-card-meta p {
  margin: 0;
  color: #b7c7da;
}

#evidence-viewer-pane .stage7-return-card .passage {
  color: #f1f5f9 !important;
  line-height: 1.62;
  font-size: 0.98rem;
}

#evidence-viewer-pane .stage7-return-callout {
  margin-top: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.10), rgba(5, 10, 20, 0.84));
  color: #d9e4f2;
}

#evidence-viewer-pane .stage7-return-callout strong {
  color: #fff1bd;
}

#evidence-viewer-pane .stage7-jesus-cta {
  width: min(760px, 100%);
  margin: 18px auto 6px;
  border: 1px solid rgba(255, 225, 150, 0.42);
  border-radius: 18px;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 224, 145, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(32, 25, 12, 0.68), rgba(5, 10, 20, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 16px 42px rgba(0,0,0,0.24);
  text-align: center;
}

#evidence-viewer-pane .stage7-jesus-cta h3 {
  margin: 0 0 6px;
  color: #fff1bd;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.15;
}

#evidence-viewer-pane .stage7-jesus-cta p {
  margin: 0 0 14px;
  color: #d8e4f2;
  line-height: 1.55;
}

#evidence-viewer-pane .stage7-jesus-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 225, 150, 0.58);
  border-radius: 999px;
  color: #fff4c7;
  background: rgba(255, 209, 102, 0.10);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.12);
}

#evidence-viewer-pane .stage7-jesus-link:hover,
#evidence-viewer-pane .stage7-jesus-link:focus-visible {
  border-color: rgba(111, 227, 255, 0.66);
  color: #ffffff;
  background: rgba(111, 227, 255, 0.12);
  outline: none;
}

@media (max-width: 700px) {
  #evidence-viewer-pane .stage7-return-hero {
    grid-template-columns: 1fr;
  }
  #evidence-viewer-pane .stage7-return-art,
  #evidence-viewer-pane .stage7-return-art img {
    min-height: 140px;
  }
}

/* Stage intro titles are native UI text, not evidence-title banners. */
#evidence-viewer-pane #detailpane > .detail-intro h1,
#evidence-viewer-pane #detailpane > .detail-intro h2,
#evidence-viewer-pane #detailScrollFix > .detail-intro h1,
#evidence-viewer-pane #detailScrollFix > .detail-intro h2,
#evidence-viewer-pane .stage-overview h2,
#evidence-viewer-pane .stage2-coherence h2,
#evidence-viewer-pane .stage7-return-panel h2 {
  background: none !important;
  border: 0 !important;
  color: #f8fbff !important;
  text-align: left !important;
  text-transform: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Final mobile evidence overrides: keep the toolbar compact and go straight to the tree. */
@media (max-width: 700px) {
  #app-header {
    padding: 12px 10px !important;
    gap: 10px !important;
  }

  #brand {
    flex: 0 0 100% !important;
  }

  #app-tabs {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .78fr) minmax(0, .84fr) minmax(0, .65fr) 38px !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  #app-tabs .app-tab {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 7px !important;
    min-height: 40px !important;
    justify-content: center !important;
    font-size: clamp(.72rem, 3.45vw, .95rem) !important;
  }

  #settings-button {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
  }

  #evidence-viewer-pane #ev-controls-mount,
  #evidence-viewer-pane #ev-controls-mount:empty {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #evidence-viewer-pane .container {
    padding-top: 8px !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .container::before {
    content: none !important;
    display: none !important;
  }

  #evidence-viewer-pane #tree {
    margin-top: 0 !important;
  }
}

/* Final mobile evidence-toolbar layout override. Keep this at the end so
   older mobile rules cannot collapse the stage/version/hypothesis grid. */
@media (max-width: 700px) {
  #app-tabs {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr) minmax(0, .78fr) minmax(0, .65fr) 38px !important;
  }

  #evidence-viewer-pane .header-inner,
  #evidence-viewer-pane .header-left {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    grid-template-rows: auto auto !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #evidence-viewer-pane #search {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  #evidence-viewer-pane #collapse-btn {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 54px !important;
    min-width: 54px !important;
    flex: none !important;
  }

  #evidence-viewer-pane #header-controls {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(86px, 0.95fr) minmax(0, 2.05fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  #evidence-viewer-pane #stage {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #evidence-viewer-pane #version {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #evidence-viewer-pane #hypfilter {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* Phone polish: no helper card or dead spacer between controls and tree. */
@media (max-width: 700px) {
  #app-header {
    gap: 7px !important;
    padding: 9px 10px !important;
  }

  #app-tabs {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .78fr) minmax(0, .84fr) minmax(0, .65fr) 38px !important;
    gap: 5px !important;
    width: 100% !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
  }

  #app-tabs .app-tab {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 36px !important;
    padding: 0 5px !important;
    font-size: clamp(.72rem, 3.1vw, .82rem) !important;
    line-height: 1 !important;
    justify-content: center !important;
    text-align: center !important;
  }

  #app-tabs .app-tab.icon-only {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
  }

  #evidence-viewer-pane #ev-controls-mount:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
  }

  #evidence-viewer-pane .container {
    padding: 8px 10px 10px !important;
    gap: 0 !important;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .container::before {
    content: none !important;
    display: none !important;
  }

  #evidence-viewer-pane #tree {
    margin-top: 0 !important;
  }
}

/* Final phone toolbar override: keep browsing controls compact and readable. */
@media (max-width: 700px) {
  #evidence-viewer-pane .header-left {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #evidence-viewer-pane #search {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #evidence-viewer-pane #header-controls {
    grid-column: 1 / 3 !important;
    display: grid !important;
    grid-template-columns: minmax(86px, 1fr) minmax(0, 2fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #evidence-viewer-pane #stage {
    grid-column: 1 / 3 !important;
    grid-row: 1 !important;
  }

  #evidence-viewer-pane #version {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  #evidence-viewer-pane #hypfilter {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
  }

  #other-pane,
  #other-pane .other-suite,
  #other-pane .other-submenu,
  #other-pane .other-module-panel,
  #other-pane .signal-deep-article,
  #other-pane .signal-article-hero,
  #other-pane .signal-article-section,
  #other-pane .signal-download-card,
  #other-pane .signal-prompt-shell,
  #other-pane .signal-final-question {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  #other-pane .signal-prompt-preview {
    max-width: 100% !important;
    white-space: pre-wrap !important;
    overflow-x: hidden !important;
  }

  #other-pane .signal-prompt-preview code,
  #other-pane .signal-question-grid span,
  #other-pane .signal-article-section p,
  #other-pane .signal-article-section li {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .mobile-detail-back::before,
  .other-mobile-back::before {
    content: "\2190";
  }
}

/* Last mobile toolbar pass: save vertical room in the Evidence Viewer. */
@media (max-width: 760px) {
  #evidence-viewer-pane .header-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #search {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin-left: 0 !important;
  }

  #evidence-viewer-pane #header-controls {
    flex: 1 1 100% !important;
    display: grid !important;
    grid-template-columns: minmax(92px, 1fr) minmax(0, 2fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #evidence-viewer-pane #stage {
    order: 1 !important;
    grid-column: 1 / 3 !important;
  }

  #evidence-viewer-pane #version {
    order: 2 !important;
    grid-column: 1 !important;
  }

  #evidence-viewer-pane #hypfilter {
    order: 3 !important;
    grid-column: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    font-size: 0.98rem !important;
  }
}

/* Last mobile toolbar pass: save vertical room in the Evidence Viewer. */
@media (max-width: 760px) {
  #evidence-viewer-pane .header-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #search {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin-left: 0 !important;
  }

  #evidence-viewer-pane #header-controls {
    flex: 1 1 100% !important;
    display: grid !important;
    grid-template-columns: minmax(92px, 1fr) minmax(0, 2fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #evidence-viewer-pane #stage {
    order: 1 !important;
    grid-column: 1 / 3 !important;
  }

  #evidence-viewer-pane #version {
    order: 2 !important;
    grid-column: 1 !important;
  }

  #evidence-viewer-pane #hypfilter {
    order: 3 !important;
    grid-column: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    font-size: 0.98rem !important;
  }
}

/* Final mobile toolbar override: search + collapse, stage, then version + hypothesis. */
@media (max-width: 760px) {
  #evidence-viewer-pane .header-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #search {
    flex: 1 1 calc(100% - 64px) !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 42px !important;
  }

  #evidence-viewer-pane #collapse-btn {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 42px !important;
    margin-left: 0 !important;
  }

  #evidence-viewer-pane #header-controls {
    flex: 1 1 100% !important;
    display: grid !important;
    grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #evidence-viewer-pane #stage {
    order: 1 !important;
    grid-column: 1 / -1 !important;
  }

  #evidence-viewer-pane #version {
    order: 2 !important;
    grid-column: 1 !important;
  }

  #evidence-viewer-pane #hypfilter {
    order: 3 !important;
    grid-column: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    font-size: 0.98rem !important;
  }
}
#brand .brand-wordmark {
  display: inline-flex;
  align-items: center;
}
#app-tabs { margin-left:auto; display:flex; gap:.5rem; }
.app-tab { appearance:none; border:1px solid var(--shell-border); background:transparent; color:var(--shell-text); padding:.35rem .75rem; border-radius:.5rem; cursor:pointer; font-size:.95rem; }
.app-tab.active { border-color:var(--shell-accent); color:white; box-shadow:0 0 0 1px var(--shell-accent) inset; }
#app-content { flex:1; display:block; }
.app-pane { display:none; }
.app-pane.active { display:block; }

#app-header { gap: 1rem; }
#app-controls { margin-left:auto; display:flex; align-items:center; gap:.5rem; }
#app-controls select, #app-controls input { background:transparent; color:var(--shell-text); border:1px solid var(--shell-border); border-radius:.5rem; padding:.3rem .5rem; }
#app-controls input::placeholder { color:rgba(229,231,235,.5); }
#app-controls #collapse-btn { border:1px solid var(--shell-border); background:transparent; color:var(--shell-text); padding:.3rem .6rem; border-radius:.5rem; cursor:pointer; }
#app-controls #collapse-btn:hover { border-color:var(--shell-accent); }

/* Header-only controls (Version & Stage) aligned right */
#app-header { display:flex; align-items:center; gap:.75rem; }
#header-controls { margin-left:auto; display:flex; align-items:center; gap:.5rem; }
#header-controls select { background:transparent; color:var(--shell-text); border:1px solid var(--shell-border); border-radius:.5rem; padding:.3rem .5rem; }
/* Keep search row styling minimal; align +/- to right edge of the tree column via inline layout in that row */
#collapse-btn { margin-left:.5rem; border:1px solid var(--shell-border); background:transparent; color:var(--shell-text); padding:.3rem .6rem; border-radius:.5rem; cursor:pointer; }
#collapse-btn:hover { border-color:var(--shell-accent); }

/* DATA patch: controls mount sizing */
#evidence-viewer-pane header.header #controls-mount {
  width: 100%;
}
#evidence-viewer-pane header.header #controls-mount #controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

/* DATA patch: EV controls bar inside pane */
#evidence-viewer-pane #ev-controls-mount {
  width: 100%;
  display: block;
  padding: 6px 8px;
}
#evidence-viewer-pane #ev-controls-mount #controls {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}
/* v1.41 brand + header layout */
#brand small {
    opacity: .9;
    margin-left: .5rem;
    font-weight: 600;
    font-size: large;
}
#brand {
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--shell-text);
    opacity: .9;
    font-size: large;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    border-radius: .55rem;
    padding: .15rem .25rem;
    transition: color .16s ease, opacity .16s ease, box-shadow .16s ease;
}
#brand:hover,
#brand:focus-visible {
    opacity: 1;
    color: #fff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(125, 211, 252, .34);
}
.header-left { display: flex; width:100%;}
.header-inner { display: flex; }
#header-controls {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    width:100%; 
}

#version,
#stage,
#search,
#hypfilter,
.treectl-toggle {
    border-width: 3px !important;
    border-color: skyblue !important;
    border-style: solid !important;
    border-radius: 6px !important;  /* optional */
    padding: 4px 8px !important;    /* optional */
}
#stage{width:65%;}
#hypfilter{width:20%;}
#version{width:15%;}
#header-left{width:100%;} 

#evidence-viewer-pane .container {
  display: grid !important;
  grid-template-columns: minmax(340px, 26vw) minmax(0, 1fr) !important;
}

/* Evidence tree rows: keep collapsed/expanded headers on the same grid. */
#tree .section-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content 22px;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
}
#tree .section-header > .section-title {
  grid-column: 1 !important;
  grid-row: 1 !important;
}
#tree .section-header > .count {
  grid-column: 2 !important;
  grid-row: 1 !important;
}
#tree .section-header > .section-control {
  grid-column: 3 !important;
  grid-row: 1 !important;
}
#tree .section-header::before,
#tree .section-header::after {
  content: none !important;
}
#tree .section-caret,
#tree .section-control {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
}
#tree .section-caret {
  display: none;
}
#tree .section-control::before {
  content: "+";
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
}
#tree .section.open > .section-header .section-control::before {
  content: "-";
  color: var(--text);
}
#tree .section-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  margin: 0;
  color: inherit;
  font: inherit;
}
#tree .section-header .count {
  min-width: 3.8ch;
  margin: 0;
  justify-self: end;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
#tree .section-body {
  padding-left: 10px;
  padding-right: 6px;
}
#tree .section.sub {
  margin-left: 10px;
}
#tree .section.sub .section-header {
  grid-template-columns: minmax(0, 1fr) max-content 22px;
}
#tree .section-header .stage-spacer {
  display: none !important;
}

#tree .item {
  min-width: 0;
}
#tree .item h4 {
  overflow-wrap: anywhere;
  display: block !important;
  margin: 0 0 8px !important;
  color: #e5e7eb;
}
#tree .tree-empty {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #0f172a;
  color: var(--muted);
  display: grid;
  gap: 4px;
}
#tree .tree-empty strong {
  color: var(--text);
}
.taxonomy-meta {
  margin-bottom: 8px;
}
.support-layer-note {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(125, 211, 252, .38);
  border-radius: 8px;
  background: rgba(125, 211, 252, .10);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.35;
}
.empty-bf-row td {
  color: var(--muted);
  font-style: italic;
}
#tree .item .badges .badge {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}
#tree .item .badges .badge.bf {
  padding: 3px 8px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 650;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
#tree .item .badges .badge.pending {
  border-color: rgba(148, 163, 184, .65);
  background: rgba(148, 163, 184, .14);
  color: #cbd5e1;
}
#tree .item .badges .badge.ctx {
  border-color: rgba(125, 211, 252, .65);
  background: rgba(125, 211, 252, .14);
  color: #bae6fd;
}
#tree .item .badges .badge.meta-chip {
  border-color: rgba(94, 234, 212, .45);
  background: rgba(94, 234, 212, .12);
  color: #ccfbf1;
}
#tree .item .badges .badge.status {
  border-color: rgba(196, 181, 253, .45);
  background: rgba(196, 181, 253, .12);
  color: #e9d5ff;
}
#tree .item .badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  clear: both;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}
#tree .item .meta {
  margin-top: 4px;
  display: block;
}

.results-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
}
.results-hero,
.results-card,
.results-stats > div,
.results-disclosure {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.82));
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.36);
}
.results-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 18px;
  padding: 18px;
  align-items: start;
}
.results-kicker {
  margin: 0 0 4px;
  color: #9bdaf6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.results-hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}
.results-warning,
.results-caveat {
  margin: 6px 0;
  line-height: 1.4;
}
.results-warning {
  color: #fef08a;
  font-weight: 700;
}
.results-caveat,
.results-generated {
  color: #9ca3af;
}
.results-generated {
  white-space: nowrap;
  font-size: 12px;
  margin-top: 4px;
}
.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.results-stats > div {
  padding: 12px;
  background: rgba(2, 6, 23, 0.36);
}
.results-stats span {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  letter-spacing: .03em;
}
.results-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  color: #f8fafc;
}
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.results-card {
  padding: 16px;
  overflow: hidden;
}
.results-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}
.results-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.results-section-head h3 {
  margin-bottom: 0;
}
.results-summary-note p,
.results-note {
  margin: 7px 0 10px;
  color: #cbd5e1;
  line-height: 1.4;
}
.results-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 14px;
}
.results-family-card {
  background: rgba(2, 6, 23, 0.28);
}
.results-synthesis-v3 {
  display: grid;
  gap: 14px;
}
.results-synthesis-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 14px;
}
.results-synthesis-main {
  background: linear-gradient(160deg, rgba(14, 116, 144, 0.22), rgba(2, 6, 23, 0.6));
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 12px;
  padding: 16px;
}
.results-synthesis-score {
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
  font-weight: 800;
  color: #a7f3d0;
  margin: 8px 0 10px;
}
.results-synthesis-subline {
  margin: 0 0 10px;
  font-size: 16px;
  color: #f8fafc;
}
.results-synthesis-caveat {
  margin: 0 0 8px;
  color: #fef08a;
  font-weight: 650;
}
.results-synthesis-meta {
  display: grid;
  gap: 8px;
}
.results-pathway {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.results-path-step {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.42);
  padding: 10px;
  display: grid;
  gap: 5px;
}
.results-path-step strong {
  font-size: 24px;
  color: #f8fafc;
}
.results-path-step small,
.results-path-step .step-label {
  color: #9ca3af;
  line-height: 1.3;
}
.results-path-step .step-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #93c5fd;
}
.results-path-step-final {
  border-color: rgba(250, 204, 21, 0.52);
  background: linear-gradient(155deg, rgba(250, 204, 21, 0.18), rgba(2, 6, 23, 0.58));
}
.results-path-arrow {
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 22px;
}
.results-conditioning-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.42);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: 12px;
  align-items: center;
}
.results-conditioning-card h4 {
  margin: 0;
  font-size: 20px;
}
.results-conditioning-values {
  display: grid;
  gap: 10px;
}
.results-conditioning-values > div {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.58);
}
.results-conditioning-values span {
  display: block;
  color: #9ca3af;
  font-size: 12px;
}
.results-conditioning-values strong {
  display: block;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 32px;
}
.synthesis-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.synthesis-card {
  background: rgba(15, 23, 42, .52);
}
.results-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.results-metric {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2, 6, 23, .34);
}
.results-metric span,
.results-metric small {
  display: block;
  color: #9ca3af;
  font-size: 12px;
}
.results-metric strong {
  display: block;
  margin: 2px 0;
  font-size: 21px;
  color: #f8fafc;
}
.results-components {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.results-components li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #9ca3af;
  font-size: 12px;
}
.results-components strong {
  color: #f8fafc;
  white-space: nowrap;
}
.results-table-wrap {
  overflow-x: auto;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.results-table th,
.results-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.results-table th {
  color: #cbd5e1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}
.results-table td {
  color: #e5e7eb;
}
.results-table td:first-child span {
  display: block;
  margin-top: 2px;
  color: #9ca3af;
}
.results-table .positive td:nth-child(2) {
  color: #86efac;
}
.results-table .negative td:nth-child(2) {
  color: #fca5a5;
}
.results-delta-down {
  color: #fca5a5;
}
.results-delta-up {
  color: #86efac;
}
.results-contrib {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #cbd5e1;
}
.results-contrib strong {
  display: inline-block;
  min-width: 4.5ch;
  color: #bfdbfe;
}
.results-contrib code {
  color: #bae6fd;
}
.results-disclosure {
  overflow: hidden;
}
.results-disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.results-disclosure > summary::-webkit-details-marker {
  display: none;
}
.results-disclosure > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #9ca3af;
  font-weight: 700;
}
.results-disclosure[open] > summary::before {
  content: "-";
  color: #f8fafc;
  border-color: rgba(125, 211, 252, 0.52);
}
.results-disclosure > section {
  padding: 14px;
}
.results-disclosure > section > .results-card {
  background: rgba(2, 6, 23, 0.26);
}
.results-page-intro {
  border-color: rgba(125, 211, 252, 0.25);
}
.results-loading,
.results-error {
  padding: 18px;
  color: #cbd5e1;
}

.landing-page {
  --landing-line: rgba(148, 163, 184, .28);
  --landing-cyan: #7dd3fc;
  --landing-gold: #facc15;
  --landing-green: #86efac;
  min-height: calc(100vh - 70px);
  color: var(--shell-text);
  background:
    linear-gradient(180deg, rgba(6, 12, 28, .96), rgba(11, 18, 32, 1) 52%, rgba(10, 14, 24, 1));
}
.landing-hero {
  position: relative;
  min-height: min(720px, calc(100vh - 72px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: end;
  overflow: hidden;
  border-bottom: 1px solid var(--shell-border);
  background:
    linear-gradient(90deg, rgba(125, 211, 252, .12), transparent 34%),
    linear-gradient(180deg, rgba(250, 204, 21, .08), transparent 36%),
    #07101f;
}
.landing-signal-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .9;
}
.landing-signal-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--landing-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--landing-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 72%, transparent 100%);
}
.landing-signal-field::after {
  content: "";
  position: absolute;
  inset: 16% -10% auto 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, .72), rgba(250, 204, 21, .58), transparent);
  transform: rotate(-17deg);
  transform-origin: center;
}
.signal-line {
  position: absolute;
  height: 1px;
  background: rgba(148, 163, 184, .45);
  transform-origin: left center;
}
.line-a { left: 8%; top: 28%; width: 72%; transform: rotate(11deg); }
.line-b { left: 12%; top: 62%; width: 64%; transform: rotate(-9deg); }
.line-c { left: 46%; top: 18%; width: 38%; transform: rotate(47deg); }
.signal-node,
.signal-core {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(226, 232, 240, .72);
  background: #0b1220;
  transform: rotate(45deg);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, .08);
}
.node-a { left: 10%; top: 26%; }
.node-b { left: 34%; top: 56%; border-color: rgba(134, 239, 172, .82); }
.node-c { right: 20%; top: 30%; border-color: rgba(250, 204, 21, .84); }
.node-d { right: 12%; bottom: 28%; border-color: rgba(196, 181, 253, .82); }
.signal-core {
  width: 28px;
  height: 28px;
  right: 28%;
  top: 48%;
  border-color: rgba(125, 211, 252, .9);
  box-shadow: 0 0 0 8px rgba(125, 211, 252, .08), 0 0 34px rgba(125, 211, 252, .28);
}
.landing-hero-copy {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 42px;
}
.landing-kicker {
  margin: 0 0 10px;
  color: var(--landing-cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.landing-hero h1 {
  margin: 0;
  font-size: clamp(48px, 10vw, 118px);
  line-height: .92;
  letter-spacing: 0;
}
.landing-subtitle {
  max-width: 780px;
  margin: 18px 0 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  color: #f8fafc;
}
.landing-lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.6;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.landing-btn {
  border: 1px solid rgba(226, 232, 240, .18);
  background: rgba(15, 23, 42, .72);
  color: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  font-weight: 750;
  cursor: pointer;
  white-space: normal;
}
.landing-btn:hover {
  border-color: var(--landing-cyan);
  background: rgba(14, 116, 144, .22);
}
.landing-btn.primary {
  color: #06111f;
  background: var(--landing-cyan);
  border-color: var(--landing-cyan);
}
.landing-btn.compact {
  margin-top: 8px;
}
.landing-hero-status {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto 26px;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}
.landing-hero-status div,
.landing-result-main,
.landing-result-copy,
.landing-card-grid article,
.path-card {
  border: 1px solid rgba(226, 232, 240, .12);
  background: rgba(15, 23, 42, .68);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .18);
}
.landing-hero-status div {
  padding: 12px;
}
.landing-hero-status span,
.landing-result-main span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}
.landing-hero-status strong,
.landing-result-main strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  color: #f8fafc;
}
.landing-section {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 46px 0;
  border-bottom: 1px solid rgba(226, 232, 240, .08);
}
.landing-section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}
.landing-section h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.06;
}
.landing-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.landing-copy-grid p,
.landing-result-copy p,
.path-card p,
.landing-card-grid p,
.landing-caveats li,
.landing-question-note {
  color: #cbd5e1;
  line-height: 1.55;
}
.landing-path {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.path-card {
  padding: 14px;
}
.path-card span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(125, 211, 252, .14);
  border: 1px solid rgba(125, 211, 252, .42);
  color: #bae6fd;
  font-weight: 800;
}
.path-card h3,
.landing-card-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.path-card p,
.landing-card-grid p {
  margin: 0;
  font-size: 14px;
}
.landing-results-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 12px;
}
.landing-result-main,
.landing-result-copy {
  padding: 18px;
}
.landing-result-main strong {
  color: var(--landing-green);
  font-size: clamp(36px, 7vw, 72px);
}
.landing-result-main p {
  margin: 12px 0 0;
  color: #f8fafc;
  line-height: 1.45;
}
.landing-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.landing-card-grid.six {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.landing-card-grid article {
  padding: 16px;
}
.landing-card-grid article:nth-child(2n) {
  border-color: rgba(134, 239, 172, .22);
}
.landing-card-grid article:nth-child(3n) {
  border-color: rgba(250, 204, 21, .22);
}
.landing-question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.landing-question-grid button {
  min-height: 58px;
  text-align: left;
  border: 1px solid rgba(226, 232, 240, .12);
  background: rgba(15, 23, 42, .62);
  color: #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  line-height: 1.35;
  cursor: pointer;
}
.landing-question-grid button:hover {
  border-color: var(--landing-gold);
}
.landing-question-note {
  margin: 14px 0 0;
}
.landing-caveats ul {
  columns: 2;
  column-gap: 28px;
  margin: 0;
  padding-left: 20px;
}
.landing-caveats li {
  break-inside: avoid;
  margin: 0 0 8px;
}

/* Landing identity upgrade */
.landing-page {
  background:
    linear-gradient(180deg, rgba(4, 8, 18, 1), rgba(8, 13, 25, 1) 45%, rgba(7, 11, 20, 1));
}
.landing-hero {
  min-height: min(760px, calc(100vh - 70px));
  align-content: center;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, .14), transparent 32%),
    linear-gradient(180deg, rgba(250, 204, 21, .10), transparent 34%),
    linear-gradient(135deg, #050b16, #081326 54%, #060a13);
}
.landing-signal-field::before {
  opacity: .42;
  background-size: 84px 84px;
}
.landing-signal-field::after {
  opacity: .72;
}
.signal-line {
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .58), transparent);
}
.signal-node,
.signal-core {
  background: #060b14;
}
.landing-hero-copy {
  padding: 82px 0 68px;
}
.landing-hero h1 {
  max-width: 880px;
  font-size: clamp(58px, 12vw, 138px);
  text-shadow: 0 18px 46px rgba(0, 0, 0, .36);
}
.landing-subtitle {
  max-width: 940px;
  font-size: clamp(25px, 3.7vw, 46px);
  color: #f8fafc;
}
.landing-lede {
  max-width: 850px;
  color: #d9e2ee;
  font-size: 18px;
}
.landing-lede-secondary {
  max-width: 900px;
  color: #b7c4d5;
}
.landing-actions {
  margin-top: 30px;
}
.landing-btn {
  border-radius: 10px;
  padding: 11px 16px;
  min-height: 46px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .20);
}
.landing-btn.primary {
  background: linear-gradient(135deg, #7dd3fc, #86efac);
  border-color: rgba(186, 230, 253, .95);
}
.landing-section {
  padding: 58px 0;
}
.landing-section-head {
  margin-bottom: 22px;
}
.landing-section h2 {
  max-width: 940px;
}
.landing-copy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.landing-copy-grid p {
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid rgba(125, 211, 252, .28);
}
.landing-path {
  grid-template-columns: repeat(7, minmax(180px, 1fr));
}
.path-card,
.landing-card-grid article,
.landing-result-main,
.landing-result-copy,
.landing-hero-status div {
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(15, 23, 42, .82), rgba(2, 6, 23, .72));
  border-color: rgba(148, 163, 184, .20);
}
.path-card {
  min-height: 210px;
  display: grid;
  align-content: start;
}
.path-card span {
  background: rgba(125, 211, 252, .12);
}
.path-card:nth-child(2n) span {
  border-color: rgba(134, 239, 172, .46);
  color: #bbf7d0;
  background: rgba(134, 239, 172, .10);
}
.path-card:nth-child(3n) span {
  border-color: rgba(250, 204, 21, .48);
  color: #fef08a;
  background: rgba(250, 204, 21, .10);
}
.landing-results-grid {
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
}
.landing-result-main {
  border-color: rgba(134, 239, 172, .28);
}
.landing-result-main strong {
  color: #a7f3d0;
}
.landing-result-copy {
  border-color: rgba(125, 211, 252, .22);
}
.landing-corpus-status {
  position: static;
  width: 100%;
  margin: 16px 0 0;
}
.landing-card-grid article {
  min-height: 144px;
}
.landing-card-grid h3,
.path-card h3 {
  color: #f8fafc;
}
.landing-question-grid button {
  min-height: 70px;
  background: linear-gradient(160deg, rgba(15, 23, 42, .78), rgba(2, 6, 23, .72));
}
.landing-caveats {
  border-bottom: 0;
}

@media (max-width: 760px) {
  #app-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  #brand {
    flex: 1 1 100%;
  }
  #app-tabs {
    margin-left: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  #evidence-viewer-pane .header {
    position: static;
    padding: 10px;
  }
  #evidence-viewer-pane .header-left {
    flex-wrap: wrap;
    gap: 8px;
  }
  #evidence-viewer-pane #search {
    flex: 1 1 100%;
    min-width: 0;
  }
  #evidence-viewer-pane #collapse-btn {
    margin-left: 0;
    flex: 0 0 auto;
  }
  #evidence-viewer-pane #header-controls {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
    gap: 8px;
  }
  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }
  #evidence-viewer-pane .container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
    padding: 10px;
  }
  #evidence-viewer-pane #tree {
    width: 100%;
    max-width: none;
    max-height: 46vh;
    overflow-y: auto;
  }
  #evidence-viewer-pane #detailpane {
    min-width: 0;
    width: 100%;
    min-height: 48vh;
  }
  .results-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .results-generated {
    white-space: normal;
  }
  .results-panel {
    padding: 12px;
    gap: 12px;
  }
  .results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .results-synthesis-hero,
  .results-conditioning-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .results-pathway {
    grid-template-columns: minmax(0, 1fr);
  }
  .results-path-arrow {
    min-height: 20px;
    font-size: 18px;
    transform: rotate(90deg);
  }
  .results-family-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .results-synthesis-score {
    font-size: clamp(42px, 15vw, 66px);
  }
  .results-disclosure > summary {
    font-size: 15px;
  }
  .landing-hero {
    min-height: auto;
  }
  .landing-hero-copy {
    padding: 48px 0 28px;
  }
  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .landing-hero-status,
  .landing-copy-grid,
  .landing-results-grid {
    grid-template-columns: 1fr;
  }
  .landing-section {
    width: min(100% - 24px, 1120px);
    padding: 34px 0;
  }
  .landing-path {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
  .landing-caveats ul {
    columns: 1;
  }
  #tree .section.sub {
    margin-left: 6px;
  }
  #tree .section-body {
    padding-left: 6px;
    padding-right: 4px;
  }
  .intro-grid {
    grid-template-columns: 1fr;
  }
}

.detail-intro .stage-badge{display:inline-block;margin-left:8px;padding:2px 8px;border:1px solid var(--border);border-radius:10px;font-size:12px;color:var(--muted)}
.detail-intro .lede{margin-top:2px;color:var(--muted)}
.detail-intro .stage-list{margin:8px 0 12px 18px}
.detail-intro .callout{background:rgba(59,130,246,.12);border:1px solid rgba(59,130,246,.35);padding:8px;border-radius:8px}


/* --- Stage intro "cosmic Logos" styles --- */

.detail-intro.cosmic{
 background-color:#0b1220 !important;position:relative; overflow:hidden; background: radial-gradient(1200px 600px at 10% 0%,
    rgba(59,130,246,.25), rgba(17,24,39,.0) 60%), linear-gradient(180deg, rgba(30,58,138,.20), rgba(2,6,23,.0) 55%);
  border:1px solid var(--border); border-radius:14px; padding:18px; box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.detail-intro .cosmic-bg::before, .detail-intro .cosmic-bg::after{
  content:""; position:absolute; inset:-20%; background:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,.6), transparent 60%);
  opacity:.35; pointer-events:none;
}
.intro-hero{ display:flex; flex-wrap:wrap; gap:16px; align-items:center; justify-content:space-between; margin-bottom:8px; }
.brand{ display:flex; gap:12px; align-items:center; }
.brand .glyph{ color:#7dd3fc; filter: drop-shadow(0 2px 6px rgba(59,130,246,.35)); }
.brand .logotype .site{ font-weight:700; letter-spacing:.5px; }
.brand .logotype .subtitle{ color:var(--muted); font-size:12px; margin-top:-2px; }
.intro-title{ display:flex; align-items:center; gap:10px; }
.detail-intro .stage-badge{ display:inline-block; padding:4px 10px; border:1px solid var(--border); border-radius:999px; font-size:12px; color:var(--muted); }
.john11{ margin:8px 0 0; padding-left:10px; border-left:3px solid rgba(125,211,252,.65); color:#cbd5e1; }
.john11 .ref{ font-weight:700; margin-right:8px; color:#93c5fd; }

.intro-body .lede{ color:#cbd5e1; margin:10px 0 12px; }
.explainer{ display:grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap:12px; }
.explainer .panel{ background: rgba(15,23,42,.55); border:1px solid var(--border); border-radius:12px; padding:12px; }
.explainer .callout{ margin-top:8px; background: rgba(59,130,246,.12); border:1px solid rgba(59,130,246,.35); padding:8px; border-radius:8px; }

.grid-title{ margin:14px 0 6px; }
.intro-grid{ display:grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap:10px; }
.intro-card{ background: rgba(17,24,39,.65); border:1px solid var(--border); border-radius:12px; padding:10px; display:flex; align-items:center; gap:10px; }
.intro-card span{ display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center; border-radius:50%; border:1px solid var(--border); font-weight:700; color:#93c5fd; }
.intro-card.verdict{ outline:1px solid rgba(59,130,246,.35); box-shadow: inset 0 0 12px rgba(59,130,246,.25); }

.howto{ margin-top:10px; }
.verdict-tease{ margin-top:10px; color:#cbd5e1; }

@media (max-width: 920px){
  .explainer{ grid-template-columns: 1fr; }
  .intro-grid{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}



.detail-intro .therefore-glyph{
  font-size: 42px;
  font-weight: bold;
  color:#93c5fd;
  text-shadow: 0 0 6px rgba(147,197,253,.7);
}
.detail-intro .logos-explain{margin-top:8px;color:#cbd5e1;}
.frameworks{margin:6px 0 12px 20px;}
.frameworks li{margin-bottom:4px;}
.subtitle2{font-size:14px;color:var(--muted);margin-left:6px;}



.intro-card .num{
  display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--border); font-weight:700; color:#93c5fd; margin-right:8px;
}



/* Stage cards polishing */
.intro-card{
  display:flex; gap:10px; align-items:flex-start; padding:12px; border:1px solid var(--border);
  border-radius:12px; background: rgba(17,24,39,.65);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.intro-card:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.28); }
.intro-card.active{ border-color: rgba(147,197,253,.6); box-shadow: 0 0 0 2px rgba(147,197,253,.25) inset; }
.intro-card .num{
  display:inline-flex; min-width:28px; height:28px; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--border); font-weight:700; color:#93c5fd; margin-top:2px;
}
.card-text{ display:flex; flex-direction:column; gap:4px; }
.card-title{ font-weight:600; }
.card-desc{ color:#cbd5e1; font-size:13px; line-height:1.35; }



/* Hypotheses by stage */
.hyp-grid{ display:grid; grid-template-columns: 1fr; gap:10px; margin:8px 0 12px; }
.hyp-row{ background: rgba(17,24,39,.65); border:1px solid var(--border); border-radius:12px; padding:10px; }
.hyp-stage{ font-weight:600; margin-bottom:6px; }
.hyp-list{ margin-left:18px; }
.hyp-list li{ margin:2px 0; }
@media (min-width: 960px){
  .hyp-grid{ grid-template-columns: 1fr 1fr; } /* show two columns on wide screens */
}



.hyp-badge{
  margin-left:8px; padding:1px 6px; border:1px solid var(--border); border-radius:999px;
  font-size:11px; color:#93c5fd; background: rgba(15,23,42,.6);
}



/* Stage cards polishing + active highlight */
.intro-card{
  display:flex; gap:10px; align-items:flex-start; padding:12px; border:1px solid var(--border);
  border-radius:12px; background: rgba(17,24,39,.65);
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.intro-card:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.28); }
.intro-card.active{ border-color: rgba(147,197,253,.6); box-shadow: 0 0 0 2px rgba(147,197,253,.25) inset; }
.intro-card .num{
  display:inline-flex; min-width:28px; height:28px; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--border); font-weight:700; color:#93c5fd; margin-top:2px;
}
.card-text{ display:flex; flex-direction:column; gap:4px; }
.card-title{ font-weight:600; }
.card-desc{ color:#cbd5e1; font-size:13px; line-height:1.35; }

/* Special Stage 7 visuals */
.intro-card.stage7-card {
  background: linear-gradient(135deg, rgba(30,41,59,.85) 0%, rgba(253,224,71,.12) 100%);
  border-color: rgba(253,224,71,.6);
  box-shadow: 0 0 12px rgba(253,224,71,.35);
  flex-wrap: nowrap;
  width: fit-content;

  /* Center in its own merged row */
  grid-column: 1 / -1;   /* span all columns of the grid */
  justify-self: center;  /* center horizontally */
}
/* Centered verse block below the grid */
.stage7-verse-block{
  grid-column: 1 / -1;
  text-align: center;
  margin: 16px auto 6px;
  font-style: italic;
  font-size: 15px;
  color: #facc15;
  text-shadow: 0 0 6px rgba(250,204,21,.6);
  max-width: 640px;
}



/* Keep Stage 7 title on one line and preserve glow */
.intro-card.stage7-card{ 
  background: linear-gradient(135deg, rgba(30,41,59,.85) 0%, rgba(253,224,71,.12) 100%);
  border-color: rgba(253,224,71,.6);
  box-shadow: 0 0 12px rgba(253,224,71,.35);
  flex-wrap: nowrap;
}
.intro-card.stage7-card {
    background: linear-gradient(135deg, rgba(30,41,59,.85) 0%, rgba(253,224,71,.12) 100%);
    border-color: rgba(253,224,71,.6);
    box-shadow: 0 0 12px rgba(253,224,71,.35);
    flex-wrap: nowrap;
    margin: 20px;
    height: 100px;
    align-content: center;
    align-items: center;
    margin-bottom: 0px;
}
/* Stage overview bullets */
.stage-bullets{ margin: 8px 0 0 18px; }
.stage-bullets li{ margin: 2px 0; }


/* DATA: Hypothesis tree on landing */
.hyp-landing{margin-top:24px}
.hyp-landing .hyp-title{margin:0 0 8px 0;opacity:.9}
.hyp-landing .hyp-tree{border:1px solid var(--border,#1f2937);border-radius:12px;padding:12px;background:rgba(17,24,39,.35)}

/* DATA: Static Hypothesis Tree on landing */
.hyp-landing { margin-top: 20px; }
.hyp-title { margin: 0 0 10px; opacity: .92; letter-spacing: .2px; }
.hyp-tree-static { list-style: none; padding-left: 0; margin: 0; }
.hyp-tree-static ul { list-style: none; padding-left: 18px; margin: 6px 0; }
.hyp-tree-static .hyp-id { opacity: .6; font-weight: 500; margin-left: 4px; }
.hyp-tree-static .st { opacity: .7; font-style: normal; margin-left: 8px; font-weight: 500; }
.hyp-tree-static li { margin: 4px 0; line-height: 1.35; }
.hyp-tree-static strong { font-weight: 600; }
body.beta-gate-pending {
  overflow: hidden;
  background: #05070d;
}

body.beta-gate-pending #app-shell {
  filter: grayscale(1) blur(8px) brightness(0.34) contrast(0.82);
  opacity: 0.62;
  pointer-events: none;
  user-select: none;
}

.beta-access-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, rgba(200, 210, 224, 0.16), transparent 32%),
    rgba(4, 6, 12, 0.78);
  background-size: 42px 42px, 42px 42px, auto, auto;
  backdrop-filter: blur(16px) grayscale(1);
}

body.beta-gate-pending .beta-access-gate {
  display: grid;
}

.beta-access-card {
  position: relative;
  width: min(100%, 480px);
  border: 1px solid rgba(226, 232, 240, 0.36);
  border-radius: 18px;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 26%),
    linear-gradient(145deg, rgba(9, 12, 20, 0.98), rgba(18, 23, 34, 0.96));
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f3f6fb;
  overflow: hidden;
}

.beta-access-card::before,
.beta-access-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.95) 0 18px,
    rgba(17, 24, 39, 0.9) 18px 30px
  );
}

.beta-access-card::before {
  top: 0;
}

.beta-access-card::after {
  bottom: 0;
}

.beta-access-stamp {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 16px;
  border: 1px solid rgba(245, 158, 11, 0.72);
  border-radius: 999px;
  padding: 4px 12px;
  color: #fbbf24;
  background: rgba(120, 53, 15, 0.18);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.beta-access-kicker {
  margin: 0 0 10px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.beta-access-card h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.beta-access-card p {
  color: rgba(226, 232, 240, 0.82);
}

.beta-access-label {
  display: block;
  margin: 22px 0 8px;
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.92rem;
  font-weight: 700;
}

.beta-access-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.beta-access-row input {
  min-width: 0;
  border: 1px solid rgba(203, 213, 225, 0.32);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.42);
  color: #f8fafc;
  font-size: 1rem;
  outline: none;
}

.beta-access-row input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16);
}

.beta-access-row button {
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.beta-access-row button:hover {
  filter: brightness(1.04);
}

.beta-access-error {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: #fecaca !important;
  font-weight: 700;
}

.beta-access-note {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: rgba(203, 213, 225, 0.68) !important;
}

@media (max-width: 520px) {
  .beta-access-card {
    padding: 22px;
  }

  .beta-access-row {
    grid-template-columns: 1fr;
  }

  .beta-access-row button {
    min-height: 44px;
  }
}

/* Product polish pass: evidence tree, dossier detail, and synthesis results */
#evidence-viewer-pane {
  --ui-accent: #7dd3fc;
  --ui-accent-2: #fbbf24;
  --ui-good: #8fd8b7;
  --ui-caution: #dcc48a;
  --ui-neg: #d7a1ad;
  --ui-support: #b5bad9;
  --ui-surface: rgba(16, 24, 40, 0.62);
  --ui-surface-2: rgba(8, 14, 26, 0.36);
  --ui-line: rgba(152, 168, 192, 0.14);
  background:
    radial-gradient(circle at 72% 0%, rgba(120, 180, 220, 0.055), transparent 38%),
    linear-gradient(180deg, #08101d 0%, #091020 56%, #060b14 100%);
}

#evidence-viewer-pane .container {
  gap: 16px !important;
  padding: 14px !important;
  grid-template-columns: minmax(340px, 28vw) minmax(0, 1fr) !important;
}

#evidence-viewer-pane .tree {
  gap: 8px;
  padding: 2px;
}

#tree .section {
  border: 1px solid rgba(152, 168, 192, 0.11);
  border-radius: 12px;
  background: rgba(12, 19, 34, 0.44);
  box-shadow: none;
}

#tree .section-header {
  grid-template-columns: minmax(0, 1fr) max-content 22px !important;
  gap: 8px !important;
  min-height: 38px;
  padding: 8px 11px !important;
  border-bottom: 0 !important;
  background: rgba(15, 24, 41, 0.62) !important;
  color: #dbe5f3;
}

#tree .section.open > .section-header {
  background: rgba(19, 30, 49, 0.72) !important;
}

#tree .section:not(.sub) > .section-header {
  border-bottom: 1px solid rgba(152, 168, 192, 0.12);
}

#tree .section.sub > .section-header {
  background: rgba(13, 20, 34, 0.48) !important;
  color: #ced8e8;
  border-bottom: 1px solid rgba(152, 168, 192, 0.08);
}

#tree .section-caret { display: none !important; }

#tree .section-control {
  grid-column: 3 !important;
  display: inline-grid !important;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
}

#tree .section-title {
  grid-column: 1 !important;
  justify-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-width: 0 !important;
  font-size: 0.96rem;
  font-weight: 670;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

#tree .section-header[title="Anthropology"] > .section-title,
#tree .section-header[title="Archaeology"] > .section-title,
#tree .section-header[title="History"] > .section-title,
#tree .section-header[title="Science"] > .section-title,
#tree .section-header[title="Philosophy"] > .section-title,
#tree .section-header[title="Scripture / Text"] > .section-title,
#tree .section-header[title="World Religions"] > .section-title,
#tree .section-header[title="Mathematics / Logic"] > .section-title,
#tree .section-header[title="Methodology / Signal Core"] > .section-title {
  min-width: 18ch !important;
}

#tree .section-header .count {
  grid-column: 2 !important;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(2, 6, 23, 0.32);
  color: #b8c4d4;
  font-size: 0.74rem;
}

#tree .section-body {
  padding: 3px 7px 8px 11px !important;
}

#tree .section.sub {
  margin: 8px 0 0 8px !important;
  border-color: rgba(152, 168, 192, 0.08);
  background: rgba(6, 12, 23, 0.2);
}

#tree .item {
  position: relative;
  margin: 6px 0;
  border: 1px solid rgba(152, 168, 192, 0.08);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(10, 16, 28, 0.42);
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

#tree .item:hover {
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(14, 22, 38, 0.62);
}

#tree .item.selected {
  border-color: rgba(125, 211, 252, 0.38);
  background: linear-gradient(90deg, rgba(24, 52, 78, 0.56) 0%, rgba(12, 22, 38, 0.74) 42%, rgba(10, 16, 28, 0.6) 100%);
  box-shadow: inset 2px 0 0 rgba(125, 211, 252, 0.86), 0 0 0 1px rgba(125, 211, 252, 0.08);
}

#tree .item h4 {
  margin: 0 !important;
  color: #e9eff8;
  font-size: 0.91rem !important;
  font-weight: 620;
  line-height: 1.3 !important;
  letter-spacing: 0;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

#tree .tree-item-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  min-width: 0;
}

#tree .tree-status-pill,
.detail-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  color: #bfccd9;
  font-size: 0.7rem;
  font-weight: 680;
  white-space: nowrap;
}

#tree .tree-status-pill.scored,
.detail-status-pill.scored {
  border-color: rgba(143, 216, 183, 0.36);
  background: rgba(90, 158, 126, 0.14);
  color: #cdecdc;
}

#tree .tree-status-pill.strong,
.detail-status-pill.strong {
  border-color: rgba(220, 196, 138, 0.4);
  background: rgba(168, 136, 73, 0.16);
  color: #f0e2be;
}

#tree .tree-status-pill.support,
.detail-status-pill.support {
  border-color: rgba(181, 186, 217, 0.34);
  background: rgba(102, 112, 148, 0.18);
  color: #d7dbf2;
}

#tree .tree-status-pill.pending,
.detail-status-pill.pending,
.detail-status-pill.subtle {
  border-color: rgba(220, 196, 138, 0.34);
  background: rgba(150, 124, 76, 0.14);
  color: #e8dcbf;
}

#tree .tree-status-pill.context,
.detail-status-pill.context,
#tree .tree-status-pill.unweighted,
.detail-status-pill.unweighted {
  border-color: rgba(168, 140, 96, 0.3);
  background: rgba(109, 88, 56, 0.12);
  color: #d6c8a9;
}

#tree .tree-ref-count {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8fa1b7;
  font-size: 0.71rem;
}

#tree .item .badges {
  display: none !important;
}

#evidence-viewer-pane .detail {
  border: 1px solid rgba(152, 168, 192, 0.12);
  border-radius: 16px;
  padding: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(125, 211, 252, 0.06), transparent 30%),
    rgba(8, 13, 24, 0.68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.detail-dossier {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.detail-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 34%);
  gap: 14px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 14px;
  padding: 15px 16px;
  background:
    radial-gradient(circle at 72% 8%, rgba(154, 210, 214, 0.1), transparent 34%),
    linear-gradient(156deg, rgba(18, 44, 72, 0.46), rgba(10, 18, 34, 0.78) 66%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.detail-kicker {
  margin: 0 0 5px;
  color: #9fd7eb;
  font-size: 0.7rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#evidence-viewer-pane .detail .detail-hero-card h2 {
  margin: 0;
  color: #f3f8ff !important;
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

#evidence-viewer-pane #detailpane .detail-hero-card h2,
#evidence-viewer-pane #detailScrollFix .detail-hero-card h2,
#evidence-viewer-pane .detail .detail-dossier .detail-hero-card h2 {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #f8fafc !important;
  text-align: left !important;
  text-shadow: none;
}

.detail-breadcrumb {
  margin-top: 7px;
  color: #9fadc0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.detail-thesis {
  max-width: 70ch;
  margin: 12px 0 0;
  color: #dde7f4;
  font-size: 0.99rem;
  line-height: 1.68;
}

.detail-hero-side {
  display: grid;
  align-content: start;
  gap: 8px;
}

.detail-id-chip {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(152, 168, 192, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(5, 10, 22, 0.38);
}

.detail-id-chip span {
  color: #97a8bd;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.detail-id-chip code {
  color: #e0f2fe;
  white-space: normal;
  overflow-wrap: anywhere;
}

#evidence-viewer-pane .ev-id-chip {
  vertical-align: middle;
  border: 1px solid rgba(125, 211, 252, 0.24);
  background: rgba(2, 6, 23, 0.52) !important;
  color: #cbd5e1 !important;
}

#evidence-viewer-pane .ev-id-chip code {
  color: #e0f2fe !important;
}

.detail-status-strip,
.detail-bf-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-bf-chip {
  display: inline-grid;
  gap: 3px;
  min-width: 108px;
  border: 1px solid rgba(152, 168, 192, 0.18);
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(4, 10, 20, 0.34);
  color: #bfccd9;
}

.detail-bf-chip strong {
  color: #f8fafc;
  font-size: 0.78rem;
}

.detail-bf-chip span {
  color: #90a2b8;
  font-size: 0.73rem;
}

.detail-bf-chip.positive {
  border-color: rgba(143, 216, 183, 0.34);
}

.detail-bf-chip.negative {
  border-color: rgba(215, 161, 173, 0.38);
}

.detail-bf-chip strong[class*="alt"],
.detail-bf-chip strong[class*="ALT"] {
  color: #ebc0cb;
}

.detail-mini-card,
.detail-evidence-card,
#evidence-viewer-pane .detail .article .detail-article-block,
#evidence-viewer-pane .detail .summary {
  max-width: 1040px;
  border: 1px solid rgba(152, 168, 192, 0.1) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.52), rgba(10, 16, 30, 0.5)) !important;
  color: #dbe5f2 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.016);
}

#evidence-viewer-pane .detail .article {
  display: grid;
  gap: 9px;
  max-width: 1000px;
  line-height: 1.74;
  color: #dce7f3;
}

#evidence-viewer-pane .detail .detail-section-heading {
  width: auto;
  margin: 12px 0 2px !important;
  border: 0;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: #a8bbd2 !important;
  font-size: 0.73rem !important;
  font-weight: 720 !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#evidence-viewer-pane .detail .article .detail-article-block {
  margin: 0 0 4px !important;
  padding: 16px 18px !important;
  font-size: 0.98rem !important;
}

#evidence-viewer-pane .detail .article .detail-article-block p {
  max-width: 76ch;
}

.detail-mini-card,
.detail-evidence-card {
  padding: 16px 18px;
}

.detail-evidence-card h3 {
  margin: 0 0 8px;
  color: #e9f0f8;
  font-size: 1.02rem;
  font-weight: 640;
}

.detail-bayes-card .table,
#evidence-viewer-pane .detail .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 12px;
}

#evidence-viewer-pane .detail .table th,
#evidence-viewer-pane .detail .table td {
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding: 10px 12px;
}

#evidence-viewer-pane .detail .table th {
  color: #c5d5ea;
  background: rgba(6, 12, 24, 0.54);
}

.scripture {
  max-width: 1040px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 15px;
  padding: 14px;
  background: rgba(41, 31, 12, 0.22);
}

.scripture h3 {
  margin: 0 0 10px;
  color: #fde68a;
}

.scripture-block {
  border-color: rgba(251, 191, 36, 0.18) !important;
  background: rgba(2, 6, 23, 0.36) !important;
}

#results-summary-root.results-panel {
  max-width: 1500px;
  padding: 26px;
  gap: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 211, 252, 0.1), transparent 34%),
    linear-gradient(180deg, #07101f, #080c16 62%, #05070d);
}

.results-card,
.results-hero,
.results-disclosure,
.results-stats > div {
  border-color: rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.54));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.025);
}

.results-synthesis-v3 {
  position: relative;
  border-color: rgba(125, 211, 252, 0.26);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(14, 116, 144, 0.14), rgba(2, 6, 23, 0.72)),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}

.results-synthesis-main {
  min-height: 360px;
  display: grid;
  align-content: center;
  border-radius: 22px;
  padding: clamp(22px, 4vw, 42px);
  background:
    radial-gradient(circle at 78% 10%, rgba(134, 239, 172, 0.18), transparent 26%),
    linear-gradient(145deg, rgba(12, 74, 110, 0.32), rgba(2, 6, 23, 0.78) 62%);
  border-color: rgba(125, 211, 252, 0.28);
}

.results-synthesis-main h3 {
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  max-width: 780px;
}

.results-synthesis-score {
  font-size: clamp(74px, 12vw, 156px);
  color: #ecfeff;
  text-shadow: 0 0 32px rgba(125, 211, 252, 0.22);
}

.results-synthesis-subline {
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  max-width: 760px;
}

.results-synthesis-meta {
  align-content: stretch;
}

.results-metric {
  border-color: rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.42);
}

.results-pathway {
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  padding: 4px;
}

.results-path-step {
  border-radius: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.68);
}

.results-path-step strong {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.results-path-arrow {
  color: rgba(125, 211, 252, 0.74);
}

.results-conditioning-card {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.11), rgba(15, 23, 42, 0.68));
}

.results-family-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr));
}

.results-family-card {
  padding: 18px;
}

.results-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.24);
}

.results-table th,
.results-table td {
  border-bottom-color: rgba(148, 163, 184, 0.12);
  padding: 10px;
}

.results-table tr:hover td {
  background: rgba(125, 211, 252, 0.045);
}

.results-disclosure > summary {
  min-height: 58px;
  border-radius: 18px 18px 0 0;
  background: rgba(15, 23, 42, 0.52);
}

@media (max-width: 900px) {
  #evidence-viewer-pane .container {
    grid-template-columns: 1fr !important;
  }

  .detail-hero-card,
  .results-synthesis-hero,
  .results-conditioning-card {
    grid-template-columns: 1fr;
  }

  #tree .section-body {
    padding-left: 8px !important;
  }
}

@media (max-width: 760px) {
  .detail-dossier {
    padding: 12px;
  }

  .detail-hero-card {
    padding: 16px;
  }

  .results-pathway {
    grid-template-columns: 1fr;
  }
}

/* Focused UI/UX refinement: stronger hierarchy, quieter evidence map, premium dossier. */
#evidence-viewer-pane {
  --map-item: rgba(8, 14, 26, 0.42);
  --map-item-hover: rgba(13, 23, 39, 0.68);
  --map-selected: rgba(23, 57, 88, 0.72);
  --map-cyan: #7dd3fc;
  --map-green: #9be3bd;
  --map-amber: #e6ca85;
  --map-red: #e3a2af;
}

#evidence-viewer-pane .tree {
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 16px;
  padding: 10px 8px;
  background:
    linear-gradient(180deg, rgba(12, 20, 35, 0.52), rgba(5, 10, 20, 0.48)),
    rgba(2, 6, 23, 0.34);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.018);
}

#tree > .section {
  border: 1px solid rgba(148, 163, 184, 0.105);
  background: linear-gradient(180deg, rgba(15, 24, 41, 0.72), rgba(10, 17, 31, 0.58));
}

#tree > .section.open {
  border-color: rgba(125, 211, 252, 0.16);
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.045), transparent 42%),
    linear-gradient(180deg, rgba(16, 27, 47, 0.80), rgba(8, 15, 29, 0.62));
}

#tree .section-header {
  grid-template-columns: minmax(0, 1fr) max-content 24px !important;
  gap: 9px !important;
  min-height: 40px;
  border: 0 !important;
  border-radius: 11px;
  background: transparent !important;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

#tree .section.open:not(.sub) > .section-header {
  background: rgba(125, 211, 252, 0.045) !important;
}

#tree .section:not(.sub) > .section-header .section-title {
  color: #edf5ff;
  font-size: 0.98rem;
  font-weight: 730;
}

#tree .section.sub {
  margin: 8px 10px 8px 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 11px;
  background: rgba(2, 6, 23, 0.20);
}

#tree .section.sub > .section-header {
  min-height: 36px;
  background: rgba(8, 14, 26, 0.42) !important;
}

#tree .section.sub .section-title {
  color: #cbd7e7;
  font-size: 0.90rem;
  font-weight: 650;
}

#tree .section-title {
  letter-spacing: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

#tree .section-header .count {
  justify-self: end;
  min-width: 3.2ch;
  padding: 1px 6px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.28);
  color: #9caabe;
  font-size: 0.70rem;
  font-weight: 650;
}

#tree .section-control {
  justify-self: end;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.18);
  color: #aebbc9;
}

#tree .section.open > .section-header .section-control {
  border-color: rgba(125, 211, 252, 0.23);
  background: rgba(125, 211, 252, 0.08);
  color: #d8f3ff;
}

#tree .section-body {
  padding: 2px 8px 9px 12px !important;
}

#tree .item {
  margin: 5px 0;
  border-color: rgba(148, 163, 184, 0.07);
  border-radius: 10px;
  padding: 8px 10px 8px 12px;
  background: var(--map-item);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

#tree .item:hover {
  border-color: rgba(125, 211, 252, 0.18);
  background: var(--map-item-hover);
}

#tree .item.selected {
  border-color: rgba(125, 211, 252, 0.48);
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.16) 0, rgba(125, 211, 252, 0.07) 46%, rgba(6, 12, 23, 0.62) 100%),
    var(--map-selected);
  box-shadow:
    inset 4px 0 0 rgba(125, 211, 252, 0.95),
    0 0 0 1px rgba(125, 211, 252, 0.12),
    0 10px 26px rgba(2, 6, 23, 0.28);
}

#tree .item h4 {
  color: #dbe6f5;
  font-size: 0.86rem !important;
  font-weight: 610;
  line-height: 1.34 !important;
}

#tree .item.selected h4 {
  color: #f4f9ff;
}

#tree .tree-status-pill,
.detail-status-pill {
  min-height: 18px;
  padding: 1px 7px;
  font-size: 0.66rem;
}

#tree .tree-status-pill.scored,
.detail-status-pill.scored,
#tree .tree-status-pill.strong,
.detail-status-pill.strong {
  border-color: rgba(155, 227, 189, 0.32);
  background: rgba(72, 143, 111, 0.17);
  color: #d6f6e4;
}

#tree .tree-status-pill.pending,
.detail-status-pill.pending,
.detail-status-pill.subtle,
#tree .tree-status-pill.context,
.detail-status-pill.context,
#tree .tree-status-pill.unweighted,
.detail-status-pill.unweighted {
  border-color: rgba(230, 202, 133, 0.26);
  background: rgba(111, 86, 42, 0.14);
  color: #eadbb5;
}

#tree .tree-status-pill.support,
.detail-status-pill.support {
  border-color: rgba(181, 186, 217, 0.30);
  background: rgba(89, 98, 135, 0.17);
  color: #dce1f5;
}

#tree .tree-ref-count {
  color: #8495aa;
  font-size: 0.68rem;
}

#evidence-viewer-pane .detail {
  border-color: rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 74% 0%, rgba(125, 211, 252, 0.055), transparent 32%),
    linear-gradient(180deg, rgba(9, 15, 28, 0.82), rgba(4, 9, 18, 0.72));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22), inset 1px 0 0 rgba(255, 255, 255, 0.018);
}

.detail-dossier {
  gap: 16px;
  padding: 18px;
}

.detail-hero-card {
  border-color: rgba(125, 211, 252, 0.28);
  border-radius: 16px;
  padding: 18px;
  background:
    radial-gradient(circle at 78% 10%, rgba(125, 211, 252, 0.13), transparent 36%),
    linear-gradient(145deg, rgba(18, 48, 78, 0.54), rgba(7, 14, 27, 0.86) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#evidence-viewer-pane .detail .detail-hero-card h2 {
  color: #f7fbff !important;
  font-size: clamp(1.35rem, 1.5vw, 1.82rem);
  line-height: 1.18;
}

.detail-breadcrumb {
  color: #9eb0c5;
  font-size: 0.82rem;
}

.detail-thesis {
  max-width: 78ch;
  color: #dce7f3;
  line-height: 1.72;
}

.detail-id-chip {
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(2, 6, 23, 0.34);
}

.detail-bf-chip {
  border-color: rgba(148, 163, 184, 0.15);
  background: rgba(2, 6, 23, 0.28);
}

.detail-bf-chip.positive {
  border-color: rgba(155, 227, 189, 0.30);
  background: rgba(45, 111, 82, 0.13);
}

.detail-bf-chip.negative {
  border-color: rgba(227, 162, 175, 0.34);
  background: rgba(116, 48, 62, 0.14);
}

.detail-mini-card,
.detail-evidence-card,
#evidence-viewer-pane .detail .article .detail-article-block,
#evidence-viewer-pane .detail .summary {
  border-color: rgba(148, 163, 184, 0.085) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(12, 20, 35, 0.54), rgba(6, 12, 24, 0.45)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

#evidence-viewer-pane .detail .article {
  gap: 11px;
  max-width: 1060px;
  color: #dde8f4;
  font-size: 1rem;
  line-height: 1.78;
}

#evidence-viewer-pane .detail .detail-section-heading {
  color: #9fbbd3 !important;
  font-size: 0.70rem !important;
  font-weight: 760 !important;
  letter-spacing: 0.10em;
}

#evidence-viewer-pane .detail .article .detail-article-block,
.detail-mini-card,
.detail-evidence-card {
  padding: 17px 20px !important;
}

.detail-evidence-card h3 {
  color: #eff6ff;
  font-size: 1rem;
}

@media (max-width: 760px) {
  #evidence-viewer-pane .tree {
    padding: 8px 6px;
  }

  #tree .section.sub {
    margin-left: 8px !important;
  }

  .detail-dossier {
    padding: 12px;
  }

  .detail-hero-card {
    padding: 15px;
  }
}

/* Signal shell polish: keep the top nav clean and move secondary modules under More. */
:root {
  --shell-bg: #050914;
  --shell-border: rgba(148, 163, 184, 0.16);
  --shell-accent: #7dd3fc;
  --shell-gold: #f7d36f;
  --shell-text: #e7eef8;
}

#app-header {
  background:
    radial-gradient(circle at 10% 0%, rgba(125, 211, 252, 0.12), transparent 22rem),
    radial-gradient(circle at 86% 0%, rgba(247, 211, 111, 0.10), transparent 20rem),
    rgba(5, 9, 20, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.app-tab {
  min-height: 36px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.28);
  color: #cbd7e6;
  font-weight: 750;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.app-tab:hover,
.app-tab:focus-visible {
  border-color: rgba(125, 211, 252, 0.42);
  color: #eef8ff;
  background: rgba(14, 35, 58, 0.46);
}

.app-tab.active {
  border-color: rgba(125, 211, 252, 0.62);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(14, 35, 58, 0.76), rgba(3, 10, 22, 0.62));
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.18),
    0 0 28px rgba(125, 211, 252, 0.12);
}

.app-tab.active[data-pane="landing-pane"],
.app-tab.active[data-pane="results-pane"] {
  border-color: rgba(247, 211, 111, 0.44);
  box-shadow:
    inset 0 0 0 1px rgba(247, 211, 111, 0.14),
    0 0 28px rgba(247, 211, 111, 0.10);
}

.other-suite {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 68px);
  padding: clamp(16px, 2.4vw, 30px);
  color: #e7eef8;
  background:
    radial-gradient(circle at 82% 0%, rgba(247, 211, 111, 0.11), transparent 24rem),
    radial-gradient(circle at 14% 16%, rgba(125, 211, 252, 0.13), transparent 26rem),
    linear-gradient(180deg, #050914 0%, #020611 100%);
}

.app-tab[data-pane="other-pane"].active {
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.12),
    0 0 26px rgba(125, 211, 252, 0.10);
}

.other-submenu,
.other-module-panel {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background: rgba(7, 13, 27, 0.70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.other-submenu {
  align-self: start;
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.other-kicker {
  margin: 0;
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.other-submenu h2,
.other-module-head h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
  line-height: 1.05;
}

.other-submenu-intro {
  margin: -2px 0 4px;
  color: #b4c3d6;
  font-size: 0.92rem;
  line-height: 1.55;
}

.other-submenu-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.38);
  color: #dbe7f7;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.other-submenu-button:hover {
  border-color: rgba(125, 211, 252, 0.28);
  background: rgba(10, 18, 34, 0.64);
  text-decoration: none;
}

.other-submenu-button span {
  font-weight: 850;
}

.other-submenu-button small,
.other-submenu-note,
.other-module-head p {
  color: #9aa9bc;
  line-height: 1.55;
}

.other-submenu-button.active {
  border-color: rgba(247, 211, 111, 0.42);
  background:
    radial-gradient(circle at 90% 18%, rgba(247, 211, 111, 0.14), transparent 8rem),
    rgba(10, 18, 34, 0.76);
  box-shadow: inset 3px 0 0 rgba(247, 211, 111, 0.72);
}

.other-module-panel {
  display: none;
  min-width: 0;
  overflow: hidden;
}

.other-module-panel.active {
  display: block;
}

.other-mobile-back {
  display: none;
}

.other-module-head {
  display: grid;
  gap: 8px;
  padding: clamp(18px, 2.4vw, 28px) clamp(18px, 2.4vw, 30px) 0;
}

.signal-calculation-panel,
.ai-alignment-panel {
  padding-bottom: clamp(22px, 3vw, 34px);
}

.signal-calculation-body {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 2.4vw, 30px);
}

.signal-pipeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.signal-pipeline-step {
  position: relative;
  min-height: 150px;
  padding: 16px 14px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(2, 6, 23, 0.52)),
    radial-gradient(circle at 50% 0%, rgba(125, 211, 252, 0.10), transparent 8rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.signal-pipeline-step::after {
  content: "";
  position: absolute;
  top: 32px;
  right: -10px;
  width: 10px;
  height: 1px;
  background: linear-gradient(90deg, rgba(125, 211, 252, 0.34), rgba(247, 211, 111, 0.34));
}

.signal-pipeline-step:last-child::after {
  display: none;
}

.signal-pipeline-step span {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.10);
  color: #9be7ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.signal-pipeline-step strong {
  display: block;
  color: #f4f8ff;
  font-size: 1rem;
  line-height: 1.2;
}

.signal-pipeline-step small {
  display: block;
  margin-top: 10px;
  color: #a9b8cb;
  line-height: 1.45;
}

.signal-math-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
}

.signal-math-card,
.signal-caveat-list,
.signal-caveat-band,
.signal-article-section,
.signal-article-hero {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.signal-article-hero {
  position: relative;
}

.signal-article-hero::before {
  content: "\2234\2020\2234";
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: #f8d977;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 0 0 18px rgba(248, 217, 119, 0.34);
}

.signal-math-card,
.signal-caveat-list {
  padding: 20px;
}

.signal-math-card h3,
.signal-caveat-list h3 {
  margin: 0 0 14px;
  color: #f8fbff;
}

.signal-math-card p {
  margin: 0 0 10px;
  color: #c9d8ea;
}

.signal-math-card code {
  display: block;
  white-space: normal;
  color: #e9f6ff;
}

.signal-caveat-list ul {
  margin: 0;
  padding-left: 20px;
  color: #c9d8ea;
  line-height: 1.65;
}

.signal-caveat-list p {
  margin: 0 0 12px;
  color: #c9d8ea;
  line-height: 1.68;
}

.signal-caveat-list p strong {
  color: #fff2c7;
}

.signal-deep-article {
  display: grid;
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(18px, 2.4vw, 30px);
}

.signal-article-hero {
  padding: clamp(24px, 3.4vw, 42px);
  background:
    radial-gradient(circle at 12% 0%, rgba(125, 211, 252, 0.15), transparent 20rem),
    radial-gradient(circle at 88% 10%, rgba(247, 211, 111, 0.13), transparent 20rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.66));
}

.signal-article-hero h2 {
  margin: 8px 0 14px;
  max-width: 18ch;
  color: #f8fbff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.signal-article-hero p:last-child {
  max-width: 68ch;
  margin: 0;
  color: #d7e5f5;
  font-size: clamp(1.06rem, 1.45vw, 1.28rem);
  line-height: 1.65;
}

.signal-article-section {
  padding: clamp(20px, 2.6vw, 32px);
}

.signal-article-section h3 {
  margin: 0 0 14px;
  color: #f7fbff;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.15;
}

.signal-article-section p,
.signal-caveat-band p {
  max-width: 78ch;
  margin: 0 0 16px;
  color: #d4dfed;
  font-size: 1.04rem;
  line-height: 1.78;
}

.signal-article-section p:last-child,
.signal-caveat-band p:last-child {
  margin-bottom: 0;
}

.signal-emphasis-line {
  color: #fff2c7 !important;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.22rem, 1.8vw, 1.62rem) !important;
  line-height: 1.45 !important;
}

.signal-question-grid,
.signal-compare-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.signal-question-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.signal-question-grid span,
.signal-compare-grid div {
  padding: 14px 15px;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.54);
  color: #dce9f8;
  line-height: 1.45;
}

.signal-question-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.signal-question-link-grid a {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 8%, rgba(247, 211, 111, 0.10), transparent 8rem),
    rgba(2, 6, 23, 0.42);
  color: #dbeafe;
  text-decoration: none;
}

.signal-question-link-grid a:hover {
  border-color: rgba(247, 211, 111, 0.34);
  background: rgba(10, 18, 34, 0.68);
  text-decoration: none;
}

.signal-question-link-grid strong {
  color: #f8fbff;
  line-height: 1.18;
}

.signal-question-link-grid span {
  color: #aab9ca;
  line-height: 1.48;
}

.signal-compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signal-compare-grid small {
  display: block;
  margin-bottom: 7px;
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signal-compare-grid strong {
  display: block;
  color: #edf6ff;
  font-size: 1rem;
  line-height: 1.45;
}

.signal-pullquote {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid rgba(247, 211, 111, 0.20);
  border-left: 4px solid rgba(247, 211, 111, 0.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(247, 211, 111, 0.13), transparent 14rem),
    rgba(247, 211, 111, 0.065);
  color: #fff3cb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 1.65vw, 1.48rem);
  line-height: 1.52;
}

.signal-caveat-band {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-color: rgba(247, 211, 111, 0.18);
  background:
    linear-gradient(135deg, rgba(247, 211, 111, 0.08), rgba(125, 211, 252, 0.06)),
    rgba(2, 6, 23, 0.50);
}

.signal-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 22px 0;
  padding: 20px;
  border: 1px solid rgba(247, 211, 111, 0.24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, rgba(247, 211, 111, 0.12), transparent 18rem),
    rgba(15, 23, 42, 0.68);
}

.signal-package-quickstart {
  display: grid;
  gap: 18px;
}

.signal-download-card-primary {
  margin-top: 0;
  border-color: rgba(125, 211, 252, 0.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(125, 211, 252, 0.14), transparent 18rem),
    radial-gradient(circle at 100% 0%, rgba(247, 211, 111, 0.13), transparent 18rem),
    rgba(15, 23, 42, 0.72);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.signal-package-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal-package-steps > div,
.signal-package-note {
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(12, 22, 39, 0.72), rgba(5, 11, 22, 0.58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.signal-package-steps > div {
  padding: 16px;
}

.signal-package-steps span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border: 1px solid rgba(247, 211, 111, 0.38);
  border-radius: 999px;
  color: #ffe39b;
  font-weight: 900;
  background: rgba(247, 211, 111, 0.08);
}

.signal-package-steps strong {
  display: block;
  color: #f8fbff;
  font-size: 1rem;
}

.signal-package-steps p {
  margin: 7px 0 0;
  color: #b8c8db;
  line-height: 1.5;
}

.signal-model-question-grid span {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.signal-package-note {
  margin-top: 16px;
  padding: 16px 18px;
  color: #d8e8f8;
  line-height: 1.55;
}

.signal-package-note strong {
  color: #ffe39b;
}

.signal-package-safety-note {
  margin-top: 0;
  border-color: rgba(247, 211, 111, 0.20);
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 211, 111, 0.10), transparent 18rem),
    linear-gradient(180deg, rgba(12, 22, 39, 0.74), rgba(5, 11, 22, 0.58));
}

.signal-package-safety-note a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 999px;
  color: #d8efff;
  background:
    linear-gradient(180deg, rgba(16, 36, 60, 0.88), rgba(7, 17, 31, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.20);
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  text-decoration: none;
}

.signal-package-safety-note a:visited {
  color: #d8efff;
}

.signal-package-safety-note a:hover {
  color: #ffe39b;
  border-color: rgba(247, 211, 111, 0.42);
  background:
    linear-gradient(180deg, rgba(28, 39, 54, 0.92), rgba(10, 20, 35, 0.88));
}

#other-pane .static-scripture-anchors {
  border-color: rgba(247, 211, 111, 0.22);
  background:
    radial-gradient(circle at 92% 0%, rgba(247, 211, 111, 0.10), transparent 18rem),
    linear-gradient(180deg, rgba(9, 18, 33, 0.76), rgba(3, 10, 22, 0.64));
}

#other-pane .static-scripture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

#other-pane .static-scripture-head h3 {
  margin-top: 0;
}

#other-pane .static-scripture-head p {
  max-width: 620px;
  margin-bottom: 0;
}

#other-pane .static-scripture-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.42);
  color: #b9c8db;
  font-size: 0.84rem;
  font-weight: 760;
}

#other-pane .static-scripture-picker select {
  min-width: 86px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 999px;
  padding: 6px 28px 6px 10px;
  background: #071225;
  color: #eef6ff;
  font: inherit;
}

#other-pane .static-scripture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

#other-pane .static-scripture-card {
  display: grid;
  align-content: start;
  gap: 9px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  padding: 16px;
  background: rgba(2, 6, 23, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#other-pane .static-scripture-ref {
  color: #fff0bd;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

#other-pane .static-scripture-note {
  margin: 0;
  color: #8fa7c2;
  font-size: 0.82rem;
  line-height: 1.5;
  font-style: italic;
}

#other-pane .static-scripture-text {
  position: relative;
  margin: 4px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  border-left: 3px solid rgba(247, 211, 111, 0.5);
  padding: 12px 0 0 14px;
  color: #e7f0fb;
  font-size: 0.95rem;
  line-height: 1.62;
  quotes: "\201C" "\201D";
}

#other-pane .static-scripture-text::before {
  content: open-quote;
}

#other-pane .static-scripture-text::after {
  content: close-quote;
}

.signal-download-card h4 {
  margin: 6px 0 8px;
  color: #f8fbff;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
}

.signal-download-card p {
  margin: 0;
}

.signal-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(247, 211, 111, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(247, 211, 111, 0.24), rgba(125, 211, 252, 0.10));
  color: #fff2c7;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.signal-download-button:hover {
  border-color: rgba(247, 211, 111, 0.72);
  box-shadow: 0 0 28px rgba(247, 211, 111, 0.12);
}

.other-submenu-button.signal-jesus-cta {
  border-color: rgba(247, 211, 111, 0.42);
  background:
    radial-gradient(circle at 0% 0%, rgba(247, 211, 111, 0.16), transparent 12rem),
    linear-gradient(135deg, rgba(247, 211, 111, 0.12), rgba(125, 211, 252, 0.07)),
    rgba(15, 23, 42, 0.72);
  box-shadow:
    0 0 28px rgba(247, 211, 111, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.other-submenu-button.signal-jesus-cta span {
  color: #fff2c7;
}

.other-submenu-button.signal-jesus-cta small {
  color: #d8e8f8;
}

.signal-prompt-shell {
  position: relative;
  max-width: 82ch;
  margin: 18px 0 0;
}

.signal-copy-prompt-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 10px;
  background: rgba(3, 10, 21, 0.78);
  color: #dff7ff;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.04);
}

.signal-copy-prompt-button:hover,
.signal-copy-prompt-button:focus-visible {
  border-color: rgba(247, 211, 111, 0.46);
  color: #fff1bd;
  outline: none;
}

.signal-copy-prompt-button.copied {
  border-color: rgba(74, 222, 128, 0.48);
  color: #bbf7d0;
}

.signal-prompt-preview {
  max-width: 82ch;
  margin: 0;
  padding: 54px 18px 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.70);
  color: #d8e8f8;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
}

.signal-prompt-preview code {
  color: inherit;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.signal-final-question {
  max-width: 900px;
  margin: 20px auto 0;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid rgba(247, 211, 111, 0.36);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(247, 211, 111, 0.16), transparent 18rem),
    radial-gradient(circle at 50% 100%, rgba(125, 211, 252, 0.10), transparent 18rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.66));
  box-shadow:
    0 0 38px rgba(247, 211, 111, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.045);
}

.signal-final-question span {
  display: block;
  color: #9ee7ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.signal-final-question strong {
  display: block;
  max-width: 760px;
  margin: 9px auto 0;
  color: #fff6d5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.28;
}

.signal-final-question p {
  margin: 10px auto 0;
  color: #d8e8f8;
  font-size: 1.05rem;
  line-height: 1.48;
}

.borrowed-light-panel {
  padding: clamp(18px, 3vw, 34px);
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 211, 252, 0.10), transparent 24rem),
    radial-gradient(circle at 88% 12%, rgba(247, 211, 111, 0.11), transparent 22rem),
    rgba(7, 13, 27, 0.70);
}

.borrowed-light-article {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid rgba(247, 211, 111, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.66)),
    radial-gradient(circle at 12% 0%, rgba(125, 211, 252, 0.11), transparent 18rem);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.borrowed-light-article::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.68), rgba(247, 211, 111, 0.72));
  box-shadow: 0 0 30px rgba(247, 211, 111, 0.22);
}

.borrowed-light-article h2 {
  margin: 8px 0 18px;
  color: #f8fbff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.borrowed-light-article p {
  max-width: 78ch;
  margin: 0 0 18px;
  color: #d7e2ef;
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.78;
}

.borrowed-light-article .borrowed-light-lede {
  color: #fff2c7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.28rem, 2vw, 1.85rem);
  line-height: 1.42;
}

.borrowed-light-article blockquote {
  max-width: 76ch;
  margin: 26px 0;
  padding: 20px 24px;
  border-left: 3px solid rgba(247, 211, 111, 0.78);
  border-radius: 18px;
  background: rgba(247, 211, 111, 0.08);
  color: #fff4d0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 1.7vw, 1.5rem);
  line-height: 1.55;
}

@media (max-width: 860px) {
  #app-tabs {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #other-pane,
  .other-suite {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .other-suite {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    min-height: auto;
  }

  .other-submenu {
    position: relative;
    top: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #other-pane.other-mobile-detail .other-submenu {
    display: none;
  }

  .other-module-panel,
  .signal-deep-article,
  .signal-article-hero,
  .signal-article-section,
  .signal-download-card,
  .signal-package-steps,
  .signal-package-steps > div,
  .signal-package-note,
  .signal-final-question,
  .signal-prompt-shell,
  .signal-prompt-preview {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .other-module-panel {
    display: none !important;
    overflow: visible;
  }

  #other-pane.other-mobile-detail .other-module-panel.active {
    display: block !important;
  }

  .other-mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 12px 12px 0;
    padding: 0 16px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(12, 28, 48, 0.92), rgba(5, 13, 25, 0.88));
    color: #dff6ff;
    font-weight: 850;
    letter-spacing: 0.01em;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 22px rgba(125, 211, 252, 0.08);
  }

  .other-mobile-back::before {
    content: "\2190";
    margin-right: 8px;
    color: #f8d977;
  }

  .signal-deep-article {
    padding: 12px;
  }

  .signal-article-hero,
  .signal-article-section {
    padding: 18px 16px;
  }

  .signal-pipeline,
  .signal-math-grid,
  .signal-compare-grid {
    grid-template-columns: 1fr;
  }

  .signal-pipeline-step {
    min-height: auto;
  }

  .signal-pipeline-step::after {
    top: auto;
    right: auto;
    left: 28px;
    bottom: -10px;
    width: 1px;
    height: 10px;
  }

  .signal-article-hero h2 {
    max-width: none;
  }

  .signal-download-card {
    grid-template-columns: 1fr;
  }

  .signal-download-button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .signal-package-steps {
    grid-template-columns: 1fr;
  }

  .signal-question-grid {
    grid-template-columns: 1fr;
  }

  .signal-prompt-preview,
  .signal-prompt-preview code {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .borrowed-light-article {
    padding: 22px 18px;
  }
}

@media (min-width: 861px) and (max-width: 1220px) {
  .signal-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-pipeline-step::after {
    display: none;
  }
}

/* Evidence Viewer intro and tree impact pass */
#evidence-viewer-pane .ev-intro-landing {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  padding: clamp(14px, 2vw, 22px);
  background:
    linear-gradient(90deg, rgba(4, 9, 18, 0.94) 0%, rgba(4, 9, 18, 0.84) 47%, rgba(4, 9, 18, 0.58) 100%),
    radial-gradient(circle at 78% 16%, rgba(251, 191, 36, 0.11), transparent 30%),
    radial-gradient(circle at 18% 10%, rgba(34, 211, 238, 0.10), transparent 28%),
    url("../assets/evidence-viewer/evidence-viewer-fullwidth-background.png") center / cover no-repeat,
    #07101f;
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#evidence-viewer-pane .ev-intro-landing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 70% 34%, black, transparent 72%);
  opacity: 0.58;
}

#evidence-viewer-pane .ev-intro-landing > * {
  position: relative;
  z-index: 1;
}

#evidence-viewer-pane .ev-intro-hero {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(360px, 1fr);
  gap: clamp(18px, 2.6vw, 34px);
  align-items: stretch;
  margin-bottom: clamp(14px, 2vw, 22px);
}

#evidence-viewer-pane .ev-signal-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.92;
  filter: drop-shadow(0 0 11px rgba(125, 211, 252, 0.16));
}

#evidence-viewer-pane .ev-intro-eyebrow,
#evidence-viewer-pane .ev-section-heading span {
  margin: 14px 0 6px;
  color: #9ee7ff;
  font-size: 0.72rem;
  font-weight: 860;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#evidence-viewer-pane .ev-intro-landing .intro-title {
  display: block;
}

#evidence-viewer-pane .ev-intro-landing .intro-title h1,
#evidence-viewer-pane .ev-intro-landing .intro-title h2 {
  max-width: 780px;
  margin: 0;
  color: #f6fbff;
  font-size: clamp(1.9rem, 2.8vw, 3.05rem);
  line-height: 1.03;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(125, 211, 252, 0.18);
}

#evidence-viewer-pane .ev-intro-landing .subtitle2 {
  display: block;
  max-width: 680px;
  margin: 10px 0 0;
  color: #f7dca0;
  font-size: clamp(0.98rem, 1.35vw, 1.18rem);
  line-height: 1.38;
}

#evidence-viewer-pane .ev-intro-landing .logos-explain,
#evidence-viewer-pane .ev-intro-landing .john11 {
  max-width: 760px;
}

#evidence-viewer-pane .ev-intro-landing .logos-explain {
  margin-top: 12px;
  color: #d5e3f2;
  font-size: 0.98rem;
  line-height: 1.64;
}

#evidence-viewer-pane .ev-intro-landing .john11 {
  margin-top: 12px;
  border-left-color: rgba(251, 191, 36, 0.72);
  background: rgba(2, 6, 23, 0.32);
  border-radius: 0 12px 12px 0;
  padding: 9px 12px;
}

#evidence-viewer-pane .ev-orientation-card {
  max-width: 790px;
  margin-top: 14px;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 16px;
  padding: 14px 15px 13px;
  background:
    linear-gradient(180deg, rgba(8, 20, 38, 0.56), rgba(3, 10, 21, 0.42));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

#evidence-viewer-pane .ev-orientation-card h3 {
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

#evidence-viewer-pane .ev-orientation-card ul {
  margin: 0;
  padding-left: 18px;
  color: #b9cbe0;
  line-height: 1.48;
}

#evidence-viewer-pane .ev-orientation-card li + li {
  margin-top: 7px;
}

#evidence-viewer-pane .ev-orientation-card strong {
  color: #dff7ff;
}

#evidence-viewer-pane .ev-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

#evidence-viewer-pane .ev-trust-strip span {
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(2, 6, 23, 0.34);
  color: #d9f4ff;
  font-size: 0.78rem;
  font-weight: 740;
}

#evidence-viewer-pane .ev-intro-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  max-width: 500px;
  margin-top: 14px;
}

#evidence-viewer-pane .ev-intro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none !important;
  color: #eef7ff;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  width: 100%;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

#evidence-viewer-pane .ev-intro-btn:hover,
#evidence-viewer-pane .ev-intro-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

#evidence-viewer-pane .ev-intro-btn-primary {
  grid-column: 1 / -1;
  justify-self: start;
  width: min(230px, 100%);
  border: 1px solid rgba(190, 240, 255, 0.62);
  background: linear-gradient(180deg, rgba(52, 211, 255, 0.98), rgba(20, 150, 198, 0.95));
  box-shadow: 0 16px 34px rgba(34, 211, 238, 0.22), inset 0 1px 0 rgba(255,255,255,0.26);
}

#evidence-viewer-pane .ev-intro-btn-secondary {
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: linear-gradient(180deg, rgba(8, 20, 38, 0.78), rgba(3, 10, 21, 0.70));
  box-shadow: 0 12px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
}

#evidence-viewer-pane .ev-intro-link {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: #ffe39b;
  font-weight: 850;
  text-decoration: none !important;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.16);
}

#evidence-viewer-pane .ev-intro-link:hover,
#evidence-viewer-pane .ev-intro-link:focus-visible {
  color: #fff1bd;
  outline: none;
  text-decoration: underline !important;
  text-underline-offset: 4px;
}

#evidence-viewer-pane .ev-intro-visual {
  position: relative;
  min-height: 385px;
  border: 1px solid rgba(125, 211, 252, 0.20);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(251, 191, 36, 0.17), transparent 24%),
    radial-gradient(circle at 20% 78%, rgba(34, 211, 238, 0.18), transparent 28%),
    linear-gradient(rgba(125, 211, 252, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(145deg, rgba(5, 17, 34, 0.92), rgba(2, 6, 23, 0.78));
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  box-shadow: inset 0 0 42px rgba(2, 6, 23, 0.52), 0 18px 45px rgba(0, 0, 0, 0.22);
}

#evidence-viewer-pane .ev-logos-visual {
  display: grid;
  align-items: stretch;
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 45%, rgba(251, 191, 36, 0.16), transparent 35%),
    radial-gradient(circle at 30% 50%, rgba(34, 211, 238, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(5, 17, 34, 0.94), rgba(2, 6, 23, 0.88));
}

#evidence-viewer-pane .ev-logos-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.28), transparent 42%, rgba(2, 6, 23, 0.18)),
    linear-gradient(180deg, rgba(2, 6, 23, 0.20), transparent 38%, rgba(2, 6, 23, 0.42));
}

#evidence-viewer-pane .ev-logos-network-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
  opacity: 0.78;
  transform: scale(1.012);
}

#evidence-viewer-pane .ev-logos-visual-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  max-width: 520px;
  margin: 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 15px;
  padding: 13px 14px;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}

#evidence-viewer-pane .ev-logos-visual-copy span {
  display: block;
  color: #9ee7ff;
  font-size: 0.7rem;
  font-weight: 860;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

#evidence-viewer-pane .ev-logos-visual-copy strong {
  display: block;
  margin-top: 7px;
  color: #f6fbff;
  font-size: 0.98rem;
  line-height: 1.35;
}

#evidence-viewer-pane .ev-stage-path-art {
  display: none;
}

#evidence-viewer-pane .ev-network-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#evidence-viewer-pane .ev-network-hairline {
  fill: none;
  stroke: rgba(226, 232, 240, 0.24);
  stroke-width: 7;
  stroke-linecap: round;
}

#evidence-viewer-pane .ev-network-glow {
  fill: none;
  stroke: url("#evPathGradient");
  stroke-width: 3.25;
  stroke-linecap: round;
  filter: drop-shadow(0 0 16px rgba(125, 211, 252, 0.34));
}

#evidence-viewer-pane .ev-network-stars circle {
  fill: #d9f5ff;
  opacity: 0.68;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.45));
}

#evidence-viewer-pane .ev-sacred-ring {
  position: absolute;
  right: -78px;
  top: -74px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 999px;
  background:
    repeating-conic-gradient(from 10deg, rgba(251, 191, 36, 0.18) 0 1deg, transparent 1deg 13deg),
    radial-gradient(circle, transparent 0 48%, rgba(251, 191, 36, 0.10) 49% 50%, transparent 51%);
  opacity: 0.55;
  pointer-events: none;
}

#evidence-viewer-pane .ev-intro-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 19%, rgba(251, 191, 36, 0.20), transparent 26%),
    radial-gradient(circle at 18% 78%, rgba(34, 211, 238, 0.14), transparent 26%),
    linear-gradient(180deg, transparent 0, rgba(2, 6, 23, 0.28) 100%);
  pointer-events: none;
}

#evidence-viewer-pane .ev-path-line {
  display: none;
}

#evidence-viewer-pane .ev-path-node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 114px;
  min-height: 48px;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 15px;
  padding: 7px;
  background: rgba(3, 10, 21, 0.76);
  color: #edf8ff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 820;
  line-height: 1.15;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28), inset 0 0 26px rgba(125, 211, 252, 0.08);
}

#evidence-viewer-pane .ev-path-node::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(125, 211, 252, 0.11);
  border-radius: 22px;
  pointer-events: none;
}

#evidence-viewer-pane .ev-path-node.start { left: 4%; top: 68%; }
#evidence-viewer-pane .ev-path-node.reality { left: 19%; top: 53%; }
#evidence-viewer-pane .ev-path-node.god { left: 36%; top: 41%; }
#evidence-viewer-pane .ev-path-node.christ { left: 53%; top: 29%; }
#evidence-viewer-pane .ev-path-node.resurrection { left: 66%; top: 18%; }
#evidence-viewer-pane .ev-path-node.endpoint {
  right: 5%;
  top: 7%;
  width: 126px;
  border-color: rgba(251, 191, 36, 0.56);
  color: #fff3c4;
  background: rgba(34, 24, 8, 0.76);
}

#evidence-viewer-pane .ev-evidence-chip {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(2, 6, 23, 0.58);
  color: #b9cbe0;
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

#evidence-viewer-pane .ev-evidence-chip.chip-a { left: 7%; top: 13%; }
#evidence-viewer-pane .ev-evidence-chip.chip-b { left: 43%; bottom: 9%; color: #dff7ff; border-color: rgba(125, 211, 252, 0.24); }
#evidence-viewer-pane .ev-evidence-chip.chip-c { right: 7%; bottom: 16%; color: #ffe9b8; border-color: rgba(251, 191, 36, 0.24); }

#evidence-viewer-pane .ev-section-heading {
  margin: 18px 0 10px;
}

#evidence-viewer-pane .ev-section-heading h3 {
  max-width: 900px;
  margin: 0;
  color: #f3f8ff;
  font-size: clamp(1.12rem, 1.55vw, 1.42rem);
  line-height: 1.18;
}

#evidence-viewer-pane .ev-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#evidence-viewer-pane .ev-feature-grid article,
#evidence-viewer-pane .ev-where-card > div,
#evidence-viewer-pane .intro-card {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(12, 22, 39, 0.72), rgba(5, 11, 22, 0.54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

#evidence-viewer-pane .ev-feature-grid article {
  padding: 13px;
}

#evidence-viewer-pane .ev-feature-grid strong,
#evidence-viewer-pane .ev-where-card span {
  color: #f8fafc;
  font-size: 0.95rem;
}

#evidence-viewer-pane .ev-feature-grid p,
#evidence-viewer-pane .ev-where-card p {
  margin: 6px 0 0;
  color: #b8c8db;
  line-height: 1.48;
}

#evidence-viewer-pane .ev-intro-landing .intro-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

#evidence-viewer-pane .ev-intro-landing .intro-card {
  min-height: 112px;
  align-items: flex-start;
  padding: 15px;
}

#evidence-viewer-pane .ev-intro-landing .intro-card .num {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-color: rgba(251, 191, 36, 0.35);
  color: #f9d889;
  background: rgba(251, 191, 36, 0.08);
}

#evidence-viewer-pane .ev-intro-landing .card-title {
  color: #eef7ff;
  font-weight: 820;
}

#evidence-viewer-pane .ev-intro-landing .card-desc {
  margin-top: 7px;
  color: #9fb2c7;
  line-height: 1.45;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  max-width: 920px;
  margin: 18px auto 0;
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 22px;
  padding: 20px clamp(18px, 2.4vw, 28px);
  background:
    radial-gradient(circle at 12% 50%, rgba(251, 191, 36, 0.16), transparent 28%),
    radial-gradient(circle at 84% 38%, rgba(125, 211, 252, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(18, 26, 42, 0.88), rgba(8, 13, 24, 0.74) 58%, rgba(42, 30, 9, 0.52));
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.06) inset,
    0 0 34px rgba(251, 191, 36, 0.14),
    0 18px 48px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda::before {
  content: "";
  position: absolute;
  inset: -55%;
  pointer-events: none;
  background:
    conic-gradient(from 45deg, transparent 0 15%, rgba(251, 191, 36, 0.16) 16%, transparent 18% 45%, rgba(125, 211, 252, 0.10) 46%, transparent 48% 100%);
  opacity: 0.42;
  transform: rotate(8deg);
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda-orb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(251, 191, 36, 0.64);
  border-radius: 999px;
  color: #fff2bf;
  font-size: 1.08rem;
  font-weight: 900;
  background:
    radial-gradient(circle, rgba(255, 243, 196, 0.20), rgba(251, 191, 36, 0.08) 45%, rgba(2, 6, 23, 0.54));
  box-shadow:
    0 0 22px rgba(251, 191, 36, 0.22),
    inset 0 0 20px rgba(251, 191, 36, 0.10);
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda-body {
  position: relative;
  z-index: 1;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda-kicker {
  color: #ffe39b;
  font-size: 0.72rem;
  font-weight: 880;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda-title {
  margin-top: 4px;
  color: #f9fbff;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 900;
  line-height: 1.14;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #c7d8ec;
  line-height: 1.5;
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda blockquote {
  margin: 12px 0 0;
  color: #ffe082;
  font-style: italic;
  font-weight: 760;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.20);
}

#evidence-viewer-pane .ev-intro-landing .stage7-coda cite {
  color: #f7dca0;
  font-style: normal;
}

#evidence-viewer-pane .ev-frameworks {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

#evidence-viewer-pane .ev-frameworks li {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(2, 6, 23, 0.36);
  color: #c7d8ec;
  font-size: 0.84rem;
}

#evidence-viewer-pane .ev-where-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

#evidence-viewer-pane .ev-where-card > div {
  padding: 18px;
}

#tree .section:not(.sub) > .section-header {
  grid-template-columns: 28px minmax(0, 1fr) max-content 24px !important;
}

#tree .section.sub > .section-header {
  grid-template-columns: minmax(0, 1fr) max-content 24px !important;
}

#tree .section-icon {
  grid-column: 1;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.10), rgba(251, 191, 36, 0.05));
  color: #9fe8ff;
  font-size: 0.78rem;
  font-weight: 880;
  box-shadow: inset 0 0 14px rgba(125, 211, 252, 0.06);
}

#tree .section-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#tree .section-icon-glyph {
  display: inline-block;
  color: inherit;
  font-size: 0;
  line-height: 1;
}

#tree .section-icon-glyph::before {
  content: "*";
  font-size: 0.95rem;
  line-height: 1;
}

#tree .section:not(.sub) > .section-header > .section-title {
  grid-column: 2 !important;
}

#tree .section:not(.sub) > .section-header > .count {
  grid-column: 3 !important;
}

#tree .section:not(.sub) > .section-header > .section-control {
  grid-column: 4 !important;
}

#tree .section.sub > .section-header > .section-title {
  grid-column: 1 !important;
}

#tree .section.sub > .section-header > .count {
  grid-column: 2 !important;
}

#tree .section.sub > .section-header > .section-control {
  grid-column: 3 !important;
}

#tree .section-title {
  overflow-wrap: normal !important;
  word-break: normal !important;
}

@media (max-width: 1100px) {
  #evidence-viewer-pane .ev-intro-hero,
  #evidence-viewer-pane .ev-feature-grid,
  #evidence-viewer-pane .ev-where-card {
    grid-template-columns: 1fr;
  }

  #evidence-viewer-pane .ev-intro-visual {
    min-height: 300px;
  }
}

@media (max-width: 680px) {
  #evidence-viewer-pane .ev-intro-landing {
    padding: 16px;
  }

  #evidence-viewer-pane .ev-path-node {
    position: relative;
    inset: auto !important;
    width: auto;
    margin: 8px 0;
  }

  #evidence-viewer-pane .ev-path-line {
    display: none;
  }

  #evidence-viewer-pane .ev-network-svg,
  #evidence-viewer-pane .ev-sacred-ring,
  #evidence-viewer-pane .ev-evidence-chip {
    display: none;
  }

  #evidence-viewer-pane .ev-intro-visual {
    min-height: auto;
    display: grid;
    gap: 8px;
    padding: 16px;
  }

  #evidence-viewer-pane .ev-intro-actions {
    grid-template-columns: 1fr;
  }

  #evidence-viewer-pane .ev-intro-link {
    grid-column: auto;
  }

  #evidence-viewer-pane .ev-intro-landing .stage7-coda {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* Phone portrait evidence viewer: browse and dossier become one primary pane at a time. */
@media (max-width: 700px) {
  html,
  body,
  #app-shell,
  #app-content,
  .app-pane {
    max-width: 100%;
    overflow-x: hidden;
  }

  #app-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }

  #brand {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.98rem;
  }

  #app-tabs {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 3px;
    scrollbar-width: thin;
  }

  .app-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  #evidence-viewer-pane.active {
    min-width: 0;
    overflow: hidden !important;
  }

  #evidence-viewer-pane .header {
    flex: 0 0 auto;
    padding: 9px 10px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(5, 10, 20, 0.82);
  }

  #evidence-viewer-pane .header-inner {
    width: 100%;
    min-width: 0;
    display: block !important;
  }

  #evidence-viewer-pane .header-left {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    grid-template-rows: auto auto !important;
    align-items: stretch !important;
    gap: 8px;
  }

  #evidence-viewer-pane #search {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #evidence-viewer-pane #collapse-btn {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    flex: none !important;
    width: 54px !important;
    min-width: 54px !important;
    min-height: 40px;
    margin-left: 0;
  }

  #evidence-viewer-pane #header-controls {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(86px, 0.95fr) minmax(0, 2.05fr) !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #ev-controls-mount,
  #evidence-viewer-pane #ev-controls-mount #controls {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  #evidence-viewer-pane #stage {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  #evidence-viewer-pane #version {
    grid-column: 1 / 2 !important;
    grid-row: 2 !important;
  }

  #evidence-viewer-pane #hypfilter {
    grid-column: 2 / 3 !important;
    grid-row: 2 !important;
  }

  #evidence-viewer-pane #version,
  #evidence-viewer-pane #stage,
  #evidence-viewer-pane #hypfilter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 40px;
    font-size: 1rem;
  }

  #evidence-viewer-pane .container {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px !important;
    gap: 10px !important;
    overflow: hidden !important;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) .container::before {
    content: "For the full evidence workbench, desktop or landscape tablet is recommended.";
    display: block;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 12px;
    padding: 9px 11px;
    background: rgba(9, 18, 32, 0.72);
    color: #aebed2;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  #evidence-viewer-pane:not(.mobile-detail-active) #detailpane {
    display: none !important;
  }

  #evidence-viewer-pane.mobile-detail-active #tree {
    display: none !important;
  }

  #evidence-viewer-pane #tree,
  #evidence-viewer-pane #detailpane {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  #treeScrollFix,
  #detailScrollFix {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #tree .section,
  #tree .section.sub,
  #tree .item {
    max-width: 100%;
    min-width: 0;
  }

  #tree .section.sub {
    margin-left: 6px !important;
    margin-right: 0 !important;
  }

  #tree .section-header {
    grid-template-columns: minmax(0, 1fr) max-content 30px !important;
    min-width: 0;
  }

  #tree .section-title,
  #tree .item h4,
  #tree .tree-ref-count {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #tree .section-header[title="Anthropology"] > .section-title,
  #tree .section-header[title="Archaeology"] > .section-title,
  #tree .section-header[title="History"] > .section-title,
  #tree .section-header[title="Science"] > .section-title,
  #tree .section-header[title="Philosophy"] > .section-title,
  #tree .section-header[title="Scripture / Text"] > .section-title,
  #tree .section-header[title="World Religions"] > .section-title,
  #tree .section-header[title="Mathematics / Logic"] > .section-title,
  #tree .section-header[title="Methodology / Signal Core"] > .section-title {
    min-width: 0 !important;
  }

  .mobile-detail-back {
    position: sticky;
    top: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 40px;
    border: 1px solid rgba(125, 211, 252, 0.34);
    border-radius: 999px;
    padding: 0 14px;
    background: rgba(4, 12, 24, 0.92);
    color: #dff7ff;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.34);
  }

  .mobile-detail-back::before {
    content: "←";
    margin-right: 8px;
  }

  .detail-dossier,
  .detail-hero-card,
  .detail-mini-card,
  .detail-evidence-card,
  #evidence-viewer-pane .detail .article,
  #evidence-viewer-pane .detail .article .detail-article-block {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .detail-dossier {
    padding: 10px !important;
    gap: 12px;
  }

  .detail-hero-card {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 14px !important;
  }

  #evidence-viewer-pane .detail .detail-hero-card h2 {
    font-size: clamp(1.18rem, 8vw, 1.55rem) !important;
  }

  .detail-thesis,
  #evidence-viewer-pane .detail .article .detail-article-block p {
    max-width: 100%;
    line-height: 1.68;
  }

  .detail-status-strip,
  .detail-bf-strip {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .detail-evidence-card {
    overflow-x: auto;
  }

  .detail-bayes-card .table,
  #evidence-viewer-pane .detail .table {
    min-width: 680px;
  }

  #evidence-viewer-pane .footer {
    display: none;
  }
}

/* Menu order is Landing, Evidence Viewer, Results, More, Settings. */
@media (max-width: 700px) {
  #app-tabs {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr) minmax(0, .78fr) minmax(0, .65fr) 38px !important;
  }
}
