/* The book stays in the existing 440px mobile frame on larger screens. */
body.consulting {
  margin: 0;
  overflow: hidden;
  background: #0b090c !important;
}

body.consulting > :is(.shell, .dock, #compareBar, #compareBoard) {
  display: none;
}

.journey[hidden] {
  display: none;
}

.journey {
  --journey-side: clamp(18px, 5vw, 26px);
  --journey-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  --journey-text: #fff9f7;
  --journey-muted: #dccdd0;
  --journey-accent: #ee8399;
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 440px);
  height: 100%;
  height: 100dvh;
  margin-inline: auto;
  color: var(--journey-text);
  background: #110b10;
  color-scheme: dark;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.journeyScene {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: #160e14;
}

.journeyScene > :is(img, video) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 24%;
}

.journeyScene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #130a11a8, #130a1114 15%, #130a110d 32%, #130a116b 61%, #100a10db 90%, #0f0a10);
}

#consultView .journeyHeader {
  position: relative;
  z-index: 2;
  inset: auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) 12px 4px;
  background: linear-gradient(180deg, #100c10e8, #100c107a);
  backdrop-filter: none;
}

#consultView .journeyHeader::before,
#consultView .journeyHeader::after {
  content: none;
}

.journeyIcon {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}

.journeyIcon svg {
  width: 22px;
  height: 22px;
}

.journeyProduct {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .925rem;
  font-weight: 650;
  letter-spacing: -.035em;
  text-shadow: 0 1px 8px #12090db3;
}

.journeyProgress {
  z-index: 1;
  height: 2px;
  background: #f8dae52b;
}

.journeyProgress > span {
  display: block;
  height: 100%;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, #a72f4b, #fb9aa7);
  transition: width .22s ease-out;
}

.journeyBody {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-color: #80505c transparent;
  scrollbar-width: thin;
  scroll-padding-block: 16px var(--journey-bottom);
}

/* Auto margin consumes spare space; it collapses for a long form or open keyboard. */
.journeyPanel {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  display: grid;
  align-content: end;
  gap: 13px;
  min-width: 0;
  width: 100%;
  margin: auto 0 0;
  padding: 27px var(--journey-side) var(--journey-bottom);
}

.journeyPanel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -64px 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, #110c12e8 75px, #110c12f8 140px, #100b11);
}

.journeyTitle, .journeyLine, .journeyTopic, .journeyHint,
.journeyCount, .journeyError, .journeyPanel h3, .journeyPanel h4 {
  margin: 0;
}

.journeyTitle, .journeyLine {
  color: var(--journey-text);
  font-family: "Noto Serif CJK KR", "AppleMyungjo", "Batang", serif;
  font-size: clamp(1.42rem, 5.6vw, 1.72rem);
  font-weight: 700;
  line-height: 1.43;
  letter-spacing: -.055em;
  text-wrap: pretty;
  text-shadow: 0 1px 12px #1408126b;
}

.journeyTopic, .journeyHint {
  color: var(--journey-muted);
  font-size: .925rem;
  line-height: 1.55;
  letter-spacing: -.015em;
}

.journeyLine {
  white-space: pre-line;
}

.journey[data-page="intro"] .journeyTitle {
  font-size: clamp(2rem, 8.3vw, 3rem);
  line-height: 1.26;
}

.journey[data-page="intro"] .journeyTopic {
  color: #f0d5d6;
  font-weight: 550;
}

.journey[data-page="story"] .journeyPanel {
  gap: 19px;
}

.journeyFields, .journeyChoices, .journeyLabel, .journeyActions {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.journeyLabel {
  color: #efdee3;
  font-size: .925rem;
  font-weight: 600;
}

.journey .journeyInput, .journeyChoice, .journeySegment, .journeyAction, .journeySecondary {
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  border: 1px solid #85606a;
  border-radius: 14px;
  color: var(--journey-text);
  background: #241920ee;
  font: inherit;
  line-height: 1.4;
}

.journey .journeyInput {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-size: 1rem;
  text-align: start;
}

.journeyInput::placeholder {
  color: #af9da4;
  opacity: 1;
}

.journey textarea.journeyInput {
  min-height: 96px;
  resize: vertical;
}

.journeyChoice, .journeySegment, .journeyAction, .journeySecondary {
  padding: 12px 15px;
  touch-action: manipulation;
}

.journeyChoice {
  width: 100%;
  min-height: 47px;
  background: #211820f5;
  border-color: #78535f;
  text-align: center;
  font-size: .9875rem;
  font-weight: 550;
}

.journeySegments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.journeySegment {
  flex: 1 1 auto;
  min-height: 45px;
  border-radius: 12px;
  font-size: .94rem;
}

.journey :is(.journeyChoice, .journeySegment):is([aria-pressed="true"], [aria-checked="true"], .selected) {
  color: #fff7f8;
  border-color: #f8a1b4;
  background: #502431;
}

.journeyActions {
  margin-top: 4px;
}

.journeyAction, .journeySecondary {
  width: 100%;
  min-height: 48px;
  font-weight: 700;
}

.journeyAction {
  border-color: #c94664;
  background: #ab2d4a;
}

.journeySecondary {
  min-height: 44px;
  color: #f1d5dd;
  border-color: #694b57;
  background: #271b23;
}

.journey button:disabled {
  cursor: default;
  opacity: .52;
}

.journey :is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid #ffe3ea;
  outline-offset: 2px;
}

.journeyCount {
  color: #d6b1bc;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.journeyError {
  color: #ffb6ca;
  font-weight: 550;
  font-size: .925rem;
  line-height: 1.5;
}

.journey :is(.journeyError, .journeyFields, .journeyActions):empty {
  display: none;
}

.journey[data-page="result"] .journeyScene::after {
  background: linear-gradient(180deg, #150e1599, #120c12cd 28%, #100b11);
}

.journey[data-page="result"] .journeyPanel {
  line-height: 1.6;
}

.journey .surveySummary {
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #62414d;
}

.journey :is(.surveySummary, .surveyEvidenceGroup) > summary {
  padding-block: 4px;
  cursor: pointer;
  font-weight: 650;
  color: #f9dbe4;
}

.journey .surveySummary p {
  margin: 6px 0 10px;
}

.journey .surveySummary small {
  color: #ccb6bf;
}

@media (hover: hover) {
  .journey :is(.journeyChoice, .journeySegment, .journeySecondary):enabled:hover {
    border-color: #c78b9d;
    background: #36212b;
  }
  .journeyAction:enabled:hover { background: #bf3857; }
  .journeyIcon:hover { background: #412732b3; }
}

@media (min-height: 760px) {
  .journey[data-page="intro"] .journeyPanel,
  .journey[data-page="story"] .journeyPanel {
    padding-bottom: max(34px, var(--journey-bottom));
  }
}

@media (max-height: 590px) {
  .journeyPanel { padding-top: 15px; gap: 10px; }
  .journeyScene::after { background: linear-gradient(#130a1199, #130a114d 28%, #100b11dc 82%); }
}

@media (prefers-reduced-motion: reduce) {
  .journey *, .journey *::after, .journey *::before {
    animation-duration: 0s;
    transition-duration: 0s;
    scroll-behavior: auto;
  }
}

.readingTerm{display:inline;min-width:0;min-height:0;border:0;border-radius:2px;background:transparent;color:inherit;font:inherit;font-weight:inherit;line-height:inherit;padding:0;cursor:pointer;text-decoration:underline dotted #ef99af;text-underline-offset:.2em}
.readingTerm:focus-visible,.readingTermDialog button:focus-visible{outline:2px solid #ffd0df;outline-offset:2px}
.readingTermDialog{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(21rem,calc(100% - 32px));max-height:80vh;overflow:auto;padding:1.2rem;border:1px solid #85445a;border-radius:16px;background:#291c22;color:#fff3f6;box-shadow:0 14px 50px #0008;font:inherit}
.readingTermDialog::backdrop{background:#130b11a3}
.readingTermDialog strong{display:block;font-size:1.1rem}
.readingTermDialog p{margin:.6rem 0 1rem;line-height:1.65;word-break:keep-all;overflow-wrap:anywhere}
.readingTermDialog button{border:1px solid #95576b;border-radius:9px;background:#3b252d;color:#fff1f5;min-height:44px;padding:.4em 1.1em;font:inherit;cursor:pointer}
