/* Structured case-thread presentation */

.modal-card:has(.case-thread){
  width:min(880px,100%);
}

.case-thread-header{
  padding-right:34px;
  margin-bottom:22px;
}

.case-thread-header h2{
  margin:14px 0 10px;
}

.case-thread-byline{
  color:#6d7888;
  font-size:14px;
  margin:0;
}

.case-thread-status-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.case-snapshot{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:20px 0 28px;
}

.case-snapshot-item{
  border:1px solid #dce4ef;
  background:#f8fafc;
  border-radius:14px;
  padding:13px 14px;
  min-width:0;
}

.case-snapshot-item span{
  display:block;
  color:#748092;
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-bottom:4px;
}

.case-snapshot-item strong{
  display:block;
  font-size:14px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.case-journey-title{
  margin:4px 0 18px;
  font-size:22px;
}

.case-journey{
  position:relative;
  display:grid;
  gap:14px;
  margin-bottom:30px;
}

.case-journey::before{
  content:"";
  position:absolute;
  left:17px;
  top:22px;
  bottom:22px;
  width:2px;
  background:#dbe5f2;
}

.case-stage{
  position:relative;
  display:grid;
  grid-template-columns:36px 1fr;
  gap:13px;
  align-items:start;
}

.case-stage-number{
  width:36px;
  height:36px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#e7f0ff;
  color:#24589e;
  border:2px solid #fff;
  box-shadow:0 0 0 1px #cad9ed;
  font-weight:800;
  font-size:13px;
  z-index:1;
}

.case-stage.final .case-stage-number{
  background:#e8f7ef;
  color:#16794b;
  box-shadow:0 0 0 1px #bce3cd;
}

.case-stage-card{
  border:1px solid #dce4ef;
  background:#fff;
  border-radius:16px;
  padding:16px 17px;
}

.case-stage-card h3{
  margin:0 0 8px;
  font-size:17px;
}

.case-stage-card p{
  margin:0;
  color:#465466;
  overflow-wrap:anywhere;
}

.case-stage-card .case-not-recorded{
  color:#8993a1;
  font-style:italic;
}

.case-stage.final .case-stage-card{
  border-color:#bfe1ce;
  background:#f4fbf7;
}

.case-outcome-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  margin-top:12px;
  color:#617083;
  font-size:13px;
}

.case-discussion{
  border-top:1px solid #e1e7ef;
  padding-top:25px;
  margin-top:6px;
}

.case-discussion-head{
  display:flex;
  justify-content:space-between;
  gap:15px;
  align-items:center;
  margin-bottom:14px;
}

.case-discussion-head h3{
  margin:0;
  font-size:22px;
}

.case-reply-count{
  color:#738092;
  font-size:13px;
  font-weight:700;
}

.case-thread .reply{
  border:1px solid #e0e6ee;
  background:#f8fafc;
}

.reply-author-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}

.reply-author-row small{
  color:#7b8796;
}

.case-thread-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  border-top:1px solid #e1e7ef;
  margin-top:24px;
  padding-top:20px;
}

.case-thread-actions .danger-link{
  color:#a02b2b;
}

.case-thread .reply-form-wrap{
  margin-top:18px;
  padding:18px;
  border-radius:16px;
  background:#f4f7fb;
  border:1px solid #dde5ef;
}

.case-thread .reply-form-wrap label{
  margin-bottom:2px;
}

@media(max-width:700px){
  .case-snapshot{
    grid-template-columns:1fr 1fr;
  }

  .case-stage{
    grid-template-columns:32px 1fr;
    gap:10px;
  }

  .case-stage-number{
    width:32px;
    height:32px;
  }

  .case-journey::before{
    left:15px;
  }
}

@media(max-width:620px){
  .modal-card:has(.case-thread){
    width:100%;
  }

  .case-thread-header{
    padding-right:26px;
  }

  .case-thread-header h2{
    font-size:27px;
  }

  .case-snapshot{
    gap:8px;
    margin-top:16px;
    margin-bottom:24px;
  }

  .case-snapshot-item{
    padding:12px;
  }

  .case-snapshot-item strong{
    font-size:13px;
  }

  .case-journey-title,.case-discussion-head h3{
    font-size:20px;
  }

  .case-stage-card{
    padding:14px;
  }

  .case-discussion-head{
    align-items:flex-start;
  }

  .reply-author-row{
    align-items:flex-start;
    flex-direction:column;
    gap:2px;
  }

  .case-thread-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .case-thread-actions .btn,
  .case-thread-actions .text-link{
    width:100%;
    min-height:46px;
    justify-content:center;
    text-align:center;
  }
}
