/* ============================================================
   할 일 하나.
   화면의 중심은 «왜 이 날짜인지»다. 그래서 이유를 접어두지 않는다.
   ============================================================ */

.detail-head {
  padding: var(--sp-2) var(--sp-1) 0;
}

.detail-head__title {
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

.detail-head__meta {
  margin-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

/* ---------- 역산 타임라인 ---------- */

.timeline {
  margin-top: var(--sp-5);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 56px 24px minmax(0, 1fr);
  column-gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) 0;
  text-align: left;
}

/* 칸과 칸을 잇는 세로 줄. 마지막 칸에는 그리지 않는다. */
.step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 68px;
  top: 38px;
  bottom: -6px;
  width: 2px;
  background: var(--line);
}

.step.is-done:not(:last-child)::before { background: var(--tile-done); }

.step__d {
  display: block;
  padding-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: right;
}

.step__dot {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__dot svg {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.step.is-done .step__dot {
  background: var(--tile-done);
  border-color: var(--ink);
}

.step.is-done .step__dot svg { opacity: 1; }

.step.is-current .step__dot {
  background: var(--accent);
  border-color: var(--accent);
}

.step__body {
  display: block;
  min-width: 0;
}

.step__name {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.4;
}

.step.is-done .step__name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.step__date {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--sub);
}

/* 이 앱에서 제일 중요한 글이라 늘 펼쳐 둔다. */
.step__why {
  display: block;
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--r-xs);
  background: var(--cream);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--sub);
}

.step.is-current .step__why {
  background: var(--accent-soft);
  color: var(--ink);
}

.step__badge {
  display: inline-block;
  margin-top: var(--sp-2);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--paper);
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* ---------- 아래 버튼들 ---------- */

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}

.detail-actions__row {
  display: flex;
  gap: var(--sp-2);
}

.detail-actions__row .btn { flex: 1 1 0; }
