:root {
  --bg: #09090b;
  --surface: #111115;
  --surface-2: #18181e;
  --surface-3: #22222b;
  --border: #272730;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --brand: #f97316;
  --brand-hover: #ea580c;
  --emerald: #10b981;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --rose: #f43f5e;
  --amber: #f59e0b;
  --radius: 12px;
  --editor-font-size: 13.5px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; line-height: 1.5; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.full-w { width: 100%; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.65rem 1.2rem; background: rgba(9, 9, 11, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; }
.brand-logo { width: 35px; height: 35px; border-radius: 9px; background: linear-gradient(135deg, #ef4444, var(--brand)); display: grid; place-items: center; font-weight: 800; font-size: 0.88rem; color: #fff; }
.brand-title { font-weight: 800; font-size: 1.02rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.35rem; }
.brand-title span { color: var(--brand); }
.oss-tag { font-size: 0.62rem; font-weight: 800; background: rgba(16, 185, 129, 0.16); color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.35); padding: 0.06rem 0.38rem; border-radius: 5px; }
.brand-sub { font-size: 0.68rem; color: var(--muted); }

.nav-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav-btn { background: transparent; color: var(--muted); border: 1px solid transparent; padding: 0.4rem 0.72rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.32rem; transition: all 0.15s; }
.nav-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-btn.active { color: #fff; background: var(--surface-2); border-color: rgba(249, 115, 22, 0.5); }
.nav-contrib { border: 1px dashed rgba(16, 185, 129, 0.45); color: #6ee7b7; }
.nav-contrib.active { border-style: solid; border-color: var(--emerald); background: rgba(16, 185, 129, 0.12); color: #fff; }

.pill { background: rgba(249, 115, 22, 0.16); color: #fb923c; font-size: 0.66rem; padding: 0.05rem 0.38rem; border-radius: 999px; }
.pill-amber { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.pill-emerald { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.pill-sky { background: rgba(56, 189, 248, 0.16); color: #38bdf8; }
.pill-violet { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; }

.status-badge { display: inline-flex; align-items: center; gap: 0.42rem; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 0.36rem 0.7rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.dot.live { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.dot.static { background: var(--sky); }

/* Main Container */
.main-content { max-width: 100%; width: 100%; margin: 0 auto; padding: 1.25rem; }
.main-content.workspace-full { max-width: 100%; padding: 0; }
.view { display: none; }
.view.active { display: block; }

/* Hero & Analytics */
.hero-banner { background: linear-gradient(135deg, #16161f 0%, #1f1410 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.8rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.hero-tag { display: inline-block; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 0.35rem; }
.hero-banner h1 { font-size: 1.5rem; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.hero-banner p { color: var(--muted); max-width: 720px; font-size: 0.88rem; }
.hero-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.portal-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }

/* RiseAhead Progress Ring + Heatmap */
.analytics-grid { display: grid; grid-template-columns: 360px 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: 1fr; } }
.ring-card { display: flex; align-items: center; gap: 1.1rem; }
.ring-wrap { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.progress-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.ring-sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.ring-breakdown { flex: 1; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.82rem; }
.rb-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }

.heatmap-card { display: flex; flex-direction: column; justify-content: space-between; overflow-x: auto; }
.heatmap-grid { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; gap: 3px; padding: 0.35rem 0; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-3); display: inline-block; }
.hm-0 { background: #1c1c24; }
.hm-1 { background: #14532d; }
.hm-2 { background: #15803d; }
.hm-3 { background: #22c55e; }
.hm-4 { background: #4ade80; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 0.4rem; }

/* RiseAhead-Style Roadmap Accordions */
.view-toggle { display: flex; gap: 0.4rem; }
.roadmap-list { display: flex; flex-direction: column; gap: 0.75rem; }
.roadmap-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.roadmap-head { width: 100%; background: var(--surface); border: none; color: var(--text); padding: 0.95rem 1.15rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; }
.roadmap-head:hover { background: var(--surface-2); }
.rm-title-col { display: flex; flex-direction: column; gap: 0.15rem; }
.rm-title { font-weight: 700; font-size: 0.96rem; }
.rm-sub { font-size: 0.76rem; color: var(--muted); }
.rm-prog-col { display: flex; align-items: center; gap: 0.85rem; min-width: 220px; }
.rm-bar-bg { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rm-bar-fg { height: 100%; background: linear-gradient(90deg, var(--brand), var(--emerald)); transition: width 0.3s ease; }
.rm-count { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 60px; text-align: right; }
.roadmap-body { border-top: 1px solid var(--border); background: #0d0d11; }

/* Full-Viewport RiseAhead Workspace */
.workspace-view { height: calc(100vh - 58px); display: none; flex-direction: column; }
.workspace-view.active { display: flex; }
.ws-topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ws-left-nav, .ws-center-actions, .ws-right-nav { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.ws-title-text { font-size: 0.92rem; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-split { flex: 1; display: flex; overflow: hidden; }
.ws-pane { display: flex; flex-direction: column; overflow: hidden; min-width: 300px; }
.ws-left { width: 48%; background: var(--surface); }
.ws-right { flex: 1; background: #0c0c10; }
.ws-resizer { width: 6px; background: var(--border); cursor: col-resize; transition: background 0.15s; flex-shrink: 0; }
.ws-resizer:hover, .ws-resizer.dragging { background: var(--brand); }
.ws-left-body { flex: 1; overflow-y: auto; padding: 1.45rem 1.65rem 2.4rem; }
@media (max-width: 900px) { .ws-split { flex-direction: column; overflow-y: auto; } .ws-left { width: 100% !important; min-height: 360px; } .ws-resizer { display: none; } }

.oss-footer-bar { margin-top: 1.25rem; padding-top: 0.85rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.notes-area { width: 100%; height: 220px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.75rem; font-size: 0.86rem; resize: vertical; }
.notes-area:focus { outline: none; border-color: var(--brand); }

/* CodeMirror 5 Dark Theme Integration */
.CodeMirror { flex: 1; height: 100% !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--editor-font-size); line-height: 1.6; background: #0b0b0f !important; }
.CodeMirror-gutters { background: #0f0f15 !important; border-right: 1px solid #1e1e26 !important; }

/* Buttons & Cards */
.btn-primary { background: var(--brand); color: #fff; border: none; padding: 0.52rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.84rem; cursor: pointer; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-submit { background: var(--emerald); color: #052e16; border: none; padding: 0.52rem 1rem; border-radius: 8px; font-weight: 700; font-size: 0.84rem; cursor: pointer; }
.btn-submit:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 0.52rem 0.95rem; border-radius: 8px; font-weight: 600; font-size: 0.84rem; cursor: pointer; }
.btn-secondary:hover { background: var(--surface-3); }
.btn-review { background: rgba(167, 139, 250, 0.14); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.4); padding: 0.52rem 0.95rem; border-radius: 8px; font-weight: 600; font-size: 0.84rem; cursor: pointer; }
.btn-review.active { background: var(--violet); color: #09090b; }
.btn-sm { padding: 0.34rem 0.68rem; font-size: 0.77rem; }
.btn-ghost { background: transparent; color: var(--brand); border: none; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.75rem; gap: 1rem; flex-wrap: wrap; }
.section-header h2 { font-size: 1.1rem; font-weight: 700; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.95rem; }
.book-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; transition: border-color 0.15s, transform 0.15s; cursor: pointer; }
.book-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.book-card-top { display: flex; justify-content: space-between; align-items: center; }
.book-kind { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.16rem 0.48rem; border-radius: 6px; background: var(--surface-3); color: var(--brand); }
.book-title { font-weight: 700; font-size: 1rem; }
.book-source { font-size: 0.76rem; color: var(--muted); }
.diff-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; font-size: 0.72rem; }

/* Sidebars, Filters, Tables */
.portal-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 960px) { .portal-layout { grid-template-columns: 1fr; } }
.chapter-sidebar { position: sticky; top: 72px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; padding: 0.9rem; }
.sidebar-title { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.86rem; padding-bottom: 0.6rem; margin-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.chapter-list { overflow-y: auto; display: flex; flex-direction: column; gap: 0.22rem; }
.chapter-item { width: 100%; text-align: left; background: transparent; color: var(--muted); border: 1px solid transparent; padding: 0.45rem 0.62rem; border-radius: 8px; font-size: 0.79rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.chapter-item:hover { background: var(--surface-2); color: var(--text); }
.chapter-item.active { background: rgba(249, 115, 22, 0.14); border-color: rgba(249, 115, 22, 0.4); color: #fff; font-weight: 600; }
.chapter-count { font-size: 0.7rem; background: var(--surface-3); color: var(--muted); padding: 0.06rem 0.4rem; border-radius: 999px; flex-shrink: 0; }
.chapter-item.active .chapter-count { background: var(--brand); color: #fff; }

.domain-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.domain-tab { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); padding: 0.4rem 0.8rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.domain-tab.active { background: rgba(249, 115, 22, 0.18); border-color: var(--brand); color: #fdba74; }
.core-cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0.85rem; }
.core-cs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem; display: flex; flex-direction: column; gap: 0.5rem; cursor: pointer; }
.core-cs-card:hover { border-color: var(--amber); }

.filter-bar { display: flex; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.input-field, .select-field { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.78rem; font-size: 0.84rem; }
.input-field { flex: 1; min-width: 200px; }
.select-field { min-width: 145px; }
.table-meta-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; flex-wrap: wrap; gap: 0.6rem; }
.pagination { display: flex; gap: 0.28rem; align-items: center; }
.page-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 0.3rem 0.64rem; border-radius: 6px; font-size: 0.77rem; cursor: pointer; }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.table-wrap { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.data-table th { text-align: left; padding: 0.68rem 0.85rem; color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table td { padding: 0.66rem 0.85rem; border-bottom: 1px solid rgba(39, 39, 48, 0.65); vertical-align: middle; }
.data-table tr:hover td { background: rgba(249, 115, 22, 0.04); }
.problem-link { color: var(--text); font-weight: 600; cursor: pointer; background: none; border: none; text-align: left; font-size: 0.86rem; padding: 0; }
.problem-link:hover { color: var(--brand); }
.topic-sub { font-size: 0.73rem; color: var(--muted); margin-top: 0.12rem; }

.badge-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; background: var(--surface-3); color: #d4d4d8; padding: 0.14rem 0.44rem; border-radius: 6px; }
.diff-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.13rem 0.5rem; border-radius: 999px; }
.diff-Easy { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.diff-Medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.diff-Hard { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.lang-badge { font-size: 0.66rem; font-weight: 700; padding: 0.14rem 0.46rem; border-radius: 6px; background: rgba(56, 189, 248, 0.15); color: var(--sky); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: inline-grid; place-items: center; font-size: 0.8rem; }
.icon-btn.solved { background: rgba(16, 185, 129, 0.18); border-color: var(--emerald); color: var(--emerald); }
.icon-btn.bookmarked { background: rgba(249, 115, 22, 0.18); border-color: var(--brand); color: var(--brand); }

/* MCQs & Exam Quiz */
.mcq-list { display: flex; flex-direction: column; gap: 0.85rem; }
.mcq-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.mcq-header { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.65rem; }
.mcq-context { background: var(--surface-2); border-left: 3px solid var(--sky); padding: 0.68rem 0.9rem; border-radius: 6px; font-size: 0.85rem; color: #e4e4e7; margin-bottom: 0.75rem; }
.mcq-question { font-size: 0.94rem; font-weight: 600; margin-bottom: 0.8rem; line-height: 1.65; }
.mcq-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.5rem; }
.opt-btn { text-align: left; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 0.82rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem; display: flex; gap: 0.55rem; align-items: flex-start; }
.opt-btn:hover { border-color: var(--brand); }
.opt-btn.selected { border-color: var(--brand); background: rgba(249, 115, 22, 0.14); }
.opt-btn.correct { border-color: var(--emerald); background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.opt-btn.wrong { border-color: var(--rose); background: rgba(244, 63, 94, 0.14); color: #fda4af; }
.opt-key { font-weight: 800; color: var(--brand); min-width: 20px; }
.mcq-explanation { margin-top: 0.8rem; padding: 0.78rem 0.92rem; border-radius: 8px; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); font-size: 0.84rem; line-height: 1.6; }

.quiz-setup { max-width: 860px; margin: 0 auto; }
.quiz-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1rem; }
.field-label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--muted); margin-bottom: 0.35rem; }
.quiz-topbar { display: flex; justify-content: space-between; align-items: center; gap: 0.85rem; flex-wrap: wrap; margin-bottom: 1rem; }
.quiz-counters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.q-stat { font-size: 0.75rem; font-weight: 700; padding: 0.22rem 0.58rem; border-radius: 999px; }
.stat-ans { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.stat-rev { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.stat-un { background: var(--surface-3); color: var(--muted); }
.quiz-timer { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.exam-layout { display: grid; grid-template-columns: 1fr 270px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .exam-layout { grid-template-columns: 1fr; } }
.quiz-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.38rem; margin-bottom: 0.8rem; }
.pal-btn { height: 35px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.pal-btn.answered { background: rgba(16, 185, 129, 0.22); border-color: var(--emerald); color: #6ee7b7; }
.pal-btn.review { background: rgba(167, 139, 250, 0.26); border-color: var(--violet); color: #ddd6fe; }
.pal-btn.current { box-shadow: 0 0 0 2px var(--brand); color: #fff; }
.palette-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 0.38rem; font-size: 0.73rem; color: var(--muted); }
.leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.28rem; vertical-align: middle; }
.leg-ans { background: var(--emerald); } .leg-rev { background: var(--violet); } .leg-cur { background: var(--brand); } .leg-un { background: var(--surface-3); border: 1px solid var(--border); }
.quiz-nav-footer { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }

/* Editor, Compiler Panel & Modals */
.meta-chips { display: flex; gap: 0.38rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.meta-chip { font-size: 0.71rem; background: var(--surface-3); color: #d4d4d8; padding: 0.18rem 0.52rem; border-radius: 6px; }
.doc-block { margin-bottom: 1rem; }
.doc-block h4 { font-size: 0.77rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.example-box { background: #0c0c10; border: 1px solid var(--border); border-radius: 8px; padding: 0.68rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; white-space: pre-wrap; color: #e4e4e7; }
.complexity-row { display: flex; gap: 0.5rem; margin-top: 0.55rem; flex-wrap: wrap; }
.comp-pill { background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.25); color: #fdba74; padding: 0.22rem 0.58rem; border-radius: 6px; font-size: 0.75rem; }

.editor-tabs { display: flex; align-items: center; gap: 0.28rem; padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.tab-btn { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 0.3rem 0.68rem; border-radius: 6px; font-size: 0.77rem; font-weight: 600; cursor: pointer; }
.tab-btn.active { background: var(--surface-3); color: #fff; border-color: var(--border); }
.editor-tools { margin-left: auto; display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.tool-icon { background: var(--surface-3); border: 1px solid var(--border); color: #d4d4d8; padding: 0.24rem 0.52rem; border-radius: 6px; font-size: 0.73rem; font-weight: 600; cursor: pointer; }
.tool-icon:hover { border-color: var(--brand); color: #fff; }
.shortcut-hint { font-size: 0.7rem; color: #71717a; font-family: ui-monospace, monospace; background: var(--surface-3); padding: 0.18rem 0.42rem; border-radius: 5px; }

.editor-wrap { flex: 1; display: flex; overflow: hidden; position: relative; background: #0b0b0f; min-height: 220px; }
.line-gutter { width: 44px; padding: 0.85rem 0.5rem 0.85rem 0.2rem; text-align: right; background: #0f0f15; border-right: 1px solid #1e1e26; color: #52525b; font-family: ui-monospace, monospace; font-size: var(--editor-font-size); line-height: 1.6; user-select: none; overflow: hidden; white-space: pre; }
.code-textarea, .code-viewer { flex: 1; width: 100%; background: #0b0b0f; color: #f4f4f5; border: none; padding: 0.85rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--editor-font-size); line-height: 1.6; resize: none; outline: none; overflow: auto; tab-size: 4; white-space: pre; }
.code-viewer { color: #bbf7d0; }

.compiler-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0.8rem; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.console-tab-group { display: flex; gap: 0.25rem; }
.c-tab { background: transparent; border: none; color: var(--muted); padding: 0.32rem 0.68rem; border-radius: 6px; font-size: 0.77rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.c-tab:hover { color: #fff; }
.c-tab.active { background: var(--surface-3); color: #fff; }
.result-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.result-dot.pass { background: var(--emerald); } .result-dot.fail { background: var(--rose); }

.compiler-panel { height: 245px; background: #08080b; overflow-y: auto; transition: height 0.15s ease; }
.compiler-panel.expanded { height: 390px; }
.panel-body { padding: 0.8rem 0.95rem; }
.testcase-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; gap: 0.5rem; flex-wrap: wrap; }
.testcase-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.6rem; }
.tc-field label { display: block; font-family: ui-monospace, monospace; font-size: 0.75rem; color: #fb923c; margin-bottom: 0.22rem; font-weight: 700; }
.tc-field input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: #f4f4f5; padding: 0.42rem 0.68rem; border-radius: 7px; font-family: ui-monospace, monospace; font-size: 0.81rem; }
.tc-field input:focus { outline: none; border-color: var(--brand); }
.empty-result { color: var(--muted); font-size: 0.84rem; padding: 1.15rem 0; text-align: center; }
.verdict-row { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.verdict-title { font-size: 1.02rem; font-weight: 800; }
.verdict-title.pass { color: #34d399; } .verdict-title.fail { color: #fb7185; } .verdict-title.warn { color: #fbbf24; }
.verdict-pills { display: flex; gap: 0.38rem; }
.v-pill { font-size: 0.73rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: #d4d4d8; padding: 0.16rem 0.52rem; border-radius: 999px; }
.verdict-hint { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fde68a; padding: 0.5rem 0.72rem; border-radius: 8px; font-size: 0.79rem; margin-bottom: 0.6rem; }
.io-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 640px) { .io-cards { grid-template-columns: 1fr; } }
.io-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.58rem 0.72rem; }
.io-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 0.22rem; }
.io-val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.83rem; color: #f4f4f5; white-space: pre-wrap; word-break: break-word; }
.err-box { background: rgba(244, 63, 94, 0.08); border: 1px solid rgba(244, 63, 94, 0.3); border-radius: 8px; padding: 0.62rem 0.78rem; margin-top: 0.52rem; }
.console-raw { font-family: ui-monospace, monospace; font-size: 0.79rem; white-space: pre-wrap; color: #d4d4d8; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.8); display: grid; place-items: center; padding: 0.75rem; }
.modal-sheet { width: min(1240px, 100%); height: min(85vh, 800px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.modal-small { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.modal-header { padding: 0.8rem 1.15rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; background: var(--surface-2); }
.modal-header-actions { display: flex; align-items: center; gap: 0.45rem; }
.icon-close { background: transparent; border: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.split-pane { flex: 1; display: grid; grid-template-columns: 0.9fr 1.1fr; overflow: hidden; }
.pane-left { padding: 1.1rem; overflow-y: auto; border-right: 1px solid var(--border); }
.pane-right { display: flex; flex-direction: column; background: #0c0c10; overflow: hidden; }

.toast { position: fixed; bottom: 20px; right: 20px; z-index: 200; background: var(--surface-2); border: 1px solid var(--brand); color: #fff; padding: 0.58rem 1rem; border-radius: 10px; font-size: 0.83rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }

/* Clean Textbook Math Typography */
.math-op { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 0.22em; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; }
.math-op .op-sup, .math-op .op-sub { font-size: 0.66em; color: #fdba74; line-height: 1.05; }
.math-op .op-sym { font-size: 1.38em; line-height: 1; color: #f4f4f5; }
.math-sup { font-size: 0.74em; vertical-align: super; line-height: 0; color: #fde68a; }
.math-sub { font-size: 0.74em; vertical-align: sub; line-height: 0; color: #93c5fd; }
.math-sym { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; color: #f4f4f5; }

/* Sleek Dark Custom Scrollbars (fixes bright white Windows default scrollbar) */
* {
  scrollbar-width: thin;
  scrollbar-color: #353542 transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #353542;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #525264;
}

.chapter-sidebar {
  padding: 0.9rem 0.7rem 0.9rem 0.9rem;
}
.chapter-list {
  padding-right: 0.35rem;
}
.sidebar-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 0.42rem 0.65rem;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}
.sidebar-search:focus {
  outline: none;
  border-color: var(--brand);
}

/* 3-Level Tabs (Level 1: Basic, Level 2: Medium, Level 3: Advanced) */
.level-bar {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.lvl-tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.14s;
}
.lvl-tab:hover { color: #fff; border-color: #3f3f4a; }
.lvl-tab.active[data-level="All"] { background: rgba(249, 115, 22, 0.16); border-color: var(--brand); color: #fdba74; }
.lvl-tab.active[data-level="Easy"] { background: rgba(16, 185, 129, 0.16); border-color: var(--emerald); color: #6ee7b7; }
.lvl-tab.active[data-level="Medium"] { background: rgba(245, 158, 11, 0.16); border-color: var(--amber); color: #fcd34d; }
.lvl-tab.active[data-level="Hard"] { background: rgba(244, 63, 94, 0.16); border-color: var(--rose); color: #fda4af; }

/* ==================== 3-COLUMN PRACTICE SET & QUIZ STUDIO (REFERENCE UI) ==================== */
.ps-shell {
  display: grid;
  grid-template-columns: 248px 1fr 292px;
  gap: 1.15rem;
  min-height: calc(100vh - 64px);
  padding: 1rem 1.25rem;
  background: #090a0d;
  align-items: start;
}
@media (max-width: 1100px) {
  .ps-shell { grid-template-columns: 220px 1fr; }
  .ps-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}
@media (max-width: 780px) {
  .ps-shell { grid-template-columns: 1fr; }
  .ps-right { grid-template-columns: 1fr; }
}

.ps-left {
  background: #101116;
  border: 1px solid #1e2028;
  border-radius: 14px;
  padding: 0.9rem;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
}
.ps-back-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: transparent; border: none; color: #a1a1aa;
  font-size: 0.84rem; font-weight: 600; cursor: pointer;
  padding: 0.35rem 0.25rem; margin-bottom: 0.65rem; text-align: left;
}
.ps-back-btn:hover { color: #fff; }
.ps-ch-label {
  font-size: 0.82rem; color: #d4d4d8; font-weight: 700;
  padding: 0.45rem 0.25rem 0.75rem; border-bottom: 1px solid #1e2028; margin-bottom: 0.65rem;
}

.ps-acc-btn {
  width: 100%; background: transparent; border: none; color: #e4e4e7;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.52rem 0.35rem; font-size: 0.84rem; font-weight: 700; cursor: pointer;
}
.ps-acc-btn:hover { color: #fff; }

.ps-tree {
  margin-left: 0.65rem;
  padding-left: 0.75rem;
  border-left: 1px solid #262936;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 0.65rem;
  padding-right: 0.25rem;
}
.ps-set-item {
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  color: #a1a1aa; padding: 0.48rem 0.7rem; border-radius: 9px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
  transition: all 0.14s;
}
.ps-set-item:hover { background: #171923; color: #f4f4f5; }
.ps-set-item.active {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.45);
  color: #fff;
}
.ps-set-done { color: #22c55e; font-size: 0.78rem; font-weight: 800; }

.ps-left-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid #1e2028;
}
.ps-prog-text { font-size: 0.76rem; color: #a1a1aa; margin-bottom: 0.35rem; display: flex; justify-content: space-between; }
.ps-prog-track { height: 5px; background: #1e2028; border-radius: 999px; overflow: hidden; }
.ps-prog-fill { height: 100%; background: #f97316; transition: width 0.3s ease; }

/* Center Stage */
.ps-center {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
}
.ps-header-card {
  background: #111218;
  border: 1px solid #1e2028;
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
}
.ps-header-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.ps-header-top h2 { font-size: 1.18rem; font-weight: 700; color: #f4f4f5; }
.ps-subdate { font-size: 0.8rem; color: #8c90a0; margin-top: 0.2rem; }
.btn-blue {
  background: #ea580c; color: #fff; border: none;
  padding: 0.55rem 1.15rem; border-radius: 9px;
  font-weight: 700; font-size: 0.84rem; cursor: pointer;
}
.btn-blue:hover { background: #c2410c; }
.btn-blue-outline {
  background: transparent; color: #fb923c; border: 1px solid #ea580c;
  padding: 0.48rem 1rem; border-radius: 9px;
  font-weight: 600; font-size: 0.83rem; cursor: pointer;
}
.btn-blue-outline:hover { background: rgba(234, 88, 12, 0.14); }
.btn-blue-outline:disabled { opacity: 0.35; cursor: not-allowed; }

.ps-stats-strip {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 0.75rem;
  background: #0c0d12;
  border: 1px solid #1c1e26;
  border-radius: 11px;
  padding: 0.85rem 1.1rem;
}
@media (max-width: 640px) { .ps-stats-strip { grid-template-columns: 1fr 1fr; } }
.ps-stat-val { font-size: 1.05rem; font-weight: 800; color: #f4f4f5; }
.ps-stat-val.amber { color: #f59e0b; }
.ps-stat-lbl { font-size: 0.75rem; color: #8c90a0; margin-top: 0.12rem; }

.ps-q-card {
  background: #111218;
  border: 1px solid #1e2028;
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
}
.ps-q-num {
  font-size: 0.84rem; color: #8c90a0; font-weight: 600;
  padding-bottom: 0.85rem; margin-bottom: 1rem;
  border-bottom: 1px solid #1c1e26;
  display: flex; justify-content: space-between; align-items: center;
}
.ps-q-stem {
  font-size: 1.05rem; font-weight: 600; color: #f4f4f5;
  margin-bottom: 1.25rem; line-height: 1.65;
}
.ps-options-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ps-opt-row {
  width: 100%; text-align: left;
  background: #15161e; border: 1px solid #242632; color: #e4e4e7;
  padding: 0.92rem 1.1rem; border-radius: 10px;
  font-size: 0.93rem; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 0.85rem;
  transition: all 0.14s;
}
.ps-opt-row:hover:not(:disabled) { border-color: #f97316; background: #191c28; }
.ps-opt-left { display: flex; align-items: center; gap: 0.75rem; }
.ps-opt-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3f4254; flex-shrink: 0;
}
.ps-opt-row.selected { border-color: #f97316; background: rgba(249, 115, 22, 0.12); color: #fff; }
.ps-opt-row.selected .ps-opt-dot { background: #f97316; box-shadow: 0 0 8px #f97316; }
.ps-opt-row.correct { border-color: #16a34a; background: rgba(22, 163, 74, 0.18); color: #dcfce7; }
.ps-opt-row.correct .ps-opt-dot { background: #22c55e; }
.ps-opt-row.wrong { border-color: #dc2626; background: rgba(220, 38, 38, 0.16); color: #fecaca; }
.ps-opt-row.wrong .ps-opt-dot { background: #ef4444; }
.ps-opt-mark { font-weight: 800; font-size: 1rem; }

.ps-q-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #1c1e26;
}

/* Right Sidebar: Timer + Beveled Question Palette */
.ps-right {
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 70px;
}
.ps-side-card {
  background: #111218;
  border: 1px solid #1e2028;
  border-radius: 14px;
  padding: 1.15rem;
}
.ps-side-title {
  text-align: center; font-size: 0.88rem; font-weight: 700;
  color: #d4d4d8; margin-bottom: 0.9rem;
}
.ps-timer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-bottom: 0.9rem;
}
.ps-time-box {
  background: #171821; border: 1px solid #232531; border-radius: 10px;
  padding: 0.7rem 0.35rem; text-align: center;
}
.ps-time-num { font-size: 1.05rem; font-weight: 800; color: #f4f4f5; font-family: ui-monospace, monospace; }
.ps-time-unit { font-size: 0.7rem; color: #8c90a0; margin-top: 0.15rem; }

.ps-timer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.ps-subtle-btn {
  background: #171821; border: 1px solid #232531; color: #a1a1aa;
  padding: 0.52rem 0.6rem; border-radius: 9px; font-size: 0.77rem; font-weight: 600; cursor: pointer;
}
.ps-subtle-btn:hover { color: #fff; border-color: #f97316; }

/* Signature Beveled Corner Palette Tiles */
.ps-bevel-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.55rem; margin-bottom: 0.95rem;
}
.ps-tile {
  height: 40px;
  background: #171821;
  color: #d4d4d8;
  border: 1px solid #2b2e3c;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  border-radius: 4px;
  transition: all 0.14s;
}
.ps-tile:hover { border-color: #f97316; color: #fff; }
.ps-tile.answered { background: rgba(249, 115, 22, 0.22); border-color: #f97316; color: #93c5fd; }
.ps-tile.correct { background: rgba(22, 163, 74, 0.2); border-color: #22c55e; color: #86efac; }
.ps-tile.wrong { background: rgba(220, 38, 38, 0.2); border-color: #ef4444; color: #fca5a5; }
.ps-tile.current { box-shadow: inset 0 0 0 2px #f97316; color: #fff; }

.ps-legend {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.35rem; flex-wrap: wrap; font-size: 0.72rem; color: #8c90a0;
}
.ps-legend span { display: inline-flex; align-items: center; gap: 0.28rem; }
.ps-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ps-dot.c { background: #22c55e; }
.ps-dot.w { background: #ef4444; }
.ps-dot.cur { border: 1.5px solid #f97316; background: transparent; }
.ps-dot.u { background: #3f4254; }

/* Cropped Book Graph / Chart Figure Section + Click-to-Zoom Lightbox */
.q-figure-wrap {
  margin: 0.75rem 0 1rem;
  background: #ffffff;
  border: 2px solid #2b2e3c;
  border-radius: 10px;
  padding: 0.65rem;
  text-align: center;
  position: relative;
}
.q-figure-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
  margin: 0 auto;
}
.q-figure-cap {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #52525b;
  font-weight: 600;
}
.img-lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.9);
  display: grid; place-items: center; padding: 1.5rem; cursor: zoom-out;
}
.img-lightbox img {
  max-width: 94vw; max-height: 92vh;
  background: #fff; padding: 0.75rem; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

/* ==================== MULTI-USER LOGIN / REGISTER PAGE ==================== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: radial-gradient(circle at top right, #1b1528 0%, #09090b 60%);
  display: grid; place-items: center; padding: 1.25rem;
}
.auth-card {
  width: min(440px, 100%);
  background: #111218;
  border: 1px solid #262836;
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}
.auth-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.15rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; background: #181922; padding: 0.3rem; border-radius: 10px; margin-bottom: 1.15rem; }
.auth-tab {
  background: transparent; border: none; color: #a1a1aa;
  padding: 0.5rem; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.auth-tab.active { background: #ea580c; color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-err {
  background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af; padding: 0.55rem 0.75rem; border-radius: 8px; font-size: 0.82rem;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0.32rem 0.65rem; border-radius: 999px; font-size: 0.77rem; font-weight: 600;
}
.ccs-quiz-scorebar {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  background: #151620; border: 1px solid #262938; border-radius: 10px;
  padding: 0.7rem 1rem; margin-bottom: 0.9rem; font-size: 0.86rem;
}

/* Full-Page Core CS Tutorial Reader */
.ccs-reader-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) { .ccs-reader-layout { grid-template-columns: 1fr; } }
.ccs-article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
}
.tut-section {
  margin-bottom: 1.45rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(39, 39, 48, 0.7);
}
.tut-section:last-child { border-bottom: none; margin-bottom: 0; }
.tut-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.tut-text { font-size: 0.95rem; line-height: 1.78; color: #e4e4e7; }
.tut-steps { padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; color: #e4e4e7; font-size: 0.94rem; line-height: 1.65; }
.qa-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}
.qa-q { font-weight: 700; color: #fbbf24; font-size: 0.9rem; margin-bottom: 0.3rem; }
.qa-a { color: #d4d4d8; font-size: 0.88rem; line-height: 1.6; }


/* ==================== INTERACTIVE SQL PLAYGROUND ==================== */
.sql-problem-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.9rem;
}
.sql-problem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}
.sql-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.sql-problem-text {
  margin: 0 0 0.65rem 0;
  line-height: 1.55;
  color: var(--text);
  font-size: 0.92rem;
}
.sql-problem-text code {
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.84rem;
}
.sql-schema-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
}
.sql-schema-label {
  color: var(--muted);
  font-weight: 700;
}
.sql-schema-strip code {
  color: #93c5fd;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.sql-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.sql-toolbar kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08rem 0.35rem;
  font-size: 0.74rem;
  font-family: var(--mono);
}
.sql-editor-textarea {
  width: 100%;
  min-height: 200px;
  background: #0b0d12;
  color: #e5e7eb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.sql-editor-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.18);
}
.sql-result-box {
  margin-top: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 18, 25, 0.9);
  overflow: hidden;
}
.sql-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.sql-status-ok { color: #34d399; font-weight: 700; font-size: 0.88rem; }
.sql-status-warn { color: #fbbf24; font-weight: 700; font-size: 0.88rem; }
.sql-status-err { color: #f87171; font-weight: 700; font-size: 0.88rem; }
.sql-table-wrap {
  overflow-x: auto;
  max-height: 340px;
}
.sql-result-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.sql-result-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fdba74;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sql-result-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  white-space: nowrap;
}
.sql-result-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.sql-error-pre {
  margin: 0;
  padding: 0.85rem 1rem;
  color: #fca5a5;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
}


/* ==================== VERBAL PILL & CHAPTER THEORY PANEL ==================== */
.pill-rose { background: rgba(244, 63, 94, 0.16); color: #fda4af; }
.ps-theory-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  line-height: 1.65;
}
.ps-theory-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
}
.ps-theory-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(249, 115, 22, 0.14);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}
.ps-theory-title {
  margin: 0 0 0.4rem 0;
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text);
}
.ps-theory-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}
.ps-theory-section {
  margin-bottom: 1.35rem;
}
.ps-theory-section h3 {
  margin: 0 0 0.45rem 0;
  font-size: 1.04rem;
  color: #fdba74;
}
.ps-theory-section p {
  margin: 0 0 0.55rem 0;
  font-size: 0.92rem;
  color: var(--text);
}
.ps-theory-bullets {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}
.ps-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.ps-formula-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid #38bdf8;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.ps-formula-lbl {
  font-size: 0.76rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.25rem;
}
.ps-formula-val {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: #f8fafc;
  font-weight: 600;
}
.ps-formula-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.ps-example-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}
.ps-example-q {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-size: 0.91rem;
}
.ps-example-sol {
  color: #cbd5e1;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.ps-example-ans {
  font-size: 0.84rem;
  font-weight: 700;
  color: #34d399;
}
.ps-tips-box {
  background: rgba(249, 115, 22, 0.07);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.05rem;
}


/* ==================== SCOREBOARD & LEADERBOARD ==================== */
.lb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}
.lb-kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}
.lb-kpi-lbl { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-bottom: 0.25rem; }
.lb-kpi-val { font-size: 1.45rem; font-weight: 800; color: var(--text); }
.lb-kpi-sub { font-size: 0.76rem; color: #34d399; margin-top: 0.2rem; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.lb-table th {
  text-align: left; padding: 0.65rem 0.85rem; color: var(--muted);
  border-bottom: 1px solid var(--border); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.lb-table td { padding: 0.72rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.lb-row-me { background: rgba(249, 115, 22, 0.1); }
.verified-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.7rem; font-weight: 700; color: #34d399;
  background: rgba(16, 185, 129, 0.14); padding: 0.12rem 0.45rem; border-radius: 999px; margin-left: 0.35rem;
}


/* ==================== COMPANIES & PROJECTS INTERACTIVE FLUID UI ==================== */
.cp-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.cp-chips-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.45rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.9rem;
  scrollbar-width: thin;
}
.cp-chip {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cp-chip:hover { color: #fff; border-color: rgba(249, 115, 22, 0.45); }
.cp-chip.active {
  background: rgba(249, 115, 22, 0.16);
  border-color: #f97316;
  color: #fdba74;
}
.layout-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.layout-toggle button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.42rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.layout-toggle button.active {
  background: #f97316;
  color: #fff;
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  width: 100%;
}
.cp-grid.list-mode {
  grid-template-columns: 1fr;
}
.cp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.16s, transform 0.16s;
}
.cp-card:hover {
  border-color: rgba(249, 115, 22, 0.55);
  transform: translateY(-2px);
}
.cp-grid.list-mode .cp-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.cp-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}
.cp-tier {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.14);
  color: #fdba74;
  white-space: nowrap;
}
.cp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cp-tag {
  font-size: 0.72rem;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.cp-detail-drawer {
  background: var(--card);
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.15rem;
}
.cp-prob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}
.cp-prob-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.62rem 0.85rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.cp-prob-btn:hover {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.1);
}


/* ==================== SLEEK SINGLE-ROW HORIZONTAL NAVBAR ==================== */
.topbar {
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 1.25rem !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
}
.brand { flex-shrink: 0; gap: 0.5rem !important; }
.brand-title { font-size: 1.05rem !important; white-space: nowrap; }
.nav-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.2rem !important;
  overflow: visible !important;
}
.nav-btn {
  padding: 0.38rem 0.72rem !important;
  font-size: 0.84rem !important;
  white-space: nowrap !important;
  border-radius: 7px !important;
}
.topbar-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.45rem !important;
  flex-shrink: 0 !important;
}
.status-badge {
  padding: 0.28rem 0.6rem !important;
  font-size: 0.75rem !important;
  white-space: nowrap !important;
}
.user-chip {
  padding: 0.25rem 0.6rem !important;
  font-size: 0.78rem !important;
  white-space: nowrap !important;
}
.nav-dropdown { position: relative; }
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #14161f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-drop-menu.hidden { display: none !important; }
.nav-drop-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: #e4e4e7;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
}
.nav-drop-item:hover {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.4);
  color: #fff;
}
@media (max-width: 1024px) {
  .topbar { height: auto !important; flex-wrap: wrap !important; padding: 0.5rem 0.9rem !important; }
  .nav-tabs { overflow-x: auto !important; }
}


/* ==================== DEVELOPER & SUPPORT QR SECTION ==================== */
.dev-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1.15rem;
  align-items: start;
}
.dev-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.dev-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--brand);
  box-shadow: 0 0 22px rgba(249, 115, 22, 0.28);
  flex-shrink: 0;
}
.dev-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}
.dev-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}
.dev-info-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.dev-info-box h4 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  color: #fb923c;
}
.dev-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.dev-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.dev-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.32);
  color: #fed7aa;
}
.dev-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}
.dev-links-row a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qr-support-card {
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(160deg, rgba(249, 115, 22, 0.08), rgba(15, 18, 28, 0.96));
}
.qr-support-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.qr-support-copy {
  flex: 1 1 320px;
}
.qr-frame {
  width: 220px;
  max-width: 100%;
  padding: 0.55rem;
  border-radius: 14px;
  background: #000;
  border: 1.5px solid rgba(249, 115, 22, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}
.qr-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
@media (max-width: 960px) {
  .dev-grid { grid-template-columns: 1fr; }
  .dev-subgrid { grid-template-columns: 1fr; }
}


/* Question Contributor Credit (Name + GitHub ID) */
.contrib-credit-box {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface-2, #141923);
  border: 1px solid var(--border, #252d3d);
}
.contrib-credit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.contrib-credit-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9aa7b8);
}
.contrib-credit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.contrib-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--text, #eef2f7);
  font-size: 0.8rem;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.contrib-badge:hover {
  border-color: #f97316;
  transform: translateY(-1px);
}
.contrib-badge .gh-handle {
  color: #fb923c;
  font-family: monospace;
  font-weight: 600;
}
.contrib-badge .imp-note {
  color: var(--muted, #9aa7b8);
  font-size: 0.74rem;
}
.contrib-improve-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border, #252d3d);
}
.contrib-improve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 640px) {
  .contrib-improve-grid { grid-template-columns: 1fr; }
}

/* Rich DSA Problem Description Typography (LeetCode-Style Spacing & Clarity) */
.dsa-desc-body {
  font-size: 0.94rem;
  line-height: 1.75;
  color: #e6ebf2;
}
.desc-para {
  margin: 0 0 1.05rem 0;
  line-height: 1.75;
  color: #e6ebf2;
}
.desc-subhead {
  margin: 1.5rem 0 0.65rem 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fb923c;
}
.desc-list {
  margin: 0 0 1.05rem 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #dbe3ee;
}
.desc-list li { padding-left: 0.2rem; }
.desc-inline-code {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  margin: 0 0.08rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: #f8fafc;
}
.dsa-examples-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.lc-example-card {
  background: #0d1118;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-left: 3px solid #f97316;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.lc-ex-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}
.lc-ex-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.lc-ex-label {
  font-weight: 700;
  color: #e2e8f0;
  min-width: 62px;
}
.lc-ex-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #f8fafc;
  word-break: break-word;
}
.lc-ex-exp {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin-top: 0.15rem;
}
