:root {
  --primary: #2f6280;
  --primary-dark: #244d65;
  --accent: #14766f;
  --navy: #10283b;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-soft: #eaf0f4;
  --text: #14212c;
  --muted: #526473;
  --line: #cdd7df;
  --chrome-start: #112638;
  --chrome-end: #23465a;
  --footer-bg: #e8edf1;
  --footer-border: #bdc9d1;
  --footer-text: #334653;
  --footer-link: #24566c;
  --fixed-footer-height: 82px;
}

html[data-ntt-accent='steel'] {
  --primary: #2f6280;
  --primary-dark: #244d65;
  --accent: #14766f;
  --surface-soft: #eaf0f4;
  --chrome-start: #112638;
  --chrome-end: #23465a;
  --footer-link: #24566c;
}

html[data-ntt-accent='teal'] {
  --primary: #176f68;
  --primary-dark: #11564f;
  --accent: #2b867d;
  --surface-soft: #e8f3f1;
  --chrome-start: #122d2d;
  --chrome-end: #23524e;
  --footer-link: #17645e;
}

html[data-ntt-accent='blue'] {
  --primary: #285f91;
  --primary-dark: #1e4971;
  --accent: #3f7da9;
  --surface-soft: #e8f0f6;
  --chrome-start: #11283d;
  --chrome-end: #224b69;
  --footer-link: #24587f;
}

html[data-ntt-accent='indigo'] {
  --primary: #505b8b;
  --primary-dark: #3e476d;
  --accent: #6974a1;
  --surface-soft: #eceef5;
  --chrome-start: #202438;
  --chrome-end: #383e5d;
  --footer-link: #4b557d;
}

html[data-ntt-accent='green'] {
  --primary: #3f7255;
  --primary-dark: #315a43;
  --accent: #58866a;
  --surface-soft: #ebf2ed;
  --chrome-start: #172b22;
  --chrome-end: #31503e;
  --footer-link: #38684c;
}

body,
html[data-ntt-theme='light'] body,
html[data-ntt-theme='system'] body {
  color: var(--text);
  background: var(--bg);
}

.site-header {
  background: linear-gradient(105deg, var(--chrome-start), var(--chrome-end));
  border-bottom-color: rgba(255, 255, 255, .14);
  box-shadow: 0 7px 20px rgba(8, 21, 31, .2);
}

.brand,
.brand strong,
.brand small,
.main-nav a,
.header-action,
.nav-toggle {
  color: #f7fbfd;
}

.brand small { color: #d6e2e8; }

.brand-mark {
  color: var(--primary-dark);
  background: #f8fafb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .14);
}

.nav-toggle,
.header-action {
  min-height: 38px;
  padding: .45rem .72rem;
  border: 1px solid rgba(255, 255, 255, .30);
  border-radius: 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, .07);
  font-weight: 700;
}

.nav-toggle:hover,
.header-action:hover,
.header-action:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, .17);
}

.language-indicator { min-width: 48px; }

.hero,
html[data-ntt-theme='light'] .hero,
html[data-ntt-theme='system'] .hero {
  color: var(--text);
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 34%),
    radial-gradient(circle at 12% 80%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 28%),
    linear-gradient(180deg, #ffffff, var(--bg));
}

.page-hero,
html[data-ntt-theme='light'] .page-hero,
html[data-ntt-theme='system'] .page-hero {
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--bg));
}

h1, h2, h3,
.panel-head,
.learning-cycle strong,
.feature-card h3,
.module-card h3,
.question-card legend,
.sidebar strong {
  color: var(--text);
}

h1 span,
.eyebrow,
.text-link,
.feature-number {
  color: var(--primary);
}

.hero-copy,
.hero-points,
.learning-cycle small,
.feature-card p,
.module-card p,
.section-heading > p:last-child,
.page-hero p:last-child,
.sidebar a {
  color: var(--muted);
}

.hero-panel,
.feature-card,
.module-card,
.question-card,
.sidebar,
.table-wrap,
.topic-grid a,
.option,
.section-muted {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.hero-panel {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 48px rgba(25, 45, 58, .13);
}

.hero-panel .panel-head,
.hero-panel .panel-head strong,
.hero-panel .learning-cycle strong {
  color: #182733;
}

.hero-panel .learning-cycle small { color: #617381; }
.hero-panel .progress { background: #dce5eb; }

.learning-cycle li > span {
  color: var(--primary-dark);
  background: var(--surface-soft);
}

.feature-card,
.module-card,
.question-card,
.topic-grid a {
  box-shadow: 0 7px 22px rgba(26, 44, 55, .06);
}

.option {
  color: #263846;
  background: #f0f4f6;
}

.button.primary,
.settings-save {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 24%, transparent);
}

.button.primary:hover,
.settings-save:hover {
  color: #ffffff;
  background: var(--primary-dark);
}

.button.secondary,
.button.light {
  color: #1c2c38;
  border-color: var(--line);
  background: #ffffff;
}

.button.secondary:hover,
.button.light:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: #f8fafb;
}

.progress span {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.cta-card {
  color: #ffffff;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary), var(--accent));
}

.cta-card h2,
.cta-card p,
.cta-card .eyebrow { color: #ffffff; }

.note { color: #183250; background: #eaf2fa; }
.warning { color: #5e3a05; background: #fff4df; }
.success { color: #164b3f; background: #e5f4ef; }

.settings-dialog::backdrop {
  background: rgba(10, 22, 31, .68);
}

.settings-dialog {
  width: min(720px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  padding: 24px;
  color: #182733;
  border-color: #c2ced6;
  border-radius: 16px;
  background: #f8fafb;
}

.settings-dialog__header { margin-bottom: 18px; }
.settings-dialog__header h2 { color: #182733; font-size: 1.55rem; }
.settings-dialog__header p { color: #5d707e; }
.settings-fields { gap: 8px; }

.settings-row {
  grid-template-columns: minmax(190px, .9fr) minmax(190px, 1.1fr);
  gap: 16px;
  padding: 9px 0;
  color: #263946;
  border-bottom: 1px solid #dce3e8;
}

.settings-row__label { display: grid; gap: 2px; }
.settings-row__label strong { color: #263946; font-size: .9rem; }
.settings-row__label small { color: #687a86; font-size: .74rem; font-weight: 400; line-height: 1.35; }

.settings-row select,
.settings-close,
.settings-reset {
  color: #1f3340;
  border-color: #b9c7d0;
  background: #ffffff;
}

.settings-row select { min-height: 42px; border-radius: 9px; }
.settings-data-actions { margin-top: 14px; }

.settings-clear-progress {
  min-height: 38px;
  padding: .5rem .75rem;
  border: 1px solid #c78e97;
  border-radius: 8px;
  color: #82343f;
  background: #fff5f6;
  font-weight: 700;
}

.settings-actions { margin-top: 16px; padding-top: 14px; }
.settings-save, .settings-reset { min-height: 40px; border-radius: 9px; }

.site-footer {
  height: var(--fixed-footer-height);
  padding: .45rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--footer-text);
  border-top: 1px solid var(--footer-border);
  background: rgba(232, 237, 241, .98);
  box-shadow: 0 -.3rem 1rem rgba(30, 47, 58, .07);
}

.site-footer::before {
  width: min(12rem, 38vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.site-footer .ecosystem-footer__copyright {
  position: absolute;
  left: max(.8rem, 2vw);
  margin: 0;
  color: var(--footer-text);
  font-size: .7rem;
  line-height: 1.1;
  white-space: nowrap;
}

.ecosystem-footer__navigation {
  max-width: calc(100% - 440px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.site-footer .ecosystem-footer__link {
  min-height: 26px;
  padding: .04rem .08rem;
  color: var(--footer-link);
  background: transparent;
  font-size: .7rem;
  font-weight: 600;
  text-underline-offset: .18em;
}

.site-footer .ecosystem-footer__link + .ecosystem-footer__link { margin-left: .82rem; }
.site-footer .ecosystem-footer__link + .ecosystem-footer__link::before {
  left: -.47rem;
  color: color-mix(in srgb, var(--footer-link) 45%, transparent);
}

.site-footer .ecosystem-footer__link:hover,
.site-footer .ecosystem-footer__link:focus-visible,
.site-footer .footer-pdf-button,
.site-footer .footer-pdf-button:hover,
.site-footer .footer-pdf-button:focus-visible {
  color: var(--primary-dark);
}

.ecosystem-footer__version {
  right: max(.65rem, 1.5vw);
  bottom: .25rem;
  color: #5f707b;
  font-size: .55rem;
}

.site-footer .footer-layout {
  width: min(calc(100% - 32px), var(--container));
}

.site-footer .footer-disclaimer {
  max-width: 650px;
  margin: 0;
  color: var(--footer-text);
  font-size: .74rem;
  line-height: 1.35;
}

.site-footer .footer-links {
  justify-content: center;
}

.site-footer .footer-links a {
  display: inline;
  margin: 0;
  color: var(--footer-link);
  font-size: .72rem;
  font-weight: 700;
  text-underline-offset: .18em;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible {
  color: var(--primary-dark);
}

.site-footer .footer-status {
  padding: .2rem .5rem;
  border: 1px solid var(--footer-border);
  border-radius: 999px;
  color: var(--footer-text);
  font-size: .7rem;
  line-height: 1;
}

html[data-ntt-theme='dark'] {
  --bg: #0f1820;
  --surface: #19252e;
  --surface-soft: #23323c;
  --text: #f0f5f7;
  --muted: #bac7ce;
  --line: #43535e;
  --footer-bg: #18232b;
  --footer-border: #43515a;
  --footer-text: #d1dbe0;
  --footer-link: #a8d3d0;
}

html[data-ntt-theme='dark'] body,
html[data-ntt-theme='dark'] .hero,
html[data-ntt-theme='dark'] .page-hero {
  color: var(--text);
  background: linear-gradient(180deg, #122231, var(--bg));
}

html[data-ntt-theme='dark'] h1,
html[data-ntt-theme='dark'] h2,
html[data-ntt-theme='dark'] h3,
html[data-ntt-theme='dark'] .panel-head,
html[data-ntt-theme='dark'] .learning-cycle strong,
html[data-ntt-theme='dark'] .feature-card h3,
html[data-ntt-theme='dark'] .module-card h3,
html[data-ntt-theme='dark'] .question-card legend,
html[data-ntt-theme='dark'] .sidebar strong {
  color: var(--text);
}

html[data-ntt-theme='dark'] .hero-copy,
html[data-ntt-theme='dark'] .hero-points,
html[data-ntt-theme='dark'] .learning-cycle small,
html[data-ntt-theme='dark'] .feature-card p,
html[data-ntt-theme='dark'] .module-card p,
html[data-ntt-theme='dark'] .section-heading > p:last-child,
html[data-ntt-theme='dark'] .page-hero p:last-child,
html[data-ntt-theme='dark'] .sidebar a {
  color: var(--muted);
}

html[data-ntt-theme='dark'] .hero-panel,
html[data-ntt-theme='dark'] .feature-card,
html[data-ntt-theme='dark'] .module-card,
html[data-ntt-theme='dark'] .question-card,
html[data-ntt-theme='dark'] .sidebar,
html[data-ntt-theme='dark'] .table-wrap,
html[data-ntt-theme='dark'] .topic-grid a,
html[data-ntt-theme='dark'] .option,
html[data-ntt-theme='dark'] .section-muted {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

html[data-ntt-theme='dark'] .hero-panel .panel-head,
html[data-ntt-theme='dark'] .hero-panel .panel-head strong,
html[data-ntt-theme='dark'] .hero-panel .learning-cycle strong {
  color: #f0f5f7;
}

html[data-ntt-theme='dark'] .hero-panel .learning-cycle small { color: #bac7ce; }
html[data-ntt-theme='dark'] .hero-panel .progress { background: #364751; }
html[data-ntt-theme='dark'] .option { color: #e4ecef; background: #22313a; }

html[data-ntt-theme='dark'] .button.secondary,
html[data-ntt-theme='dark'] .button.light {
  color: #edf3f5;
  border-color: #53636d;
  background: #22313a;
}

html[data-ntt-theme='dark'] .site-footer {
  color: var(--footer-text);
  border-color: var(--footer-border);
  background: rgba(24, 35, 43, .98);
}

html[data-ntt-theme='dark'] .site-footer .ecosystem-footer__copyright,
html[data-ntt-theme='dark'] .ecosystem-footer__version { color: var(--footer-text); }
html[data-ntt-theme='dark'] .site-footer .ecosystem-footer__link { color: var(--footer-link); }
html[data-ntt-theme='dark'] .site-footer .footer-disclaimer,
html[data-ntt-theme='dark'] .site-footer .footer-status { color: var(--footer-text); }
html[data-ntt-theme='dark'] .site-footer .footer-links a { color: var(--footer-link); }
html[data-ntt-theme='dark'] .is-correct .question-feedback { color: #8ed8cb; }
html[data-ntt-theme='dark'] .is-incorrect .question-feedback { color: #ffabb4; }

html[data-ntt-theme='dark'] .settings-dialog {
  color: #eef4f6;
  border-color: #465761;
  background: #18252d;
}

html[data-ntt-theme='dark'] .settings-dialog__header h2,
html[data-ntt-theme='dark'] .settings-row__label strong { color: #f0f5f7; }
html[data-ntt-theme='dark'] .settings-dialog__header p,
html[data-ntt-theme='dark'] .settings-row__label small { color: #b7c5cc; }
html[data-ntt-theme='dark'] .settings-row { color: #e8eef1; border-color: #344650; }
html[data-ntt-theme='dark'] .settings-row select,
html[data-ntt-theme='dark'] .settings-close,
html[data-ntt-theme='dark'] .settings-reset {
  color: #f0f5f7;
  border-color: #52656f;
  background: #24343d;
}

html[data-ntt-font='sans'] body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html[data-ntt-font='serif'] body { font-family: Georgia, "Times New Roman", serif; }
html[data-ntt-font='system'] body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
html[data-ntt-font='mono'] body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

html[data-ntt-text='small'] { font-size: 93.75%; }
html[data-ntt-text='default'] { font-size: 100%; }
html[data-ntt-text='large'] { font-size: 112.5%; }
html[data-ntt-text='xlarge'] { font-size: 125%; }

html[data-ntt-width='narrow'] { --container: 980px; }
html[data-ntt-width='standard'] { --container: 1180px; }
html[data-ntt-width='wide'] { --container: 1380px; }

html[data-ntt-spacing='compact'] .section { padding-block: 56px; }
html[data-ntt-spacing='compact'] .content-layout { padding-block: 36px 62px; }
html[data-ntt-spacing='spacious'] .section { padding-block: 108px; }
html[data-ntt-spacing='spacious'] .content-layout { padding-block: 72px 112px; }

html[data-ntt-contrast='high'] { --text: #07131b; --muted: #32424d; --line: #87969f; }
html[data-ntt-theme='dark'][data-ntt-contrast='high'] { --text: #ffffff; --muted: #d6e0e5; --line: #6f818c; }

html[data-ntt-sidebar='hide'] .sidebar { display: none; }
html[data-ntt-sidebar='hide'] .content-layout { grid-template-columns: minmax(0, 1fr); }
html[data-ntt-sidebar='show'] .sidebar { display: block; }

html[data-ntt-motion='reduced'] { scroll-behavior: auto; }
html[data-ntt-motion='reduced'] *,
html[data-ntt-motion='reduced'] *::before,
html[data-ntt-motion='reduced'] *::after {
  animation-duration: .01ms !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}

@media (max-width: 1100px) {
  :root { --fixed-footer-height: 98px; }
  .site-footer { flex-direction: column; gap: .02rem; padding-block: .25rem; }
  .site-footer .ecosystem-footer__copyright { position: static; font-size: .67rem; }
  .ecosystem-footer__navigation { max-width: calc(100% - 140px); flex-wrap: wrap; }
  .site-footer .footer-layout { grid-template-columns: 1fr auto; gap: 5px 16px; }
  .site-footer .footer-disclaimer { grid-column: 1 / -1; max-width: none; text-align: center; }
}

@media (max-width: 840px) {
  :root { --fixed-footer-height: 122px; }
  .main-nav { color: #14212c; background: #ffffff; }
  .main-nav a { color: #526473; }
  .main-nav a:hover, .main-nav a.active { color: var(--primary-dark); background: var(--surface-soft); }
  .settings-row { grid-template-columns: 1fr; gap: 5px; }
  .ecosystem-footer__navigation { max-width: 100%; }
  .site-footer .footer-layout { grid-template-columns: 1fr; justify-items: center; gap: 5px; }
  .site-footer .footer-links { justify-content: center; }
  .site-footer .footer-status { display: none; }
}

@media (max-width: 560px) {
  :root { --fixed-footer-height: 148px; }
  .site-footer .ecosystem-footer__link { min-height: 23px; font-size: .67rem; }
  .site-footer .ecosystem-footer__link + .ecosystem-footer__link { margin-left: 0; }
  .site-footer .ecosystem-footer__link + .ecosystem-footer__link::before { display: none; }
  .ecosystem-footer__version { position: static; margin-top: .04rem; }
  .site-footer .footer-layout { width: min(calc(100% - 20px), var(--container)); }
  .site-footer .footer-disclaimer,
  .site-footer .footer-links a { font-size: .67rem; }
}
