/* ============================================================
   ROADMAP — the full tracker, in the site's design system
   Reads and writes the SAME localStorage store as the lessons, so
   ticking a checkpoint here marks the lesson complete and vice versa.
   ============================================================ */

/* ---------- Overall summary ---------- */
.rm-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px 40px;
  align-items: center;
  margin-top: 38px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.rm-summary-stats { display: flex; flex-wrap: wrap; gap: 14px 38px; }
.rm-dial { display: grid; place-items: center; position: relative; flex: none; }
.rm-dial svg { width: 108px; height: 108px; transform: rotate(-90deg); }
.rm-dial .dial-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.rm-dial .dial-fg {
  fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset .8s var(--ease-out);
}
.rm-dial b {
  position: absolute; font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Progress bar ---------- */
.rm-bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--border); flex: 1; min-width: 90px;
}
.rm-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent, var(--gold));
  border-radius: 999px;
  transition: width .5s var(--ease-out);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.rm-section { --accent: var(--gold); margin-bottom: clamp(40px, 5vw, 64px); scroll-margin-top: 90px; }
.rm-section-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 22px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.rm-section-head h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.rm-section-head .rm-sec-meta {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .05em;
  color: var(--accent); font-weight: 600; margin-left: auto; white-space: nowrap;
}
.rm-section-head p { flex-basis: 100%; color: var(--text-muted); font-size: .96rem; margin-top: -4px; }

/* ---------- Module block ---------- */
.rm-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color .25s;
}
.rm-module > summary { list-style: none; cursor: pointer; }
.rm-module > summary::-webkit-details-marker { display: none; }
.rm-module.is-complete { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }

.rm-mod-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  align-items: center; gap: 14px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.rm-disclosure { width: 12px; height: 12px; border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle); transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease-out); }
.rm-module[open] .rm-disclosure { transform: rotate(225deg) translate(-1px, -2px); }
.rm-module-content { padding-bottom: 16px; }
.rm-mod-icon { color: var(--accent-ink, var(--accent)); }
.rm-mod-icon svg { width: 20px; height: 20px; }
.rm-mod-num {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 7px; padding: 4px 8px; min-width: 34px; text-align: center;
}
.rm-mod-icon { font-size: 19px; line-height: 1; }
.rm-mod-title { min-width: 0; }
.rm-mod-title h3 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.015em; }
.rm-mod-title a:hover h3 { color: var(--accent); }
.rm-mod-title span {
  font-family: var(--font-mono); font-size: .7rem; color: var(--text-faint);
  display: block; margin-top: 3px;
}
.rm-mod-progress { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.rm-mod-count {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rm-mod-hours {
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint);
  white-space: nowrap;
}

/* ---------- Checkpoint rows ---------- */
.rm-checks { padding: 6px 20px 12px; }
.rm-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start; gap: 13px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
}
.rm-check-body { cursor: pointer; }
.rm-check:last-child { border-bottom: none; }

/* Real checkbox, visually restyled — keeps keyboard and screen-reader
   behaviour for free. */
.rm-check input {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; flex: none; margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px; cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.rm-check input::after {
  content: "✓"; font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--navy-deep); opacity: 0; transition: opacity .15s;
}
.rm-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.rm-check input:checked::after { opacity: 1; }
.rm-check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.rm-check-body { min-width: 0; }
.rm-check-body strong { font-size: .95rem; font-weight: 600; display: block; }
.rm-check-body p { font-size: .86rem; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.rm-check.is-done .rm-check-body strong { color: var(--text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.rm-check.is-done .rm-check-body p { opacity: .6; }

.rm-check-side { display: flex; align-items: center; gap: 10px; flex: none; }
.rm-check-hours {
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint);
  white-space: nowrap;
}
.rm-open {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent); border-radius: 6px; padding: 3px 8px;
  transition: background .2s; white-space: nowrap;
}
.rm-open:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rm-open { color: var(--accent-ink, var(--accent)); min-height: 32px; display: inline-flex; align-items: center; }
.rm-planned { color: var(--text-subtle); font: 600 .66rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.rm-module-overview { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 20px; color: var(--accent-ink, var(--accent)); font-size: .9rem; font-weight: 600; }
.rm-module-overview:hover { color: var(--text); }

/* ---------- Module project ---------- */
.rm-project {
  margin: 4px 20px 16px;
  padding: 13px 16px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 32%, transparent);
  font-size: .88rem; line-height: 1.55; color: var(--text-muted);
}
.rm-project b {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  display: block; margin-bottom: 5px;
}

/* ---------- Sticky section jump rail ---------- */
.rm-toolbar { position: sticky; top: 70px; z-index: 25; display: flex; align-items: center; gap: 16px; padding: 10px 0 14px; margin-bottom: 8px; background: linear-gradient(var(--bg) 78%, transparent); }
.rm-jump { display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 3px 1px 8px; scrollbar-width: thin; flex: 1; }
.rm-jump a {
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .04em;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted); background: var(--surface);
  transition: .2s; white-space: nowrap;
}
.rm-jump a:hover { border-color: var(--jump-accent, var(--gold)); color: var(--jump-ink, var(--gold-ink)); }
.rm-actions { display: flex; gap: 8px; flex: none; }
.rm-actions .btn { min-height: 40px; }

@media (max-width: 860px) {
  .rm-summary { grid-template-columns: 1fr; }
  .rm-dial { justify-self: start; }
  .rm-mod-head { grid-template-columns: auto auto 1fr auto; row-gap: 10px; }
  .rm-mod-progress { grid-column: 1 / -1; }
  .rm-mod-hours { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .rm-checks { padding: 4px 14px 10px; }
  .rm-mod-head { padding: 13px 14px; }
  .rm-project { margin: 4px 14px 14px; }
  .rm-check-side { flex-direction: column; align-items: flex-end; gap: 5px; }
  .rm-toolbar { top: 64px; display: block; padding-top: 8px; }
  .rm-jump { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .rm-actions { margin-top: 6px; }
  .rm-actions .btn { flex: 0 0 calc(50% - 4px); min-width: 0; padding-inline: 8px; font-size: .72rem; }
  .rm-section { scroll-margin-top: 142px; }
  .rm-module-overview { margin-inline: 14px; }
}
