/* frontend/css/simulation.css */

body.app-booting {
  overflow: hidden;
  background: var(--theme-root-bg, #030711);
}

body.app-booting .page {
  max-width: none;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

@supports (height: 100svh) {
  body.app-booting .page {
    height: 100svh;
  }
}

@supports (height: 100dvh) {
  body.app-booting .page {
    height: 100dvh;
  }
}

body.app-booting #chat,
body.app-booting footer,
body.app-booting .floating-menu-stack {
  opacity: 0;
  pointer-events: none;
}

#chat.simulation-mode {
  position: relative;
  padding: 0;
  gap: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

@supports (height: 100svh) {
  #chat.simulation-mode {
    height: 100svh;
  }
}

@supports (height: 100dvh) {
  #chat.simulation-mode {
    height: 100dvh;
  }
}

body:has(#chat.simulation-mode) {
  overflow: hidden;
  background: var(--theme-root-bg, #030711);
}

body:has(#chat.simulation-mode) .app-shell,
body:has(#chat.simulation-mode) .main {
  background: var(--theme-root-bg, #030711);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.app-route-map:has(#chat.simulation-mode) .page {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  background: var(--theme-root-bg, #030711);
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

body:has(#chat.simulation-mode) header:not(.app-eve-list-header):not(.app-my-header):not(.app-my-subheader):not(.app-companion-header) {
  height: calc(58px + env(safe-area-inset-top, 0px));
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  color: rgba(30, 31, 35, 0.9);
  background: linear-gradient(180deg, rgba(247, 245, 242, 0.88), rgba(247, 245, 242, 0));
  border-bottom: 1px solid rgba(220, 218, 214, 0.5);
  box-shadow: none;
}

body:has(#chat.simulation-mode) .top-left,
body:has(#chat.simulation-mode) .icon-btn,
body:has(#chat.simulation-mode) .auth-btn {
  color: rgba(30, 30, 35, 0.88);
}

body:has(#chat.simulation-mode) .top-left-wrap {
  padding-left: 58px;
}

body:has(#chat.simulation-mode) .auth-btn {
  background: rgba(247, 245, 242, 0.78);
  border-color: rgba(220, 218, 214, 0.58);
  box-shadow: 0 0 18px rgba(255, 90, 60, 0.12);
}

.simulation-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .simulation-shell {
    height: 100%;
    min-height: 0;
  }
}

.journey-root {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--theme-root-bg, #171d31);
}

@supports (height: 100dvh) {
  .journey-root {
    height: 100%;
    min-height: 0;
  }
}

.journey-root::before {
  content: "";
  position: absolute;
  left: -48px;
  right: -48px;
  top: 0;
  height: 420px;
  pointer-events: none;
  background: var(--theme-root-top-cloud-bg, url("/frontend/assets/pink_cloud_fog_top_screen.png") center top / auto 620px repeat-x);
  opacity: var(--theme-root-top-cloud-opacity, 0.72);
  filter: var(--theme-root-top-cloud-filter, none);
  transform: translate3d(0, 0, 0);
  animation: journeyRootCloudDrift var(--theme-root-top-cloud-drift-duration, 38s) ease-in-out infinite alternate;
  animation-delay: var(--journey-world-animation-offset, 0ms);
  will-change: transform;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.46) 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 64%, rgba(0, 0, 0, 0.46) 84%, transparent 100%);
  z-index: 2;
}

.journey-root::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--theme-root-atmosphere-bg,
    radial-gradient(ellipse at 50% 0%, rgba(226, 236, 252, 0.24), transparent 62%),
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 28%,
      rgba(255, 247, 244, 0.1) 36%,
      rgba(255, 249, 248, 0.3) 47%,
      rgba(232, 239, 250, 0.1) 55%,
      transparent 62%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      rgba(224, 234, 249, 0.84) 0%,
      rgba(202, 216, 237, 0.7) 34%,
      rgba(164, 184, 216, 0.54) 64%,
      rgba(104, 130, 174, 0.34) 84%,
      rgba(42, 58, 96, 0.2) 96%,
      transparent 100%
    ));
  opacity: 1;
}

.journey-world-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: auto;
  transform-origin: 50% 62%;
  transition:
    transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 260ms ease,
    filter 260ms ease;
}

.journey-ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0;
  pointer-events: none;
}

.journey-ui-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 36;
  pointer-events: none;
  background: rgba(132, 136, 142, 0.44);
  opacity: 0;
  backdrop-filter: grayscale(1) brightness(0.72) contrast(0.9) blur(2px);
  -webkit-backdrop-filter: grayscale(1) brightness(0.72) contrast(0.9) blur(2px);
  transition: opacity 0.18s ease;
}

.journey-ui-overlay > * {
  pointer-events: auto;
}

.journey-detail-dim {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  background: rgba(17, 17, 17, 0.22);
  opacity: 0;
  transition: opacity 220ms ease;
}

.journey-node-content-card,
.journey-choice-panel-card,
.journey-input-bar .input-wrapper,
.simulation-nav-btn {
  clip-path: polygon(
    14px 0,
    calc(100% - 14px) 0,
    100% 14px,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    14px 100%,
    0 calc(100% - 14px),
    0 14px
  );
}

.journey-header {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding:
    max(16px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(18px, env(safe-area-inset-right, 0px))
    0
    max(18px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.journey-header-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.journey-header :is(button, a, input, textarea, select, [role="button"]),
.journey-toolbar,
.journey-map-toggle {
  pointer-events: auto;
}

.journey-header-kicker {
  display: grid;
  gap: 1px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: 0;
  text-transform: none;
  color: var(--theme-header-kicker, rgba(17, 17, 17, 0.48));
  text-shadow: none;
  padding-left: 44px;
  transform: translateY(1px);
}

.journey-header-kicker span:first-child {
  font-size: 12px;
  font-weight: 620;
}

.journey-header-kicker span:last-child {
  font-size: 10.5px;
  font-weight: 520;
}

.journey-toolbar {
  margin-top: 12px;
}

.journey-node-content {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 18px 12px;
  min-height: 0;
  transition: transform 0.22s ease;
}

.journey-node-content.hidden {
  display: none !important;
}

.journey-root[data-view-mode="overview"] .journey-ui-overlay {
  pointer-events: none;
}

.journey-root[data-view-mode="overview"] .journey-world-layer {
  z-index: 8;
  pointer-events: auto;
}

.journey-root[data-view-mode="overview"] .journey-header {
  pointer-events: auto;
}

.journey-root[data-motion-state="forecasting"] .journey-world-layer {
  z-index: 1;
  transform: translate3d(0, 58px, 0);
  opacity: 0.82;
  filter: saturate(0.92) brightness(1.04);
}

.journey-root[data-motion-state="revealing"] .journey-world-layer {
  z-index: 1;
  transform: translate3d(0, 0, 0);
  opacity: 0.9;
  filter: saturate(0.96) brightness(1.04);
  animation: journeyMapRevealReturn 1.35s 260ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
}

.journey-root[data-motion-state="forecasting"] .journey-ui-overlay,
.journey-root[data-motion-state="revealing"] .journey-ui-overlay {
  z-index: 12;
}

.journey-root[data-motion-state="closing"] .journey-node-content-card,
.journey-root[data-motion-state="closing"] .journey-choice-panel-card {
  animation: journeyContentExit 180ms ease-in both;
}

.journey-root[data-motion-state="idle"] .journey-node-content-card {
  animation: journeyContentEnter 320ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
}

.journey-root[data-motion-state="page-loading"] .journey-node-content-card {
  opacity: 0.58;
  filter: grayscale(0.92) brightness(1.08);
  pointer-events: none;
}

@keyframes journeyMapRevealReturn {
  0%,
  58% {
    transform: translate3d(0, 0, 0);
    opacity: 0.9;
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes journeyContentExit {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.96);
    filter: blur(4px);
  }
}

@keyframes journeyContentEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.96);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}



.journey-forecasting {
  display: none !important;
}

.journey-forecasting.hidden {
  display: none !important;
}

.journey-page-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 108px;
  height: 44px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body.eve-v2-rollout .journey-page-loading {
  flex-direction: column;
  gap: 12px;
  width: min(360px, calc(100vw - 48px));
  height: auto;
  min-height: 72px;
}

.journey-page-loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.journey-page-loading-copy {
  display: none;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(20, 29, 38, 0.4);
}

body.eve-v2-rollout .journey-page-loading-copy {
  display: inline;
}

.journey-page-loading.hidden {
  display: none !important;
}

.journey-page-loading-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.68),
    0 0 18px rgba(255, 255, 255, 0.32);
}

.side-quest-star-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 14, 20, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.side-quest-star-modal {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 26px;
  color: rgba(249, 252, 255, 0.96);
  background:
    radial-gradient(circle at 50% 24%, rgba(124, 168, 218, 0.22), transparent 38%),
    linear-gradient(160deg, rgba(31, 39, 51, 0.98), rgba(15, 20, 29, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.side-quest-star-modal-kicker,
.side-quest-star-modal-meta {
  color: rgba(218, 231, 245, 0.68);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.side-quest-star-modal h2 {
  margin: 8px 0 16px;
  font-size: clamp(22px, 5vw, 30px);
}

.side-quest-star-modal-symbol {
  margin: 0 auto 10px;
  color: #fff;
  font-size: 54px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.9), 0 0 38px rgba(126, 178, 235, 0.72);
}

.side-quest-star-modal h3 {
  margin: 0;
  font-size: 18px;
}

.side-quest-star-modal p {
  margin: 12px auto;
  max-width: 34em;
  color: rgba(235, 242, 249, 0.8);
  font-size: 14px;
  line-height: 1.7;
}

.side-quest-star-modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.side-quest-star-modal-actions button {
  min-width: 116px;
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  font: inherit;
}

.side-quest-star-modal-primary {
  border: 1px solid rgba(255, 255, 255, 0.82);
  color: #17202b;
  background: rgba(255, 255, 255, 0.94);
}

.side-quest-star-modal-secondary {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(249, 252, 255, 0.86);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 520px) {
  .side-quest-star-modal { padding: 24px 20px; }
  .side-quest-star-modal-actions { flex-direction: column; }
  .side-quest-star-modal-actions button { width: 100%; }
}

.journey-forecasting::before {
  content: "";
  position: absolute;
  width: min(24vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.58), transparent 64%);
  filter: blur(13px);
  opacity: 0.74;
}

.journey-forecasting-ring {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.94);
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.24),
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0)
  );
  box-shadow:
    0 0 14px rgba(255, 255, 255, 0.78),
    0 0 28px rgba(255, 255, 255, 0.34);
  animation: journeyForecastSpin 1.05s linear infinite;
}

.journey-forecasting-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: rgba(247, 245, 242, 0.76);
  border: 1px solid rgba(255, 196, 170, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes journeyForecastSpin {
  to {
    transform: rotate(360deg);
  }
}

.journey-choice-panel {
  position: relative;
  z-index: 45;
  display: flex;
  justify-content: center;
  padding: 0 18px 14px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.journey-choice-panel.hidden {
  display: none !important;
}

.journey-choice-panel-card {
  width: min(680px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--theme-panel-bg, rgba(31, 38, 50, 0.28));
  border: 1px solid var(--theme-panel-border, rgba(255, 255, 255, 0.7));
  box-shadow: var(--theme-choice-panel-shadow,
    0 0 0 1px rgba(255, 255, 255, 0.58),
    0 0 22px var(--theme-panel-glow, rgba(255, 90, 60, 0.15)),
    0 16px 36px rgba(120, 96, 92, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.48));
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  padding: 12px;
  transform: translateY(-2px);
}

.journey-input-bar {
  position: relative;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 18px max(8px, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.journey-input-bar.hidden {
  display: none !important;
}

.journey-input-bar .input-wrapper {
  width: min(720px, calc(100vw - 36px));
  min-height: 58px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  clip-path: none;
}

.journey-input-bar #input {
  background: transparent;
  border: none;
  color: var(--theme-input-text, rgba(244, 247, 255, 0.92));
  box-shadow: var(--theme-input-shadow,
    0 0 0 0.75px rgba(255, 238, 228, 0.5),
    0 0 16px rgba(255, 111, 86, 0.18),
    0 0 42px rgba(255, 142, 122, 0.11),
    0 0 82px rgba(255, 181, 168, 0.07),
    0 10px 28px rgba(120, 96, 92, 0.12),
    inset 0 0 0 0.75px rgba(255, 238, 228, 0.22),
    inset 0 0 16px rgba(255, 106, 86, 0.09),
    inset 0 0 32px rgba(255, 137, 122, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.58));
  min-height: 46px;
}

.journey-input-bar #input::placeholder {
  color: var(--theme-input-placeholder, rgba(226, 232, 240, 0.54));
}

@keyframes journeyRootCloudDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(var(--theme-root-top-cloud-drift-x, 18px), 0, 0);
  }
}

body:has(#historyPanelModal:not(.hidden)) .journey-input-bar {
  display: none !important;
}

body:has(.journey-root[data-view-mode="overview"]) .journey-input-bar,
body:has(.journey-root[data-motion-state="closing"]) .journey-input-bar,
body:has(.journey-root[data-motion-state="forecasting"]) .journey-input-bar,
body:has(.journey-root[data-motion-state="revealing"]) .journey-input-bar,
body:has(.simulation-history-meta:not(.hidden)) .journey-input-bar {
  display: none !important;
}

.journey-input-bar #input:focus {
  border: none;
  background: transparent;
  box-shadow: var(--theme-input-focus-shadow,
    0 0 0 0.75px rgba(255, 244, 238, 0.62),
    0 0 16px rgba(255, 97, 86, 0.2),
    0 0 38px rgba(255, 137, 122, 0.12),
    inset 0 0 0 0.75px rgba(255, 244, 238, 0.36),
    inset 0 0 18px rgba(255, 244, 236, 0.24),
    inset 0 0 30px rgba(255, 86, 92, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.62));
}

.journey-input-bar #send {
  background: var(--theme-send-bg, rgba(255, 86, 74, 0.479));
  color: var(--theme-send-text, rgba(255, 248, 240, 0.96));
  box-shadow: var(--theme-send-shadow,
    inset 0 0 14px rgba(255, 86, 74, 0.28),
    inset 0 0 28px rgba(255, 122, 116, 0.14),
    0 0 18px rgba(255, 86, 74, 0.34),
    0 0 34px rgba(255, 86, 74, 0.18),
    0 8px 18px rgba(94, 42, 29, 0.28));
}

.journey-input-bar #send svg {
  fill: currentColor;
  transform: rotate(-18deg) translate(1px, -1px);
  transform-origin: 50% 50%;
  filter: var(--theme-send-icon-filter,
    drop-shadow(0 0 3px rgba(255, 248, 240, 0.58))
    drop-shadow(0 0 8px rgba(255, 86, 74, 0.28)));
}

.journey-input-bar #send:hover {
  background: var(--theme-send-bg-hover, rgba(248, 69, 45, 0.692));
  box-shadow: var(--theme-send-hover-shadow,
    inset 0 0 16px rgba(255, 86, 74, 0.34),
    inset 0 0 30px rgba(255, 122, 116, 0.18),
    0 0 20px rgba(255, 86, 74, 0.4),
    0 0 38px rgba(255, 86, 74, 0.22),
    0 8px 18px rgba(94, 42, 29, 0.28));
}

.journey-node-content-card {
  width: min(720px, calc(100vw - 36px));
  max-height: min(46vh, 410px);
  display: flex;
  flex-direction: column;
  background: var(--theme-panel-bg, rgba(31, 38, 50, 0.28));
  border: 0;
  box-shadow: var(--theme-content-panel-shadow,
    0 0 0 1px var(--theme-panel-edge, rgba(255, 238, 228, 0.58)),
    0 0 18px rgba(253, 118, 100, 0.2),
    0 0 48px rgba(255, 146, 131, 0.13),
    0 0 92px rgba(252, 190, 182, 0.075),
    0 22px 48px rgba(7, 12, 20, 0.18),
    inset 0 0 0 1px rgba(255, 238, 228, 0.3),
    inset 0 0 18px rgba(255, 106, 86, 0.1),
    inset 0 0 38px rgba(255, 137, 122, 0.06),
    inset 0 1px 0 rgba(255, 230, 218, 0.35));
  backdrop-filter: blur(20px) saturate(1.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.16);
  clip-path: polygon(
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px),
    0 18px
  );
  overflow: hidden;
}

.journey-choice-panel-card::before,

.journey-title-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.journey-title-frame-glow,
.journey-title-frame-edge {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
  stroke-linecap: square;
}

.journey-title-frame-glow {
  stroke: rgba(255, 120, 102, 0.24);
  stroke-width: 7;
}

.journey-title-frame-edge {
  stroke: rgba(255, 196, 188, 0.76);
  stroke-width: 1.1;
}

.simulation-title-line,
.simulation-subtitle,
.simulation-counter {
  position: relative;
  z-index: 1;
}
.journey-input-bar .input-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
  box-shadow:
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.32),
    inset 0 0 14px rgba(255, 106, 86, 0.08),
    0 0 16px rgba(255, 111, 86, 0.16);
  opacity: 1;
}

.journey-node-content-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  box-shadow:
    inset 0 0 18px rgba(255, 106, 86, 0.14),
    inset 0 0 42px rgba(255, 137, 122, 0.08),
    inset 0 0 76px rgba(252, 190, 182, 0.045);
  opacity: 1;
}


.journey-node-content-card::after {
  display: none;
}

.journey-content-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.journey-content-frame-glow,
.journey-content-frame-edge,
.journey-content-frame-corner {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
  stroke-linecap: square;
}

.journey-content-frame-glow {
  display: none;
}

.journey-content-frame-edge {
  stroke: rgba(255, 238, 228, 0.86);
  stroke-width: 0.75;
}

.journey-content-frame-corner {
  stroke: rgba(255, 238, 228, 0.68);
  stroke-width: 1.8;
}

.journey-node-content-scroll,
.journey-node-content-more {
  position: relative;
  z-index: 1;
}

.simulation-toolbar-center::before {
  display: none;
}

.simulation-toolbar-center::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--theme-toolbar-bg, rgba(70, 76, 88, 0.2));
  box-shadow: var(--theme-toolbar-shadow,
    0 8px 22px rgba(18, 24, 36, 0.12),
    inset 0 0 18px rgba(255, 255, 255, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
  filter: none;
}


.journey-title-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.journey-title-frame-glow,
.journey-title-frame-edge {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
  stroke-linecap: square;
}

.journey-title-frame-glow {
  stroke: rgba(255, 106, 92, 0.1);
  stroke-width: 7;
}

.journey-title-frame-edge {
  stroke: rgba(255, 106, 92, 0.3);
  stroke-width: 1.1;
}

.simulation-title-line,
.simulation-subtitle,
.simulation-counter {
  position: relative;
  z-index: 1;
}
.journey-input-bar .input-wrapper::before {
  display: none;
}

.journey-node-content-card,
.journey-choice-panel-card,
.journey-input-bar .input-wrapper,
.simulation-toolbar-center {
  position: relative;
}

.journey-node-content-summarybar {
  display: none;
  padding: 13px 16px 11px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(109, 109, 118, 0.78);
  border-bottom: 1px solid rgba(255, 236, 229, 0.14);
  background: linear-gradient(90deg, rgba(255, 90, 60, 0.12), transparent 60%);
}

.journey-node-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-color: rgba(226, 232, 240, 0.28) transparent;
}

.journey-node-content-card.is-origin-question {
  max-height: min(30vh, 230px);
}

.journey-node-content-scroll.is-origin-question {
  min-height: 104px;
  justify-content: flex-start;
  padding: 22px 30px 18px;
}

.simulation-turn-origin {
  display: flex;
  width: 100%;
  min-height: 68px;
  margin-block: auto;
  align-items: center;
  justify-content: center;
}

.journey-origin-question {
  width: min(100%, 560px);
  color: var(--theme-text-main, rgba(238, 242, 248, 0.96));
  text-align: center;
  text-shadow: 0 1px 3px rgba(8, 12, 20, 0.18);
}

.journey-origin-question p {
  margin: 0;
  font-size: 17px;
  line-height: 1.68;
  font-weight: 560;
  letter-spacing: 0;
}

.journey-origin-question p + p {
  margin-top: 10px;
}

.journey-node-content-scroll::-webkit-scrollbar {
  width: 7px;
}

.journey-node-content-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.journey-node-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(226, 232, 240, 0.24);
  border-radius: 999px;
}

.journey-node-content-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(226, 232, 240, 0.34);
}

.journey-node-content-more {
  flex: 0 0 auto;
  padding: 0 16px 13px;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(226, 232, 240, 0.54);
  text-align: center;
  letter-spacing: 0.04em;
  text-shadow: var(--theme-content-more-shadow, 0 0 10px rgba(255, 90, 60, 0.18));
}

.journey-node-content-more.hidden {
  display: none !important;
}

.journey-node-ai-copy {
  width: 100%;
  color: var(--theme-text-main, rgba(238, 242, 248, 0.94));
}

.journey-node-ai-copy p {
  margin: 0;
  font-size: 16px;
  line-height: 1.78;
  letter-spacing: 0.01em;
  color: var(--theme-text-main, rgba(238, 242, 248, 0.94));
  text-shadow: 0 1px 3px rgba(8, 12, 20, 0.18);
}

.journey-node-ai-copy p + p {
  margin-top: 18px;
}

.journey-node-choice-trace {
  display: grid;
  gap: 8px;
  width: min(100%, 560px);
}

.journey-node-inline-choices {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding-bottom: 2px;
}

.journey-node-choice-trace-item {
  padding: 9px 13px;
  border: 1px solid rgba(255, 226, 210, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(226, 232, 240, 0.68);
  font-size: 13px;
  line-height: 1.48;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.journey-node-choice-trace-item.is-selected {
  border-color: rgba(255, 226, 210, 0.54);
  background:
    linear-gradient(90deg, rgba(255, 116, 76, 0.2), rgba(255, 226, 210, 0.08)),
    rgba(255, 255, 255, 0.06);
  color: rgba(255, 244, 235, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 226, 210, 0.12),
    0 0 16px rgba(255, 116, 76, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.journey-node-choice-trace-item.is-free {
  border-style: dashed;
}

.simulation-action-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  pointer-events: none;
  transition: transform 0.22s ease;
}

body.app-route-map.app-map-tabs-visible #chat.simulation-mode .journey-dashboard-panel {
  --journey-dashboard-panel-y: calc(-1 * var(--app-tab-height));
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .app-bottom-tabs,
body.app-route-map:has(#chat.simulation-mode .journey-input-bar:not(.hidden)) .app-bottom-tabs {
  transform: translateY(calc(100% + 8px)) !important;
  opacity: 0;
  pointer-events: none;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) footer,
body.app-route-map:has(#chat.simulation-mode .journey-input-bar:not(.hidden)) footer {
  bottom: max(0px, env(safe-area-inset-bottom));
}

body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .app-bottom-tabs {
  transform: translateY(calc(100% + 8px)) !important;
  opacity: 0;
  pointer-events: none;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-ui-overlay::before,
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-ui-overlay::before,
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-ui-overlay::before {
  opacity: 1;
  pointer-events: auto;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-node-content,
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-node-content,
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-node-content {
  z-index: 48;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-input-bar,
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-input-bar,
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-input-bar {
  z-index: 52;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) :is(.journey-world-layer, .journey-header, .journey-dashboard, .simulation-action-area, .floating-menu-stack, .app-menu-floating-slot, .app-bottom-tabs),
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) :is(.journey-world-layer, .journey-header, .floating-menu-stack, .app-menu-floating-slot),
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) :is(.journey-world-layer, .journey-header, .floating-menu-stack, .app-menu-floating-slot) {
  pointer-events: none !important;
  filter: grayscale(1) brightness(0.72) contrast(0.9);
}

.simulation-action-area > * {
  pointer-events: auto;
}

.simulation-toolbar,
.journey-toolbar {
  position: relative;
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.simulation-nav-btn {
  width: 0;
  height: 0;
  border: none;
  background: transparent;
  color: rgba(30, 30, 35, 0.84);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.simulation-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.simulation-toolbar-center {
  z-index: 91;
  isolation: isolate;
  text-align: center;
  width: min(100%, 1040px);
  margin: 0 auto;
  min-width: 0;
  padding: 7px 32px 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: var(--theme-toolbar-filter, none);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  clip-path: none;
}

.simulation-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(109, 109, 118, 0.72);
  text-transform: uppercase;
}

.simulation-title-line {
  display: flex;
  position: relative;
  z-index: 92;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
}

.simulation-title-text {
  position: relative;
  z-index: 93;
  font-size: 18px;
  font-weight: 500;
  color: var(--theme-title-text, rgba(255, 255, 255, 0.96));
  text-shadow: var(--theme-title-text-shadow,
    0 1px 3px rgba(38, 42, 56, 0.24),
    0 0 8px rgba(255, 238, 228, 0.12));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(60vw, 420px);
}

.simulation-title-edit-btn {
  width: 24px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--theme-title-text, rgba(255, 255, 255, 0.96));
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-1px);
  text-shadow: var(--theme-title-text-shadow,
    0 1px 3px rgba(38, 42, 56, 0.24),
    0 0 8px rgba(255, 238, 228, 0.12));
}

.simulation-title-edit-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
}

.simulation-title-edit-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  filter:
    drop-shadow(0 1px 4px rgba(76, 88, 108, 0.32))
    drop-shadow(0 0 12px rgba(76, 88, 108, 0.24))
    drop-shadow(0 0 20px rgba(255, 255, 255, 0.28));
}


.simulation-counter {
  display: none !important;
  font-size: 11px;
  color: rgba(255, 238, 228, 0.62);
  letter-spacing: 0.04em;
}

.simulation-history-meta {
  display: none !important;
}

.simulation-history-meta.hidden {
  display: none !important;
}

.simulation-body {
  display: flex;
  align-items: flex-end;
  min-height: 100%;
}

.simulation-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.simulation-turn-user,
.simulation-turn-ai {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.simulation-turn-user {
  align-items: flex-end;
}

.simulation-user-text {
  max-width: min(100%, 240px);
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    rgba(17, 24, 39, 0.34);
  border: 1px solid rgba(255, 226, 210, 0.2);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  font-size: 15px;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    0 0 26px rgba(255, 135, 98, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.simulation-user-text p {
  margin: 0;
}

.simulation-user-text p + p {
  margin-top: 12px;
}

.simulation-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.simulation-inline-icon-btn {
  border: none;
  background: transparent;
  color: rgba(103, 83, 76, 0.72);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.simulation-inline-icon-btn:hover {
  color: #3b2f2b;
}

.simulation-card {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #1d1e24;
  box-shadow: none;
}

.simulation-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.82;
  letter-spacing: 0.01em;
}

.simulation-card p + p {
  margin-top: 18px;
}

.simulation-choices {
  position: static;
  background: transparent;
  backdrop-filter: none;
  padding-top: 0;
  margin-top: -10px;
}

.simulation-choices.hidden {
  display: none !important;
}

.simulation-choice-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
}

.simulation-choice-btn {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 238, 228, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.025),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 16px rgba(255, 135, 98, 0.06);
}

.simulation-choice-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 226, 210, 0.52);
  background:
    linear-gradient(90deg, rgba(255, 116, 76, 0.2), rgba(255, 226, 210, 0.08)),
    rgba(255, 255, 255, 0.045);
  color: rgba(255, 244, 235, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 226, 210, 0.1),
    0 0 16px rgba(255, 116, 76, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.simulation-choice-btn:active,
.simulation-choice-btn.is-selected {
  border-color: rgba(255, 226, 210, 0.58);
  background:
    linear-gradient(90deg, rgba(255, 116, 76, 0.24), rgba(255, 226, 210, 0.1)),
    rgba(255, 255, 255, 0.05);
  color: rgba(255, 244, 235, 0.98);
}

.simulation-free-option {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.4;
  padding: 0 4px;
  white-space: nowrap;
}

.simulation-history-footer {
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  width: 100%;
  padding: 0 max(18px, calc(env(safe-area-inset-right) + 18px))
    max(20px, calc(env(safe-area-inset-bottom) + 20px)) 18px;
  pointer-events: none;
}

.simulation-history-footer.hidden {
  display: none;
}

.simulation-history-footer .simulation-back-latest-wrap,
.simulation-history-footer .simulation-back-latest-link {
  pointer-events: auto;
}

.simulation-branch-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.simulation-branch-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 90, 60, 0.12);
  background: rgba(255, 251, 248, 0.94);
  color: #374151;
  font-size: 14px;
  cursor: pointer;
}

.simulation-branch-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 24, 39, 0.14);
}

.simulation-back-latest-wrap {
  display: flex;
  justify-content: flex-end;
}

.simulation-back-latest-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  min-height: 34px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 246, 224, 0.94);
  box-shadow: none;
  text-shadow:
    0 1px 0 rgba(48, 31, 14, 0.9),
    0 2px 6px rgba(28, 18, 10, 0.62);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    color 180ms ease,
    text-shadow 180ms ease;
}

.simulation-back-latest-link:hover {
  transform: translateY(-1px);
  background: transparent;
  color: rgba(255, 250, 235, 0.98);
  box-shadow: none;
  text-shadow:
    0 1px 0 rgba(48, 31, 14, 0.96),
    0 2px 7px rgba(28, 18, 10, 0.72),
    0 0 9px rgba(255, 246, 220, 0.3);
}

.simulation-back-latest-arrow {
  font-size: 15px;
  line-height: 1;
}

.simulation-back-latest-text {
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

:root[data-theme="silver"] .journey-title-frame-glow {
  stroke: rgba(174, 188, 206, 0.28);
}

:root[data-theme="silver"] .journey-title-frame-edge,
:root[data-theme="silver"] .journey-content-frame-edge {
  stroke: rgba(216, 226, 238, 0.82);
}

:root[data-theme="silver"] .simulation-title-edit-btn {
  color: rgba(108, 120, 138, 0.76);
}

:root[data-theme="silver"] .simulation-title-edit-btn:hover {
  color: rgba(76, 86, 104, 0.92);
}

:root[data-theme="silver"] .journey-content-frame-corner {
  stroke: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.42));
}

:root[data-theme="silver"] .journey-input-bar .input-wrapper::before {
  box-shadow:
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.34),
    inset 0 0 14px rgba(226, 234, 242, 0.1),
    0 0 16px rgba(255, 255, 255, 0.18);
}

:root[data-theme="silver"] .journey-node-content-card::before {
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.16),
    inset 0 0 42px rgba(226, 234, 242, 0.1),
    inset 0 0 76px rgba(190, 202, 218, 0.055);
}

:root[data-theme="silver"] .journey-node-content-summarybar {
  border-bottom-color: rgba(226, 234, 242, 0.18);
  background: linear-gradient(90deg, rgba(226, 234, 242, 0.16), transparent 60%);
}

:root[data-theme="silver"] .journey-node-choice-trace-item {
  border-color: rgba(226, 234, 242, 0.22);
  color: rgba(88, 98, 112, 0.74);
  background: rgba(255, 255, 255, 0.12);
}

:root[data-theme="silver"] .journey-node-choice-trace-item.is-selected,
:root[data-theme="silver"] .simulation-choice-btn:hover,
:root[data-theme="silver"] .simulation-choice-btn:active,
:root[data-theme="silver"] .simulation-choice-btn.is-selected {
  border-color: rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(90deg, rgba(226, 234, 242, 0.28), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.16);
  color: rgba(70, 80, 94, 0.94);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 16px rgba(226, 234, 242, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

:root[data-theme="silver"] .simulation-user-text {
  border-color: rgba(226, 234, 242, 0.28);
  box-shadow:
    0 14px 30px rgba(112, 128, 148, 0.16),
    0 0 26px rgba(226, 234, 242, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

:root[data-theme="silver"] .simulation-choice-btn {
  border-color: rgba(255, 255, 255, 0.72);
  color: rgba(58, 68, 84, 0.94);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(226, 234, 242, 0.18)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 8px 18px rgba(112, 128, 148, 0.1),
    0 0 18px rgba(226, 234, 242, 0.16);
}

:root[data-theme="silver"] .simulation-branch-btn {
  border-color: rgba(226, 234, 242, 0.3);
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="warm-horizon"] .journey-root[data-motion-state="forecasting"] .journey-world-layer {
  z-index: 8 !important;
  transform: translate3d(0, 0, 0) !important;
  opacity: 1 !important;
  filter: saturate(1) brightness(1) contrast(1.04) !important;
}

:root[data-theme="warm-horizon"] .journey-root[data-motion-state="revealing"] .journey-world-layer {
  z-index: 8 !important;
  transform: translate3d(0, 0, 0) !important;
  opacity: 1 !important;
  filter: saturate(1) brightness(1) contrast(1.04) !important;
}

:root[data-theme="warm-horizon"] .journey-root[data-view-mode="overview"] .journey-world-layer {
  opacity: 1 !important;
  filter: saturate(1) brightness(1) contrast(1.04) !important;
}

:root[data-theme="warm-horizon"] .journey-cloud-layers {
  z-index: 0;
  -webkit-mask-image: none;
  mask-image: none;
}

:root[data-theme="warm-horizon"] .journey-cloud-layer-red {
  z-index: 0;
  opacity: 1;
}

:root[data-theme="warm-horizon"] .journey-cloud-layer-top {
  display: none;
}

:root[data-theme="warm-horizon"] .journey-cloud-layer-soft {
  display: none;
}

:root[data-theme="warm-horizon"] .journey-cloud-layer-transition,
:root[data-theme="warm-horizon"] .journey-mountain-layers,
:root[data-theme="warm-horizon"] .journey-world::after {
  display: none;
}

:root[data-theme="warm-horizon"] .journey-root::after {
  display: none;
}

:root[data-theme="warm-horizon"] .journey-root::before {
  display: none;
  z-index: 0;
  opacity: 0;
}

:root[data-theme="warm-horizon"] .simulation-toolbar-center {
  width: min(100%, 960px);
  margin: 0;
  padding: 6px 0 7px 26px;
  text-align: left;
}

:root[data-theme="warm-horizon"] .simulation-toolbar-center::after {
  display: none;
}

:root[data-theme="warm-horizon"] .simulation-title-line {
  justify-content: flex-start;
}

:root[data-theme="warm-horizon"] .simulation-title-text {
  max-width: min(76vw, 620px);
  font-size: 21px;
  font-weight: 680;
}

:root[data-theme="warm-horizon"] .journey-input-bar #input {
  min-height: 50px;
  padding-top: 13px;
  padding-bottom: 13px;
  background:
    linear-gradient(90deg, rgba(255, 250, 235, 0.2), rgba(255, 244, 222, 0.12)),
    rgba(72, 55, 34, 0.2);
  border-radius: 999px;
  caret-color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 4px rgba(48, 31, 14, 0.32);
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
}

:root[data-theme="warm-horizon"] .journey-input-bar #input:focus {
  background:
    linear-gradient(90deg, rgba(255, 252, 242, 0.24), rgba(255, 244, 222, 0.16)),
    rgba(72, 55, 34, 0.24);
}

:root[data-theme="warm-horizon"] .journey-input-bar #send {
  right: 6px;
  bottom: 6px;
  width: 42px;
  height: 42px;
}

:root[data-theme="warm-horizon"] .simulation-title-edit-btn {
  color: rgba(75, 58, 38, 0.78);
}

:root[data-theme="warm-horizon"] .simulation-title-edit-btn:hover {
  color: rgba(52, 42, 31, 0.96);
}

:root[data-theme="warm-horizon"] .journey-content-frame-edge,
:root[data-theme="warm-horizon"] .journey-title-frame-edge {
  stroke: rgba(255, 242, 211, 0.88);
}

:root[data-theme="warm-horizon"] .journey-node-content-card::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at 84% 76%, rgba(255, 191, 88, 0.11), transparent 38%);
  box-shadow:
    inset 0 0 18px rgba(255, 248, 226, 0.18),
    inset 0 0 42px rgba(226, 219, 202, 0.1),
    inset 0 0 76px rgba(205, 196, 176, 0.055);
  opacity: 1;
}

:root[data-theme="warm-horizon"] .journey-node-content-card::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  top: 0;
  z-index: 1;
  display: block;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 222, 0.82), transparent);
  box-shadow: 0 0 14px rgba(255, 198, 92, 0.18);
}

:root[data-theme="warm-horizon"] .journey-content-frame-corner {
  display: none;
}

:root[data-theme="warm-horizon"] .journey-content-frame-edge {
  stroke: rgba(255, 239, 204, 0.58);
}

:root[data-theme="warm-horizon"] .journey-node-ai-copy p {
  color: rgba(55, 45, 34, 0.88);
  font-size: 15px;
  line-height: 1.88;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

:root[data-theme="warm-horizon"] .journey-node-ai-copy p + p {
  margin-top: 18px;
}

:root[data-theme="warm-horizon"] .simulation-free-input-hint {
  color: rgba(55, 45, 34, 0.88);
}

:root[data-theme="warm-horizon"] .simulation-user-text {
  max-width: min(72%, 340px);
  padding: 12px 15px;
  border-color: rgba(255, 242, 211, 0.24);
  border-radius: 8px;
  color: rgba(55, 45, 34, 0.88);
  background: rgba(255, 250, 238, 0.24);
  box-shadow:
    0 8px 18px rgba(151, 111, 53, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-weight: 400;
  line-height: 1.62;
  text-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root[data-theme="warm-horizon"] .simulation-choices {
  margin-top: -6px;
  padding-top: 4px;
}

:root[data-theme="warm-horizon"] .simulation-choice-row {
  gap: 9px;
}

:root[data-theme="warm-horizon"] .simulation-choice-btn {
  width: fit-content;
  min-height: 34px;
  padding: 8px 14px;
  border-color: rgba(255, 220, 150, 0.58);
  border-radius: 8px;
  color: rgba(61, 48, 34, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 250, 238, 0.5), rgba(255, 228, 164, 0.18)),
    rgba(255, 250, 238, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 8px 18px rgba(151, 111, 53, 0.08);
}

:root[data-theme="warm-horizon"] .simulation-choice-btn:hover,
:root[data-theme="warm-horizon"] .simulation-choice-btn:active,
:root[data-theme="warm-horizon"] .simulation-choice-btn.is-selected,
:root[data-theme="warm-horizon"] .journey-node-choice-trace-item.is-selected {
  border-color: rgba(255, 186, 77, 0.64);
  background:
    linear-gradient(180deg, rgba(255, 239, 197, 0.5), rgba(255, 206, 121, 0.2)),
    rgba(255, 246, 224, 0.22);
  color: rgba(52, 41, 30, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 16px rgba(255, 184, 66, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

:root[data-theme="warm-horizon"] .journey-node-choice-trace {
  padding-top: 4px;
}

:root[data-theme="warm-horizon"] .journey-node-choice-trace-item {
  border-color: rgba(255, 220, 150, 0.42);
  background: rgba(255, 250, 238, 0.16);
  color: rgba(61, 48, 34, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 5px 14px rgba(151, 111, 53, 0.05);
}

:root[data-theme="manga-lineart"] .journey-root[data-motion-state="forecasting"] .journey-world-layer,
:root[data-theme="manga-lineart"] .journey-root[data-motion-state="revealing"] .journey-world-layer,
:root[data-theme="manga-lineart"] .journey-root[data-view-mode="overview"] .journey-world-layer {
  z-index: 8 !important;
  transform: translate3d(0, 0, 0) !important;
  opacity: 1 !important;
  filter: none !important;
}

:root[data-theme="manga-lineart"] .journey-cloud-layers,
:root[data-theme="manga-lineart"] .journey-cloud-layer-top,
:root[data-theme="manga-lineart"] .journey-cloud-layer-red,
:root[data-theme="manga-lineart"] .journey-cloud-layer-soft,
:root[data-theme="manga-lineart"] .journey-cloud-layer-transition,
:root[data-theme="manga-lineart"] .journey-mountain-layers,
:root[data-theme="manga-lineart"] .journey-world::after,
:root[data-theme="manga-lineart"] .journey-root::before,
:root[data-theme="manga-lineart"] .journey-root::after {
  display: none;
}

:root[data-theme="manga-lineart"] .journey-root::after {
  display: block;
  background-image: url("/frontend/assets/journey/worldline-earth-arc-bg.png");
  background-position: center -18px;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  filter: none;
}

:root[data-theme="manga-lineart"] .simulation-toolbar-center {
  width: min(100%, 960px);
  margin: 0;
  padding: 6px 0 7px 26px;
  text-align: left;
}

:root[data-theme="manga-lineart"] .simulation-toolbar-center::after {
  display: none;
}

:root[data-theme="manga-lineart"] .simulation-title-line {
  justify-content: flex-start;
}

:root[data-theme="manga-lineart"] .simulation-title-text {
  max-width: min(76vw, 620px);
  color: #111111;
  font-size: 21px;
  font-weight: 760;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .journey-input-bar #input {
  min-height: 50px;
  padding: 13px 54px 13px 18px;
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  caret-color: #111111;
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="manga-lineart"] .journey-input-bar #input:focus {
  background: #ffffff;
}

:root[data-theme="manga-lineart"] .journey-input-bar #send {
  right: 7px;
  bottom: 7px;
  width: 38px;
  height: 38px;
  border: 0;
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

:root[data-theme="manga-lineart"] .journey-input-bar #send svg {
  width: 16px;
  height: 16px;
}

:root[data-theme="manga-lineart"] .journey-input-bar #send:hover {
  background: #111111;
  color: #ffffff;
  box-shadow: var(--theme-send-hover-shadow);
  transform: translateY(-1px);
}

:root[data-theme="manga-lineart"] .journey-input-bar #send:active {
  transform: translateY(0);
}

:root[data-theme="manga-lineart"] .simulation-title-edit-btn,
:root[data-theme="manga-lineart"] .simulation-title-edit-btn:hover {
  color: #111111;
}

:root[data-theme="manga-lineart"] .journey-content-frame-edge,
:root[data-theme="manga-lineart"] .journey-title-frame-edge {
  stroke: #111111;
}

:root[data-theme="manga-lineart"] .journey-title-frame-glow,
:root[data-theme="manga-lineart"] .journey-content-frame-corner {
  display: none;
}

:root[data-theme="manga-lineart"] .journey-node-content-card::before {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #111111;
  opacity: 1;
}

:root[data-theme="manga-lineart"] .journey-detail-dim {
  background: transparent;
}

:root[data-theme="manga-lineart"] .journey-root[data-view-mode="detail"][data-motion-state="idle"] .journey-detail-dim {
  opacity: 1;
}

:root[data-theme="manga-lineart"] .journey-node-content-card::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  top: 0;
  z-index: 1;
  display: block;
  height: 2px;
  pointer-events: none;
  background: #111111;
  box-shadow: none;
}

:root[data-theme="manga-lineart"] .journey-node-content-summarybar {
  border-color: #111111;
  background: #ffffff;
  color: #111111;
}

:root[data-theme="manga-lineart"] .journey-node-ai-copy p {
  color: #111111;
  font-size: 15px;
  line-height: 1.88;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .journey-node-ai-copy p + p {
  margin-top: 18px;
}

:root[data-theme="manga-lineart"] .journey-node-content-more {
  color: #4a4a4a;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .simulation-free-input-hint {
  color: rgba(17, 17, 17, 0.72);
}

:root[data-theme="manga-lineart"] .simulation-user-text {
  max-width: min(72%, 340px);
  padding: 12px 15px;
  border: 1px solid #111111;
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(17, 17, 17, 0.16),
    2px 2px 0 rgba(17, 17, 17, 0.08);
  font-weight: 500;
  line-height: 1.62;
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="manga-lineart"] .journey-node-content-card.is-origin-question {
  background: #ffffff;
}

:root[data-theme="manga-lineart"] .journey-node-content-scroll.is-origin-question {
  padding: 22px 28px 18px;
}

:root[data-theme="manga-lineart"] .journey-origin-question {
  color: #111111;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .journey-origin-question p {
  font-size: 17px;
  line-height: 1.64;
  font-weight: 650;
}

:root[data-theme="manga-lineart"] .simulation-choices {
  margin-top: -6px;
  padding-top: 4px;
}

:root[data-theme="manga-lineart"] .simulation-choice-row {
  gap: 9px;
}

:root[data-theme="manga-lineart"] .simulation-choice-btn,
:root[data-theme="manga-lineart"] .simulation-branch-btn,
:root[data-theme="manga-lineart"] .journey-node-choice-trace-item {
  width: fit-content;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid #111111;
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(17, 17, 17, 0.16),
    2px 2px 0 rgba(17, 17, 17, 0.08);
  text-shadow: none;
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

:root[data-theme="manga-lineart"] .simulation-choice-btn:hover,
:root[data-theme="manga-lineart"] .simulation-branch-btn:hover,
:root[data-theme="manga-lineart"] .journey-node-choice-trace-item:hover {
  border-color: #111111;
  background: #ffffff;
  color: #111111;
  box-shadow:
    0 1px 0 rgba(17, 17, 17, 0.18),
    2px 3px 0 rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

:root[data-theme="manga-lineart"] .simulation-choice-btn:active,
:root[data-theme="manga-lineart"] .simulation-branch-btn:active {
  border-color: #111111;
  background: #ffffff;
  color: #111111;
  box-shadow:
    0 1px 0 rgba(17, 17, 17, 0.16),
    2px 2px 0 rgba(17, 17, 17, 0.08);
  transform: translateY(0);
}

:root[data-theme="manga-lineart"] .simulation-choice-btn.is-selected,
:root[data-theme="manga-lineart"] .journey-node-choice-trace-item.is-selected {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  box-shadow: none;
}

:root[data-theme="manga-lineart"] .journey-node-choice-trace {
  padding-top: 4px;
}

:root[data-theme="manga-lineart"] .simulation-back-latest-link {
  border: 0;
  background: transparent;
  color: #111111;
  box-shadow: none;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .simulation-back-latest-link:hover {
  background: transparent;
  color: #111111;
  box-shadow: none;
  text-shadow: none;
  transform: translateY(-2px);
}

:root[data-theme="manga-lineart"] .simulation-back-latest-arrow,
:root[data-theme="manga-lineart"] .simulation-back-latest-text {
  color: #111111;
  text-shadow: none;
}

:root[data-theme="manga-lineart"] .simulation-history-footer {
  padding-right: max(26px, calc(env(safe-area-inset-right) + 26px));
  padding-bottom: calc(170px + max(8px, env(safe-area-inset-bottom)));
}

:root[data-theme="manga-lineart"] .simulation-back-latest-link {
  color: rgba(17, 17, 17, 0.42);
  font-weight: 500;
}

:root[data-theme="manga-lineart"] .simulation-back-latest-link:hover {
  color: rgba(17, 17, 17, 0.58);
}

:root[data-theme="manga-lineart"] .simulation-back-latest-arrow,
:root[data-theme="manga-lineart"] .simulation-back-latest-text {
  color: currentColor;
  font-weight: 500;
}

.simulation-ai-label,
.simulation-user-label {
  display: none !important;
}

footer.simulation-footer-hidden {
  display: none !important;
}

footer.journey-footer-detached {
  padding: 0;
  background: transparent;
  pointer-events: none;
}

footer.journey-footer-detached .footer-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  height: 0;
}

.simulation-subtitle {
  display: none !important;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.34);
  text-align: center;
}

.simulation-free-input-hint {
  width: 100%;
  padding: 2px 8px 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(218, 223, 229, 0.86);
  text-align: left;
}

/* Immersive scene page --------------------------------------------------- */
/* The map remains available in overview mode.  In detail mode the user is
   inside one stable island location instead of reading a dialog over a map. */
.journey-scene-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image: var(--journey-scene-image, none);
  background-size: cover;
  background-position: center;
  opacity: 1;
  filter: contrast(1.04) brightness(1.025);
  transform: scale(1.018);
  transition: opacity 280ms ease, transform 700ms ease;
}

.journey-scene-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, transparent 30%),
    linear-gradient(0deg, rgba(255,255,255,0.14) 0%, transparent 42%);
}

.journey-root[data-view-mode="overview"] .journey-scene-layer {
  opacity: 0;
  transform: scale(1.03);
}

.journey-root[data-view-mode="detail"] .journey-world-layer {
  opacity: 0;
  pointer-events: none !important;
  filter: none;
}

.journey-root[data-view-mode="detail"]::before,
.journey-root[data-view-mode="detail"]::after {
  display: none;
}

/* A scene is already the reading surface; unlike the former modal, it must
   stay sharp while the narrative layer is open. */
body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-root[data-view-mode="detail"] .journey-ui-overlay::before,
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-root[data-view-mode="detail"] .journey-ui-overlay::before,
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-root[data-view-mode="detail"] .journey-ui-overlay::before {
  opacity: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-root[data-view-mode="detail"] .journey-header,
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-root[data-view-mode="detail"] .journey-header,
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-root[data-view-mode="detail"] .journey-header {
  pointer-events: none !important;
  filter: none !important;
}

body.app-route-map:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .journey-root[data-view-mode="detail"] .journey-header :is(button, a, input, textarea, select, [role="button"]),
body.app-route-map:has(#chat.simulation-mode):has(#input:focus) .journey-root[data-view-mode="detail"] .journey-header :is(button, a, input, textarea, select, [role="button"]),
body.app-route-map.app-keyboard-open:has(#chat.simulation-mode) .journey-root[data-view-mode="detail"] .journey-header :is(button, a, input, textarea, select, [role="button"]) {
  pointer-events: auto !important;
}

.journey-root[data-view-mode="detail"] .journey-ui-overlay {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.journey-root[data-view-mode="detail"] .journey-header {
  z-index: 30;
  align-items: flex-start;
  padding: max(20px, calc(env(safe-area-inset-top, 0px) + 14px)) 22px 0;
  gap: 10px;
}

.journey-root[data-view-mode="detail"] .journey-header-kicker {
  padding-left: 0;
  color: rgba(17, 17, 17, 0.66);
}

.journey-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(17,17,17,0.36);
  border-radius: 999px;
  background: rgba(255,255,255,0.58);
  color: rgba(17,17,17,0.82);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(17,17,17,0.06);
}

.journey-map-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.journey-map-toggle:hover {
  background: rgba(255,255,255,0.88);
}

.journey-root[data-view-mode="overview"] .journey-map-toggle {
  display: none;
}

.journey-map-return {
  position: absolute;
  z-index: 42;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 10px));
  right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(17,17,17,0.48);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  color: #111;
  font: 650 12px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  box-shadow: 0 6px 20px rgba(17,17,17,0.12);
  cursor: pointer;
}

.journey-map-return:hover {
  background: #111;
  color: #fff;
}

.journey-root[data-view-mode="detail"] .simulation-toolbar-center {
  width: min(88vw, 620px);
  margin: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.journey-root[data-view-mode="detail"] .simulation-toolbar-center::after,
.journey-root[data-view-mode="detail"] .journey-title-frame-svg {
  display: none;
}

.journey-root[data-view-mode="detail"] .simulation-title-line {
  display: block;
}

.journey-root[data-view-mode="detail"] .simulation-title-text {
  max-width: 100%;
  color: #111;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(34px, 8.7vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.055em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

.journey-root[data-view-mode="detail"] .simulation-title-edit-btn {
  display: none;
}

.journey-root[data-view-mode="detail"] .simulation-counter {
  display: block !important;
  width: fit-content;
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(17,17,17,0.72);
  color: rgba(17,17,17,0.72);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.journey-root[data-view-mode="detail"] .journey-node-content {
  z-index: 25;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 28px 20px 116px;
  pointer-events: none;
}

.journey-root[data-view-mode="detail"] .journey-node-content-card {
  width: min(650px, 100%);
  max-height: min(43vh, 400px);
  border-radius: 20px 20px 4px 4px;
  clip-path: none;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 38px rgba(17,17,17,0.11), inset 0 1px rgba(255,255,255,0.82);
  backdrop-filter: blur(15px) saturate(0.88);
  -webkit-backdrop-filter: blur(15px) saturate(0.88);
  pointer-events: auto;
}

.journey-root[data-view-mode="detail"] .journey-node-content-card::before,
.journey-root[data-view-mode="detail"] .journey-content-frame-svg {
  display: none;
}

.journey-root[data-view-mode="detail"] .journey-node-content-scroll {
  padding: 20px 20px 14px;
  gap: 13px;
  scrollbar-color: rgba(17,17,17,0.24) transparent;
}

.journey-root[data-view-mode="detail"] .journey-node-ai-copy,
.journey-root[data-view-mode="detail"] .journey-node-ai-copy p,
.journey-root[data-view-mode="detail"] .journey-origin-question {
  color: rgba(17,17,17,0.9);
  text-shadow: none;
}

.journey-root[data-view-mode="detail"] .journey-node-ai-copy p {
  font-size: 16px;
  line-height: 1.78;
}

.journey-root[data-view-mode="detail"] .journey-node-content-more {
  color: rgba(17,17,17,0.46);
  text-shadow: none;
}

.journey-root[data-view-mode="detail"] .simulation-choice-btn,
.journey-root[data-view-mode="detail"] .journey-node-choice-trace-item {
  border-color: rgba(17,17,17,0.68);
  background: rgba(255,255,255,0.48);
  color: #111;
  box-shadow: none;
}

.journey-root[data-view-mode="detail"] .simulation-choice-btn:hover {
  background: #111;
  color: #fff;
}

.journey-root[data-view-mode="detail"] .simulation-choice-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 13px;
  text-align: left;
}

.journey-root[data-view-mode="detail"] .simulation-choice-prefix {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.journey-root[data-view-mode="detail"] .simulation-choice-label {
  flex: 1;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.4;
}

.journey-root[data-view-mode="detail"] .journey-input-bar {
  z-index: 35;
  padding: 0 20px max(15px, env(safe-area-inset-bottom, 0px));
}

.journey-root[data-view-mode="detail"] .journey-input-bar .input-wrapper {
  clip-path: none;
  border: 1px solid rgba(17,17,17,0.45);
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 6px 24px rgba(17,17,17,0.1);
}

.journey-root[data-view-mode="detail"] .journey-input-bar #input {
  color: #111;
}

.journey-root[data-view-mode="detail"] .journey-input-bar #send {
  background: #111;
  color: #fff;
  box-shadow: none;
}

/* Keep the existing tap-to-reveal navigation behaviour.  The scene page must
   not permanently suppress it when the app has made the tabs visible. */
body.app-route-map.app-map-tabs-visible:has(#chat.simulation-mode .journey-node-content:not(.hidden)) .app-bottom-tabs,
body.app-route-map.app-map-tabs-visible:has(#chat.simulation-mode .journey-input-bar:not(.hidden)) .app-bottom-tabs {
  transform: translateY(0) !important;
  opacity: 1;
  pointer-events: auto;
}

body.app-route-map.app-map-tabs-visible .journey-root[data-view-mode="detail"] .journey-input-bar {
  transform: translateY(calc(-1 * (var(--app-tab-height, 80px) + 8px)));
}

@media (max-width: 768px) {
  .journey-root[data-view-mode="detail"] .journey-header {
    padding-inline: 18px;
  }

  .journey-root[data-view-mode="detail"] .journey-node-content {
    padding: 24px 14px 108px;
  }

  .journey-root[data-view-mode="detail"] .journey-node-content-card {
    max-height: min(43vh, 370px);
    border-radius: 16px 16px 3px 3px;
  }

  .journey-root[data-view-mode="detail"] .journey-node-content-scroll {
    padding: 18px 17px 13px;
  }

  .journey-root[data-view-mode="detail"] .journey-input-bar {
    padding-inline: 14px;
  }
}

@media (max-width: 768px) {
  #chat.simulation-mode,
  .simulation-shell {
    height: 100%;
    min-height: 0;
  }

  @supports (height: 100dvh) {
    #chat.simulation-mode,
    .simulation-shell,
    .journey-root {
      min-height: 0;
    }
  }

  .journey-node-content {
    padding: 46px 12px 8px;
  }

  .journey-choice-panel {
    padding: 0 12px 10px;
  }

  .journey-input-bar {
    padding: 0 12px max(8px, env(safe-area-inset-bottom, 0px));
  }

  body:has(#input:focus) .journey-input-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  body.app-keyboard-open .journey-input-bar {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .simulation-toolbar,
  .journey-toolbar {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .simulation-nav-btn {
    width: 0;
    height: 0;
    font-size: 0;
  }

  .simulation-toolbar-center {
    padding: 7px 22px 8px;
    border-radius: 18px;
  }

  .simulation-title-text {
    font-size: 16px;
    max-width: min(60vw, 260px);
  }

  .journey-node-content-card {
    width: calc(100vw - 24px);
    max-height: 46vh;
  }

  .simulation-subtitle {
    font-size: 12px;
    margin-top: 0;
  }

  .simulation-free-input-hint {
    font-size: 14px;
    padding: 0 16px;
  }

  .simulation-page {
    gap: 14px;
    padding-bottom: 0;
  }

  .simulation-user-text {
    max-width: min(100%, 224px);
    font-size: 15px;
    line-height: 1.72;
  }

  .simulation-card {
    width: 100%;
  }

  .simulation-card p {
    font-size: 16px;
    line-height: 1.8;
  }

  .journey-node-content-card {
    width: calc(100vw - 24px);
  }

  .journey-node-content-card.is-origin-question {
    max-height: 34vh;
  }

  .journey-node-content-scroll.is-origin-question {
    min-height: 82px;
    padding: 18px 22px 16px;
  }

  .simulation-turn-origin {
    min-height: 54px;
  }

  .journey-origin-question p {
    font-size: 16px;
    line-height: 1.58;
  }

  .simulation-choice-row {
    justify-content: flex-start;
    overflow-x: visible;
    flex-wrap: nowrap;
    flex-direction: column;
    padding: 0;
  }

  .simulation-choice-btn,
  .simulation-free-input-hint {
    flex: 0 0 auto;
    white-space: normal;
  }

  :root[data-theme="warm-horizon"] .simulation-toolbar-center {
    padding: 4px 0 7px 2px;
    border-radius: 0;
  }

  :root[data-theme="warm-horizon"] .simulation-title-line {
    justify-content: flex-start;
  }

  :root[data-theme="warm-horizon"] .simulation-title-text {
    max-width: calc(100vw - 76px);
    font-size: 18px;
    font-weight: 680;
  }

  :root[data-theme="manga-lineart"] .simulation-toolbar-center {
    padding: 4px 0 7px 2px;
    border-radius: 0;
  }

  :root[data-theme="manga-lineart"] .simulation-title-line {
    justify-content: flex-start;
  }

  :root[data-theme="manga-lineart"] .simulation-title-text {
    max-width: calc(100vw - 76px);
    font-size: 18px;
    font-weight: 760;
  }
}
/* Chapter experience: branch preview, journey atlas, and Eve's pattern reveal. */
.chapter-experience-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 10, 15, 0.76);
  backdrop-filter: blur(12px);
}

.chapter-experience-card {
  width: min(100%, 560px);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  padding: 28px;
  color: #fffdf8;
  background: linear-gradient(145deg, #272a38, #14151d 70%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

.chapter-experience-eyebrow,
.journey-atlas-label {
  color: #f2bc70;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.chapter-experience-card h2 { margin: 10px 0 8px; font-size: 26px; line-height: 1.25; }
.chapter-experience-intro { margin: 0 0 22px; color: rgba(255,255,255,.68); line-height: 1.7; }
.branch-preview-details { display: grid; grid-template-columns: 92px 1fr; gap: 14px 16px; margin: 0; }
.branch-preview-details dt { color: #f2bc70; font-weight: 700; }
.branch-preview-details dd { margin: 0; line-height: 1.55; color: rgba(255,255,255,.9); }
.chapter-experience-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.chapter-experience-actions button { min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.chapter-experience-primary { border: 0; color: #1c1720; background: #f4c276; }
.chapter-experience-secondary { border: 1px solid rgba(255,255,255,.28); color: rgba(255,255,255,.88); background: transparent; }
.journey-atlas-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.journey-atlas-grid section { min-height: 96px; padding: 15px; border-radius: 16px; background: rgba(255,255,255,.075); }
.journey-atlas-grid p { margin: 8px 0 0; line-height: 1.55; color: rgba(255,255,255,.86); }
.journey-atlas-archive { margin-top: 22px; }
.journey-atlas-archive-label { margin-bottom: 10px; color: rgba(255,255,255,.55); font-size: 12px; }
.journey-atlas-archive-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.journey-atlas-archive-button { flex: 0 0 auto; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: rgba(255,255,255,.72); background: transparent; }
.journey-atlas-archive-button[data-active="true"] { border-color: rgba(244,194,118,.7); color: #f4c276; background: rgba(244,194,118,.1); }
.journey-calibration { margin-top: 18px; padding: 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; }
.journey-calibration p { margin: 7px 0 12px; color: rgba(255,255,255,.86); line-height: 1.55; }
.journey-calibration-actions, .journey-calibration-reasons { display:flex; flex-wrap:wrap; gap:8px; }
.journey-calibration-button, .journey-calibration-reason { min-height:34px; border:1px solid rgba(255,255,255,.28); border-radius:999px; padding:6px 10px; color:rgba(255,255,255,.9); background:transparent; font:inherit; font-size:12px; cursor:pointer; }
.eve-pattern-card { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 22px; max-width: 700px; }
.eve-pattern-avatar { width: 112px; height: 112px; object-fit: cover; border-radius: 24px; border: 1px solid rgba(242,188,112,.66); background: #161823; }
.eve-pattern-detail { display: none; margin-top: 18px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.08); }
.eve-pattern-detail h3 { margin: 0 0 10px; font-size: 18px; }
.eve-pattern-detail p, .eve-pattern-detail li { color: rgba(255,255,255,.86); line-height: 1.6; }
.eve-pattern-detail ul { margin: 12px 0 0; padding-left: 20px; }
.eve-pattern-feedback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.eve-pattern-feedback-button { padding: 7px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.72); background: transparent; }
.eve-pattern-feedback-button[data-active="true"] { border-color: rgba(244,194,118,.72); color: #f4c276; background: rgba(244,194,118,.1); }
.eve-pattern-revealed-actions { display: none; }
.eve-pattern-card.is-revealed .eve-pattern-detail, .eve-pattern-card.is-revealed .eve-pattern-revealed-actions { display: flex; }
.eve-pattern-card.is-revealed .eve-pattern-detail { display: block; }
.eve-pattern-card.is-revealed .eve-pattern-initial-actions { display: none; }

/* Eve reveal is intentionally a two-screen beat: the first screen is only a
   title and a hook, while the evidence waits behind “查看”. */
.eve-pattern-card:not(.is-revealed) {
  display: block;
  max-width: 560px;
}
.eve-pattern-card:not(.is-revealed) .eve-pattern-avatar {
  display: none;
}
.eve-pattern-card:not(.is-revealed) .eve-pattern-detail,
.eve-pattern-card:not(.is-revealed) .eve-pattern-revealed-actions {
  display: none;
}

@media (max-width: 560px) {
  .chapter-experience-layer { padding: 16px; }
  .chapter-experience-card { padding: 22px; border-radius: 24px; }
  .journey-atlas-grid { grid-template-columns: 1fr; }
  .eve-pattern-card { grid-template-columns: 72px minmax(0, 1fr); gap: 15px; }
  .eve-pattern-avatar { width: 68px; height: 68px; border-radius: 18px; }
}

.life-board-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483010;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 25%, rgba(77, 69, 98, .48), transparent 48%), rgba(8, 9, 14, .86);
  backdrop-filter: blur(14px);
}

.life-board-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px;
  color: #fffdf8;
  background: linear-gradient(150deg, #292b3a, #15161e 72%);
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}

.life-board-progress { height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.life-board-progress span { display: block; height: 100%; border-radius: inherit; background: #f4c276; transition: width .25s ease; }
.life-board-kicker { margin-top: 22px; color: #f2bc70; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.life-board-card h2 { margin: 9px 0 7px; font-size: 27px; line-height: 1.3; }
.life-board-card > p { margin: 0; color: rgba(255,255,255,.68); line-height: 1.6; }
.life-board-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.life-board-choice { min-height: 54px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 15px; color: rgba(255,255,255,.84); background: rgba(255,255,255,.055); text-align: left; cursor: pointer; }
.life-board-choice[data-selected="true"] { border-color: rgba(244,194,118,.9); color: #fff; background: rgba(244,194,118,.17); box-shadow: inset 0 0 0 1px rgba(244,194,118,.22); }
.life-board-choice span { color: rgba(255,255,255,.58); font-size: 12px; line-height: 1.4; }
.life-board-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.life-board-actions button { min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; }
.life-board-back { border: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.82); background: transparent; }
.life-board-next { border: 0; color: #1b1720; background: #f4c276; }
.life-board-next:disabled { opacity: .34; cursor: not-allowed; }

@media (max-width: 560px) {
  .life-board-layer { padding: 14px; }
  .life-board-card { max-height: calc(100vh - 28px); padding: 22px; border-radius: 24px; }
  .life-board-card h2 { font-size: 23px; }
  .life-board-choices { grid-template-columns: 1fr 1fr; }
  .life-board-roles { grid-template-columns: 1fr; }
}

/* Added chapter surfaces follow the existing manga-lineart vocabulary:
   paper white, ink black, compact type, clipped corners and restrained shadow. */
:root[data-theme="manga-lineart"] .chapter-experience-layer,
:root[data-theme="manga-lineart"] .life-board-layer {
  padding: 18px;
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: grayscale(1) blur(2px);
  -webkit-backdrop-filter: grayscale(1) blur(2px);
}

:root[data-theme="manga-lineart"] .chapter-experience-card,
:root[data-theme="manga-lineart"] .life-board-card {
  border: 1px solid #111111;
  border-radius: 8px;
  color: #111111;
  background: #ffffff;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.18), 0 14px 36px rgba(17, 17, 17, 0.18);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

:root[data-theme="manga-lineart"] .chapter-experience-eyebrow,
:root[data-theme="manga-lineart"] .journey-atlas-label,
:root[data-theme="manga-lineart"] .life-board-kicker {
  color: rgba(17, 17, 17, 0.58);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

:root[data-theme="manga-lineart"] .chapter-experience-card h2,
:root[data-theme="manga-lineart"] .life-board-card h2 {
  margin: 9px 0 8px;
  color: #111111;
  font-size: 21px;
  line-height: 1.42;
  font-weight: 760;
}

:root[data-theme="manga-lineart"] .chapter-experience-intro,
:root[data-theme="manga-lineart"] .life-board-card > p {
  color: rgba(17, 17, 17, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

:root[data-theme="manga-lineart"] .branch-preview-details {
  gap: 12px 16px;
  padding-top: 6px;
  border-top: 1px solid rgba(17, 17, 17, 0.14);
}
:root[data-theme="manga-lineart"] .branch-preview-details dt { color: rgba(17, 17, 17, 0.58); font-size: 12px; font-weight: 650; }
:root[data-theme="manga-lineart"] .branch-preview-details dd { color: #111111; font-size: 14px; line-height: 1.55; }

:root[data-theme="manga-lineart"] .chapter-experience-actions { margin-top: 22px; }
:root[data-theme="manga-lineart"] .chapter-experience-actions button,
:root[data-theme="manga-lineart"] .life-board-actions button {
  min-height: 36px;
  padding: 0 15px;
  border-radius: 7px;
  color: #111111;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
:root[data-theme="manga-lineart"] .chapter-experience-primary,
:root[data-theme="manga-lineart"] .life-board-next {
  border: 1px solid #111111;
  color: #ffffff !important;
  background: #111111;
  box-shadow: 1px 1px 0 rgba(17, 17, 17, 0.22);
}
:root[data-theme="manga-lineart"] .chapter-experience-secondary,
:root[data-theme="manga-lineart"] .life-board-back {
  border: 1px solid #111111;
  color: #111111;
  background: #ffffff;
}

:root[data-theme="manga-lineart"] .journey-atlas-grid { gap: 9px; margin-top: 18px; }
:root[data-theme="manga-lineart"] .journey-atlas-grid section {
  min-height: 86px;
  padding: 13px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  border-radius: 6px;
  background: #ffffff;
}
:root[data-theme="manga-lineart"] .journey-atlas-grid p { margin-top: 7px; color: #111111; font-size: 14px; line-height: 1.58; }
:root[data-theme="manga-lineart"] .journey-calibration { border-color: rgba(17, 17, 17, .2); border-radius: 6px; background: #fff; }
:root[data-theme="manga-lineart"] .journey-calibration p { color: #111; font-size: 14px; }
:root[data-theme="manga-lineart"] .journey-calibration-button,
:root[data-theme="manga-lineart"] .journey-calibration-reason { border-color: rgba(17, 17, 17, .4); border-radius: 6px; color: #111; background: #fff; }
:root[data-theme="manga-lineart"] .journey-atlas-archive { margin-top: 18px; }
:root[data-theme="manga-lineart"] .journey-atlas-archive-label { color: rgba(17, 17, 17, 0.54); font-size: 11px; }
:root[data-theme="manga-lineart"] .journey-atlas-archive-button,
:root[data-theme="manga-lineart"] .eve-pattern-feedback-button {
  padding: 7px 10px;
  border: 1px solid rgba(17, 17, 17, 0.38);
  border-radius: 6px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
}
:root[data-theme="manga-lineart"] .journey-atlas-archive-button[data-active="true"],
:root[data-theme="manga-lineart"] .eve-pattern-feedback-button[data-active="true"] { color: #ffffff; border-color: #111111; background: #111111; }

:root[data-theme="manga-lineart"] .eve-pattern-card { grid-template-columns: 94px minmax(0, 1fr); gap: 20px; max-width: 720px; }
:root[data-theme="manga-lineart"] .eve-pattern-card:not(.is-revealed) { max-width: 560px; }
:root[data-theme="manga-lineart"] .eve-pattern-avatar { width: 88px; height: 88px; border: 1px solid #111111; border-radius: 8px; background: #ffffff; }
:root[data-theme="manga-lineart"] .eve-pattern-detail { margin-top: 16px; padding: 14px; border: 1px solid rgba(17, 17, 17, 0.2); border-radius: 6px; background: #ffffff; }
:root[data-theme="manga-lineart"] .eve-pattern-detail h3 { margin-bottom: 8px; color: #111111; font-size: 17px; }
:root[data-theme="manga-lineart"] .eve-pattern-detail p,
:root[data-theme="manga-lineart"] .eve-pattern-detail li { color: #111111; font-size: 14px; line-height: 1.62; }
:root[data-theme="manga-lineart"] .eve-pattern-feedback { gap: 6px; margin-top: 14px; }

:root[data-theme="manga-lineart"] .life-board-card { width: min(680px, 100%); padding: 28px; }
:root[data-theme="manga-lineart"] .life-board-progress { height: 2px; border-radius: 0; background: rgba(17, 17, 17, 0.16); }
:root[data-theme="manga-lineart"] .life-board-progress span { border-radius: 0; background: #111111; }
:root[data-theme="manga-lineart"] .life-board-choices { gap: 9px; margin-top: 20px; }
:root[data-theme="manga-lineart"] .life-board-choice {
  min-height: 52px;
  padding: 11px 13px;
  border: 1px solid rgba(17, 17, 17, 0.38);
  border-radius: 6px;
  color: #111111;
  background: #ffffff;
  box-shadow: 1px 1px 0 rgba(17, 17, 17, 0.1);
}
:root[data-theme="manga-lineart"] .life-board-choice[data-selected="true"] { border-color: #111111; color: #ffffff; background: #111111; box-shadow: none; }
:root[data-theme="manga-lineart"] .life-board-choice span { color: rgba(17, 17, 17, 0.58); font-size: 11px; }
:root[data-theme="manga-lineart"] .life-board-choice[data-selected="true"] span { color: rgba(255, 255, 255, 0.74); }

@media (max-width: 560px) {
  :root[data-theme="manga-lineart"] .chapter-experience-card,
  :root[data-theme="manga-lineart"] .life-board-card { padding: 22px; border-radius: 7px; }
  :root[data-theme="manga-lineart"] .eve-pattern-card { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  :root[data-theme="manga-lineart"] .eve-pattern-avatar { width: 60px; height: 60px; border-radius: 6px; }
}
