/* ============================================================
   NEXORA · Screen / Learn — Learning Command Center
   Calm, premium, information-rich. Colour comes only from design
   tokens so light and dark mode are both readable by construction.
   Preserves the subject-overview + explore classnames used by
   subject.js / explore.js.
   ============================================================ */

/* ---------- screen rhythm ---------------------------------- */
.learn-screen { display: grid; gap: 2.25rem; }
.learn-section { display: grid; gap: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- typography scale (6 steps, no more) ------------- */
.learn-title {
  font-family: var(--font-display); font-weight: 700; line-height: 1.15;
  font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.15rem); color: var(--text-1);
  letter-spacing: -0.02em;
}
.learn-eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.learn-sub {
  font-size: 0.95rem; line-height: 1.6; color: var(--text-2);
  max-width: 62ch; margin-top: 0.5rem;
}
.panel-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 650; color: var(--text-1); }
.panel-head .sub { font-size: 0.82rem; color: var(--text-3); margin-top: 0.2rem; line-height: 1.45; }
.panel-figure { font-weight: 700; color: var(--text-1); font-size: 0.9rem; }
.panel-note { font-size: 0.68rem; color: var(--text-3); }

.learn-panel { display: grid; gap: 0.9rem; align-content: start; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head { margin-bottom: 0.2rem; }
.panel-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap; margin-top: 0.2rem;
}
.link-arrow-sm { font-size: 0.78rem; }

/* ---------- status strip ----------------------------------- */
.learn-status {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 0.8rem; font-weight: 550;
}
.learn-status .icon { width: 16px; height: 16px; flex: none; color: var(--text-3); }
/* Semantic tones — warning (offline/degraded) / info (syncing). Icon + text
   always carry the meaning alongside the color. */
.learn-status.is-warn {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
.learn-status.is-warn .icon { color: var(--warning); }
.learn-status.is-info {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info-text);
}
.learn-status.is-info .icon { color: var(--info); }
.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.7rem; border-radius: var(--radius-sm); }

/* ---------- header ----------------------------------------- */
.learn-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.learn-head-copy { min-width: 0; flex: 1 1 420px; }
.learn-head-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin-top: 1rem; }
.learn-head-meta .w-meta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2);
}
.learn-head-meta .w-meta .icon { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.learn-head-meta .w-meta b { color: var(--text-1); }

.lh-overall {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.2rem; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px solid var(--border);
}
.lh-overall .score-ring { width: 76px; height: 76px; flex: none; }
.lh-overall .ring-text b { font-size: 1.1rem; }
.lh-overall-meta { display: grid; }
.kpi-value { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-1); }
.kpi-label {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- search ------------------------------------------ */
.lh-search-wrap { display: grid; gap: 0.5rem; position: relative; }
.lh-search {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.lh-search:focus-within { border-color: var(--accent-border); box-shadow: var(--focus-ring); }
.lh-search > .icon { color: var(--text-3); flex: none; }
.lh-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  font-size: 0.95rem; color: var(--text-1); min-height: 24px;
}
.lh-search input::placeholder { color: var(--text-3); }
.lh-search input::-webkit-search-cancel-button { display: none; }
.lh-search-clear {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border: 0; border-radius: 999px; background: var(--surface-2);
  color: var(--text-2); cursor: pointer;
}
.lh-search-clear:hover { color: var(--text-1); }
.lh-search kbd {
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3);
  padding: 0.15rem 0.45rem; border-radius: 5px; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
}
.lh-results {
  display: grid; gap: 0.2rem; padding: 0.5rem;
  border-radius: var(--radius-md); background: var(--bg-elevated);
  border: 1px solid var(--border); box-shadow: var(--elev-3);
  max-height: 400px; overflow-y: auto;
}
.lh-search-meta { font-size: 0.7rem; color: var(--text-3); padding: 0 0.2rem; }
.lh-hit {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem; border-radius: var(--radius-sm);
  transition: background var(--dur-fast); text-decoration: none; min-height: 44px;
}
.lh-hit:hover, .lh-hit.is-active { background: var(--surface-2); }
.lh-hit-body { flex: 1; min-width: 0; }
.lh-hit b {
  display: block; font-family: var(--font-display); font-size: 0.9rem;
  color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lh-hit span { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); }
.lh-empty { padding: 0.6rem 0.2rem; font-size: 0.88rem; color: var(--text-2); font-weight: 600; }
.lh-suggest { padding: 0.4rem 0.3rem; display: grid; gap: 0.4rem; }
.lh-suggest-label {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-top: 0.3rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.35rem 0.75rem; border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.72rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover { color: var(--text-1); border-color: var(--border-strong); }

/* ---------- continue card ----------------------------------- */
.lh-continue {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: 1.25rem 1.4rem; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
}
.lh-continue .icon-tile {
  width: 52px; height: 52px; flex: none; border-radius: var(--radius-md);
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.lh-continue .asset-icon { width: 28px; height: 28px; object-fit: contain; }
.lh-continue-body { flex: 1; min-width: 240px; }
.eyebrow-min {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}
.lh-continue h3 { font-size: 1.2rem; margin: 0.3rem 0 0.35rem; color: var(--text-1); line-height: 1.3; }
.lh-continue-meta {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-3);
}
.dot-sep { color: var(--text-3); }
.lh-prereq-note {
  display: flex; align-items: center; gap: 0.35rem; margin-top: 0.45rem;
  font-size: 0.76rem; color: var(--text-3);
}
.lh-prereq-note .icon { color: var(--text-3); flex: none; }
.lh-continue .bar { margin-top: 0.75rem; }
.lh-progress-meta {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3); margin-top: 0.4rem;
}
.lh-continue-cta { flex: none; }
.lh-continue-cta:active { transform: scale(0.97); }
.lh-empty-continue {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.4rem; border-radius: var(--radius-lg);
  background: var(--bg-elevated); border: 1px dashed var(--border-strong);
}
.lh-empty-continue p { color: var(--text-1); font-size: 1rem; font-weight: 650; }
.lh-empty-continue span { display: block; color: var(--text-3); font-size: 0.85rem; margin-top: 0.2rem; }

/* activity type chip */
.type-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.04em;
  color: var(--text-2); padding: 0.15rem 0.5rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.type-chip .icon { width: 12px; height: 12px; color: var(--text-3); }

/* ---------- split: mission + my learning -------------------- */
.learn-split {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: var(--content-gutter, 1.25rem); align-items: start;
}

/* mission */
.mission-grid { display: grid; gap: 0.5rem; }
.mission-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0.95rem; border-radius: var(--radius-md); min-height: 56px;
  background: var(--surface-inset); border: 1px solid var(--border-subtle); box-shadow: var(--inset-well);
  text-decoration: none; transition: border-color var(--dur-fast), background var(--dur-fast);
}
.mission-row:hover { border-color: var(--border-strong); background: var(--surface-2); box-shadow: none; }
.mission-row.done { background: var(--surface-2); border-style: dashed; }
.mission-row.done .m-body b { color: var(--text-3); text-decoration: line-through; }
.m-check {
  width: 28px; height: 28px; border-radius: 999px; flex: none;
  display: grid; place-items: center; border: 1.5px solid var(--border-strong);
  color: var(--text-3); background: var(--surface);
}
.m-check .icon { width: 14px; height: 14px; }
.mission-row.done .m-check { background: var(--success); border-color: var(--success); color: var(--n-0); }
[data-theme="dark"] .mission-row.done .m-check { color: var(--n-950); }
.m-body { flex: 1; min-width: 0; }
.m-body b { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-1); }
.m-body span {
  display: block; font-family: var(--font-mono); font-size: 0.66rem;
  color: var(--text-3); margin-top: 0.15rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-cta { flex: none; color: var(--text-3); display: grid; place-items: center; }
.mission-row:hover .m-cta { color: var(--text-1); }

/* my learning */
.learn-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.stat-card {
  padding: 0.85rem 0.9rem; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border); display: grid; gap: 0.2rem;
}
.stat-card b { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-1); line-height: 1.1; }
.stat-card span {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.stat-card i { font-style: normal; font-size: 0.68rem; color: var(--text-2); }

/* ---------- recommendations --------------------------------- */
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.rec-card {
  display: grid; gap: 0.5rem; align-content: start;
  padding: 1rem 1.05rem; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border);
  transition: border-color var(--dur-fast);
}
.rec-card:hover { border-color: var(--border-strong); }
.rec-card .why {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-3); line-height: 1.4;
}
.rec-card .why .icon { width: 13px; height: 13px; flex: none; }
.rec-card h3 { font-size: 0.95rem; color: var(--text-1); line-height: 1.35; font-weight: 650; }
.rec-card p {
  font-size: 0.8rem; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rec-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.15rem; }
.rec-meta { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); }

/* ---------- rows (revision / saved / recent) ---------------- */
.row-stack { display: grid; gap: 0.45rem; }
/* Rows are inset wells inside cards (never the card's own tone) */
.row-item {
  display: flex; align-items: center; gap: 0.8rem; min-height: 56px;
  padding: 0.65rem 0.8rem; border-radius: var(--radius-md);
  background: var(--surface-inset); border: 1px solid var(--border-subtle); box-shadow: var(--inset-well);
  text-decoration: none; transition: border-color var(--dur-fast), background var(--dur-fast);
}
a.row-item:hover { border-color: var(--border-strong); background: var(--surface-2); box-shadow: none; }
.row-item .icon-tile {
  width: 38px; height: 38px; flex: none; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.row-item .asset-icon { width: 22px; height: 22px; object-fit: contain; }
.row-body { flex: 1; min-width: 0; }
.row-body b {
  display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-body span {
  display: block; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3);
  margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-end { flex: none; color: var(--text-3); }
a.row-item:hover .row-end { color: var(--text-1); }

/* recall strength — never colour alone, the number is always present */
.mastery {
  display: inline-flex; align-items: center; gap: 0.35rem; flex: none;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-2);
}
.mastery-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--text-3); flex: none; }
/* Review urgency — danger / warning / success. Never color alone: the dot
   sits next to the urgency label text. */
.mastery[data-urgency="high"] .mastery-dot { background: var(--danger); }
.mastery[data-urgency="medium"] .mastery-dot { background: var(--warning); }
.mastery[data-urgency="low"] .mastery-dot { background: var(--success); }

/* ---------- subject cards ----------------------------------- */
.learn-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sort-select select {
  appearance: none; padding: 0.45rem 1.8rem 0.45rem 0.8rem; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text-2); font-family: var(--font-mono); font-size: 0.72rem; min-height: 34px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.85rem center, right 0.6rem center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.sort-select select:hover { color: var(--text-1); border-color: var(--border-strong); }

.lh-subjects {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem;
}
.subj-card { display: grid; gap: 0.8rem; align-content: start; padding: 1.25rem; }
.subj-top { display: flex; align-items: flex-start; gap: 0.85rem; }
.subj-top .icon-tile {
  width: 46px; height: 46px; flex: none; border-radius: var(--radius-md);
  display: grid; place-items: center; background: var(--surface-2); color: var(--text-2);
}
.subj-top .asset-icon { width: 26px; height: 26px; object-fit: contain; }
.subj-name { flex: 1; min-width: 0; }
.subj-name h3 { font-size: 1.1rem; margin-bottom: 0.3rem; color: var(--text-1); }
.status-pill {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
}
/* In progress = learning accent · Completed = success. Both stay subtle
   tints with a hairline, never solid saturated fills. */
.status-pill.is-active {
  color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border);
}
.status-pill.is-complete {
  color: var(--success-text); background: var(--success-soft); border-color: var(--success-border);
}

.save-btn {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  background: none; color: var(--text-3); transition: color var(--dur-fast), background var(--dur-fast);
}
.save-btn:hover { color: var(--text-1); background: var(--surface-2); }
.save-btn[aria-pressed="true"] { color: var(--text-1); }
.save-btn.pop { transform: scale(1.18); transition: transform 0.18s var(--ease-out); }

.subj-blurb {
  font-size: 0.86rem; line-height: 1.55; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.subj-meta {
  display: flex; gap: 0.9rem; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3);
}
.subj-meta b { color: var(--text-2); font-weight: 550; }
.subj-progress { display: grid; gap: 0.35rem; }
.subj-progress-top {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3);
}
.subj-progress-top b { color: var(--text-1); }
.subj-current {
  display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.subj-current .icon { color: var(--text-2); flex: none; }
.subj-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.filter-chip {
  display: inline-flex; align-items: center; min-height: 34px; cursor: pointer;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.72rem;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-3);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.filter-chip:hover { color: var(--text-1); border-color: var(--border-strong); }
.filter-chip.is-active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }

/* ---------- learning paths ---------------------------------- */
.paths-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 0.9rem; }
.path-card { padding: 1.1rem; display: grid; gap: 0.65rem; align-content: start; }
.path-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.path-head h3 { font-size: 1rem; color: var(--text-1); }
.path-pct { font-size: 0.75rem; color: var(--text-3); font-weight: 650; }
.path-card p { font-size: 0.82rem; color: var(--text-2); line-height: 1.5; }
.path-steps {
  display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3);
}
.path-step {
  padding: 0.22rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.path-step.done { color: var(--success-text); background: var(--success-soft); border-color: var(--success-border); }
.path-step.active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.path-arrow { color: var(--text-3); display: inline-flex; }
.path-arrow .icon { width: 11px; height: 11px; }
.path-more { color: var(--text-3); }
.path-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.path-note { font-size: 0.66rem; color: var(--text-3); }
.icon-xs { width: 11px; height: 11px; }

/* ---------- hardware explorer -------------------------------- */
.lh-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0.85rem; }
.part-card { display: grid; gap: 0.45rem; padding: 0.9rem; text-align: center; justify-items: center; }
.part-thumb {
  width: 100%; height: 78px; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--surface-inset); border: 1px solid var(--border-subtle);
  box-shadow: var(--inset-well); overflow: hidden;
}
.part-thumb svg { width: 100%; height: 100%; }
.part-card b { font-family: var(--font-display); font-size: 0.86rem; color: var(--text-1); }
.part-card span { font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-3); }

/* ---------- subject overview (used by subject.js) ------------ */
.sv-hero { display: flex; align-items: center; gap: 1.2rem; padding: 1.4rem; flex-wrap: wrap; }
.sv-hero .icon-tile { width: 62px; height: 62px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--surface-2); }
/* Subject icon — learning family tint (AI subject resolves to the accent). */
.sv-hero .icon-tile .icon { color: var(--hue, var(--text-2)); width: 1.6em; height: 1.6em; }
.sv-hero-body { flex: 1; min-width: 240px; }
.sv-hero h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); margin-bottom: 0.35rem; }
.sv-hero p { font-size: 0.95rem; line-height: 1.6; color: var(--text-2); max-width: 60ch; }
.sv-stats { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.sv-hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sv-hero-actions .btn { min-height: 42px; }
.sv-modules { display: grid; gap: 1.2rem; }
.sv-module { padding: 1.1rem 1.2rem; }
.sv-module-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.sv-module-head h3 { font-size: 1.05rem; }
.sv-module-head .mono { font-size: 0.68rem; color: var(--text-3); }
.sv-lessons { display: grid; gap: 0.4rem; }
.sv-lesson { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); transition: background var(--dur-fast); }
.sv-lesson:hover { background: var(--surface-2); }
.sv-state {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.sv-state.done { color: var(--success); background: var(--success-soft); box-shadow: inset 0 0 0 1px var(--success-border); }
.sv-state.current { color: var(--accent-on); background: var(--accent); box-shadow: none; }
.sv-state .icon { width: 0.85em; height: 0.85em; }
.sv-lesson-body { flex: 1; min-width: 0; }
.sv-lesson b { display: block; font-family: var(--font-display); font-size: 0.94rem; font-weight: 600; color: var(--text-1); }
.sv-lesson span { font-size: 0.8rem; color: var(--text-3); line-height: 1.45; }
.sv-lesson-meta { display: flex; gap: 0.5rem; align-items: center; flex: none; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-3); }
.diff { padding: 0.15rem 0.5rem; border-radius: var(--radius-full); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; }
.diff.Beginner { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.diff.Intermediate { color: var(--text-1); background: var(--surface-2); border: 1px solid var(--border-strong); }
.diff.Advanced { color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-border); }

/* explore */
.ex-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ex-picker { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.ex-chip {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.85rem; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-3);
  background: var(--bg-elevated); border: 1px solid var(--border); transition: all var(--dur-fast);
}
.ex-chip:hover { color: var(--text-1); }
.ex-chip.is-active { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }

/* ---------- empty / skeleton / focus ------------------------- */
.empty-state {
  display: grid; place-items: center; text-align: center; gap: 0.45rem;
  padding: 1.6rem 1rem; border-radius: var(--radius-md);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.empty-state p { font-size: 0.92rem; font-weight: 650; color: var(--text-1); }
.empty-state span { font-size: 0.8rem; color: var(--text-3); max-width: 34ch; line-height: 1.5; }
.empty-state .btn { margin-top: 0.3rem; }
.span-all { grid-column: 1 / -1; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); display: block; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-3, rgba(128,128,128,.14)), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 12px; margin-bottom: 0.5rem; }
.sk-lg { height: 20px; }
.sk-w30 { width: 30%; } .sk-w40 { width: 40%; } .sk-w60 { width: 60%; }
.sk-tile { width: 52px; height: 52px; border-radius: var(--radius-md); flex: none; }
.lh-continue.is-skeleton { border-style: dashed; }

.learn-ptr {
  text-align: center; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3);
  height: 0; overflow: hidden; transition: height 0.2s var(--ease-out);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- animation (short, purposeful, interruptible) ----- */
.learn-enter .learn-section,
.learn-enter .learn-split,
.learn-enter > .card { animation: learn-in 0.34s var(--ease-out) both; }
.learn-enter .rec-card,
.learn-enter .subj-card,
.learn-enter .path-card { animation: learn-in 0.3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes learn-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .learn-enter .learn-section,
  .learn-enter .learn-split,
  .learn-enter > .card,
  .learn-enter .rec-card,
  .learn-enter .subj-card,
  .learn-enter .path-card { animation: none; }
  .skeleton::after { animation: none; }
  .save-btn.pop { transform: none; }
}
html.nx-reduced-motion .learn-enter .learn-section,
html.nx-reduced-motion .learn-enter .learn-split,
html.nx-reduced-motion .learn-enter > .card,
html.nx-reduced-motion .learn-enter .rec-card,
html.nx-reduced-motion .learn-enter .subj-card,
html.nx-reduced-motion .learn-enter .path-card { animation: none; }
html.nx-reduced-motion .skeleton::after { animation: none; }

/* ---------- responsive --------------------------------------- */
@media (max-width: 1023px) {
  .learn-screen { gap: 1.7rem; }
  .learn-split { grid-template-columns: 1fr; }
  .rec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .learn-screen { gap: 1.4rem; }
  .learn-head { gap: 1rem; }
  .lh-overall { width: 100%; justify-content: flex-start; }
  .rec-grid { grid-template-columns: 1fr; }
  .learn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-lesson-meta { display: none; }
  .subj-actions .btn { flex: 1; }
  .lh-continue-cta { width: 100%; justify-content: center; }
  .lh-search kbd { display: none; }
  .learn-controls { width: 100%; }
  /* horizontal filter rail rather than a wrapping pile of chips */
  #lh-filter {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 0.2rem;
  }
  #lh-filter::-webkit-scrollbar { display: none; }
  .filter-chip { flex: none; }
  .panel-head { gap: 0.6rem; }
}

/* desktop: use the space, don't stretch mobile cards */
@media (min-width: 1280px) {
  .rec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .learn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lh-subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
