/* Practice page: chapter/topic sidebar + quiz. */
.practice-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px; align-items: start; }
.practice-main { min-width: 0; }
.practice-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.practice-nav-toggle > summary { display: none; }
.pn-chapters, .pn-topics { list-style: none; margin: 0; padding: 0; }
.pn-chapter + .pn-chapter { border-top: 1px solid var(--line); }
.pn-chapter > details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 10px 10px; border-radius: 10px; font-weight: 600; font-size: 15px; line-height: 1.3; }
.pn-chapter > details > summary::-webkit-details-marker { display: none; }
.pn-chapter > details > summary:hover { background: var(--ground); }
.pn-chapter.is-current > details > summary { color: var(--accent-dark); }
.pn-chapter.is-locked > details > summary { color: var(--muted); }
.pn-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ground); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; }
.pn-chapter.is-current .pn-num { background: var(--accent); color: #fff; }
.pn-count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; }
.pn-count svg { width: 14px; height: 14px; }
.pn-topics { padding: 2px 0 10px 36px; }
.pn-topics a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.35; }
.pn-topics a:hover { background: var(--ground); color: var(--ink); }
.pn-topics a[aria-current="page"] { background: var(--tint); color: var(--accent-dark); font-weight: 600; }
.pn-code { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* quiz math (moved from the old practice template) */
#quiz .katex, #quiz-done .katex { font-size: 1.06em; line-height: 1.2; }
#quiz .katex.katex-wide { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding-bottom: 2px; }
#quiz .katex-display { margin: 0.4em 0; overflow-x: auto; overflow-y: hidden; }
#quiz .choice { min-width: 0; max-width: 100%; }
#quiz-edit { margin-left: auto; }

@media (max-width: 900px) {
  .practice-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .practice-nav { position: static; max-height: none; }
  .practice-nav-toggle > summary { display: block; cursor: pointer; padding: 10px 12px; font-weight: 700; font-family: var(--display); }
  .practice-nav-toggle:not([open]) { padding: 0; }
}
