/* Screen 7: the journey reel, the zoom detail. */

.journey { position: relative; height: 100dvh; overflow: hidden; background: var(--lk-paper); }
.j-top {
  position: absolute; z-index: 5; inset: 0 0 auto 0; display: flex; align-items: center; gap: var(--sp-3);
  padding: max(var(--sp-3), env(safe-area-inset-top)) var(--sp-4) var(--sp-3);
  background: linear-gradient(var(--lk-paper) 55%, rgb(241 244 242 / 0));
  pointer-events: none;
}
.j-top > * { pointer-events: auto; }
.j-top .brand { width: 28px; height: 28px; color: var(--lk-brand); }
.j-progress { flex: 1; color: var(--lk-ink-faint); }

.reel {
  height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none; outline: none;
}
.reel::-webkit-scrollbar { display: none; }
.card {
  min-height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  padding: calc(64px + env(safe-area-inset-top)) var(--sp-5) calc(88px + env(safe-area-inset-bottom));
  position: relative;
}
.card + .card { border-top: 1px solid var(--lk-line); }
.card-inner { width: 100%; max-width: 32rem; display: grid; gap: var(--sp-4); align-content: center; }
.card h2:focus { outline: none; }
.card h2:focus-visible { box-shadow: none; }

/* rail + nav */
.j-rail {
  position: absolute; z-index: 5; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; gap: 2px;
}
.j-rail button { width: 24px; height: 18px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.j-rail button::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--lk-line-strong); transition: all var(--t-med) var(--ease-out); }
.j-rail button.is-current::before { height: 16px; border-radius: 3px; background: var(--lk-brand); }
.j-nav {
  position: absolute; z-index: 5; right: var(--sp-4); bottom: max(var(--sp-4), env(safe-area-inset-bottom));
  display: flex; gap: var(--sp-2);
}
.j-nav .icon-btn { box-shadow: 0 4px 14px -6px rgb(20 40 38 / 0.3); }
.j-nav .icon-btn:disabled { visibility: hidden; }
.j-nav .icon-btn { background: var(--lk-surface); }

/* motifs */
.motif { width: 100%; height: 100%; }
.motif .m-line { stroke: var(--lk-brand); stroke-width: 2; fill: none; }
.motif .m-soft { fill: var(--lk-brand-tint); stroke: none; }
.motif .m-accent { stroke: var(--lk-brass); stroke-width: 2.4; fill: none; }
.motif .m-accent-fill { fill: var(--lk-brass); stroke: none; opacity: 0.9; }
.is-look .motif .m-soft { fill: var(--st-look-tint); }

/* overview */
.card-overview .card-inner { align-content: start; }
.overview-rose { width: 44px; color: var(--lk-brand); }
.overview-intro { font-family: var(--lk-font-display); font-size: var(--fs-1); line-height: 1.45; text-wrap: pretty; }
.replayed { color: var(--lk-brand); }
.tiles { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.tile {
  width: 100%; height: 100%; min-height: 128px; text-align: left; cursor: pointer; display: grid; align-content: start; gap: 6px;
  padding: var(--sp-3) var(--sp-3) var(--sp-4); border-radius: var(--lk-radius-m); border: 1px solid var(--lk-line);
  background: var(--lk-surface); transition: transform var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: var(--lk-line-strong); }
.tile:active { transform: scale(0.985); }
.tile.is-look { border-color: color-mix(in srgb, var(--st-look) 45%, var(--lk-line)); }
.tile-motif { width: 40px; height: 40px; }
.tile-title { font-weight: 600; line-height: 1.25; }
.tile-count { color: var(--lk-ink-faint); }
.tile .mark { font-size: 0.78rem; }
.swipe-hint { display: flex; align-items: center; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-3); color: var(--lk-ink-faint); }
.swipe-hint svg { width: 18px; height: 18px; animation: hint 2.2s ease-in-out 1.5s 3; }
@keyframes hint { 50% { transform: translateY(-5px); } }

/* chapter */
.chapter-topic { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; color: var(--lk-ink-soft); }
.chapter-motif { width: 52px; height: 52px; flex: none; }
.chapter-headline { font-size: var(--fs-3); }
.chapter-summary { color: var(--lk-ink-soft); text-wrap: pretty; }
.chapter-values { display: grid; gap: var(--sp-4); }
.value { display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4) var(--sp-3); border-radius: var(--lk-radius-m); background: var(--lk-surface); }
.value-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-3); align-items: baseline; }
.value-name { font-weight: 600; }
.value-tech { font-weight: 400; color: var(--lk-ink-faint); font-size: var(--fs--1); }
.value-word { font-size: var(--fs--1); font-weight: 600; }
.value.is-in .value-word { color: var(--st-calm-ink); }
.value.is-look .value-word { color: var(--st-look-ink); }
.value-num { line-height: 1; margin-top: var(--sp-1); }
.value-num .num { font-size: var(--fs-num); letter-spacing: -0.02em; }
.value-unit { color: var(--lk-ink-soft); font-size: var(--fs-0); }
.value-range { margin-top: -4px; }
.value-spark { margin-top: var(--sp-1); }

.rangebar { width: 100%; height: auto; overflow: visible; }
.rb-fade0 { stop-color: var(--lk-line); stop-opacity: 0; }
.rb-fade1 { stop-color: var(--lk-line-strong); stop-opacity: 1; }
.rb-band { fill: var(--st-calm-tint); stroke: var(--st-calm); stroke-width: 1; stroke-opacity: 0.5; }
.rb-edge { stroke: var(--st-calm); stroke-width: 1.5; stroke-linecap: round; }
.rb-tick { font: 600 11px var(--lk-font-body); fill: var(--lk-ink-soft); font-variant-numeric: tabular-nums; }
.rb-value { font: 600 13px var(--lk-font-body); fill: var(--lk-ink); font-variant-numeric: tabular-nums; }
.rb-fill { fill: var(--st-calm); }
.rb-halo { fill: var(--lk-surface); }
.rb-ring { fill: var(--lk-surface); stroke: var(--st-look); stroke-width: 3; }
.is-look .rb-value { fill: var(--st-look-ink); }

.sparkline { width: 100%; height: auto; overflow: visible; }
.sp-band { fill: var(--st-calm-tint); }
.sp-line { fill: none; stroke: var(--lk-ink-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sp-pt { fill: var(--lk-surface); stroke: var(--st-calm-ink); stroke-width: 1.6; }
.sp-pt.is-look { stroke: var(--st-look); }
.sp-pt.is-last { fill: var(--st-calm); stroke: var(--lk-surface); stroke-width: 2; }
.sp-pt.is-last.is-look { fill: var(--lk-surface); stroke: var(--st-look); stroke-width: 3; }
.sp-label { font: 500 11px var(--lk-font-body); fill: var(--lk-ink-faint); }

.chapter-why h3, .actions-h { font-size: var(--fs-0); font-weight: 600; }
.chapter-why p { color: var(--lk-ink-soft); margin-top: var(--sp-1); }
.actions { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.action { display: grid; grid-template-columns: 40px 1fr; gap: var(--sp-3); align-items: start; }
.action-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lk-brand-tint); color: var(--lk-brand-strong); }
.action-icon svg { width: 22px; height: 22px; }
.action-body { display: grid; gap: 2px; padding-top: 0.45rem; }
.action-title { font-weight: 600; line-height: 1.3; }
.action-how { color: var(--lk-ink-soft); }
.action-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; color: var(--lk-ink-faint); }
.evidence { display: inline-block; padding: 0.05rem 0.55rem; border-radius: var(--lk-radius-chip); border: 1px solid var(--lk-line-strong); color: var(--lk-ink-soft); font-size: 0.75rem; font-weight: 600; }
.evidence.ev-gut_belegt { border-color: var(--st-calm); color: var(--st-calm-ink); }
.chapter-more { justify-self: start; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-5); counter-reset: none; }
.step { display: grid; grid-template-columns: 2rem 1fr; gap: var(--sp-3); align-items: start; }
.step-n { font-size: var(--fs-3); line-height: 1; color: var(--lk-brass); }
.step-body { display: grid; gap: var(--sp-1); }
.step-title { font-family: var(--lk-font-display); font-size: var(--fs-2); line-height: 1.15; }
.step-how { color: var(--lk-ink-soft); }
.step-meta { display: flex; align-items: center; gap: var(--sp-2); color: var(--lk-ink-faint); }
.step-meta .action-icon { width: 26px; height: 26px; }
.step-meta .action-icon svg { width: 16px; height: 16px; }

/* pharmacy */
.card-pharmacy .card-inner { align-content: start; }
.ph-sub { font-family: var(--lk-font-display); font-size: var(--fs-1); color: var(--lk-ink-soft); }
.pharmacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.pharmacy-list > li { display: grid; grid-template-columns: 24px 1fr; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--lk-radius-m); background: var(--lk-surface); }
.pharmacy-icon { color: var(--lk-brand); width: 22px; }
.pharmacy-text { display: block; color: var(--lk-ink-soft); margin-top: var(--sp-2); font-size: var(--fs--1); }
.ph-status { display: block; margin-top: var(--sp-1); color: var(--st-look-ink); font-size: var(--fs--1); }
.ph-q { margin: var(--sp-2) 0 0; padding-left: 1.1rem; color: var(--lk-ink-soft); font-size: var(--fs--1); }
.ph-block h3 { font-size: var(--fs-0); font-weight: 600; margin-bottom: var(--sp-1); }
.ph-block ul { margin: 0; padding-left: 1.1rem; color: var(--lk-ink-soft); }
.pharmacy-disclaimer { padding-top: var(--sp-3); border-top: 1px solid var(--lk-line); }

/* take away */
.take-actions { display: grid; gap: var(--sp-2); }
.take-delete { display: grid; justify-items: start; }
.delete-confirm { display: grid; gap: var(--sp-2); justify-items: start; }
.disclaimer { padding-top: var(--sp-4); border-top: 1px solid var(--lk-line); }
.made-by { color: var(--lk-ink-faint); }

/* detail (zoom) */
.detail {
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100dvh;
  background: transparent;
}
.detail::backdrop { background: rgb(20 40 38 / 0.32); }
.detail-sheet {
  position: relative; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--lk-paper); margin-left: auto; width: 100%; max-width: 40rem;
}
@media (min-width: 48rem) { .detail-sheet { box-shadow: -24px 0 48px -24px rgb(20 40 38 / 0.35); } }
.detail.is-entering .detail-sheet { animation: sheet-in 360ms var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.detail-close { position: sticky; top: max(var(--sp-3), env(safe-area-inset-top)); display: flex; margin: var(--sp-3) var(--sp-3) -56px auto; z-index: 2; }
.detail-body { padding: var(--sp-6) var(--sp-5) var(--sp-8); display: grid; gap: var(--sp-5); max-width: 36rem; margin: 0 auto; }
.detail-hero { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-4); align-items: center; padding-right: 48px; }
@media (min-width: 48rem) { .detail-hero { grid-template-columns: 72px 1fr; } }
.detail-motif { width: 100%; aspect-ratio: 1; }
.detail-topic { color: var(--lk-ink-soft); font-weight: 600; }
.detail-title { font-size: var(--fs-3); margin: 2px 0 var(--sp-2); }
.detail-title:focus { outline: none; }
.detail-sec { display: grid; gap: var(--sp-3); }
.detail-sec > h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-1); font-family: var(--lk-font-display); font-weight: 400; padding-top: var(--sp-4); border-top: 1px solid var(--lk-line); }
.detail-sec > h3 svg { width: 22px; height: 22px; color: var(--lk-brand); }
.detail-value { display: grid; gap: var(--sp-2); }
.value-spark.big { padding: var(--sp-3); background: var(--lk-surface); border-radius: var(--lk-radius-m); }
.hist { border-collapse: collapse; width: 100%; font-size: var(--fs--1); }
.hist th, .hist td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--lk-line); }
.hist th { color: var(--lk-ink-soft); font-weight: 600; }
.hist td.num { text-align: right; font-family: var(--lk-font-body); }
.hist th:last-child { text-align: right; }
.outside-note { display: grid; grid-template-columns: 20px 1fr; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--lk-radius-s); background: var(--st-look-tint); color: var(--st-look-ink); }
.outside-note svg { width: 20px; height: 20px; }
.note-sec { padding: 0 var(--sp-4) var(--sp-4); border-radius: var(--lk-radius-m); background: var(--lk-surface); }
.note-sec > h3 { border-top: 0; }
.actions-full { gap: var(--sp-4); }
.refs { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.ref-title { font-weight: 600; line-height: 1.35; }
.ref-title a { color: var(--lk-ink); text-decoration-color: var(--lk-line-strong); }
.ref-title a:hover { color: var(--lk-brand); }
.ref-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-top: 2px; }
.detail-foot { color: var(--lk-ink-faint); }

/* View Transition: tile or chapter motif grows into the detail header */
::view-transition-group(lk-zoom) { animation-duration: 420ms; animation-timing-function: cubic-bezier(.22,.8,.26,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 300ms; }

@media (min-width: 60rem) {
  .card-chapter .card-inner { max-width: 34rem; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.value-range { margin-top: var(--sp-2); }
@media (max-width: 599px) {
  .j-nav .icon-btn:first-child { display: none; }
}
