/* Codex Loom — help-only identity
   Slate / coral / teal. Sticky mast + chapter spine + scroll-snap tickets.
   Independent of Knowledge Beacon (kh-*) mosaic / satellites / open sheets. */

.page-help {
  --cx-ink: #152028;
  --cx-mute: #5a6a76;
  --cx-chalk: #f4f7f9;
  --cx-paper: #ffffff;
  --cx-line: rgba(21, 32, 40, 0.12);
  --cx-coral: #ff4d6d;
  --cx-coral-soft: rgba(255, 77, 109, 0.12);
  --cx-teal: #0f8f82;
  --cx-teal-soft: rgba(15, 143, 130, 0.12);
  --cx-slate: #243447;
  --cx-display: "Darker Grotesque", system-ui, sans-serif;
  --cx-serif: "Cormorant Infant", Georgia, serif;
  --cx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cx-mast-h: 5.5rem;
  --cx-spine-w: 13.5rem;
}

body.a60-store.page-help,
.page-help .a60-prism-wrap,
.page-help .a60-prism-stage {
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(15, 143, 130, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(255, 77, 109, 0.07), transparent 50%),
    var(--cx-chalk) !important;
  color: var(--cx-ink) !important;
  font-family: var(--cx-display);
}

.page-help .a60-prism-stage {
  min-height: 0 !important;
  padding-bottom: 0 !important;
}

.page-help .page-main {
  max-width: none;
  padding: 0;
  color: var(--cx-ink) !important;
}

.page-help .page-main h1,
.page-help .page-main h2,
.page-help .page-main h3,
.page-help .page-main h4,
.page-help .page-main p,
.page-help .page-main span,
.page-help .page-main a,
.page-help .page-main strong,
.page-help .page-main em,
.page-help .page-main label,
.page-help .page-main li,
.page-help .page-main button,
.page-help .page-main dt,
.page-help .page-main dd,
.page-help .page-main small,
.page-help .page-main time {
  color: inherit;
}

.cx-atelier {
  padding-bottom: 0;
}

.cx-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cx-teal);
}

/* Sticky mast */
.cx-mast {
  position: sticky;
  top: calc(var(--island-h, 64px) + 0.5rem);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 0 clamp(1rem, 3vw, 2.5rem) 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--cx-line);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 16px 40px rgba(21, 32, 40, 0.08);
  transition: padding 0.3s var(--cx-ease), box-shadow 0.3s, border-radius 0.3s;
}

.cx-mast.is-compact {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(21, 32, 40, 0.12);
}

.cx-mast-brand h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cx-mast-brand h1 em {
  font-family: var(--cx-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--cx-coral);
}

.cx-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cx-filter input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--cx-line) !important;
  background: var(--cx-chalk) !important;
  font-family: var(--cx-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cx-ink) !important;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.cx-filter input:focus {
  outline: none;
  border-color: var(--cx-teal) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px var(--cx-teal-soft);
}

.cx-filter-count {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--cx-slate);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cx-filter-count[hidden] {
  display: none;
}

.cx-mast-meta {
  display: none;
  text-align: right;
  line-height: 1.1;
}

.cx-mast-meta strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cx-coral);
}

.cx-mast-meta span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cx-mute);
}

@media (min-width: 720px) {
  .cx-mast-meta { display: block; }
}

@media (max-width: 820px) {
  .cx-mast {
    grid-template-columns: 1fr;
    top: calc(var(--island-h, 64px) + 0.35rem);
  }

  .cx-mast.is-compact {
    border-radius: 1.1rem;
  }
}

/* Marquee tags */
.cx-marquee {
  overflow: hidden;
  margin: 0 0 1.25rem;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.cx-marquee-track {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  padding: 0.25rem clamp(1rem, 3vw, 2.5rem);
  animation: cx-marquee 32s linear infinite;
}

.cx-marquee:hover .cx-marquee-track {
  animation-play-state: paused;
}

@keyframes cx-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.cx-tag {
  appearance: none;
  flex-shrink: 0;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--cx-line);
  background: var(--cx-paper);
  color: var(--cx-ink);
  font-family: var(--cx-display);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--cx-ease), border-color 0.2s;
}

.cx-tag:hover {
  background: var(--cx-slate);
  color: #fff;
  border-color: var(--cx-slate);
  transform: translateY(-2px);
}

/* Loom: spine + scroll */
.cx-loom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0 clamp(1rem, 3vw, 2.5rem);
  align-items: start;
}

@media (min-width: 960px) {
  .cx-loom {
    grid-template-columns: var(--cx-spine-w) minmax(0, 1fr);
    gap: 1.75rem;
  }
}

.cx-spine {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scroll-snap-type: x mandatory;
}

@media (min-width: 960px) {
  .cx-spine {
    position: sticky;
    top: calc(var(--island-h, 64px) + 6.5rem);
    flex-direction: column;
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }
}

.cx-spine-label {
  display: none;
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cx-mute);
}

@media (min-width: 960px) {
  .cx-spine-label { display: block; }
}

.cx-spine-node {
  appearance: none;
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 10.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--cx-line);
  background: var(--cx-paper);
  color: var(--cx-ink);
  font-family: var(--cx-display);
  text-align: left;
  cursor: pointer;
  transition: transform 0.3s var(--cx-ease), border-color 0.25s, background 0.25s, box-shadow 0.3s;
  animation: cx-rise 0.5s var(--cx-ease) both;
  animation-delay: calc(var(--si, 0) * 0.06s);
}

@media (min-width: 960px) {
  .cx-spine-node {
    min-width: 0;
    width: 100%;
  }
}

.cx-spine-node:hover {
  transform: translateX(3px);
  border-color: rgba(15, 143, 130, 0.4);
}

.cx-spine-node.is-active {
  background: var(--cx-slate);
  color: #fff;
  border-color: var(--cx-slate);
  box-shadow: 0 14px 32px rgba(36, 52, 71, 0.25);
}

.cx-spine-code {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: var(--cx-coral-soft);
  color: var(--cx-coral);
  font-weight: 800;
  font-size: 0.95rem;
}

.cx-spine-node.is-active .cx-spine-code {
  background: var(--cx-coral);
  color: #fff;
}

.cx-spine-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.cx-spine-text strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.cx-spine-text em {
  font-style: normal;
  font-size: 0.78rem;
  opacity: 0.7;
}

.cx-spine-progress {
  display: none;
  height: 3px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: var(--cx-line);
  overflow: hidden;
}

@media (min-width: 960px) {
  .cx-spine-progress { display: block; }
}

.cx-spine-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cx-teal), var(--cx-coral));
  transition: width 0.25s var(--cx-ease);
}

/* Scroll chapters */
.cx-scroll {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 40vh;
  scroll-margin-top: 8rem;
}

.cx-chapter {
  scroll-margin-top: calc(var(--island-h, 64px) + 7.5rem);
  padding: 1.25rem;
  border-radius: 1.5rem;
  background: var(--cx-paper);
  border: 1px solid var(--cx-line);
  box-shadow: 0 18px 48px rgba(21, 32, 40, 0.06);
  transition: opacity 0.3s, transform 0.3s var(--cx-ease);
}

.cx-chapter.is-dimmed {
  opacity: 0.35;
  transform: scale(0.99);
  pointer-events: none;
}

.cx-chapter.is-hidden {
  display: none;
}

.cx-chapter-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--cx-line);
}

.cx-chapter-code {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, var(--cx-teal), #0b6f66);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 143, 130, 0.3);
}

.cx-chapter-head h2 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.cx-chapter-head p {
  margin: 0;
  color: var(--cx-mute);
  font-size: 1.05rem;
}

/* Expandable tickets */
.cx-tickets {
  display: grid;
  gap: 0.55rem;
}

.cx-ticket {
  border-radius: 1rem;
  border: 1px solid var(--cx-line);
  background: var(--cx-chalk);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.3s var(--cx-ease), transform 0.3s var(--cx-ease);
  animation: cx-rise 0.45s var(--cx-ease) both;
  animation-delay: calc(var(--ti, 0) * 0.05s);
}

.cx-ticket.is-hidden {
  display: none;
}

.cx-ticket.is-match {
  border-color: var(--cx-coral);
  box-shadow: 0 0 0 3px var(--cx-coral-soft);
}

.cx-ticket.is-open {
  background: #fff;
  border-color: rgba(15, 143, 130, 0.35);
  box-shadow: 0 14px 36px rgba(15, 143, 130, 0.12);
  transform: translateY(-2px);
}

.cx-ticket-q {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--cx-display);
  text-align: left;
  cursor: pointer;
}

.cx-ticket-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--cx-coral);
  font-variant-numeric: tabular-nums;
}

.cx-ticket-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.cx-ticket-chev {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid var(--cx-mute);
  border-bottom: 2px solid var(--cx-mute);
  transform: rotate(45deg);
  transition: transform 0.3s var(--cx-ease), border-color 0.25s;
}

.cx-ticket.is-open .cx-ticket-chev {
  transform: rotate(225deg);
  border-color: var(--cx-teal);
}

.cx-ticket-a {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s var(--cx-ease), opacity 0.3s, padding 0.3s;
  padding: 0 1.1rem;
}

.cx-ticket-a:not([hidden]) {
  max-height: 28rem;
  opacity: 1;
  padding: 0 1.1rem 1.15rem;
}

.cx-ticket-body {
  padding-top: 0.15rem;
  border-top: 1px solid var(--cx-line);
  padding-top: 0.85rem;
  color: var(--cx-mute);
  font-size: 1.08rem;
  line-height: 1.55;
}

.cx-ticket-body a {
  color: var(--cx-teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cx-ticket-body a:hover {
  color: var(--cx-coral);
}

.cx-empty {
  margin: 0;
  padding: 2rem 1.5rem;
  text-align: center;
  border-radius: 1.25rem;
  border: 1px dashed var(--cx-line);
  background: var(--cx-paper);
  color: var(--cx-mute);
  font-size: 1.1rem;
}

.cx-empty a {
  color: var(--cx-coral);
  font-weight: 800;
}

/* Bridges — horizontal snap */
.cx-bridges {
  margin: 2.5rem 0 0;
  padding: 0 0 0.5rem;
}

.cx-bridges-head {
  margin: 0 clamp(1rem, 3vw, 2.5rem) 1rem;
}

.cx-bridges-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.cx-bridge-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: clamp(1rem, 3vw, 2.5rem);
  padding: 0.35rem clamp(1rem, 3vw, 2.5rem) 1rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cx-bridge-rail::-webkit-scrollbar { display: none; }

.cx-bridge {
  flex: 0 0 min(14rem, 72vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.2rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--cx-slate);
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(36, 52, 71, 0.22);
  transition: transform 0.3s var(--cx-ease), background 0.25s;
  animation: cx-rise 0.5s var(--cx-ease) both;
  animation-delay: calc(var(--bi, 0) * 0.05s);
}

.cx-bridge:nth-child(even) {
  background: linear-gradient(145deg, #1a5f58, var(--cx-teal));
}

.cx-bridge:hover {
  transform: translateY(-5px) rotate(-0.5deg);
}

.cx-bridge strong {
  font-size: 1.2rem;
  font-weight: 800;
}

.cx-bridge span {
  font-size: 0.88rem;
  opacity: 0.75;
}

/* Desk CTA */
.cx-desk {
  margin: 2.5rem clamp(1rem, 3vw, 2.5rem) 0;
}

.cx-desk-panel {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 1.75rem;
  background:
    linear-gradient(125deg, rgba(255, 77, 109, 0.95), rgba(255, 77, 109, 0.75) 40%, transparent 70%),
    linear-gradient(200deg, var(--cx-slate), #152028);
  color: #fff;
  box-shadow: 0 28px 70px rgba(21, 32, 40, 0.28);
}

@media (min-width: 800px) {
  .cx-desk-panel {
    grid-template-columns: 1.2fr auto;
    align-items: center;
  }
}

.cx-desk-panel .cx-kicker {
  color: rgba(255, 255, 255, 0.75);
}

.cx-desk-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--cx-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.45rem);
  font-weight: 600;
  line-height: 1.15;
}

.cx-desk-panel p {
  margin: 0;
  max-width: 34rem;
  opacity: 0.85;
  font-size: 1.08rem;
  line-height: 1.5;
}

.cx-desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-family: var(--cx-display);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.25s var(--cx-ease), background 0.25s, color 0.25s;
}

.cx-btn-fill {
  background: #fff;
  color: var(--cx-slate) !important;
}

.cx-btn-fill:hover {
  transform: translateY(-2px) scale(1.02);
  background: #ffe8ec;
  color: var(--cx-coral) !important;
}

.cx-btn-ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  color: #fff !important;
  background: transparent;
}

.cx-btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

@keyframes cx-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cx-marquee-track,
  .cx-spine-node,
  .cx-ticket,
  .cx-bridge {
    animation: none !important;
  }

  .cx-ticket-a {
    transition: none;
  }
}
