/* Self-learning section: pages + widgets */

.learn-wrap { padding-top: 1.5rem; }
.learn-crumbs { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.learn-crumbs a { color: var(--text-muted); text-decoration: none; }
.learn-crumbs a:hover { color: #c4b5fd; }
.learn-title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.25rem; }
.learn-sub { color: var(--text-muted); margin-bottom: 1.25rem; }

/* Index: tracks */
.track-card { border-radius: 14px; height: 100%; }
.track-head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.6rem; }
.track-icon { font-size: 1.8rem; line-height: 1; }
.track-num { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.track-name { font-size: 1.15rem; margin: 0.1rem 0 0.15rem; }
.track-tag { font-size: 0.82rem; color: #c4b5fd; }
.track-focus { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.track-sec { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.6rem; border-radius: 9px; text-decoration: none; color: var(--text-primary); transition: background 0.15s; }
.track-sec:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.track-sec .chk { color: var(--text-muted); font-size: 1rem; margin-top: 0.05rem; }
.track-sec.done .chk { color: #34d399; }
.track-sec.done .chk::before { content: "\F26A"; }
.track-sec strong { display: block; font-size: 0.9rem; font-weight: 600; }
.track-sec small { display: block; color: var(--text-muted); font-size: 0.75rem; line-height: 1.35; }
.lw-prog { display: flex; align-items: center; gap: 0.6rem; margin: 0.4rem 0 0.6rem; }
.lw-prog-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.lw-prog-fill { height: 100%; width: 0; background: var(--grad-main); transition: width 0.3s; }
.lw-prog-txt { font-size: 0.72rem; color: var(--text-muted); min-width: 2.6rem; text-align: right; }

.tool-card { display: flex; gap: 0.8rem; align-items: center; padding: 0.9rem 1rem; border-radius: 12px; text-decoration: none; color: var(--text-primary); height: 100%; }
.tool-card:hover { color: var(--text-primary); border-color: var(--border-accent); }
.tool-card .ti { font-size: 1.5rem; }
.tool-card strong { display: block; font-size: 0.92rem; }
.tool-card small { color: var(--text-muted); font-size: 0.78rem; }

/* Lesson page */
.lesson-toc { position: sticky; top: 70px; border-radius: 14px; padding: 0.9rem; }
.lesson-toc .toc-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.4rem; }
.lesson-toc a { display: block; font-size: 0.83rem; padding: 0.3rem 0.5rem; border-radius: 7px; color: var(--text-primary); text-decoration: none; }
.lesson-toc a:hover { background: rgba(255,255,255,0.06); }
.lesson-body { font-size: 0.97rem; line-height: 1.7; }
.lesson-body p, .lesson-body li { color: #d8d6e8; }
.lesson-body h3 { font-size: 1.02rem; margin: 1.4rem 0 0.5rem; color: #e9e5ff; }
.lesson-body table { width: 100%; font-size: 0.88rem; margin: 0.8rem 0 1.2rem; border-collapse: collapse; }
.lesson-body th, .lesson-body td { border: 1px solid var(--border); padding: 0.45rem 0.6rem; vertical-align: top; }
.lesson-body th { background: rgba(255,255,255,0.04); color: #c4b5fd; font-weight: 600; text-align: left; }
.tbl-wrap { overflow-x: auto; }
.lesson-body code, .lesson-body kbd { background: rgba(255,255,255,0.08); color: #f0abfc; padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
.lw-part { font-size: 1.35rem; margin: 2.2rem 0 0.8rem; padding-top: 0.4rem; scroll-margin-top: 80px; }
.lw-part:first-child { margin-top: 0; }
.lesson-card { border-radius: 14px; padding: 1.4rem 1.5rem; }
.lesson-foot { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center; margin-top: 1.2rem; }
.lesson-nav a { font-size: 0.85rem; }
.lw-done-btn { border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text-primary); border-radius: 9px; padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.lw-done-btn.done { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }

/* Callouts */
.lw-box { display: flex; gap: 0.7rem; padding: 0.75rem 0.9rem; border-radius: 10px; margin: 1rem 0; font-size: 0.9rem; border: 1px solid; }
.lw-box > i { font-size: 1.05rem; margin-top: 0.1rem; }
.lw-box p:last-child, .lw-box ul:last-child { margin-bottom: 0; }
.lw-box-tip { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.3); }
.lw-box-tip > i { color: #c4b5fd; }
.lw-box-warn { background: rgba(217,119,6,0.1); border-color: rgba(217,119,6,0.3); }
.lw-box-warn > i { color: #fbbf24; }
.lw-box-practice { background: rgba(14,165,233,0.08); border-color: rgba(14,165,233,0.3); }
.lw-box-practice > i { color: #7dd3fc; }

/* Shared widget bits */
.lw-cap { font-size: 0.8rem; color: var(--text-muted); margin: 0.35rem 0; }
.lw-btn { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--border-accent); background: rgba(124,58,237,0.15); color: #ede9fe; border-radius: 8px; padding: 0.3rem 0.75rem; font-size: 0.82rem; font-weight: 600; }
.lw-btn:hover { background: rgba(124,58,237,0.28); }
.lw-btn-sm { padding: 0.2rem 0.6rem; font-size: 0.76rem; margin-top: 0.3rem; }
.lw-chip { font-size: 0.78rem; padding: 0.15rem 0.5rem; border-radius: 6px; background: rgba(255,255,255,0.07); font-weight: 600; }
.lw-chip.on { background: var(--grad-main); color: #fff; }
.lw-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.lw-ctl input[type=range] { width: 130px; accent-color: #a78bfa; }
.lw-bpm { font-size: 0.8rem; color: var(--text-muted); min-width: 4.5rem; font-variant-numeric: tabular-nums; }
.lw-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lw-seg button { background: transparent; border: none; color: var(--text-muted); padding: 0.28rem 0.7rem; font-size: 0.8rem; }
.lw-seg button + button { border-left: 1px solid var(--border); }
.lw-seg button.on { background: rgba(124,58,237,0.25); color: #ede9fe; font-weight: 600; }
.lw-play { border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text-primary); border-radius: 7px; padding: 0.15rem 0.55rem; font-size: 0.8rem; margin: 0.1rem 0; }
.lw-play:hover { border-color: var(--border-accent); background: rgba(124,58,237,0.15); }

/* Chord boxes */
.lw-chord-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0 1.1rem; }
.lw-chord { margin: 0; padding: 0.35rem 0.3rem 0.45rem; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); text-align: center; cursor: pointer; transition: border-color 0.15s, transform 0.12s; }
.lw-chord:hover, .lw-chord:focus { border-color: var(--border-accent); outline: none; }
.lw-chord.lw-hit { transform: scale(1.04); border-color: #f9a8d4; }
.lw-chord figcaption { font-weight: 700; font-size: 0.95rem; margin-top: -0.1rem; }
.lw-chord-svg { display: block; }

/* TAB */
.lw-tab { margin: 0.8rem 0 1.1rem; }
.lw-tab pre { margin: 0; background: #0a0a16; color: #d4d4d8; border: 1px solid var(--border); border-radius: 10px 10px 0 0; padding: 0.8rem 1rem; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.85rem; line-height: 1.45; white-space: pre; overflow-x: auto; }
.lw-tab-ctl { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; background: rgba(255,255,255,0.03); }
.lw-tab-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.lw-tab-fill { height: 100%; width: 0; background: var(--grad-main); }

/* Strum */
.lw-strum { margin: 0.8rem 0 1.2rem; padding: 0.8rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.02); }
.lw-strum-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.lw-strum-grid.lw-16 { grid-template-columns: repeat(16, minmax(0, 1fr)); }
.lw-strum-cell { text-align: center; border-radius: 7px; background: rgba(255,255,255,0.04); padding: 0.3rem 0 0.2rem; transition: background 0.08s; }
.lw-strum-cell .arr { display: block; font-size: 1.25rem; font-weight: 700; color: #c4b5fd; line-height: 1.2; }
.lw-16 .lw-strum-cell .arr { font-size: 0.95rem; }
.lw-strum-cell .cnt { display: block; font-size: 0.72rem; color: var(--text-muted); }
.lw-strum-cell.beat .cnt { color: #ede9fe; font-weight: 700; }
.lw-strum-cell.on { background: var(--grad-main); }
.lw-strum-cell.on .arr, .lw-strum-cell.on .cnt { color: #fff; }

/* Metronome */
.lw-metronome { margin: 0.8rem 0 1.2rem; padding: 0.9rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.02); }
.lw-met-dots { display: flex; gap: 0.6rem; }
.lw-met-dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid var(--border); transition: background 0.05s; }
.lw-met-dot:first-child { border-color: rgba(219,39,119,0.5); }
.lw-met-dot.on { background: #a78bfa; }
.lw-met-dot:first-child.on { background: #db2777; }

/* Mini fretboard */
.lw-fret { margin: 0.8rem 0 1.1rem; }
.lw-fret-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lw-fret-svg { display: block; }
.lw-dot { cursor: pointer; }
.lw-dot circle { transition: transform 0.12s; transform-box: fill-box; transform-origin: center; }
.lw-dot:hover circle, .lw-dot.on circle { transform: scale(1.25); }
.lw-dot.on circle { filter: drop-shadow(0 0 5px #f9a8d4); }

/* Tuning tones */
.lw-tones { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; margin: 0.8rem 0 1.1rem; }
.lw-tone { border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text-primary); border-radius: 10px; padding: 0.5rem 0.2rem; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.lw-tone .num { font-size: 0.68rem; color: var(--text-muted); }
.lw-tone strong { font-size: 1rem; }
.lw-tone small { font-size: 0.65rem; color: var(--text-muted); }
.lw-tone.on { background: var(--grad-main); border-color: transparent; }
.lw-tone.on .num, .lw-tone.on small { color: #fff; }

/* Anatomy */
.lw-anatomy { margin: 0.8rem 0 1.2rem; }
.lw-anat-stage { margin-top: 0.6rem; border: 1px solid var(--border); border-radius: 12px; background: rgba(0,0,0,0.25); overflow-x: auto; }
.lw-anat-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.lw-hot { cursor: pointer; outline: none; }
.lw-hot circle { fill: rgba(124,58,237,0.85); stroke: #fff; stroke-width: 1.5; transition: transform 0.12s; transform-box: fill-box; transform-origin: center; }
.lw-hot text { fill: #fff; pointer-events: none; }
.lw-hot:hover circle, .lw-hot:focus circle, .lw-hot.on circle { fill: #db2777; transform: scale(1.2); }
.lw-anat-info { margin-top: 0.6rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.3); min-height: 3.6rem; }
.lw-anat-info strong { display: block; color: #ede9fe; }
.lw-anat-info span { font-size: 0.88rem; color: #d8d6e8; }
.lw-anat-list { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.6rem; }
.lw-anat-list button { border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text-primary); border-radius: 7px; font-size: 0.78rem; padding: 0.2rem 0.55rem; }
.lw-anat-list button span { display: inline-block; min-width: 1.1rem; color: #c4b5fd; font-weight: 700; }
.lw-anat-list button.on { border-color: #db2777; background: rgba(219,39,119,0.15); }

/* Inline diagrams */
.lw-diagram { display: block; max-width: 100%; height: auto; margin: 0.8rem auto 1rem; }
.lw-slash { font-family: 'JetBrains Mono', monospace; background: #0a0a16; border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 1rem; overflow-x: auto; white-space: pre; font-size: 0.9rem; color: #e5e7eb; }

/* Help / FAQ */
.lw-faq-group h2 { font-size: 1.05rem; margin: 1.4rem 0 0.5rem; color: #c4b5fd; }
.lw-faq { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.45rem; background: rgba(255,255,255,0.03); }
.lw-faq summary { padding: 0.65rem 0.9rem; cursor: pointer; font-weight: 600; font-size: 0.93rem; list-style: none; display: flex; justify-content: space-between; gap: 0.5rem; }
.lw-faq summary::-webkit-details-marker { display: none; }
.lw-faq summary::after { content: "+"; color: #c4b5fd; font-weight: 700; }
.lw-faq[open] summary::after { content: "−"; }
.lw-faq .ans { padding: 0 0.9rem 0.8rem; font-size: 0.9rem; color: #d8d6e8; line-height: 1.6; }
.lw-faq .ans a { color: #c4b5fd; }

/* Cheat sheets */
.sheet { border-radius: 14px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; page-break-inside: avoid; }
.sheet h2 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.sheet table { width: 100%; font-size: 0.86rem; border-collapse: collapse; }
.sheet th, .sheet td { border: 1px solid var(--border); padding: 0.35rem 0.5rem; }
.sheet th { color: #c4b5fd; text-align: left; background: rgba(255,255,255,0.04); }
.log-table td { height: 2rem; }

@media (max-width: 575.98px) {
    .lesson-card { padding: 1.1rem 1rem; }
    .lw-tones { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lw-strum-grid.lw-16 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media print {
    body { background: #fff !important; color: #000 !important; padding-top: 0 !important; }
    .navbar, .footer, .no-print, .lesson-toc, .lw-tab-ctl, .lw-ctl, .lw-btn { display: none !important; }
    .card, .sheet, .lesson-card { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; backdrop-filter: none !important; }
    .sheet h2, .learn-title, .sheet th, .lesson-body h3, .lw-part { color: #000 !important; -webkit-text-fill-color: #000 !important; }
    .sheet td, .sheet th, .lesson-body td, .lesson-body th { border-color: #999 !important; color: #000 !important; }
    .lesson-body p, .lesson-body li, .learn-sub { color: #222 !important; }
    .lw-chord { border-color: #ccc !important; background: #fff !important; }
    .lw-chord figcaption { color: #000; }
    .lw-tab pre { background: #fff !important; color: #000 !important; border-color: #999 !important; }
    .col-lg-3.learn-side { display: none !important; }
    a { color: #000 !important; text-decoration: none !important; }
}
