:root {
  color-scheme: light;
  --page: #f4f7fb;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #5f6f7f;
  --line: #d8e0e8;
  --accent: #1e7f66;
  --accent-dark: #14624e;
  --answer: #9a4f18;
  --shadow: 0 18px 45px rgba(25, 38, 54, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 24px 22px;
}

.ad-banner {
  width: min(1120px, 100%);
  justify-self: center;
}

.ad-link {
  display: block;
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.ad-link img {
  display: block;
  width: 100%;
  height: clamp(74px, 12vh, 118px);
  object-fit: cover;
}

.ad-link[href="#"] {
  pointer-events: none;
}

.study-stage {
  min-height: 0;
  width: min(820px, 100%);
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.1;
}

.counter {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.card {
  width: 100%;
  min-height: min(50vh, 460px);
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.card:focus-visible,
.controls button:focus-visible,
.ad-link:focus-visible {
  outline: 3px solid rgba(30, 127, 102, 0.36);
  outline-offset: 4px;
}

.card-type {
  display: block;
  width: 100%;
  padding: 18px clamp(24px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(30, 127, 102, 0.08);
  color: var(--accent-dark);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.card-type.answer {
  background: rgba(154, 79, 24, 0.1);
  color: var(--answer);
}

.card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  padding: clamp(26px, 5vw, 52px);
  font-size: clamp(1.45rem, 3.6vw, 2.6rem);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.card-text.with-answer {
  justify-content: flex-start;
}

.question-text {
  color: var(--ink);
  font-size: 0.7em;
  font-weight: inherit;
}

.answer-text {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--answer);
  font-size: 0.58em;
  font-weight: 700;
  line-height: 1.38;
}

.answer-placeholder {
  visibility: hidden;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.controls button {
  min-width: 112px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.controls button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.keyboard-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.deck-seo-section {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto 56px;
  padding: 32px;
  border-top: 1px solid var(--line);
}

.deck-seo-section h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.deck-seo-section p {
  color: var(--muted);
  line-height: 1.65;
}

.deck-seo-section ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .app-shell {
    gap: 10px;
    padding: 12px;
  }

  .ad-link {
    min-height: 58px;
  }

  .ad-link img {
    height: 58px;
  }

  .study-stage {
    grid-template-rows: auto minmax(300px, 1fr) auto auto;
    gap: 12px;
  }

  .deck-seo-section ul {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.55rem;
  }

  .card {
    min-height: 340px;
  }

  .card-type {
    padding: 14px 20px;
  }

  .card-text {
    padding: 22px;
  }
}

.site-header {
  width: calc(100% - 24px);
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 700;
  text-decoration: none;
}

.site-logo img {
  width: 144px;
  height: auto;
  flex: 0 0 auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.site-nav a {
  flex: 0 0 auto;
  padding: 6px 6px;
  border-radius: 8px;
  background: rgba(30, 127, 102, 0.08);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--accent);
  color: #ffffff;
}

.site-nav a[aria-current="page"] {
  background: var(--accent);
  color: #ffffff;
}

.home-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.home-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 42px;
  align-items: center;
  padding: 54px 0 44px;
}

.home-hero h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4.5vw, 3.45rem);
  line-height: 1.06;
}

.home-lede {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.55;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  background: var(--accent);
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.hero-course-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.hero-course-buttons a {
  min-height: 46px;
  padding: 0 16px;
}

.hero-course-buttons a:hover {
  transform: translateY(-1px);
}

.hero-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-panel-label {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-question {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero-answer {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--answer);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
}

.hero-feature-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.hero-promo-box {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(25, 38, 54, 0.1);
  overflow: hidden;
  position: relative;
}

.hero-promo-box::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.hero-promo-box:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hero-promo-box span {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.78;
}

.hero-promo-box strong {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.15;
  position: relative;
  z-index: 1;
}

.hero-promo-box em {
  color: inherit;
  font-style: normal;
  line-height: 1.4;
  opacity: 0.86;
  position: relative;
  z-index: 1;
}

.hero-promo-box small {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0.82;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
}

.hero-promo-box.crm {
  background: linear-gradient(135deg, #17324d, #1e7f66);
  color: #ffffff;
}

.hero-promo-box.forum {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #ffffff;
}

.hero-promo-box.calculations {
  background: linear-gradient(135deg, #14624e, #9a4f18);
  color: #ffffff;
}

.hero-promo-box.blogs {
  background: linear-gradient(135deg, #4338ca, #0f766e);
  color: #ffffff;
}

.hero-promo-box.resources {
  background: linear-gradient(135deg, #9a4f18, #f59e0b);
  color: #ffffff;
}

.study-flow-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}

.study-flow-panel span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.study-flow-panel strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.study-flow-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.study-flow-panel:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

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

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.section-heading p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

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

.course-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.course-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(25, 38, 54, 0.1);
}

.course-card span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.course-card strong {
  font-size: 1.26rem;
  line-height: 1.2;
}

.course-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

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

.resource-list div {
  padding: 22px;
  border-left: 4px solid var(--accent);
  background: #ffffff;
}

.resource-list strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.resource-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.faq-list h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.faq-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.calculator-page {
  width: min(1380px, calc(100% - 28px));
  margin: 0 auto 56px;
}

.calculator-hero {
  max-width: 960px;
  padding: 34px 0 20px;
}

.calculator-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.calculator-hover-note {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.calculator-instruction-stack {
  margin: 14px 0 12px;
}

.calculator-instruction-stack .calculator-hover-note {
  margin: 0;
}

.calculator-mouseover-note {
  margin: 8px 0 0;
  color: #b42318;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.calculator-hero p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.calculator-hero .calculator-hover-note {
  color: var(--ink);
}

.calculator-search {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.calculator-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
}

.calculator-search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(42, 55, 68, 0.22);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

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

.calculator-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(25, 38, 54, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.calculator-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(25, 38, 54, 0.14);
}

.calculator-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #eef3f8;
}

.calculator-card span,
.calculator-card strong,
.calculator-card em {
  margin-left: 22px;
  margin-right: 22px;
}

.calculator-card span {
  margin-top: 18px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calculator-card strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.15;
}

.calculator-card em {
  margin-top: 10px;
  margin-bottom: 22px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.calculator-empty {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ed;
  color: var(--ink);
  font-weight: 700;
}

.calculator-back-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent-dark);
  font-weight: 800;
}

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

.exam-calc-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(25, 38, 54, 0.07);
}

.exam-calc-card h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
}

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

.exam-input-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.exam-input-grid input {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid rgba(42, 55, 68, 0.2);
  border-radius: 6px;
  background: #f8fbfd;
  color: var(--ink);
  font: inherit;
}

.calc-results {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.calc-results div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 6px;
  background: #f7fbf9;
}

.calc-results dt {
  color: var(--muted);
  font-weight: 700;
}

.calc-results dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.ratio-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  line-height: 1.4;
}

.ratio-note strong {
  color: var(--ink);
}

.ratio-note span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(30, 127, 102, 0.1);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.calculator-table-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(25, 38, 54, 0.08);
  overflow-x: auto;
}

.calc-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.calc-table th,
.calc-table td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}

.calc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef6f3;
  color: var(--accent-dark);
  text-align: center;
}

.calc-table thead th:first-child {
  width: 210px;
  text-align: left;
}

.calc-table thead strong {
  display: block;
  font-size: 1.05rem;
}

.calc-table thead span {
  display: inline-flex;
  margin-top: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(154, 79, 24, 0.1);
  color: var(--answer);
  font-size: 0.78rem;
}

.calc-table tbody th {
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
}

.calc-table td {
  background: #ffffff;
}

.calc-table th:nth-child(2),
.calc-table td:nth-child(2) {
  background-color: #f7fbf9;
}

.calc-table th:nth-child(3),
.calc-table td:nth-child(3) {
  background-color: #fff9f2;
}

.calc-table th:nth-child(4),
.calc-table td:nth-child(4) {
  background-color: #f5f8fc;
}

.calc-table th:nth-child(5),
.calc-table td:nth-child(5) {
  background-color: #f8f6fb;
}

.calc-table thead th:nth-child(2) {
  background-color: #e7f2ee;
}

.calc-table thead th:nth-child(3) {
  background-color: #f7eadb;
}

.calc-table thead th:nth-child(4) {
  background-color: #e8eef6;
}

.calc-table thead th:nth-child(5) {
  background-color: #eee9f5;
}

.shared-row th,
.shared-row td {
  box-shadow: inset 0 0 0 999px rgba(30, 127, 102, 0.025);
}

.shared-row th::after {
  content: " shared";
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(30, 127, 102, 0.12);
  color: var(--accent-dark);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.calc-table input {
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f4f7fb;
  color: var(--ink);
  font: inherit;
  text-align: right;
}

.calc-table input:focus {
  border-color: var(--accent);
  background: #ffffff;
  outline: 3px solid rgba(30, 127, 102, 0.16);
}

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

.split-inputs label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid rgba(42, 55, 68, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
}

.split-inputs span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.split-inputs input {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  border-color: rgba(42, 55, 68, 0.22);
  background: #ffffff;
}

.calc-table input::placeholder {
  color: var(--muted);
}

.section-row th {
  padding: 11px 12px;
  border-top: 14px solid #ffffff;
  border-bottom: 2px solid rgba(30, 127, 102, 0.28);
  background: #e7f2ee;
  color: var(--accent-dark);
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.debt-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.debt-label button,
.sheet-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.debt-label button {
  padding: 0 8px;
}

.sheet-action {
  width: 100%;
}

.debt-label button:hover,
.sheet-action:hover {
  border-color: var(--accent);
}

.sheet-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.result-row th,
.result-row td,
.status-row th,
.status-row td {
  box-shadow: inset 0 0 0 999px rgba(154, 79, 24, 0.045);
  font-weight: 700;
}

.result-row td,
.status-row td {
  text-align: right;
}

.status-row td {
  border-left-width: 3px;
  color: var(--muted);
}

.status-row td.is-pass {
  background: rgba(30, 127, 102, 0.12);
  color: var(--accent-dark);
}

.status-row td.is-fail {
  background: rgba(154, 79, 24, 0.12);
  color: var(--answer);
}

.calculation-explainer {
  margin-top: 24px;
  padding: 28px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.calculation-explainer h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.calculation-explainer div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.calculation-explainer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.site-footer a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 34px auto 56px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.legal-page h2 {
  margin: 34px 0 12px;
  font-size: 1.45rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-page ul {
  padding-left: 22px;
}

.contact-email {
  color: var(--accent-dark);
  font-weight: 700;
}

.contact-page .primary-action {
  margin-top: 12px;
}

.resources-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.resources-hero {
  max-width: 880px;
  padding: 44px 0 28px;
}

.resources-hero .eyebrow {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

.resources-hero h1 {
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  line-height: 1.12;
}

.resources-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.58;
}

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

.affiliate-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(25, 38, 54, 0.08);
  overflow: hidden;
}

.affiliate-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(25, 38, 54, 0.14);
}

.affiliate-category {
  width: fit-content;
  margin: 6px 22px 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(30, 127, 102, 0.12);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.affiliate-card strong {
  display: block;
  padding: 0 22px;
  font-size: 1.55rem;
  line-height: 1.1;
}

.affiliate-card em {
  display: block;
  padding: 0 22px;
  color: var(--answer);
  font-size: 1.08rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.affiliate-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

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

.blog-header {
  padding: 24px 0 14px;
}

.blog-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.blog-card {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  grid-template-areas:
    "thumb time"
    "thumb title"
    "thumb copy"
    "thumb cta";
  gap: 4px 16px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
}

.blog-card-thumb {
  grid-area: thumb;
  display: block;
  width: 156px;
  height: 108px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
  object-fit: cover;
}

.blog-card:hover {
  border-color: var(--accent);
}

.blog-card time {
  grid-area: time;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-card h2 {
  grid-area: title;
  margin: 6px 0;
  font-size: 1.28rem;
}

.blog-card p {
  grid-area: copy;
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.55;
}

.blog-card span {
  grid-area: cta;
  color: var(--answer);
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.article-page {
  max-width: 820px;
}

.article-hero-image {
  display: block;
  width: 100%;
  max-height: 440px;
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
  object-fit: cover;
}

.article-callout,
.article-related {
  margin: 28px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.article-callout h2,
.article-related h2 {
  margin-top: 0;
}

.article-related ul {
  margin-bottom: 0;
}

.article-related a,
.article-callout a {
  color: var(--accent-dark);
  font-weight: 700;
}

.article-tool-links {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.article-tool-links a {
  display: inline-flex;
  width: fit-content;
}

@media (max-width: 900px) {
  .site-header {
    align-items: center;
  }

  .site-nav {
    justify-content: center;
  }

  .site-logo img {
    width: 104px;
  }

  .home-hero,
  .course-grid,
  .resource-list,
  .affiliate-grid,
  .faq-list,
  .calculator-card-grid,
  .exam-calculator-grid,
  .calculation-explainer div {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
    padding-top: 34px;
  }

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

@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }

  .site-header,
  .home-page,
  .resources-page,
  .app-shell,
  .legal-page {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding-top: 14px;
  }

  .site-logo {
    gap: 10px;
    font-size: 1rem;
    text-align: center;
  }

  .site-nav {
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .site-nav a {
    padding: 7px 9px;
    font-size: 0.76rem;
  }

  .ad-banner {
    width: min(100% - 24px, 1120px);
  }

  .home-hero {
    gap: 28px;
    padding: 26px 0 34px;
  }

  .home-hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.45rem);
  }

  .home-lede,
  .resources-hero p:not(.eyebrow),
  .section-heading p:not(.eyebrow) {
    font-size: 1rem;
  }

  .hero-course-buttons,
  .home-actions {
    gap: 10px;
  }

  .hero-course-buttons .primary-action,
  .primary-action,
  .secondary-action {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    text-align: center;
  }

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

  .hero-promo-box {
    aspect-ratio: auto;
    min-height: 150px;
  }

  .study-flow-panel,
  .course-card,
  .affiliate-card,
  .calculator-card,
  .exam-calc-card,
  .blog-card,
  .legal-page {
    padding: 18px;
  }

  .legal-page {
    margin: 22px auto 42px;
  }

  .legal-page h1 {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
  }

  .legal-page h2 {
    font-size: 1.25rem;
  }

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

  .resources-hero h1,
  .section-heading h2,
  .blog-header h1 {
    font-size: clamp(1.55rem, 8vw, 2.2rem);
  }

  .affiliate-card {
    min-height: auto;
  }

  .calculator-card {
    min-height: auto;
  }

  .affiliate-card img {
    height: 128px;
  }

  .blog-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 4px 12px;
  }

  .blog-card-thumb {
    width: 96px;
    height: 82px;
  }

  .calculator-card img {
    height: 140px;
  }

  .exam-input-grid {
    grid-template-columns: 1fr;
  }

  .affiliate-category {
    width: auto;
    max-width: calc(100% - 36px);
  }

  .card {
    min-height: min(56vh, 420px);
  }

  .card-text {
    padding: 22px;
    font-size: clamp(1.25rem, 7vw, 1.85rem);
  }

  .controls {
    width: 100%;
  }

  .controls button {
    flex: 1 1 0;
    min-width: 0;
  }
}
