:root {
  --rites-panel: rgba(3, 12, 34, 0.74);
  --rites-panel-strong: rgba(4, 10, 26, 0.84);
  --rites-stroke: rgba(176, 151, 96, 0.28);
  --rites-stroke-soft: rgba(136, 156, 214, 0.16);
  --rites-glow: rgba(219, 176, 90, 0.28);
  --rites-silver: rgba(215, 224, 255, 0.72);
}

.ts-rites-wrap {
  padding-bottom: 2rem;
}

.ts-rites-stage {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 132px);
  padding: 2rem;
  border-radius: 2rem;
  border: 1px solid var(--rites-stroke-soft);
  background: radial-gradient(circle at top, rgba(14, 31, 77, 0.24), rgba(4, 8, 20, 0.9) 74%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 22px 60px rgba(0, 0, 0, 0.36);
}

.ts-rites-worldback,
.ts-rites-worldback > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ts-rites-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.42s ease;
}

.ts-rites-bg-secondary {
  opacity: 0;
}

.ts-rites-vignette-shade {
  background:
    radial-gradient(circle at center, rgba(7, 16, 38, 0.14), rgba(1, 3, 10, 0.74) 75%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.52));
}

.ts-rites-gridveil {
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.2;
  mix-blend-mode: screen;
}

.ts-rites-rings {
  border-radius: 50%;
  border: 1px solid rgba(179, 192, 255, 0.12);
  mix-blend-mode: screen;
}

.ts-rites-rings-a {
  inset: 7% auto auto 57%;
  width: 620px;
  height: 620px;
}

.ts-rites-rings-b {
  inset: auto auto 8% -4%;
  width: 480px;
  height: 480px;
}

.ts-rites-motes span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 238, 201, 0.58);
  box-shadow: 0 0 12px rgba(255, 229, 172, 0.46);
  animation: ritesDrift 14s linear infinite;
}

.ts-rites-motes span:nth-child(1) { top: 16%; left: 18%; animation-delay: 0s; }
.ts-rites-motes span:nth-child(2) { top: 28%; left: 72%; animation-delay: -3s; }
.ts-rites-motes span:nth-child(3) { top: 44%; left: 40%; animation-delay: -7s; }
.ts-rites-motes span:nth-child(4) { top: 62%; left: 84%; animation-delay: -9s; }
.ts-rites-motes span:nth-child(5) { top: 78%; left: 22%; animation-delay: -11s; }
.ts-rites-motes span:nth-child(6) { top: 22%; left: 58%; animation-delay: -5s; }
.ts-rites-motes span:nth-child(7) { top: 70%; left: 52%; animation-delay: -1s; }
.ts-rites-motes span:nth-child(8) { top: 34%; left: 87%; animation-delay: -13s; }

.ts-rites-headerband,
.ts-rites-topgrid,
.ts-rites-bottomgrid {
  position: relative;
  z-index: 2;
}

.ts-rites-headerband {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 64rem;
  margin-bottom: 1.4rem;
}

.ts-rites-overline,
.ts-rites-kicker {
  font-family: "Cinzel", serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: rgba(226, 203, 151, 0.96);
}

.ts-rites-title {
  margin: 0;
  color: #f7f2e6;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
}

.ts-rites-intro {
  max-width: 52rem;
  margin: 0;
  color: rgba(232, 234, 245, 0.86);
}

.ts-rites-topgrid {
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(620px, 1.22fr);
  gap: 1.35rem;
  align-items: stretch;
}

.ts-rites-hubpanel,
.ts-rites-viewerpanel,
.ts-rites-mini {
  background: var(--rites-panel);
  border: 1px solid var(--rites-stroke-soft);
  border-radius: 1.7rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  backdrop-filter: blur(14px);
}

.ts-rites-hubpanel {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ts-rites-orbitwrap {
  display: grid;
  place-items: center;
  min-height: 33rem;
}

.ts-rites-orbitstage {
  --orbit-main-size: min(100%, 52rem);
  --orbit-main-radius: 19.8rem;
  --orbit-bridge-radius: 24.5rem;
  position: relative;
  width: var(--orbit-main-size);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}

.ts-rites-orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.ts-rites-orbit-ring-main {
  width: calc(var(--orbit-main-radius) * 2);
  height: calc(var(--orbit-main-radius) * 2);
  border: 1px solid rgba(222, 189, 112, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 30px rgba(219, 176, 90, 0.08);
}

.ts-rites-orbit-ring-bridge {
  width: calc(var(--orbit-bridge-radius) * 2);
  height: calc(var(--orbit-bridge-radius) * 2);
  border: 1px dashed rgba(181, 198, 255, 0.12);
  opacity: 0.55;
}

.ts-rites-node {
  position: absolute;
  width: 8.5rem;
  height: 8.5rem;
  display: grid;
  place-items: end center;
  padding: 0.75rem 0.6rem 0.85rem;
  overflow: hidden;
  border-radius: 1.4rem;
  border: 1px solid rgba(181, 198, 255, 0.16);
  background: linear-gradient(180deg, rgba(9, 23, 57, 0.82), rgba(8, 18, 42, 0.94));
  color: rgba(243, 239, 232, 0.96);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease;
  will-change: transform;
}

.ts-rites-node::before {
  content: "";
  position: absolute;
  inset: -0.7rem;
  clip-path: polygon(25% 6%, 75% 6%, 94% 50%, 75% 94%, 25% 94%, 6% 50%);
  border: 1px solid rgba(222, 189, 112, 0.22);
  opacity: 0.55;
  pointer-events: none;
}

.ts-rites-node-art,
.ts-rites-node-shade,
.ts-rites-node-sigil {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.ts-rites-node-art {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  transform: scale(1.02);
}

.ts-rites-node-art-center-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56%;
  height: 56%;
  object-fit: contain;
  object-position: center center;
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

.ts-rites-node-center .ts-rites-node-label {
  position: absolute;
  left: 50%;
  bottom: 0.64rem;
  transform: translateX(-50%);
  width: 78%;
  margin: 0;
  text-align: center;
  line-height: 1.02;
  z-index: 2;
}

.ts-rites-node-shade {
  background:
    linear-gradient(180deg, rgba(5, 12, 30, 0.02), rgba(5, 12, 30, 0.10) 42%, rgba(4, 10, 26, 0.24)),
    radial-gradient(circle at 50% 18%, rgba(237, 214, 157, 0.10), transparent 58%);
}

.ts-rites-node:hover,
.ts-rites-node:focus-visible,
.ts-rites-node.is-active {
  border-color: rgba(231, 202, 132, 0.42);
  box-shadow:
    0 0 0 1px rgba(231, 202, 132, 0.18),
    0 10px 34px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(219, 176, 90, 0.18);
}

.ts-rites-node:hover,
.ts-rites-node:focus-visible {
  filter: brightness(1.04);
}

.ts-rites-node-center {
  top: 50%;
  left: 50%;
  width: 12rem;
  height: 12rem;
  padding: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(219, 176, 90, 0.24), rgba(31, 43, 80, 0.96) 74%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03), transparent 76%);
  z-index: 1;
}

.ts-rites-node-center::before {
  inset: -1rem;
  clip-path: polygon(25% 6%, 75% 6%, 94% 50%, 75% 94%, 25% 94%, 6% 50%);
}

.ts-rites-node-sigil {
  background: none;
}

.ts-rites-node-orbit {
  top: 50%;
  left: 50%;
  z-index: 2;
}

.ts-rites-node-orbit[data-locus="A"] { box-shadow: 0 0 0 1px rgba(196, 214, 255, 0.10), 0 0 24px rgba(161, 194, 255, 0.10); }
.ts-rites-node-orbit[data-locus="B"] { box-shadow: 0 0 0 1px rgba(112, 204, 255, 0.10), 0 0 24px rgba(112, 204, 255, 0.12); }
.ts-rites-node-orbit[data-locus="C"] { box-shadow: 0 0 0 1px rgba(226, 184, 112, 0.10), 0 0 24px rgba(226, 184, 112, 0.12); }
.ts-rites-node-orbit[data-locus="D"] { box-shadow: 0 0 0 1px rgba(255, 214, 150, 0.10), 0 0 24px rgba(255, 214, 150, 0.12); }
.ts-rites-node-orbit[data-locus="E"] { box-shadow: 0 0 0 1px rgba(255, 170, 214, 0.10), 0 0 24px rgba(255, 170, 214, 0.12); }

.ts-rites-node-orbit[data-locus="A"]:hover,
.ts-rites-node-orbit[data-locus="A"].is-active { border-color: rgba(196, 214, 255, 0.62); box-shadow: 0 0 0 1px rgba(196, 214, 255, 0.22), 0 10px 34px rgba(0,0,0,0.34), 0 0 30px rgba(161,194,255,0.24); }
.ts-rites-node-orbit[data-locus="B"]:hover,
.ts-rites-node-orbit[data-locus="B"].is-active { border-color: rgba(112, 204, 255, 0.58); box-shadow: 0 0 0 1px rgba(112, 204, 255, 0.20), 0 10px 34px rgba(0,0,0,0.34), 0 0 30px rgba(112,204,255,0.24); }
.ts-rites-node-orbit[data-locus="C"]:hover,
.ts-rites-node-orbit[data-locus="C"].is-active { border-color: rgba(226, 184, 112, 0.58); box-shadow: 0 0 0 1px rgba(226, 184, 112, 0.20), 0 10px 34px rgba(0,0,0,0.34), 0 0 30px rgba(226,184,112,0.24); }
.ts-rites-node-orbit[data-locus="D"]:hover,
.ts-rites-node-orbit[data-locus="D"].is-active { border-color: rgba(255, 214, 150, 0.62); box-shadow: 0 0 0 1px rgba(255, 214, 150, 0.22), 0 10px 34px rgba(0,0,0,0.34), 0 0 30px rgba(255,214,150,0.26); }
.ts-rites-node-orbit[data-locus="E"]:hover,
.ts-rites-node-orbit[data-locus="E"].is-active { border-color: rgba(255, 170, 214, 0.62); box-shadow: 0 0 0 1px rgba(255, 170, 214, 0.22), 0 10px 34px rgba(0,0,0,0.34), 0 0 30px rgba(255,170,214,0.26); }

.ts-rites-node-code {
  display: none;
}

.ts-rites-node-name,
.ts-rites-node-label {
  position: relative;
  z-index: 2;
  display: block;
  font-family: "EB Garamond", serif;
  font-size: 1.18rem;
  line-height: 1.03;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

.ts-rites-hubtitle {
  font-family: "EB Garamond", serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  color: #f5f0e6;
}

.ts-rites-hubtext {
  color: rgba(228, 231, 242, 0.84);
  font-size: 1.05rem;
  line-height: 1.48;
}

.ts-rites-viewerpanel {
  padding: 1.15rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 1rem;
  min-height: 44rem;
}

.ts-rites-viewerframe {
  position: relative;
  min-height: 28rem;
  border-radius: 1.65rem;
  overflow: hidden;
  border: 1px solid rgba(177, 196, 255, 0.12);
  background: rgba(3, 8, 20, 0.82);
}

.ts-rites-mainstill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ts-rites-mainvideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.72);
}

.ts-rites-mainvideo.is-hidden {
  display: none;
}

/* Past Rite foreshadow veil: prior charge through the Active Field. */
.ts-rites-pastritevideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: saturate(1.08) contrast(1.06) brightness(1.04);
}

.ts-rites-pastritevideo.is-active {
  animation: ritesPastRiteForeshadow var(--rites-past-duration, 2800ms) ease-in-out forwards;
}

@keyframes ritesPastRiteForeshadow {
  0% { opacity: 0; }
  18% { opacity: var(--rites-past-opacity, 0.24); }
  68% { opacity: var(--rites-past-opacity, 0.24); }
  100% { opacity: 0; }
}

.ts-rites-mainveil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.16), rgba(0,0,0,0.06) 32%, rgba(0,0,0,0.54));
}

.ts-rites-mainhalo {
  position: absolute;
  inset: auto auto 14% 50%;
  width: 58%;
  height: 34%;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(255, 225, 173, 0.16), rgba(255, 225, 173, 0.02) 68%, transparent 72%);
  pointer-events: none;
}

.ts-rites-maincaption {
  position: absolute;
  left: 1.2rem;
  right: 1.2rem;
  bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(5, 12, 28, 0.5), rgba(5, 12, 28, 0.76));
  border: 1px solid rgba(178, 191, 246, 0.12);
  backdrop-filter: blur(12px);
}

.ts-rites-scene-title {
  font-family: "EB Garamond", serif;
  font-size: clamp(2.1rem, 3vw, 3rem);
  color: #faf6ed;
}

.ts-rites-scene-note {
  color: rgba(233, 235, 244, 0.86);
  font-size: 1.03rem;
  line-height: 1.45;
}

.ts-rites-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.ts-rites-toolbar-left {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.ts-rites-toolbar-right {
  display: none;
}

.ts-rites-ghost {
  padding: 0.88rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(180, 195, 244, 0.18);
  background: rgba(7, 17, 41, 0.62);
  color: rgba(244, 238, 226, 0.84);
  font-family: "Cinzel", serif;
  letter-spacing: 0.12em;
}

.ts-rites-ghost:disabled {
  opacity: 0.42;
}

.ts-rites-modebadge {
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  border: 1px solid rgba(215, 180, 102, 0.38);
  background: rgba(17, 28, 54, 0.72);
  color: #f3ece0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.12em;
}

.ts-rites-drawer {
  padding: 1rem;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgba(4, 11, 30, 0.66), rgba(6, 17, 43, 0.84));
  border: 1px solid rgba(176, 191, 255, 0.1);
}

.ts-rites-drawer-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
}

.ts-rites-drawer-title {
  font-family: "EB Garamond", serif;
  font-size: 1.45rem;
  color: #f4efe5;
}

.ts-rites-fragmentrail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.ts-rites-fragbtn {
  display: grid;
  gap: 0.45rem;
  padding: 0.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(177, 190, 255, 0.12);
  background: rgba(7, 16, 39, 0.64);
  color: rgba(245, 241, 232, 0.92);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.ts-rites-fragbtn:hover,
.ts-rites-fragbtn:focus-visible,
.ts-rites-fragbtn.is-active {
  transform: translateY(-2px);
  border-color: rgba(231, 202, 132, 0.36);
  box-shadow: 0 0 0 1px rgba(231, 202, 132, 0.12), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.ts-rites-fragthumb {
  width: 100%;
  aspect-ratio: 7 / 5;
  object-fit: cover;
  border-radius: 0.8rem;
}

.ts-rites-fraglabel {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: rgba(228, 203, 149, 0.92);
}

.ts-rites-bottomgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.ts-rites-mini {
  padding: 1rem 1.15rem;
}

.ts-rites-mini-speech {
  grid-column: span 1;
}

.ts-rites-minivalue {
  font-family: "EB Garamond", serif;
  font-size: 1.95rem;
  color: #f7f2e8;
}

.ts-rites-mininote,
.ts-rites-minispeech {
  color: rgba(232, 235, 244, 0.84);
  line-height: 1.46;
  font-size: 1rem;
}

@keyframes ritesDrift {
  0% { transform: translateY(0) scale(0.92); opacity: 0.35; }
  50% { transform: translateY(-12px) scale(1.08); opacity: 0.88; }
  100% { transform: translateY(0) scale(0.92); opacity: 0.35; }
}

@media (max-width: 1380px) {
  .ts-rites-topgrid {
    grid-template-columns: 1fr;
  }

  .ts-rites-viewerpanel {
    min-height: 0;
  }

  .ts-rites-bottomgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ts-rites-stage {
    padding: 1rem;
  }

  .ts-rites-orbitwrap {
    min-height: 23rem;
  }

  .ts-rites-orbitstage {
    --orbit-main-size: min(100%, 36rem);
    --orbit-main-radius: 15.4rem;
    --orbit-bridge-radius: 19rem;
  }

  .ts-rites-node {
    width: 6.6rem;
    height: 6.6rem;
  }

  .ts-rites-node-center {
    width: 9.25rem;
    height: 9.25rem;
  }

  .ts-rites-fragmentrail,
  .ts-rites-bottomgrid {
    grid-template-columns: 1fr;
  }

  .ts-rites-toolbar {
    align-items: flex-start;
  }
}

/* MR canonical precinct patch: visible tiles use names only; stage numbers remain hidden. */
.ts-rites-node-code {
  display: none !important;
}

.ts-rites-surroundingwash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1.5s ease;
  mix-blend-mode: screen;
}

.ts-rites-surroundingwash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 230, 184, 0.12), rgba(5, 12, 30, 0.42) 70%);
}

.ts-rites-surroundingwash.is-active {
  opacity: 0.4;
}

.ts-rites-mainstill,
.ts-rites-mainvideo {
  z-index: 0;
}

.ts-rites-mainveil,
.ts-rites-mainhalo,
.ts-rites-maincaption {
  z-index: 2;
}


/* MR loci-drawer placement patch: Locus -> four carried loci -> Active Field. */
.ts-rites-topgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.ts-rites-hubpanel {
  gap: 0.72rem;
}

.ts-rites-orbitwrap {
  min-height: 32rem;
}

.ts-rites-hubnote {
  margin-top: 0;
}

.ts-rites-drawer {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0.82rem 0.92rem 0.92rem;
}

.ts-rites-drawer-head {
  margin-bottom: 0.62rem;
}

.ts-rites-drawer-title {
  font-size: 1.28rem;
}

.ts-rites-fragmentrail {
  gap: 0.65rem;
}

.ts-rites-fragbtn {
  gap: 0;
  padding: 0.42rem;
}

.ts-rites-fragthumb {
  aspect-ratio: 9 / 4.8;
}

.ts-rites-fraglabel {
  display: none !important;
}

.ts-rites-viewerpanel {
  min-height: 0;
  grid-template-rows: minmax(24rem, 38rem) auto;
  gap: 0.82rem;
  margin: 0;
}

.ts-rites-viewerframe {
  min-height: 24rem;
}

.ts-rites-bottomgrid {
  margin-top: 0.72rem;
}

.ts-rites-surroundingwash {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transform: none;
  background-position: center;
  background-size: cover;
  mix-blend-mode: screen;
  transition: none;
}

.ts-rites-surroundingwash.is-active {
  animation: ritesSurroundingDissolve 2.5s linear forwards;
}

@keyframes ritesSurroundingDissolve {
  0% { opacity: 0.5; }
  100% { opacity: 0; }
}

@media (max-width: 900px) {
  .ts-rites-topgrid {
    gap: 0.5rem;
  }

  .ts-rites-orbitwrap {
    min-height: 23rem;
  }

  .ts-rites-viewerpanel {
    grid-template-rows: minmax(20rem, auto) auto;
  }
}

/* MR surgical pass: compact header/locus spacing, place Surroundings cleanly between Locus and Active Field. */
.ts-rites-stage {
  padding-top: 1.15rem;
}

.ts-rites-headerband {
  gap: 0.22rem;
  margin-bottom: 0.62rem;
}

.ts-rites-intro {
  line-height: 1.42;
}

.ts-rites-topgrid {
  gap: 0.42rem;
}

.ts-rites-hubpanel {
  padding: 0.95rem 1.25rem 0.75rem;
  gap: 0.28rem;
  overflow: hidden;
}

.ts-rites-hubpanel > .ts-rites-kicker {
  margin-bottom: 0;
}

.ts-rites-orbitwrap {
  min-height: 29.5rem;
  margin-top: -0.65rem;
  margin-bottom: -0.85rem;
}

.ts-rites-orbitstage {
  transform: translateY(-0.75rem);
}

.ts-rites-hubnote {
  display: none !important;
}

.ts-rites-drawer {
  margin-top: 0;
  margin-bottom: 0;
}

.ts-rites-viewerpanel {
  margin-top: 0;
}

.ts-rites-maincaption #ritesModeKicker,
#ritesModeKicker {
  letter-spacing: 0.18em;
}

@media (max-width: 900px) {
  .ts-rites-stage {
    padding-top: 0.9rem;
  }
  .ts-rites-headerband {
    margin-bottom: 0.5rem;
  }
  .ts-rites-orbitwrap {
    min-height: 22rem;
    margin-top: -0.35rem;
    margin-bottom: -0.5rem;
  }
  .ts-rites-orbitstage {
    transform: translateY(-0.35rem);
  }
}

/* MR surgical tightening: Locus block vertical compression; tile sizes unchanged. */
.ts-rites-headerband {
  margin-bottom: 0.75rem;
}

.ts-rites-hubpanel {
  padding: 1rem 1.35rem 1.05rem;
  gap: 0.45rem;
}

.ts-rites-hubpanel > .ts-rites-kicker {
  margin-bottom: -0.15rem;
}

.ts-rites-orbitwrap {
  min-height: 0;
  padding: 0;
  margin: 0;
}

/* MR baseline tightening pass: keep tile size and side orbit proportions; reduce only vertical slack around the Locus field. */
.ts-rites-hubpanel {
  padding-top: 1rem;
  padding-bottom: 1rem;
  overflow: hidden;
}

.ts-rites-hubpanel > .ts-rites-kicker {
  margin-bottom: 0;
}

.ts-rites-orbitwrap {
  height: 42rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
}

.ts-rites-orbitstage {
  width: min(100%, 52rem);
  height: 42rem;
  aspect-ratio: auto;
  transform: none;
}

.ts-rites-drawer {
  margin-top: 0.48rem;
}

@media (max-width: 900px) {
  .ts-rites-orbitwrap {
    height: 30rem;
  }

  .ts-rites-orbitstage {
    height: 30rem;
  }
}

@media (max-width: 640px) {
  .ts-rites-orbitwrap {
    height: 25rem;
  }

  .ts-rites-orbitstage {
    height: 25rem;
  }
}

/* MR surgical pass: remove Locus title space, reduce whole orbit field by about 20 percent, and keep side breathing room. */
.ts-rites-hubpanel {
  padding: 0.65rem 1.35rem;
  gap: 0;
  overflow: hidden;
}

.ts-rites-orbitwrap {
  height: 33.6rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
}

.ts-rites-orbitstage {
  --orbit-main-size: min(100%, 41.6rem);
  --orbit-main-radius: 15.85rem;
  --orbit-bridge-radius: 19.6rem;
  width: var(--orbit-main-size);
  height: auto;
  aspect-ratio: 1 / 1;
  transform: none;
}

.ts-rites-node {
  width: 6.8rem;
  height: 6.8rem;
  padding: 0.58rem 0.48rem 0.64rem;
  border-radius: 1.15rem;
}

.ts-rites-node-center {
  width: 9.6rem;
  height: 9.6rem;
}

.ts-rites-node-center .ts-rites-node-label {
  display: none;
}

.ts-rites-node-name {
  font-size: 0.96rem;
  line-height: 1.02;
}

@media (max-width: 900px) {
  .ts-rites-orbitwrap {
    height: 24rem;
  }

  .ts-rites-orbitstage {
    --orbit-main-size: min(100%, 28.8rem);
    --orbit-main-radius: 12.3rem;
    --orbit-bridge-radius: 15.2rem;
  }

  .ts-rites-node {
    width: 5.3rem;
    height: 5.3rem;
  }

  .ts-rites-node-center {
    width: 7.4rem;
    height: 7.4rem;
  }
}

@media (max-width: 640px) {
  .ts-rites-orbitwrap {
    height: 20rem;
  }

  .ts-rites-orbitstage {
    --orbit-main-size: min(100%, 24rem);
    --orbit-main-radius: 10.1rem;
    --orbit-bridge-radius: 12.6rem;
  }

  .ts-rites-node {
    width: 4.65rem;
    height: 4.65rem;
  }

  .ts-rites-node-name {
    font-size: 0.78rem;
  }

  .ts-rites-node-center {
    width: 6.5rem;
    height: 6.5rem;
  }
}

/* MR surgical pass: restore the Locus as a wide oblong field while preserving the current reduced tile scale. */
.ts-rites-hubpanel {
  padding: 0.55rem 1.35rem;
  overflow: hidden;
}

.ts-rites-orbitwrap {
  height: 31rem;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
}

.ts-rites-orbitstage {
  width: min(100%, 52rem);
  height: 31rem;
  aspect-ratio: auto;
  margin-inline: auto;
  transform: none;
}

.ts-rites-orbit-ring-main {
  width: min(100%, 42rem);
  height: 24rem;
}

.ts-rites-orbit-ring-bridge {
  width: min(100%, 50rem);
  height: 30rem;
}

.ts-rites-node-center {
  width: 9.4rem;
  height: 9.4rem;
}

@media (max-width: 900px) {
  .ts-rites-orbitwrap {
    height: 23rem;
  }

  .ts-rites-orbitstage {
    width: min(100%, 38rem);
    height: 23rem;
    aspect-ratio: auto;
  }

  .ts-rites-orbit-ring-main {
    width: min(100%, 31rem);
    height: 17.5rem;
  }

  .ts-rites-orbit-ring-bridge {
    width: min(100%, 37rem);
    height: 22rem;
  }
}

@media (max-width: 640px) {
  .ts-rites-orbitwrap {
    height: 20rem;
  }

  .ts-rites-orbitstage {
    width: min(100%, 32rem);
    height: 20rem;
    aspect-ratio: auto;
  }

  .ts-rites-orbit-ring-main {
    width: min(100%, 26rem);
    height: 15rem;
  }

  .ts-rites-orbit-ring-bridge {
    width: min(100%, 31rem);
    height: 19rem;
  }
}

/* MR surgical baseline: transparent centre sigil and final threshold title. */
.ts-rites-node-center,
.ts-rites-node-center:hover,
.ts-rites-node-center:focus-visible,
.ts-rites-node-center.is-active {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  filter: none;
}

.ts-rites-node-center::before,
.ts-rites-node-center .ts-rites-node-sigil {
  display: none !important;
}

/* MR baseline hardening: ensure Active Field halo remains suppressed. */
.ts-rites-mainhalo {
  display: none !important;
}

/* MR baseline hardening: Locus translucence and Active Field halo suppression. */
.ts-rites-hubpanel {
  background: rgba(5, 12, 30, 0.25);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.ts-rites-mainhalo {
  display: none !important;
}



/* MR Chamber v1 clean section: state-driven backend continuation renderer.
   Landing, orbit, Surroundings and Active Field rules above this line are preserved.
   This section replaces the accumulated Chamber patch stack. */

/* 1. Chamber shell state --------------------------------------------------- */
.ts-rites-chamberbody {
  display: none;
}

.ts-rites-stage.is-chamber {
  min-height: calc(100vh - 132px);
}

.ts-rites-stage.is-chamber .ts-rites-headerband,
.ts-rites-stage.is-chamber .ts-rites-hubpanel,
.ts-rites-stage.is-chamber .ts-rites-drawer,
.ts-rites-stage.is-chamber .ts-rites-bottomgrid {
  display: none !important;
}

.ts-rites-stage.is-chamber .ts-rites-topgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.ts-rites-stage.is-chamber .ts-rites-viewerpanel {
  position: relative;
  z-index: 2;
  min-height: 0;
  padding: clamp(1rem, 2vw, 1.65rem);
  display: block;
  background:
    radial-gradient(circle at 18% 4%, rgba(219, 176, 90, 0.08), transparent 32%),
    radial-gradient(circle at 78% 0%, rgba(107, 132, 214, 0.10), transparent 36%),
    linear-gradient(180deg, rgba(3, 8, 20, 0.68), rgba(2, 5, 14, 0.88));
  border-color: rgba(231, 202, 132, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 22px 62px rgba(0, 0, 0, 0.35);
}

.ts-rites-stage.is-chamber .ts-rites-viewerframe {
  display: none !important;
}

.ts-rites-stage.is-chamber .ts-rites-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.35rem);
  align-items: start;
}

.ts-rites-stage.is-chamber .ts-rites-toolbar-right {
  display: none !important;
}

.ts-rites-stage.is-chamber .ts-rites-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  width: min(100%, 82rem);
  margin: 0 auto;
  order: 2;
}

.ts-rites-stage.is-chamber .ts-primary-btn,
.ts-rites-stage.is-chamber .ts-rites-ghost {
  min-height: 3.15rem;
  padding: 0.9rem 1.55rem;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continuing"] .ts-rites-chamberbody {
  opacity: 0.82;
}

/* 2. Chamber layout ------------------------------------------------------- */
.ts-rites-stage.is-chamber .ts-rites-chamberbody.is-visible {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.35rem);
  width: min(100%, 82rem);
  margin: 0 auto;
  order: 1;
}

.ts-rites-stage.is-chamber .ts-rites-storycascade {
  order: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.85rem, 1.65vw, 1.15rem);
  width: 100%;
  margin: 0;
  padding: 0;
}

.ts-rites-stage.is-chamber .ts-rites-chamberstory {
  order: 2;
  display: block;
  width: 100%;
  padding: clamp(1.05rem, 2.2vw, 1.45rem);
  border: 1px solid rgba(177, 196, 255, 0.16);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at top left, rgba(219, 176, 90, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(4, 12, 31, 0.74), rgba(2, 6, 18, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 14px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ts-rites-stage.is-chamber .ts-rites-chamberstory[aria-hidden="true"] {
  display: none;
}

.ts-rites-stage.is-chamber .ts-rites-chamberstory-title {
  margin: 0.22rem 0 0.62rem;
  font-family: "EB Garamond", serif;
  font-size: clamp(2rem, 3.5vw, 3.15rem);
  line-height: 1.02;
  color: #fbf6ec;
  text-wrap: balance;
}

.ts-rites-stage.is-chamber .ts-rites-chamberstory-body {
  margin: 0;
  max-width: 74rem;
  color: rgba(235, 238, 247, 0.9);
  font-size: clamp(1.05rem, 1.38vw, 1.22rem);
  line-height: 1.56;
  white-space: pre-line;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-chamberstory {
  order: 0;
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  border-color: rgba(231, 202, 132, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 18px 38px rgba(0,0,0,0.24);
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-storycascade {
  order: 1;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-chamberstory-title {
  font-size: clamp(2.3rem, 4vw, 3.6rem);
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-chamberstory-body {
  font-size: clamp(1.08rem, 1.5vw, 1.28rem);
}


/* 3. Fourfold determinant bands ------------------------------------------ */
.ts-rites-stage.is-chamber .ts-rites-storystep {
  position: relative;
  display: grid;
  gap: clamp(0.78rem, 1.55vw, 1rem);
  align-items: stretch;
  min-height: 0;
  margin: 0;
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="past"],
.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"] {
  grid-template-columns: minmax(9.25rem, 13rem) minmax(0, 1fr);
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"],
.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] {
  grid-template-columns: minmax(0, 1fr) minmax(9.25rem, 13rem);
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"] .ts-rites-storycopy,
.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] .ts-rites-storycopy {
  grid-column: 1;
  grid-row: 1;
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"] .ts-rites-storycard,
.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] .ts-rites-storycard {
  grid-column: 2;
  grid-row: 1;
}

.ts-rites-stage.is-chamber .ts-rites-storycard,
.ts-rites-stage.is-chamber .ts-rites-storycopy {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(177, 196, 255, 0.15);
  border-radius: 1.16rem;
  background:
    radial-gradient(circle at top left, rgba(219, 176, 90, 0.10), transparent 38%),
    linear-gradient(180deg, rgba(4, 12, 31, 0.78), rgba(2, 6, 18, 0.91));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 14px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ts-rites-stage.is-chamber .ts-rites-storycard {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  padding: 0.72rem;
}

.ts-rites-stage.is-chamber .ts-rites-storycopy {
  display: grid;
  align-content: center;
  padding: clamp(0.92rem, 1.7vw, 1.15rem);
}

.ts-rites-stage.is-chamber .ts-rites-storycopy-title {
  margin: 0.2rem 0 0.28rem;
  font-family: "EB Garamond", serif;
  font-size: clamp(1.35rem, 2.05vw, 1.85rem);
  line-height: 1.04;
  color: #f8f2e7;
}

.ts-rites-stage.is-chamber .ts-rites-storycopy-body {
  margin: 0;
  color: rgba(232, 235, 244, 0.88);
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  line-height: 1.46;
  white-space: pre-line;
}

.ts-rites-stage.is-chamber .ts-rites-storycard-value {
  display: block;
  margin-top: 0.35rem;
  font-family: "EB Garamond", serif;
  font-size: clamp(1.12rem, 1.6vw, 1.45rem);
  line-height: 1.08;
  color: #fbf6ec;
  text-align: center;
  text-wrap: balance;
}

.ts-rites-stage.is-chamber .ts-rites-storycard--chooser > .ts-rites-storycard-value {
  display: none !important;
}

.ts-rites-stage.is-chamber .ts-rites-strip-image,
.ts-rites-stage.is-chamber .ts-rites-strip-video,
.ts-rites-stage.is-chamber .ts-rites-present-viewport,
.ts-rites-stage.is-chamber .ts-rites-door-image {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0.82rem;
  border: 1px solid rgba(177, 196, 255, 0.15);
  background: radial-gradient(circle at center, rgba(16, 26, 55, 0.9), rgba(3, 7, 18, 0.98));
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

.ts-rites-stage.is-chamber .ts-rites-strip-image,
.ts-rites-stage.is-chamber .ts-rites-strip-video,
.ts-rites-stage.is-chamber .ts-rites-present-viewport,
.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] .ts-rites-door-image {
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"] .ts-rites-storycard {
  justify-content: flex-start;
}

.ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"] .ts-rites-door-image {
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.ts-rites-stage.is-chamber .ts-rites-strip-video.is-hidden,
.ts-rites-stage.is-chamber .ts-rites-strip-image.is-empty,
.ts-rites-stage.is-chamber .ts-rites-door-image.is-empty {
  display: none;
}

.ts-rites-stage.is-chamber .ts-rites-strip-video.is-visible {
  display: block;
}

.ts-rites-stage.is-chamber .ts-rites-storycard--image .ts-rites-strip-image.has-video-visible {
  display: none;
}

/* 4. Present Rite chooser ------------------------------------------------- */
.ts-rites-stage.is-chamber .ts-rites-presentchooser {
  display: grid;
  gap: 0.62rem;
}

.ts-rites-stage.is-chamber .ts-rites-present-viewport {
  position: relative;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  isolation: isolate;
}

.ts-rites-stage.is-chamber .ts-rites-present-viewport:disabled {
  cursor: default;
  opacity: 0.76;
}

.ts-rites-stage.is-chamber .ts-rites-present-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.ts-rites-stage.is-chamber .ts-rites-present-status,
.ts-rites-stage.is-chamber .ts-rites-present-meta {
  display: none !important;
}

.ts-rites-stage.is-chamber .ts-rites-present-actions {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.ts-rites-stage.is-chamber .ts-rites-present-actions .ts-rites-ghost {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-present-actions,
.ts-rites-stage.is-chamber[data-chamber-phase="continuing"] .ts-rites-present-actions {
  display: none !important;
}

.ts-rites-present-sprinkle {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.ts-rites-present-sprinkle span {
  position: absolute;
  width: 25%;
  height: 25%;
  background-image: var(--next-image);
  background-size: 400% 400%;
  opacity: 0;
  transform: scale(0.72) rotate(var(--tile-rot, 0deg));
  animation: ts-present-sprinkle 0.62s ease both;
  animation-delay: var(--tile-delay, 0s);
}

@keyframes ts-present-sprinkle {
  0% { opacity: 0; transform: scale(0.62) rotate(var(--tile-rot, 0deg)); filter: brightness(1.25) saturate(1.08); }
  48% { opacity: 1; transform: scale(1.02) rotate(0deg); filter: brightness(1.05) saturate(1.02); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); filter: none; }
}

/* 5. Querent identification ----------------------------------------------- */
.ts-rites-stage.is-chamber .ts-rites-identity {
  order: 3;
  padding: clamp(1rem, 2vw, 1.3rem);
  border: 1px solid rgba(177, 196, 255, 0.16);
  border-radius: 1.28rem;
  background:
    radial-gradient(circle at top left, rgba(219, 176, 90, 0.11), transparent 38%),
    linear-gradient(180deg, rgba(4, 12, 31, 0.72), rgba(2, 6, 18, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 14px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ts-rites-stage.is-chamber .ts-rites-identity-prompt {
  margin: 0.45rem 0 0.82rem;
  color: rgba(232, 235, 244, 0.88);
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.48;
}

.ts-rites-stage.is-chamber .ts-rites-identity-options {
  display: grid;
  gap: 0.65rem;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-identity {
  order: 2;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-identity-options {
  display: none;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-identity-prompt {
  margin: 0.3rem 0 0;
  font-size: clamp(1.02rem, 1.3vw, 1.12rem);
  color: rgba(244, 238, 226, 0.9);
}

.ts-rites-stage.is-chamber .ts-rites-idbtn {
  width: 100%;
  display: grid;
  gap: 0.22rem;
  padding: 0.86rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(180, 195, 244, 0.16);
  background: rgba(7, 17, 41, 0.62);
  color: rgba(244, 238, 226, 0.92);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.ts-rites-stage.is-chamber .ts-rites-idbtn span {
  font-family: "Cinzel", serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.86rem;
  color: rgba(244, 224, 178, 0.96);
}

.ts-rites-stage.is-chamber .ts-rites-idbtn small {
  font-size: 0.98rem;
  line-height: 1.35;
  color: rgba(232, 235, 244, 0.78);
}

.ts-rites-stage.is-chamber .ts-rites-idbtn:disabled {
  opacity: 0.46;
  cursor: default;
}

.ts-rites-stage.is-chamber .ts-rites-idbtn:not(:disabled):hover,
.ts-rites-stage.is-chamber .ts-rites-idbtn:not(:disabled):focus-visible,
.ts-rites-stage.is-chamber .ts-rites-idbtn.is-selected {
  transform: translateY(-1px);
  border-color: rgba(231, 202, 132, 0.44);
  box-shadow: 0 0 0 1px rgba(231, 202, 132, 0.16), 0 10px 28px rgba(0, 0, 0, 0.28);
}

.ts-rites-stage.is-chamber .ts-rites-idbtn.is-selected {
  background:
    radial-gradient(circle at top left, rgba(231, 202, 132, 0.19), transparent 48%),
    rgba(9, 21, 48, 0.82);
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-idbtn,
.ts-rites-stage.is-chamber[data-chamber-phase="continuing"] .ts-rites-idbtn {
  transform: none;
}

/* 6. Present preview modal ------------------------------------------------ */
.ts-rites-modal[hidden] {
  display: none;
}

.ts-rites-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.ts-rites-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ts-rites-modal-dialog {
  position: relative;
  width: min(94vw, 34rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgba(177, 196, 255, 0.16);
  border-radius: 1.45rem;
  background:
    radial-gradient(circle at top left, rgba(219, 176, 90, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(4, 12, 31, 0.94), rgba(2, 6, 18, 0.97));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.44);
}

.ts-rites-modal-close {
  position: absolute;
  top: 0.72rem;
  right: 0.72rem;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(177, 196, 255, 0.14);
  border-radius: 999px;
  background: rgba(9, 18, 40, 0.76);
  color: #f8f2e7;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.ts-rites-modal-title {
  display: none !important;
}

.ts-rites-modal-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(72vh, 48rem);
  margin: 1.4rem auto 0;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 1rem;
  border: 1px solid rgba(177, 196, 255, 0.14);
  background: radial-gradient(circle at center, rgba(16, 26, 55, 0.9), rgba(3, 7, 18, 0.98));
}

.ts-rites-modal-caption {
  margin: 0.9rem 0 0;
  color: rgba(232, 235, 244, 0.86);
  font-size: 1rem;
  line-height: 1.5;
}

.ts-rites-modal-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.ts-rites-modal-actions .ts-primary-btn,
.ts-rites-modal-actions .ts-rites-ghost {
  flex: 1 1 12rem;
}

/* 7. Responsive Chamber fallback ----------------------------------------- */
@media (max-width: 980px) {
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="past"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] {
    grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  }

  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"] .ts-rites-storycard,
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] .ts-rites-storycard {
    grid-column: 1;
    grid-row: 1;
  }

  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"] .ts-rites-storycopy,
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] .ts-rites-storycopy {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 680px) {
  .ts-rites-stage.is-chamber .ts-rites-viewerpanel {
    padding: 0.9rem;
  }

  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="past"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="present"],
  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="future"] {
    grid-template-columns: 1fr;
  }

  .ts-rites-stage.is-chamber .ts-rites-storystep .ts-rites-storycard,
  .ts-rites-stage.is-chamber .ts-rites-storystep .ts-rites-storycopy {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .ts-rites-stage.is-chamber .ts-rites-storycard {
    width: min(100%, 14rem);
  }

  .ts-rites-stage.is-chamber .ts-rites-storystep[data-step="bridge"] .ts-rites-storycard {
    width: min(100%, 18rem);
  }

  .ts-rites-stage.is-chamber .ts-rites-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }

  .ts-rites-stage.is-chamber .ts-rites-toolbar-left > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-rites-present-sprinkle span {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* MR Chamber v1.1 tuning: remove internal card labels, center preview modal, restore visible chooser mosaic. */

/* Card-bottom station labels are internal/debug-facing; the image and determination panel carry the user-facing meaning. */
.ts-rites-stage.is-chamber .ts-rites-storycard-value {
  display: none !important;
}

/* Keep the Present Rite chooser's image transition legible after the clean Chamber rebuild. */
.ts-rites-stage.is-chamber .ts-rites-present-viewport {
  background: linear-gradient(180deg, rgba(7, 16, 36, 0.94), rgba(3, 7, 18, 0.98));
  overflow: hidden;
}

.ts-rites-stage.is-chamber .ts-rites-present-image {
  position: relative;
  z-index: 1;
  opacity: 1;
  transform: scale(1);
  filter: none;
  transition: opacity 0.34s ease, transform 0.34s ease, filter 0.34s ease;
  will-change: opacity, transform, filter;
}

.ts-rites-stage.is-chamber .ts-rites-present-viewport.is-swapping .ts-rites-present-image {
  opacity: 0.34;
  transform: scale(0.986);
  filter: brightness(0.72) saturate(0.9) blur(0.4px);
}

.ts-rites-present-sprinkle {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.ts-rites-present-sprinkle span {
  position: absolute;
  width: 25%;
  height: 25%;
  background-image: var(--next-image);
  background-size: 400% 400%;
  opacity: 0;
  transform: translateY(0.28rem) scale(0.66) rotate(var(--tile-rot, 0deg));
  transform-origin: center center;
  animation: ts-present-sprinkle 0.78s cubic-bezier(.2,.78,.24,1) both;
  animation-delay: var(--tile-delay, 0s);
  box-shadow: 0 0 18px rgba(245, 215, 151, 0.08);
  will-change: opacity, transform, filter;
}

@keyframes ts-present-sprinkle {
  0% {
    opacity: 0;
    transform: translateY(0.36rem) scale(0.58) rotate(var(--tile-rot, 0deg));
    filter: brightness(1.35) saturate(1.16) blur(1px);
  }
  42% {
    opacity: 1;
    transform: translateY(-0.03rem) scale(1.035) rotate(0deg);
    filter: brightness(1.08) saturate(1.04) blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: none;
  }
}

/* Present preview modal: force true viewport centering even when opened from a scrolled Chamber. */
.ts-rites-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.ts-rites-modal[hidden] {
  display: none !important;
}

.ts-rites-modal-backdrop {
  position: fixed;
  inset: 0;
}

.ts-rites-modal-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 31rem);
  max-height: min(92vh, 56rem);
  overflow: auto;
  margin: 0;
}

.ts-rites-modal-image {
  width: auto;
  max-width: 100%;
  max-height: min(70vh, 45rem);
  margin: 1.25rem auto 0;
  object-fit: contain;
}

@media (max-width: 680px) {
  .ts-rites-modal-dialog {
    width: min(96vw, 30rem);
    max-height: 94vh;
  }

  .ts-rites-modal-image {
    max-height: 66vh;
  }
}

/* MR Chamber v1.2 tuning: selector mechanics, viewport modal, no dialog scrollbar. */

/* Hold button now freezes the rite in JS; image click alone opens the preview. */
.ts-rites-stage.is-chamber .ts-rites-present-actions .ts-rites-ghost {
  cursor: pointer;
}

/* Slow and soften the selector's mosaic handoff so it reads as one transition. */
.ts-rites-present-sprinkle span {
  animation-duration: 0.9s !important;
  animation-timing-function: cubic-bezier(.18,.74,.2,1) !important;
}

@keyframes ts-present-sprinkle {
  0% {
    opacity: 0;
    transform: translateY(0.34rem) scale(0.62) rotate(var(--tile-rot, 0deg));
    filter: brightness(1.24) saturate(1.08) blur(0.8px);
  }
  48% {
    opacity: 1;
    transform: translateY(-0.02rem) scale(1.018) rotate(0deg);
    filter: brightness(1.04) saturate(1.02) blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: none;
  }
}

/* The preview modal is moved to document.body by JS; these rules keep it centred on the viewport. */
.ts-rites-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: clamp(0.75rem, 2vw, 1.25rem) !important;
  box-sizing: border-box !important;
}

.ts-rites-modal[hidden] {
  display: none !important;
}

.ts-rites-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 5, 14, 0.82) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.ts-rites-modal-dialog {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: min(92vw, 31rem) !important;
  max-height: calc(100dvh - 2rem) !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  scrollbar-width: none !important;
}

.ts-rites-modal-dialog::-webkit-scrollbar {
  display: none !important;
}

.ts-rites-modal-close {
  flex: 0 0 auto !important;
}

.ts-rites-modal-title {
  display: none !important;
}

.ts-rites-modal-image {
  flex: 0 1 auto !important;
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: calc(100dvh - 14.6rem) !important;
  min-height: 0 !important;
  margin: 0.85rem auto 0 !important;
  object-fit: contain !important;
}

.ts-rites-modal-caption {
  flex: 0 0 auto !important;
  margin-top: 0.75rem !important;
  font-size: 0.92rem !important;
  line-height: 1.38 !important;
}

.ts-rites-modal-actions {
  flex: 0 0 auto !important;
  margin-top: 0.75rem !important;
  gap: 0.55rem !important;
}

.ts-rites-modal-actions .ts-primary-btn,
.ts-rites-modal-actions .ts-rites-ghost {
  min-height: 2.75rem !important;
  padding: 0.65rem 0.95rem !important;
  font-size: 0.76rem !important;
}

@media (max-height: 760px) {
  .ts-rites-modal-dialog {
    width: min(92vw, 27rem) !important;
    padding: 0.9rem !important;
  }

  .ts-rites-modal-image {
    max-height: calc(100dvh - 12.8rem) !important;
  }

  .ts-rites-modal-caption {
    font-size: 0.84rem !important;
    line-height: 1.32 !important;
  }
}

@media (max-width: 680px) {
  .ts-rites-modal-dialog {
    width: min(96vw, 29rem) !important;
  }
}

/* MR selector close-of-day stabilization: resume + non-blinking handoff. */
.ts-rites-stage.is-chamber .ts-rites-present-viewport.is-swapping .ts-rites-present-image {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.ts-rites-present-sprinkle {
  opacity: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: opacity 0.18s ease;
}

.ts-rites-present-sprinkle.is-fading-out {
  opacity: 0;
}

.ts-rites-present-sprinkle span {
  animation-duration: 0.82s !important;
  backface-visibility: hidden;
}


/* MR modal quarantine patch: true viewport overlay, no page bleed, no mid-page jump. */
body.ts-rites-modal-open {
  position: fixed !important;
  overflow: hidden !important;
  inset: 0 !important;
  width: 100% !important;
}

.ts-rites-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: clamp(0.75rem, 2vw, 1.25rem) !important;
  padding-top: clamp(1rem, 3vh, 1.75rem) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.ts-rites-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 5, 14, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.ts-rites-modal-dialog {
  position: relative !important;
  z-index: 1 !important;
  width: min(92vw, 31rem) !important;
  max-height: calc(100dvh - clamp(1.5rem, 5vh, 3rem)) !important;
  margin: 0 !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52) !important;
}

.ts-rites-modal-image {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(72dvh, 48rem) !important;
  margin: 0.85rem auto 0 !important;
  object-fit: contain !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42) !important;
}

@media (max-width: 680px) {
  .ts-rites-modal {
    padding: 0.75rem !important;
    padding-top: max(0.75rem, env(safe-area-inset-top)) !important;
  }

  .ts-rites-modal-dialog {
    width: min(96vw, 29rem) !important;
    max-height: calc(100dvh - 1.5rem) !important;
  }
}


/* MR chamber correction: keep final shell kickers, but do not surface semantic trace lines inside image cards after continuation. */
.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-storycard-value,
.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-storycard--chooser > .ts-rites-storycard-value {
  display: none !important;
}

.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-strip-image,
.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-strip-video,
.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-present-viewport,
.ts-rites-stage.is-chamber[data-chamber-phase="continued"] .ts-rites-door-image {
  order: unset;
  max-height: none;
}
