/* ═══════════════════════════════════════════════════════════════════
   Hedge Funds Notes — styles.css
   RequestNotes Finance → Alternative Investments → Hedge Funds
═══════════════════════════════════════════════════════════════════ */

/* ── DARK MODE (Default) ── */
:root {
  --bg:           #09090b;
  --surface:      #111113;
  --card:         #18181b;
  --border:       #27272a;
  --border-light: #3f3f46;
  --text:         #fafafa;
  --muted:        #a1a1aa;
  --dim:          #52525b;
  --shadow:       0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.5);

  --accent:  #6366f1;
  --accent2: #818cf8;
  --accent3: #a5b4fc;

  --green: #22c55e;
  --amber: #f59e0b;
  --coral: #f97316;
  --pink:  #ec4899;
  --teal:  #14b8a6;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --topbar-height: 40px;
}

/* ── LIGHT MODE ── */
.light,
[data-theme="light"] {
  --bg:           #fafaf9;
  --surface:      #f4f4f5;
  --card:         #ffffff;
  --border:       #e4e4e7;
  --border-light: #d4d4d8;
  --text:         #09090b;
  --muted:        #52525b;
  --dim:          #a1a1aa;
  --shadow:       0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --green-text:   #15803d;
  --amber-text:   #b45309;
  --coral-text:   #c2410c;
  --teal-text:    #0f766e;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.site-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.topbar-logo-mark {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: .02em;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--dim);
  flex: 1;
  min-width: 0;
}

.topbar-bc-link {
  color: var(--dim);
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.topbar-bc-link:hover { color: var(--muted); }
.topbar-bc-sep { color: var(--dim); font-size: 11px; }
.topbar-bc-current { color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  padding: 3px 7px;
  font-size: 13px;
  transition: border-color .15s, color .15s;
  display: flex;
  align-items: center;
}
.topbar-theme-toggle:hover { border-color: var(--border-light); color: var(--text); }

.icon-light { display: none; }
.icon-dark  { display: inline; }
.light .icon-dark  { display: none; }
.light .icon-light { display: inline; }

.topbar-request {
  font-size: 12px;
  color: var(--accent2);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.topbar-request:hover { border-color: var(--accent); color: var(--accent); }

/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  margin-top: var(--topbar-height);
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

#toc-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#toc-nav::-webkit-scrollbar { width: 3px; }
#toc-nav::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
#toc-nav::-webkit-scrollbar-track { background: transparent; }

/* Separator between top-level sidebar items */
.toc-item { border-bottom: 1px solid var(--border); }

a.toc-header, a.toc-sub {
  text-decoration: none;
  color: inherit;
  display: flex;
}

.toc-header {
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.toc-header:hover { background: rgba(255,255,255,.03); color: var(--text); }
.light .toc-header:hover { background: rgba(0,0,0,.03); }

.toc-header.active {
  color: var(--accent2);
  background: rgba(99,102,241,.07);
}

.toc-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.toc-label { flex: 1; }
.toc-chevron { font-size: 9px; color: var(--dim); transition: transform .2s ease; }
.toc-item.open > a .toc-chevron { transform: rotate(90deg); }

.toc-subs { display: none; }
.toc-item.open .toc-subs { display: block; }

.toc-sub {
  display: block;
  padding: 5px 14px 5px 40px;
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.toc-sub:hover { background: rgba(255,255,255,.02); color: var(--muted); }
.light .toc-sub:hover { background: rgba(0,0,0,.02); }
.toc-sub.active { color: var(--accent2); font-weight: 500; }

/* ── SIDEBAR FOOTER (Progress Bar) ── */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 5px;
}

.progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width .4s ease;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  min-width: 0;
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 0 0 64px;
}

.main-header {
  padding: 16px 48px 0;
  max-width: 960px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 12px;
  color: var(--dim);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.breadcrumb .bc-active { color: var(--muted); }

#content-area {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 48px 64px;
}

/* ── CONTENT CONTAINER ── */
.content-container { padding-top: 24px; }

/* ── TYPOGRAPHY ── */
.content-container h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.content-container h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.content-container h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 20px 0 8px;
}

.body-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 16px;
}

.content-container p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 14px;
}

.content-container ul, .content-container ol {
  padding-left: 20px;
  margin-bottom: 14px;
}
.content-container li {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 4px;
}
.content-container strong { color: var(--text); }
.content-container em { color: var(--accent3); font-style: italic; }
.content-container a { color: var(--accent2); text-decoration: none; }
.content-container a:hover { color: var(--accent); text-decoration: underline; }

/* ── DIFFICULTY BADGE ── */
.difficulty-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 18px;
  letter-spacing: .03em;
}
.difficulty-badge.beginner  { background: rgba(34,197,94,.12);  color: var(--green); border: 1px solid rgba(34,197,94,.2);  }
.difficulty-badge.intermediate { background: rgba(245,158,11,.12); color: var(--amber); border: 1px solid rgba(245,158,11,.2); }
.difficulty-badge.advanced  { background: rgba(249,115,22,.12); color: var(--coral); border: 1px solid rgba(249,115,22,.2); }
.difficulty-badge.expert    { background: rgba(239,68,68,.12);  color: #ef4444;      border: 1px solid rgba(239,68,68,.2);  }

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--sv-color, var(--accent2));
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.stat-desc {
  font-size: 12px;
  color: var(--dim);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── CALLOUT BOXES ── */
.callout {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.65;
  border-left: 3px solid;
}
.callout-title {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}
.callout.info    { background: rgba(99,102,241,.07);  border-color: var(--accent);  color: var(--muted); }
.callout.success { background: rgba(34,197,94,.07);   border-color: var(--green);   color: var(--muted); }
.callout.warning { background: rgba(245,158,11,.08);  border-color: var(--amber);   color: var(--muted); }
.callout.danger  { background: rgba(249,115,22,.08);  border-color: var(--coral);   color: var(--muted); }
.callout.teal    { background: rgba(20,184,166,.07);  border-color: var(--teal);    color: var(--muted); }

/* ── FORMULA BOX ── */
.formula-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0;
  font-family: 'Segoe UI', system-ui, monospace;
}
.formula-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent2);
  margin-bottom: 8px;
}
.formula-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-family: 'Consolas', 'Courier New', monospace;
}
.formula-vars {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.7;
}
.formula-vars span { display: block; }
.formula-vars strong { color: var(--muted); }

/* ── TABLES ── */
.table-wrapper {
  overflow-x: auto;
  margin: 18px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead tr { background: var(--surface); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 9px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }
.light tr:hover td { background: rgba(0,0,0,.02); }

/* ── TABS ── */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--muted); }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── EXPANDABLE BLOCKS ── */
.expand-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 12px 0;
  overflow: hidden;
}
.expand-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background .12s;
}
.expand-header:hover { background: rgba(255,255,255,.03); }
.light .expand-header:hover { background: rgba(0,0,0,.03); }
.expand-icon { font-size: 10px; color: var(--dim); transition: transform .2s; }
.expand-block.open .expand-icon { transform: rotate(180deg); }
.expand-body { display: none; padding: 14px 16px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.expand-block.open .expand-body { display: block; }

/* ── QUIZ ── */
.quiz-question { margin-bottom: 24px; }
.quiz-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-opt {
  text-align: left;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--border-light); background: var(--card); }
.quiz-opt.correct  { border-color: var(--green); background: rgba(34,197,94,.08); color: var(--text); }
.quiz-opt.wrong    { border-color: var(--coral); background: rgba(249,115,22,.06); color: var(--muted); opacity: .7; }
.quiz-opt:disabled { cursor: default; }
.quiz-explain {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}
.quiz-explain.show { display: block; }
.quiz-question.answered .quiz-explain { display: block; }

/* Mini Quiz Section */
.mini-quiz-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.mini-quiz-section h3 { margin-bottom: 4px; }
.mini-quiz-block { margin-bottom: 32px; }
.mini-quiz-block h4, .knowledge-check-block h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 16px;
  border-left: none;
  padding-left: 0;
}

/* Topic Quick Check */
.topic-quick-check { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.topic-quick-check h3 { margin-bottom: 4px; }

/* Knowledge Check Items */
.kc-item { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; }
.kc-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 12px;
}
.kc-question:hover { background: rgba(99,102,241,.05); }
.light .kc-question:hover { background: rgba(99,102,241,.04); }
.kc-q-text { font-size: 14px; color: var(--text); font-weight: 500; line-height: 1.5; }
.kc-toggle { font-size: 11px; color: var(--muted); flex-shrink: 0; margin-top: 3px; transition: transform .2s ease; }
.kc-item.open .kc-toggle { transform: rotate(180deg); }
.kc-answer {
  display: none;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.kc-item.open .kc-answer { display: block; }
.kc-answer p { margin-bottom: 10px; color: var(--muted); }
.kc-answer p:last-child { margin-bottom: 0; }
.kc-answer strong { color: var(--text); }

/* Quiz section padding */
.kc-section    { padding-bottom: 16px; }
.quiz-section  { padding-bottom: 16px; }

/* ── SUBTOPIC NAV ── */
.subtopic-nav {
  margin-top: 36px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--border);
}
.subtopic-nav-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
.subtopic-nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.subtopic-nav-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: color .15s, border-color .15s;
  cursor: pointer;
}
.subtopic-nav-link:hover { color: var(--text); border-color: var(--accent); }
.subtopic-nav-link.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(99,102,241,.07);
  font-weight: 500;
  pointer-events: none;
}

/* ── PREV / NEXT FOOTER ── */
.topic-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.topic-nav-prev, .topic-nav-next {
  font-size: 13px;
  color: var(--accent2);
  text-decoration: none;
  transition: color .15s;
}
.topic-nav-prev:hover, .topic-nav-next:hover { color: var(--accent); }
.topic-nav-next { margin-left: auto; }

/* ── COUNTRY TABS ── */
.country-tabs { margin: 18px 0; }
.country-tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.country-tab-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.country-tab-btn:hover { color: var(--muted); }
.country-tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }
.country-tab-panel { display: none; }
.country-tab-panel.active { display: block; }

/* ── METRIC BARS ── */
.metric-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
.metric-bar-label { width: 160px; flex-shrink: 0; color: var(--muted); }
.metric-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.metric-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width .6s ease;
}
.metric-bar-val { width: 40px; text-align: right; color: var(--dim); flex-shrink: 0; }

/* ── CHEATSHEET COMPONENTS ── */
.cheatsheet-section {
  margin-bottom: 36px;
}

.cheatsheet-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 0 0 14px;
  padding-left: 0;
  border-left: none;
  padding-bottom: 6px;
  border-bottom: none;
}

/* Formula grid */
.cs-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.cs-formula-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.cs-f-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent2);
  margin-bottom: 6px;
}
.cs-f-formula {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  word-break: break-word;
}
.cs-f-note {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.5;
}

/* Compact formula list */
.cs-formula-compact {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}
.cs-fc-row {
  display: grid;
  grid-template-columns: 200px 24px 1fr;
  align-items: start;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.cs-fc-row:last-child { border-bottom: none; }
.cs-fc-row:nth-child(even) { background: rgba(255,255,255,.015); }
.light .cs-fc-row:nth-child(even) { background: rgba(0,0,0,.015); }
.cs-fc-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.cs-fc-eq { font-size: 14px; color: var(--dim); text-align: center; }
.cs-fc-formula { font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; color: var(--accent2); word-break: break-word; }

/* Info card grids */
.cs-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cs-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.cs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.cs-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 8px;
}
.cs-items { display: flex; flex-direction: column; gap: 4px; }
.cs-items span { font-size: 12.5px; color: var(--dim); line-height: 1.5; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.cs-items span:last-child { border-bottom: none; padding-bottom: 0; }
.cs-items strong { color: var(--muted); }

/* Timeline */
.cs-timeline { padding: 0 0 0 16px; border-left: 2px solid var(--border); margin: 8px 0 12px; }
.cs-tl-item { position: relative; padding: 0 0 16px 20px; }
.cs-tl-item:last-child { padding-bottom: 0; }
.cs-tl-dot {
  position: absolute;
  left: -9px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.cs-tl-dot-warn { background: var(--amber); }
.cs-tl-dot-info { background: var(--accent2); }
.cs-tl-dot-success { background: var(--green); }
.cs-tl-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.cs-tl-desc { font-size: 12px; color: var(--dim); line-height: 1.5; }

/* Note box */
.cs-note {
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(245,158,11,.06);
  border-left: 3px solid var(--amber);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 10px;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (≤ 767px) — Never affects desktop layout
══════════════════════════════════════════════════════════════ */
.mobile-nav-toggle { display: none; }

@media (max-width: 767px) {
  .app-layout { display: block; overflow: visible; }

  .main-content {
    height: auto;
    overflow-y: visible;
    padding: 16px 18px 100px;
  }

  .main-header { padding: 12px 18px 0; }
  #content-area { padding: 0 18px 64px; }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: 280px;
    height: calc(100vh - var(--topbar-height));
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.mobile-open { transform: translateX(0); }

  .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--topbar-height);
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.28s ease;
  }
  .mobile-nav-overlay.active { display: block; opacity: 1; }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 0;
    z-index: 198;
    width: 44px;
    height: 44px;
    padding: 0 0 0 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 22px 0 0 22px;
    color: #6366f1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.25);
  }
  .mobile-nav-toggle:hover, .mobile-nav-toggle:focus-visible {
    background: var(--card);
    color: #6366f1;
    outline: none;
  }
  .mobile-nav-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
  .mobile-nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cs-grid-3 { grid-template-columns: 1fr 1fr; }
  .cs-formula-grid { grid-template-columns: 1fr; }

  .topic-nav-prev, .topic-nav-next {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
  }
  .topic-nav-footer { flex-direction: column; }
  .topic-nav-next { margin-left: 0; }

  .content-container h2 { font-size: 22px; }
  .topbar-logo-text, .topbar-bc-link:not(:last-of-type) { display: none; }
}
