.domain-main {
  width: min(var(--max), calc(100% - var(--page-gutter)));
  margin: auto;
}

.domain-hero {
  padding: 52px 0 34px;
  scroll-margin-top: 96px;
}

.series-back-row {
  align-items: center;
  margin: 24px 0 0;
}

.back-to-domain-btn {
  width: fit-content;
  min-height: 46px;
  padding: 0 18px 0 10px;
  gap: 10px;
  border-color: rgba(46, 229, 139, 0.30);
  background:
    linear-gradient(135deg, rgba(46, 229, 139, 0.14), rgba(26, 199, 161, 0.06)),
    var(--card);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  font-size: 0.94rem;
  line-height: 1.1;
  white-space: normal;
}

.back-to-domain-btn:hover,
.back-to-domain-btn:focus-visible {
  color: var(--text);
  border-color: rgba(46, 229, 139, 0.68);
  background:
    linear-gradient(135deg, rgba(46, 229, 139, 0.20), rgba(26, 199, 161, 0.10)),
    var(--card-strong);
}

.back-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  background: var(--accent);
  color: #03140b;
  font-size: 1rem;
  font-weight: 950;
}

.domain-hero h1 {
  font-size: 4.8rem;
  line-height: 0.96;
  letter-spacing: 0;
  margin: 18px 0;
}

.domain-hero p,
.domain-card p,
.faq-card p,
.access-card p {
  color: var(--muted);
  line-height: 1.75;
}

.domain-hero > p:not(.career-kicker) {
  max-width: 920px;
  font-size: 1.08rem;
}

.domain-hero-stats {
  display: grid;
  grid-template-columns: 0.85fr 1.05fr 1.35fr;
  gap: 14px;
  margin: 28px 0 4px;
}

.domain-hero-stats article {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
}

.domain-hero-stats span,
.knowledge-section-head p,
.tool-chip-grid span {
  color: var(--accent);
  font-weight: 950;
}

.domain-hero-stats strong {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.domain-jump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
}

.domain-jump-list a {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
}

.domain-jump-list a:hover {
  color: var(--accent);
  border-color: rgba(46, 229, 139, 0.35);
  background: rgba(46, 229, 139, 0.06);
}

.domain-section {
  padding: 38px 0;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.domain-card,
.faq-card,
.access-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 22px;
}

.domain-card span,
.access-card span {
  color: var(--accent);
  font-weight: 950;
}

.knowledge-section {
  padding: 24px 0 34px;
}

.knowledge-section-head {
  max-width: 860px;
  margin-bottom: 20px;
}

.knowledge-section-head h2 {
  font-size: 2.45rem;
  line-height: 1.04;
  letter-spacing: 0;
  margin: 12px 0 8px;
}

.knowledge-section-head > p:not(.career-kicker) {
  color: var(--muted);
  line-height: 1.75;
}

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

.knowledge-feature h3,
.compact-knowledge-card h3 {
  margin: 12px 0 10px;
}

.knowledge-list {
  display: grid;
  gap: 11px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.knowledge-list li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.knowledge-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(46, 229, 139, 0.08);
}

.tool-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-chip-grid span {
  border: 1px solid rgba(46, 229, 139, 0.24);
  background: rgba(46, 229, 139, 0.08);
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 0.92rem;
}

.roadmap-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: roadmap;
}

.roadmap-list li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
}

.roadmap-list strong {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #03140b;
  font-size: 0.96rem;
}

.roadmap-list span {
  color: var(--text);
  line-height: 1.55;
  font-weight: 750;
}

.compact-knowledge-card {
  box-shadow: none;
  border-radius: 10px;
  padding: 12px;
}

.compact-knowledge-card p {
  margin-bottom: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.test-series-card {
  min-height: 84px;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}

.test-series-card span,
.test-series-card h3,
.test-series-card p {
  grid-column: 1;
}

.test-series-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.test-series-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.test-series-card a,
.test-series-card button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  width: auto;
  min-width: 62px;
  min-height: 30px;
  height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  white-space: nowrap;
  line-height: 1;
  font-size: 0.78rem;
}

.test-series-card .primary-btn {
  background: var(--soft-action);
  color: #03140b;
}

.test-series-card .primary-btn:hover,
.test-series-card .primary-btn:focus-visible {
  background: var(--soft-action-hover);
}

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

.access-card {
  margin-top: 18px;
}

.domain-test-link[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.78;
}

.test-runner-section.hidden {
  display: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 900px) {
  .domain-hero {
    padding-top: 40px;
  }

  .domain-hero h1 {
    font-size: clamp(1.48rem, 6.8vw, 1.72rem);
    line-height: 1.16;
  }

  .domain-grid,
  .domain-hero-stats,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-section-head h2 {
    font-size: clamp(1.28rem, 5.8vw, 1.55rem);
  }
}

@media (max-width: 380px) {
  .domain-main {
    width: min(var(--max), calc(100% - 56px));
    max-width: calc(100% - 56px);
    overflow-x: hidden;
  }

  .back-to-domain-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .domain-hero h1 {
    font-size: 1.75rem;
  }

  .roadmap-list li {
    grid-template-columns: 1fr;
  }
}

/* Compact typography for domain and test-series pages */
.domain-hero h1 {
  font-size: clamp(2.15rem, 4vw, 3.35rem);
  line-height: 1.06;
}

.domain-hero > p:not(.career-kicker) {
  font-size: 1rem;
}

.knowledge-section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.12;
}

.domain-card h3,
.faq-card h3,
.access-card h3,
.knowledge-feature h3,
.compact-knowledge-card h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.22;
}

@media (max-width: 640px) {
  .domain-main {
    width: min(var(--max), calc(100% - 56px));
    max-width: calc(100% - 56px);
  }

  .domain-hero h1 {
    font-size: clamp(1.48rem, 6.8vw, 1.72rem);
    line-height: 1.16;
  }

  .knowledge-section-head h2 {
    font-size: clamp(1.28rem, 5.8vw, 1.55rem);
    line-height: 1.18;
  }

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

  .test-series-card a,
  .test-series-card button {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    width: 100%;
    height: auto;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
  }
}
