/* ═══════════════════════════════════════════════════════════════
   Real Estate Investing & Analysis Notes — styles.css
   RequestNotes Design System — Dark Default + Light Mode
═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Theme Tokens — Dark Default ── */
:root {
  --bg:           #09090b;
  --surface:      #111113;
  --card:         #18181b;
  --border:       #27272a;
  --border-light: #3f3f46;
  --text:         #fafafa;
  --muted:        #a1a1aa;
  --dim:          #52525b;
  --accent:       #6366f1;
  --accent2:      #818cf8;
  --accent3:      #a5b4fc;
  --green:        #22c55e;
  --amber:        #f59e0b;
  --coral:        #f97316;
  --pink:         #ec4899;
  --teal:         #14b8a6;
  --shadow:       0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.5);
  --radius:       6px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --topbar-height: 40px;
}

/* ── Light Mode Overrides ── */
.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);
}

body { background: var(--bg); color: var(--text); transition: background-color 0.2s ease, color 0.2s ease; }

/* ── Topbar ── */
.site-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.topbar-inner {
  width: 100%; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; flex-shrink: 0;
}
.topbar-logo-mark {
  width: 22px; height: 22px;
  background: var(--accent); color: #fff;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.topbar-logo-text { color: var(--text); }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted);
  flex: 1; overflow: hidden;
}
.topbar-bc-link { color: var(--muted); transition: color .15s ease; }
.topbar-bc-link:hover { color: var(--text); }
.topbar-bc-sep { color: var(--dim); }
.topbar-bc-current { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-theme-toggle {
  margin-left: auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: var(--radius);
  transition: all .15s ease; flex-shrink: 0;
}
.topbar-theme-toggle:hover { color: var(--text); background: rgba(255,255,255,.05); }
.light .topbar-theme-toggle:hover { background: rgba(0,0,0,.05); }
.topbar-theme-toggle .icon-light { display: none; }
.topbar-theme-toggle .icon-dark  { display: inline; }
.light .topbar-theme-toggle .icon-dark  { display: none; }
.light .topbar-theme-toggle .icon-light { display: inline; }
.topbar-request {
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); white-space: nowrap; flex-shrink: 0;
  transition: opacity .15s ease;
}
.topbar-request:hover { opacity: .85; }

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

/* ── Sidebar ── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--topbar-height));
}
.sidebar-label {
  padding: 12px 14px 8px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--dim); flex-shrink: 0;
}
#toc-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; }
#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; }

/* TOC Items */
.toc-item { }
a.toc-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 13px;
  color: var(--muted); text-decoration: none;
  transition: all .15s ease; cursor: pointer;
}
a.toc-header:hover { color: var(--text); background: rgba(255,255,255,.04); }
.light a.toc-header:hover { background: rgba(0,0,0,.04); }
a.toc-header.active {
  color: var(--accent); background: rgba(99,102,241,.07);
  border-left: 2px solid var(--accent);
}
.toc-icon { font-size: 13px; flex-shrink: 0; }
.toc-label { flex: 1; }
.toc-chevron {
  font-size: 9px; color: var(--dim);
  transition: transform .2s ease; flex-shrink: 0;
}
.toc-item.open .toc-chevron { transform: rotate(90deg); }

/* Subtopics */
.toc-subs { display: none; }
.toc-item.open .toc-subs { display: block; }
a.toc-sub {
  display: block; padding: 5px 14px 5px 35px;
  font-size: 12px; color: var(--dim);
  text-decoration: none; transition: all .15s ease;
}
a.toc-sub:hover { color: var(--muted); background: rgba(255,255,255,.02); }
.light a.toc-sub:hover { background: rgba(0,0,0,.02); }
a.toc-sub.active { color: var(--accent2); }

/* Progress */
.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; overflow-y: auto;
  height: calc(100vh - var(--topbar-height));
}
.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
.main-content::-webkit-scrollbar-track { background: transparent; }

.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 80px; }

/* ── Content Container ── */
.content-container { }
.content-container h2 {
  font-size: 26px; font-weight: 700;
  color: var(--text); margin: 28px 0 6px;
  line-height: 1.25;
}
.content-container h3 {
  font-size: 18px; font-weight: 600;
  color: var(--text); margin: 28px 0 10px;
}
.content-container h4 {
  font-size: 12px; font-weight: 600;
  color: var(--muted); margin: 20px 0 8px;
  text-transform: uppercase; letter-spacing: .04em;
}
.content-container p {
  color: var(--muted); font-size: 14.5px; line-height: 1.75;
  margin-bottom: 14px;
}
.content-container ul, .content-container ol {
  color: var(--muted); font-size: 14.5px; line-height: 1.75;
  padding-left: 20px; margin-bottom: 14px;
}
.content-container li { margin-bottom: 4px; }
.content-container strong { color: var(--text); font-weight: 600; }
.content-container em { color: var(--accent3); font-style: normal; font-weight: 500; }

/* ── Difficulty Badge ── */
.difficulty-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.difficulty-badge.beginner    { background: rgba(34,197,94,.1);  border-color: rgba(34,197,94,.25);  color: #22c55e; }
.difficulty-badge.intermediate { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: #f59e0b; }
.difficulty-badge.advanced    { background: rgba(249,115,22,.1);  border-color: rgba(249,115,22,.25);  color: #f97316; }
.difficulty-badge.expert      { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.25);   color: #ef4444; }

/* ── Section Blocks ── */
.section-block { margin-bottom: 32px; }

/* ── Callout Boxes ── */
.callout {
  padding: 14px 18px; border-radius: var(--radius-md);
  border-left: 3px solid; margin: 20px 0; font-size: 14px;
}
.callout p { margin-bottom: 0; font-size: 14px; }
.callout-info    { background: rgba(99,102,241,.07); border-color: var(--accent); color: var(--muted); }
.callout-warning { background: rgba(245,158,11,.07); border-color: var(--amber); color: var(--muted); }
.callout-success { background: rgba(34,197,94,.07);  border-color: var(--green); color: var(--muted); }
.callout-danger  { background: rgba(249,115,22,.07); border-color: var(--coral); color: var(--muted); }
.callout-accent  { background: rgba(99,102,241,.08); border-color: var(--accent2); color: var(--muted); }
.callout-teal    { background: rgba(20,184,166,.07); border-color: var(--teal); color: var(--muted); }
.callout strong  { color: var(--text); }

/* ── Formula Block ── */
.formula-block {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md); padding: 16px 20px;
  margin: 20px 0;
}
.formula-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--dim); margin-bottom: 8px; font-weight: 600;
}
.formula-body {
  font-size: 16px; color: var(--text);
  font-style: italic; line-height: 1.6;
}
.formula-vars {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.formula-vars p { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.formula-vars code { color: var(--accent3); background: rgba(99,102,241,.1); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* ── Data Tables ── */
.table-wrapper { overflow-x: auto; margin: 20px 0; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead { background: var(--card); }
th { padding: 10px 14px; text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; color: var(--muted); border-bottom: 1px solid var(--border); }
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); }
td strong { color: var(--text); }
.td-green  { color: var(--green) !important; }
.td-coral  { color: var(--coral) !important; }
.td-amber  { color: var(--amber) !important; }
.td-accent { color: var(--accent2) !important; }

/* ── Code Blocks ── */
.code-block {
  background: #18181b; border: 1px solid #27272a;
  border-radius: var(--radius-md); margin: 20px 0; overflow: hidden;
}
.light .code-block { background: #18181b; border-color: #27272a; }
.code-header {
  background: #111113; padding: 8px 14px;
  border-bottom: 1px solid #27272a;
  font-size: 11px; color: #71717a; font-weight: 600;
}
.code-block code {
  display: block; padding: 14px 16px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; line-height: 1.7; color: #fafafa;
  white-space: pre; overflow-x: auto;
}

/* ── Content Tabs ── */
.tabs-wrapper { margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.tabs-header {
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.tab-btn {
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(99,102,241,.05); }
.tab-panels { }
.tab-panel { display: none; padding: 20px; }
.tab-panel.active { display: block; }
.tab-panel p { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.tab-panel p:last-child { margin-bottom: 0; }
.tab-panel ul { color: var(--muted); font-size: 14px; padding-left: 18px; line-height: 1.7; }

/* ── Country Tabs ── */
.country-tabs-wrapper { margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.country-tabs-header { display: flex; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--border); }
.country-tab-btn {
  padding: 8px 16px; font-size: 12.5px; color: var(--muted);
  background: transparent; border: none; border-right: 1px solid var(--border);
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.country-tab-btn:hover { color: var(--text); background: rgba(255,255,255,.03); }
.light .country-tab-btn:hover { background: rgba(0,0,0,.03); }
.country-tab-btn.active { color: var(--accent); background: rgba(99,102,241,.06); border-bottom: 2px solid var(--accent); }
.country-tab-panels { }
.country-panel { display: none; padding: 18px 20px; }
.country-panel.active { display: block; }
.country-panel p  { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin-bottom: 10px; }
.country-panel ul { color: var(--muted); font-size: 13.5px; padding-left: 18px; line-height: 1.7; margin-bottom: 8px; }
.country-panel li { margin-bottom: 4px; }
.country-panel strong { color: var(--text); }
.country-panel table { font-size: 13px; }
.country-panel h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent2); margin-bottom: 10px; }

/* ── Expandable Blocks ── */
.expand-block { border: 1px solid var(--border); border-radius: var(--radius-md); margin: 16px 0; overflow: hidden; }
.expand-trigger {
  width: 100%; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card); font-size: 14px; color: var(--muted);
  text-align: left; cursor: pointer; transition: all .15s ease;
}
.expand-trigger:hover { color: var(--text); }
.expand-trigger.open  { color: var(--text); }
.expand-arrow { font-size: 10px; transition: transform .2s ease; }
.expand-trigger.open .expand-arrow { transform: rotate(180deg); }
.expand-content { display: none; padding: 16px; border-top: 1px solid var(--border); }
.expand-content.open { display: block; }
.expand-content p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.expand-content p:last-child { margin-bottom: 0; }

/* ── Quiz ── */
.quiz-section { }
.quiz-question { margin-bottom: 24px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.quiz-q { font-size: 14px; color: var(--text); margin-bottom: 12px; font-weight: 500; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; color: var(--muted); text-align: left; background: var(--surface);
  cursor: pointer; transition: all .15s ease;
}
.quiz-opt:hover { border-color: var(--accent); color: var(--text); }
.quiz-question.answered .quiz-opt { cursor: default; pointer-events: none; }
.quiz-opt.correct { background: rgba(34,197,94,.1); border-color: var(--green); color: var(--green); }
.quiz-opt.wrong   { background: rgba(249,115,22,.1); border-color: var(--coral); color: var(--coral); }
.quiz-explain { display: none; margin-top: 12px; padding: 10px 14px; background: rgba(99,102,241,.07); border-radius: var(--radius); font-size: 13.5px; color: var(--muted); }
.quiz-question.answered .quiz-explain { display: block; }

/* ── Interview / Knowledge Check Questions ── */
.interview-section { padding-bottom: 16px; }
.iq-item { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden; }
.iq-question {
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  background: var(--card); cursor: pointer;
  font-size: 14px; color: var(--muted); transition: color .15s ease;
}
.iq-question:hover, .iq-item.open .iq-question { color: var(--text); }
.iq-arrow { font-size: 10px; flex-shrink: 0; margin-top: 4px; transition: transform .2s ease; }
.iq-item.open .iq-arrow { transform: rotate(180deg); }
.iq-answer { display: none; padding: 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); line-height: 1.75; }
.iq-item.open .iq-answer { display: block; }
.iq-answer strong { color: var(--text); }
.iq-answer ul { padding-left: 18px; margin-top: 8px; }
.iq-answer li { margin-bottom: 5px; }

/* ── Stat Cards ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--accent2); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--dim); }
.stat-sub   { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* ── Comparison Grid ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.compare-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.compare-card h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; text-transform: none; letter-spacing: 0; }
.compare-card ul { color: var(--muted); font-size: 13.5px; padding-left: 16px; }
.compare-card li { margin-bottom: 5px; }
.compare-card.pro-card { border-color: rgba(34,197,94,.2); }
.compare-card.con-card { border-color: rgba(249,115,22,.2); }

/* ── Mental Model Box ── */
.mental-model {
  background: rgba(99,102,241,.05); border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--radius-md); padding: 18px 20px; margin: 20px 0;
}
.mental-model-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent2); margin-bottom: 8px; }
.mental-model p { color: var(--muted); font-size: 14px; margin-bottom: 0; }

/* ── Step List ── */
.step-list { list-style: none; padding: 0; margin: 16px 0; }
.step-list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.step-list li:last-child { border-bottom: none; }
.step-num { width: 26px; height: 26px; flex-shrink: 0; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.step-content { flex: 1; }
.step-content strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 3px; }
.step-content span { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ── Checklist ── */
.checklist { list-style: none; padding: 0; margin: 14px 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--muted); }
.checklist li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── Misconception callout ── */
.misconception { border: 1px solid rgba(249,115,22,.25); background: rgba(249,115,22,.05); border-radius: var(--radius-md); padding: 14px 18px; margin: 16px 0; }
.misconception-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--coral); margin-bottom: 6px; }
.misconception p { font-size: 14px; color: var(--muted); margin: 0; }

/* ── Subtopic Navigation ── */
.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; }

/* ── Cheatsheet ── */
.cheatsheet-section { margin-bottom: 36px; }
.cheatsheet-section:last-child { margin-bottom: 0; }
.cheatsheet-section > h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding-left: 10px; border-left: 3px solid var(--accent); margin-bottom: 16px; margin-top: 0; }

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

.cs-formula-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.cs-formula-card { background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius-md); padding: 12px; }
.cs-f-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent2); margin-bottom: 6px; }
.cs-f-formula { font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace; font-size: 12px; color: var(--text); background: var(--surface); border-radius: 4px; padding: 4px 8px; margin-bottom: 6px; }
.cs-f-note { font-size: 11.5px; color: var(--dim); line-height: 1.5; }

.cs-formula-compact { border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius-md); overflow: hidden; margin: 0; background: var(--card); }
.cf-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent2); padding: 8px 12px 6px; background: rgba(99,102,241,.05); border-bottom: 1px solid var(--border); }
.cf-formula { font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace; font-size: 14px; font-weight: 600; color: var(--text); padding: 10px 12px 8px; line-height: 1.4; }
.cf-vars { font-size: 11.5px; color: var(--muted); padding: 0 12px 8px; line-height: 1.55; border-top: 1px dashed var(--border); padding-top: 7px; }
.cf-example { font-size: 11.5px; color: var(--accent3); padding: 6px 12px 9px; background: rgba(99,102,241,.04); font-style: italic; border-top: 1px solid var(--border); line-height: 1.5; }

.cs-timeline { margin: 12px 0; padding-left: 16px; border-left: 2px solid var(--border); }
.cs-tl-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; margin-left: -8px; }
.cs-tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 3px; }
.cs-tl-dot-warn { background: var(--amber) !important; }
.cs-tl-dot-info { background: var(--accent2) !important; }
.cs-tl-dot-success { background: var(--green) !important; }
.cs-tl-content { flex: 1; }
.cs-tl-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.cs-tl-desc  { font-size: 12px; color: var(--dim); }
.cs-note { font-size: 12.5px; color: var(--muted); background: rgba(245,158,11,.05); border-left: 3px solid var(--amber); border-radius: 4px; padding: 8px 12px; margin-top: 10px; }
.cs-note strong { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar { width: 210px; }
  #content-area { padding: 0 28px 60px; }
  .main-header { padding: 14px 28px 0; }
  .compare-grid { grid-template-columns: 1fr; }
  .cs-grid-3 { grid-template-columns: 1fr 1fr; }
  .cs-formula-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  #content-area { padding: 0 16px 60px; }
  .main-header { padding: 12px 16px 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr; }
  .cs-grid-2, .cs-grid-3 { grid-template-columns: 1fr; }
  .cs-formula-grid { grid-template-columns: 1fr; }
  .topbar-logo-text { display: none; }
}

/* -- Knowledge Check (KC) Items � new quiz pattern -- */
.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; }
.topic-quick-check { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.topic-quick-check h3 { margin-bottom: 4px; }
.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(--muted); }
.kc-item.open .kc-answer { display: block; }
.kc-answer strong { color: var(--text); }
.kc-answer ul { padding-left: 18px; margin-top: 8px; }
.kc-answer li { margin-bottom: 5px; }
