/* Mathematics hub and catalog. Scoped to math pages to avoid changing legacy subjects. */
:root {
  --math-ink: #111827;
  --math-muted: #667085;
  --math-green: #05c46b;
  --math-green-dark: #047a45;
  --math-blue: #2563eb;
  --math-amber: #f59e0b;
  --math-surface: #ffffff;
  --math-line: rgba(15, 23, 42, .11);
  --math-shadow: 0 20px 50px rgba(15, 23, 42, .12);
}

body.math-hub-page {
  background:
    radial-gradient(circle at 92% 2%, rgba(37, 99, 235, .14), transparent 25%),
    radial-gradient(circle at 10% 0%, rgba(5, 196, 107, .18), transparent 28%),
    #f4f7f9;
}

body.math-hub-page .math-main {
  max-width: 1220px;
  padding: 22px 32px 64px;
}

.math-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  color: var(--math-ink);
  font-weight: 900;
  text-decoration: none;
}

.math-back-link:hover {
  transform: translateY(-1px);
}

.math-hero,
.math-catalog-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 262px;
  gap: 28px;
  align-items: center;
  margin-top: 12px;
  padding: clamp(24px, 3.3vw, 38px);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(7, 17, 32, .98), rgba(15, 41, 64, .97) 54%, rgba(4, 122, 69, .94));
  box-shadow: 0 28px 70px rgba(15, 23, 42, .24);
  color: #ffffff;
  overflow: hidden;
}

.math-hero::before,
.math-catalog-hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -190px;
  top: -230px;
  border: 70px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.math-hero::after,
.math-catalog-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  left: 43%;
  bottom: -150px;
  border: 42px solid rgba(5, 196, 107, .16);
  transform: rotate(20deg);
}

.math-hero > *,
.math-catalog-hero > * {
  position: relative;
  z-index: 1;
}

.math-kicker,
.math-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  color: #8ff0bd;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.math-kicker {
  padding: 6px 10px;
  border: 1px solid rgba(143, 240, 189, .30);
  border-radius: 999px;
  background: rgba(5, 196, 107, .11);
}

.math-hero h1,
.math-catalog-hero h1 {
  max-width: 700px;
  margin: 12px 0 10px;
  color: #ffffff;
  font-size: clamp(38px, 4.6vw, 56px);
  line-height: 1;
  letter-spacing: -.045em;
}

.math-hero h1 span,
.math-catalog-hero h1 span {
  color: #8ff0bd;
}

.math-hero-copy > p,
.math-catalog-hero > div > p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, .74);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
}

.math-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.math-primary-button,
.math-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 15px;
  border-radius: 11px;
  font-weight: 950;
  text-decoration: none;
}

.math-primary-button {
  background: var(--math-green);
  color: #062615;
  box-shadow: 0 14px 28px rgba(5, 196, 107, .25);
}

.math-secondary-button {
  border: 1px solid rgba(255, 255, 255, .20);
  background: rgba(255, 255, 255, .09);
  color: #ffffff;
}

.math-primary-button:hover,
.math-secondary-button:hover {
  transform: translateY(-2px);
}

.math-hero-panel {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
}

.math-scholar-portrait {
  width: 86px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 13px;
  background: rgba(1, 16, 28, .45);
  box-shadow: 0 9px 18px rgba(0, 0, 0, .17);
}

.math-scholar-portrait img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
  object-position: 50% 25%;
  filter: saturate(.86) contrast(1.04);
}

.math-scholar-portrait figcaption {
  padding: 5px 6px 6px;
  color: rgba(255, 255, 255, .78);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.math-hero-stat > span {
  color: rgba(255, 255, 255, .65);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.math-hero-stat > strong {
  display: block;
  margin-top: 2px;
  color: #ffffff;
  font-size: 58px;
  line-height: .9;
  letter-spacing: -.06em;
}

.math-hero-stat > p {
  margin: 3px 0 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.math-hero-panel-meta {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
}

.math-hero-panel-meta span {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .74);
  font-size: 11px;
  font-weight: 900;
}

.math-image-credit {
  grid-column: 1 / -1;
  margin-top: -3px;
  color: rgba(255, 255, 255, .58);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.math-image-credit:hover {
  color: #8ff0bd;
}

.math-section {
  margin-top: 34px;
  scroll-margin-top: 100px;
}

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

.math-section-heading h2 {
  margin: 4px 0 0;
  color: var(--math-ink);
  font-size: clamp(29px, 3.5vw, 40px);
  line-height: 1;
  letter-spacing: -.035em;
}

.math-section-heading > p {
  max-width: 470px;
  margin: 0;
  color: var(--math-muted);
  font-weight: 700;
  line-height: 1.55;
}

.math-eyebrow {
  color: var(--math-green-dark);
}

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

.math-path-card {
  position: relative;
  display: flex;
  min-height: 342px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--math-line);
  border-radius: 18px;
  background: var(--math-surface);
  box-shadow: var(--math-shadow);
  color: var(--math-ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.math-path-card::after {
  content: "";
  position: absolute;
  width: 118px;
  height: 118px;
  right: -59px;
  bottom: -71px;
  border: 24px solid rgba(15, 23, 42, .045);
  border-radius: 50%;
}

a.math-path-card:hover {
  transform: translateY(-5px);
  border-color: rgba(5, 196, 107, .38);
  box-shadow: 0 28px 60px rgba(15, 23, 42, .17);
}

.math-path-card--certificate {
  background: linear-gradient(180deg, #ffffff, #edfff6);
}

.math-path-card--admission {
  background: linear-gradient(180deg, #ffffff, #eef4ff);
}

.math-path-card--attestation {
  background: linear-gradient(180deg, #ffffff, #fff8e8);
}

.math-path-status {
  align-self: flex-start;
  min-height: 23px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .07);
  color: #475467;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.math-path-status.is-building {
  background: rgba(5, 196, 107, .14);
  color: #047a45;
}

.math-path-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: 16px;
  border-radius: 13px;
  background: var(--math-ink);
  color: #ffffff;
  box-shadow: 0 14px 25px rgba(15, 23, 42, .18);
}

.math-path-card--certificate .math-path-icon { background: var(--math-green-dark); }
.math-path-card--admission .math-path-icon { background: var(--math-blue); }
.math-path-card--attestation .math-path-icon { background: var(--math-amber); color: #3b2600; }

.math-path-icon svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.math-path-order {
  position: absolute;
  top: 48px;
  right: 19px;
  color: rgba(15, 23, 42, .08);
  font-size: 58px;
  font-weight: 950;
  line-height: 1;
}

.math-path-card h3 {
  margin: 15px 0 6px;
  color: var(--math-ink);
  font-size: 24px;
  letter-spacing: -.03em;
}

.math-path-card > p {
  min-height: 0;
  margin: 0;
  color: var(--math-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.math-path-card ul {
  display: grid;
  gap: 6px;
  margin: 14px 0 16px;
  padding: 0;
  list-style: none;
}

.math-path-card li {
  position: relative;
  padding-left: 20px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.math-path-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--math-green);
  box-shadow: 0 0 0 4px rgba(5, 196, 107, .11);
}

.math-path-card--admission li::before { background: var(--math-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .10); }
.math-path-card--attestation li::before { background: var(--math-amber); box-shadow: 0 0 0 4px rgba(245, 158, 11, .12); }

.math-path-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--math-line);
  color: var(--math-green-dark);
  font-size: 13px;
  font-weight: 950;
}

.math-path-cta b {
  font-size: 21px;
}

.math-path-cta.is-muted {
  color: #98a2b3;
}

.math-method-section {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 20px 52px rgba(15, 23, 42, .08);
}

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

.math-method-card {
  padding: 16px;
  border: 1px solid var(--math-line);
  border-radius: 17px;
  background: #ffffff;
}

.math-method-card > span {
  color: var(--math-green-dark);
  font-size: 12px;
  font-weight: 950;
}

.math-method-card h3 {
  margin: 7px 0 5px;
  color: var(--math-ink);
  font-size: 20px;
}

.math-method-card p {
  margin: 0;
  color: var(--math-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.math-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--math-line);
  border-radius: 17px;
  background: var(--math-line);
  overflow: hidden;
}

.math-trust-strip div {
  display: grid;
  gap: 6px;
  padding: 17px;
  background: #ffffff;
}

.math-trust-strip strong {
  color: var(--math-ink);
}

.math-trust-strip span {
  color: var(--math-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

/* Milliy sertifikat catalog */
.math-teacher-strip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 15px;
  background: linear-gradient(100deg, #111827 0%, #163d5c 58%, #047a45 100%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, .14);
  color: #ffffff;
  text-decoration: none;
}

.math-teacher-strip:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(15, 23, 42, .18);
}

.math-teacher-strip-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .13);
  color: #9df2c4;
  font-size: 18px;
}

.math-teacher-strip strong {
  font-size: 15px;
  font-weight: 950;
}

.math-teacher-strip small {
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  font-weight: 750;
}

.math-teacher-strip b {
  font-size: 21px;
}

.math-catalog-title {
  padding-top: 25px;
}

.math-catalog-title h1 {
  margin: 0;
  color: var(--math-ink);
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.04em;
}

.math-catalog-title p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--math-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.math-catalog-intro {
  max-width: 760px;
  padding: 10px 0 4px;
}

.math-catalog-intro > span,
.math-simple-heading span {
  color: var(--math-green-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.math-catalog-intro h1 {
  margin: 9px 0 8px;
  color: var(--math-ink);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.045em;
  line-height: 1.04;
}

.math-catalog-intro p,
.math-simple-heading p,
.math-source-note {
  margin: 0;
  color: var(--math-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.math-free-section {
  margin-top: 20px;
}

.math-simple-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.math-simple-heading h2 {
  margin: 0;
  color: var(--math-ink);
  font-size: clamp(23px, 3vw, 32px);
  letter-spacing: -.035em;
}

.math-free-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.math-free-grid .math-test-card {
  min-height: 215px;
  border: 2px solid rgba(4, 122, 69, .28);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 52%);
  box-shadow: 0 14px 30px rgba(4, 122, 69, .10);
}

.math-free-grid .math-test-card h2 {
  font-size: 23px;
}

.math-source-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--math-line);
  font-size: 12px;
}

.math-catalog-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
}

.math-catalog-hero h1 {
  font-size: clamp(37px, 5vw, 62px);
}

.math-catalog-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 9px;
  margin: 0;
}

.math-catalog-stats div {
  min-width: 105px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 15px;
  background: rgba(255, 255, 255, .09);
}

.math-catalog-stats dt {
  color: rgba(255, 255, 255, .60);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.math-catalog-stats dd {
  margin: 7px 0 0;
  color: #ffffff;
  font-size: 35px;
  font-weight: 950;
  line-height: 1;
}

.math-catalog-stats small {
  font-size: 12px;
}

.math-disclosure {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, .28);
  border-radius: 14px;
  background: #fffaeb;
  color: #7a4e00;
  font-size: 13px;
  line-height: 1.5;
}

.math-catalog-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 15px;
}

.math-filter-stack {
  display: grid;
  gap: 8px;
}

.math-year-filters,
.math-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.math-year-filters button,
.math-status-filters button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--math-line);
  border-radius: 10px;
  background: #ffffff;
  color: #475467;
  font-weight: 900;
  cursor: pointer;
}

.math-year-filters button:hover,
.math-year-filters button.is-active,
.math-status-filters button:hover,
.math-status-filters button.is-active {
  border-color: var(--math-green-dark);
  background: var(--math-green-dark);
  color: #ffffff;
}

.math-status-filters button {
  min-height: 42px;
  padding-inline: 16px;
  background: #eef2f6;
}

.math-catalog-count {
  flex: 0 0 auto;
  color: var(--math-muted);
  font-size: 13px;
  font-weight: 900;
}

.math-test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.math-test-card {
  display: flex;
  min-width: 0;
  min-height: 250px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--math-line);
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}

.math-test-card.is-ready {
  border-color: rgba(4, 122, 69, .30);
  box-shadow: 0 18px 38px rgba(4, 122, 69, .12);
}

.math-test-card.is-adapted {
  border-color: rgba(181, 71, 8, .30);
  box-shadow: 0 18px 38px rgba(181, 71, 8, .10);
}

.math-test-card-head,
.math-test-meta,
.math-test-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.math-test-number {
  color: var(--math-green-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .05em;
}

.math-test-state {
  padding: 5px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.math-test-state.is-ready {
  background: #ecfdf3;
  color: #067647;
}

.math-test-state.is-adapted {
  background: #fffaeb;
  color: #b54708;
}

.math-test-card.is-editing {
  position: relative;
  border: 1px dashed #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.math-test-card.is-editing::before {
  position: absolute;
  inset: 0 18px auto;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  content: "";
}

.math-test-state.is-editing {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.math-test-card.is-editing h2,
.math-test-card.is-editing .math-test-number {
  color: #475467;
}

.math-test-card .math-test-editing-note {
  min-height: 34px;
  margin-top: 7px;
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.math-test-card h2 {
  margin: 20px 0 4px;
  color: var(--math-ink);
  font-size: 27px;
  letter-spacing: -.03em;
}

.math-test-card > p {
  min-height: 22px;
  margin: 0;
  color: var(--math-muted);
  font-size: 12px;
  font-weight: 800;
}

.math-test-meta {
  justify-content: flex-start;
  margin: 17px 0;
}

.math-test-meta span {
  padding: 7px 8px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #475467;
  font-size: 10px;
  font-weight: 900;
}

.math-test-quality {
  min-height: 66px;
  margin-bottom: 16px;
  padding: 11px;
  border-radius: 11px;
  background: #f8fafc;
}

.math-test-card.is-ready .math-test-quality {
  background: #f0fdf4;
}

.math-test-card.is-adapted .math-test-quality {
  background: #fffaeb;
}

.math-test-quality strong,
.math-test-quality span {
  display: block;
}

.math-test-quality strong {
  color: #344054;
  font-size: 11px;
}

.math-test-quality span {
  margin-top: 5px;
  color: #667085;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.math-test-foot {
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--math-line);
}

.math-test-foot > span {
  max-width: 120px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
}

.math-test-foot button {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: #e4e7ec;
  color: #98a2b3;
  font-weight: 900;
}

.math-test-card.is-editing .math-test-foot button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.math-test-card.is-editing .math-test-foot button span {
  color: #f59e0b;
  font-size: 8px;
}

/* Published tests stay visually brighter than cards still under review. */
.math-test-card.is-ready {
  position: relative;
  border: 2px solid #34c77b;
  background: linear-gradient(145deg, #eafff3 0%, #ffffff 58%, #f0fff7 100%);
  box-shadow: 0 18px 38px rgba(5, 150, 83, .18), 0 0 0 5px rgba(52, 199, 123, .06);
  overflow: hidden;
}

.math-test-card.is-ready::before {
  position: absolute;
  inset: 0 18px auto;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #16a36a, #4ade80);
  content: "";
}

.math-test-card.is-ready .math-test-number,
.math-test-card.is-ready h2 {
  color: #075d3b;
}

.math-test-card.is-ready .math-test-state.is-ready {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #087443;
}

.math-test-card.is-ready .math-test-state.is-ready::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .13);
  content: "";
}

.math-test-card.is-ready .math-test-meta span {
  background: #dcfce7;
  color: #166534;
}

.math-test-card.is-ready .math-test-foot {
  border-top-color: #bbf7d0;
}

.math-test-card.is-ready .math-test-foot a {
  background: linear-gradient(135deg, #079455, #16a36a);
  box-shadow: 0 10px 22px rgba(5, 150, 83, .28);
}

.math-test-card.is-ready:hover {
  border-color: #16a36a;
  box-shadow: 0 22px 46px rgba(5, 150, 83, .23), 0 0 0 6px rgba(52, 199, 123, .08);
  transform: translateY(-2px);
}

.math-test-foot a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--math-green-dark);
  box-shadow: 0 9px 20px rgba(4, 122, 69, .20);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
}

/* Premium catalog: one clear offer, then calm selectable test cards. */
.math-premium-offer {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .8fr) auto;
  gap: 22px;
  align-items: center;
  margin: 24px 0 12px;
  padding: 22px 24px;
  border: 1px solid rgba(4, 122, 69, .28);
  border-radius: 20px;
  background: linear-gradient(112deg, #102a23 0%, #0b5138 56%, #087a4a 100%);
  box-shadow: 0 18px 40px rgba(16, 42, 35, .16);
  color: #ffffff;
}

body.has-product-math-ms-90d .math-premium-offer { display: none; }

.math-premium-offer-copy > span,
.math-premium-list-heading > div > span {
  color: #75e0a7;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.math-premium-offer-copy h2 {
  margin: 5px 0 6px;
  color: #ffffff;
  font-size: clamp(21px, 2.7vw, 29px);
  letter-spacing: -.03em;
}

.math-premium-offer-copy p {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.math-premium-offer-points {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.math-premium-offer-points li::before {
  margin-right: 8px;
  color: #75e0a7;
  content: "✓";
  font-weight: 950;
}

.math-premium-offer-action {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  min-width: 190px;
}

.math-premium-offer-action > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.math-premium-offer-action strong { font-size: 20px; }
.math-premium-offer-action span { color: rgba(255, 255, 255, .66); font-size: 11px; font-weight: 800; }
.math-premium-offer-action a {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  background: #ffffff;
  color: #075d3b;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
}

.math-premium-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-top: 28px;
  scroll-margin-top: 100px;
}

.math-premium-list-heading > div > span { color: var(--math-green-dark); }
.math-premium-list-heading h2 { margin: 5px 0 0; color: var(--math-ink); font-size: clamp(23px, 3vw, 32px); letter-spacing: -.035em; }
.math-premium-list-heading p { max-width: 430px; margin: 0; color: var(--math-muted); font-size: 12px; font-weight: 700; line-height: 1.5; text-align: right; }

.math-test-card.is-premium-locked {
  border-color: rgba(180, 83, 9, .24);
  background: linear-gradient(180deg, #ffffff 0%, #fffcf5 100%);
  box-shadow: 0 12px 28px rgba(120, 53, 15, .07);
}

.math-test-card.is-premium-locked .math-test-state {
  background: #fff4dc;
  color: #9a3412;
}

.math-test-card.is-premium-locked .math-test-foot a {
  background: #fff4dc;
  box-shadow: none;
  color: #8a3b12;
}

.math-test-card.is-premium-locked .math-test-foot a:hover,
.math-premium-offer-action a:hover {
  transform: translateY(-1px);
}

@media (max-width: 1060px) {
  .math-premium-offer { grid-template-columns: minmax(0, 1fr) auto; }
  .math-premium-offer-points { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .math-premium-offer { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .math-premium-offer-points { grid-column: auto; grid-row: auto; grid-template-columns: 1fr; }
  .math-premium-offer-action { min-width: 0; }
  .math-premium-list-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .math-premium-list-heading p { text-align: left; }
}

/* Regional mathematics teacher directory. */
.math-teachers-intro {
  box-sizing: border-box;
  width: 100%;
  max-width: 820px;
  padding: 38px clamp(20px, 4vw, 40px) 26px;
}

.math-teachers-intro > span,
.math-teacher-join > div > span,
.math-teacher-results-head > span {
  color: var(--math-green-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.math-teachers-intro h1 {
  margin: 8px 0 10px;
  color: var(--math-ink);
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -.055em;
  line-height: .98;
}

.math-teachers-intro p {
  max-width: 680px;
  margin: 0;
  color: var(--math-muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.math-region-section {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 22px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 22px 52px rgba(15, 23, 42, .08);
}

.math-region-heading,
.math-teacher-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.math-region-heading {
  margin-bottom: 14px;
}

.math-region-heading h2,
.math-teacher-results-head h2 {
  margin: 0;
  color: var(--math-ink);
  font-size: 24px;
  letter-spacing: -.03em;
}

.math-region-heading > span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--math-green-dark);
  font-size: 11px;
  font-weight: 900;
}

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

.math-region-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 13px 14px;
  border: 1px solid var(--math-line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--math-ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.math-region-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #16a36a;
}

.math-region-card:nth-child(4n + 2)::before { background: #3b82f6; }
.math-region-card:nth-child(4n + 3)::before { background: #f59e0b; }
.math-region-card:nth-child(4n + 4)::before { background: #8b5cf6; }

.math-region-card:hover,
.math-region-card.is-active {
  border-color: rgba(4, 122, 69, .52);
  background: #f0fdf4;
  box-shadow: 0 10px 24px rgba(4, 122, 69, .10);
  transform: translateY(-1px);
}

.math-region-card > span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: #f2f4f7;
  color: #667085;
  font-size: 10px;
  font-weight: 950;
}

.math-region-card:nth-child(4n + 2) > span:first-child { background: #eff6ff; color: #1d4ed8; }
.math-region-card:nth-child(4n + 3) > span:first-child { background: #fffbeb; color: #b45309; }
.math-region-card:nth-child(4n + 4) > span:first-child { background: #f5f3ff; color: #6d28d9; }

.math-region-card.is-active > span {
  background: var(--math-green-dark);
  color: #ffffff;
}

.math-region-card strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.math-region-card-copy {
  display: grid !important;
  width: auto !important;
  height: auto !important;
  place-items: initial !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
}

.math-region-card-copy small {
  margin-top: 3px;
  color: #98a2b3;
  font-size: 9px;
  font-weight: 800;
}

.math-region-card.is-active .math-region-card-copy small {
  color: #43836a;
}

.math-region-card b {
  color: var(--math-green-dark);
  font-size: 17px;
}

.math-teacher-results {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid rgba(4, 122, 69, .18);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.math-teacher-results[hidden] {
  display: none;
}

.math-teacher-results-head {
  justify-content: flex-start;
}

.math-teacher-results-head h2 {
  font-size: 21px;
}

.math-teacher-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
  padding: 16px;
  border-radius: 15px;
  background: #f8fafc;
}

.math-teacher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 15px;
}

.math-teacher-card {
  padding: 16px;
  border: 1px solid var(--math-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .07);
}

.math-teacher-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.math-teacher-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #dff8ea, #dbeafe);
  color: #075f3c;
  font-weight: 950;
  overflow: hidden;
}

.math-teacher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.math-teacher-card h3,
.math-teacher-card p {
  margin: 0;
}

.math-teacher-card h3 {
  color: var(--math-ink);
  font-size: 15px;
}

.math-teacher-card-top p,
.math-teacher-achievement {
  margin-top: 3px;
  color: var(--math-muted);
  font-size: 11px;
  font-weight: 650;
}

.math-teacher-verified {
  grid-column: 1 / -1;
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--math-green-dark);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.math-teacher-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.math-teacher-card-meta span {
  padding: 6px 7px;
  border-radius: 8px;
  background: #f2f4f7;
  color: #475467;
  font-size: 9px;
  font-weight: 850;
}

.math-teacher-card > a {
  display: inline-flex;
  margin-top: 13px;
  color: var(--math-green-dark);
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
}

.math-teacher-empty > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: #e8f8ef;
  color: var(--math-green-dark);
  font-size: 21px;
  font-weight: 950;
}

.math-teacher-empty h3,
.math-teacher-empty p {
  margin: 0;
}

.math-teacher-empty h3 {
  color: var(--math-ink);
  font-size: 16px;
}

.math-teacher-empty p {
  margin-top: 3px;
  color: var(--math-muted);
  font-size: 12px;
  font-weight: 650;
}

.math-teacher-empty a,
.math-teacher-join > a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 11px;
  background: var(--math-green-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.math-teacher-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(110deg, #111827, #153b58 62%, #047a45);
  box-shadow: 0 22px 52px rgba(15, 23, 42, .16);
}

.math-teacher-join > div > span {
  color: #8ff0bd;
}

.math-teacher-join h2,
.math-teacher-join p {
  margin: 0;
  color: #ffffff;
}

.math-teacher-join h2 {
  margin-top: 5px;
  font-size: 23px;
  letter-spacing: -.03em;
}

.math-teacher-join p {
  margin-top: 5px;
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
  font-weight: 650;
}

.math-teacher-join > a {
  background: #ffffff;
  color: #064e35;
}

.math-catalog-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 180px;
  place-content: center;
  padding: 28px;
  border: 1px dashed #d0d5dd;
  border-radius: 17px;
  background: rgba(255, 255, 255, .65);
  text-align: center;
}

.math-catalog-empty strong,
.math-catalog-empty span {
  display: block;
}

.math-catalog-empty span {
  margin-top: 6px;
  color: var(--math-muted);
  font-size: 12px;
  font-weight: 650;
}

.math-catalog-empty.is-error {
  border-color: #fda29b;
  background: #fff6f5;
}

@media (max-width: 1040px) {
  .math-hero,
  .math-catalog-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .math-hero-panel {
    width: min(100%, 360px);
  }

  .math-path-grid {
    grid-template-columns: 1fr;
  }

  .math-path-card {
    min-height: 0;
  }

  .math-path-card > p {
    min-height: 0;
  }

  .math-free-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 780px) {
  body.math-hub-page .math-main {
    width: 100%;
    margin-left: 0;
    padding: 72px 16px 56px;
  }

  .math-hero,
  .math-catalog-hero {
    gap: 24px;
    padding: 26px 20px;
    border-radius: 22px;
  }

  .math-hero h1,
  .math-catalog-hero h1 {
    font-size: clamp(35px, 11vw, 48px);
  }

  .math-section-heading,
  .math-catalog-toolbar,
  .math-simple-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .math-method-grid,
  .math-trust-strip {
    grid-template-columns: 1fr;
  }

  .math-method-section {
    padding: 20px;
  }

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

  .math-catalog-stats div {
    min-width: 0;
    padding: 12px 9px;
  }

  .math-catalog-stats dd {
    font-size: 27px;
  }

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

  .math-teacher-strip {
    grid-template-columns: auto 1fr auto;
  }

  .math-teacher-strip small {
    display: none;
  }

  .math-teacher-join,
  .math-teacher-empty {
    grid-template-columns: 1fr;
  }

  .math-teacher-empty > span {
    display: none;
  }
}

@media (max-width: 480px) {
  .math-hero-actions {
    display: grid;
  }

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

  .math-hero-stat > strong {
    font-size: 52px;
  }

  .math-path-card {
    padding: 20px;
  }

  .math-path-order {
    right: 18px;
    font-size: 58px;
  }

  .math-year-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .math-filter-stack,
  .math-status-filters {
    width: 100%;
  }

  .math-status-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .math-year-filters button {
    padding-inline: 7px;
  }

  .math-test-grid {
    grid-template-columns: 1fr;
  }

  .math-free-grid {
    grid-template-columns: 1fr;
  }

  .math-region-grid {
    grid-template-columns: 1fr;
  }

  .math-teacher-grid {
    grid-template-columns: 1fr;
  }

  .math-teachers-intro {
    padding: 28px 20px 24px;
  }

  .math-region-section {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .math-hub-page *,
  .math-hub-page *::before,
  .math-hub-page *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
