/* © 2026 Рустам Буркеев. Все права защищены */
/* Тренажер — общая навигация. Можно менять отдельно от тренажёров. */
.oge-platform-header,
.oge-platform-header *{box-sizing:border-box}
.oge-platform-header{position:sticky;top:0;z-index:9999;background:rgba(255,255,255,.94);backdrop-filter:blur(16px);border-bottom:1px solid #d8dee9;box-shadow:0 8px 28px rgba(16,24,40,.08);font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#151922}
.oge-platform-inner{width:min(1100px,calc(100% - 24px));margin:0 auto;padding:10px 0;display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.oge-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#111827;font-weight:900;letter-spacing:-.03em;font-size:20px;white-space:nowrap}
.oge-brand-mark{width:46px;height:46px;border-radius:12px;display:block;object-fit:contain;flex:0 0 auto;box-shadow:0 8px 20px rgba(29,78,216,.20)}
.oge-menu{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.oge-menu a,.oge-submenu a{display:inline-flex;align-items:center;gap:6px;text-decoration:none;border:1px solid #d8dee9;background:#fff;color:#344054;border-radius:999px;padding:8px 11px;font-weight:800;font-size:13px;line-height:1;transition:.12s}
.oge-menu a:hover,.oge-submenu a:hover{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8;transform:translateY(-1px)}
.oge-menu a.active,.oge-submenu a.active{background:#111827;color:#fff;border-color:#111827}
.oge-subbar{border-top:1px solid #eef2f7;background:rgba(248,250,252,.92)}
.oge-subbar-inner{width:min(1100px,calc(100% - 24px));margin:0 auto;padding:8px 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.oge-subtitle{font-size:12px;font-weight:900;color:#667085;text-transform:uppercase;letter-spacing:.06em;margin-right:2px}
.oge-submenu{display:flex;gap:7px;flex-wrap:wrap}
.oge-soon{opacity:.55}
.oge-page{width:min(1100px,calc(100% - 24px));margin:18px auto 52px;font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#151922}
.oge-hero{background:linear-gradient(135deg,#eef4ff,#f7f8fb);border:1px solid #d8dee9;border-radius:26px;box-shadow:0 10px 30px rgba(16,24,40,.08);padding:26px;margin-bottom:14px}
.oge-hero h1{font-size:38px;line-height:1.05;margin:0 0 10px;letter-spacing:-.05em}
.oge-hero p{font-size:16px;line-height:1.5;color:#475467;margin:0;max-width:760px}
.oge-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.oge-card{display:block;text-decoration:none;background:#fff;border:1px solid #d8dee9;border-radius:22px;padding:18px;box-shadow:0 10px 30px rgba(16,24,40,.08);color:#151922;transition:.15s}
.oge-card:hover{transform:translateY(-2px);border-color:#bfdbfe;background:#fbfdff}
.oge-card h2{margin:0 0 8px;font-size:22px;letter-spacing:-.03em}.oge-card p{margin:0 0 12px;color:#667085;line-height:1.45}.oge-chip{display:inline-flex;align-items:center;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-weight:900;font-size:12px;padding:6px 10px;border:1px solid #bfdbfe}.oge-muted{color:#667085}.oge-note{background:#fff;border:1px solid #d8dee9;border-radius:18px;padding:14px;margin-top:14px;color:#475467;line-height:1.5}
@media(max-width:760px){.oge-platform-inner{align-items:flex-start}.oge-brand{font-size:16px}.oge-menu a,.oge-submenu a{font-size:12px;padding:8px 10px}.oge-subbar-inner{align-items:flex-start}.oge-hero h1{font-size:30px}.oge-grid{grid-template-columns:1fr}.oge-page{margin-top:12px}}

/* iPhone / mobile optimization layer — keep in shared CSS so every trainer updates from one file. */
:root{--oge-safe-top:env(safe-area-inset-top);--oge-safe-bottom:env(safe-area-inset-bottom)}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
body{overflow-x:hidden}
button,a,select,.gap{-webkit-tap-highlight-color:rgba(37,99,235,.14);touch-action:manipulation}

@media(max-width:932px){
  body{padding-bottom:calc(10px + var(--oge-safe-bottom))!important}
  .oge-platform-header{padding-top:var(--oge-safe-top);box-shadow:0 6px 22px rgba(16,24,40,.10)}
  .oge-platform-inner{width:calc(100% - 14px)!important;padding:7px 0 6px!important;display:grid!important;grid-template-columns:1fr!important;gap:7px!important;align-items:stretch!important}
  .oge-brand{font-size:15px!important;gap:8px!important;min-height:34px!important}
  .oge-brand-mark{width:30px!important;height:30px!important;border-radius:11px!important;font-size:12px!important;flex:0 0 auto!important}
  .oge-menu,.oge-submenu{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;gap:6px!important;width:100%!important;max-width:100%!important;padding:0 2px 3px!important;-webkit-overflow-scrolling:touch;scrollbar-width:none;scroll-snap-type:x proximity}
  .oge-menu::-webkit-scrollbar,.oge-submenu::-webkit-scrollbar{display:none}
  .oge-menu a,.oge-submenu a{flex:0 0 auto!important;min-height:38px!important;padding:9px 11px!important;font-size:12px!important;line-height:1!important;scroll-snap-align:start;white-space:nowrap!important}
  .oge-subbar-inner{width:calc(100% - 14px)!important;padding:6px 0 7px!important;display:block!important}
  .oge-subtitle{display:block!important;margin:0 0 5px!important;font-size:10px!important;letter-spacing:.08em!important}

  .oge-page{width:calc(100% - 14px)!important;margin:10px auto 38px!important}
  .oge-hero{padding:18px 16px!important;border-radius:22px!important;margin-bottom:10px!important}
  .oge-hero h1{font-size:31px!important;line-height:1.05!important;margin-bottom:8px!important}
  .oge-hero p{font-size:15px!important;line-height:1.45!important}
  .oge-grid{grid-template-columns:1fr!important;gap:10px!important}
  .oge-card{border-radius:20px!important;padding:16px!important;min-height:96px!important}
  .oge-card h2{font-size:21px!important;margin-top:4px!important}
  .oge-card p{font-size:14px!important;margin-bottom:10px!important}
  .oge-note{border-radius:16px!important;font-size:14px!important;padding:13px!important}

  /* Trainer pages */
  .wrap{width:calc(100% - 14px)!important;margin:10px auto 38px!important}
  .panel{border-radius:18px!important;padding:14px!important;margin-bottom:10px!important;box-shadow:0 7px 22px rgba(16,24,40,.07)!important}
  .top{align-items:stretch!important;gap:9px!important}
  .top>div{min-width:0!important}
  h1{font-size:22px!important;line-height:1.12!important;margin-bottom:5px!important;letter-spacing:-.035em!important}
  h2{font-size:19px!important;line-height:1.15!important}
  .small{font-size:12.5px!important;line-height:1.35!important}
  .controls{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;align-items:stretch!important}
  .controls select,.controls button{width:100%!important;min-height:44px!important;border-radius:13px!important;font-size:13px!important;padding:9px 10px!important}
  .stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin-top:10px!important}
  .stat{padding:8px 6px!important;border-radius:12px!important;min-width:0!important;text-align:center!important}
  .stat b{font-size:18px!important;line-height:1.1!important}
  .stat .small{font-size:10.5px!important;white-space:nowrap!important}
  .progress{height:8px!important;margin-top:9px!important}
  .badge{font-size:11px!important;line-height:1!important;min-height:30px!important;padding:6px 9px!important;white-space:normal!important}
  .prompt{font-size:16px!important;line-height:1.25!important;margin:8px 0!important}
  .question{font-size:17px!important;line-height:1.45!important;padding:12px!important;border-radius:16px!important;margin:8px 0!important;overflow-wrap:anywhere!important}
  .hint{font-size:13px!important;line-height:1.4!important;padding:10px!important;border-radius:14px!important;margin-top:8px!important}
  .options{grid-template-columns:1fr!important;gap:8px!important;margin:10px 0!important}
  .option{width:100%!important;min-height:50px!important;padding:12px!important;border-radius:14px!important;font-size:15px!important;line-height:1.35!important}
  .nav{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:10px!important}
  .nav button{width:100%!important;min-height:46px!important;border-radius:14px!important;padding:10px 12px!important;font-size:14px!important;line-height:1.1!important}
  .result{font-size:14px!important;line-height:1.45!important;border-radius:16px!important;padding:12px!important;margin-top:10px!important}
  .answer{font-size:14px!important;line-height:1.45!important;border-radius:13px!important;padding:11px 12px!important;margin:9px 0!important}
  .rule{font-size:14px!important;line-height:1.45!important;border-radius:13px!important;padding:11px!important}
  .help{grid-template-columns:1fr!important;gap:8px!important}
  .help-card,.help div{font-size:13px!important;line-height:1.4!important;border-radius:13px!important;padding:10px!important}

  /* Punctuation trainer: bigger tap targets for comma circles */
  .task{font-size:18px!important;line-height:2.22!important;letter-spacing:0!important;padding:13px!important;border-radius:16px!important;margin:10px 0!important;overflow-wrap:anywhere!important}
  .word{white-space:normal!important}
  .gap{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;margin:0 3px!important;border-width:2px!important;transform:translateY(5px)!important}
  .gap.selected::after,.gap.correct::after{font-size:20px!important;line-height:1!important}
  .gap.wrong::after{font-size:17px!important;line-height:1!important}
}

@media(max-width:390px){
  .controls{grid-template-columns:1fr!important}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .nav{grid-template-columns:1fr!important}
  .oge-hero h1{font-size:28px!important}
  .task{font-size:17px!important;line-height:2.25!important}
}

@media(orientation:landscape) and (max-width:932px){
  .oge-platform-header{position:relative!important}
  .oge-menu a,.oge-submenu a{min-height:34px!important;padding:8px 10px!important}
}

/* Legal / copyright footer */
.site-legal-footer{width:min(1100px,calc(100% - 24px));margin:18px auto 28px;color:#475467;font-size:13px;line-height:1.45}
.site-legal-footer__inner{background:#fff;border:1px solid #d8dee9;border-radius:18px;padding:14px 16px;box-shadow:0 8px 24px rgba(16,24,40,.06)}
.site-legal-footer b{display:block;color:#101828;margin-bottom:5px;font-weight:900}
.site-legal-footer p{margin:0}.site-legal-footer a{color:#1d4ed8;text-decoration:none;font-weight:800}.site-legal-footer a:hover{text-decoration:underline}
.legal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.legal-card{background:#fff;border:1px solid #d8dee9;border-radius:18px;padding:16px;box-shadow:0 8px 24px rgba(16,24,40,.06)}.legal-card h2{margin:0 0 8px;font-size:22px}.legal-card ul{margin:0;padding-left:19px;color:#475467;line-height:1.55}.legal-card p{color:#475467;line-height:1.55}.legal-badge{display:inline-flex;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:6px 10px;font-weight:900;font-size:12px;margin-bottom:10px}
@media(max-width:760px){.site-legal-footer{width:calc(100% - 14px);margin:12px auto 24px;font-size:12.5px}.site-legal-footer__inner{border-radius:16px;padding:13px}.legal-grid{grid-template-columns:1fr}.legal-card{border-radius:16px;padding:14px}}

/* Footer legal link: keep clickable, black like the footer text, but underlined */
.site-legal-footer a,
.site-legal-footer a:visited {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: inherit;
}
.site-legal-footer a:hover {
  text-decoration-thickness: 2px;
}
.site-legal-footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Legal page links: restrained, black, underlined */
.legal-card a,
.oge-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-card a:visited,
.oge-note a:visited {
  color: inherit;
}

/* Footer copyright: regular weight, not bold */
.site-legal-footer__inner > b {
  font-weight: 400;
}

/* Exam guide divider before legal footer */
.exam-guide {
  margin: 48px auto 26px;
  padding: 0 20px;
  max-width: 1120px;
}
.exam-guide__inner {
  border: 1px solid rgba(35, 35, 35, 0.10);
  background:
    radial-gradient(circle at top left, rgba(246, 238, 220, 0.85), transparent 38%),
    linear-gradient(180deg, #fbfaf7 0%, #f6f2ea 100%);
  border-radius: 24px;
  padding: 24px 26px 22px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.055);
}
.exam-guide__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #6f614d;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.exam-guide__label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}
.exam-guide p {
  margin: 0;
  max-width: 980px;
  color: #343434;
  font-size: 15.5px;
  line-height: 1.72;
}
.exam-guide p + p {
  margin-top: 8px;
}
.exam-guide__note {
  color: #5a5145;
}
@media (max-width: 720px) {
  .exam-guide {
    margin: 36px auto 22px;
    padding: 0 14px;
  }
  .exam-guide__inner {
    padding: 20px 18px;
    border-radius: 20px;
  }
  .exam-guide p {
    font-size: 14.5px;
  }
}

/* TrainerUp brand */
.oge-brand-word{display:inline-flex;align-items:baseline;letter-spacing:-.045em}
html[data-theme="dark"] .oge-brand-word{color:#f6f8fb}
html[data-theme="dark"] 
html[data-theme="dark"] .oge-brand-mark{background:transparent!important;box-shadow:0 8px 20px rgba(29,78,216,.24)!important}

/* ===== DARK MODE START ===== */

/* Toggle itself remains available in both themes */
.oge-platform-inner{position:relative}
.oge-theme-toggle{
  flex:0 0 auto;width:40px;height:40px;display:inline-grid;place-items:center;
  border:1px solid #d8dee9;border-radius:999px;background:#fff;color:#344054;
  cursor:pointer;padding:0;box-shadow:0 5px 16px rgba(16,24,40,.07);
  transition:background .18s,border-color .18s,color .18s,transform .12s;
  font:inherit;-webkit-tap-highlight-color:transparent;
}
.oge-theme-toggle:hover{transform:translateY(-1px);background:#f8fafc;border-color:#c7d0dd}
.oge-theme-toggle:focus-visible{outline:3px solid rgba(37,99,235,.28);outline-offset:2px}
.oge-theme-icon{font-size:18px;line-height:1;transform:translateY(-1px)}

/* Core dark palette */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#080d14;
  --card:#111923;
  --ink:#edf2f7;
  --muted:#a8b3c2;
  --line:#2c3949;
  --blue:#5b8cff;
  --blue2:#14243d;
  --green:#66d9ad;
  --green2:#102c25;
  --red:#ff9aa9;
  --red2:#351820;
  --amber:#ffc878;
  --amber2:#34250f;
  --dark:#05080d;
  --shadow:0 12px 34px rgba(0,0,0,.32);
  background:#080d14 !important;
}
html[data-theme="dark"] body{
  background:#080d14 !important;
  color:#edf2f7 !important;
}

/* Every actually-light UI surface found in the current site becomes dark.
   This list is generated from the site's own page CSS so old trainers are covered too. */
html[data-theme="dark"] .anchor-nav a,
html[data-theme="dark"] .answer-template,
html[data-theme="dark"] .bad,
html[data-theme="dark"] .card,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .compact-toolbar button,
html[data-theme="dark"] .compact-toolbar button.active,
html[data-theme="dark"] .culture-card,
html[data-theme="dark"] .culture-note,
html[data-theme="dark"] .culture-text-card,
html[data-theme="dark"] .exam-guide__inner,
html[data-theme="dark"] .filter-box,
html[data-theme="dark"] .formula,
html[data-theme="dark"] .gap,
html[data-theme="dark"] .good,
html[data-theme="dark"] .help div,
html[data-theme="dark"] .help-card,
html[data-theme="dark"] .hero::after,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .hist-nav a,
html[data-theme="dark"] .hist-note,
html[data-theme="dark"] .hist-period,
html[data-theme="dark"] .hist-period-head span,
html[data-theme="dark"] .hist-topic-card,
html[data-theme="dark"] .hist-topic-card span,
html[data-theme="dark"] .hist-topic-card:hover,
html[data-theme="dark"] .image-modal__close,
html[data-theme="dark"] .image-modal__hint,
html[data-theme="dark"] .image-modal__img,
html[data-theme="dark"] .image-modal__link,
html[data-theme="dark"] .kbd,
html[data-theme="dark"] .legal-badge,
html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .mark.cause,
html[data-theme="dark"] .mark.date,
html[data-theme="dark"] .mark.effect,
html[data-theme="dark"] .mark.essay,
html[data-theme="dark"] .mark.event,
html[data-theme="dark"] .mark.map,
html[data-theme="dark"] .mark.mistake,
html[data-theme="dark"] .mark.person,
html[data-theme="dark"] .mark.source,
html[data-theme="dark"] .mark.term,
html[data-theme="dark"] .media-card,
html[data-theme="dark"] .memory,
html[data-theme="dark"] .mini-table,
html[data-theme="dark"] .mini-table th,
html[data-theme="dark"] .modal__close,
html[data-theme="dark"] .modal__dialog,
html[data-theme="dark"] .next,
html[data-theme="dark"] .oge-card,
html[data-theme="dark"] .oge-card:hover,
html[data-theme="dark"] .oge-chip,
html[data-theme="dark"] .oge-hero,
html[data-theme="dark"] .oge-menu a,
html[data-theme="dark"] .oge-menu a:hover,
html[data-theme="dark"] .oge-note,
html[data-theme="dark"] .oge-platform-header,
html[data-theme="dark"] .oge-subbar,
html[data-theme="dark"] .oge-submenu a,
html[data-theme="dark"] .oge-submenu a:hover,
html[data-theme="dark"] .opt,
html[data-theme="dark"] .opt.correct,
html[data-theme="dark"] .opt.wrong,
html[data-theme="dark"] .opt:hover,
html[data-theme="dark"] .option,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .person-card,
html[data-theme="dark"] .person-chip,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .progress,
html[data-theme="dark"] .qbox,
html[data-theme="dark"] .question,
html[data-theme="dark"] .question-link a,
html[data-theme="dark"] .question-link a:hover,
html[data-theme="dark"] .result.bad,
html[data-theme="dark"] .result.ok,
html[data-theme="dark"] .rule,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .section-nav a,
html[data-theme="dark"] .signal,
html[data-theme="dark"] .site-legal-footer__inner,
html[data-theme="dark"] .source,
html[data-theme="dark"] .source-box,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .sticky-note,
html[data-theme="dark"] .story,
html[data-theme="dark"] .story-check .item,
html[data-theme="dark"] .storyline span,
html[data-theme="dark"] .task,
html[data-theme="dark"] .term-card,
html[data-theme="dark"] .term-chip,
html[data-theme="dark"] .term-timeline div,
html[data-theme="dark"] .territory-box,
html[data-theme="dark"] .text-card,
html[data-theme="dark"] .time-row,
html[data-theme="dark"] .timeline .row,
html[data-theme="dark"] .timeline div,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .toc-note,
html[data-theme="dark"] .toolbar button,
html[data-theme="dark"] .toolbar button.active,
html[data-theme="dark"] .topic-note,
html[data-theme="dark"] .trainer-panel .qbox,
html[data-theme="dark"] .violet,
html[data-theme="dark"] /* Cleaner trainer UI */
.trainer-panel,
html[data-theme="dark"] button.print,
html[data-theme="dark"] details,
html[data-theme="dark"] select,
html[data-theme="dark"] table,
html[data-theme="dark"] th{
  background:#111923 !important;
  background-image:none !important;
  border-color:#2c3949 !important;
  color:#e8eef5 !important;
  box-shadow:none;
}

/* Explicit old dark-gray text becomes readable on dark surfaces */
html[data-theme="dark"] .anchor-nav a,
html[data-theme="dark"] .compact-toolbar button,
html[data-theme="dark"] .compact-toolbar button.active,
html[data-theme="dark"] .culture-card figcaption,
html[data-theme="dark"] .culture-card figcaption b,
html[data-theme="dark"] .culture-note,
html[data-theme="dark"] .exam-guide p,
html[data-theme="dark"] .exam-guide__label,
html[data-theme="dark"] .exam-guide__note,
html[data-theme="dark"] .formula,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .hist-nav a,
html[data-theme="dark"] .hist-period-head p,
html[data-theme="dark"] .hist-topic-card,
html[data-theme="dark"] .hist-topic-card p,
html[data-theme="dark"] .image-modal__close,
html[data-theme="dark"] .image-modal__link,
html[data-theme="dark"] .lead,
html[data-theme="dark"] .legal-card p,
html[data-theme="dark"] .legal-card ul,
html[data-theme="dark"] .media-card figcaption,
html[data-theme="dark"] .media-card figcaption b,
html[data-theme="dark"] .mini-table th,
html[data-theme="dark"] .modal__desc,
html[data-theme="dark"] .modal__title,
html[data-theme="dark"] .next,
html[data-theme="dark"] .oge-brand,
html[data-theme="dark"] .oge-card,
html[data-theme="dark"] .oge-card p,
html[data-theme="dark"] .oge-hero p,
html[data-theme="dark"] .oge-menu a,
html[data-theme="dark"] .oge-muted,
html[data-theme="dark"] .oge-note,
html[data-theme="dark"] .oge-page,
html[data-theme="dark"] .oge-platform-header,
html[data-theme="dark"] .oge-submenu a,
html[data-theme="dark"] .oge-subtitle,
html[data-theme="dark"] .person-card b,
html[data-theme="dark"] .person-card small,
html[data-theme="dark"] .person-chip,
html[data-theme="dark"] .qcat,
html[data-theme="dark"] .qmedia .cap,
html[data-theme="dark"] .qmedia small,
html[data-theme="dark"] .qmedia-caption,
html[data-theme="dark"] .question-link,
html[data-theme="dark"] .question-link a,
html[data-theme="dark"] .question-link a:hover,
html[data-theme="dark"] .question-media small,
html[data-theme="dark"] .rule,
html[data-theme="dark"] .rule b,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .section-nav a,
html[data-theme="dark"] .site-legal-footer b,
html[data-theme="dark"] .small-note,
html[data-theme="dark"] .sticky-note,
html[data-theme="dark"] .story,
html[data-theme="dark"] .story-check b,
html[data-theme="dark"] .storyline span,
html[data-theme="dark"] .term-card b,
html[data-theme="dark"] .term-card small,
html[data-theme="dark"] .timeline b,
html[data-theme="dark"] .timeline-item b,
html[data-theme="dark"] .timeline-item small,
html[data-theme="dark"] .toolbar button,
html[data-theme="dark"] .toolbar button.active,
html[data-theme="dark"] .trainer-panel .qcat,
html[data-theme="dark"] .trainer-panel .qtext,
html[data-theme="dark"] /* Legal / copyright footer */
.site-legal-footer,
html[data-theme="dark"] button.print,
html[data-theme="dark"] summary,
html[data-theme="dark"] th{
  color:#e8eef5 !important;
}

/* Content links */
html[data-theme="dark"] body a { color:#8fbaff; }
html[data-theme="dark"] body a:visited { color:#b6a8ff; }

/* Navigation */
html[data-theme="dark"] .oge-platform-header{
  background:#0d141e !important;color:#edf2f7 !important;
  border-bottom-color:#263244 !important;box-shadow:0 8px 28px rgba(0,0,0,.30) !important;
}
html[data-theme="dark"] .oge-brand{color:#f6f8fb !important}
html[data-theme="dark"] .oge-brand-mark{background:#27364b !important;color:#fff !important;box-shadow:none !important}
html[data-theme="dark"] .oge-menu a,
html[data-theme="dark"] .oge-submenu a{
  background:#121b27 !important;border-color:#2c3949 !important;color:#c5cfdb !important;
}
html[data-theme="dark"] .oge-menu a:hover,
html[data-theme="dark"] .oge-submenu a:hover{
  background:#192638 !important;border-color:#405875 !important;color:#dbeafe !important;
}
html[data-theme="dark"] .oge-menu a.active,
html[data-theme="dark"] .oge-submenu a.active{
  background:#2a4263 !important;color:#fff !important;border-color:#4c6f9c !important;
}
html[data-theme="dark"] .oge-subbar{
  border-top-color:#222d3a !important;background:#0d141e !important;
}
html[data-theme="dark"] .oge-subtitle{color:#95a3b5 !important}
html[data-theme="dark"] .oge-theme-toggle{
  background:#141e2a !important;border-color:#334155 !important;color:#f8fafc !important;
  box-shadow:0 5px 16px rgba(0,0,0,.24) !important;
}
html[data-theme="dark"] .oge-theme-toggle:hover{background:#1b2939 !important;border-color:#4a607b !important}

/* Main shared pages */
html[data-theme="dark"] .oge-page{color:#edf2f7 !important}
html[data-theme="dark"] .oge-hero{
  background:#111923 !important;background-image:none !important;
  border-color:#2c3949 !important;color:#edf2f7 !important;
  box-shadow:0 12px 30px rgba(0,0,0,.24) !important;
}
html[data-theme="dark"] .oge-hero p,
html[data-theme="dark"] .oge-card p,
html[data-theme="dark"] .oge-muted,
html[data-theme="dark"] .small,
html[data-theme="dark"] .muted{color:#a8b3c2 !important}
html[data-theme="dark"] .oge-card,
html[data-theme="dark"] .oge-note{
  background:#111923 !important;background-image:none !important;border-color:#2c3949 !important;
  color:#edf2f7 !important;box-shadow:0 10px 28px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] .oge-card:hover{background:#151f2c !important;border-color:#3c5979 !important}

/* Generic trainer panels */
html[data-theme="dark"] :is(
  .panel,.card,.task,.rule,.stat,.qbox,.question,.filter-box,.source-box,.territory-box,
  .answer-template,.person-card,.term-card,.culture-card,.culture-text-card,.media-card,
  .map-card,.timeline-item,.topic-note,.help-card,.modal__dialog,.image-modal__dialog
){
  background:#111923 !important;background-image:none !important;
  border-color:#2c3949 !important;color:#e8eef5 !important;
  box-shadow:0 10px 28px rgba(0,0,0,.20) !important;
}
html[data-theme="dark"] .help > div,
html[data-theme="dark"] .help div{
  background:#111923 !important;border-color:#2c3949 !important;color:#dce4ee !important;
}
html[data-theme="dark"] .kbd{
  background:#1a2533 !important;border-color:#3a485a !important;color:#dce6f2 !important;
}
html[data-theme="dark"] .gap{
  background:#16202c !important;border-color:#566477 !important;
}
html[data-theme="dark"] .gap:hover{background:#1b3150 !important;border-color:#6da0e8 !important}
html[data-theme="dark"] .gap.selected{background:#356ee6 !important;border-color:#5b8cff !important;color:#fff !important}
html[data-theme="dark"] .gap.correct{background:#17684e !important;border-color:#55c99d !important;color:#fff !important}
html[data-theme="dark"] .gap.wrong{background:#7a2638 !important;border-color:#f27f95 !important;color:#fff !important}

/* Buttons / controls */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background:#121b27 !important;color:#e7edf5 !important;border-color:#334155 !important;
}
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .toolbar button,
html[data-theme="dark"] .compact-toolbar button,
html[data-theme="dark"] .next{
  background:#182333 !important;color:#dde6f1 !important;border-color:#334155 !important;
}
html[data-theme="dark"] .secondary:hover,
html[data-theme="dark"] .toolbar button:hover,
html[data-theme="dark"] .compact-toolbar button:hover{background:#203047 !important}
html[data-theme="dark"] .ghost{color:#72a3ff !important}
html[data-theme="dark"] .primary{background:#356ee6 !important;color:#fff !important}
html[data-theme="dark"] .danger{background:#431923 !important;color:#ffafbd !important}
html[data-theme="dark"] .toolbar button.active{
  background:#294972 !important;border-color:#4c78ad !important;color:#fff !important;
}

/* Options, results, status colors */
html[data-theme="dark"] .opt,
html[data-theme="dark"] .option{
  background:#121b27 !important;border-color:#334155 !important;color:#e8eef5 !important;
}
html[data-theme="dark"] .opt:hover,
html[data-theme="dark"] .option:hover{background:#19283b !important;border-color:#496a91 !important}
html[data-theme="dark"] :is(.opt.correct,.option.correct,.result.ok,.good){
  background:#102f27 !important;border-color:#2c745e !important;color:#b9f3da !important;
}
html[data-theme="dark"] :is(.opt.wrong,.option.wrong,.result.bad,.bad){
  background:#361820 !important;border-color:#814151 !important;color:#ffc2cc !important;
}
html[data-theme="dark"] .warn{
  background:#34250f !important;border-color:#73552a !important;color:#ffe0a3 !important;
}
html[data-theme="dark"] .violet{
  background:#251d3d !important;border-color:#564779 !important;color:#e4ddff !important;
}
html[data-theme="dark"] :is(.formula,.sticky-note,.hint,.topic-note){
  background:#14243d !important;border-color:#315780 !important;color:#c8ddff !important;
}
html[data-theme="dark"] .answer{background:#05080d !important;color:#f8fafc !important}
html[data-theme="dark"] .progress{background:#263244 !important}

/* Chips and small cards */
html[data-theme="dark"] :is(.badge,.chip,.person-chip,.term-chip,.storyline span,.hist-period-head span,.hist-topic-card span,.oge-chip){
  background:#14243d !important;border-color:#315780 !important;color:#a9caff !important;
}
html[data-theme="dark"] .badge.hard{
  background:#34250f !important;border-color:#73552a !important;color:#ffd28a !important;
}
html[data-theme="dark"] .section-nav a{
  background:#14243d !important;border-color:#315780 !important;color:#b3d1ff !important;
}

/* History overview */
html[data-theme="dark"] :is(.hist-nav a,.hist-period,.hist-topic-card){
  background:#111923 !important;border-color:#2c3949 !important;color:#e8eef5 !important;
  box-shadow:none !important;
}
html[data-theme="dark"] .hist-topic-card:hover{background:#162130 !important;border-color:#405875 !important}
html[data-theme="dark"] :is(.hist-period-head p,.hist-topic-card p){color:#a8b3c2 !important}
html[data-theme="dark"] .hist-note{
  background:#34250f !important;border-color:#73552a !important;color:#ffe0a3 !important;
}

/* The divider memo must be dark too */
html[data-theme="dark"] .exam-guide__inner{
  background:#101720 !important;background-image:none !important;
  border-color:#2c3949 !important;box-shadow:0 12px 30px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] .exam-guide__label{color:#aebaca !important}
html[data-theme="dark"] .exam-guide p,
html[data-theme="dark"] .exam-guide__note{color:#c3ccd8 !important}
html[data-theme="dark"] .exam-guide strong,
html[data-theme="dark"] .exam-guide b{color:#f2f5f8 !important}

/* Footer: no white island */
html[data-theme="dark"] .site-legal-footer{color:#9ba8b9 !important;border-top-color:#263244 !important}
html[data-theme="dark"] .site-legal-footer__inner{
  background:#0f1722 !important;background-image:none !important;
  border-color:#2c3949 !important;box-shadow:none !important;
}
html[data-theme="dark"] .site-legal-footer b{color:#edf2f7 !important}
html[data-theme="dark"] .site-legal-footer p{color:#9ba8b9 !important}
html[data-theme="dark"] .site-legal-footer a,
html[data-theme="dark"] .site-legal-footer a:visited{color:#b9c7d8 !important}

/* Terms */
html[data-theme="dark"] .legal-card{
  background:#111923 !important;border-color:#2c3949 !important;color:#e8eef5 !important;
  box-shadow:0 10px 28px rgba(0,0,0,.20) !important;
}
html[data-theme="dark"] .legal-card p,
html[data-theme="dark"] .legal-card li{color:#b0bbc9 !important}
html[data-theme="dark"] .legal-badge{
  background:#14243d !important;border-color:#315780 !important;color:#a9caff !important;
}

/* Modals and overlays */
html[data-theme="dark"] :is(.modal,.image-modal){background:rgba(2,6,12,.90) !important}
html[data-theme="dark"] :is(.modal__dialog,.image-modal__dialog){
  background:#0f1722 !important;border-color:#2c3949 !important;color:#e8eef5 !important;
}
html[data-theme="dark"] :is(.modal__top,.modal__bottom){border-color:#2c3949 !important}
html[data-theme="dark"] :is(.modal__title,.modal__desc){color:#e8eef5 !important}
html[data-theme="dark"] :is(.modal__close,.image-modal__close,.image-modal__link){
  background:#172230 !important;border-color:#36475d !important;color:#f5f7fa !important;
}
html[data-theme="dark"] .modal__bottom a{color:#9cc5ff !important}

/* Image canvases keep the image itself natural, but the surrounding canvas is no longer white */
html[data-theme="dark"] :is(.modal__imageWrap,.qmedia,.question-media,.map-wrap){
  background:#0b1119 !important;border-color:#2c3949 !important;
}
html[data-theme="dark"] :is(.media-card img,.culture-card img,.qmedia img,.question-media img,.map-img,.visual-card-img,.modal__image,.image-modal__img){
  background:#0b1119 !important;
}

/* Dark scrollbars */
html[data-theme="dark"]{scrollbar-color:#40516a #111923}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:#111923 !important}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#40516a !important}
html[data-theme="dark"] ::selection{background:#315a89;color:#fff}

/* Smooth switch */
html.oge-theme-transition body,
html.oge-theme-transition .oge-platform-header,
html.oge-theme-transition .panel,
html.oge-theme-transition .card,
html.oge-theme-transition .oge-card,
html.oge-theme-transition .hist-period,
html.oge-theme-transition .hist-topic-card,
html.oge-theme-transition .legal-card,
html.oge-theme-transition .exam-guide__inner,
html.oge-theme-transition .site-legal-footer__inner{
  transition:background-color .20s,color .20s,border-color .20s,box-shadow .20s;
}

@media(max-width:932px){
  .oge-brand{padding-right:46px}
  .oge-theme-toggle{position:absolute;right:0;top:7px;width:36px;height:36px;z-index:2}
}
@media(max-width:520px){.oge-theme-toggle{right:0}}
/* ===== DARK MODE END ===== */

/* Minimal legal footer */
.site-legal-footer__inner {
  font-weight: 400;
}
.site-legal-footer a,
.site-legal-footer a:visited {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 400;
}
.site-legal-footer a:hover {
  text-decoration-thickness: 2px;
}
