/* Pipeline pages: stepper + shared layout. Builds on viewer.css + builder.css. */

/* ---------------- page shell ---------------- */
.page {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px 80px;
}
.page h1 { font-size: 26px; margin: 0 0 4px; font-weight: 700; }
.page .lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.page h2 { font-size: 19px; margin: 0 0 10px; }

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-block;
  margin-bottom: 14px;
}
.back-link:hover { background: var(--bg); color: var(--text); }

/* ---------------- stepper ---------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 28px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  overflow-x: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.step.clickable { cursor: pointer; }
.step.clickable:hover { background: var(--bg); }
.step-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: var(--line);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
}
.step-body { display: flex; flex-direction: column; gap: 1px; }
.step-name { font-size: 13px; line-height: 1.1; }
.step-hint { font-size: 11px; font-weight: 500; color: #94a3b8; line-height: 1.2; }

.step-done { color: #059669; }
.step-done .step-num { background: #10b981; color: #fff; }
.step-done .step-hint { color: #6ee7b7; }
.step-done.clickable:hover { background: #d1fae5; }

.step-active { color: #1d4ed8; background: #eff6ff; }
.step-active .step-num { background: #3b82f6; color: #fff; }
.step-active .step-hint { color: #60a5fa; }

.step-upcoming { opacity: 0.65; }
.step-upcoming .step-num { background: var(--line); color: #94a3b8; }

.step-sep { color: #cbd5e1; font-size: 18px; padding: 0 4px; flex-shrink: 0; }

/* ---------------- overview (index) ---------------- */
.hero {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border-radius: 18px;
  padding: 36px 40px;
  margin-bottom: 28px;
}
.hero h1 { font-size: 32px; margin: 0 0 8px; color: #fff; }
.hero p { margin: 0; font-size: 15px; color: #dbeafe; max-width: 640px; line-height: 1.5; }
.hero .actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .actions a {
  padding: 10px 18px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.hero .actions a.primary {
  background: #fff;
  color: #1d4ed8;
  border-color: #fff;
}
.hero .actions a:hover { filter: brightness(1.1); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 14px;
}
.section-head h2 { font-size: 18px; margin: 0; }
.section-head .aside { color: var(--muted); font-size: 13px; }

.pipeline-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.pipeline-card {
  display: block;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  border-color: var(--stage-new_knowledge);
}
.pipeline-card .card-step-num {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.pipeline-card.done .card-step-num { background: #10b981; color: #fff; }
.pipeline-card h3 { font-size: 17px; margin: 0 0 4px; padding-right: 40px; }
.pipeline-card .desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 10px; }
.pipeline-card .status-line {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.pipeline-card.done .status-line { color: #059669; font-weight: 600; }

.deck-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.deck-card {
  display: block;
  padding: 20px 22px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}
.deck-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.07);
}
.deck-card h3 { font-size: 17px; margin: 0 0 6px; }
.deck-card .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.deck-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-card .tag { padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 11px; }
.card-g1  { --accent: var(--stage-motivation); }
.card-g2  { --accent: var(--stage-prior_knowledge); }
.card-g3  { --accent: var(--stage-new_knowledge); }
.card-g3b { --accent: var(--stage-initial_practice); }

.adhoc-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 8px;
}

/* ---------------- step footer nav ---------------- */
.step-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: space-between;
  align-items: center;
}
.step-footer .left, .step-footer .right { display: flex; gap: 10px; align-items: center; }
.step-footer .btn-big {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
}

/* ---------------- fixture summary card ---------------- */
.fixture-summary {
  padding: 14px 18px;
  background: color-mix(in srgb, var(--stage-new_knowledge) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--stage-new_knowledge) 30%, var(--line));
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.fixture-summary .row { display: flex; gap: 16px; flex-wrap: wrap; }
.fixture-summary .row span { color: var(--muted); }
.fixture-summary .row strong { color: var(--text); font-weight: 600; }
.fixture-summary.missing { background: #fee2e2; border-color: #fecaca; color: #991b1b; }

@media (max-width: 820px) {
  .step-hint { display: none; }
  .step-sep { padding: 0 2px; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 24px; }
}
