.shex-world-run-detail,
.shex-world-run-runtime {
  width: min(100%, 980px);
  margin: 0 auto;
  color: #493b55;
}

.shex-world-run-detail {
  min-height: 100%;
  padding: 16px clamp(14px, 3vw, 28px) 32px;
  background: linear-gradient(180deg, #f7f0fb 0%, #f3ecf8 100%);
}

.shex-world-run-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 16px;
}

.shex-world-run-nav button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.78);
  color: #765c88;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(85,58,102,.1);
}

.shex-world-run-nav div { display: grid; gap: 2px; min-width: 0; }
.shex-world-run-nav small { color: #9b88a8; font-size: 10px; letter-spacing: .12em; }
.shex-world-run-nav strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }

.shex-world-run-detail-hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: 28px;
  background: #8c739f;
  box-shadow: 0 20px 52px rgba(74,48,91,.18);
}

.shex-world-run-promo,
.shex-world-run-promo img,
.shex-world-run-detail-hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.shex-world-run-promo img { object-fit: cover; }
.shex-world-run-detail-hero::after { content: ''; background: linear-gradient(90deg, rgba(29,20,36,.78), rgba(29,20,36,.2)); }
.shex-world-run-detail-copy { position: relative; z-index: 1; width: min(62%, 520px); padding: clamp(28px, 6vw, 64px); color: #fff; }
.shex-world-run-detail-copy > span,
.shex-world-run-runtime-kind { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(255,255,255,.26); border-radius: 999px; font-size: 10px; letter-spacing: .08em; }
.shex-world-run-detail-copy h1 { margin: 16px 0 10px; font: 600 clamp(28px, 5vw, 46px)/1.16 Georgia, 'Source Han Serif SC', serif; }
.shex-world-run-detail-copy p { margin: 0 0 18px; line-height: 1.8; }
.shex-world-run-detail-copy small { color: rgba(255,255,255,.82); }

.shex-world-run-start {
  display: block;
  width: min(100%, 420px);
  min-height: 52px;
  margin: 22px auto 0;
  border: 0;
  border-radius: 18px;
  background: #86649c;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 14px 30px rgba(100,70,119,.2);
}
.shex-world-run-start:disabled { opacity: .58; }
.shex-world-run-message { margin: 16px 0 0; padding: 11px 14px; border-radius: 14px; text-align: center; }
.shex-world-run-message.is-error { background: #fff0f2; color: #b14355; }

.shex-world-run-runtime {
  position: relative;
  min-height: min(82vh, 820px);
  overflow: hidden;
  border-radius: 28px;
  background: #665271;
  color: #fff;
  isolation: isolate;
}
.shex-world-run-background { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shex-world-run-runtime-shade { position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(22,16,27,.18), rgba(22,16,27,.84)); }
.shex-world-run-runtime-nav { padding: 16px 20px; }
.shex-world-run-runtime-nav button { background: rgba(28,20,34,.42); color: #fff; }
.shex-world-run-runtime-nav small { color: rgba(255,255,255,.68); }
.shex-world-run-runtime-content { position: absolute; top: 82px; right: clamp(22px, 6vw, 70px); bottom: 126px; left: clamp(22px, 6vw, 70px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; }
.shex-world-run-runtime-content h1 { margin: 16px 0 8px; font: 600 clamp(30px, 6vw, 54px)/1.14 Georgia, 'Source Han Serif SC', serif; }
.shex-world-run-position { display: flex; flex-wrap: wrap; gap: 8px; color: rgba(255,255,255,.86); }
.shex-world-run-heading h1 { margin-top: 10px; font-size: clamp(24px, 5vw, 42px); }
.shex-world-run-conversation { min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; scrollbar-width: thin; }
.shex-world-run-bubble { width: min(82%, 620px); padding: 10px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 16px; background: rgba(24,17,29,.46); backdrop-filter: blur(10px); }
.shex-world-run-bubble.is-user { align-self: flex-end; background: rgba(133,98,154,.72); }
.shex-world-run-bubble small { color: rgba(255,255,255,.68); font-size: 10px; }
.shex-world-run-bubble p { margin: 4px 0 0; line-height: 1.65; white-space: pre-wrap; }
.shex-world-run-conversation-empty { margin: auto; color: rgba(255,255,255,.68); }
.shex-world-run-runtime-footer { position: absolute; right: 22px; bottom: 18px; left: 22px; display: flex; gap: 10px; align-items: stretch; }
.shex-world-run-runtime-footer form { display: flex; flex: 1; gap: 8px; min-width: 0; }
.shex-world-run-runtime-footer label { flex: 1; min-width: 0; }
.shex-world-run-runtime-footer textarea { width: 100%; height: 50px; resize: none; padding: 11px 13px; border: 1px solid rgba(255,255,255,.28); border-radius: 15px; background: rgba(22,16,27,.52); color: #fff; }
.shex-world-run-runtime-footer button { min-height: 46px; padding: 0 17px; border: 1px solid rgba(255,255,255,.28); border-radius: 16px; background: rgba(22,16,27,.48); color: #fff; }
.shex-world-run-runtime-footer [data-world-run-send] { background: rgba(137,101,159,.9); }
.shex-world-run-runtime-footer .shex-world-run-leave { flex: 0 0 auto; }
.shex-world-run-media-fallback { display: grid; place-items: center; background: linear-gradient(145deg, #b9a2c8, #765d88); color: rgba(255,255,255,.78); font: 600 74px/1 Georgia, serif; }

@media (max-width: 700px) {
  .shex-world-run-detail { padding: 12px 12px 26px; }
  .shex-world-run-detail-hero { min-height: 440px; border-radius: 22px; }
  .shex-world-run-detail-hero::after { background: linear-gradient(180deg, rgba(29,20,36,.08), rgba(29,20,36,.9)); }
  .shex-world-run-detail-copy { position: absolute; right: 0; bottom: 0; left: 0; width: auto; padding: 24px 20px; }
  .shex-world-run-runtime { width: 100%; min-height: calc(100dvh - 28px); border-radius: 0; }
  .shex-world-run-runtime-content { top: 78px; right: 16px; bottom: 132px; left: 16px; }
  .shex-world-run-heading h1 { font-size: 24px; }
  .shex-world-run-bubble { width: 90%; }
  .shex-world-run-runtime-footer { right: 12px; bottom: 12px; left: 12px; gap: 6px; }
  .shex-world-run-runtime-footer button { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .shex-world-run-start,
  .shex-world-run-nav button { scroll-behavior: auto; }
}
