/* lineage.ux.css (ux-pass, 2026-10-15). After lineage.css. */

/* Desktop: the stage and panel fit one screen under the sticky chrome. */
.lin-stage,
.lin-panel {
  height: clamp(28rem, calc(100svh - var(--enc-chrome-h, 45px) - 2rem), 56rem);
  min-height: 0;
}
.lin-stage { scroll-margin-top: calc(var(--enc-chrome-h, 45px) + 1rem); }

/* Compact header on wide screens: title and stats on one line. */
@media (min-width: 62rem) {
  .lin-hero { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.5rem; margin-bottom: 1rem; }
  .lin-hero .enc-crumbs { flex-basis: 100%; margin-bottom: 0.5rem; }
  .lin-hero h1 { font-size: 2.2rem; margin: 0; }
  .lin-hero .enc-dek { flex-basis: 100%; order: 3; font-size: 1.05rem; margin: 0.5rem 0 0; max-width: 80ch; }
}

/* The zoom hint (lineage.ux.js shows it when a plain wheel is let through). */
.lin-zoomhint {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(6, 18, 36, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  font: 600 0.88rem var(--enc-sans);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.lin-zoomhint.is-on { opacity: 1; }
.lin-zoomhint kbd { font: 600 0.8rem var(--enc-mono); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.3rem; }

.lin-explore, .lin-close { display: none; }

/* Phones and tablets: a preview the page scrolls past freely; touches go to
   the map only in full-screen Explore mode. */
@media (max-width: 62rem) {
  .lin-stage { height: 18.75rem; min-height: 0; }
  .lin-stage canvas { pointer-events: none; touch-action: auto; }
  .lin-stage .lin-tools,
  .lin-stage .lin-hint { display: none; }
  .lin-stage .lin-legend { display: none; }
  .lin-explore {
    display: inline-flex;
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font: 600 0.95rem var(--enc-sans);
    white-space: nowrap;
    cursor: pointer;
  }
  .lin-panel { height: auto; }

  .lin-exploring { overflow: hidden; }
  .lin-exploring .lin-stage {
    position: fixed;
    inset: 0;
    z-index: 1002;
    height: auto;
    border-radius: 0;
    border: 0;
  }
  .lin-exploring .lin-stage canvas { pointer-events: auto; touch-action: none; }
  .lin-exploring .lin-stage .lin-tools { display: flex; flex-wrap: nowrap; }
  .lin-exploring .lin-stage .lin-search { flex: 1 1 auto; max-width: none; }
  .lin-exploring .lin-stage .lin-btns .lin-icon:not(.lin-close) { display: none; }
  .lin-exploring .lin-explore { display: none; }
  .lin-exploring .lin-close { display: inline-grid; place-items: center; }
  .lin-exploring .lin-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1003;
    max-height: 42svh;
    overflow-y: auto;
    border-radius: 1.1rem 1.1rem 0 0;
    border: 0;
    border-top: 1px solid var(--border);
    padding-top: 1.4rem;
  }
  .lin-exploring .lin-panel::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 2px;
    background: var(--border);
  }
  .lin-exploring #swaco-banner { visibility: hidden; }
}
