/* Reference pages (subject: Reference). Linked as /styles/reference.css; wrapper: <div class="reference-lesson <course-slug>"> */
  .reference-lesson {
    font-family: 'Georgia', serif;
    color: #e2e4ec;
    line-height: 1.75;
  }
  .reference-lesson h2 {
    font-size: 1.45rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: #fff;
    border-bottom: 2px solid #4f8ef7;
    padding-bottom: 8px;
  }
  .reference-lesson h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
    color: #c9a8ff;
    font-family: system-ui, -apple-system, sans-serif;
  }
  .reference-lesson p { margin-bottom: 1rem; }
  .reference-lesson .section-intro {
    font-style: italic;
    color: #7a7f96;
    margin-bottom: 20px;
    font-size: 0.92em;
  }

  /* ── Code blocks ─────────────────────────────────── */
  .code-block {
    background: #12141e;
    border: 1px solid #2a2d3a;
    border-radius: 6px;
    padding: 14px 16px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.88em;
    color: #e2e4ec;
    display: block;
    overflow-x: auto;
    white-space: pre;
    position: relative;
    line-height: 1.7;
    margin: 8px 0 16px;
  }
  .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    color: #a0a4b8;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: system-ui, sans-serif;
  }
  .copy-btn:hover { background: #2a2d3a; color: #e2e4ec; }
  @media print { .copy-btn { display: none; } }
  .cm { color: #6a9153; font-style: italic; }
  .kw { color: #c9a8ff; }
  .st { color: #7ecfa0; }
  .nu { color: #f08080; }
  .fn { color: #7ab8ff; }
  .cl { color: #ffd580; }
  .op { color: #a0a4b8; }

  /* ── Callout boxes ───────────────────────────────── */
  .java-box {
    background: #1a1d27;
    border-left: 3px solid #ffd580;
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.88em;
    color: #a0a4b8;
  }
  .java-box strong { color: #ffd580; }
  .java-box .java-label {
    font-family: system-ui, sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffd580;
    display: block;
    margin-bottom: 4px;
  }

  .tip-box {
    background: #1a1d27;
    border-left: 3px solid #7c5cbf;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin-top: 16px;
    font-size: 0.88em;
    color: #a0a4b8;
    font-style: italic;
  }
  .tip-box strong { color: #4f8ef7; font-style: normal; }
  .tip-box .trap { color: #f08080; font-style: normal; font-weight: bold; }

  /* ── Concept cards ───────────────────────────────── */
  .concept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }
  @media (max-width: 600px) { .concept-grid { grid-template-columns: 1fr; } }

  .concept-card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 6px;
    padding: 16px;
    transition: border-color 0.2s;
  }
  .concept-card:hover { border-color: #4f8ef7; }
  .concept-card .cc-type {
    font-family: system-ui, sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4f8ef7;
    margin-bottom: 4px;
  }
  .concept-card .cc-name {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 1.1em;
    color: #ffd580;
    margin-bottom: 6px;
    display: block;
  }
  .concept-card .cc-desc {
    font-size: 0.88em;
    color: #a0a4b8;
    margin-bottom: 10px;
  }
  .concept-card .cc-example {
    background: #12141e;
    border-radius: 4px;
    padding: 8px 10px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.82em;
    color: #e2e4ec;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.6;
  }

  /* ── Example blocks ──────────────────────────────── */
  .example-block {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
  }
  .example-block .ex-title {
    font-family: system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    color: #4f8ef7;
    margin-bottom: 6px;
  }
  .example-block .ex-desc {
    font-size: 0.88em;
    color: #a0a4b8;
    margin-bottom: 8px;
    font-style: italic;
  }

  /* ── Quick reference table ───────────────────────── */
  .ref-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.88em;
    margin-top: 12px;
    margin-bottom: 24px;
  }
  .ref-table th {
    background: #1e2235;
    color: #4f8ef7;
    padding: 9px 14px;
    text-align: left;
    font-size: 0.8em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid #2a2d3a;
  }
  .ref-table td {
    padding: 8px 14px;
    border-bottom: 1px solid #2a2d3a;
    color: #e2e4ec;
    vertical-align: top;
  }
  .ref-table tr:nth-child(even) td { background: #1a1d27; }
  .ref-table tr:hover td { background: #1e2235; }
  .ref-table code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9em;
    color: #7ecfa0;
    background: #12141e;
    padding: 1px 5px;
    border-radius: 3px;
  }
  .ref-table .note { font-size: 0.8em; color: #7a7f96; font-style: italic; }

  .fastapi-box {
    background: #0f1a14;
    border-left: 3px solid #7ecfa0;
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.88em;
    color: #a0a4b8;
  }
  .fastapi-box strong { color: #7ecfa0; }
  .fastapi-box .fastapi-label {
    font-family: system-ui, sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7ecfa0;
    display: block;
    margin-bottom: 4px;
  }
  .reference-lesson ol, .reference-lesson ul { margin: 0 0 1rem 1.4rem; color: #a0a4b8; font-size: 0.92em; }
  .reference-lesson li { margin-bottom: 0.4rem; }
  .reference-lesson p code, .reference-lesson li code, .java-box code, .fastapi-box code, .tip-box code {
    font-family: 'Courier New', Consolas, monospace; font-size: 0.9em; color: #7ecfa0;
    background: #12141e; padding: 1px 5px; border-radius: 3px;
  }

  /* ── Reference-page additions ────────────────────── */
  .reference-lesson .course-name { font-family: system-ui, sans-serif; font-weight: 700; font-size: 1.3rem; color: #4f8ef7; margin: 0 0 2px; }
  .reference-lesson .chapter-sub { font-family: system-ui, sans-serif; font-size: 0.8rem; color: #7a7f96; margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.08em; }
  .syntax-box { background: #12141e; border: 1px solid #2a2d3a; border-left: 3px solid #4f8ef7; border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 0 0 18px; }
  .syntax-box .syntax-label { font-family: system-ui, sans-serif; font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #4f8ef7; display: block; margin-bottom: 6px; }
  .syntax-box .syntax-code { font-family: 'Courier New', Consolas, monospace; font-size: 0.88em; white-space: pre; overflow-x: auto; line-height: 1.7; color: #e2e4ec; }
  .syntax-box .syntax-meta { font-family: system-ui, sans-serif; font-size: 0.8em; color: #7a7f96; margin-top: 8px; }

  /* ── Keyword index (home page) ───────────────────── */
  .kw-progress { font-family: system-ui, sans-serif; font-size: 0.85em; color: #a0a4b8; margin: 0 0 18px; }
  .kw-group-title { font-family: system-ui, sans-serif; font-size: 0.85em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #ffd580; margin: 22px 0 8px; }
  .kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
  .kw-card { background: #1a1d27; border: 1px solid #2a2d3a; border-radius: 6px; padding: 10px 12px; }
  .kw-card.written { border-color: #2f4a3a; }
  .kw-card .kw-name { font-family: 'Courier New', Consolas, monospace; font-size: 1.05em; color: #ffd580; display: block; }
  .kw-card .kw-name a { color: #7ab8ff; text-decoration: none; }
  .kw-card .kw-name a:hover { text-decoration: underline; }
  .kw-card .kw-status { font-family: system-ui, sans-serif; font-size: 0.74em; color: #7a7f96; display: block; margin-top: 2px; }
  .kw-card .kw-status.planned { font-style: italic; }
  .kw-card .kw-extra { font-family: system-ui, sans-serif; font-size: 0.74em; display: block; margin-top: 4px; color: #7a7f96; }
  .kw-card .kw-extra a { color: #7ecfa0; text-decoration: none; }
  .kw-card .kw-extra a:hover { text-decoration: underline; }

  /* ── Exercise pages ──────────────────────────────── */
  .challenges-grid { display: grid; gap: 1.25rem; margin: 1.5rem 0; }
  .challenge-card { background: #1a1d27; border: 1px solid #2a2d3a; border-left: 4px solid #4f8ef7; border-radius: 0 6px 6px 0; padding: 1.2rem 1.4rem; }
  .challenge-card h4 { font-family: system-ui, -apple-system, sans-serif; color: #7ab8ff; font-size: 1rem; margin-bottom: 0.6rem; }
  .challenge-card p { color: #a0a4b8; font-size: 0.92rem; margin-bottom: 0.7rem; }
  .challenge-card p:last-of-type { margin-bottom: 0; }
  .challenge-card strong { color: #e2e4ec; }
  .challenge-card code { font-family: 'Courier New', Consolas, monospace; background: #12141e; border: 1px solid #2a2d3a; border-radius: 4px; padding: 1px 6px; color: #ffd580; font-size: 0.88em; }
  .challenge-card .cc-solution { font-family: system-ui, -apple-system, sans-serif; font-size: 0.85rem; }
  .challenge-card .cc-solution a { color: #7ecfa0; text-decoration: none; }
  .challenge-card .cc-solution a:hover { text-decoration: underline; }
