.journey-body {
  overflow-x: hidden;
  background: #0A0A0F;
}

.journey-heading {
  grid-template-columns: minmax(0, 820px) auto;
}

.journey-workspace {
  grid-template-columns: minmax(320px, 0.9fr) minmax(560px, 1.34fr);
}

.journey-form {
  position: sticky;
  top: 84px;
}

.journey-workflow-card,
.journey-preset-block,
.journey-summary-card,
.journey-section,
.journey-mini-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.journey-preset-block {
  background: #161620;
}

.journey-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.journey-card-header strong {
  color: #EDEDF5;
  font: 800 1rem var(--font-display);
}

.journey-card-header span {
  color: #8888A0;
  font-size: 0.8rem;
  font-weight: 800;
}

.journey-steps {
  display: grid;
  gap: 9px;
}

.journey-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: #161620;
}

.journey-step > span,
.action-step > span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #2A2A3A;
  color: #B8B8CC;
  font-size: 0.82rem;
  font-weight: 900;
}

.journey-step strong {
  display: block;
  color: #B8B8CC;
  font-size: 0.9rem;
  line-height: 1.25;
}

.journey-step em {
  display: block;
  margin-top: 2px;
  color: #8888A0;
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
}

.journey-step.is-active {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.08);
}

.journey-step.is-active > span {
  color: #111118;
  background: linear-gradient(135deg, #f59e0b, #2563eb);
}

.journey-step.is-done > span {
  color: #111118;
  background: #0f766e;
}

.journey-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 8px;
  background: #111118;
  color: #B8B8CC;
  cursor: pointer;
  font: 800 0.82rem var(--font-sans);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.preset-chip:hover {
  border-color: rgba(245, 158, 11, 0.56);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-1px);
}

.preset-chip.is-active {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(37, 99, 235, 0.08);
  color: #A78BFA;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.journey-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.journey-actions .action-step {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.journey-actions .btn {
  width: 100%;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
}

.journey-output .output-header {
  align-items: flex-start;
}

.journey-regen-control {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.journey-regen-control select {
  width: min(230px, 100%);
}

.journey-result {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.journey-result[hidden] {
  display: none !important;
}

.journey-summary-card {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.42fr);
  align-items: stretch;
  border-color: rgba(245, 158, 11, 0.25);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(37, 99, 235, 0.08)),
    #111118;
}

.journey-summary-card h3 {
  margin: 0 0 8px;
  color: #EDEDF5;
  font: 900 1.35rem/1.15 var(--font-display);
}

.journey-summary-card p {
  margin: 0;
  color: #B8B8CC;
  line-height: 1.5;
}

.journey-goal-box {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
}

.journey-goal-box strong {
  color: #EDEDF5;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.journey-goal-box span {
  color: #B8B8CC;
  line-height: 1.45;
}

.journey-stage-list {
  display: grid;
  gap: 12px;
}

.journey-stage-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stage-head h3 {
  margin: 0;
  color: #EDEDF5;
  font: 900 1.08rem/1.2 var(--font-display);
}

.stage-head p {
  margin: 4px 0 0;
  color: #8888A0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.stage-number {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #111118;
  background: #0f172a;
  font-weight: 900;
}

.stage-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stage-block {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #161620;
}

.stage-block h4 {
  margin: 0;
  color: #EDEDF5;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.journey-tag,
.journey-barrier {
  display: block;
  margin: 6px 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: #111118;
  color: #B8B8CC;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.42;
}

.journey-barrier {
  display: grid;
  gap: 6px;
}

.barrier-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.barrier-why {
  color: #8888A0;
  font-size: 0.8rem;
  font-weight: 600;
}

.priority-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.priority-high {
  color: #F87171;
  background: #fee2e2;
  border: 1px solid rgba(229,77,77,0.3);
}

.priority-medium {
  color: #FBBF24;
  background: #ffedd5;
  border: 1px solid rgba(251,191,36,0.3);
}

.priority-low {
  color: #34D399;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
}

.journey-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.journey-mini-card {
  align-content: start;
  background: #161620;
}

.journey-mini-card h3 {
  margin: 0;
  color: #EDEDF5;
  font: 900 1rem/1.2 var(--font-display);
}

.journey-loader {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 380px;
  padding: 34px 16px;
  text-align: center;
}

.journey-loader-map {
  position: relative;
  width: min(380px, 100%);
  height: 136px;
}

.journey-loader-map::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 64px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #2563eb, #10b981);
  opacity: 0.45;
}

.journey-loader-dot {
  position: absolute;
  top: 47px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid #111118;
  background: #f59e0b;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  animation: journey-pulse 1.25s ease-in-out infinite;
}

.journey-loader-dot:nth-child(1) { left: 6%; }
.journey-loader-dot:nth-child(2) { left: 34%; animation-delay: 0.16s; background: #2563eb; }
.journey-loader-dot:nth-child(3) { left: 62%; animation-delay: 0.32s; background: #10b981; }
.journey-loader-dot:nth-child(4) { right: 6%; animation-delay: 0.48s; background: #0f172a; }

.journey-loader strong {
  color: #EDEDF5;
  font: 900 1.35rem var(--font-display);
}

.journey-loader p {
  margin: 4px 0 0;
  color: #8888A0;
  font-weight: 700;
}

@keyframes journey-pulse {
  0%, 100% {
    transform: translateY(0) scale(0.94);
    opacity: 0.65;
  }
  50% {
    transform: translateY(-10px) scale(1);
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  .journey-workspace,
  .journey-heading {
    grid-template-columns: 1fr;
  }

  .journey-form {
    position: static;
  }
}

@media (max-width: 760px) {
  .journey-shell {
    width: 100%;
  }

  .journey-grid,
  .journey-actions,
  .journey-summary-card,
  .stage-content-grid,
  .journey-insight-grid {
    grid-template-columns: 1fr;
  }

  .journey-card-header,
  .journey-output .output-header,
  .stage-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .journey-regen-control,
  .journey-regen-control select,
  .journey-regen-control .btn {
    width: 100%;
  }

  .journey-actions .action-step {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .journey-step > span,
  .action-step > span {
    width: 26px;
    height: 26px;
  }
}


/* overflow protection */
.brief-result, .brief-output-panel, .evidence-strip { overflow-wrap: break-word; word-break: break-word; }
.brief-panel, .brief-workspace { min-width: 0; }
