/* Constellation cohesion — shared nav, inscribe widget, command bar, Make Eternal */
/* Package: vayati-inscribe-cohesion-v1 */

/* Shared bar chrome size — nav, exit, session, ⌘K all match */
.weave-header {
  --weave-bar-font: 0.8125rem;
  --weave-bar-height: 2.25rem;
  --weave-bar-pad-x: 0.7rem;
  --weave-bar-radius: 999px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Primary constellation bar — parity with www.vayati.com (www-1 / www-2) */
.constellation-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.45rem;
  padding: 0;
  width: auto;
  flex: 1;
  min-width: 0;
  justify-content: flex-start; /* www: nav after brand on the left */
}

.constellation-nav-bar a {
  color: #b8c0d0;
  text-decoration: none;
  font-size: var(--weave-bar-font);
  font-weight: 500;
  letter-spacing: 0.03em;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--weave-bar-height);
  height: var(--weave-bar-height);
  padding: 0 var(--weave-bar-pad-x);
  border-radius: var(--weave-bar-radius);
  border: 1px solid transparent;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.constellation-nav-bar a:hover {
  color: #c9a8ff;
  border-color: #9d6bff55;
}

.constellation-nav-bar a.is-active {
  color: #c9a8ff;
  border-color: #9d6bff99;
  box-shadow: 0 0 12px rgba(157, 107, 255, 0.2);
}

/* Weave discovery weight (www primary) */
.constellation-nav-bar a.nav-primary {
  color: #c9a8ff;
  font-weight: 500;
  border-color: #9d6bff44;
}

.constellation-nav-bar a.nav-primary:hover,
.constellation-nav-bar a.nav-primary.is-active {
  color: #e8d8ff;
  border-color: #9d6bffaa;
  box-shadow: 0 0 12px rgba(157, 107, 255, 0.2);
}

.constellation-nav-bar a.nav-accent {
  color: #ffd700;
}

.constellation-nav-bar a.nav-subtle {
  opacity: 0.8;
}

.constellation-nav-bar a.nav-cta {
  border: 1px solid #ffd700aa;
  color: #ffd700;
  background: #1a1200;
  font-weight: 600;
}

.constellation-nav-bar a.nav-cta:hover {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.weave-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1rem !important;
  /* Stay above result cards so Relic type tags never paint over status chips */
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 5, 30, 0.96) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Left: Home · Odyssey · Weave · Haven · Inscribe (no logo — www home parity) */
.weave-header__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

/* Residual brand never shown in bar */
.weave-header--nav-only .weave-header__brand,
.weave-header .weave-header__brand {
  display: none !important;
}

/* Right tools: badges + session + ⌘K */
.weave-header__cohesion,
.weave-header__tools {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
}

.weave-header__badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  /* Override main CSS mobile width:100% that stretched chips into the left rail */
  width: auto !important;
  max-width: 100%;
  justify-content: flex-end;
  flex: 0 1 auto;
}

/* Match nav pill height/type for status chips */
.weave-header .live-badge,
.weave-header .demo-badge,
.weave-header .cache-badge,
.weave-header__tools .live-badge,
.weave-header__tools .demo-badge,
.weave-header__tools .cache-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--weave-bar-height);
  height: var(--weave-bar-height);
  padding: 0 var(--weave-bar-pad-x) !important;
  border-radius: var(--weave-bar-radius);
  font-size: var(--weave-bar-font) !important;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

/* Exit link removed from chrome; hide if residual markup appears */
.weave-header .weave-exit-link {
  display: none !important;
}

.weave-header .weave-session-chrome {
  margin-left: 0 !important;
  margin-right: 0 !important;
  gap: 0.35rem;
}

.weave-header .weave-session-chrome__label {
  font-size: var(--weave-bar-font) !important;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #888;
  line-height: 1;
}

.weave-header .weave-session-chrome__btn,
.weave-header .weave-session-chrome__chip {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--weave-bar-height);
  height: var(--weave-bar-height);
  padding: 0 var(--weave-bar-pad-x) !important;
  border-radius: var(--weave-bar-radius);
  font-size: var(--weave-bar-font) !important;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1;
}

.weave-header .weave-session-chrome__chip {
  max-width: min(220px, 40vw);
}

.weave-header .weave-session-chrome__as,
.weave-header .weave-session-chrome__name {
  font-size: inherit !important;
  font-weight: 500;
}

.inscribe-widget {
  margin: 1.25rem auto 0;
  max-width: 720px;
  background: linear-gradient(160deg, #14100a 0%, #0a0a0f 55%, #0d0814 100%);
  border: 1px solid #ffd70044;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  overflow: hidden;
}

.inscribe-widget--footer {
  margin: 2rem auto 2.5rem;
  max-width: min(720px, calc(100% - 2rem));
}

.inscribe-widget__media {
  position: relative;
  margin: -1rem -1.2rem 0.85rem;
  height: 150px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.inscribe-widget__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inscribe-widget__media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 15%, #0a0a0f 100%);
  pointer-events: none;
}

.inscribe-widget__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.inscribe-widget__badge {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #ffd700;
  border: 1px solid #ffd70066;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

.inscribe-widget__title {
  margin: 0;
  flex: 1;
  color: #f5f0e6;
  font-size: 1.05rem;
}

.inscribe-widget__status {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #666;
  color: #ccc;
}

.inscribe-widget__status--ok { border-color: #00ff8899; color: #7dffa8; }
.inscribe-widget__status--degraded { border-color: #ffd70099; color: #ffd700; }
.inscribe-widget__status--unknown,
.inscribe-widget__status--down { border-color: #ff668899; color: #ff99aa; }

.inscribe-widget__detail {
  color: #b8b0a4;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 0.85rem;
}

.inscribe-widget__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inscribe-widget__btn {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #9d6bff66;
  color: #c9a8ff;
  text-decoration: none;
  font-size: 0.82rem;
}

.inscribe-widget__btn--primary {
  border-color: #ffd700aa;
  color: #ffd700;
  background: #1a1200;
}

.make-eternal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #ffd70088;
  color: #ffd700;
  background: #120e00;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.make-eternal-btn:hover {
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

/*
 * Hide Make Eternal on Weave Search result cards (2026-07-11).
 * Flow is deferred to deeper management / Inscribe enablement.
 * constellation-cohesion.js SHOW_MAKE_ETERNAL_ON_CARDS = false also skips inject.
 */
.weave-card .make-eternal-btn,
.weave-card a.make-eternal-btn,
.weave-results .make-eternal-btn,
.weave-grid .make-eternal-btn {
  display: none !important;
}

/* ⌘K — in-header control (match www, not bottom FAB) */
.constellation-cmd-launch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0;
  min-height: var(--weave-bar-height, 2.25rem);
  height: var(--weave-bar-height, 2.25rem);
  line-height: 1;
  border-radius: var(--weave-bar-radius, 999px);
  border: 1px solid #9d6bff88;
  background: #0c0a14ee;
  color: #c9a8ff;
  padding: 0 var(--weave-bar-pad-x, 0.7rem);
  font-size: var(--weave-bar-font, 0.8125rem);
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(157, 107, 255, 0.15);
}

.constellation-cmd-launch:hover {
  box-shadow: 0 0 28px rgba(157, 107, 255, 0.3);
}

.weave-header__cohesion .constellation-cmd-launch {
  align-self: center;
}

.constellation-cmd {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
}

.constellation-cmd__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.constellation-cmd__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: linear-gradient(165deg, #14101c 0%, #0a0a10 100%);
  border: 1px solid #9d6bff55;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 0 50px rgba(157, 107, 255, 0.15);
}

.constellation-cmd__row { display: flex; gap: 0.5rem; }

.constellation-cmd__input {
  flex: 1;
  background: #000;
  border: 1px solid #333;
  border-radius: 10px;
  color: #eee;
  padding: 0.7rem 0.85rem;
}

.constellation-cmd__close {
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 10px;
  padding: 0 0.75rem;
  cursor: pointer;
}

.constellation-cmd__result h4 { margin: 0.9rem 0 0.35rem; color: #c9a8ff; }
.constellation-cmd__result p { margin: 0 0 0.75rem; color: #bbb; font-size: 0.92rem; line-height: 1.5; }
.constellation-cmd__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.constellation-cmd__btn {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #666;
  color: #ddd;
  text-decoration: none;
  font-size: 0.85rem;
}
.constellation-cmd__btn--primary { border-color: #ffd70099; color: #ffd700; }

@media (max-width: 720px) {
  .weave-header__left {
    width: 100%;
  }
  .weave-header__cohesion,
  .weave-header__tools {
    width: 100%;
    margin-left: 0;
    /* Keep NOW LIVE + Edge cache on the right — not under Relic type tags */
    justify-content: flex-end;
  }
  .weave-header__badges {
    width: auto !important;
    margin-left: auto;
    justify-content: flex-end;
  }
  .constellation-nav-bar {
    justify-content: flex-start;
    width: 100%;
  }
  .weave-header .weave-session-chrome__chip {
    max-width: 100%;
  }
}

/* Status chips: never collide with each other or left content */
.weave-header .live-badge,
.weave-header .demo-badge,
.weave-header .cache-badge {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
