:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --bg: #f5f3ed;
  --bg-elevated: #ffffff;
  --bg-soft: #ece9df;
  --bg-strong: #12372a;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --text: #17231f;
  --text-soft: #58645f;
  --text-faint: #7b8580;
  --inverse: #f8faf7;
  --primary: #176b50;
  --primary-strong: #0f513c;
  --primary-soft: #dceee7;
  --accent: #d8a524;
  --accent-strong: #9e7210;
  --accent-soft: #fff1c4;
  --blue: #2e6f95;
  --blue-soft: #e2f0f7;
  --coral: #b85f4b;
  --coral-soft: #f9e7e1;
  --violet: #6e5a92;
  --violet-soft: #eee8f7;
  --success: #26754f;
  --success-soft: #e0f2e8;
  --warning: #9a6500;
  --warning-soft: #fff2d3;
  --danger: #a33c35;
  --danger-soft: #fbe7e5;
  --border: #d9ddd8;
  --border-strong: #bcc5bf;
  --shadow-sm: 0 1px 2px rgba(19, 32, 26, 0.06), 0 4px 12px rgba(19, 32, 26, 0.04);
  --shadow-md: 0 10px 35px rgba(19, 32, 26, 0.11);
  --shadow-lg: 0 24px 70px rgba(19, 32, 26, 0.18);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --sidebar-width: 286px;
  --topbar-height: 70px;
  --content-max: 1180px;
  --focus: 0 0 0 3px rgba(46, 111, 149, 0.28);
}

html[data-theme="dark"] {
  --bg: #101713;
  --bg-elevated: #18221d;
  --bg-soft: #202b26;
  --bg-strong: #0b2f22;
  --panel: rgba(24, 34, 29, 0.88);
  --panel-solid: #18221d;
  --text: #edf3ef;
  --text-soft: #afbbb4;
  --text-faint: #839087;
  --inverse: #f8faf7;
  --primary: #6fc3a2;
  --primary-strong: #91d5ba;
  --primary-soft: #173d30;
  --accent: #edc75f;
  --accent-strong: #ffd97b;
  --accent-soft: #3b3219;
  --blue: #78b5d8;
  --blue-soft: #173447;
  --coral: #e08a75;
  --coral-soft: #41251f;
  --violet: #b5a1d5;
  --violet-soft: #312943;
  --success: #77c99b;
  --success-soft: #173b29;
  --warning: #efc66c;
  --warning-soft: #3a3018;
  --danger: #ef8f89;
  --danger-soft: #422220;
  --border: #33423a;
  --border-strong: #4a5c52;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22), 0 5px 18px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.4);
  --focus: 0 0 0 3px rgba(120, 181, 216, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 4%, rgba(216, 165, 36, 0.09), transparent 28rem),
    radial-gradient(circle at 20% 75%, rgba(23, 107, 80, 0.07), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.modal-open,
body.sidebar-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

svg {
  overflow: visible;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.65rem);
}

h3 {
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg-elevated);
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 12px 17px 10px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--bg-strong);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: -2px;
  color: var(--text-soft);
  font-size: 0.71rem;
  letter-spacing: 0.01em;
}

.icon-button.sidebar-close {
  display: none;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--bg-soft);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg,
.quiet-button svg,
.search-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-progress {
  margin: 8px 16px 18px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.progress-copy strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 400ms ease;
}

#sidebar-nav {
  padding: 0 10px 22px;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-label {
  display: block;
  padding: 0 12px 7px;
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 630;
  line-height: 1.25;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover {
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-link.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -10px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.nav-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.nav-link.active .nav-number {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--panel-solid);
  color: var(--primary-strong);
}

.nav-link.completed .nav-number {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.nav-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: var(--success);
}

.nav-check svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer p {
  margin: 8px 8px 0;
  color: var(--text-faint);
  font-size: 0.69rem;
  line-height: 1.4;
}

.quiet-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.quiet-button:hover {
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text);
}

.full-width {
  width: 100%;
}

.sidebar-scrim {
  position: fixed;
  z-index: 35;
  inset: 0;
  background: rgba(5, 14, 10, 0.54);
  backdrop-filter: blur(2px);
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.menu-button {
  display: none;
}

.breadcrumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.82rem;
  white-space: nowrap;
}

.breadcrumbs strong {
  max-width: 48vw;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
}

.breadcrumb-separator {
  color: var(--border-strong);
}

.search-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.79rem;
  transition: background 150ms ease, border-color 150ms ease;
}

.search-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-solid);
}

.search-button kbd {
  min-width: 23px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  text-align: center;
}

.theme-moon {
  display: none;
}

html[data-theme="dark"] .theme-sun {
  display: none;
}

html[data-theme="dark"] .theme-moon {
  display: block;
}

#main-content {
  min-height: calc(100vh - var(--topbar-height));
  padding: 34px 34px 80px;
}

.page-shell {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  animation: page-in 250ms ease both;
}

@keyframes page-in {
  from {
    transform: translateY(4px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.page-loading {
  display: grid;
  min-height: 60vh;
  place-content: center;
  justify-items: center;
  color: var(--text-soft);
}

.loading-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.hero {
  position: relative;
  display: grid;
  min-height: 470px;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  overflow: hidden;
  padding: clamp(36px, 6vw, 72px);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 18%, rgba(244, 201, 93, 0.24), transparent 16rem),
    linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 85%, var(--panel-solid)), var(--panel-solid));
  box-shadow: var(--shadow-md);
}

.hero::after {
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 25rem;
  height: 25rem;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 45px color-mix(in srgb, var(--primary) 4%, transparent),
    0 0 0 90px color-mix(in srgb, var(--primary) 3%, transparent);
}

.hero-copy,
.hero-visual {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 19px;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 27px;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.text-button:hover {
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--primary-strong);
  background: var(--primary-strong);
  color: var(--inverse);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 26%, transparent);
}

.primary-button svg,
.secondary-button svg,
.text-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button {
  border: 1px solid var(--border-strong);
  background: var(--panel-solid);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.text-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--primary-strong);
}

.text-button:hover {
  background: var(--primary-soft);
}

.danger-button {
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 31px;
}

.hero-stat {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  backdrop-filter: blur(8px);
}

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  color: var(--text-faint);
  font-size: 0.7rem;
}

.city-visual {
  position: relative;
  display: grid;
  min-height: 320px;
  place-items: center;
}

.city-orbit {
  position: absolute;
  width: 285px;
  height: 285px;
  border: 1px dashed color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 50%;
  animation: rotate 35s linear infinite;
}

.city-orbit::before,
.city-orbit::after {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 4px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  content: "";
}

.city-orbit::before {
  top: 19px;
  left: 45px;
}

.city-orbit::after {
  right: 18px;
  bottom: 62px;
  background: var(--blue);
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.city-card {
  position: relative;
  z-index: 2;
  width: min(100%, 320px);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.city-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.city-card-head span:first-child {
  font-size: 0.75rem;
  font-weight: 750;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.skyline {
  display: flex;
  height: 140px;
  align-items: end;
  gap: 7px;
  padding: 14px 14px 0;
  border-radius: 15px;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--blue-soft) 75%, var(--panel-solid)), var(--panel-solid));
}

.building {
  position: relative;
  flex: 1;
  min-width: 17px;
  border-radius: 4px 4px 0 0;
  background: var(--primary-strong);
  opacity: 0.92;
}

.building:nth-child(2n) {
  background: var(--blue);
}

.building:nth-child(3n) {
  background: var(--accent-strong);
}

.building::after {
  position: absolute;
  inset: 8px 5px auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.62);
  content: "";
  box-shadow: 0 12px rgba(255, 255, 255, 0.42), 0 24px rgba(255, 255, 255, 0.42), 0 36px rgba(255, 255, 255, 0.42);
}

.city-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.city-card-metrics div {
  padding: 8px;
  border-radius: 9px;
  background: var(--bg-soft);
  text-align: center;
}

.city-card-metrics strong,
.city-card-metrics span {
  display: block;
}

.city-card-metrics strong {
  font-size: 0.8rem;
}

.city-card-metrics span {
  color: var(--text-faint);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.section {
  margin-top: 54px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 6px;
}

.section-heading p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--text-soft);
}

.section-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.resume-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 21px 23px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.resume-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 1.3rem;
  font-weight: 800;
}

.resume-card h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.resume-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.87rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  position: relative;
  display: flex;
  min-height: 285px;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--module-color, var(--primary));
  content: "";
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--module-color, var(--primary)) 40%, var(--border));
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.module-icon {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--module-color, var(--primary)) 13%, var(--panel-solid));
  color: var(--module-color, var(--primary));
}

.module-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-number {
  color: var(--text-faint);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.module-card h3 {
  margin-bottom: 10px;
  font-size: 1.19rem;
}

.module-card p {
  margin-bottom: 20px;
  color: var(--text-soft);
  font-size: 0.87rem;
  line-height: 1.55;
}

.module-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 750;
}

.card-status.complete {
  color: var(--success);
}

.card-status.in-progress {
  color: var(--warning);
}

.mini-progress {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--module-color, var(--primary));
}

.pathway {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.pathway::before {
  position: absolute;
  top: 54px;
  right: 10%;
  left: 10%;
  height: 2px;
  background: var(--border);
  content: "";
}

.path-step {
  position: relative;
  z-index: 1;
  text-align: center;
}

.path-dot {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 13px;
  place-items: center;
  border: 5px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--primary);
  color: var(--inverse);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 0.73rem;
  font-weight: 800;
}

.path-step:nth-child(2) .path-dot { background: var(--blue); }
.path-step:nth-child(3) .path-dot { background: var(--accent-strong); }
.path-step:nth-child(4) .path-dot { background: var(--violet); }

.path-step h3 {
  margin-bottom: 5px;
  font-size: 0.93rem;
}

.path-step p {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.45;
}

.mental-model {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.model-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.model-card-number {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 800;
}

.model-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.model-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.callout-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 16px;
  background: var(--accent-soft);
}

.callout-banner-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 22%, var(--panel-solid));
  color: var(--accent-strong);
  font-weight: 900;
}

.callout-banner h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.callout-banner p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 75%, var(--accent-strong));
  font-size: 0.84rem;
}

.module-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--module-color) 20%, transparent), transparent 20rem),
    linear-gradient(145deg, color-mix(in srgb, var(--module-color) 9%, var(--panel-solid)), var(--panel-solid));
  box-shadow: var(--shadow-sm);
}

.module-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: end;
  gap: 40px;
}

.module-hero .module-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 17px;
  color: var(--module-color);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.module-hero .module-label span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--module-color) 13%, var(--panel-solid));
}

.module-hero h1 {
  max-width: 800px;
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.module-hero-lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
}

.module-meta-panel {
  display: grid;
  gap: 10px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--module-color) 22%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-solid) 80%, transparent);
  backdrop-filter: blur(8px);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.meta-row strong {
  color: var(--text);
  font-size: 0.79rem;
}

.module-tabbar {
  position: sticky;
  z-index: 20;
  top: calc(var(--topbar-height) + 10px);
  display: flex;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 28px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.module-tabbar::-webkit-scrollbar {
  display: none;
}

.module-tab {
  display: inline-flex;
  min-width: max-content;
  min-height: 39px;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 720;
}

.module-tab:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.module-tab.active {
  background: var(--module-color);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.module-tab svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: start;
  gap: 28px;
}

.lesson-main {
  min-width: 0;
}

.lesson-aside {
  position: sticky;
  top: calc(var(--topbar-height) + 84px);
  display: grid;
  gap: 14px;
}

.aside-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.aside-card h3 {
  margin-bottom: 9px;
  font-size: 0.92rem;
}

.aside-card p,
.aside-card li {
  color: var(--text-soft);
  font-size: 0.77rem;
  line-height: 1.5;
}

.aside-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.lesson-section {
  padding: clamp(24px, 4vw, 39px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.lesson-section + .lesson-section {
  margin-top: 18px;
}

.lesson-section-number {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--module-color);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.lesson-section h2 {
  margin-bottom: 17px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.lesson-section > p,
.prose p {
  color: var(--text-soft);
}

.lesson-section > p + p,
.prose p + p {
  margin-top: 1rem;
}

.learning-objectives {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.learning-objectives li {
  position: relative;
  padding: 13px 14px 13px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-solid);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.learning-objectives li::before {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-strong);
  content: "✓";
  font-size: 0.68rem;
  font-weight: 900;
}

.concept-grid,
.comparison-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 22px;
}

.concept-card,
.comparison-card,
.case-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
}

.concept-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--module-color) 12%, var(--panel-solid));
  color: var(--module-color);
  font-size: 0.86rem;
  font-weight: 850;
}

.concept-card h3,
.comparison-card h3,
.case-card h3 {
  margin-bottom: 7px;
  font-size: 1rem;
}

.concept-card p,
.comparison-card p,
.case-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.81rem;
  line-height: 1.55;
}

.comparison-card.positive {
  border-top: 3px solid var(--success);
}

.comparison-card.caution {
  border-top: 3px solid var(--coral);
}

.case-card {
  background: color-mix(in srgb, var(--blue-soft) 45%, var(--panel-solid));
}

.case-label {
  display: inline-flex;
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.formula-card {
  margin-top: 21px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--module-color) 28%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--module-color) 6%, var(--panel-solid));
}

.formula-label {
  display: block;
  margin-bottom: 8px;
  color: var(--module-color);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.formula {
  overflow-x: auto;
  padding: 5px 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.24rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.formula-explanation {
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.formula-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.formula-legend div {
  display: flex;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.formula-legend strong {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-serif);
}

.term {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted currentColor;
  background: transparent;
  color: var(--primary-strong);
  cursor: help;
  font-weight: 680;
}

.term:hover {
  border-bottom-style: solid;
}

.insight-box,
.caution-box,
.example-box {
  position: relative;
  margin-top: 20px;
  padding: 18px 18px 18px 51px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.insight-box {
  background: var(--primary-soft);
}

.caution-box {
  background: var(--warning-soft);
}

.example-box {
  background: var(--blue-soft);
}

.insight-box::before,
.caution-box::before,
.example-box::before {
  position: absolute;
  top: 17px;
  left: 17px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.insight-box::before {
  background: color-mix(in srgb, var(--primary) 18%, var(--panel-solid));
  color: var(--primary-strong);
  content: "i";
}

.caution-box::before {
  background: color-mix(in srgb, var(--warning) 18%, var(--panel-solid));
  color: var(--warning);
  content: "!";
}

.example-box::before {
  background: color-mix(in srgb, var(--blue) 18%, var(--panel-solid));
  color: var(--blue);
  content: "↗";
}

.insight-box strong,
.caution-box strong,
.example-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.insight-box p,
.caution-box p,
.example-box p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.81rem;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 23px;
  margin-top: 24px;
}

.process-step {
  position: relative;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
  text-align: center;
}

.process-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -18px;
  color: var(--text-faint);
  content: "→";
  font-weight: 800;
  transform: translateY(-50%);
}

.process-step strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.process-step span {
  color: var(--text-faint);
  font-size: 0.71rem;
  line-height: 1.4;
}

.simple-diagram {
  margin-top: 23px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel-solid);
}

.diagram-title {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.diagram-stage {
  min-height: 240px;
  padding: 18px;
}

.diagram-stage svg {
  width: 100%;
  height: auto;
}

.diagram-stage text {
  fill: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 11px;
}

.diagram-stage .axis {
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.diagram-stage .grid-line {
  stroke: var(--border);
  stroke-width: 0.8;
  stroke-dasharray: 4 5;
}

.diagram-stage .primary-line {
  fill: none;
  stroke: var(--module-color);
  stroke-width: 3;
  stroke-linecap: round;
}

.diagram-stage .secondary-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.diagram-stage .area {
  fill: color-mix(in srgb, var(--module-color) 15%, transparent);
}

.key-takeaway {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
  padding: 21px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 16px;
  background: var(--accent-soft);
}

.key-takeaway-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 20%, var(--panel-solid));
  color: var(--accent-strong);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
}

.key-takeaway h3 {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.key-takeaway p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 75%, var(--accent-strong));
  font-size: 0.84rem;
}

.tab-intro {
  max-width: 780px;
  margin: 0 auto 24px;
  text-align: center;
}

.tab-intro h2 {
  margin-bottom: 10px;
}

.tab-intro p {
  color: var(--text-soft);
}

.lab-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.lab-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 25px 27px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--module-color) 7%, var(--panel-solid));
}

.lab-header h2 {
  margin-bottom: 7px;
  font-size: 1.55rem;
}

.lab-header p {
  max-width: 720px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.lab-badge {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--module-color);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.lab-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 520px;
}

.lab-controls {
  padding: 25px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 55%, var(--panel-solid));
}

.lab-controls h3 {
  margin-bottom: 4px;
  font-size: 0.96rem;
}

.lab-controls > p {
  margin-bottom: 20px;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.control-group + .control-group {
  margin-top: 22px;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.control-label-row label,
.control-label-row .control-label {
  color: var(--text);
  font-size: 0.79rem;
  font-weight: 720;
}

.control-value {
  min-width: 57px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-solid);
  color: var(--module-color);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.control-help {
  display: block;
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 0.67rem;
  line-height: 1.4;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 5px 0;
  border-radius: 999px;
  background: linear-gradient(to right, var(--module-color) 0 var(--range-progress, 50%), var(--border) var(--range-progress, 50%) 100%);
  cursor: pointer;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 19px;
  height: 19px;
  border: 3px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--module-color);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.24);
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--module-color);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.24);
}

select,
input[type="number"],
input[type="text"],
input[type="search"],
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--text);
}

select,
input[type="number"],
input[type="text"],
input[type="search"] {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  min-height: 230px;
  padding: 14px;
  line-height: 1.6;
  resize: vertical;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: 1px solid var(--border);
}

.toggle-copy strong,
.toggle-copy span {
  display: block;
}

.toggle-copy strong {
  font-size: 0.77rem;
}

.toggle-copy span {
  color: var(--text-faint);
  font-size: 0.65rem;
}

.switch {
  position: relative;
  width: 43px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background 150ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 150ms ease;
}

.switch input:checked + .switch-track {
  background: var(--module-color);
}

.switch input:checked + .switch-track::after {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  box-shadow: var(--focus);
}

.lab-reset {
  width: 100%;
  margin-top: 24px;
}

.lab-output {
  min-width: 0;
  padding: 25px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  min-height: 2.2em;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 0.64rem;
  font-weight: 720;
  line-height: 1.25;
  text-transform: uppercase;
}

.metric-card strong {
  overflow: hidden;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.2;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.62rem;
}

.metric-card.good strong { color: var(--success); }
.metric-card.warn strong { color: var(--warning); }
.metric-card.bad strong { color: var(--danger); }

.chart-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel-solid);
}

.chart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 16px 10px;
}

.chart-header h3 {
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.chart-header p {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.66rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--text-faint);
  font-size: 0.63rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: var(--swatch, var(--module-color));
}

.chart-area {
  position: relative;
  min-height: 300px;
  padding: 3px 12px 12px;
}

.chart-area svg {
  width: 100%;
  height: auto;
}

.chart-area text {
  fill: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 10px;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.chart-line-primary {
  fill: none;
  stroke: var(--module-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-secondary {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-tertiary {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area-fill {
  fill: color-mix(in srgb, var(--module-color) 12%, transparent);
}

.chart-dot {
  fill: var(--panel-solid);
  stroke: var(--module-color);
  stroke-width: 3;
}

.chart-annotation {
  fill: var(--text) !important;
  font-size: 10px !important;
  font-weight: 700;
}

.lab-interpretation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg-soft);
}

.interpretation-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.83rem;
  font-weight: 900;
}

.lab-interpretation strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.lab-interpretation p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.lab-footnote {
  margin: 13px 2px 0;
  color: var(--text-faint);
  font-size: 0.65rem;
}

.lab-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
}

.lab-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.lab-table th,
.lab-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lab-table th:first-child,
.lab-table td:first-child {
  text-align: left;
}

.lab-table thead th {
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.lab-table input[type="number"] {
  width: 76px;
  min-height: 34px;
  padding: 5px 7px;
  text-align: right;
}

.population-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.district-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
}

.district-card h3 {
  margin-bottom: 9px;
  font-size: 0.84rem;
}

.dot-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.person-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--module-color);
}

.person-dot.group-b {
  background: var(--accent);
}

.funnel {
  display: grid;
  gap: 7px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-solid);
}

.funnel-step {
  display: grid;
  min-height: 42px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-inline: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--module-color) 13%, var(--panel-solid));
  color: var(--text);
  font-size: 0.71rem;
}

.funnel-step strong {
  font-variant-numeric: tabular-nums;
}

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

.quiz-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.quiz-progress-track {
  height: 7px;
  margin-bottom: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.quiz-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--module-color);
  transition: width 250ms ease;
}

.quiz-card {
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.question-label {
  display: inline-flex;
  margin-bottom: 13px;
  color: var(--module-color);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quiz-card h2 {
  margin-bottom: 22px;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.35;
}

.answer-list {
  display: grid;
  gap: 10px;
}

.answer-option {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-solid);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.answer-option:hover {
  transform: translateY(-1px);
  border-color: var(--module-color);
  background: color-mix(in srgb, var(--module-color) 5%, var(--panel-solid));
}

.answer-option.selected {
  border-color: var(--module-color);
  background: color-mix(in srgb, var(--module-color) 9%, var(--panel-solid));
}

.answer-option.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.answer-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.option-letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.answer-option.selected .option-letter {
  border-color: var(--module-color);
  background: var(--module-color);
  color: #ffffff;
}

.quiz-explanation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 15px;
  border-radius: 13px;
}

.quiz-explanation.correct {
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--border));
  background: var(--success-soft);
}

.quiz-explanation.incorrect {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  background: var(--danger-soft);
}

.quiz-explanation-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--panel-solid);
  font-weight: 900;
}

.quiz-explanation.correct .quiz-explanation-mark { color: var(--success); }
.quiz-explanation.incorrect .quiz-explanation-mark { color: var(--danger); }

.quiz-explanation strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.81rem;
}

.quiz-explanation p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 21px;
}

.quiz-result {
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.score-ring {
  position: relative;
  display: grid;
  width: 145px;
  height: 145px;
  margin: 0 auto 23px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--module-color) calc(var(--score) * 1%), var(--border) 0);
}

.score-ring::before {
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--panel-solid);
  content: "";
}

.score-ring span {
  position: relative;
  z-index: 1;
  font-size: 1.8rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.quiz-result h2 {
  margin-bottom: 9px;
}

.quiz-result > p {
  max-width: 600px;
  margin: 0 auto 22px;
  color: var(--text-soft);
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-width: 520px;
  margin: 22px auto;
}

.result-summary div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-solid);
}

.result-summary strong,
.result-summary span {
  display: block;
}

.result-summary strong {
  font-size: 1.05rem;
}

.result-summary span {
  color: var(--text-faint);
  font-size: 0.65rem;
}

.notes-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
}

.notes-card,
.prompt-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.notes-card h2,
.prompt-card h2 {
  margin-bottom: 7px;
  font-size: 1.25rem;
}

.notes-card > p,
.prompt-card > p {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.reflection-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: reflection;
}

.reflection-list li {
  position: relative;
  padding: 11px 11px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-solid);
  color: var(--text-soft);
  font-size: 0.75rem;
  counter-increment: reflection;
}

.reflection-list li::before {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 7px;
  background: var(--module-color);
  color: #ffffff;
  content: counter(reflection);
  font-size: 0.62rem;
  font-weight: 800;
}

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

.page-header h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

.page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--text-soft);
}

.search-field {
  position: relative;
  min-width: min(100%, 320px);
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 40px;
}

.glossary-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.filter-chip {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.glossary-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.glossary-card h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.glossary-card p {
  margin-bottom: 11px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.term-category {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-faint);
  font-size: 0.61rem;
  font-weight: 780;
  text-transform: uppercase;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 50px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  text-align: center;
}

.formula-list {
  display: grid;
  gap: 14px;
}

.formula-sheet-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 25px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.formula-sheet-card h2 {
  margin-bottom: 7px;
  font-size: 1.07rem;
}

.formula-sheet-card .formula {
  font-size: 1.35rem;
}

.formula-sheet-card p,
.formula-sheet-card li {
  color: var(--text-soft);
  font-size: 0.79rem;
}

.formula-sheet-card ul {
  margin: 11px 0 0;
  padding-left: 18px;
}

.assessment-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: 38px;
  padding: clamp(30px, 5vw, 55px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 20%, rgba(244, 201, 93, 0.23), transparent 17rem),
    linear-gradient(145deg, var(--primary-soft), var(--panel-solid));
  box-shadow: var(--shadow-md);
}

.assessment-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.assessment-hero p {
  color: var(--text-soft);
}

.assessment-visual {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel-solid) 82%, transparent);
  box-shadow: inset 0 0 0 20px color-mix(in srgb, var(--primary) 5%, transparent);
}

.assessment-visual-inner {
  text-align: center;
}

.assessment-visual strong,
.assessment-visual span {
  display: block;
}

.assessment-visual strong {
  font-size: 3.4rem;
  line-height: 1;
}

.assessment-visual span {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 19px;
}

.readiness-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}

.readiness-card strong,
.readiness-card span {
  display: block;
}

.readiness-card strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.readiness-card span {
  color: var(--text-faint);
  font-size: 0.71rem;
}

.capstone-scenario {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.capstone-scenario h2 {
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.scenario-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.scenario-facts div {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-solid);
}

.scenario-facts strong,
.scenario-facts span {
  display: block;
}

.scenario-facts strong {
  font-size: 1rem;
}

.scenario-facts span {
  color: var(--text-faint);
  font-size: 0.64rem;
}

.certificate {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  padding: 62px;
  border: 10px double var(--accent-strong);
  background: #fffdf7;
  color: #17231f;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.certificate::before,
.certificate::after {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(23, 107, 80, 0.18);
  border-radius: 50%;
  content: "";
}

.certificate::before {
  top: -90px;
  left: -90px;
  box-shadow: 0 0 0 24px rgba(23, 107, 80, 0.04), 0 0 0 48px rgba(23, 107, 80, 0.03);
}

.certificate::after {
  right: -90px;
  bottom: -90px;
  box-shadow: 0 0 0 24px rgba(216, 165, 36, 0.05), 0 0 0 48px rgba(216, 165, 36, 0.03);
}

.certificate .brand-mark {
  margin: 0 auto 22px;
}

.certificate-kicker {
  color: #176b50;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.certificate h1 {
  margin: 12px 0 20px;
  color: #17231f;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 500;
}

.certificate-name {
  max-width: 600px;
  margin: 24px auto 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #9e7210;
  color: #12372a;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-style: italic;
}

.certificate p {
  max-width: 650px;
  margin-inline: auto;
  color: #58645f;
}

.certificate-meta {
  display: flex;
  justify-content: center;
  gap: 45px;
  margin-top: 34px;
}

.certificate-meta div {
  min-width: 160px;
  padding-top: 8px;
  border-top: 1px solid #bcc5bf;
}

.certificate-meta strong,
.certificate-meta span {
  display: block;
}

.certificate-meta strong {
  color: #17231f;
  font-size: 0.8rem;
}

.certificate-meta span {
  color: #7b8580;
  font-size: 0.68rem;
}

.resources-list {
  display: grid;
  gap: 13px;
}

.resource-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.resource-type {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.68rem;
  font-weight: 850;
}

.resource-card h2 {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.resource-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.resource-card a {
  min-width: max-content;
}

.modal {
  width: min(92vw, 640px);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(5, 14, 10, 0.62);
  backdrop-filter: blur(4px);
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-solid) 93%, transparent);
  backdrop-filter: blur(12px);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.45rem;
}

#term-dialog-body {
  padding: 22px;
}

#term-dialog-body p {
  color: var(--text-soft);
}

.term-example {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-soft);
}

.term-example strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.77rem;
}

.term-example p {
  margin: 0;
  font-size: 0.75rem;
}

.settings-grid {
  display: grid;
  gap: 0;
}

.settings-grid section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.settings-grid section:last-child {
  border-bottom: 0;
}

.settings-grid h3 {
  margin-bottom: 5px;
  font-size: 0.97rem;
}

.settings-grid p {
  margin-bottom: 14px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-soft);
}

.segmented-control button {
  min-height: 35px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 720;
}

.segmented-control button.active {
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.file-button {
  cursor: pointer;
}

.danger-zone {
  background: color-mix(in srgb, var(--danger-soft) 45%, var(--panel-solid));
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(400px, calc(100vw - 40px));
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--text);
  color: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  font-size: 0.79rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.noscript-message {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 40px;
  background: var(--bg);
  text-align: center;
}

.noscript-message h1 {
  font-size: 2rem;
}

@media (max-width: 1180px) {
  .module-grid,
  .glossary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.75fr);
    padding: 46px;
  }

  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: -1;
  }

  .lab-body {
    grid-template-columns: 300px minmax(0, 1fr);
  }

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

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(88vw, 310px);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .icon-button.sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .workspace {
    grid-column: auto;
  }

  .topbar {
    padding: 0 20px;
  }

  #main-content {
    padding-inline: 22px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual {
    display: none;
  }

  .module-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .lab-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-controls {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .assessment-hero {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .notes-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 62px;
  }

  body {
    font-size: 15px;
  }

  .topbar {
    padding: 0 12px;
  }

  .search-button span,
  .search-button kbd {
    display: none;
  }

  .search-button {
    width: 42px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }

  #main-content {
    padding: 22px 14px 65px;
  }

  .hero,
  .module-hero,
  .assessment-hero {
    padding: 29px 23px;
    border-radius: 21px;
  }

  .hero {
    min-height: auto;
  }

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

  .section {
    margin-top: 40px;
  }

  .section-heading,
  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .module-grid,
  .glossary-grid,
  .mental-model {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-card {
    min-height: 235px;
  }

  .resume-card,
  .callout-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .resume-card .primary-button,
  .callout-banner .text-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pathway {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 34px;
  }

  .pathway::before {
    top: 38px;
    bottom: 38px;
    left: 51px;
    width: 2px;
    height: auto;
  }

  .path-step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
    text-align: left;
  }

  .path-dot {
    margin: 0;
  }

  .path-step h3,
  .path-step p {
    grid-column: 2;
  }

  .path-step h3 {
    margin-bottom: 2px;
  }

  .path-step p {
    margin-top: -9px;
  }

  .module-meta-panel {
    grid-template-columns: 1fr;
  }

  .module-tabbar {
    top: calc(var(--topbar-height) + 6px);
    width: 100%;
    justify-content: flex-start;
  }

  .lesson-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .lesson-section {
    padding: 23px 19px;
  }

  .learning-objectives,
  .concept-grid,
  .comparison-grid,
  .case-grid,
  .formula-legend {
    grid-template-columns: minmax(0, 1fr);
  }

  .process-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .process-step:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -15px;
    content: "↓";
    transform: translateX(50%);
  }

  .lab-header {
    flex-direction: column;
    padding: 21px;
  }

  .lab-controls,
  .lab-output {
    padding: 20px;
  }

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

  .chart-area {
    min-height: 240px;
    overflow-x: auto;
  }

  .chart-area svg {
    min-width: 560px;
  }

  .population-visual {
    grid-template-columns: minmax(0, 1fr);
  }

  .quiz-card {
    padding: 23px 18px;
  }

  .quiz-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .quiz-actions .primary-button,
  .quiz-actions .secondary-button {
    width: 100%;
  }

  .result-summary,
  .readiness-grid,
  .scenario-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .formula-sheet-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-visual {
    display: none;
  }

  .resource-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .resource-card a {
    grid-column: 1 / -1;
    width: 100%;
  }

  .certificate {
    padding: 36px 20px;
    border-width: 6px;
  }

  .certificate-meta {
    align-items: center;
    flex-direction: column;
    gap: 20px;
  }

  .modal {
    width: min(96vw, 640px);
    max-height: 90vh;
    border-radius: 18px;
  }
}

@media (max-width: 430px) {
  .breadcrumbs span:not(.current-crumb),
  .breadcrumbs .breadcrumb-separator {
    display: none;
  }

  .breadcrumbs strong {
    max-width: 55vw;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-tab {
    padding-inline: 11px;
  }
}

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

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

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .module-tabbar,
  .print-hide,
  .toast {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
  }

  #main-content {
    padding: 0;
  }

  .page-shell {
    width: 100%;
  }

  .certificate {
    box-shadow: none;
    break-inside: avoid;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
