/* Mystery Logic 1.2.3 — robust dossier composition.
   Content-first layout: every event spans the full dossier width and flows vertically. */

body.ktv-case-page .ktv-game-shell .ktv-stage-nav{
  position:relative!important;
  top:auto!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper,
body.ktv-case-page .ktv-game-shell .ktv-testimony,
body.ktv-case-page .ktv-game-shell .ktv-answer,
body.ktv-case-page .ktv-game-shell .ktv-result{
  scroll-margin-top:28px!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-section-head h2{
  margin:6px 0 0!important;
  max-width:900px!important;
  font-size:clamp(2rem,3.2vw,3.25rem)!important;
  line-height:1!important;
}

/* Keep the evidence stamp inside the paper instead of letting it cut across sections. */
body.ktv-case-page .ktv-game-shell .ktv-paper::after{
  top:24px!important;
  right:24px!important;
  padding:5px 13px!important;
  font-size:.54rem!important;
  letter-spacing:.16em!important;
  transform:rotate(2deg)!important;
}

/* Timeline: one dependable editorial column for every case shape. */
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline{
  display:grid!important;
  width:100%!important;
  max-width:none!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-auto-columns:minmax(0,1fr)!important;
  gap:18px!important;
  margin:30px 0 0!important;
  align-items:stretch!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline::before{
  display:none!important;
  content:none!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline>.ktv-timeline-item{
  display:grid!important;
  grid-column:1 / -1!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  gap:10px!important;
  padding:0!important;
  justify-self:stretch!important;
  align-self:stretch!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-marker{
  display:flex!important;
  justify-content:flex-start!important;
  min-width:0!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-marker::before,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-marker::after{
  display:none!important;
  content:none!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-marker span{
  width:auto!important;
  min-width:88px!important;
  padding:7px 11px!important;
  border-radius:2px!important;
}

/* Event memo: vertical flow prevents long titles or descriptions from colliding. */
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-card,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-card{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:0!important;
  padding:clamp(24px,3vw,38px)!important;
  border-radius:3px!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-head,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-head{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:8px 20px!important;
  grid-column:auto!important;
  grid-row:auto!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-head strong,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-head strong{
  max-width:760px!important;
  font-size:clamp(1.35rem,2vw,1.85rem)!important;
  line-height:1.08!important;
  overflow-wrap:anywhere!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-head span{
  flex:0 1 auto!important;
  max-width:360px!important;
  text-align:right!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-card>p,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-card>p{
  display:block!important;
  grid-column:auto!important;
  grid-row:auto!important;
  width:auto!important;
  max-width:940px!important;
  margin:20px 0 12px!important;
  font-size:clamp(.98rem,1.2vw,1.08rem)!important;
  line-height:1.72!important;
  overflow-wrap:anywhere!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-card>small,
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-card>small{
  display:block!important;
  grid-column:auto!important;
  grid-row:auto!important;
  margin-top:14px!important;
}

/* Evidence cards: readable widths, not a row of narrow tiles. */
body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-facts{
  display:grid!important;
  width:100%!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:16px!important;
}

body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-fact-card{
  min-width:0!important;
  min-height:145px!important;
  overflow-wrap:anywhere!important;
}

@media (max-width:980px){
  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-facts{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.ktv-case-page .ktv-game-shell .ktv-paper::after{
    display:none!important;
    content:none!important;
  }
}

@media (max-width:820px){
  body.ktv-case-page .ktv-game-shell .ktv-stage-nav{
    position:sticky!important;
    top:max(6px,env(safe-area-inset-top))!important;
  }

  body.ktv-case-page .ktv-game-shell .ktv-paper,
  body.ktv-case-page .ktv-game-shell .ktv-testimony,
  body.ktv-case-page .ktv-game-shell .ktv-answer,
  body.ktv-case-page .ktv-game-shell .ktv-result{
    scroll-margin-top:94px!important;
  }

  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-head span{
    max-width:none!important;
    text-align:left!important;
  }
}

@media (max-width:600px){
  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-facts{
    grid-template-columns:minmax(0,1fr)!important;
  }
}

@media (max-width:520px){
  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-section-head h2{
    font-size:clamp(1.8rem,9vw,2.55rem)!important;
  }

  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-card,
  body.ktv-case-page .ktv-game-shell .ktv-paper .ktv-timeline-item:only-child .ktv-timeline-card{
    padding:20px!important;
  }
}
