/**
 * weave-cohesion-p0.css — Simple Mode, trail, demo empty, bi-links (w-3)
 */

/* —— Simple Mode toggle —— */
.cohesion-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  order: -1;
  flex-shrink: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(157, 107, 255, 0.4);
  background: rgba(20, 14, 36, 0.75);
  color: #d8cef5;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.cohesion-mode-toggle input {
  accent-color: #9d6bff;
  width: 1rem;
  height: 1rem;
}
body.weave-simple-mode .cohesion-mode-toggle {
  border-color: rgba(125, 222, 160, 0.45);
  color: #c8f0d4;
}

/* —— Constellation Trail —— */
.constellation-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.65rem 0 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(12, 10, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}
.constellation-trail.is-empty {
  opacity: 0.55;
}
.constellation-trail__label {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a82a8;
}
.constellation-trail__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.constellation-trail__item {
  display: inline-flex;
  align-items: center;
  color: #c8c0e0;
  min-height: 44px;
}
.constellation-trail__item:not(:last-child)::after {
  content: '›';
  margin: 0 0.35rem;
  color: #6a6288;
}
.constellation-trail__item a {
  color: #9ef0ff;
  text-decoration: none;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.constellation-trail__item a:hover,
.constellation-trail__item a:focus-visible {
  background: rgba(0, 255, 255, 0.08);
  text-decoration: underline;
}
.constellation-trail__item span[aria-current='page'] {
  color: #f0e8ff;
  font-weight: 650;
  padding: 0.35rem 0.4rem;
}

/* —— Demo host / empty teaching —— */
.cohesion-demo-host {
  margin: 1rem 0 2rem;
}
.cohesion-demo-host.hidden {
  display: none !important;
}
.cohesion-demo {
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 16px;
  border: 1px dashed rgba(157, 107, 255, 0.4);
  background: linear-gradient(165deg, rgba(36, 24, 56, 0.9), rgba(12, 10, 24, 0.95));
}
.cohesion-demo__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b8a8e0;
}
.cohesion-demo__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: #f4f0ff;
}
.cohesion-demo__lead {
  margin: 0 0 1rem;
  color: #a89ec4;
  font-size: 0.92rem;
  line-height: 1.45;
}
.cohesion-demo__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.cohesion-demo-card {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 6, 20, 0.75);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 11rem;
}
.cohesion-demo-card__title {
  margin: 0;
  font-size: 1rem;
  color: #efe8ff;
}
.cohesion-demo-card__blurb {
  margin: 0;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #b0a6c8;
}
.cohesion-demo-card__cta {
  min-height: 44px;
  width: 100%;
}
.cohesion-demo__howto {
  margin: 0.9rem 0 0;
  text-align: center;
}

/* —— Buttons —— */
.cohesion-btn {
  appearance: none;
  border: 1px solid rgba(157, 107, 255, 0.45);
  background: rgba(157, 107, 255, 0.15);
  color: #e8e0ff;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  min-height: 44px;
}
.cohesion-btn--primary {
  background: linear-gradient(135deg, rgba(0, 200, 220, 0.25), rgba(157, 107, 255, 0.35));
  border-color: rgba(0, 255, 255, 0.4);
  color: #f0ffff;
}
.cohesion-btn--primary:hover,
.cohesion-btn--primary:focus-visible {
  filter: brightness(1.08);
}
.cohesion-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #c8c0e0;
}

/* —— Bidirectional links on cards —— */
.cohesion-bi-links {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  line-height: 1.4;
  color: #9a90b8;
}
.cohesion-bi-links__label {
  font-weight: 700;
  color: #b8aee0;
  margin-right: 0.25rem;
}
.cohesion-bi-links__a {
  color: #7fd4e0;
  text-decoration: none;
}
.cohesion-bi-links__a:hover,
.cohesion-bi-links__a:focus-visible {
  text-decoration: underline;
}
/* w-7: View inside its Story secondary action (Echo bi-link parity) */
.cohesion-bi-links__view {
  margin-top: 0.35rem;
}
.cohesion-bi-links__a--view {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
  color: #9ef0ff !important;
}
.echoes-card .cohesion-bi-links {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* —— Welcome sheet —— */
.cohesion-welcome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 0.75rem;
  pointer-events: none;
}
.cohesion-welcome.hidden {
  display: none !important;
}
.cohesion-welcome__panel {
  pointer-events: auto;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: 16px 16px 12px 12px;
  border: 1px solid rgba(157, 107, 255, 0.4);
  background: rgba(12, 10, 24, 0.96);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}
.cohesion-welcome__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9d6bff;
}
.cohesion-welcome__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: #f4f0ff;
}
.cohesion-welcome__body {
  margin: 0 0 0.9rem;
  color: #b0a6c8;
  font-size: 0.92rem;
  line-height: 1.45;
}
.cohesion-welcome__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.cohesion-btn--muted {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 168, 140, 0.35);
  background: transparent;
  color: #b8ae98;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.cohesion-btn--muted:hover,
.cohesion-btn--muted:focus-visible {
  color: #e8dcc0;
  border-color: rgba(201, 168, 76, 0.5);
}
.cohesion-welcome__remember {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #9a90b8;
  min-height: 44px;
}

/* Pyramid / modal friendliness in Simple Mode */
body.weave-simple-mode .weave-modal__section-title {
  letter-spacing: 0.04em;
}
/* Desktop Simple Mode: larger tab hit targets */
@media (min-width: 641px) {
  body.weave-simple-mode .filter-tab {
    min-height: 44px;
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }
}

/* —— Mobile one-row menus (w-7.1) ——
 * 5-tab bar (All + 4 types) + header chrome no longer wrap.
 */
@media (max-width: 640px) {
  /* Top header: badges + Simple toggle + Guest/Sign-in on one row */
  .weave-header {
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.35rem !important;
    padding: 0.55rem 0.65rem !important;
  }
  .weave-header__badges {
    width: auto !important;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap !important;
    gap: 0.3rem !important;
    justify-content: flex-start !important;
    overflow: hidden;
  }
  .weave-session-chrome {
    width: auto !important;
    flex: 0 0 auto;
    margin: 0 !important;
    order: unset !important;
    flex-wrap: nowrap !important;
    gap: 0.3rem !important;
    justify-content: flex-end !important;
  }
  .weave-session-chrome__label {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }
  .weave-session-chrome__btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    white-space: nowrap;
  }
  .weave-session-chrome__chip {
    max-width: 28vw;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }
  .cohesion-mode-toggle {
    margin-left: 0;
    min-height: 36px;
    padding: 0.2rem 0.45rem;
    gap: 0.25rem;
    font-size: 0.68rem;
    flex-shrink: 0;
  }
  /* Compact mobile label for Simple Mode toggle */
  .cohesion-mode-toggle__text {
    font-size: 0;
    line-height: 0;
  }
  .cohesion-mode-toggle__text::after {
    content: 'Simple Mode';
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Filter type menu: always one horizontal row */
  .filter-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: stretch !important;
    align-items: stretch;
    gap: 0.22rem !important;
    max-width: none !important;
    width: 100%;
    margin: 0 0 0.65rem !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.1rem 0 0.15rem;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  .filter-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px !important;
    padding: 0.32rem 0.2rem !important;
    font-size: 0.68rem !important;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }
  body.weave-simple-mode .filter-tab {
    min-height: 38px !important;
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
  }
}

/* Extra-narrow phones: slightly tighter still */
@media (max-width: 360px) {
  .filter-tab {
    font-size: 0.62rem !important;
    padding: 0.28rem 0.12rem !important;
  }
  .cohesion-mode-toggle {
    padding: 0.18rem 0.35rem;
  }
  .weave-session-chrome__label {
    display: none; /* keep Sign in / chip only */
  }
}

/* Quiet constellation health strip chrome in Simple Mode (edge/status noise) */
body.weave-simple-mode .cohesion-status-quiet .weave-status-strip__list {
  opacity: 0.75;
}
body.weave-simple-mode #cache-badge {
  display: none !important;
}

/* Pyramid Simple Mode — larger targets + back control */
body.weave-simple-mode .pyramid-node {
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.55rem;
}
.pyramid-apex__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.pyramid-apex__back {
  appearance: none;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 40, 48, 0.45);
  color: #9ef0ff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}
.pyramid-apex__back:hover,
.pyramid-apex__back:focus-visible {
  background: rgba(0, 80, 90, 0.5);
}
.pyramid-apex__map-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a82a8;
  margin-bottom: 0.2rem;
}
.node-preview-panel__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.5rem;
  font-weight: 650;
}

@media (max-width: 640px) {
  .cohesion-demo__grid {
    grid-template-columns: 1fr;
  }
  .constellation-trail {
    font-size: 0.75rem;
  }
}
