/* SharpLearn - minimal, readable, light + dark. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --panel: #ffffff;
  --text: #1b1e23;
  --muted: #5c6672;
  --border: #e4e7ec;
  --border-strong: #d3d8e0;
  --accent: #512bd4;
  --accent-soft: #f1ecff;
  --accent-text: #ffffff;
  --code-bg: #f7f8fa;
  --out-bg: #1c2027;
  --out-text: #e8ebf0;
  --ok: #10794a;
  --err: #c0392b;
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.06), 0 8px 24px rgba(16, 20, 28, 0.05);
  --nav-bg: #dee3ed;
  --nav-border: #c6cddb;
  --nav-hover: #d0d7e5;
  --nav-input: #eef1f6;
  --nav-track: #c6cddb;
  --nav-heading: #4a5568;
  --nav-tick: #a8b2c4;
  --why-bg: #faf9ff;
  --practice-bg: #f5fbf8;

  --t-keyword: #7c3aed;
  --t-type: #0f766e;
  --t-string: #b4471f;
  --t-comment: #7b8492;
  --t-number: #0b6bab;
  --t-call: #1d4ed8;
  --t-literal: #7c3aed;
  --t-punct: #566072;
  --t-meta: #9333ea;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-w: 274px;
  --head-h: 56px;
}

html[data-theme='dark'] {
  --bg: #14161a;
  --bg-soft: #1a1d22;
  --panel: #191c21;
  --text: #e4e7ec;
  --muted: #98a2b0;
  --border: #282d35;
  --border-strong: #343a44;
  --accent: #a78bfa;
  --accent-soft: #241f3a;
  --accent-text: #14161a;
  --code-bg: #1a1d23;
  --out-bg: #0f1115;
  --out-text: #e4e7ec;
  --ok: #4ade80;
  --err: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --nav-bg: #171a1f;
  --nav-border: #2c313a;
  --nav-hover: #22262e;
  --nav-input: #1f232a;
  --nav-track: #2c313a;
  --nav-heading: #98a2b0;
  --nav-tick: #414855;
  --why-bg: #1b1826;
  --practice-bg: #14201b;

  --t-keyword: #c792ea;
  --t-type: #4ec9b0;
  --t-string: #e0956b;
  --t-comment: #7d8590;
  --t-number: #b5cea8;
  --t-call: #82aaff;
  --t-literal: #c792ea;
  --t-punct: #a1abbb;
  --t-meta: #c586c0;
}

* { box-sizing: border-box; }

:root { color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: var(--mono); font-size: 0.88em; }

/* ------------------------------------------------------------------ header */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
html[data-theme='dark'] .brand-mark { color: #14161a; }
.brand-sharp { color: var(--accent); }

.head-spacer { flex: 1; }

.head-note {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.icon-btn:hover { background: var(--bg-soft); }

#nav-toggle { display: none; }

/* ----------------------------------------------------------------- sidebar */

.sidebar {
  position: fixed;
  top: var(--head-h);
  bottom: 0;
  left: 0;
  width: var(--nav-w);
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.nav-search-wrap { padding: 11px 12px 7px; }
#nav-search {
  width: 100%;
  padding: 8px 11px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--nav-input);
  border: 1px solid var(--nav-border);
  border-radius: 8px;
}
#nav-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Progress widget */
#nav-progress {
  padding: 9px 14px 11px;
  border-bottom: 1px solid var(--nav-border);
  font-size: 12px;
}
.prog-top { display: flex; align-items: baseline; gap: 8px; }
.prog-level { font-weight: 700; color: var(--text); }
.prog-xp { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-bar {
  height: 6px;
  margin: 7px 0 5px;
  border-radius: 4px;
  background: var(--nav-track);
  overflow: hidden;
}
.prog-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #7c5cf0);
  transition: width 0.35s ease;
}
.prog-meta { display: flex; gap: 8px; color: var(--muted); }
.prog-streak { margin-left: auto; font-weight: 600; color: #b45309; }
html[data-theme='dark'] .prog-streak { color: #fbbf24; }

#nav-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 40px;
  scrollbar-width: thin;
}

/* Chapters */
.nav-group + .nav-group { margin-top: 3px; }

.nav-group-title,
.nav-sub-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.nav-group-title:hover, .nav-sub-title:hover { background: var(--nav-hover); }

.nav-group-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--nav-heading);
}
.nav-sub-label { font-size: 13px; font-weight: 650; color: var(--text); }

.nav-group-count, .nav-sub-count {
  margin-left: auto;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--nav-track);
  border-radius: 10px;
  padding: 1px 6px;
}
.nav-group-count.is-complete, .nav-sub-count.is-complete {
  background: #1a7f37;
  color: #fff;
}

.nav-caret {
  flex: 0 0 auto;
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  opacity: 0.5;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}
.is-collapsed > .nav-group-title .nav-caret,
.is-collapsed > .nav-sub-title .nav-caret { transform: rotate(0deg); }

.nav-group-body { overflow: hidden; }
.nav-group.is-collapsed > .nav-group-body { display: none; }
.nav-sub.is-collapsed > ul { display: none; }

.nav-sub { margin: 1px 0 3px; }
.nav-sub > ul { padding-left: 10px; border-left: 1px solid var(--nav-border); margin-left: 14px; }

.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
}
.nav-group a:hover { background: var(--nav-hover); text-decoration: none; }
.nav-group a.is-active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.nav-tick {
  flex: 0 0 auto;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--nav-tick);
}
.nav-group a.is-done .nav-tick {
  border-color: #1a7f37;
  background: #1a7f37;
  position: relative;
}
.nav-group a.is-done .nav-tick::after {
  content: '';
  position: absolute;
  left: 3.5px; top: 1px;
  width: 3px; height: 6px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
.nav-group a.is-active .nav-tick { border-color: currentColor; }
.nav-group a.is-active.is-done .nav-tick { border-color: #fff; background: #fff; }
.nav-group a.is-active.is-done .nav-tick::after { border-color: var(--accent); }

/* ------------------------------------------------------------------- main */

.wrap {
  margin-left: var(--nav-w);
  padding: calc(var(--head-h) + 26px) 32px 96px;
}
.lesson { max-width: 780px; margin: 0 auto; }

.crumbs { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 8px 0 18px;
}
h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 38px 0 10px;
  padding-top: 6px;
}
h3 { font-size: 17px; margin: 26px 0 6px; }

p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--muted); margin-bottom: 20px; }

p code, li code, td code, .callout code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--t-string);
}
html[data-theme='dark'] p code,
html[data-theme='dark'] li code,
html[data-theme='dark'] td code { color: var(--t-type); }

.body-list { margin: 0 0 16px; padding-left: 22px; }
.body-list li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- callouts */

.callout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 18px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  background: var(--bg-soft);
  font-size: 15px;
}
.callout strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.callout p:last-child { margin-bottom: 0; }
.callout-note { border-left-color: #3b82f6; }
.callout-note strong { color: #3b82f6; }
.callout-tip { border-left-color: #10b981; }
.callout-tip strong { color: #10b981; }
.callout-warn { border-left-color: #f59e0b; }
.callout-warn strong { color: #d97706; }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------- cards */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.card-title { font-weight: 650; font-size: 15px; }
.card-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------- code blocks */

pre.code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 4;
}
pre.code code { font-size: inherit; background: none; border: 0; padding: 0; color: inherit; }

.snippet { margin: 18px 0; }
.snippet figcaption { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.t-keyword { color: var(--t-keyword); }
.t-type { color: var(--t-type); }
.t-string, .t-char { color: var(--t-string); }
.t-comment { color: var(--t-comment); font-style: italic; }
.t-number { color: var(--t-number); }
.t-call { color: var(--t-call); }
.t-literal { color: var(--t-literal); font-weight: 500; }
.t-punct, .t-op { color: var(--t-punct); }
.t-meta { color: var(--t-meta); }
.t-hole.t-ident { color: var(--text); }

/* ---------------------------------------------------------------- examples */

.example {
  margin: 20px 0 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.example figcaption {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.example-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.example-intro { margin: 12px 14px 0; font-size: 15px; color: var(--muted); }
.example-code { padding: 12px 14px 0; }
.example-code pre.code { border: 0; background: transparent; padding: 0; }

.example-output { margin: 10px 14px 0; font-size: 14px; }
.example-output summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; user-select: none; }
.example-output summary:hover { color: var(--accent); }
.example-output pre {
  margin: 8px 0 0;
  padding: 11px 13px;
  background: var(--out-bg);
  color: var(--out-text);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
}

.example-actions { padding: 12px 14px 14px; }
.try-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
.try-btn:hover { filter: brightness(1.08); }
.example.is-live .example-actions { padding-top: 0; }

/* ------------------------------------------------------------------ editor */

.example-editor { padding: 12px 14px 14px; }

.ed-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}
.ed-label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ed-actions { margin-left: auto; display: flex; gap: 6px; }
.ed-btn {
  font: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.ed-btn:hover { background: var(--bg-soft); }
.ed-btn-run {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}
.ed-btn-run:hover { filter: brightness(1.08); background: var(--accent); }
.ed-btn-run:disabled { opacity: 0.6; cursor: default; }
.ed-run-icon {
  width: 0; height: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}
.is-running .ed-run-icon {
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  width: 11px; height: 11px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ed-body {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--code-bg);
  overflow: hidden;
}
.ed-gutter {
  flex: 0 0 auto;
  padding: 12px 8px 12px 12px;
  overflow: hidden;
  text-align: right;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  opacity: 0.55;
  user-select: none;
  border-right: 1px solid var(--border);
}
.ed-gutter span { display: block; }

.ed-surface { position: relative; flex: 1; min-width: 0; }

.ed-paint,
.ed-input {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  border: 0;
  letter-spacing: normal;
}
.ed-paint {
  position: absolute;
  inset: 0;
  overflow: auto;
  pointer-events: none;
  color: var(--text);
}
.ed-paint code { font: inherit; }
.ed-input {
  position: relative;
  display: block;
  width: 100%;
  resize: none;
  overflow: auto;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
  outline: none;
}
.ed-input::selection { background: rgba(81, 43, 212, 0.22); }
html[data-theme='dark'] .ed-input::selection { background: rgba(167, 139, 250, 0.3); }

/* Completion popup. */
.cmp-popup {
  position: fixed;
  z-index: 200;
  width: 370px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  box-shadow: 0 10px 34px rgba(16, 20, 28, 0.18);
  font-family: var(--mono);
  font-size: 12.5px;
  scrollbar-width: thin;
}
html[data-theme='dark'] .cmp-popup { box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55); }

.cmp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.cmp-row:hover { background: var(--bg-soft); }
.cmp-row.is-selected { background: var(--accent); color: var(--accent-text); }
.cmp-row.is-selected .cmp-sig { color: var(--accent-text); opacity: 0.75; }

.cmp-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.cmp-icon-method { background: #8250df; }
.cmp-icon-property { background: #0969da; }
.cmp-icon-field { background: #1a7f37; }
.cmp-icon-keyword { background: #a4413a; }
.cmp-icon-snippet { background: #bf6516; }
.cmp-icon-class { background: #0f766e; }

.cmp-name { flex: 0 0 auto; font-weight: 600; }
.cmp-sig {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  color: var(--muted);
  font-size: 11.5px;
}

.cmp-doc {
  position: sticky;
  bottom: 0;
  margin: 4px -4px -4px;
  padding: 8px 11px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: normal;
}

/* Drag handle under the editor. */
.ed-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  margin-top: 2px;
  cursor: ns-resize;
  border-radius: 6px;
  touch-action: none;
}
.ed-grip span {
  display: block;
  width: 46px;
  height: 4px;
  border-radius: 3px;
  background: var(--border-strong);
  transition: background 0.12s ease, width 0.12s ease;
}
.ed-grip:hover span, .ed-grip:focus-visible span { background: var(--accent); width: 70px; }
.ed-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
body.is-resizing { cursor: ns-resize; user-select: none; }
body.is-resizing .ed-input { pointer-events: none; }

/* Full-screen editing. */
body.has-fullscreen-editor { overflow: hidden; }

.example.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  margin: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.example.is-fullscreen > figcaption {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-soft);
}
.example.is-fullscreen .example-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 20px 28px;
}
.example.is-fullscreen .ed-out-body { max-height: none; }

.ed-stdin { margin-top: 10px; }
.ed-stdin.is-hidden { display: none; }
.ed-stdin label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ed-stdin small { font-weight: 400; }
.ed-stdin-box {
  width: 100%;
  padding: 8px 11px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  resize: vertical;
}

.ed-out { margin-top: 10px; border-radius: 9px; overflow: hidden; background: var(--out-bg); }
.ed-out-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.05);
  color: #aeb6c4;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ed-out-meta { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; opacity: 0.85; }
.ed-out-body {
  margin: 0;
  padding: 12px 13px;
  color: var(--out-text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
}
.ed-out.is-empty .ed-out-body { color: #93a0b1; }
.ed-out.is-ok .ed-out-bar { color: #6ee7a8; }
.ed-out.is-error .ed-out-bar { color: #fca5a5; }
.ed-out .diag { color: #fca5a5; }
.ed-out .warnline { color: #fcd34d; }
.ed-out .muted { color: #93a0b1; font-style: italic; }
.ed-out kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #3a424f;
  background: #262c35;
}

/* --------------------------------------------- why / best practice / done */

.why {
  margin: 46px 0 0;
  padding: 20px 22px 4px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--why-bg);
}
.why h2 { margin: 0 0 10px; padding: 0; font-size: 20px; }
.why-lead { font-size: 16px; }
.why-list { list-style: none; margin: 0; padding: 0; }
.why-list li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 26px;
  font-size: 15.5px;
  line-height: 1.6;
}
.why-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.why-list strong { font-weight: 650; }

.practice {
  margin: 20px 0 0;
  padding: 16px 20px 6px;
  border: 1px solid var(--border);
  border-left: 4px solid #10b981;
  border-radius: 12px;
  background: var(--practice-bg);
}
.practice h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #0f7f5c;
}
html[data-theme='dark'] .practice h3 { color: #34d399; }
.practice .body-list { font-size: 15.5px; }

.complete-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.complete-btn:hover { border-color: var(--accent); }
.complete-btn.is-done {
  border-color: #1a7f37;
  background: #1a7f37;
  color: #fff;
}
.complete-btn .tick { font-size: 16px; }
.complete-btn.pop { animation: pop 0.32s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.complete-hint { font-size: 13px; color: var(--muted); }

.example-ran {
  margin-left: auto;
  color: #1a7f37;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
}
.example.has-run .example-ran { opacity: 1; }
html[data-theme='dark'] .example-ran { color: #4ade80; }

/* ------------------------------------------------------------------ pager */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 46%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager-next { text-align: right; }
.pager span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pager strong { font-size: 15px; font-weight: 600; }

/* ------------------------------------------------------------------ mobile */

#scrim { display: none; }

@media (max-width: 900px) {
  #nav-toggle { display: grid; }
  .head-note { display: none; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open #scrim {
    display: block;
    position: fixed;
    inset: var(--head-h) 0 0 0;
    background: rgba(10, 12, 16, 0.4);
    z-index: 25;
  }
  .wrap { margin-left: 0; padding: calc(var(--head-h) + 18px) 18px 72px; }
  h1 { font-size: 27px; }
  h2 { font-size: 20px; }
  body { font-size: 15.5px; }
}
