/* ============================================================
   MAIN.CSS  –  Graduation Score Analysis 2025
   ============================================================ */

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

:root {
  --blue:       #3b82f6;
  --blue-dark:  #1d4ed8;
  --blue-deep:  #1e40af;
  --green:      #10b981;
  --green-dark: #065f46;
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.chart-grid.single { grid-template-columns: 1fr; }
.chart-grid.triple { grid-template-columns: repeat(3, 1fr); }

/* ── Masonry layout (CSS columns) ── */
.masonry-grid {
  columns: 480px;
  column-gap: 24px;
}
.masonry-grid > .masonry-item {
  break-inside: avoid;
  margin-bottom: 24px;
  display: inline-block; /* fix column break rendering in some browsers */
  width: 100%;
}r:      #f59e0b;
  --red:        #ef4444;
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-600:  #475569;
  --slate-700:  #334155;
  --slate-800:  #1e293b;
  --white:      #ffffff;

  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px rgb(0 0 0 / .06);
  --shadow:    0 4px 12px rgb(0 0 0 / .10);
  --shadow-lg: 0 10px 32px rgb(0 0 0 / .12);
  --nav-h:     64px;
  --sidebar-w: 260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.65;
  font-size: 15px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-400); border-radius: 3px; }

/* ============================================================
   TOP NAVBAR
   ============================================================ */
#top-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

#nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

#nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 8px rgb(59 130 246 / .35);
}

#nav-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.2;
}

#nav-logo .logo-sub {
  font-size: 11px;
  color: var(--slate-500);
  font-weight: 400;
}

#nav-menu {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

#nav-menu a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--slate-600);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

#nav-menu a:hover,
#nav-menu a.active {
  background: var(--slate-100);
  color: var(--blue-dark);
}

.nav-spacer { flex: 1; }

#nav-badge {
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #dbeafe;
  color: var(--blue-dark);
  font-weight: 600;
  white-space: nowrap;
}

#hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

#hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--slate-700);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
#page-wrapper {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Left Sidebar ── */
#sidebar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--slate-200);
  padding: 24px 16px;
  z-index: 900;
  transition: transform .25s;
}

#sidebar-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 12px;
}

.sidebar-group { margin-bottom: 6px; }

.sidebar-group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate-500);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
  user-select: none;
  transition: background .15s;
}

.sidebar-group-label:hover { background: var(--slate-100); }

.sidebar-group-label .sg-icon { font-size: 14px; }
.sidebar-group-label .sg-caret {
  margin-left: auto;
  font-size: 10px;
  transition: transform .2s;
  color: var(--slate-400);
}

.sidebar-group.open .sg-caret { transform: rotate(90deg); }

.sidebar-group-items { display: none; padding-left: 10px; }
.sidebar-group.open .sidebar-group-items { display: block; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--slate-600);
  text-decoration: none;
  transition: background .15s, color .15s;
  line-height: 1.3;
}

.sidebar-link:hover { background: #eff6ff; color: var(--blue-dark); }
.sidebar-link.active {
  background: #dbeafe;
  color: var(--blue-dark);
  font-weight: 600;
}

.sidebar-link .sl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--slate-300);
  flex-shrink: 0;
}

.sidebar-link.active .sl-dot { background: var(--blue); }

/* ── Main Content ── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: calc(100% - var(--sidebar-w));
}

/* ============================================================
   HERO / PAGE HEADER
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  color: var(--white);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgb(255 255 255 / .05);
}

.page-hero::before {
  content: '';
  position: absolute;
  right: 100px; bottom: -80px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgb(255 255 255 / .03);
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  background: rgb(255 255 255 / .15);
  border: 1px solid rgb(255 255 255 / .25);
  border-radius: 20px;
  margin-bottom: 16px;
}

.page-hero h1 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.page-hero p {
  font-size: 15px;
  opacity: .85;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: box-shadow .2s, transform .2s;
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #d1fae5; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.red    { background: #fee2e2; }

.stat-body .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-800);
  line-height: 1;
  margin-bottom: 3px;
}

.stat-body .stat-label {
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 500;
}

/* ============================================================
   SECTIONS & CARDS
   ============================================================ */
.section { margin-bottom: 52px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--slate-200);
}

.section-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #dbeafe;
  color: var(--blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-800);
}

.section-subtitle {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 1px;
}

/* ── Chart Grid ── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.chart-grid.single { grid-template-columns: 1fr; }
.chart-grid.triple { grid-template-columns: repeat(3, 1fr); }

/* ── Masonry layout (CSS columns) ── */
.masonry-grid {
  columns: 480px;
  column-gap: 24px;
}
.masonry-grid > .masonry-item {
  break-inside: avoid;
  margin-bottom: 24px;
  display: inline-block;
  width: 100%;
}


.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.chart-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.chart-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-tag {
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--slate-100);
  color: var(--slate-500);
  font-weight: 600;
}

.chart-card-body {
  padding: 16px 20px 18px;
}

.chart-card-body img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

/* ── Comment Box ── */
.comment-box {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed #c7d2e8;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--slate-700);
  line-height: 1.75;
  background: #fbfcff;
  min-height: 80px;
}
.comment-box p {
  margin: 0 0 0.6em 0;
}
.comment-box p:last-child {
  margin-bottom: 0;
}
.comment-box ul {
  margin: 0.4em 0 0.6em 1.4em;
  padding: 0;
}
.comment-box li {
  margin-bottom: 0.25em;
}

/* ============================================================
   THEORY / INSIGHT PANELS
   ============================================================ */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  padding: 32px 36px;
  margin-bottom: 32px;
}

.panel-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.panel-badge.yellow { background: #fef9c3; color: #854d0e; }
.panel-badge.blue   { background: #dbeafe; color: var(--blue-deep); }
.panel-badge.green  { background: #d1fae5; color: var(--green-dark); }
.panel-badge.purple { background: #ede9fe; color: #4c1d95; }

.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 6px;
}

.panel-lead {
  font-size: 13.5px;
  color: var(--slate-600);
  margin-bottom: 24px;
  line-height: 1.7;
}

.panel h3 {
  font-size: 15px;
  color: #2563eb;
  margin: 22px 0 8px;
  font-weight: 700;
}

.panel h4 {
  font-size: 14px;
  color: var(--slate-700);
  border-left: 4px solid var(--blue);
  padding-left: 12px;
  margin: 20px 0 10px;
  font-weight: 700;
}

.panel p { font-size: 13.5px; color: var(--slate-700); line-height: 1.75; margin-bottom: 10px; }
.panel ul { padding-left: 22px; margin: 8px 0 10px; }
.panel li { font-size: 13.5px; color: var(--slate-700); line-height: 1.75; margin-bottom: 6px; }

.highlight-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 14px 0;
}

.callout {
  background: #e8f4fd;
  border-left: 4px solid #2980b9;
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  color: #1e3a5f;
  font-style: italic;
  margin-top: 16px;
}

/* ── Data Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table thead th {
  background: var(--blue-dark);
  color: var(--white);
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}

.data-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-700);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: var(--slate-50); }
.data-table tbody tr:hover td { background: #eff6ff; }

/* ============================================================
   PIPELINE
   ============================================================ */
.pipeline-wrap { margin-bottom: 40px; }

.pipeline-step {
  display: flex;
  gap: 0;
  position: relative;
}

.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 28px;
  top: 62px;
  bottom: -16px;
  width: 2px;
  background: var(--slate-200);
}

.step-circle {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}

.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgb(59 130 246 / .35);
  position: relative;
  z-index: 1;
}

.step-body {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 18px 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 5px;
}

.step-desc {
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.65;
  margin-bottom: 10px;
}

/* ── Code Block ── */
.code-block {
  background: #1e293b;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: pre;
  margin-top: 8px;
  word-wrap: break-word;
  max-width: 100%;
}

.code-block .kw  { color: #c084fc; }
.code-block .st  { color: #86efac; }
.code-block .fn  { color: #67e8f9; }
.code-block .cm  { color: #475569; font-style: italic; }
.code-block .num { color: #fbbf24; }

/* ============================================================
   CLUSTER CARDS
   ============================================================ */
.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.cluster-card {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  border: 2px solid transparent;
}

.cluster-card.c1 { background: #d1fae5; border-color: #10b981; }
.cluster-card.c2 { background: #dbeafe; border-color: #3b82f6; }
.cluster-card.c3 { background: #fef3c7; border-color: #f59e0b; }
.cluster-card.c4 { background: #fee2e2; border-color: #ef4444; }

.cluster-card .cc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.cluster-card.c1 .cc-title { color: var(--green-dark); }
.cluster-card.c2 .cc-title { color: var(--blue-deep); }
.cluster-card.c3 .cc-title { color: #92400e; }
.cluster-card.c4 .cc-title { color: #991b1b; }

.cluster-card .cc-provinces {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
#page-footer {
  margin-left: var(--sidebar-w);
  padding: 24px 48px;
  text-align: center;
  font-size: 12.5px;
  color: var(--slate-400);
  border-top: 1px solid var(--slate-200);
  background: var(--white);
}

#page-footer a { color: var(--blue); text-decoration: none; }
#page-footer a:hover { text-decoration: underline; }

/* ============================================================
   PROGRESS BAR (reading)
   ============================================================ */
#read-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  width: 0%;
  z-index: 999;
  transition: width .1s;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 500;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover { transform: translateY(-3px); }

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--slate-100);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 18px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--white);
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgb(0 0 0 / .10);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--slate-800);
  color: var(--white);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 99;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: .04em;
}

.badge-blue   { background: #dbeafe; color: var(--blue-deep); }
.badge-green  { background: #d1fae5; color: var(--green-dark); }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #4c1d95; }

/* formula inline */
.formula {
  font-family: var(--font-mono);
  background: var(--slate-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .87em;
  color: #c026d3;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  #main-content { padding: 32px 32px 60px; }
  .chart-grid,
  .chart-grid.triple { grid-template-columns: 1fr; }
  .masonry-grid { columns: 1; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  #main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 16px 60px;
  }

  #page-footer { margin-left: 0; }

  #hamburger { display: flex; }

  #nav-menu { display: none; }

  .page-hero { padding: 32px 24px; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  #back-to-top { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .panel { padding: 22px 20px; }
  .chart-card-body { padding: 12px; }
}
/* ============================================================
   NAV.CSS  –  Navigation & Sidebar animations
   ============================================================ */

/* ── Active section highlight pulse ── */
@keyframes sidebarPulse {
  0%   { box-shadow: 0 0 0 0 rgb(59 130 246 / .4); }
  70%  { box-shadow: 0 0 0 6px rgb(59 130 246 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(59 130 246 / 0); }
}

.sidebar-link.pulse { animation: sidebarPulse .6s ease-out; }

/* ── Sidebar overlay (mobile) ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / .35);
  z-index: 850;
}

#sidebar-overlay.open { display: block; }

/* ── Search box in sidebar ── */
#sidebar-search-wrap {
  margin-bottom: 14px;
}

#sidebar-search {
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  font-size: 13px;
  color: var(--slate-700);
  background: var(--slate-50);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

#sidebar-search:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(59 130 246 / .1);
  background: var(--white);
}

.sidebar-link.hidden { display: none; }

/* ── Breadcrumb ── */
#breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--slate-500);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}

#breadcrumb a:hover { text-decoration: underline; }

#breadcrumb .bc-sep { color: var(--slate-300); }
#breadcrumb .bc-current { color: var(--slate-600); font-weight: 600; }

/* ── Sticky section header ── */
.section-anchor {
  display: block;
  position: relative;
  top: calc(-1 * var(--nav-h) - 16px);
  visibility: hidden;
}
/* ============================================================
   CHARTS.CSS  –  Chart-specific overrides & lightbox
   ============================================================ */

/* ── Lightbox overlay ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / .82);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#lightbox.open { display: flex; }

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgb(0 0 0 / .55);
  cursor: default;
  animation: lbIn .2s ease-out;
}

#lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  opacity: .75;
  transition: opacity .15s;
}

#lightbox-close:hover { opacity: 1; }

@keyframes lbIn {
  from { opacity: 0; transform: scale(.93); }
  to   { opacity: 1; transform: scale(1);   }
}

/* ── Clickable chart images ── */
.chart-card-body img {
  cursor: zoom-in;
  transition: opacity .2s, transform .2s;
}

.chart-card-body img:hover {
  opacity: .93;
  transform: scale(1.008);
}

/* ── Full-width image inside panel ── */
.panel-img-wrap {
  text-align: center;
  margin: 24px 0;
  padding: 16px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
}

.panel-img-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
  transition: opacity .2s;
}

.panel-img-wrap img:hover { opacity: .92; }

/* ── Annotation tags on chart cards ── */
.chart-annotations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ── Comparison bar (hypothesis) ── */
.hypo-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}

.hypo-stat {
  border-radius: 10px;
  padding: 14px 18px;
  text-align: center;
}

.hypo-stat.blue-stat { background: #dbeafe; }
.hypo-stat.red-stat  { background: #fee2e2; }

.hypo-stat .hs-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.hypo-stat.blue-stat .hs-label { color: var(--blue-deep); }
.hypo-stat.red-stat  .hs-label { color: #991b1b; }

.hypo-stat .hs-mean {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.hypo-stat.blue-stat .hs-mean { color: var(--blue-dark); }
.hypo-stat.red-stat  .hs-mean { color: #dc2626; }

.hypo-stat .hs-detail {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 4px;
}

/* ── Result badge (hypothesis) ── */
.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 13.5px;
  font-weight: 600;
}

.result-banner.reject { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.result-banner.accept { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--green-dark); }

.result-banner .rb-icon { font-size: 22px; }

/* ── Lang bar chart summary ── */
.lang-table {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 14px;
  align-items: center;
  margin: 16px 0;
}

.lang-table-row { display: contents; }

.lang-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  white-space: nowrap;
}

.lang-bar-wrap {
  height: 14px;
  background: var(--slate-100);
  border-radius: 7px;
  overflow: hidden;
}

.lang-bar-fill {
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  transition: width .6s ease;
}

.lang-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate-600);
  white-space: nowrap;
}
