:root {
  --kst-gold: #d8b86a;
  --kst-gold-deep: #9c7730;
  --kst-ivory: #f4edda;
  --kst-ink: #04060b;
  --kst-blue: #071227;
  --kst-violet: #241339;
  --kst-line: rgba(216, 184, 106, 0.28);
}

html[data-kst-preview="shuttle-trinity-v1"] {
  scroll-behavior: smooth;
}

.kst-preview-shell,
.kst-coradi-context {
  box-sizing: border-box;
  color: var(--kst-ivory);
  font-family: "Montserrat", sans-serif;
}

.kst-preview-shell *,
.kst-coradi-context * {
  box-sizing: border-box;
}

.kst-preview-shell {
  position: relative;
  z-index: 5;
  width: 100%;
  background:
    radial-gradient(circle at 16% 0%, rgba(63, 34, 100, 0.28), transparent 34rem),
    linear-gradient(180deg, #050811 0%, #071021 58%, #03050a 100%);
  border-top: 1px solid rgba(216, 184, 106, 0.18);
  border-bottom: 1px solid rgba(216, 184, 106, 0.2);
}

.kst-preview-safety {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.45rem 1rem;
  color: rgba(244, 237, 218, 0.7);
  background: rgba(4, 6, 11, 0.92);
  border-bottom: 1px solid rgba(216, 184, 106, 0.12);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease;
}

.kst-preview-safety.is-alerting {
  color: #100c03;
  background: var(--kst-gold);
}

.kst-trinity-selector {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 4vw, 4rem) 1rem;
  background: linear-gradient(180deg, rgba(5, 8, 17, 0.98), rgba(7, 16, 33, 0.96));
  border-bottom: 1px solid var(--kst-line);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.kst-selector-heading {
  max-width: 1220px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.kst-selector-heading h2,
.kst-panel-hero h2,
.kst-coradi-context h2 {
  margin: 0;
  color: var(--kst-ivory);
  font-family: "Cormorant Upright", serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.kst-selector-heading h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.5rem);
  line-height: 1.05;
}

.kst-kicker {
  margin: 0 0 0.4rem;
  color: var(--kst-gold);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.kst-coradi-inline,
.kst-panel-actions button,
.kst-orientation-controls button,
.kst-relations button,
.kst-network-toggle {
  min-height: 44px;
  border: 1px solid var(--kst-line);
  color: var(--kst-ivory);
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.kst-coradi-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  color: var(--kst-gold);
  font-size: 0.76rem;
}

.kst-coradi-inline:hover,
.kst-coradi-inline:focus-visible,
.kst-panel-actions button:hover,
.kst-panel-actions button:focus-visible,
.kst-orientation-controls button:hover,
.kst-orientation-controls button:focus-visible {
  border-color: rgba(216, 184, 106, 0.78);
  background: rgba(216, 184, 106, 0.09);
  outline: none;
}

.kst-coradi-orb {
  color: #f6dd97;
  filter: drop-shadow(0 0 8px rgba(216, 184, 106, 0.7));
}

.kst-tabs {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.kst-tab {
  min-height: 86px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 0.15rem 0.7rem;
  padding: 0.9rem 1rem;
  overflow: hidden;
  text-align: left;
  color: rgba(244, 237, 218, 0.76);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(216, 184, 106, 0.17);
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(0.76rem, 1vw, 0.9rem);
  letter-spacing: 0.07em;
  cursor: pointer;
}

.kst-tab::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--kst-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.kst-tab span {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--kst-gold);
  font-family: "Cormorant Upright", serif;
  font-size: 1.9rem;
  font-variant-numeric: lining-nums;
}

.kst-tab small {
  grid-column: 1;
  color: rgba(244, 237, 218, 0.42);
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.kst-tab:hover,
.kst-tab:focus-visible,
.kst-tab.is-active {
  color: var(--kst-ivory);
  border-color: rgba(216, 184, 106, 0.62);
  background: linear-gradient(140deg, rgba(216, 184, 106, 0.11), rgba(54, 27, 86, 0.18));
  outline: none;
}

.kst-tab.is-active::before {
  transform: scaleX(1);
}

.kst-orientation {
  max-width: 1220px;
  margin: 0.85rem auto 0;
  display: grid;
  grid-template-columns: auto auto minmax(16rem, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
  color: rgba(244, 237, 218, 0.54);
  font-size: 0.72rem;
}

.kst-orientation p {
  margin: 0;
}

.kst-orientation-controls {
  display: flex;
  gap: 0.35rem;
}

.kst-orientation-controls button {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.67rem;
}

.kst-orientation-controls button.is-active {
  color: #120e04;
  background: var(--kst-gold);
  border-color: var(--kst-gold);
}

.kst-itinerary {
  color: rgba(244, 237, 218, 0.72) !important;
}

.kst-dimension-panel {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 7vw, 6rem);
}

.kst-dimension-panel[hidden] {
  display: none !important;
}

.kst-panel-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid rgba(216, 184, 106, 0.22);
  background:
    radial-gradient(circle at 18% 50%, rgba(54, 105, 181, 0.18), transparent 35%),
    linear-gradient(135deg, rgba(10, 24, 48, 0.86), rgba(37, 18, 57, 0.72));
}

.kst-panel-hero-social {
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr);
}

.kst-panel-hero img {
  width: 100%;
  height: min(320px, 48vw);
  display: block;
  object-fit: contain;
  object-position: center;
}

.kst-panel-hero h2 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.kst-panel-hero > div > p:last-child {
  max-width: 50rem;
  margin: 1.25rem 0 0;
  color: rgba(244, 237, 218, 0.67);
  font-size: clamp(0.9rem, 1.3vw, 1.06rem);
  font-weight: 300;
  line-height: 1.8;
}

.kst-statement {
  max-width: 900px;
  margin: clamp(3rem, 7vw, 6rem) auto;
  padding: 0 1rem;
  text-align: center;
}

.kst-statement p {
  margin: 0;
  color: var(--kst-ivory);
  font-family: "Cormorant Upright", serif;
  font-size: clamp(1.65rem, 3.5vw, 3rem);
  font-weight: 400;
  line-height: 1.25;
}

.kst-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
}

.kst-content-grid article,
.kst-flow article {
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border: 1px solid rgba(216, 184, 106, 0.17);
  background: rgba(255, 255, 255, 0.025);
}

.kst-content-grid article > span,
.kst-flow article > span {
  color: var(--kst-gold);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.kst-content-grid h3,
.kst-details h3 {
  margin: 0.7rem 0;
  color: var(--kst-ivory);
  font-family: "Cormorant Upright", serif;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 500;
}

.kst-content-grid p,
.kst-flow p,
.kst-details-body,
.kst-network-body,
#kst-network-body > p {
  color: rgba(244, 237, 218, 0.63);
  font-size: 0.84rem;
  font-weight: 300;
  line-height: 1.75;
}

.kst-details,
.kst-cubes {
  margin: 1.2rem 0;
  border: 1px solid rgba(216, 184, 106, 0.18);
  background: rgba(4, 6, 11, 0.38);
}

.kst-details summary,
.kst-cubes summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0.9rem 1.15rem;
  color: var(--kst-gold);
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.kst-details-body {
  padding: 0.2rem clamp(1.2rem, 4vw, 3rem) 2rem;
}

.kst-details-body ol {
  display: grid;
  gap: 0.85rem;
  padding-left: 1.2rem;
}

.kst-details-body strong {
  color: var(--kst-ivory);
  font-weight: 500;
}

.kst-source-note {
  margin-top: 1.5rem;
  color: rgba(216, 184, 106, 0.72);
  font-size: 0.7rem;
}

.kst-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2rem;
}

.kst-panel-actions button {
  padding: 0.7rem 1rem;
  border-radius: 2px;
  font-size: 0.7rem;
}

.kst-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr) auto) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 2rem;
}

.kst-flow i {
  align-self: center;
  color: var(--kst-gold);
  font-style: normal;
}

.kst-flow article {
  min-width: 0;
  padding: 1.15rem;
}

.kst-flow p {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
}

.kst-network {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto clamp(3rem, 8vw, 7rem);
  border: 1px solid rgba(216, 184, 106, 0.2);
  background: linear-gradient(135deg, rgba(7, 16, 33, 0.92), rgba(29, 14, 44, 0.86));
}

.kst-network-toggle {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border: 0;
  text-align: left;
}

.kst-network-toggle small {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--kst-gold);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

.kst-network-toggle strong {
  font-family: "Cormorant Upright", serif;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 500;
}

#kst-network-body {
  padding: 0 clamp(1rem, 3vw, 2rem) 2rem;
}

.kst-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0;
}

.kst-relations button {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.68rem;
}

.kst-relations button[aria-pressed="true"] {
  color: #100c03;
  background: var(--kst-gold);
  border-color: var(--kst-gold);
}

.kst-relation-detail {
  min-height: 92px;
  padding: 1.1rem 1.25rem;
  border-left: 2px solid var(--kst-gold);
  background: rgba(0, 0, 0, 0.22);
}

.kst-relation-detail span {
  color: var(--kst-gold);
  font-family: "Cormorant Upright", serif;
  font-size: 1.35rem;
}

.kst-relation-detail p {
  margin: 0.45rem 0 0;
  color: rgba(244, 237, 218, 0.67);
  font-size: 0.78rem;
  line-height: 1.65;
}

.kst-cube-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 1rem 1.2rem;
}

.kst-cube-grid figure {
  margin: 0;
}

.kst-cube-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
  background: #000;
}

.kst-cube-grid figcaption {
  padding-top: 0.6rem;
  color: rgba(244, 237, 218, 0.58);
  font-size: 0.68rem;
  text-align: center;
}

[data-kst-native-coradi-preview="simulated"] .kst-coradi-simulation {
  margin: 0.55rem 0.75rem 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(216, 184, 106, 0.28);
  border-radius: 999px;
  color: var(--kst-gold);
  background: rgba(216, 184, 106, 0.06);
  font-family: "Montserrat", sans-serif;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: center;
}

.kst-coradi-context {
  position: fixed;
  right: 1rem;
  bottom: 7rem;
  z-index: 80;
  width: min(370px, calc(100vw - 2rem));
  padding: 1.5rem;
  border: 1px solid rgba(216, 184, 106, 0.58);
  background: linear-gradient(150deg, rgba(7, 16, 33, 0.98), rgba(35, 17, 52, 0.98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
}

.kst-coradi-context[hidden] {
  display: none !important;
}

.kst-coradi-context h2 {
  font-size: 1.7rem;
  line-height: 1.1;
}

.kst-coradi-context > p:not(.kst-kicker) {
  color: rgba(244, 237, 218, 0.69);
  font-size: 0.78rem;
  line-height: 1.65;
}

.kst-coradi-limit {
  padding-top: 0.8rem;
  border-top: 1px solid rgba(216, 184, 106, 0.18);
}

.kst-coradi-close {
  min-width: 44px;
  min-height: 44px;
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  color: var(--kst-gold);
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 920px) {
  .kst-selector-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .kst-orientation {
    grid-template-columns: 1fr;
  }

  .kst-panel-hero,
  .kst-panel-hero-social {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .kst-panel-hero img {
    max-width: 480px;
    margin: 0 auto;
  }

  .kst-flow {
    grid-template-columns: 1fr;
  }

  .kst-flow i {
    justify-self: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 720px) {
  .kst-preview-safety {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }

  .kst-trinity-selector {
    padding: 0.85rem 0.75rem 0.8rem;
  }

  .kst-selector-heading {
    margin-bottom: 0.55rem;
    align-items: center;
    flex-direction: row;
  }

  .kst-selector-heading > div {
    display: none;
  }

  .kst-coradi-inline {
    width: 100%;
    justify-content: center;
    padding-block: 0.5rem;
  }

  .kst-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .kst-tab {
    min-height: 76px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.1rem 0.25rem;
    padding: 0.5rem 0.45rem;
    font-size: 0.58rem;
    line-height: 1.25;
    letter-spacing: 0.02em;
  }

  .kst-tab span {
    font-size: 1.5rem;
  }

  .kst-tab small {
    display: none;
  }

  .kst-orientation {
    margin-top: 0.45rem;
    gap: 0;
  }

  .kst-orientation > p {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .kst-orientation-controls {
    width: 100%;
  }

  .kst-orientation-controls button {
    flex: 1;
  }

  .kst-content-grid,
  .kst-cube-grid {
    grid-template-columns: 1fr;
  }

  .kst-dimension-panel {
    width: min(100% - 1.25rem, 1180px);
    padding-top: 2.5rem;
  }

  .kst-panel-hero {
    min-height: 0;
    padding: 1.2rem;
    gap: 1.25rem;
  }

  .kst-panel-hero img {
    height: auto;
    max-height: 200px;
  }

  .kst-panel-hero h2 {
    font-size: clamp(1.8rem, 8.5vw, 2.7rem);
  }

  .kst-panel-hero > div > p:last-child {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .kst-statement {
    margin: 2.5rem auto;
  }

  .kst-panel-actions {
    display: grid;
  }

  .kst-panel-actions button {
    width: 100%;
  }

  .kst-network {
    width: calc(100% - 1.25rem);
  }

  .kst-network-toggle {
    min-height: 72px;
  }

  .kst-coradi-context {
    right: 0.625rem;
    bottom: 6.5rem;
    width: calc(100vw - 1.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-kst-preview="shuttle-trinity-v1"] {
    scroll-behavior: auto;
  }

  .kst-preview-shell *,
  .kst-coradi-context * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
