:root { --journey-footer-height: 88px; --journey-shell-max-width: 82rem; --journey-phase-rail-width: clamp(12rem, 18vw, 14rem); --journey-content-max-width: var(--journey-shell-max-width); }
.page-shell.journey-page {
  max-width: var(--journey-shell-max-width);
  padding-bottom: 1rem;
  transition: opacity 90ms ease;
}
.page-shell.journey-page.journey-step-transitioning { opacity: 0; pointer-events: none; }
.page-shell.journey-page .page-shell-header { margin-bottom: 0.6rem; }
.page-shell.journey-page .page-shell-header h2 { font-size: clamp(1.28rem, 1.2vw + 0.95rem, 1.65rem); line-height: 1.2; }
.journey-main-layout { min-height: 0; min-width: 0; }
.journey-content-column { width: 100%; min-width: 0; }
.journey-phase-rail-stack { display: grid; gap: 0.75rem; }
.journey-phase-rail-tools:empty { display: none; }
.journey-case-context-wrap {
  width: 100%;
  max-width: var(--journey-content-max-width);
  margin: 0 auto 0.9rem;
}
.journey-case-context {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(53, 95, 117, 0.42);
  border-radius: 0.9rem;
  background: rgba(12, 24, 34, 0.72);
}
.journey-case-context-band {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.journey-case-context-row {
  display: grid;
  gap: 0.2rem;
  align-content: start;
  min-width: 0;
}
.journey-case-context dt {
  margin: 0;
  color: #8da5b4;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
}
.journey-case-context dd {
  min-width: 0;
  margin: 0;
  color: #e7f2f6;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.journey-content-grid { padding-top: clamp(1.25rem, 3vh, 2.25rem); }
.journey-content-grid.journey-content-grid-start { padding-top: clamp(0.8rem, 2vh, 1.35rem); }

.journey-stage-stack {
  width: 100%;
  max-width: var(--journey-content-max-width);
  min-width: 0;
  margin-inline: auto;
}

.journey-stage-stack > :where(section, article), .journey-stage-stack .form-page-shell, .journey-stage-stack .form-page-card { width: 100%; max-width: none; min-width: 0; }

.journey-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px dashed rgba(77, 208, 167, 0.42);
  border-radius: 0.85rem;
  background: rgba(8, 15, 20, 0.45);
}

.journey-scroll-cue-copy {
  margin: 0;
  font-size: 0.8rem;
  color: #c3d7e2;
}

.journey-scroll-cue-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(77, 208, 167, 0.55);
  background: rgba(34, 193, 145, 0.18);
  color: #e7fff5;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.38rem 0.72rem;
  white-space: nowrap;
}

.journey-scroll-cue-button:hover {
  background: rgba(34, 193, 145, 0.27);
}

.journey-scroll-cue-arrow {
  display: inline-flex;
  animation: journey-scroll-cue-bob 1.15s ease-in-out infinite;
}

@keyframes journey-scroll-cue-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
}

.journey-start-pane {
  min-width: 0;
}

.journey-start-suggestions {
  padding-top: 0.2rem;
}

.journey-sticky-footer {
  position: static;
  margin-top: 0.55rem;
  padding: 0.65rem 0 calc(env(safe-area-inset-bottom) + 0.72rem);
}

.journey-sticky-footer-inner {
  max-width: none;
  width: 100%;
  margin-inline: auto;
  padding: 0.68rem 0.8rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
}

.journey-nav-btn {
  min-width: clamp(7.5rem, 14vw, 10rem);
  border-radius: 0.6rem;
  padding: 0.58rem 0.95rem;
  font-size: 0.92rem;
  border: 1px solid rgba(158, 178, 191, 0.35);
}

.journey-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.journey-download-error {
  margin: 0.45rem 0 0;
  color: #fecdd3;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.journey-nav-btn.primary {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.8);
  color: #fff;
  margin-inline-start: auto;
}

@media (max-width: 767px) {
  .journey-case-context-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.journey-nav-btn.primary:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.95);
}

.journey-nav-btn.secondary {
  color: #d6e2e9;
  background: rgba(22, 41, 53, 0.58);
}

.journey-nav-btn.secondary:hover:not(:disabled) {
  background: rgba(42, 79, 100, 0.4);
}

.required-marker {
  color: #f87171;
}

@media (max-width: 1023px) {
  .journey-sticky-footer-inner {
    padding: 0.58rem 0.64rem;
  }
}

@media (min-width: 1024px) {
  .journey-main-layout {
    min-height: 0;
  }

  .journey-content-grid {
    padding-top: 0.5rem;
  }

  .journey-content-grid.journey-content-grid-start {
    padding-top: 0.38rem;
  }

  .journey-scroll-cue {
    padding: 0.62rem 0.86rem;
  }

  .journey-sticky-footer-inner {
    padding: 0.76rem 0.92rem;
    border-radius: 0.95rem;
  }

  .journey-nav-btn {
    min-width: clamp(8rem, 13vw, 10rem);
    min-height: 2.95rem;
    padding: 0.68rem 1rem;
    font-size: 0.98rem;
  }

}

@media (max-width: 767px) {
  .journey-sticky-footer-inner {
    flex-wrap: wrap;
    border-radius: 1rem;
  }

  .journey-nav-btn {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .journey-nav-btn.primary {
    margin-inline-start: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  .journey-scroll-cue-arrow {
    animation: none;
  }
}

.journey-report-preview {
  line-height: 1.8;
  color: #f3f4f6;
  text-align: start;
  overflow-wrap: anywhere;
  padding: clamp(1.25rem, 2vw, 2rem);
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.journey-report-preview > :first-child {
  margin-block-start: 0;
}

.journey-report-preview :where(h1, h2, h3, h4) {
  margin: 1.25rem 0 0.65rem;
  color: #f8fbfd;
  font-weight: 700;
  line-height: 1.35;
}

.journey-report-preview :where(h1) {
  margin: 0 0 0.85rem;
  font-size: 1.42rem;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.journey-report-preview :where(h2) {
  margin-top: 1.55rem;
  font-size: 1.08rem;
}

.journey-report-preview :where(h3, h4) {
  font-size: 1rem;
}

.journey-report-preview :where(p, ul, ol, blockquote, table, pre) {
  margin: 0 0 0.9rem;
}

.journey-report-preview :where(ul, ol) {
  padding-inline-start: 1.4rem;
}

.journey-report-preview :where(ul) {
  list-style: disc;
}

.journey-report-preview :where(ol) {
  list-style: decimal;
}

.journey-report-preview :where(li + li) {
  margin-top: 0.35rem;
}

.journey-report-preview :where(blockquote) {
  padding: 0.8rem 1rem;
  border-inline-start: 3px solid rgba(34, 193, 145, 0.45);
  background: rgba(18, 34, 46, 0.72);
  color: #d6e2e9;
}

.journey-report-preview :where(code, pre) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
}

.journey-report-preview :where(code) {
  border-radius: 0.35rem;
  background: rgba(15, 26, 34, 0.92);
  padding: 0.12rem 0.32rem;
  font-size: 0.92em;
}

.journey-report-preview :where(pre) {
  overflow-x: auto;
  border: 1px solid rgba(53, 95, 117, 0.8);
  border-radius: 0.75rem;
  background: rgba(8, 17, 23, 0.94);
  padding: 0.95rem 1rem;
  white-space: pre-wrap;
}

.journey-report-preview :where(pre code) {
  background: transparent;
  padding: 0;
}

.journey-report-preview :where(table) {
  width: 100%;
  border-collapse: collapse;
}

.journey-report-preview :where(h1 + table) {
  width: min(100%, 40rem);
  margin: 0 auto 1.35rem;
  border-collapse: separate;
  border-spacing: 0 0.2rem;
  direction: rtl;
}

.journey-report-preview :where(th, td) {
  border: 1px solid rgba(53, 95, 117, 0.72);
  padding: 0.55rem 0.7rem;
  vertical-align: top;
}

.journey-report-preview :where(h1 + table th, h1 + table td) {
  border: 0;
  background: transparent;
  padding: 0.08rem 0.5rem;
  font-size: 1.02rem;
  line-height: 1.55;
}

.journey-report-preview :where(h1 + table th) {
  width: 46%;
  color: #f8fbfd;
  text-align: right;
  font-weight: 700;
}

.journey-report-preview :where(h1 + table td) {
  text-align: center;
}

.journey-report-preview :where(th) {
  background: rgba(18, 34, 46, 0.88);
  color: #f8fbfd;
  font-weight: 700;
}

.journey-report-preview :where(a) {
  color: #7ae0be;
  text-decoration: underline;
}
.report-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.72);
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.82);
}

.report-editor__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.55rem;
  overflow-x: auto;
  border-bottom: 1px solid rgba(71, 85, 105, 0.68);
  background: rgba(15, 23, 42, 0.98);
  scrollbar-width: thin;
}

.report-editor__tool {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding-inline: 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  color: #e2e8f0;
  white-space: nowrap;
}

.report-editor__tool:hover,
.report-editor__tool:focus-visible {
  border-color: rgba(52, 211, 153, 0.75);
  background: rgba(16, 185, 129, 0.16);
  color: #fff;
}

.report-editor__tool--label {
  min-width: auto;
  font-size: 0.78rem;
  font-weight: 650;
}

.report-editor__separator {
  flex: 0 0 1px;
  align-self: stretch;
  margin-block: 0.3rem;
  background: rgba(100, 116, 139, 0.68);
}

.report-editor__save-state {
  flex: 0 0 auto;
  margin-inline-start: auto;
  padding-inline: 0.45rem;
  color: #94a3b8;
  font-size: 0.75rem;
  white-space: nowrap;
}

.report-editor__save-state.is-saving,
.report-editor__save-state.is-dirty {
  color: #fcd34d;
}

.report-editor__save-state.is-saved {
  color: #6ee7b7;
}

.report-editor__save-state.is-error {
  color: #fda4af;
}

.report-editor__surface {
  min-height: 18rem;
  padding: clamp(1rem, 2.5vw, 2rem);
  color: #e5e7eb;
  line-height: 1.85;
  overflow-wrap: anywhere;
  outline: none;
}

.report-editor__surface:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.82);
}

.report-editor__surface table {
  display: table;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.report-editor__surface th,
.report-editor__surface td {
  padding: 0.55rem;
  border: 1px solid rgba(100, 116, 139, 0.7);
  overflow-wrap: anywhere;
}

.report-editor__surface a {
  color: #6ee7b7;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.report-editor__link-form,
.report-editor__error,
.report-editor__protected-note {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(71, 85, 105, 0.68);
  font-size: 0.8rem;
}

.report-editor__link-form .ui-field-input {
  min-width: 8rem;
  flex: 1 1 18rem;
}

.report-editor__error {
  border-top: 1px solid rgba(244, 63, 94, 0.4);
  border-bottom: 0;
  color: #fecdd3;
}

.report-editor__protected-note {
  border-top: 1px solid rgba(100, 116, 139, 0.45);
  border-bottom: 0;
  color: #cbd5e1;
}

@media (max-width: 639px) {
  .report-editor__surface {
    min-height: 16rem;
    padding: 1rem;
  }

  .report-editor__save-state {
    margin-inline-start: 0.25rem;
  }
}

.report-stage-shell,
.report-review-shell,
.report-review-workspace,
.report-review-document,
.report-review-editor-pane,
.report-review-preview-pane {
  min-width: 0;
  min-height: 0;
}

.report-review-shell {
  display: flex;
  flex-direction: column;
  height: min(74dvh, 52rem);
  overflow: hidden;
  border: 1px solid rgba(53, 95, 117, 0.58);
  border-radius: 1rem;
  background: rgba(8, 18, 27, 0.78);
}

.report-review-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(53, 95, 117, 0.42);
}

.report-review-eyebrow,
.report-review-outline-title {
  margin: 0 0 0.3rem;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 800;
}

.report-review-actions,
.report-review-mode-tabs,
.report-review-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.report-review-primary,
.report-review-secondary,
.report-review-mode-tabs button,
.report-review-history button {
  min-height: 2.5rem;
  border: 1px solid rgba(100, 116, 139, 0.65);
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.report-review-primary {
  border-color: rgba(52, 211, 153, 0.7);
  background: rgba(5, 150, 105, 0.86);
  color: #fff;
}

.report-review-mode-tabs {
  flex: 0 0 auto;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(53, 95, 117, 0.36);
}

.report-review-mode-tabs button.is-active,
.report-review-history button.is-active {
  border-color: rgba(52, 211, 153, 0.75);
  background: rgba(16, 185, 129, 0.16);
  color: #d1fae5;
}

.report-review-workspace {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(9.5rem, 10.5rem) minmax(0, 1fr);
  overflow: hidden;
}

.report-review-outline {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem;
  border-inline-end: 1px solid rgba(53, 95, 117, 0.42);
  background: rgba(8, 18, 27, 0.72);
  scrollbar-gutter: stable;
}

.report-review-outline ol {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-review-outline button {
  display: grid;
  width: 100%;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: start;
  gap: 0.45rem;
  padding: 0.6rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  color: #9fb3c1;
  text-align: start;
}

.report-review-outline button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.7);
  font-size: 0.68rem;
}

.report-review-outline button strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  line-height: 1.45;
}

.report-review-outline button.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.12);
  color: #f0fdf4;
}

.report-review-document {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(0.75rem, 1.6vw, 1.2rem);
  scrollbar-gutter: stable;
}

.report-review-editor-pane,
.report-review-preview-pane {
  max-width: 62rem;
  margin-inline: auto;
}

.report-review-editor-pane > h3 {
  margin: 0 0 0.65rem;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
}

.report-review-preview-pane .journey-report-preview {
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.76);
}

.report-review-loading,
.report-review-error {
  margin: 0;
  padding: 0.75rem 1rem;
  color: #cbd5e1;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.report-review-error {
  color: #fecdd3;
}

.report-review-history {
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  border-top: 1px solid rgba(53, 95, 117, 0.36);
  color: #94a3b8;
  font-size: 0.75rem;
}

@media (max-width: 767px) {
  .report-review-shell {
    height: min(76dvh, 46rem);
  }

  .report-review-header {
    display: grid;
  }

  .report-review-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .report-review-outline {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.55rem;
    border-inline-end: 0;
    border-bottom: 1px solid rgba(53, 95, 117, 0.42);
  }

  .report-review-outline-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .report-review-outline ol {
    display: flex;
    width: max-content;
  }

  .report-review-outline li {
    width: min(15rem, 70vw);
  }
}
