.md-grid {
  max-width: 100%;
}

.tutorial-hero {
  border-left: 4px solid #ff6b35;
  padding: 0.75rem 1rem;
  background: #f6f8fb;
}

.diagram-frame {
  width: 100%;
  height: 980px;
  min-height: 920px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
}

.part-photo {
  max-width: 520px;
  width: 100%;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.part-card {
  border: 1px solid #d8dee9;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.section-card {
  border: 1px solid #d8dee9;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.section-card h3 {
  margin-top: 0;
}

.section-ready {
  border-left: 4px solid #2f7d5b;
}

.section-empty {
  border-left: 4px solid #a3aab5;
  background: #f8fafc;
}

.status-empty {
  border-left: 4px solid #a3aab5;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  color: #4b5563;
}

.progress-map {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
  padding: 0.45rem;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #f8fafc;
  overflow-x: auto;
}

.progress-phase-row {
  display: grid;
  grid-template-columns: minmax(4.2rem, 0.7fr) repeat(7, minmax(4.4rem, 1fr));
  gap: 0.3rem;
  align-items: stretch;
  min-width: 600px;
}

.progress-phase-corner,
.progress-phase-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  border: 1px solid #cfd6df;
  border-radius: 5px;
  padding: 0.25rem 0.32rem;
  color: #243447;
  font-weight: 700;
  font-size: 0.52rem;
  line-height: 1.15;
  text-align: center;
}

.progress-phase-corner {
  background: #dfe6ee;
}

.progress-phase-cell {
  background: #edf3f8;
}

.progress-lane {
  display: grid;
  grid-template-columns: minmax(4.2rem, 0.7fr) repeat(7, minmax(4.4rem, 1fr));
  gap: 0.3rem;
  align-items: stretch;
  min-width: 600px;
}

.progress-lane-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border: 1px solid #cfd6df;
  border-radius: 5px;
  padding: 0.32rem 0.4rem;
  background: #e8edf3;
  color: #243447;
  font-weight: 700;
  font-size: 0.6rem;
  text-align: center;
  line-height: 1.15;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 2.4rem;
  border: 1px solid #cfd6df;
  border-radius: 5px;
  padding: 0.32rem 0.4rem;
  background: #fff;
  color: #1f2937;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.06);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.progress-step:hover {
  border-color: #64748b;
  color: #111827;
  box-shadow: 0 6px 13px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

.progress-step strong {
  color: inherit;
  line-height: 1.15;
  font-size: 0.55rem;
}

.progress-step span {
  color: #4b5563;
  font-size: 0.45rem;
  line-height: 1.15;
}

.progress-branch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr));
  gap: 0.3rem;
}

.progress-slot {
  display: grid;
  min-width: 0;
}

.progress-stack {
  display: grid;
  gap: 0.3rem;
}

.progress-slot > p,
.progress-stack > p,
.progress-branch > p {
  display: contents;
  margin: 0;
}

.progress-slot .progress-step {
  width: 100%;
}

.progress-step-safety {
  border-left: 2px solid #64748b;
  background: #f7f9fc;
}

.progress-step-hardware {
  border-left: 2px solid #2f7d5b;
}

.progress-step-flight {
  border-left: 2px solid #3b6ea8;
}

.progress-step-nuc {
  border-left: 2px solid #7c5c2e;
}

.progress-step-gate {
  border-left: 2px solid #c2410c;
  background: #fff7ed;
}

.progress-step-optional {
  border-left: 2px solid #7c3aed;
  background: #faf7ff;
  border-style: dashed;
}

.progress-col-1 {
  grid-column-start: 2;
}

.progress-col-2 {
  grid-column-start: 3;
}

.progress-col-3 {
  grid-column-start: 4;
}

.progress-col-4 {
  grid-column-start: 5;
}

.progress-col-5 {
  grid-column-start: 6;
}

.progress-col-6 {
  grid-column-start: 7;
}

.progress-col-7 {
  grid-column-start: 8;
}

.progress-span-1 {
  grid-column-end: span 1;
}

.progress-span-2 {
  grid-column-end: span 2;
}

.wide-photo {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.motor-rotation-standard {
  display: block;
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
}

.motor-order-reference {
  display: block;
  width: 400px;
  max-width: 100%;
  margin: 0 auto;
}

.hardware-frame {
  height: 1080px;
  min-height: 980px;
}

@media (max-width: 760px) {
  .diagram-frame {
    height: 1040px;
    min-height: 980px;
  }

  .hardware-frame {
    height: 1180px;
    min-height: 1080px;
  }

  .progress-map {
    overflow-x: visible;
  }

  .progress-phase-row {
    display: none;
  }

  .progress-lane {
    display: block;
    min-width: 0;
  }

  .progress-lane + .progress-lane {
    margin-top: 0.75rem;
  }

  .progress-lane-title,
  .progress-step,
  .progress-branch {
    margin-bottom: 0.5rem;
  }

  .progress-lane-title,
  .progress-step {
    min-height: 0;
  }

  .progress-branch {
    display: grid;
    grid-template-columns: 1fr;
  }
}
