:root {
  /* White + blue theme (SV Technologies) */
  --bg: #ffffff;          /* page background */
  --bg-alt: #f3f6fb;      /* sidebar / header / panels */
  --bg-soft: #e9f0fb;     /* soft blue tint for hovers/cards */
  --border: #d7e0ee;      /* light blue-grey borders */
  --text: #0f2744;        /* deep navy body text */
  --text-dim: #5b6b84;    /* muted grey-blue */
  --accent: #1763d6;      /* primary blue */
  --accent-2: #1763d6;    /* links/active = same blue for consistency */
  --green: #16a34a;
  --code-bg: #0f2744;     /* code blocks: dark navy for contrast */
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}

.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark {
  background: linear-gradient(135deg, var(--accent), #ff6a00);
  color: #111;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.brand-text { font-weight: 600; }

.search-wrap { margin-left: auto; flex: 1; max-width: 460px; }
#search {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  outline: none;
}
#search:focus { border-color: var(--accent-2); }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: 290px;
  flex-shrink: 0;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 16px 10px 40px;
  overflow-y: auto;
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
}

.nav-group { margin-bottom: 14px; }
.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 12px;
  font-weight: 700;
}
.nav-link {
  display: block;
  padding: 7px 12px;
  margin: 1px 4px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: calc(100% - 8px);
  text-align: left;
}
.nav-link:hover { background: var(--bg-soft); }
.nav-link.active { background: var(--accent); color: #111; font-weight: 600; }

/* Content */
.content {
  flex: 1;
  padding: 28px 40px 80px;
  max-width: 960px;
  margin: 0 auto;
  outline: none;
}

.article h1 {
  font-size: 30px;
  margin: 0 0 6px;
  line-height: 1.2;
}
.article .subtitle { color: var(--text-dim); margin: 0 0 24px; font-size: 15px; }
.article h2 {
  font-size: 22px;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.article h3 { font-size: 17px; margin: 22px 0 8px; color: var(--accent); }
.article p { margin: 10px 0; }
.article ul, .article ol { margin: 10px 0; padding-left: 24px; }
.article li { margin: 5px 0; }

/* Q&A */
.qa { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); }
.qa summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "Q"; background: var(--accent-2); color: #061018; font-weight: 800; border-radius: 5px; padding: 0 7px; font-size: 13px; flex-shrink: 0; margin-top: 2px; }
.qa[open] summary { border-bottom: 1px solid var(--border); }
.qa .answer { padding: 14px 18px; color: var(--text); background: var(--bg); }
.qa .answer p:first-child { margin-top: 0; }

/* Steps / cards */
.callout {
  border-left: 4px solid var(--accent-2);
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
}
.callout.warn { border-left-color: var(--accent); }
.callout.tip { border-left-color: var(--green); }

/* Code */
code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  color: #ffd083;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0;
}
pre code { background: none; border: none; padding: 0; color: #d7e1ea; font-size: 13px; line-height: 1.55; }
.cmt { color: #6b7684; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
th, td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); }
tr:nth-child(even) td { background: var(--bg-alt); }

/* Search results */
.search-results { margin-bottom: 20px; }
.search-results h2 { margin-top: 0; }
.result-item { display: block; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; cursor: pointer; background: var(--bg-alt); }
.result-item:hover { border-color: var(--accent-2); }
.result-item .r-sec { color: var(--text-dim); font-size: 12px; }
.result-item mark { background: var(--accent); color: #111; border-radius: 3px; padding: 0 2px; }

/* Footer */
.footer { padding: 18px 40px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; background: var(--bg-alt); }

/* Mobile */
@media (max-width: 860px) {
  .brand-text { display: none; }
  .content { padding: 20px; }
}

/* ===== v2 additions ===== */
.brand { text-decoration: none; color: var(--text); }
.brand-dim { color: var(--accent); }
.footer a { color: var(--accent-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Mermaid diagrams */
.mermaid {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 18px 0;
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { max-width: 100%; height: auto; }

/* Diagram caption */
.diagram-cap {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: -8px 0 18px;
}

/* Comparison grid cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card h4 { margin: 0 0 8px; color: var(--accent-2); }
.card ul { margin: 0; padding-left: 18px; }

/* Pills / tags */
.pill {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 2px 4px 2px 0;
}

/* ===== v3: official source links ===== */
.srcs {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 18px 0;
}
.srcs h4 { margin: 0 0 8px; color: var(--accent-2); font-size: 0.9rem; letter-spacing: 0.3px; }
.srcs ul { margin: 0; padding-left: 18px; }
.srcs a { color: var(--accent-2); text-decoration: none; word-break: break-all; }
.srcs a:hover { text-decoration: underline; }

/* numbered step blocks for hands-on guides */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
  position: relative;
  margin: 0 0 14px;
  padding: 2px 0 2px 38px;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

/* ===== v4: real-world use-case callouts ===== */
.usecase {
  background: linear-gradient(180deg, rgba(63,185,80,0.08), transparent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
}
.usecase h4 {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.usecase p { margin: 6px 0 0; }

/* ===== realtime web search action ===== */
.websearch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 10px 0 18px;
}
.ws-label { color: var(--text-dim); font-size: 0.9rem; margin-right: 4px; }
.ws-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.85rem;
}
.ws-btn:hover { border-color: var(--accent-2); }

/* ===== collapsible track nav ===== */
.nav-track { margin-bottom: 4px; }
.nav-track-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-align: left;
  border-radius: 7px;
}
.nav-track-head:hover { background: var(--bg-soft); }
.nav-track-caret { color: var(--accent); transition: transform 0.15s ease; display: inline-block; }
.nav-track.open > .nav-track-head .nav-track-caret { transform: rotate(90deg); }
.nav-track-body { display: none; padding-left: 6px; margin-bottom: 8px; }
.nav-track.open > .nav-track-body { display: block; }

/* ===== learning-path link rows ===== */
.path-links {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 8px 0 26px;
  line-height: 2;
  font-size: 0.9rem;
}
.path-links a { color: var(--accent-2); text-decoration: none; }
.path-links a:hover { text-decoration: underline; }

/* ===== mermaid click-to-enlarge + lightbox ===== */
.mermaid-zoomable { cursor: zoom-in; position: relative; }
.mermaid-zoomable::after {
  content: "\2922 click to enlarge";
  position: absolute;
  top: 8px; right: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.mermaid-zoomable:hover::after { opacity: 1; }

.diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
}
.dlb-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
}
.dlb-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.dlb-btn:hover { border-color: var(--accent); }
.dlb-close { color: var(--accent); }
.dlb-stage {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dlb-pan {
  transform-origin: center center;
  will-change: transform;
}
.dlb-pan svg { max-width: none; height: auto; }
.dlb-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 10px;
}

/* ============================================================
   Admin editor (admin.js)
   ============================================================ */
.admin-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 800;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.admin-launcher:hover { border-color: var(--accent); color: #fff; }

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(2, 6, 12, .66);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-panel {
  width: min(1000px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.admin-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.admin-head strong { font-size: 16px; }
.admin-sub { color: var(--text-dim); font-size: 12px; flex: 1; }
.admin-x {
  border: none; background: transparent; color: var(--text-dim);
  font-size: 18px; cursor: pointer;
}
.admin-x:hover { color: #fff; }

.admin-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--border); }
.admin-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 13px;
}
.admin-tab.active { background: var(--bg-soft); color: var(--text); border-color: var(--border); }

.admin-body { padding: 16px; overflow: auto; }

.admin-search {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-main strong { display: block; }
.admin-row-meta { color: var(--text-dim); font-size: 12px; }
.admin-row-actions { display: flex; gap: 6px; }
.admin-empty { color: var(--text-dim); }

.admin-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.admin-btn:hover { border-color: var(--accent-2); }
.admin-btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #04121f; font-weight: 600; }
.admin-btn.danger { border-color: #7f1d1d; color: #ffb4b4; }
.admin-btn.danger:hover { background: #3a1414; }

.admin-form { display: flex; flex-direction: column; gap: 12px; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-dim); }
.admin-form input,
.admin-form textarea {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.admin-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus { outline: none; border-color: var(--accent-2); }
.admin-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-hint { color: var(--text-dim); font-size: 12px; }

.admin-preview {
  margin-top: 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.admin-preview-label {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.admin-preview-body { padding: 16px; max-height: 360px; overflow: auto; }

.admin-publish p { margin: 0 0 12px; }
.admin-publish code { background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }

/* ============================================================
   Signed-in user badge (auth.js / app.js)
   ============================================================ */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 12px;
  font-size: 13px;
}
.ub-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}
.ub-tag {
  background: var(--accent);
  color: #1a1206;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ub-signout {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.ub-signout:hover { border-color: var(--accent-2); color: #fff; }

/* ============================================================
   Daily submit launcher + submission cards (admin.js)
   ============================================================ */
/* stack the two floating launchers so they don't overlap */
.submit-launcher { bottom: 18px; right: 18px; background: var(--accent-2); color: #04121f; font-weight: 700; border-color: var(--accent-2); }
.admin-launcher:not(.submit-launcher) { bottom: 62px; }  /* admin sits above submit */

.admin-sub-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.admin-sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.admin-sub-notes {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  max-height: 260px;
  overflow: auto;
}
.admin-sub-notes h2,
.admin-sub-notes h3,
.admin-sub-notes h4 { margin: 8px 0 4px; }
.admin-sub-notes ul { margin: 6px 0; padding-left: 20px; }
.admin-sub-doubt { margin-top: 8px; color: #e6c07b; font-size: 14px; }
.admin-sub-foot { margin-top: 8px; font-size: 13px; }
.admin-sub-foot a { color: var(--accent-2); }

/* ============================================================
   Quiz maker / quizzes / profile launchers (admin.js)
   ============================================================ */
/* stack launchers vertically so they never overlap */
.submit-launcher   { bottom: 18px;  right: 18px; background: var(--accent-2); color: #04121f; font-weight: 700; border-color: var(--accent-2); }
.quizzes-launcher  { bottom: 62px;  right: 18px; }
.profile-launcher  { bottom: 106px; right: 18px; }
.admin-launcher:not(.submit-launcher):not(.quizzes-launcher):not(.profile-launcher) { bottom: 150px; right: 18px; }

.admin-qblock {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  background: var(--bg-alt);
}
.admin-qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.admin-qtext { width: 100%; margin-bottom: 8px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 9px 11px; }
.admin-optrow { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.admin-optrow .admin-opttext { flex: 1; background: var(--code-bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); padding: 8px 10px; }
.admin-body h3 { margin: 16px 0 8px; font-size: 15px; }

/* ============================================================
   Admin / panel UI polish (overrides earlier rules)
   ============================================================ */
/* Floating launchers: pill with subtle lift on hover */
.admin-launcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg-alt));
  color: var(--text);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.admin-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.45); border-color: var(--accent-2); color: #fff; }
.admin-launcher:active { transform: translateY(0); }
.submit-launcher { background: linear-gradient(180deg, #3b82f6, #2563eb); border-color: #2563eb; color: #fff; }
.submit-launcher:hover { border-color: #60a5fa; }

/* Overlay: fade in + blur the backdrop */
.admin-overlay {
  background: rgba(2, 6, 12, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: vrFade .16s ease;
}
@keyframes vrFade { from { opacity: 0; } to { opacity: 1; } }

/* Panel: rounder, lifts in */
.admin-panel {
  width: min(980px, 96vw);
  border-radius: 16px;
  border-color: #30384a;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: vrPop .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes vrPop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* Header: gradient bar */
.admin-head {
  padding: 16px 18px;
  background: linear-gradient(180deg, #1b2434, var(--bg-alt));
  border-bottom: 1px solid var(--border);
}
.admin-head strong { font-size: 17px; letter-spacing: .2px; }
.admin-x {
  width: 30px; height: 30px; border-radius: 8px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.admin-x:hover { background: rgba(255,255,255,.08); color: #fff; }

/* Tabs: pill style, clear active state */
.admin-tabs { gap: 6px; padding: 12px 16px 0; background: var(--bg); }
.admin-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.admin-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.admin-tab.active {
  background: var(--accent-2);
  color: #04121f;
  border-color: var(--accent-2);
  border-radius: 999px;
}

.admin-body { padding: 18px; }

/* Rows: hover highlight */
.admin-row {
  border-radius: 10px;
  transition: border-color .12s ease, background .12s ease;
}
.admin-row:hover { border-color: #3a4456; background: #1a2130; }
.admin-row-main strong { font-size: 14px; }

/* Buttons: slightly bigger hit area + transitions */
.admin-btn {
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 600;
  transition: transform .1s ease, border-color .12s ease, background .12s ease;
}
.admin-btn:hover { transform: translateY(-1px); }
.admin-btn.primary { box-shadow: 0 4px 14px rgba(79,156,249,.35); }

/* Inputs: focus ring */
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.admin-search:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(79,156,249,.18);
}

/* Section headings inside panel */
.admin-body h3 {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* Submission cards: accent strip */
.admin-sub-card { border-left: 3px solid var(--accent-2); }

/* ============================================================
   White/blue theme adjustments + collapsible nav groups + scroll UX
   (appended; later rules win)
   ============================================================ */

/* Code blocks: dark navy bg (var --code-bg) needs light text */
pre, pre code, code.block { color: #e6edf3; }
:not(pre) > code { background: var(--bg-soft); color: #0f2744; padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); border: 1px solid #1d3a5f; border-radius: var(--radius); }
.cmt { color: #7fb0e6; }

/* Links / accents on light bg */
a { color: var(--accent); }
.article a { text-decoration: underline; text-underline-offset: 2px; }

/* Callouts readable on white */
.callout { border-radius: var(--radius); }
.callout.tip  { background: #eaf2ff; border-left: 4px solid var(--accent); }
.callout.warn { background: #fff4e5; border-left: 4px solid #d97706; color: #5a3a06; }

/* Tables + cards on white */
table { border-color: var(--border); }
th { background: var(--bg-alt); color: var(--text); }
td, th { border-color: var(--border); }
.card { background: var(--bg-alt); border: 1px solid var(--border); }
.pill { background: var(--bg-soft); color: var(--accent); border: 1px solid var(--border); }

/* ---- Scroll UX ---- */
.content { overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; }
.article { max-width: 920px; margin: 0 auto; padding-bottom: 80px; }
.article h1 { scroll-margin-top: 16px; }
/* comfortable reading rhythm */
.article p, .article li { line-height: 1.7; }
.article h2 { margin-top: 1.6em; padding-top: .3em; }

/* thin, themed scrollbars */
.content::-webkit-scrollbar, .browse-panel::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb, .browse-panel::-webkit-scrollbar-thumb { background: #c3d3ea; border-radius: 6px; }
.content::-webkit-scrollbar-thumb:hover, .browse-panel::-webkit-scrollbar-thumb:hover { background: #9fb8dc; }
.content::-webkit-scrollbar-track, .browse-panel::-webkit-scrollbar-track { background: transparent; }

/* ---- Collapsible nav groups (sub-options so the list isn't overwhelming) ---- */
.nav-group { margin: 2px 0; }
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.nav-group-title:hover { background: var(--bg-soft); }
.nav-group-caret { transition: transform .15s ease; color: var(--accent); font-size: 11px; width: 10px; }
.nav-group.open > .nav-group-title .nav-group-caret { transform: rotate(90deg); }
.nav-group-label { flex: 1; }
.nav-group-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 1px 8px;
}
/* topics hidden until the group is opened */
.nav-group-links { display: none; padding-left: 14px; margin: 2px 0 6px; border-left: 2px solid var(--border); }
.nav-group.open > .nav-group-links { display: block; }
.nav-group .nav-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.4;
}
.nav-group .nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-group .nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }

/* Brand on white/blue theme */
.brand-mark { background: linear-gradient(135deg, #1763d6, #0f49a8); color: #fff; }
.brand-text { color: var(--text); }
.topbar { box-shadow: 0 1px 3px rgba(15,39,68,.06); }
.search-wrap input, #search {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
}
#search::placeholder { color: var(--text-dim); }
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); color: var(--text-dim); }
.footer a { color: var(--accent); }
/* track headers on light sidebar */
.nav-track-head { color: var(--text); }
.nav-track-head:hover { background: var(--bg-soft); }
.nav-track-caret { color: var(--accent); }

/* ============================================================
   Resume Builder (admin.js openResumeBuilder)
   ============================================================ */
.resume-launcher { bottom: 150px; right: 18px; }
/* re-stack launchers now that there are more of them */
.submit-launcher   { bottom: 18px; }
.quizzes-launcher  { bottom: 62px; }
.profile-launcher  { bottom: 106px; }
.resume-launcher   { bottom: 150px; }
.admin-launcher:not(.submit-launcher):not(.quizzes-launcher):not(.profile-launcher):not(.resume-launcher) { bottom: 194px; }

.resume-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.resume-form h3 { margin: 14px 0 6px; font-size: 13px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.resume-row { display: flex; gap: 10px; }
.resume-row label { flex: 1; }
.resume-preview {
  position: sticky;
  top: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  max-height: 72vh;
  overflow: auto;
}
.resume-doc { font-size: 13px; color: #111; padding: 14px; }
.resume-doc .rd-name { font-size: 22px; font-weight: 800; color: #0f2744; }
.resume-doc .rd-headline { color: var(--accent); font-weight: 600; }
.resume-doc .rd-head { border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin-bottom: 10px; }
.resume-doc .rd-contact { color: #555; font-size: 12px; margin-top: 4px; }
.resume-doc .rd-sec { margin: 10px 0; }
.resume-doc .rd-sec h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.resume-doc .rd-item { margin: 5px 0; }
.resume-doc .rd-item-top { display: flex; justify-content: space-between; gap: 8px; }
.resume-doc .rd-dates { color: #777; font-size: 11px; white-space: nowrap; }
.resume-doc .rd-skills { display: flex; flex-wrap: wrap; gap: 5px; }
.resume-doc .rd-skill { background: #eaf2ff; color: var(--accent); border-radius: 4px; padding: 1px 7px; font-size: 11px; }
@media (max-width: 860px) { .resume-wrap { grid-template-columns: 1fr; } .resume-preview { position: static; max-height: none; } }

/* ---- AI ATS report ---- */
.ats-report { grid-column: 1 / -1; margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; background: #f7faff; padding: 14px 16px; }
.ats-loading { color: var(--accent); font-weight: 600; }
.ats-err { color: #b42318; font-weight: 600; }
.ats-raw { white-space: pre-wrap; font-size: 13px; line-height: 1.5; margin: 6px 0 0; }
.ats-head { display: flex; align-items: center; gap: 16px; }
.ats-score { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #fff; }
.ats-score span { font-size: 12px; font-weight: 600; margin-left: 2px; opacity: .9; }
.ats-good { background: #1a7f37; }
.ats-ok { background: #c9820a; }
.ats-low { background: #b42318; }
.ats-verdict h4 { margin: 0 0 4px; color: var(--accent); }
.ats-verdict p { margin: 0; font-size: 14px; line-height: 1.5; }
.ats-model { display: inline-block; margin-top: 6px; font-size: 11px; color: #777; }
.ats-sec { margin-top: 12px; }
.ats-sec h5 { margin: 0 0 4px; font-size: 13px; color: var(--ink, #0f2744); }
.ats-sec ul { margin: 0; padding-left: 18px; }
.ats-sec li { font-size: 13px; line-height: 1.5; margin: 2px 0; }
.ats-kw li { display: inline-block; background: #eaf2ff; color: var(--accent); border-radius: 4px; padding: 1px 8px; margin: 2px 4px 2px 0; font-size: 12px; }
.ats-kw { list-style: none; padding-left: 0 !important; }
.ats-count { display: block; margin-top: 6px; font-weight: 600; color: var(--accent); }

/* ---- Resume starter templates ---- */
.resume-templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.resume-tpl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-alt); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 700;
  min-width: 150px; flex: 1 1 150px;
}
.resume-tpl span { font-size: 11px; font-weight: 500; color: var(--text-dim); }
.resume-tpl:hover { border-color: var(--accent); background: #eaf2ff; }
.resume-tpl.active { border-color: var(--accent); background: #eaf2ff; box-shadow: 0 0 0 2px rgba(23,99,214,.15); }

/* ---- AI chatbot ---- */
.chat-wrap { display: flex; flex-direction: column; height: min(62vh, 560px); }
.chat-log {
  flex: 1; overflow-y: auto; padding: 6px 4px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.55; white-space: normal; word-wrap: break-word;
}
.chat-msg.bot .chat-bubble { background: var(--bg-alt); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--accent); color: #fff; border-top-right-radius: 4px; }
.chat-bubble code { background: rgba(15,39,68,.08); color: #0f2744; border: none; padding: 1px 5px; }
.chat-msg.user .chat-bubble code { background: rgba(255,255,255,.2); color: #fff; }
.chat-pre { background: var(--code-bg); color: #d7e1ea; border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 12.5px; margin: 6px 0; }
.chat-ul { margin: 6px 0; padding-left: 20px; }
.chat-typing { letter-spacing: 3px; color: var(--accent); animation: chatblink 1.2s infinite; }
@keyframes chatblink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--border); }
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
.chat-input textarea:focus { outline: none; border-color: var(--accent); }
.chat-input .admin-btn { white-space: nowrap; }
.chat-foot { display: flex; justify-content: space-between; margin-top: 6px; }
.chat-foot .admin-hint { font-size: 11px; }
@media (max-width: 640px) { .chat-bubble { max-width: 90%; } .chat-wrap { height: 70vh; } }

/* chat prepopulated prompt suggestions */
.chat-suggest { margin: 2px 0 4px; }
.chat-suggest-label { font-size: 12px; color: var(--text-dim); margin: 0 0 6px 2px; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip {
  border: 1px solid var(--border); background: #fff; color: var(--accent);
  font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  text-align: left; line-height: 1.3;
}
.chat-chip:hover { background: #eaf2ff; border-color: var(--accent); }

/* ============================================================
   Toast
   ============================================================ */
.vr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #0f2744;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(15,39,68,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 1200;
}
.vr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Header "Tools" menu (holds all heavy options; replaces floating buttons)
   ============================================================ */
.tools-menu { position: relative; margin-left: 8px; }
.tools-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.tools-btn:hover { background: #0f49a8; border-color: #0f49a8; }
.tools-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15,39,68,.18);
  padding: 6px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.tools-item:hover { background: var(--bg-soft); color: var(--accent); }

/* Retire the old floating launcher buttons entirely (now in the header menu) */
.admin-launcher { display: none !important; }

@media (max-width: 640px) {
  .tools-btn { padding: 8px 12px; font-size: 13px; }
  .tools-dropdown { min-width: 200px; }
}

/* ============================================================
   Header "Topics" mega-menu (replaces the left sidebar entirely)
   ============================================================ */
.browse-menu { position: relative; margin-left: 4px; }
.browse-btn {
  color: #fff;
  border: 1px solid var(--accent);
  background: var(--accent);
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.browse-btn:hover { background: #0f49a8; border-color: #0f49a8; }

/* dim backdrop behind the open panel */
.browse-scrim {
  position: fixed; inset: 56px 0 0 0;
  background: rgba(15,39,68,.28);
  z-index: 190;
}

/* the panel drops from under the header, full width, scrollable */
.browse-panel {
  position: fixed;
  left: 0; right: 0; top: 56px;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(15,39,68,.18);
  z-index: 200;
  padding: 14px 24px 28px;
}

/* top strip: track jump-chips + close */
.browse-bar {
  display: flex; align-items: flex-start; gap: 12px;
  position: sticky; top: 0; background: #fff;
  padding: 4px 0 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.browse-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.browse-chip {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.browse-chip:hover { background: #eaf2ff; border-color: var(--accent); }
.browse-close {
  flex: 0 0 auto;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.browse-close:hover { background: var(--bg-soft); }

/* responsive multi-column grid of tracks */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px 24px;
  align-items: start;
}
.browse-track { break-inside: avoid; }
.browse-track-head {
  margin: 0 0 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); border-bottom: 2px solid #e1e9f5; padding-bottom: 4px;
}

.browse-group { margin-bottom: 4px; }
.browse-group-title {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; background: transparent; border: none;
  color: var(--text); font-weight: 600; font-size: 13.5px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
.browse-group-title:hover { background: var(--bg-soft); }
.browse-group-caret { transition: transform .15s ease; color: var(--accent); font-size: 11px; width: 10px; }
.browse-group.open > .browse-group-title .browse-group-caret { transform: rotate(90deg); }
.browse-group-label { flex: 1; }
.browse-group-count {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg-soft); border-radius: 999px; padding: 1px 8px;
}
.browse-group-links { display: none; padding-left: 16px; margin: 1px 0 6px; border-left: 2px solid var(--border); }
.browse-group.open > .browse-group-links { display: block; }
.browse-link {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 13px; padding: 6px 10px; border-radius: 7px; cursor: pointer; line-height: 1.4;
}
.browse-link:hover { background: var(--bg-soft); color: var(--text); }
.browse-link.active { background: var(--accent); color: #fff; font-weight: 600; }

/* content is centered full-width now that the sidebar is gone */
.layout { display: block; }
body.browse-open { overflow: hidden; }

@media (max-width: 640px) {
  .browse-btn { padding: 8px 12px; font-size: 13px; }
  .browse-panel { padding: 12px 14px 24px; }
}

/* ---- Tools menu structure: section labels + dividers ---- */
.tools-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim); font-weight: 700;
  padding: 10px 12px 4px;
}
.tools-divider { height: 1px; background: var(--border); margin: 4px 6px; border: none; }
