/* ── Site Breadcrumb ── */
.site-breadcrumb {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 9999;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.site-breadcrumb a {
  color: #3a6a3a;
  text-decoration: none;
  transition: color 0.2s;
}
.site-breadcrumb a:hover {
  color: #62DE61;
  text-decoration: none;
}
body.light .site-breadcrumb a {
  color: #6a8a6a;
}
body.light .site-breadcrumb a:hover {
  color: #1a7a1a;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #62DE61;
  background: rgba(98,222,97,0.08);
  color: #62DE61;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}
.theme-toggle:hover {
  background: rgba(98,222,97,0.18);
  box-shadow: 0 0 12px rgba(98,222,97,0.25);
}
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

/* ── Light Mode ── */
body.light {
  background: #f5f5f2;
  color: #2a2a2a;
}

body.light .theme-toggle {
  background: rgba(26,122,26,0.06);
  border-color: #1a7a1a;
  color: #1a6a1a;
}
body.light .theme-toggle:hover {
  background: rgba(26,122,26,0.14);
  box-shadow: 0 0 12px rgba(26,122,26,0.15);
}
body.light .theme-toggle .icon-sun { display: none; }
body.light .theme-toggle .icon-moon { display: block; }

body.light a { color: #1a7a1a; }

body.light code {
  background: #e8ede8;
  color: #1a6a1a;
}
body.light pre {
  background: #e8ede8;
  color: #1a6a1a;
}

/* Header */
body.light .header {
  border-bottom-color: #d0d8d0;
}
body.light .header h1 {
  color: #1a6a1a;
}
body.light .header .subtitle {
  color: #6a8a6a;
}

/* Section titles */
body.light .section-title {
  color: #1a6a1a;
  border-bottom-color: #d0d8d0;
}

/* Model cards */
body.light .model-card,
body.light .model-entry {
  background: #fff;
  border-color: #d0d8d0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
body.light .model-card:hover,
body.light .model-entry:hover {
  border-color: #1a7a1a;
  background: #f8fdf8;
  box-shadow: 0 4px 16px rgba(26,122,26,0.08);
}
body.light .model-card .card-name,
body.light .model-entry .model-name {
  color: #1a6a1a;
}
body.light .model-card .card-label {
  color: #6a8a6a;
}
body.light .model-card .card-value {
  color: #2a2a2a;
}
body.light .model-card.comparison-card {
  opacity: 0.9;
  border-color: #d8ddd8;
}
body.light .model-card.comparison-card .card-name {
  color: #4a8a4a;
}

/* Model entry (index page) */
body.light .model-entry .model-org {
  color: #6a8a6a;
}
body.light .model-entry .model-desc {
  color: #4a4a4a;
}
body.light .model-entry .model-meta {
  color: #8a8a8a;
}
body.light .model-entry .model-meta .model-meta-label {
  color: #6a8a6a;
}

/* Tags */
body.light .tag-dense,
body.light .tag-hybrid,
body.light .tag-attn {
  background: rgba(26,122,26,0.1);
  color: #1a6a1a;
  border-color: rgba(26,122,26,0.25);
}
body.light .tag-moe,
body.light .tag-edge {
  background: rgba(180,140,20,0.1);
  color: #8a6a0a;
  border-color: rgba(180,140,20,0.2);
}
body.light .tag-vision {
  background: rgba(30,100,180,0.08);
  color: #1a5a9a;
  border-color: rgba(30,100,180,0.2);
}
body.light .tag-audio {
  background: rgba(120,60,200,0.08);
  color: #6a3aaa;
  border-color: rgba(120,60,200,0.18);
}
body.light .tag-misc,
body.light .tag-size,
body.light .tag-madl {
  background: rgba(26,122,26,0.06);
  color: #4a7a4a;
  border-color: rgba(26,122,26,0.15);
}
body.light .tag-xformer {
  background: rgba(120,60,200,0.08);
  color: #6a3aaa;
  border-color: rgba(120,60,200,0.18);
}

/* Tables */
body.light .table-wrap {
  border-color: #d0d8d0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
body.light table {
  background: #fff;
}
body.light thead th {
  background: #f0f4f0;
  color: #1a6a1a;
  border-bottom-color: #c0ccc0;
}
body.light tbody td {
  border-bottom-color: #e8ede8;
}
body.light tbody tr:hover {
  background: rgba(26,122,26,0.03);
}
body.light td.row-label {
  color: #4a7a4a;
}
body.light td.highlight {
  background: rgba(26,122,26,0.05);
}
body.light td.best {
  color: #1a6a1a;
}

/* Innovations list */
body.light .innovations-list li {
  background: #fff;
  border-color: #d0d8d0;
  border-left-color: #1a7a1a;
}
body.light .innovations-list li strong {
  color: #1a6a1a;
}
body.light .innovations-list li span {
  color: #4a5a4a;
}

/* Deep dive cards */
body.light .deepdive-card,
body.light .intro-item {
  background: #fff;
  border-color: #d0d8d0;
}
body.light .deepdive-card-highlight {
  border-color: #1a7a1a;
  box-shadow: 0 0 12px rgba(26,122,26,0.06);
}
body.light .deepdive-card-title,
body.light .intro-item-title {
  color: #1a6a1a;
}
body.light .deepdive-card-body,
body.light .intro-item-desc {
  color: #3a4a3a;
}
body.light .deepdive-card-body strong {
  color: #1a6a1a;
}
body.light .deepdive-card-body em {
  color: #2a2a2a;
}
body.light .deepdive-intro {
  color: #4a5a4a;
}
body.light .deepdive-intro strong {
  color: #1a6a1a;
}
body.light .deepdive-note {
  color: #7a8a7a;
}

/* Intro text */
body.light .intro {
  color: #4a5a4a;
}
body.light .intro strong {
  color: #1a6a1a;
}
body.light .intro em {
  color: #2a2a2a;
}
body.light .intro-changes li {
  color: #4a5a4a;
}
body.light .intro-changes li strong {
  color: #1a6a1a;
}
body.light .intro-changes li::before {
  color: #1a7a1a;
}

/* SVG diagrams -- invert ALL content SVGs for readability in light mode.
   This catches inline SVGs in deep-dive cards, rope cards, PLE cards, etc.
   The theme-toggle button SVG icons are excluded via the :not() selector. */
body.light svg:not(.icon-sun):not(.icon-moon) {
  filter: invert(0.88) hue-rotate(180deg);
  border-radius: 8px;
}
body.light .diagram-container .diagram-title {
  color: #1a6a1a;
  border-bottom-color: #d0d8d0;
}

/* PLE / rope / other deep dive variants from gemma4 */
body.light .ple-card,
body.light .rope-card,
body.light .ple-multimodal-box {
  background: #fff;
  border-color: #d0d8d0;
}
body.light .ple-card-highlight,
body.light .rope-card-highlight,
body.light .deepdive-card-highlight {
  border-color: #1a7a1a;
}
body.light .ple-card-title,
body.light .rope-card-title {
  color: #1a6a1a;
}
body.light .ple-card-body,
body.light .rope-card-body {
  color: #3a4a3a;
}
body.light .ple-card-body strong,
body.light .rope-card-body strong {
  color: #1a6a1a;
}
body.light .ple-intro-text,
body.light .rope-paper-ref {
  color: #4a5a4a;
  background: #fff;
  border-color: #d0d8d0;
}
body.light .ple-intro-text strong {
  color: #1a6a1a;
}
body.light .ple-note,
body.light .rope-authors {
  color: #7a8a7a;
}
body.light .ple-multimodal-box {
  background: #faf6f0;
  border-color: #d8ccaa;
}
body.light .ple-multimodal-box .ple-card-title {
  color: #8a6a22;
}
body.light .ple-multimodal-box .ple-card-body strong {
  color: #8a6a22;
}

/* GLM deep dive variants */
body.light .deepdive-table th,
body.light .ple-param-table th {
  color: #1a6a1a;
  border-bottom-color: #c0ccc0;
}
body.light .deepdive-table td:nth-child(2),
body.light .deepdive-table td:nth-child(3),
body.light .ple-param-table td:nth-child(2),
body.light .ple-param-table td:nth-child(3) {
  color: #1a6a1a;
}

/* Legacy diagram box */
body.light .diagram-legacy {
  background: #faf6f0;
  border-color: #d8ccaa;
}
body.light .diagram-legacy .diagram-title {
  color: #8a6a22;
  border-bottom-color: #d8ccaa;
}

/* ── Broad overrides for all dark-background elements ── */
/* Master rule: every card, box, and block-level element that has background:#111
   in the page's inline <style> gets overridden here with !important. */
body.light .model-card,
body.light .model-card.comparison-card,
body.light .deepdive-card,
body.light .ple-card,
body.light .rope-card,
body.light .intro-item,
body.light .intro-target,
body.light .param-block-card,
body.light .innovations-list li,
body.light .rope-paper-ref,
body.light .code-block,
body.light .code-diagram {
  background: #fff !important;
  border-color: #d0d8d0 !important;
}
body.light .param-block-header {
  color: #1a6a1a !important;
  border-bottom-color: #d0d8d0 !important;
}
body.light .param-block-header[style] {
  color: #8a6a22 !important;
  border-color: #d8ccaa !important;
}
body.light .param-block-summary {
  border-top-color: #d0d8d0 !important;
  color: #4a5a4a !important;
}
body.light .param-block-summary strong {
  color: #1a6a1a !important;
}
/* Table headers with background:#0f0f0f */
body.light thead th,
body.light .ple-param-table th,
body.light .deepdive-table th {
  background: #f0f4f0 !important;
  color: #1a6a1a !important;
  border-bottom-color: #c0ccc0 !important;
}
/* Code / pre blocks with #0a0a0a or #1a1a1a backgrounds */
body.light pre,
body.light code,
body.light .code-block,
body.light .code-diagram,
body.light .ple-code-section pre,
body.light .deepdive pre,
body.light .rope-code-block {
  background: #e8ede8 !important;
  color: #1a6a1a !important;
  border-color: #d0d8d0 !important;
}
body.light .rope-code-block .rope-label {
  color: #6a8a6a !important;
}
/* Legacy/comparison boxes with #0d0800 bg */
body.light .diagram-legacy,
body.light .ple-multimodal-box,
body.light [style*="background:#0d0800"],
body.light [style*="background: #0d0800"] {
  background: #faf6f0 !important;
  border-color: #d8ccaa !important;
}
/* Catch any remaining inline style dark backgrounds */
body.light [style*="background:#0a0a0a"],
body.light [style*="background: #0a0a0a"] {
  background: #e8ede8 !important;
}
body.light [style*="background:#111"],
body.light [style*="background: #111"] {
  background: #fff !important;
}
body.light [style*="background:#0f0f"],
body.light [style*="background: #0f0f"] {
  background: #f0f4f0 !important;
}

/* Footer */
body.light .footer {
  border-top-color: #d0d8d0;
  color: #8a9a8a;
}
body.light .footer a {
  color: #4a7a4a;
}

/* Rope specific */
body.light .rope-paper-ref {
  border-left-color: #1a7a1a;
}
body.light .rope-paper-ref a {
  color: #1a6a1a;
}

/* Inline style color overrides for dark text on dark bg elements */
body.light [style*="color:#aa8833"] {
  color: #8a6a22 !important;
}
body.light [style*="color:#3a6a3a"],
body.light [style*="color:#4a6a4a"] {
  color: #6a8a6a !important;
}
body.light [style*="border-color:#3a2a0a"] {
  border-color: #d8ccaa !important;
}
body.light [style*="border-bottom-color:#3a2a0a"] {
  border-bottom-color: #d8ccaa !important;
}
/* Inline-styled span tags (like the PREVIOUS GEN badge) */
body.light [style*="background:#aa8833"] {
  background: #c8a844 !important;
  color: #fff !important;
}

/* MADL diagram SVGs — background stays #0a0a0a in both modes.
   The filter:invert() on body.light svg handles the visual flip. */
.madl-svg {
  background: #0a0a0a;
}
