.history-main {
  --history-green: #08a957;
  --history-orange: #ff6808;
  --history-indigo: #4938e8;
  --history-text: var(--ui-text-main, #0b1b4d);
  --history-muted: var(--ui-text-muted, #52658f);
  --history-border: var(--ui-border-soft, rgba(30, 64, 175, 0.14));
  --history-surface: var(--ui-surface-card, rgba(255, 255, 255, 0.94));
  color: var(--history-text);
  overflow: clip;
}

.history-main *,
.history-main *::before,
.history-main *::after { box-sizing: border-box; }

.history-wrap { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }

/* The canonical hero normalizer also marks the first wrapper as a hero card. */
.history-wrap.fs-hero-card {
  width: min(1280px, calc(100% - 40px));
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: left;
}

.history-hub {
  position: relative;
  isolation: isolate;
  padding: clamp(34px, 4.8vw, 64px) 0 clamp(42px, 5vw, 72px);
  background:
    radial-gradient(circle at 7% 6%, rgba(191, 219, 254, 0.75), transparent 28%),
    radial-gradient(circle at 94% 7%, rgba(219, 234, 254, 0.9), transparent 27%),
    linear-gradient(180deg, #eef5ff 0%, #f8fbff 48%, #fff 100%);
}

.history-hub::before,
.history-hub::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.history-hub::before { width: 580px; height: 580px; left: -290px; top: -350px; border-radius: 50%; }
.history-hub::after { width: 510px; height: 190px; right: -140px; top: 84px; border-radius: 50%; transform: rotate(-8deg); }

.history-intro.fs-hero-card {
  width: min(100%, 980px);
  max-width: 980px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: center;
}

.history-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #145bd7;
  box-shadow: 0 7px 20px rgba(30, 64, 175, 0.05);
  font-size: 0.86rem;
  font-weight: 850;
}

/* The canonical hero normalizer adds fs-hero-card to the first hero child. */
.history-kicker.fs-hero-card {
  width: auto;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 8px 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 7px 20px rgba(30, 64, 175, 0.05);
  backdrop-filter: blur(8px);
  text-align: center;
}

.history-kicker svg,
.history-quick-link svg,
.history-card-icon svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-intro.fs-hero-card h1 {
  max-width: none;
  margin: 0;
  color: #071846;
  font-size: clamp(2.15rem, 4.1vw, 3.45rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.history-intro.fs-hero-card .history-lead {
  max-width: 680px;
  margin: 15px auto 0;
  color: #405784;
  font-size: clamp(0.98rem, 1.25vw, 1.08rem);
  line-height: 1.55;
}

.history-quick-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 930px);
  margin: 24px auto 0;
}

.history-quick-link {
  display: inline-flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #075fe9;
  box-shadow: 0 9px 24px rgba(30, 64, 175, 0.07);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.history-quick-link:hover { transform: translateY(-1px); border-color: rgba(37, 99, 235, .4); box-shadow: 0 12px 28px rgba(30, 64, 175, .11); }
.history-quick-link:focus-visible,
.history-card-cta:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; }

.history-ad.fs-manual-ad-section { padding: clamp(22px, 3vw, 34px) 0; }
.history-ad .fs-manual-ad-shell { padding: 0; }

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(22px, 3vw, 36px);
}

.history-card {
  --accent: var(--history-green);
  --accent-rgb: 8, 169, 87;
  display: flex;
  min-width: 0;
  min-height: 348px;
  flex-direction: column;
  padding: 20px 18px 16px;
  border: 1px solid var(--history-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--ui-radius-card, 16px);
  background: var(--history-surface);
  box-shadow: var(--ui-shadow-card, 0 12px 30px rgba(15, 23, 42, 0.07));
  text-align: left;
}

.history-card--expert { --accent: var(--history-orange); --accent-rgb: 255, 104, 8; }
.history-card--national { --accent: var(--history-indigo); --accent-rgb: 73, 56, 232; }

.history-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.history-card-heading > div { min-width: 0; }
.history-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .09);
  color: var(--accent);
}
.history-card-icon svg { width: 25px; height: 25px; }

.history-level {
  display: inline-flex;
  margin: 0 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .1);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.history-card h2 { margin: 0; color: var(--history-text); font-size: clamp(1.18rem, 1.5vw, 1.42rem); line-height: 1.2; }
.history-card-body { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; align-items: center; margin: 18px 0; }
.history-card-copy { min-width: 0; }
.history-description { margin: 0; color: var(--history-muted); font-size: .91rem; line-height: 1.5; }
.history-points { margin: 14px 0 0; padding: 0; list-style: none; color: var(--history-text); font-size: .84rem; line-height: 1.42; }
.history-points li { position: relative; margin-top: 8px; padding-left: 20px; }
.history-points li::before { content: ""; position: absolute; left: 2px; top: .4em; width: 8px; height: 8px; border: 2px solid var(--accent); border-radius: 50%; }

.history-preview {
  position: relative;
  width: 112px;
  height: 138px;
  overflow: hidden;
  border: 1px solid rgba(30, 64, 175, .11);
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
  color: var(--accent);
}

.history-preview svg { display: block; width: 100%; height: 100%; }
.history-preview .preview-muted { fill: none; stroke: #e3eaf5; }
.history-preview .preview-soft { fill: rgba(var(--accent-rgb), .13); stroke: none; }
.history-preview .preview-accent { fill: none; stroke: currentColor; }
.history-preview .preview-fill { fill: rgba(var(--accent-rgb), .28); stroke: none; }

.history-card-cta {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: auto;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent), white 8%));
  color: #fff;
  box-shadow: 0 7px 17px rgba(var(--accent-rgb), .17);
  font-size: .91rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: filter .16s ease, transform .16s ease;
}

.history-card-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.history-card-cta span:last-child { font-size: 1.3rem; line-height: 1; }

[data-theme="dark"] .history-main {
  --history-text: #f3f7ff;
  --history-muted: #b8c5df;
  --history-border: rgba(148, 163, 184, .22);
  --history-surface: rgba(17, 31, 57, .93);
}

[data-theme="dark"] .history-hub {
  background:
    radial-gradient(circle at 7% 5%, rgba(30, 64, 175, .3), transparent 30%),
    radial-gradient(circle at 94% 7%, rgba(30, 58, 138, .25), transparent 29%),
    linear-gradient(180deg, #0c1830 0%, #101b31 50%, #0f172a 100%);
}

[data-theme="dark"] .history-hub::before,
[data-theme="dark"] .history-hub::after { border-color: rgba(96, 165, 250, .08); }
[data-theme="dark"] .history-intro.fs-hero-card { background: transparent !important; border: 0 !important; box-shadow: none !important; }
[data-theme="dark"] .history-wrap.fs-hero-card { background: transparent !important; border: 0 !important; box-shadow: none !important; }
[data-theme="dark"] .history-intro.fs-hero-card h1 { color: #f8fbff; }
[data-theme="dark"] .history-intro.fs-hero-card .history-lead { color: #c3d0e7; }
[data-theme="dark"] .history-kicker,
[data-theme="dark"] .history-kicker.fs-hero-card { border-color: rgba(96, 165, 250, .28); background: rgba(30, 58, 138, .22); color: #93c5fd; box-shadow: none; }
[data-theme="dark"] .history-quick-link { border-color: rgba(147, 197, 253, .22); background: rgba(15, 23, 42, .76); color: #93c5fd; box-shadow: none; }
[data-theme="dark"] .history-card { box-shadow: 0 14px 30px rgba(2, 6, 23, .28); }
[data-theme="dark"] .history-preview { border-color: rgba(148, 163, 184, .18); background: rgba(15, 23, 42, .58); box-shadow: none; }
[data-theme="dark"] .history-preview .preview-muted { stroke: rgba(148, 163, 184, .2); }

@media (max-width: 980px) {
  .history-grid { grid-template-columns: 1fr; width: min(100%, 720px); margin-right: auto; margin-left: auto; }
  .history-card { min-height: 0; }
}

@media (max-width: 760px) {
  .history-wrap,
  .history-wrap.fs-hero-card { width: min(100% - 24px, 600px); }
  .history-hub { padding-top: 27px; }
  .history-intro.fs-hero-card { width: 100%; }
  .history-intro.fs-hero-card h1 { font-size: clamp(1.9rem, 8.2vw, 2.55rem); }
  .history-intro.fs-hero-card .history-lead { font-size: .94rem; }
  .history-intro.fs-hero-card .history-lead br { display: none; }
  .history-quick-nav { grid-template-columns: 1fr; gap: 9px; width: min(100%, 470px); margin-top: 18px; }
  .history-quick-link { min-height: 47px; }
  .history-ad.fs-manual-ad-section { padding: 20px 0; }
  .history-grid { gap: 12px; margin-top: 18px; }
}

@media (max-width: 430px) {
  .history-wrap,
  .history-wrap.fs-hero-card { width: calc(100% - 20px); }
  .history-kicker,
  .history-kicker.fs-hero-card { padding: 7px 13px; font-size: .78rem; }
  .history-card { padding: 15px 13px 13px; }
  .history-card-heading { gap: 9px; }
  .history-card-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .history-card-icon svg { width: 23px; height: 23px; }
  .history-card h2 { font-size: 1.08rem; }
  .history-card-body { grid-template-columns: minmax(0, 1fr) 94px; gap: 9px; margin: 13px 0; }
  .history-description { font-size: .82rem; }
  .history-points { font-size: .77rem; }
  .history-points li { margin-top: 6px; padding-left: 17px; }
  .history-preview { width: 94px; height: 124px; }
  .history-card-cta { font-size: .84rem; }
}

@media (max-width: 370px) {
  .history-wrap,
  .history-wrap.fs-hero-card { width: calc(100% - 16px); }
  .history-intro.fs-hero-card h1 { font-size: 1.8rem; }
  .history-card { padding-right: 10px; padding-left: 10px; }
  .history-card-body { grid-template-columns: minmax(0, 1fr) 78px; gap: 7px; }
  .history-preview { width: 78px; height: 112px; }
  .history-description { font-size: .79rem; }
  .history-points { font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .history-quick-link,
  .history-card-cta { transition: none; }
  .history-quick-link:hover,
  .history-card-cta:hover { transform: none; }
}
