:root {
  --font-sans: "Inclusive Sans", "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inclusive Sans", "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-soft: #eeece5;
  --text: #171a18;
  --muted: #6c716c;
  --line: #dedbd2;
  --accent: #173f35;
  --accent-2: #c8a96b;
  --accent-soft: #e3ece8;
  --danger: #8a4037;
  --shadow: 0 20px 60px rgba(31, 39, 35, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(23, 63, 53, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
}

body::selection {
  background: var(--accent);
  color: white;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: var(--font-sans);
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 238, 0.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background:
    linear-gradient(145deg, var(--accent), #295f51);
  display: grid;
  place-items: center;
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.brand-mark::before {
  content: "V";
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(34, 42, 38, .06);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-toggle {
  display: none;
}

.menu-label {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-label span,
.menu-label::before,
.menu-label::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.menu-label span {
  margin: 4px 0;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(23, 63, 53, .18);
}

.btn-primary:hover {
  box-shadow: 0 13px 30px rgba(23, 63, 53, .24);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
}

.btn-ghost {
  color: var(--accent);
  background: transparent;
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: .9rem;
}

.page {
  padding: 48px 0 88px;
}

.hero {
  padding: 54px 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 760;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 18px 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 500;
}

.hero p {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 34px;
  color: var(--muted);
  font-size: .9rem;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-row span::before {
  content: "✓";
  color: var(--accent);
  font-weight: 900;
}

.dashboard-preview {
  position: relative;
  min-height: 530px;
  padding: 22px;
  border-radius: 36px;
  background: linear-gradient(145deg, #1a3e35, #0e251f);
  box-shadow: 0 34px 80px rgba(19, 45, 38, .26);
  overflow: hidden;
}

.dashboard-preview::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -110px;
  top: -90px;
  background: rgba(200, 169, 107, .22);
  filter: blur(8px);
}

.preview-window {
  position: relative;
  background: #f8f7f3;
  border-radius: 24px;
  padding: 20px;
  min-height: 486px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4d0c7;
}

.preview-stat {
  padding: 19px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 28px rgba(39, 45, 41, .08);
}

.preview-stat strong {
  display: block;
  font-size: 2rem;
  margin: 7px 0 2px;
}

.progress {
  height: 8px;
  background: #e7e5df;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.mini-card {
  min-height: 130px;
  padding: 18px;
  border-radius: 18px;
  background: #ecefe9;
}

.mini-card.dark {
  background: var(--accent);
  color: white;
}

.mini-card .kicker {
  font-size: .78rem;
  color: var(--muted);
}

.mini-card.dark .kicker {
  color: rgba(255,255,255,.7);
}

.section {
  padding: 70px 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.section-header > div {
  max-width: 690px;
}

.section-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: -.04em;
}

.section-subtitle {
  margin: 0;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 34px rgba(32, 39, 35, .05);
}

.feature-card {
  padding: 26px;
}

.icon-box {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 30px;
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.quote-card {
  padding: 34px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-xl);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-card p {
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.quote-card small {
  color: rgba(255,255,255,.68);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--line);
}

.stat {
  padding: 30px;
  background: var(--surface);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
}

.stat span {
  color: var(--muted);
  font-size: .9rem;
}

.page-hero {
  padding: 50px 0 26px;
}

.page-hero h1 {
  font-size: clamp(2.55rem, 5vw, 4.8rem);
  max-width: 760px;
}

.page-hero p {
  color: var(--muted);
  max-width: 720px;
  font-size: 1.05rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0;
}

.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.course-card {
  overflow: hidden;
}

.course-cover {
  min-height: 170px;
  padding: 22px;
  color: white;
  background:
    linear-gradient(145deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    var(--accent);
  position: relative;
}

.course-cover.gold {
  background: linear-gradient(145deg, #8a7045, #c8a96b);
}

.course-cover.slate {
  background: linear-gradient(145deg, #303b3f, #59696f);
}

.course-cover.olive {
  background: linear-gradient(145deg, #4d594b, #76806f);
}

.course-cover::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -28px;
  bottom: -45px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.26);
  box-shadow:
    0 0 0 24px rgba(255,255,255,.05),
    0 0 0 50px rgba(255,255,255,.04);
}

.course-tag {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}

.course-cover h3 {
  margin: 46px 0 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
}

.course-body {
  padding: 22px;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.favorite-toggle {
  position: absolute;
  opacity: 0;
}

.favorite-label {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.favorite-toggle:checked + .favorite-label {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #bdd2ca;
}

.content-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 100px;
  padding: 18px;
}

.sidebar-title {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 10px;
}

.sidebar a {
  display: block;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: .92rem;
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}

.lesson {
  padding: 34px;
}

.lesson h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -.03em;
}

.lesson h3 {
  margin-top: 30px;
}

.lesson p,
.lesson li {
  color: #4f5551;
}

.formula {
  margin: 24px 0;
  padding: 22px;
  border-radius: var(--radius-md);
  background: #172d27;
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.05rem;
  overflow-x: auto;
}

.note {
  padding: 18px 20px;
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: #f6efe2;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
}

.quiz-shell {
  max-width: 860px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .9rem;
}

.quiz-card {
  padding: 34px;
}

.quiz-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 500;
  line-height: 1.14;
}

.answer {
  display: block;
  margin-top: 12px;
}

.answer input {
  position: absolute;
  opacity: 0;
}

.answer span {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}

.answer span::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c7cbc7;
  margin-top: 2px;
}

.answer input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.answer input:checked + span::before {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent-soft);
  background: var(--accent);
}

.explanation {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.explanation summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 750;
}

.explanation div {
  padding: 0 18px 18px;
  color: var(--muted);
}
.profile-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-card {
  padding: 28px;
  text-align: center;
}

.avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #3e7566);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
}

.profile-card p {
  color: var(--muted);
}

.profile-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.profile-stat div {
  padding-top: 18px;
}

.profile-stat div + div {
  border-left: 1px solid var(--line);
}

.profile-stat strong {
  display: block;
  font-size: 1.35rem;
}

.panel {
  padding: 28px;
}

.panel + .panel {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
}

.activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.activity-row:first-of-type {
  border-top: 0;
}

.activity-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent);
  font-weight: 850;
}

.activity-row p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.score {
  font-weight: 850;
  color: var(--accent);
}

.cta {
  padding: 42px;
  border-radius: var(--radius-xl);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.cta h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
}

.cta p {
  margin: 0;
  color: rgba(255,255,255,.7);
}

.cta .btn-secondary {
  background: white;
  border-color: white;
  color: var(--accent);
}

.footer {
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .88rem;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .nav-actions .btn {
    display: none;
  }

  .menu-label {
    display: inline-flex;
    flex-direction: column;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: 16px;
    right: 16px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .menu-toggle:checked ~ .nav-links {
    display: flex;
  }

  .hero-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-preview {
    min-height: auto;
  }

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

  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar a {
    white-space: nowrap;
  }

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

@media (max-width: 700px) {
  .page,
  .section {
    padding-top: 44px;
    padding-bottom: 54px;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-grid {
    gap: 36px;
  }

  h1 {
    font-size: 3.2rem;
  }

  .grid-3,
  .grid-2,
  .preview-grid,
  .stats-strip {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .section-header,
  .cta,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .search {
    max-width: none;
    width: 100%;
  }

  .lesson,
  .quiz-card,
  .panel,
  .profile-card,
  .cta {
    padding: 22px;
  }

  .course-cover {
    min-height: 145px;
  }

  .lesson-nav {
    flex-direction: column;
  }

  .lesson-nav .btn {
    width: 100%;
  }

  .activity-row {
    grid-template-columns: auto 1fr;
  }

  .activity-row .score {
    grid-column: 2;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

/* Interactive quiz */
.quiz-main-progress {
  margin-bottom: 18px;
}

.quiz-card[hidden],
.quiz-result[hidden],
.quiz-feedback[hidden] {
  display: none;
}

.quiz-actions button,
.result-actions button {
  border: 0;
}

.btn.is-disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
  box-shadow: none;
}

.answer.is-locked span {
  cursor: default;
}

.answer.is-correct span {
  border-color: #4b806b;
  background: #e5f0eb;
}

.answer.is-correct span::before {
  border-color: #2f6a55;
  background: #2f6a55;
  box-shadow: inset 0 0 0 4px #e5f0eb;
}

.answer.is-incorrect span {
  border-color: #b66a60;
  background: #f7e9e6;
}

.answer.is-incorrect span::before {
  border-color: #9a4d43;
  background: #9a4d43;
  box-shadow: inset 0 0 0 4px #f7e9e6;
}

.quiz-feedback {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.quiz-feedback strong {
  display: block;
  margin-bottom: 5px;
}

.quiz-feedback p {
  margin: 0;
}

.quiz-feedback.is-success {
  border-color: #b9d1c6;
  background: #edf5f1;
}

.quiz-feedback.is-error {
  border-color: #dfbdb7;
  background: #fbefed;
}

.quiz-result {
  text-align: center;
}

.result-score {
  margin: 28px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: .9;
  letter-spacing: -.06em;
  color: var(--accent);
}

.result-actions {
  justify-content: center;
}

.quiz-selection-section {
  padding-bottom: 0;
}

.quiz-choice {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.quiz-choice:hover,
.quiz-choice.active {
  transform: translateY(-3px);
  border-color: #aec5bb;
  box-shadow: 0 18px 40px rgba(23, 63, 53, .10);
}

.quiz-choice.active {
  background: var(--accent-soft);
}

.quiz-choice-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 800;
}

/* Profile editor */
.profile-bio {
  max-width: 260px;
  margin: -4px auto 20px;
  font-size: .9rem;
  line-height: 1.55;
}

.profile-dialog {
  width: min(calc(100% - 28px), 720px);
  max-height: min(88vh, 800px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 34px 100px rgba(15, 31, 25, .26);
  overflow: auto;
}

.profile-dialog::backdrop {
  background: rgba(12, 24, 20, .48);
  backdrop-filter: blur(8px);
}

.profile-form {
  padding: 30px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -.035em;
}

.dialog-header p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.dialog-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 26px 0;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field > span {
  font-size: .86rem;
  font-weight: 760;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfaf7;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-field input,
.form-field select {
  min-height: 48px;
  padding: 0 14px;
}

.form-field textarea {
  min-height: 110px;
  padding: 13px 14px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #7fa294;
  background: white;
  box-shadow: 0 0 0 4px rgba(23, 63, 53, .09);
}

.form-field small {
  justify-self: end;
  color: var(--muted);
}

.form-field[hidden] {
  display: none;
}

.dialog-footer,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-footer {
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  padding: 13px 18px;
  border-radius: 999px;
  background: #172d27;
  color: white;
  font-weight: 760;
  box-shadow: 0 16px 45px rgba(15, 31, 25, .24);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[hidden] {
  display: block;
  visibility: hidden;
}

@media (max-width: 700px) {
  .profile-form {
    padding: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-full {
    grid-column: auto;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-footer > .btn,
  .dialog-actions .btn {
    width: 100%;
  }
}

/* Course filters */
.filters .chip {
  appearance: none;
  cursor: pointer;
}

.filters .chip:hover {
  color: var(--text);
  border-color: #c9c5bb;
  transform: translateY(-1px);
}

.filters .chip:focus-visible {
  outline: 3px solid rgba(23, 63, 53, .16);
  outline-offset: 2px;
}

.course-card[hidden] {
  display: none;
}

.course-empty-state {
  margin-top: 28px;
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.58);
  text-align: center;
}

.course-empty-state .icon-box {
  margin: 0 auto 18px;
}

.course-empty-state h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 500;
}

.course-empty-state p {
  margin-bottom: 20px;
  color: var(--muted);
}



/* Expanded learning library */
.course-count-row {
  display: flex;
  justify-content: flex-end;
  margin: -12px 2px 18px;
  color: var(--muted);
  font-size: .86rem;
}

.lesson-intro {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lesson-intro h2 {
  margin-top: 14px;
}

.lesson section {
  scroll-margin-top: 110px;
}

.lesson-nav-three {
  align-items: center;
}

.next-course-link {
  margin-top: 18px;
  text-align: right;
  color: var(--muted);
  font-size: .9rem;
}

.next-course-link a {
  color: var(--accent);
  font-weight: 750;
}

.quiz-choice-grid {
  align-items: stretch;
}

@media (max-width: 700px) {
  .lesson-nav-three {
    flex-direction: column;
  }

  .lesson-nav-three .btn {
    width: 100%;
  }

  .next-course-link {
    text-align: left;
  }
}


/* Functional state and progression */
.mini-card-link {
  display: block;
  transition: transform .2s ease, box-shadow .2s ease;
}

.mini-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 43, 36, .12);
}

.favorite-label {
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.favorite-label:hover {
  transform: translateY(-1px);
  border-color: #a9beb5;
}

.favorite-toggle:checked + .favorite-label {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #bdd2ca;
}

.course-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 26px 0 32px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #faf9f5;
}

.course-progress-block {
  min-width: 0;
}

.course-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: .9rem;
}

.course-progress-header span {
  color: var(--muted);
  font-weight: 700;
}

.course-progress-header strong {
  color: var(--accent);
}

.course-progress-block small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
}

.course-tools-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

#course-favorite-button.is-active {
  color: var(--accent);
  border-color: #a9c2b7;
  background: var(--accent-soft);
}

#course-complete-button.is-complete {
  background: #436e5f;
}

.activity-row-link {
  color: inherit;
  border-radius: 12px;
  transition: background .2s ease;
}

.activity-row-link:hover {
  background: var(--surface-soft);
}

.panel-empty-state {
  padding: 26px 8px 10px;
  text-align: center;
}

.panel-empty-state strong {
  display: block;
  margin-bottom: 7px;
}

.panel-empty-state p {
  max-width: 430px;
  margin: 0 auto 18px;
  color: var(--muted);
}

.storage-note {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

#reset-learning-data {
  margin-top: 16px;
  padding-left: 0;
}

.quiz-best-score {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.legal-layout {
  max-width: 920px;
}

.legal-layout .lesson section + section {
  margin-top: 28px;
}

.footer-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 750;
}

.cta .btn-secondary:hover {
  color: var(--accent);
}

@media (max-width: 820px) {
  .course-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .course-tools-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .course-tools-actions {
    display: grid;
  }

  .course-tools-actions .btn {
    width: 100%;
  }
}

body.env-corporate{--accent:#173f35;--accent-soft:#e3ece8}body.env-market{--accent:#244f7a;--accent-soft:#e6eef7;background:radial-gradient(circle at top right,rgba(36,79,122,.1),transparent 34%),var(--bg)}body.env-market .course-cover{background:linear-gradient(145deg,#244f7a,#16334f)}.environment-bar{border-bottom:1px solid var(--line);background:rgba(255,255,255,.72);backdrop-filter:blur(16px)}.environment-bar-inner{min-height:54px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:24px}.environment-identity{display:flex;align-items:center;gap:9px}.environment-dot{width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 5px var(--accent-soft)}.environment-subnav{display:flex;justify-content:center;gap:4px}.environment-subnav-link{padding:8px 12px;border-radius:999px;color:var(--muted);font-size:.88rem;font-weight:700}.environment-subnav-link.active,.environment-subnav-link:hover{color:var(--accent);background:var(--accent-soft)}.environment-switch-link{color:var(--muted);font-size:.83rem;font-weight:700}.dual-hero{padding:86px 0 58px;text-align:center}.dual-hero-inner{max-width:950px}.dual-hero p{max-width:760px;margin-left:auto;margin-right:auto}.dual-hero .hero-actions,.dual-hero .trust-row{justify-content:center}.environment-choice-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:22px}.environment-choice-card{min-height:430px;padding:36px;border:1px solid var(--line);border-radius:30px;display:flex;flex-direction:column;background:var(--surface);box-shadow:var(--shadow)}.corporate-choice{background:radial-gradient(circle at top right,rgba(23,63,53,.13),transparent 38%),var(--surface)}.market-choice{background:radial-gradient(circle at top right,rgba(36,79,122,.14),transparent 38%),var(--surface)}.environment-choice-top{display:flex;justify-content:space-between}.environment-choice-number{font-family:var(--font-display);font-size:2.2rem;opacity:.28}.environment-choice-card h2{margin:70px 0 14px;font-family:var(--font-display);font-size:clamp(2rem,4vw,3.2rem);font-weight:500}.environment-choice-card p{color:var(--muted)}.environment-choice-stats{display:flex;gap:24px;margin-top:auto;padding:28px 0 24px}.environment-choice-stats strong{display:block;font-family:var(--font-display);font-size:1.7rem}.environment-choice-actions{display:flex;flex-wrap:wrap;gap:10px}.market-choice .btn-primary{background:#244f7a}.domain-pill{display:inline-flex;padding:6px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:.74rem;font-weight:850;text-transform:uppercase}.environment-module-card{padding:28px;min-height:250px}.environment-module-card p{color:var(--muted)}.environment-module-card strong{color:var(--accent)}.environment-dashboard-preview{background:linear-gradient(145deg,var(--accent),#102c25)}body.env-market .environment-dashboard-preview{background:linear-gradient(145deg,#244f7a,#152f4a)}.profile-environment-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px;margin-bottom:18px}.profile-env-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.profile-env-stats div{padding:12px;border-radius:12px;background:var(--surface-soft)}.profile-env-stats strong,.profile-env-stats span{display:block}.profile-env-stats span{font-size:.72rem;color:var(--muted)}.market-profile-card .progress span{background:#244f7a}.quiz-best-score{display:block;margin-top:14px;color:var(--accent);font-size:.82rem}@media(max-width:900px){.environment-bar-inner{grid-template-columns:1fr;padding:10px 0}.environment-identity,.environment-switch-link{justify-self:center}.environment-choice-grid,.profile-environment-grid{grid-template-columns:1fr}.environment-subnav{overflow-x:auto;justify-content:flex-start}.environment-subnav-link{white-space:nowrap}}

/* Detailed lessons */
.lesson > section[data-course-section] { padding: 28px 0; border-top: 1px solid var(--line); }
.lesson > section[data-course-section] h3 { margin: 0 0 14px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; letter-spacing: -.025em; }
.lesson > section[data-course-section] p { max-width: 78ch; line-height: 1.7; }
.detail-list { display: grid; gap: 9px; padding-left: 22px; color: #4f5551; }
.detail-list li { padding-left: 4px; line-height: 1.6; }
.detail-list.numbered { padding-left: 25px; }
.worked-example,.detail-callout { margin: 20px 0; padding: 19px 21px; border-radius: 15px; }
.worked-example { border: 1px solid #d9d2c3; background: #f7f1e6; }
.detail-callout { border: 1px solid color-mix(in srgb,var(--accent) 22%,var(--line)); background: var(--accent-soft); }
.worked-example strong,.detail-callout strong { display: block; margin-bottom: 7px; }
.worked-example p,.detail-callout p { margin: 0; }
.glossary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.glossary-item { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }
.glossary-item strong { color: var(--accent); }
.glossary-item p { margin: 6px 0 0; font-size: .9rem; line-height: 1.5; }
@media(max-width:700px){.glossary-grid{grid-template-columns:1fr}.lesson > section[data-course-section]{padding:23px 0}}


/* ==========================================================================
   Formula variable definitions
   ========================================================================== */

.formula-variables {
  margin: -10px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(255, 255, 255, .62);
}

.formula + .formula-variables {
  margin-top: -20px;
}

.formula-variables-title {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: .82rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.formula-variables dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 7px 14px;
  margin: 0;
}

.formula-variables dt {
  color: var(--accent);
  font-weight: 800;
}

.formula-variables dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 620px) {
  .formula-variables dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .formula-variables dd {
    margin-bottom: 8px;
  }
}
/* Daily Brain Teaser */.daily-preview-card{display:grid;grid-template-columns:1.15fr .85fr;gap:32px;padding:38px;border:1px solid var(--line);border-radius:28px;background:var(--surface);box-shadow:var(--shadow)}.daily-preview-card h2{font-family:var(--font-display);font-size:clamp(2rem,4vw,3.3rem);font-weight:500}.daily-preview-meta{display:flex;gap:8px;margin:20px 0}.daily-preview-meta span{padding:7px 10px;border-radius:999px;background:var(--surface-soft);font-size:.8rem}.daily-preview-visual{min-height:270px;padding:28px;border-radius:22px;display:flex;flex-direction:column;justify-content:flex-end;position:relative;overflow:hidden;color:#fff;background:linear-gradient(145deg,#173f35,#102c25)}.daily-preview-visual strong{font-family:var(--font-display);font-size:2rem}.daily-preview-visual b{position:absolute;right:12px;bottom:-65px;font: 700 15rem/1 var(--font-display);opacity:.09}.brain-layout{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px;align-items:start}.brain-teaser-card{padding:34px}.brain-card-top{display:flex;justify-content:space-between}.brain-date{display:block;margin-top:9px;color:var(--muted);font-size:.84rem}.brain-difficulty{padding:7px 10px;border-radius:999px;background:var(--surface-soft);font-size:.78rem}.brain-number{margin-top:50px;color:var(--accent);font-weight:850}.brain-teaser-card h2{font: 600 clamp(2rem,5vw,3.6rem)/1.03 var(--font-display);margin:10px 0 18px}.brain-prompt{font-size:1.08rem;line-height:1.75}.brain-timer-panel{display:flex;justify-content:space-between;margin:28px 0 22px;padding:18px 20px;border:1px solid var(--line);border-radius:16px;background:var(--surface-soft)}.brain-timer-panel span{display:block;color:var(--muted);font-size:.78rem}.brain-timer-panel strong{font-size:1.6rem}.brain-actions,.brain-assessment-buttons{display:flex;flex-wrap:wrap;gap:10px}.brain-hint{margin-top:20px;padding:17px 19px;border-left:4px solid var(--accent);background:var(--accent-soft)}.brain-solution{margin-top:34px;padding-top:30px;border-top:1px solid var(--line)}.brain-solution li{margin:9px 0}.brain-concept-chip{display:inline-flex;margin:8px 6px 0 0;padding:7px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:.78rem}.brain-self-assessment{margin-top:25px;padding:18px;background:var(--surface-soft)}.brain-assessment-buttons .active{background:var(--accent);color:#fff}.brain-sidebar{display:grid;gap:14px}.brain-stat-card{padding:22px}.brain-stat-card strong{display:block;margin:8px 0;font: 600 2rem/1.15 var(--font-display)}@media(max-width:900px){.daily-preview-card,.brain-layout{grid-template-columns:1fr}.brain-sidebar{grid-template-columns:repeat(3,1fr)}}@media(max-width:650px){.daily-preview-card,.brain-teaser-card{padding:24px}.brain-sidebar{grid-template-columns:1fr}.brain-card-top,.brain-timer-panel{flex-direction:column;gap:12px}.brain-actions .btn{width:100%}}

/* ========================================================================== 
   Inclusive Sans theme and smooth motion system
   ========================================================================== */

body {
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: vx-page-enter .46s cubic-bezier(.22, 1, .36, 1) both;
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

h1,
h2,
h3,
h4,
.section-title,
.course-title,
.hero h1,
.page-hero h1 {
  font-family: var(--font-display);
  letter-spacing: -.035em;
}

.brand-mark::before {
  font-family: var(--font-display);
  font-weight: 700;
}

.topbar,
.environment-bar {
  transition: background-color .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.nav-links a,
.environment-subnav-link,
.footer-links a {
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.nav-links a:hover,
.environment-subnav-link:hover,
.footer-links a:hover {
  transform: translateY(-1px);
}

.card,
.environment-choice-card,
.course-card,
.module-card,
.panel,
.daily-preview-card,
.brain-teaser-card,
.brain-stat-card,
.glossary-item,
.worked-example,
.detail-callout {
  transition:
    transform .34s cubic-bezier(.22, 1, .36, 1),
    box-shadow .34s ease,
    border-color .28s ease,
    background-color .28s ease;
}

.card:hover,
.environment-choice-card:hover,
.course-card:hover,
.module-card:hover,
.daily-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 70px rgba(31, 39, 35, .11);
}

.btn {
  transition:
    transform .24s cubic-bezier(.22, 1, .36, 1),
    box-shadow .24s ease,
    background-color .24s ease,
    border-color .24s ease,
    color .24s ease;
}

.btn:active {
  transform: translateY(0) scale(.985);
}

.progress span,
.quiz-progress span {
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
}

[hidden] {
  animation: none !important;
}

html.is-page-leaving body {
  opacity: 0;
  transform: translateY(-7px) scale(.997);
  filter: blur(2px);
  pointer-events: none;
}

.js-enabled [data-vx-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity .64s cubic-bezier(.22, 1, .36, 1),
    transform .64s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--vx-reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js-enabled [data-vx-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes vx-page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vx-view-old {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(.995);
    filter: blur(2px);
  }
}

@keyframes vx-view-new {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.997);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vx-view-old .22s ease both;
}

::view-transition-new(root) {
  animation: vx-view-new .42s cubic-bezier(.22, 1, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }

  body,
  html.is-page-leaving body,
  .js-enabled [data-vx-reveal],
  .js-enabled [data-vx-reveal].is-visible {
    opacity: 1;
    transform: none;
    filter: none;
  }
}


/* ==========================================================================
   Brain Teaser — Bordeaux theme
   ========================================================================== */

:root {
  --brain-bordeaux: #6f1830;
  --brain-bordeaux-dark: #46101f;
  --brain-bordeaux-deep: #2e0b16;
  --brain-red: #a42d49;
  --brain-rose: #f4e5e9;
  --brain-rose-soft: #fbf4f6;
  --brain-line: rgba(111, 24, 48, .18);
  --brain-shadow: 0 22px 55px rgba(70, 16, 31, .14);
}

/* Page background and hero */
.brain-page,
body:has(.brain-layout) {
  background:
    radial-gradient(circle at 85% 8%, rgba(164, 45, 73, .10), transparent 30%),
    radial-gradient(circle at 12% 22%, rgba(111, 24, 48, .07), transparent 26%),
    var(--background);
}

.brain-page .eyebrow,
.brain-page .kicker,
body:has(.brain-layout) .eyebrow,
body:has(.brain-layout) .kicker {
  color: var(--brain-bordeaux);
}

.brain-page .eyebrow-dot,
body:has(.brain-layout) .eyebrow-dot {
  background: var(--brain-red);
  box-shadow: 0 0 0 5px rgba(164, 45, 73, .12);
}

/* Main challenge card */
.brain-teaser-card {
  border-color: var(--brain-line);
  background:
    radial-gradient(circle at 100% 0%, rgba(164, 45, 73, .11), transparent 32%),
    linear-gradient(180deg, #fff 0%, var(--brain-rose-soft) 100%);
  box-shadow: var(--brain-shadow);
}

.brain-teaser-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(
    180deg,
    var(--brain-red),
    var(--brain-bordeaux),
    var(--brain-bordeaux-dark)
  );
}

.brain-teaser-card .domain-pill {
  color: var(--brain-bordeaux);
  background: var(--brain-rose);
  border-color: var(--brain-line);
}

.brain-number {
  color: var(--brain-bordeaux);
}

.brain-difficulty {
  color: var(--brain-bordeaux-dark);
  background: var(--brain-rose);
  border: 1px solid var(--brain-line);
}

.brain-timer-panel {
  border-color: var(--brain-line);
  background: rgba(244, 229, 233, .7);
}

.brain-timer-panel strong,
.brain-timer {
  color: var(--brain-bordeaux-dark);
}

/* Buttons */
.brain-page .btn-primary,
body:has(.brain-layout) .btn-primary {
  background: linear-gradient(135deg, var(--brain-red), var(--brain-bordeaux));
  border-color: var(--brain-bordeaux);
  color: #fff;
  box-shadow: 0 10px 24px rgba(111, 24, 48, .22);
}

.brain-page .btn-primary:hover,
body:has(.brain-layout) .btn-primary:hover {
  background: linear-gradient(135deg, #b53554, var(--brain-bordeaux-dark));
  border-color: var(--brain-bordeaux-dark);
  box-shadow: 0 14px 30px rgba(70, 16, 31, .28);
}

.brain-page .btn-secondary,
body:has(.brain-layout) .btn-secondary {
  color: var(--brain-bordeaux);
  border-color: var(--brain-line);
  background: rgba(255, 255, 255, .82);
}

.brain-page .btn-secondary:hover,
body:has(.brain-layout) .btn-secondary:hover {
  color: var(--brain-bordeaux-dark);
  border-color: rgba(111, 24, 48, .34);
  background: var(--brain-rose);
}

.brain-assessment-buttons .active {
  color: #fff;
  border-color: var(--brain-bordeaux);
  background: var(--brain-bordeaux);
}

/* Hints, solution and chips */
.brain-hint {
  color: var(--brain-bordeaux-dark);
  border-left-color: var(--brain-red);
  background: var(--brain-rose);
}

.brain-solution {
  border-top-color: var(--brain-line);
}

.brain-concept-chip {
  color: var(--brain-bordeaux);
  background: var(--brain-rose);
  border: 1px solid var(--brain-line);
}

.brain-self-assessment {
  border: 1px solid var(--brain-line);
  background: var(--brain-rose-soft);
}

/* Sidebar */
.brain-stat-card,
.brain-info-card {
  border-color: var(--brain-line);
  background:
    linear-gradient(180deg, #fff, var(--brain-rose-soft));
}

.brain-stat-card strong {
  color: var(--brain-bordeaux-dark);
}

/* Navigation: dedicated active state */
body:has(.brain-layout) .nav-links a[href="brain-teaser.html"][aria-current="page"] {
  color: #fff;
  background: var(--brain-bordeaux);
  border-color: var(--brain-bordeaux);
}

/* Homepage Brain Teaser preview */
.daily-preview-card {
  border-color: var(--brain-line);
  background:
    radial-gradient(circle at 88% 12%, rgba(164, 45, 73, .12), transparent 34%),
    linear-gradient(135deg, #fff 0%, var(--brain-rose-soft) 100%);
  box-shadow: var(--brain-shadow);
}

.daily-preview-card .eyebrow {
  color: var(--brain-bordeaux);
}

.daily-preview-card .eyebrow-dot {
  background: var(--brain-red);
  box-shadow: 0 0 0 5px rgba(164, 45, 73, .12);
}

.daily-preview-meta span {
  color: var(--brain-bordeaux);
  background: var(--brain-rose);
  border: 1px solid var(--brain-line);
}

.daily-preview-card .btn-primary {
  background: linear-gradient(135deg, var(--brain-red), var(--brain-bordeaux));
  border-color: var(--brain-bordeaux);
  box-shadow: 0 10px 24px rgba(111, 24, 48, .22);
}

.daily-preview-card .btn-primary:hover {
  background: linear-gradient(135deg, #b53554, var(--brain-bordeaux-dark));
}

.daily-preview-visual {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, .11), transparent 26%),
    linear-gradient(145deg, var(--brain-red), var(--brain-bordeaux-dark) 68%, var(--brain-bordeaux-deep));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.daily-preview-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 62%, rgba(255, 255, 255, .06) 62% 63%, transparent 63%),
    linear-gradient(35deg, transparent 0 72%, rgba(255, 255, 255, .05) 72% 73%, transparent 73%);
  pointer-events: none;
}

.daily-preview-question-mark,
.daily-preview-visual b {
  color: #fff;
}

/* Focus accessibility */
.brain-page button:focus-visible,
.brain-page a:focus-visible,
body:has(.brain-layout) button:focus-visible,
body:has(.brain-layout) a:focus-visible {
  outline: 3px solid rgba(164, 45, 73, .34);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .brain-teaser-card,
  .brain-stat-card,
  .brain-info-card,
  .daily-preview-card {
    background:
      radial-gradient(circle at 100% 0%, rgba(164, 45, 73, .14), transparent 34%),
      var(--surface);
  }

  .brain-timer-panel,
  .brain-self-assessment {
    background: rgba(111, 24, 48, .12);
  }

  .brain-page .btn-secondary,
  body:has(.brain-layout) .btn-secondary {
    background: rgba(255, 255, 255, .04);
  }
}


/* Fallback scope for the Brain Teaser page */
.brain-theme-bordeaux {
  background:
    radial-gradient(circle at 85% 8%, rgba(164, 45, 73, .10), transparent 30%),
    radial-gradient(circle at 12% 22%, rgba(111, 24, 48, .07), transparent 26%),
    var(--background);
}

.brain-theme-bordeaux .eyebrow,
.brain-theme-bordeaux .kicker {
  color: var(--brain-bordeaux);
}

.brain-theme-bordeaux .eyebrow-dot {
  background: var(--brain-red);
  box-shadow: 0 0 0 5px rgba(164, 45, 73, .12);
}

.brain-theme-bordeaux .btn-primary {
  background: linear-gradient(135deg, var(--brain-red), var(--brain-bordeaux));
  border-color: var(--brain-bordeaux);
  color: #fff;
}

.brain-theme-bordeaux .btn-secondary {
  color: var(--brain-bordeaux);
  border-color: var(--brain-line);
}

.brain-theme-bordeaux .nav-links a[href="brain-teaser.html"][aria-current="page"] {
  color: #fff;
  background: var(--brain-bordeaux);
  border-color: var(--brain-bordeaux);
}


/* ==========================================================================
   Legal center — extended
   ========================================================================== */

.legal-hero {
  max-width: 980px;
}

.legal-version {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.legal-version span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.legal-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 92px;
  padding: 20px;
  max-height: calc(100vh - 116px);
  overflow: auto;
}

.legal-toc > strong {
  display: block;
  margin-bottom: 11px;
  font-size: .84rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.legal-toc nav {
  display: grid;
  gap: 2px;
}

.legal-toc a {
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.25;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

.legal-document {
  max-width: none;
}

.legal-document > section {
  position: relative;
  scroll-margin-top: 100px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.legal-document > section:first-of-type {
  border-top: 0;
}

.legal-document h2 {
  margin: 0 0 18px;
  padding-right: 55px;
}

.legal-document h3 {
  margin: 28px 0 10px;
  font-size: 1.15rem;
}

.legal-document p,
.legal-document li,
.legal-document td,
.legal-document th {
  line-height: 1.65;
}

.legal-section-number {
  position: absolute;
  top: 35px;
  right: 0;
  color: color-mix(in srgb, var(--accent) 46%, var(--muted));
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.legal-alert {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 15px;
  background: var(--accent-soft);
}

.legal-alert strong {
  display: block;
  margin-bottom: 6px;
}

.legal-alert p {
  margin: 0;
}

.legal-alert-danger {
  border-color: rgba(143, 37, 55, .28);
  background: rgba(143, 37, 55, .08);
}

.legal-alert-danger strong,
.legal-alert-warning strong {
  color: #7a2135;
}

.legal-alert-warning {
  border-color: rgba(164, 45, 73, .28);
  background: rgba(164, 45, 73, .08);
}

.legal-placeholder {
  display: inline;
  padding: 1px 5px;
  border-radius: 5px;
  color: #7a2135;
  background: rgba(164, 45, 73, .11);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.legal-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.legal-definition-grid > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.legal-definition-grid span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.legal-definition-grid strong {
  line-height: 1.45;
}

.legal-address {
  margin: 16px 0;
  padding: 17px 19px;
  border-left: 4px solid var(--accent);
  border-radius: 0 13px 13px 0;
  background: var(--surface-soft);
  font-style: normal;
  line-height: 1.65;
}

.legal-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.legal-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: .88rem;
}

.legal-table th,
.legal-table td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal-table th {
  color: var(--text);
  background: var(--surface-soft);
  font-size: .77rem;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-document code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .88em;
}

.legal-local-status {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.legal-danger-button {
  color: #7a2135;
}

.legal-danger-button:hover {
  color: #fff;
  background: #7a2135;
  border-color: #7a2135;
}

.legal-reference-list a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
  text-underline-offset: 3px;
}

@media (max-width: 960px) {
  .legal-shell {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
    max-height: none;
  }

  .legal-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .legal-document {
    padding: 24px;
  }

  .legal-definition-grid,
  .legal-toc nav {
    grid-template-columns: 1fr;
  }

  .legal-section-number {
    position: static;
    display: block;
    margin-bottom: 8px;
  }

  .legal-document h2 {
    padding-right: 0;
  }

  .legal-actions .btn {
    width: 100%;
  }
}

@media print {
  .topbar,
  .footer,
  .legal-toc,
  .legal-actions,
  .legal-local-status {
    display: none !important;
  }

  .legal-shell {
    display: block;
  }

  .legal-document {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
}


/* ==========================================================================
   Homepage — Mineral gray theme
   ========================================================================== */

:root {
  --home-gray-950: #202226;
  --home-gray-900: #2b2e33;
  --home-gray-800: #3b3f45;
  --home-gray-700: #52575f;
  --home-gray-500: #7b818a;
  --home-gray-300: #c8ccd1;
  --home-gray-200: #dde0e4;
  --home-gray-100: #eceef0;
  --home-gray-050: #f6f7f8;
  --home-gray-line: rgba(43, 46, 51, .14);
  --home-gray-shadow: 0 24px 60px rgba(32, 34, 38, .12);
}

body.home-theme-gray {
  --accent: var(--home-gray-800);
  --accent-soft: var(--home-gray-100);
  background:
    radial-gradient(circle at 82% 5%, rgba(82, 87, 95, .11), transparent 31%),
    radial-gradient(circle at 10% 22%, rgba(123, 129, 138, .07), transparent 28%),
    linear-gradient(180deg, #f9f9fa 0%, var(--home-gray-050) 100%);
}

/* Header */
.home-theme-gray .topbar {
  border-bottom-color: var(--home-gray-line);
  background: rgba(248, 249, 250, .82);
  backdrop-filter: blur(18px);
}

.home-theme-gray .brand-mark {
  background: linear-gradient(145deg, var(--home-gray-700), var(--home-gray-950));
  box-shadow: 0 0 0 5px rgba(59, 63, 69, .09);
}

.home-theme-gray .nav-links a {
  color: var(--home-gray-700);
}

.home-theme-gray .nav-links a:hover {
  color: var(--home-gray-950);
  background: var(--home-gray-100);
}

.home-theme-gray .nav-links a[aria-current="page"] {
  color: #fff;
  background: var(--home-gray-900);
  border-color: var(--home-gray-900);
}

/* Hero */
.home-theme-gray .dual-hero {
  position: relative;
  overflow: hidden;
}

.home-theme-gray .dual-hero::before,
.home-theme-gray .dual-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
}

.home-theme-gray .dual-hero::before {
  width: 420px;
  height: 420px;
  top: -230px;
  right: -110px;
  border: 1px solid rgba(82, 87, 95, .13);
  box-shadow:
    0 0 0 55px rgba(82, 87, 95, .025),
    0 0 0 110px rgba(82, 87, 95, .018);
}

.home-theme-gray .dual-hero::after {
  width: 260px;
  height: 260px;
  left: -135px;
  bottom: -125px;
  border: 1px solid rgba(82, 87, 95, .10);
}

.home-theme-gray .dual-hero-inner {
  position: relative;
  z-index: 1;
}

.home-theme-gray .eyebrow {
  color: var(--home-gray-700);
}

.home-theme-gray .eyebrow-dot {
  background: var(--home-gray-700);
  box-shadow: 0 0 0 5px rgba(82, 87, 95, .10);
}

.home-theme-gray .dual-hero h1 {
  color: var(--home-gray-950);
}

.home-theme-gray .dual-hero p {
  color: var(--home-gray-700);
}

.home-theme-gray .trust-row span {
  color: var(--home-gray-700);
  background: rgba(255, 255, 255, .68);
  border: 1px solid var(--home-gray-line);
}

/* Buttons */
.home-theme-gray .btn-primary {
  color: #fff;
  border-color: var(--home-gray-900);
  background: linear-gradient(135deg, var(--home-gray-800), var(--home-gray-950));
  box-shadow: 0 10px 24px rgba(32, 34, 38, .18);
}

.home-theme-gray .btn-primary:hover {
  border-color: #111316;
  background: linear-gradient(135deg, var(--home-gray-700), #15171a);
  box-shadow: 0 14px 30px rgba(32, 34, 38, .23);
}

.home-theme-gray .btn-secondary,
.home-theme-gray .btn-ghost {
  color: var(--home-gray-800);
  border-color: var(--home-gray-line);
  background: rgba(255, 255, 255, .72);
}

.home-theme-gray .btn-secondary:hover,
.home-theme-gray .btn-ghost:hover {
  color: var(--home-gray-950);
  border-color: rgba(43, 46, 51, .28);
  background: var(--home-gray-100);
}

/* Section typography */
.home-theme-gray .section-title {
  color: var(--home-gray-950);
}

.home-theme-gray .section-subtitle,
.home-theme-gray .feature-card p {
  color: var(--home-gray-700);
}

/* Environment cards */
.home-theme-gray .environment-choice-card {
  border-color: var(--home-gray-line);
  box-shadow: var(--home-gray-shadow);
}

.home-theme-gray .corporate-choice {
  background:
    radial-gradient(circle at 88% 10%, rgba(82, 87, 95, .12), transparent 36%),
    linear-gradient(145deg, #fff 0%, #f1f2f3 100%);
}

.home-theme-gray .market-choice {
  background:
    radial-gradient(circle at 88% 10%, rgba(32, 34, 38, .12), transparent 36%),
    linear-gradient(145deg, #f6f7f8 0%, #e7e9eb 100%);
}

.home-theme-gray .environment-choice-card .domain-pill {
  color: var(--home-gray-800);
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--home-gray-line);
}

.home-theme-gray .environment-choice-number {
  color: var(--home-gray-700);
}

.home-theme-gray .environment-choice-card h2,
.home-theme-gray .environment-choice-stats strong {
  color: var(--home-gray-950);
}

.home-theme-gray .environment-choice-card p,
.home-theme-gray .environment-choice-stats span {
  color: var(--home-gray-700);
}

.home-theme-gray .market-choice .btn-primary {
  background: linear-gradient(135deg, var(--home-gray-700), var(--home-gray-950));
  border-color: var(--home-gray-900);
}

/* Feature cards */
.home-theme-gray .feature-card {
  border-color: var(--home-gray-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(239, 241, 243, .90));
}

.home-theme-gray .feature-card .icon-box {
  color: #fff;
  background: linear-gradient(145deg, var(--home-gray-700), var(--home-gray-950));
  box-shadow: 0 8px 18px rgba(32, 34, 38, .14);
}

.home-theme-gray .feature-card h3 {
  color: var(--home-gray-950);
}

/*
  The Brain Teaser preview keeps its bordeaux identity so the content
  remains visually identifiable inside the otherwise neutral homepage.
*/
.home-theme-gray .daily-preview-card {
  border-color: rgba(111, 24, 48, .15);
}

/* Footer */
.home-theme-gray .footer {
  border-top-color: var(--home-gray-line);
  background: rgba(236, 238, 240, .72);
}

.home-theme-gray .footer,
.home-theme-gray .footer a {
  color: var(--home-gray-700);
}

.home-theme-gray .footer a:hover {
  color: var(--home-gray-950);
}

/* Accessible focus */
.home-theme-gray a:focus-visible,
.home-theme-gray button:focus-visible {
  outline-color: rgba(59, 63, 69, .38);
}

@media (max-width: 700px) {
  .home-theme-gray .dual-hero::before {
    width: 280px;
    height: 280px;
    top: -170px;
    right: -130px;
  }
}


/* ==========================================================================
   Brain Teaser — themed ValoraX logo
   ========================================================================== */

.brain-theme-bordeaux .brand {
  color: var(--brain-bordeaux);
}

.brain-theme-bordeaux .brand:hover {
  color: var(--brain-bordeaux-dark);
}

.brain-theme-bordeaux .brand-mark {
  background:
    linear-gradient(
      145deg,
      var(--brain-red),
      var(--brain-bordeaux-dark)
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .20),
    0 7px 18px rgba(70, 16, 31, .18);
}

.brain-theme-bordeaux .brand-mark::before {
  color: #fff;
}

.brain-theme-bordeaux .footer .brand {
  color: var(--brain-bordeaux);
}


/* ==========================================================================
   Editorial illustrations
   ========================================================================== */

.home-theme-gray .dual-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(300px, .98fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.home-hero-copy {
  min-width: 0;
}

.home-hero-visual {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(43, 46, 51, .12);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(32, 34, 38, .16);
}

.home-hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(32,34,38,.04));
}

.home-hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
  object-fit: cover;
}

.environment-dashboard-preview {
  position: relative;
}

.environment-hero-art {
  display: block;
  width: min(78%, 420px);
  margin: -22px auto 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 20px 42px rgba(16, 44, 37, .12);
  transform: rotate(1.1deg);
}

.env-market .environment-hero-art {
  box-shadow: 0 20px 42px rgba(22, 51, 79, .14);
  transform: rotate(-1.1deg);
}

.environment-hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

.brain-theme-bordeaux .page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 4rem);
}

.brain-hero-copy {
  min-width: 0;
}

.brain-hero-visual {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(111, 24, 48, .12);
  border-radius: 30px;
  background: #fff7f9;
  box-shadow: 0 24px 54px rgba(70, 16, 31, .14);
}

.brain-hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* Images are intentionally limited to key landing moments. */
@media (max-width: 900px) {
  .home-theme-gray .dual-hero-inner,
  .brain-theme-bordeaux .page-hero {
    grid-template-columns: 1fr;
  }

  .home-hero-visual {
    max-width: 680px;
  }

  .brain-hero-visual {
    width: min(100%, 430px);
  }
}

@media (max-width: 640px) {
  .home-hero-visual,
  .brain-hero-visual {
    border-radius: 22px;
  }

  .environment-hero-art {
    width: min(88%, 360px);
    margin-top: -10px;
  }
}


/* ==========================================================================
   Mobile optimization — navigation, layouts and touch ergonomics
   ========================================================================== */

html,
body {
  max-width: 100%;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

main,
section,
article,
aside,
div {
  min-width: 0;
}

button,
.btn,
.chip,
.menu-label,
.favorite-label,
.answer span,
a {
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: max(1rem, 16px);
}

h1,
h2,
h3,
h4,
p,
li,
a,
span,
strong,
code,
dd,
dt {
  overflow-wrap: anywhere;
}

.course-table-wrap,
.legal-table-wrap,
.formula,
.sidebar,
.environment-subnav,
.filters {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.course-table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.course-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: .9rem;
}

.course-table th,
.course-table td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.course-table th {
  background: var(--surface-soft);
  color: var(--text);
  font-size: .78rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.course-table tr:last-child td {
  border-bottom: 0;
}

@supports (padding: max(0px)) {
  .topbar {
    padding-top: env(safe-area-inset-top);
  }

  .footer {
    padding-bottom: max(46px, calc(24px + env(safe-area-inset-bottom)));
  }
}

@media (max-width: 980px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .nav {
    min-height: 64px;
    gap: 12px;
  }

  .brand {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .menu-label {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .menu-label span,
  .menu-label::before,
  .menu-label::after {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 19px;
    margin: 0;
    transform-origin: center;
    transition:
      transform .22s ease,
      opacity .18s ease,
      background-color .2s ease;
  }

  .menu-label::before {
    transform: translate(-50%, calc(-50% - 6px));
  }

  .menu-label span {
    transform: translate(-50%, -50%);
  }

  .menu-label::after {
    transform: translate(-50%, calc(-50% + 6px));
  }

  .menu-toggle:checked + .menu-label::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .menu-toggle:checked + .menu-label span {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(.25);
  }

  .menu-toggle:checked + .menu-label::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: calc(76px + env(safe-area-inset-top, 0px));
    left: max(14px, env(safe-area-inset-left, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    z-index: 80;
    max-height: calc(100dvh - 96px - env(safe-area-inset-top, 0px));
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 20px;
    transform-origin: top;
  }

  .nav-links a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 13px;
    font-size: 1rem;
  }

  .nav-links a + a {
    margin-top: 2px;
  }

  .menu-toggle:checked ~ .nav-links {
    animation: vx-mobile-menu-enter .2s ease-out both;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .dashboard-preview {
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .content-layout {
    gap: 18px;
  }

  .sidebar {
    width: 100%;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 15px;
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .sidebar a {
    min-height: 44px;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
  }

  .environment-bar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 14px;
    padding: 10px 0 8px;
  }

  .environment-identity {
    justify-self: start;
  }

  .environment-switch-link {
    justify-self: end;
    text-align: right;
  }

  .environment-subnav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 2px;
  }

  .environment-subnav-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .legal-shell {
    gap: 24px;
  }
}

@keyframes vx-mobile-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  :root {
    --radius-xl: 22px;
    --radius-lg: 17px;
    --radius-md: 13px;
  }

  .container {
    width: min(calc(100% - 24px), var(--container));
  }

  .page {
    padding: 30px 0 58px;
  }

  .section {
    padding: 48px 0;
  }

  .hero {
    padding: 38px 0 28px;
  }

  .dual-hero {
    padding: 44px 0 34px;
  }

  h1 {
    margin: 15px 0;
    font-size: clamp(2.35rem, 12vw, 3.55rem);
    line-height: 1;
  }

  .page-hero {
    padding: 30px 0 20px;
  }

  .page-hero h1 {
    font-size: clamp(2.25rem, 11vw, 3.4rem);
  }

  .page-hero p,
  .hero p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .eyebrow {
    max-width: 100%;
    padding: 7px 10px;
    font-size: .73rem;
    line-height: 1.35;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 23px;
  }

  .hero-actions .btn {
    flex: 1 1 190px;
  }

  .trust-row {
    gap: 10px;
    margin-top: 24px;
  }

  .trust-row span {
    width: 100%;
  }

  .home-theme-gray .dual-hero-inner,
  .brain-theme-bordeaux .page-hero {
    gap: 28px;
  }

  .home-hero-visual,
  .brain-hero-visual {
    width: 100%;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(32, 34, 38, .13);
  }

  .home-hero-visual img {
    aspect-ratio: 3 / 2;
    object-fit: contain;
  }

  .daily-preview-card {
    gap: 24px;
    padding: 24px;
    border-radius: 22px;
  }

  .daily-preview-card h2 {
    font-size: clamp(1.85rem, 9vw, 2.65rem);
  }

  .daily-preview-meta {
    flex-wrap: wrap;
    margin: 16px 0;
  }

  .daily-preview-visual {
    min-height: 210px;
    padding: 22px;
  }

  .daily-preview-visual b {
    bottom: -44px;
    font-size: 11rem;
  }

  .section-header {
    margin-bottom: 22px;
  }

  .section-title {
    font-size: clamp(1.9rem, 9vw, 2.7rem);
  }

  .environment-choice-card {
    min-height: 0;
    padding: 25px;
    border-radius: 22px;
  }

  .environment-choice-card h2 {
    margin: 40px 0 12px;
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .environment-choice-stats {
    gap: 18px;
    padding: 24px 0 20px;
  }

  .environment-choice-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .environment-choice-actions .btn {
    width: 100%;
  }

  .feature-card,
  .environment-module-card {
    min-height: 0;
    padding: 22px;
  }

  .icon-box {
    margin-bottom: 22px;
  }

  .dashboard-preview {
    min-height: 0;
    padding: 12px;
    border-radius: 24px;
  }

  .preview-window {
    min-height: 0;
    padding: 15px;
    border-radius: 18px;
  }

  .window-bar {
    margin-bottom: 15px;
  }

  .preview-stat {
    padding: 16px;
    border-radius: 15px;
  }

  .preview-stat strong {
    font-size: 1.65rem;
  }

  .mini-card {
    min-height: 116px;
    padding: 15px;
    border-radius: 15px;
  }

  .environment-hero-art {
    width: min(90%, 370px);
    margin-top: -8px;
    border-radius: 21px;
    transform: none !important;
  }

  .toolbar {
    margin: 22px 0;
  }

  .filters {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 1px 7px;
  }

  .filters .chip {
    flex: 0 0 auto;
    min-height: 42px;
  }

  .course-count-row {
    justify-content: flex-start;
    margin-top: -5px;
  }

  .course-cover {
    min-height: 140px;
    padding: 19px;
  }

  .course-cover h3 {
    margin-top: 34px;
    font-size: 1.55rem;
  }

  .course-body {
    padding: 19px;
  }

  .course-meta {
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .card-actions {
    align-items: stretch;
  }

  .card-actions .btn {
    flex: 1;
  }

  .lesson,
  .quiz-card,
  .quiz-result,
  .panel,
  .profile-card,
  .cta,
  .brain-teaser-card {
    padding: 20px;
  }

  .lesson h2 {
    font-size: 1.75rem;
  }

  .lesson h3,
  .lesson > section[data-course-section] h3 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .lesson p,
  .lesson li {
    line-height: 1.7;
  }

  .formula {
    margin: 20px 0;
    padding: 17px;
    font-size: .94rem;
    white-space: nowrap;
  }

  .formula-variables {
    padding: 14px 15px;
  }

  .worked-example,
  .detail-callout,
  .note {
    padding: 16px;
  }

  .course-tools {
    margin: 22px 0 28px;
    padding: 17px;
  }

  .course-progress-header {
    align-items: flex-start;
  }

  .quiz-progress {
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .quiz-card h2 {
    font-size: clamp(1.6rem, 8vw, 2.15rem);
  }

  .answer span {
    min-height: 52px;
    padding: 15px;
    line-height: 1.55;
  }

  .quiz-actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quiz-actions .btn,
  .result-actions .btn {
    width: 100%;
  }

  .result-score {
    font-size: clamp(4rem, 25vw, 6rem);
  }

  .profile-card {
    text-align: left;
  }

  .profile-card .avatar {
    margin-left: 0;
  }

  .profile-bio {
    max-width: none;
    margin-inline: 0;
  }

  .profile-stat {
    text-align: center;
  }

  .panel-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .panel-header h2 {
    font-size: 1.48rem;
  }

  .profile-env-stats {
    grid-template-columns: 1fr;
  }

  .profile-env-stats div {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .profile-env-stats strong {
    order: 2;
    text-align: right;
  }

  .profile-env-stats span {
    order: 1;
    font-size: .8rem;
  }

  .activity-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .activity-row .score {
    grid-column: 2;
    justify-self: start;
  }

  .brain-timer-panel {
    padding: 16px;
  }

  .brain-prompt {
    font-size: 1rem;
  }

  .brain-assessment-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brain-assessment-buttons .btn {
    width: 100%;
  }

  .legal-document {
    padding: 20px;
  }

  .legal-document h2 {
    padding-right: 0;
  }

  .legal-section-number {
    position: static;
    display: block;
    margin-bottom: 9px;
  }

  .legal-table,
  .course-table {
    font-size: .84rem;
  }

  .footer {
    padding-top: 28px;
  }

  .footer-inner {
    align-items: center;
    text-align: center;
  }

  .footer-links {
    width: 100%;
    justify-content: center;
    gap: 10px 16px;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(calc(100% - 20px), var(--container));
  }

  .brand {
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .menu-label {
    width: 40px;
    height: 40px;
  }

  .nav-links {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
  }

  .environment-switch-link {
    max-width: 145px;
    font-size: .75rem;
    line-height: 1.25;
  }

  .environment-identity strong {
    font-size: .88rem;
  }

  .environment-subnav-link {
    padding-inline: 11px;
    font-size: .82rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn,
  .daily-preview-card .btn,
  .brain-actions .btn {
    width: 100%;
  }

  .trust-row span {
    font-size: .84rem;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .mini-card {
    min-height: 100px;
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 22px;
  }

  .course-tools-actions {
    display: grid;
    width: 100%;
  }

  .course-tools-actions .btn {
    width: 100%;
  }

  .sidebar {
    margin-inline: -1px;
  }

  .lesson-nav,
  .lesson-nav-three {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lesson-nav .btn,
  .lesson-nav-three .btn {
    width: 100%;
  }

  .dialog-header {
    gap: 14px;
  }

  .profile-dialog {
    width: calc(100% - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 20px;
  }

  .profile-form {
    padding: 18px;
  }

  .dialog-header h2 {
    font-size: 1.7rem;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: auto;
    text-align: center;
    border-radius: 16px;
    transform: translateY(14px);
  }

  .toast.is-visible {
    transform: translateY(0);
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
  }
}

@media (hover: none) {
  .btn:hover,
  .course-card:hover,
  .quiz-choice:hover,
  .mini-card-link:hover,
  .favorite-label:hover {
    transform: none;
  }
}


/* ==========================================================================
   Reliable mobile navigation fix
   ========================================================================== */

.menu-label {
  padding: 0;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

@media (min-width: 981px) {
  #primary-navigation[hidden] {
    display: flex;
  }

  .home-theme-gray .dual-hero h1 {
    font-size: clamp(2.7rem, 5.45vw, 5.2rem);
  }
}

@media (max-width: 980px) {
  #primary-navigation[hidden] {
    display: none !important;
  }

  #primary-navigation:not([hidden]) {
    display: flex !important;
  }

  .menu-label[aria-expanded="true"]::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .menu-label[aria-expanded="true"] span {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(.25);
  }

  .menu-label[aria-expanded="true"]::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .nav.menu-open .nav-links {
    animation: vx-mobile-menu-enter .2s ease-out both;
  }
}


/* ==========================================================================
   Homepage alignment and transparent metrics
   ========================================================================== */

.home-theme-gray .environment-choice-card .domain-pill {
  min-width: 142px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  line-height: 1;
  text-align: center;
}

.home-theme-gray .trust-row span {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}


/* ==========================================================================
   Profile dashboard action buttons
   ========================================================================== */

.profile-environment-grid .panel-header > .btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: .78rem;
  line-height: 1;
  white-space: nowrap;
}


/* ==========================================================================
   Requested content and layout refinements
   ========================================================================== */

.home-theme-gray .home-main-title {
  font-size: clamp(2.3rem, 4.45vw, 4.25rem);
  line-height: 1.01;
}

.environment-hero .environment-main-title {
  max-width: 760px;
  font-size: clamp(2.35rem, 4.55vw, 4.4rem);
  line-height: 1.01;
}

.course-standards {
  margin-top: 8px;
  margin-bottom: 26px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 18px;
  align-items: start;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent-soft) 62%, white);
}

.course-standards strong {
  color: var(--accent);
  white-space: nowrap;
}

.course-standards p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.professional-check {
  margin: 20px 0 28px;
  padding: 17px 19px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 0 15px 15px 0;
  background: color-mix(in srgb, var(--accent-soft) 68%, white);
}

.professional-check strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
}

.professional-check p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.brain-level-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 17px 18px;
  border: 1px solid var(--brain-line, var(--line));
  border-radius: 17px;
  background: var(--brain-rose, var(--surface-soft));
}

.brain-level-selector > div:first-child {
  display: grid;
  gap: 3px;
}

.brain-level-selector span {
  color: var(--muted);
  font-size: .82rem;
}

.brain-level-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.brain-level-buttons .btn {
  min-height: 36px;
  padding-inline: 12px;
}

.brain-level-buttons .active {
  color: #fff;
  border-color: var(--brain-bordeaux, var(--accent));
  background: var(--brain-bordeaux, var(--accent));
}

.brain-timer-panel {
  align-items: center;
}

.profile-environment-grid {
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.profile-environment-grid > .panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.profile-environment-grid > .panel .progress {
  margin-top: auto;
}

.profile-environment-grid .profile-progress-title {
  font-size: 1.2rem;
  line-height: 1.18;
  letter-spacing: -.02em;
}

@media (max-width: 760px) {
  .home-theme-gray .home-main-title {
    font-size: clamp(2.15rem, 10.5vw, 3.15rem);
  }

  .environment-hero .environment-main-title {
    font-size: clamp(2.15rem, 10.5vw, 3.2rem);
  }

  .course-standards {
    grid-template-columns: 1fr;
  }

  .course-standards strong {
    white-space: normal;
  }

  .brain-level-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .brain-level-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brain-level-buttons .btn {
    width: 100%;
  }
}


/* ==========================================================================
   Final typography, formula and alignment refinements
   ========================================================================== */

/* Homepage title: exactly two controlled lines. */
.home-theme-gray .home-main-title {
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

.home-theme-gray .home-title-line {
  display: block;
  white-space: nowrap;
}

/* MathJax-rendered formulas across every Corporate and Market course. */
.lesson .formula {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 20px 22px;
  text-align: center;
  white-space: normal;
  font-family: var(--font-sans);
}

.lesson .formula mjx-container[jax="CHTML"][display="true"] {
  width: max-content;
  min-width: min-content;
  max-width: none;
  margin: .1em auto !important;
  padding: 2px 0;
  font-size: 1.06em;
}

.lesson .formula mjx-container[display="true"] {
  overflow: visible;
}

/* Equal-width and perfectly aligned Brain Teaser level controls. */
.brain-level-buttons {
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 7px;
}

.brain-level-buttons .btn {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding-inline: 8px;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
}

/* Rigid shared structure for Corporate and Market progression panels. */
.profile-environment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.profile-environment-grid > .panel {
  min-width: 0;
  min-height: 252px;
  height: 100%;
  display: grid;
  grid-template-rows: 92px minmax(0, 1fr) auto;
  align-content: stretch;
}

.profile-environment-grid > .panel .panel-header {
  min-height: 92px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.profile-environment-grid > .panel .panel-header > div {
  min-width: 0;
}

.profile-environment-grid .domain-pill {
  min-width: 140px;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.profile-environment-grid .profile-progress-title {
  min-height: 1.45em;
  margin-top: 10px;
  white-space: nowrap;
}

.profile-environment-grid .profile-env-stats {
  width: 100%;
  margin: 18px 0;
  align-self: stretch;
}

.profile-environment-grid > .panel .progress {
  width: 100%;
  align-self: end;
  margin-top: 0;
}

@media (max-width: 760px) {
  .home-theme-gray .home-main-title {
    font-size: clamp(1.9rem, 9.4vw, 3rem);
  }

  .brain-level-buttons {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .brain-level-buttons .btn {
    min-height: 40px;
    padding-inline: 4px;
    font-size: clamp(.68rem, 2.7vw, .78rem);
  }

  .lesson .formula {
    padding: 17px 15px;
  }

  .lesson .formula mjx-container[jax="CHTML"][display="true"] {
    font-size: .96em;
  }

  .profile-environment-grid {
    grid-template-columns: 1fr;
  }

  .profile-environment-grid > .panel {
    min-height: 244px;
  }
}

@media (max-width: 380px) {
  .home-theme-gray .home-main-title {
    font-size: 1.8rem;
  }

  .brain-level-buttons .btn {
    font-size: .65rem;
  }
}


/* ==========================================================================
   Final visual alignment corrections
   ========================================================================== */

/* Homepage: reserve enough room for the text and prevent image overlap. */
.home-theme-gray .dual-hero-inner {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: clamp(2.4rem, 5vw, 5.2rem);
}

.home-theme-gray .home-hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.home-theme-gray .home-hero-visual {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.home-theme-gray .home-main-title {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  font-size: clamp(2.2rem, 4.1vw, 4rem);
}

.home-theme-gray #environments .section-header > div {
  max-width: none;
}

.home-theme-gray #environments .section-title {
  white-space: nowrap;
  font-size: clamp(1.8rem, 3.35vw, 3.25rem);
}

/* Variable labels: all are rendered as normalized inline mathematics. */
.formula-variables dt {
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 700;
}

.formula-variables dt mjx-container[jax="CHTML"] {
  margin: 0 !important;
  font-size: 1.02em;
}

/* Brain Teaser title and level buttons. */
.brain-theme-bordeaux .page-hero h1 {
  white-space: nowrap;
  font-size: clamp(1.55rem, 4vw, 3.8rem);
}

.brain-level-buttons {
  width: min(100%, 450px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brain-level-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  overflow: hidden;
  padding: 0 6px;
  line-height: 1;
  text-align: center;
}

/* Profile: remove staggered reveal displacement and lock both cards to one row. */
.profile-environment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 18px;
}

.profile-environment-grid > .panel {
  align-self: stretch;
  margin: 0 !important;
  inset: auto !important;
  transform: none !important;
}

.profile-environment-grid > .panel[data-vx-reveal],
.profile-environment-grid > .panel[data-vx-reveal].is-visible {
  opacity: 1;
  transform: none !important;
  transition: none !important;
  transition-delay: 0ms !important;
}

.profile-environment-grid > .panel .panel-header,
.profile-environment-grid > .panel .profile-env-stats,
.profile-environment-grid > .panel .progress {
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 900px) {
  .home-theme-gray .dual-hero-inner {
    grid-template-columns: 1fr;
  }

  .home-theme-gray .home-main-title {
    width: max-content;
    margin-inline: auto;
    font-size: clamp(2rem, 8.8vw, 3.25rem);
  }

  .profile-environment-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-theme-gray #environments .section-title {
    font-size: clamp(1.08rem, 5.2vw, 2rem);
    letter-spacing: -.035em;
  }

  .brain-theme-bordeaux .page-hero h1 {
    font-size: clamp(1.28rem, 5.8vw, 1.8rem);
  }

  .brain-level-buttons {
    gap: 4px;
  }

  .brain-level-buttons .btn {
    min-height: 40px;
    padding-inline: 2px;
    font-size: clamp(.65rem, 2.65vw, .76rem);
  }
}


/* ==========================================================================
   Homepage title collision fix
   ========================================================================== */

@media (min-width: 901px) {
  .home-theme-gray .dual-hero-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: clamp(3rem, 5.5vw, 5.8rem);
  }

  .home-theme-gray .home-main-title {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2rem, 3.25vw, 3.3rem);
    line-height: 1.01;
    letter-spacing: -.045em;
  }

  .home-theme-gray .home-hero-visual {
    width: min(100%, 455px);
    justify-self: end;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .home-theme-gray .dual-hero-inner {
    grid-template-columns: minmax(0, 1.24fr) minmax(260px, .76fr);
    gap: 2.6rem;
  }

  .home-theme-gray .home-main-title {
    font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  }

  .home-theme-gray .home-hero-visual {
    width: min(100%, 390px);
  }
}
