/* Learning Path + Smart Fix styles (v4 Phase 1). */

.roadmap-view {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 64px;
  /* The body is a fixed-height flex column with `overflow: hidden`; the
     roadmap must be the flex child that scrolls, or long tracks are unreachable. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.roadmap-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0;
  background: var(--bg, #0f1117);
}

.roadmap-hint,
.roadmap-eyebrow {
  font-size: 11px;
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.05em;
  color: #8b93a7;
}

.roadmap-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#roadmap-search {
  width: min(320px, 55vw);
  padding: 8px 12px;
  border-radius: 99px;
  border: 1px solid var(--panel-border, #2b3246);
  background: #151925;
  color: #e6e9f2;
  font-size: 12.5px;
  outline: none;
}

#roadmap-search:focus {
  border-color: #8b6ce0;
  box-shadow: 0 0 0 3px color-mix(in oklab, #8b6ce0 25%, transparent);
}

body.light #roadmap-search {
  background: #fff;
  color: #202637;
  border-color: #c8cddb;
}

.roadmap-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border: 1px solid var(--panel-border, #2b3246);
  border-radius: 12px;
  background: #151925;
  margin-bottom: 24px;
}

.roadmap-head h2 {
  font-family: var(--font-display, Georgia, serif);
  font-size: 26px;
  font-weight: 500;
  margin: 4px 0 8px;
}

.roadmap-head p {
  color: #a4adc2;
  font-size: 13px;
  max-width: 62ch;
  line-height: 1.6;
}

.roadmap-progress {
  min-width: 180px;
  text-align: right;
  font-size: 12px;
  color: #8b93a7;
}

.roadmap-progress strong {
  display: block;
  color: #e6e9f2;
  font-size: 22px;
  font-weight: 600;
}

.roadmap-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* First-run onboarding + supported-subset modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop[hidden] {
  display: none;
}

.onboard-card {
  width: min(560px, 100%);
  background: #151925;
  border: 1px solid var(--panel-border, #2b3246);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.onboard-card .eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #8b93a7;
}

.onboard-card h2 {
  font-family: var(--font-display, Georgia, serif);
  font-size: 26px;
  font-weight: 500;
  margin: 6px 0 10px;
  color: #e6e9f2;
}

.onboard-card p,
.onboard-card li {
  color: #a4adc2;
  font-size: 13px;
  line-height: 1.6;
}

.onboard-card ul {
  margin: 12px 0 18px 18px;
}

.onboard-card li {
  margin-bottom: 6px;
}

.onboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.onboard-skip {
  background: none;
  border: none;
  color: #8b93a7;
  font-size: 12px;
  cursor: pointer;
  padding: 8px 4px;
}

.supported-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin: 12px 0 18px;
}

.supported-grid div {
  font-size: 12.5px;
  color: #c7cee0;
}

.supported-grid strong {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: #8b93a7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

@media (max-width: 600px) {
  .supported-grid { grid-template-columns: 1fr; }
  .onboard-card { padding: 20px; }
}

.progress {
  height: 6px;
  border-radius: 99px;
  background: #262d3f;
  overflow: hidden;
  margin-top: 8px;
}

.progress > span {
  display: block;
  height: 100%;
  background: #22c55e;
  border-radius: 99px;
  transition: width 0.25s ease;
}

.roadmap-tracks {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.roadmap-track-btn {
  border: 1px solid var(--panel-border, #2b3246);
  background: #151925;
  color: #a4adc2;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
}

.roadmap-track-btn.active {
  background: #5b3fa8;
  border-color: #8b6ce0;
  color: #fff;
}

.roadmap-track-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
}

.roadmap-track-title span {
  font-size: 11px;
  font-weight: 400;
  color: #8b93a7;
  margin-left: 8px;
}

.roadmap-card {
  border: 1px solid var(--panel-border, #2b3246);
  border-left: 3px solid #8b6ce0;
  border-radius: 10px;
  background: #151925;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.roadmap-card.done {
  border-left-color: #22c55e;
}

.roadmap-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.roadmap-card-head strong {
  font-size: 14px;
}

.roadmap-status {
  font-size: 11px;
  color: #8b93a7;
  white-space: nowrap;
}

.roadmap-card.done .roadmap-status {
  color: #4ade80;
}

.roadmap-card p {
  color: #a4adc2;
  font-size: 12.5px;
  margin: 6px 0 12px;
}

.roadmap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roadmap-btn {
  border: 1px solid var(--panel-border, #2b3246);
  border-radius: 99px;
  background: #1c2231;
  color: #cdd4e6;
  padding: 6px 12px;
  font-size: 11.5px;
  cursor: pointer;
}

.roadmap-btn.primary {
  background: #3b2d70;
  border-color: #8b6ce0;
  color: #fff;
}

.roadmap-btn:hover,
.roadmap-track-btn:hover {
  filter: brightness(1.15);
}

.roadmap-footnote {
  margin-top: 24px;
  font-size: 11.5px;
  color: #8b93a7;
}

/* Smart Fix */
.autofix-toggle {
  display: inline-block;
  margin: 10px 0 0;
  border: 1px solid #8b6ce0;
  background: #2e2454;
  color: #e8e2ff;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
}

.autofix-panel {
  margin-top: 10px;
  border: 1px dashed var(--panel-border, #2b3246);
  border-radius: 8px;
  padding: 12px;
  background: #111522;
}

.autofix-opt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--panel-border, #2b3246);
  border-radius: 7px;
  background: #1a2030;
  color: #d7dced;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}

.autofix-opt.selected {
  border-color: #22c55e;
  background: #15301f;
}

.autofix-opt .eff {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: #4ade80;
  white-space: nowrap;
}

.autofix-explain {
  font-size: 12px;
  color: #a4adc2;
  margin: 8px 0;
  line-height: 1.55;
}

.autofix-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.diff {
  background: #0d1018;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
}

.diff .diff-del {
  color: #f87171;
}

.diff .diff-add {
  color: #4ade80;
}

.diff .diff-same {
  color: #8b93a7;
}

.undo-btn {
  margin: 8px 0;
}

/* Illustrative 64-bit stack sizes (toggle in the Memory Map header). */
.size-pill {
  display: none;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: #fbbf24;
  background: color-mix(in oklab, #f59e0b 14%, transparent);
  border: 1px solid #f59e0b;
  border-radius: 99px;
  padding: 1px 7px;
  margin: 4px 0 0;
  width: fit-content;
}

body.show-sizes .size-pill {
  display: inline-block;
}

#btn-show-sizes.active {
  border-color: #f59e0b;
  color: #fbbf24;
}

.drop-chain {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  background: color-mix(in oklab, #ef4444 8%, transparent);
  font-size: 12px;
  color: #e6e9f2;
}

.drop-chain strong {
  color: #fca5a5;
}

.lifetime-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #4c3d8a;
  border-radius: 8px;
  background: color-mix(in oklab, #8b6ce0 8%, transparent);
}

.lifetime-row {
  font-size: 12px;
  color: #e6e9f2;
  margin-bottom: 6px;
}

.lifetime-row strong {
  color: #c4b5fd;
}

.nll-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #a4adc2;
  margin: 5px 0;
}

.nll-name {
  min-width: 56px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: #ddd6fe;
}

.nll-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #262d3f;
  position: relative;
}

.nll-end {
  position: absolute;
  right: 0;
  top: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #8b6ce0;
}

.nll-owner {
  color: #8b93a7;
}

/* "Check yourself" quiz in Step Notes */
.quiz-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #4c3d8a;
  border-left: 3px solid #8b6ce0;
  border-radius: 8px;
  background: color-mix(in oklab, #8b6ce0 7%, transparent);
}

.quiz-eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: #a78bfa;
  margin-bottom: 6px;
}

.quiz-prompt {
  font-size: 13px;
  color: #e6e9f2;
  margin-bottom: 10px;
}

.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  padding: 8px 11px;
  border: 1px solid var(--panel-border, #2b3246);
  border-radius: 7px;
  background: #1a2030;
  color: #d7dced;
  font-size: 12.5px;
  cursor: pointer;
}

.quiz-opt:hover { filter: brightness(1.12); }

.quiz-opt.correct {
  border-color: #22c55e;
  background: #15301f;
  color: #bbf7d0;
}

.quiz-opt.wrong {
  border-color: #ef4444;
  background: #331519;
  color: #fecaca;
}

.quiz-feedback {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 10px;
  border-radius: 6px;
}

.quiz-feedback.ok {
  background: #15301f;
  color: #bbf7d0;
}

.quiz-feedback.bad {
  background: #331519;
  color: #fecaca;
}

body.light .quiz-card { background: #f5f2ff; border-color: #b9a9e8; }
body.light .quiz-prompt { color: #2b2340; }
body.light .quiz-opt { background: #fff; color: #202637; border-color: #c8cddb; }
body.light .quiz-opt.correct { background: #ecfdf3; color: #14532d; }
body.light .quiz-opt.wrong { background: #fff1f1; color: #7f1d1d; }

/* --- Mobile / tablet polish ---------------------------------------------- */
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }

  .header-left,
  .header-right {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .header-right {
    justify-content: flex-start;
  }

  .brand h1 {
    font-size: 13px;
  }

  .roadmap-view {
    padding: 14px 12px 48px;
  }

  .roadmap-topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .roadmap-topbar-right {
    width: 100%;
  }

  #roadmap-search {
    width: 100%;
  }

  .roadmap-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .roadmap-progress {
    text-align: left;
    width: 100%;
  }

  .roadmap-tracks {
    gap: 6px;
  }

  .roadmap-track-btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .roadmap-card {
    padding: 12px 14px;
  }

  .roadmap-actions {
    gap: 6px;
  }

  /* Memory map: stack the three regions instead of squeezing them. */
  .memory-stage {
    grid-template-columns: 1fr !important;
  }

  .autofix-opt {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .autofix-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 460px) {
  .roadmap-head h2 {
    font-size: 21px;
  }

  .roadmap-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .roadmap-btn {
    width: 100%;
  }
}

.lifetime-note {
  margin-top: 8px;
  font-size: 11px;
  color: #8b93a7;
}
