/* ─── Header extras ─── */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.back-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
}

.back-btn svg {
  width: 14px;
  height: 14px;
}

/* ─── Legend ─── */
.tl-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.tl-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.tl-legend-item::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tl-legend-item.completed::before  { background: #22c55e; }
.tl-legend-item.in-progress::before { background: #3b82f6; }
.tl-legend-item.upcoming::before   { background: #d1d5db; }

/* ─── Timeline track ─── */
.tl-track {
  display: flex;
  overflow-x: auto;
  padding-bottom: 1rem;
  gap: 0;
  position: relative;
}

.tl-track::before {
  content: '';
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

/* ─── Column ─── */
.tl-col {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ─── Month label ─── */
.tl-month-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s;
}

.tl-col.completed  .tl-month-label { color: #16a34a; background: #f0fdf4; }
.tl-col.in-progress .tl-month-label { color: #1d4ed8; background: #eff6ff; font-weight: 800; }
.tl-col.upcoming   .tl-month-label { color: var(--text-muted); }

/* ─── Dot ─── */
.tl-dot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 100%;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #d1d5db;
  flex-shrink: 0;
}

.tl-col.completed  .tl-dot { background: #22c55e; box-shadow: 0 0 0 2px #22c55e; }
.tl-col.in-progress .tl-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
  width: 14px;
  height: 14px;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }
  50%       { box-shadow: 0 0 0 7px rgba(59,130,246,0.08); }
}

/* ─── Content card ─── */
.tl-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  width: calc(100% - 16px);
  min-height: 60px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tl-col.in-progress .tl-content {
  border-color: #bfdbfe;
  box-shadow: 0 2px 12px rgba(59,130,246,0.1);
}

.tl-col.completed .tl-content {
  background: #fafffe;
  border-color: #bbf7d0;
}

/* ─── Milestone badge ─── */
.tl-milestone {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  line-height: 1.35;
}

.tl-milestone svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 1px;
  fill: #f59e0b;
}

/* ─── Task row ─── */
.tl-task {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tl-weeks {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tl-task-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.tl-col.completed .tl-task-title { color: #374151; }
.tl-col.upcoming  .tl-task-title { color: var(--text-secondary); }

/* ─── Note ─── */
.tl-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #92400e;
}

.tl-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: #f59e0b;
  margin-top: 1px;
}

/* ─── Scrollbar ─── */
.tl-track::-webkit-scrollbar { height: 4px; }
.tl-track::-webkit-scrollbar-track { background: transparent; }
.tl-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
