/* ============================================================================
   TOOLS PAGES · animated heroes + unique per-tool functions
   Scope: tools/calculator.html, economic-calendar.html, fees.html,
          contract-specifications.html, risk-quiz.html, dynamic-margin.html,
          tools/index.html.
   Loaded after brand-sections.css.
   ============================================================================ */

/* ---------- SHARED TOOL-HERO SHELL ---------- */
.tool-hero {
  position: relative;
  padding: clamp(40px, 6vw, 80px) 0 clamp(36px, 5vw, 64px);
  overflow: hidden;
  color: #002531;
}
.tool-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg,  rgba(31,95,168,0.04) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(31,95,168,0.04) 0 1px, transparent 1px 96px);
  mask: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}
/* Per-tool theme variants — distinct light mixes */
.tool-hero.theme-calc      { background: radial-gradient(800px 500px at 0% 0%, rgba(31,95,168,0.10), transparent 65%), linear-gradient(180deg, #FFFFFF 0%, #ECF3FB 100%); }
.tool-hero.theme-calendar  { background: radial-gradient(800px 500px at 100% 0%, rgba(127,97,75,0.10), transparent 65%), linear-gradient(180deg, #FFFFFF 0%, #FFFCF6 100%); }
.tool-hero.theme-specs     { background: radial-gradient(900px 600px at 50% 0%, rgba(31,143,74,0.08), transparent 65%), linear-gradient(180deg, #FFFFFF 0%, #F2F8F3 100%); }
.tool-hero.theme-fees      { background: radial-gradient(800px 500px at 100% 50%, rgba(31,95,168,0.10), transparent 70%), linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%); }
.tool-hero.theme-quiz      { background: radial-gradient(800px 500px at 0% 0%, rgba(179,154,126,0.12), transparent 65%), linear-gradient(180deg, #FFFCF6 0%, #F6EFE0 100%); }
.tool-hero.theme-margin    { background: radial-gradient(700px 500px at 0% 0%, rgba(31,95,168,0.10), transparent 65%), radial-gradient(700px 500px at 100% 100%, rgba(127,97,75,0.08), transparent 65%), linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%); }
.tool-hero.theme-index     { background: radial-gradient(900px 600px at 15% 0%, rgba(31,95,168,0.10), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(179,154,126,0.10), transparent 60%), linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%); }

.tool-hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 900px) {
  .tool-hero .container { grid-template-columns: 1fr; gap: 28px; }
}
.tool-hero .th-text { display: flex; flex-direction: column; gap: 14px; }
.tool-hero .th-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid;
}
.tool-hero.theme-calc     .th-eyebrow { color: #1F5FA8; border-color: rgba(31,95,168,0.24); background: rgba(31,95,168,0.06); }
.tool-hero.theme-calendar .th-eyebrow { color: #7F614B; border-color: rgba(127,97,75,0.26); background: rgba(127,97,75,0.07); }
.tool-hero.theme-specs    .th-eyebrow { color: #1F8F4A; border-color: rgba(31,143,74,0.26); background: rgba(31,143,74,0.07); }
.tool-hero.theme-fees     .th-eyebrow { color: #1F5FA8; border-color: rgba(31,95,168,0.24); background: rgba(31,95,168,0.06); }
.tool-hero.theme-quiz     .th-eyebrow { color: #7F614B; border-color: rgba(127,97,75,0.26); background: rgba(127,97,75,0.07); }
.tool-hero.theme-margin   .th-eyebrow { color: #1F5FA8; border-color: rgba(31,95,168,0.24); background: rgba(31,95,168,0.06); }
.tool-hero.theme-index    .th-eyebrow { color: #1F5FA8; border-color: rgba(31,95,168,0.24); background: rgba(31,95,168,0.06); }
.tool-hero .th-eyebrow .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; position: relative;
}
.tool-hero .th-eyebrow .pulse-dot::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; background: currentColor;
  animation: th-ping 1.8s ease-out infinite;
}
@keyframes th-ping { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(3); opacity: 0; } }
.tool-hero h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 6px 0 8px;
  color: #002531;
}
.tool-hero h1 .accent {
  background: linear-gradient(135deg, #1F5FA8 0%, #B39A7E 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.tool-hero .th-lead {
  font-size: clamp(14.5px, 1.5vw, 17.5px);
  line-height: 1.6;
  color: #2F4856;
  max-width: 56ch;
  margin: 0;
}
.tool-hero .th-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tool-hero .th-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 6px 11px;
  background: #FFFFFF;
  border: 1px solid rgba(31,95,168,0.16);
  border-radius: 999px;
  color: #1F5FA8;
}
.tool-hero .th-chip svg { width: 13px !important; height: 13px !important; flex-shrink: 0; }
.tool-hero .th-cta-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 16px;
}
.tool-hero .th-stage {
  position: relative;
  min-height: clamp(280px, 38vw, 440px);
  display: grid;
  place-items: center;
}

/* ============================================================================
   1 · CALCULATOR HERO ANIM · animated pip/lot calculator preview
   ============================================================================ */
.th-calc {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(160deg, #FFFFFF 0%, #ECF3FB 100%);
  border: 1.5px solid rgba(31,95,168,0.18);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 26px 60px rgba(0,37,49,0.10);
}
.th-calc .tc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31,95,168,0.10);
  margin-bottom: 14px;
}
.th-calc .tc-head .tc-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: #002531; }
.th-calc .tc-head .tc-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.10em; color: #1F5FA8; }
.th-calc .tc-rows { display: grid; gap: 8px; }
.th-calc .tc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 14px;
  background: rgba(31,95,168,0.04);
  border-radius: 10px;
  font-size: 13px;
}
.th-calc .tc-row .tc-lab { color: #5A6B75; font-weight: 600; }
.th-calc .tc-row .tc-val {
  font-family: 'Courier New', monospace;
  font-weight: 900;
  color: #002531;
  font-size: 14px;
}
.th-calc .tc-result {
  margin-top: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1F5FA8, #002531);
  color: #FFFFFF;
  border-radius: 14px;
  display: grid; gap: 6px;
  text-align: center;
}
.th-calc .tc-result .tc-lab { font-size: 11px; letter-spacing: 0.16em; opacity: 0.85; }
.th-calc .tc-result .tc-big {
  font-family: 'Courier New', monospace;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
}
.th-calc .tc-bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-top: 12px;
  height: 30px;
}
.th-calc .tc-bars span {
  background: linear-gradient(180deg, #1F5FA8, #6DA6F2);
  border-radius: 3px;
  height: 100%;
  transform: scaleY(0);
  transform-origin: bottom;
  animation: tc-bars 1.8s cubic-bezier(0.22,1,0.36,1) forwards;
}
.th-calc .tc-bars span:nth-child(1) { animation-delay: 0.08s; }
.th-calc .tc-bars span:nth-child(2) { animation-delay: 0.14s; }
.th-calc .tc-bars span:nth-child(3) { animation-delay: 0.20s; }
.th-calc .tc-bars span:nth-child(4) { animation-delay: 0.26s; }
.th-calc .tc-bars span:nth-child(5) { animation-delay: 0.32s; }
.th-calc .tc-bars span:nth-child(6) { animation-delay: 0.38s; }
.th-calc .tc-bars span:nth-child(7) { animation-delay: 0.44s; }
.th-calc .tc-bars span:nth-child(8) { animation-delay: 0.50s; }
.th-calc .tc-bars span:nth-child(1)  { --h: 36%; }
.th-calc .tc-bars span:nth-child(2)  { --h: 52%; }
.th-calc .tc-bars span:nth-child(3)  { --h: 68%; }
.th-calc .tc-bars span:nth-child(4)  { --h: 82%; }
.th-calc .tc-bars span:nth-child(5)  { --h: 60%; }
.th-calc .tc-bars span:nth-child(6)  { --h: 92%; }
.th-calc .tc-bars span:nth-child(7)  { --h: 76%; }
.th-calc .tc-bars span:nth-child(8)  { --h: 100%; }
@keyframes tc-bars { to { transform: scaleY(var(--h, 60%)); } }

/* ============================================================================
   2 · ECONOMIC CALENDAR HERO · timeline event strip
   ============================================================================ */
.th-cal {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFFCF6 100%);
  border: 1.5px solid rgba(127,97,75,0.20);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 26px 60px rgba(45,26,12,0.10);
}
.th-cal .cal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid rgba(127,97,75,0.14);
  margin-bottom: 12px;
}
.th-cal .cal-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: #002531; }
.th-cal .cal-date {
  font-family: 'Courier New', monospace;
  font-size: 12px; font-weight: 800;
  color: #7F614B;
}
.th-cal .cal-list { display: grid; gap: 8px; }
.th-cal .cal-evt {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(127,97,75,0.05);
  border-left: 3px solid;
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  opacity: 0;
  animation: cal-slide 0.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.th-cal .cal-evt:nth-child(1) { animation-delay: 0.10s; }
.th-cal .cal-evt:nth-child(2) { animation-delay: 0.20s; }
.th-cal .cal-evt:nth-child(3) { animation-delay: 0.30s; }
.th-cal .cal-evt:nth-child(4) { animation-delay: 0.40s; }
@keyframes cal-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.th-cal .cal-evt.high   { border-color: #B33A4A; }
.th-cal .cal-evt.medium { border-color: #B39A7E; }
.th-cal .cal-evt.low    { border-color: #1F8F4A; }
.th-cal .cal-evt .cal-time {
  font-family: 'Courier New', monospace;
  font-weight: 800;
  color: #002531;
}
.th-cal .cal-evt .cal-name {
  color: #2F4856;
  font-weight: 700;
}
.th-cal .cal-evt .cal-name small {
  display: block;
  font-size: 10.5px;
  color: #5A6B75;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.th-cal .cal-evt .cal-imp {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.08em;
}
.th-cal .cal-evt.high   .cal-imp { background: rgba(179,58,74,0.16); color: #B33A4A; }
.th-cal .cal-evt.medium .cal-imp { background: rgba(127,97,75,0.16); color: #7F614B; }
.th-cal .cal-evt.low    .cal-imp { background: rgba(31,143,74,0.16); color: #1F8F4A; }

/* ============================================================================
   3 · CONTRACT SPECS HERO · animated instrument grid (v2)
   6 asset cards in 3×2 grid · each floats independently · scan beam sweeps
   horizontally · counter bubble bottom-right. Mobile: 2-col stack.
   ============================================================================ */
.cs-grid-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(155deg, #FFFFFF 0%, #F2F8F3 100%);
  border: 1.5px solid rgba(31,143,74,0.18);
  box-shadow: 0 32px 70px rgba(0,55,30,0.10);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: cs-stage-in 0.7s cubic-bezier(0.22,1,0.36,1) 0.1s forwards;
  will-change: transform, opacity;
}
@keyframes cs-stage-in { to { opacity: 1; transform: translateY(0) scale(1); } }

/* Scan beam — sweeps horizontally over grid */
.cs-grid-stage .cs-scan {
  position: absolute;
  top: 0; bottom: 0;
  left: -30%;
  width: 30%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(31,143,74,0.10) 50%,
    transparent 100%);
  pointer-events: none;
  animation: cs-scan-sweep 3.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  z-index: 1;
}
@keyframes cs-scan-sweep {
  0%   { left: -30%; }
  100% { left: 130%; }
}

/* Card grid · 3 cols on desktop, 2 on mobile */
.cs-grid-stage .cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  z-index: 2;
}
@media (max-width: 540px) {
  .cs-grid-stage .cs-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cs-grid-stage { padding: 18px; max-width: 100%; }
}

.cs-grid-stage .cs-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(31,143,74,0.14);
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  opacity: 0;
  transform: translateY(12px);
  animation: cs-card-in 0.55s cubic-bezier(0.22,1,0.36,1) forwards;
  will-change: transform, opacity;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.cs-grid-stage .cs-card:nth-child(1) { animation-delay: 0.45s; }
.cs-grid-stage .cs-card:nth-child(2) { animation-delay: 0.55s; }
.cs-grid-stage .cs-card:nth-child(3) { animation-delay: 0.65s; }
.cs-grid-stage .cs-card:nth-child(4) { animation-delay: 0.75s; }
.cs-grid-stage .cs-card:nth-child(5) { animation-delay: 0.85s; }
.cs-grid-stage .cs-card:nth-child(6) { animation-delay: 0.95s; }
@keyframes cs-card-in { to { opacity: 1; transform: translateY(0); } }

.cs-grid-stage .cs-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31,143,74,0.40);
  box-shadow: 0 12px 24px rgba(0,55,30,0.08);
}

/* Continuous gentle bob — each card slightly different timing */
.cs-grid-stage .cs-card:nth-child(odd)  { animation: cs-card-in 0.55s cubic-bezier(0.22,1,0.36,1) forwards, cs-bob-a 4s ease-in-out 1.2s infinite; }
.cs-grid-stage .cs-card:nth-child(even) { animation: cs-card-in 0.55s cubic-bezier(0.22,1,0.36,1) forwards, cs-bob-b 4.6s ease-in-out 1.4s infinite; }
@keyframes cs-bob-a {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}
@keyframes cs-bob-b {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

.cs-grid-stage .cs-cat {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #1F8F4A;
}
.cs-grid-stage .cs-sym {
  font-size: 14px;
  font-weight: 900;
  color: #002531;
  letter-spacing: -0.005em;
}
.cs-grid-stage .cs-meta {
  font-size: 10px;
  color: #5A6B75;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Counter bubble — bottom-right with pulse */
.cs-grid-stage .cs-counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #1F8F4A 0%, #167a3d 100%);
  border-radius: 999px;
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(31,143,74,0.30);
  z-index: 3;
  animation: cs-counter-in 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.15s backwards;
}
@keyframes cs-counter-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
.cs-grid-stage .cs-num {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.cs-grid-stage .cs-num-lbl {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.1;
  opacity: 0.92;
}
@media (max-width: 540px) {
  .cs-grid-stage .cs-counter { bottom: 12px; right: 12px; padding: 6px 10px; }
  .cs-grid-stage .cs-num { font-size: 15px; }
  .cs-grid-stage .cs-num-lbl { font-size: 7.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-grid-stage, .cs-grid-stage .cs-card, .cs-grid-stage .cs-scan, .cs-grid-stage .cs-counter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================================
   3 · CONTRACT SPECS HERO (LEGACY · v1 spec sheet) — kept for fallback
   ============================================================================ */
.th-spec {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: linear-gradient(160deg, #FFFFFF 0%, #F2F8F3 100%);
  border: 1.5px solid rgba(31,143,74,0.22);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    0 30px 64px rgba(0,55,30,0.12),
    0 0 0 1px rgba(31,143,74,0.04) inset;
  isolation: isolate;
  overflow: hidden;
  /* Card slide-up entrance — single clean animation */
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: th-spec-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
  will-change: transform, opacity;
}
@keyframes th-spec-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Subtle ambient pulse glow behind card */
.th-spec::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 50%, rgba(31,143,74,0.12), transparent 60%);
  z-index: -1;
  animation: th-spec-pulse 5s ease-in-out infinite;
}
@keyframes th-spec-pulse {
  0%,100% { opacity: 0.4; transform: scale(0.9); }
  50%     { opacity: 0.7; transform: scale(1.05); }
}
.th-spec .sp-head {
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em;
  color: #002531;
  padding-bottom: 12px; border-bottom: 1px solid rgba(31,143,74,0.18);
  margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.th-spec .sp-head .sp-cnt {
  color: #1F8F4A; font-family: 'Courier New', monospace; font-weight: 900;
  background: rgba(31,143,74,0.10);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.th-spec .sp-grid { display: grid; gap: 6px; }
.th-spec .sp-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(31,143,74,0.05);
  border: 1px solid rgba(31,143,74,0.08);
  border-radius: 10px;
  font-size: 12.5px;
  /* Stagger reveal — sequential 0.5s after card lands */
  opacity: 0;
  transform: translateX(20px);
  animation: th-row-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
  transition: background 0.2s ease, transform 0.2s ease;
}
.th-spec .sp-row:hover {
  background: rgba(31,143,74,0.10);
  transform: translateX(3px);
}
.th-spec .sp-row:nth-child(1) { animation-delay: 0.55s; }
.th-spec .sp-row:nth-child(2) { animation-delay: 0.65s; }
.th-spec .sp-row:nth-child(3) { animation-delay: 0.75s; }
.th-spec .sp-row:nth-child(4) { animation-delay: 0.85s; }
.th-spec .sp-row:nth-child(5) { animation-delay: 0.95s; }
.th-spec .sp-row:nth-child(6) { animation-delay: 1.05s; }
@keyframes th-row-in {
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .th-spec, .th-spec .sp-row { animation: none !important; opacity: 1 !important; transform: none !important; }
  .th-spec::before { animation: none !important; }
}
.th-spec .sp-row .sp-sym {
  font-weight: 800; color: #002531;
  font-family: 'Courier New', monospace;
}
.th-spec .sp-row .sp-name { color: #2F4856; font-weight: 600; font-size: 12px; }
.th-spec .sp-row .sp-pip {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  color: #1F8F4A;
}

/* ============================================================================
   4 · FEES HERO · transparency badges + bar
   ============================================================================ */
.th-fees {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(160deg, #FFFFFF 0%, #F4F8FD 100%);
  border: 1.5px solid rgba(31,95,168,0.18);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 26px 60px rgba(0,37,49,0.10);
}
.th-fees .fe-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid rgba(31,95,168,0.10);
  margin-bottom: 14px;
}
.th-fees .fe-head .fe-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: #002531; }
.th-fees .fe-head .fe-tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.10em;
  color: #1F8F4A;
  padding: 4px 10px;
  background: rgba(31,143,74,0.12);
  border-radius: 999px;
}
.th-fees .fe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.th-fees .fe-cell {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  background: rgba(31,95,168,0.04);
  border-radius: 12px;
}
.th-fees .fe-cell .fe-lab {
  font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: #5A6B75; font-weight: 700;
}
.th-fees .fe-cell .fe-num {
  font-family: 'Courier New', monospace;
  font-size: 22px; font-weight: 900;
  color: #1F8F4A;
  letter-spacing: -0.01em;
}
.th-fees .fe-cell .fe-sub { font-size: 11px; color: #5A6B75; }
.th-fees .fe-bar {
  margin-top: 14px;
  height: 6px;
  background: rgba(31,95,168,0.10);
  border-radius: 3px;
  overflow: hidden;
}
.th-fees .fe-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #1F8F4A, #5DD895);
  border-radius: 3px;
  animation: fe-fill 2s ease-out forwards;
  width: 0;
}
@keyframes fe-fill { to { width: 100%; } }
.th-fees .fe-foot {
  margin-top: 10px;
  font-size: 11px; color: #5A6B75; text-align: center;
}

/* ============================================================================
   5 · RISK-QUIZ HERO · progress steps with check
   ============================================================================ */
.th-quiz {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(160deg, #FFFCF6 0%, #F6EFE0 100%);
  border: 1.5px solid rgba(127,97,75,0.22);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 26px 60px rgba(45,26,12,0.10);
}
.th-quiz .qz-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid rgba(127,97,75,0.14);
  margin-bottom: 14px;
}
.th-quiz .qz-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: #2D1A0C; }
.th-quiz .qz-progress {
  font-family: 'Courier New', monospace;
  font-weight: 900; color: #7F614B;
  font-size: 13px;
}
.th-quiz .qz-steps { display: grid; gap: 10px; }
.th-quiz .qz-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(127,97,75,0.06);
  border-radius: 10px;
  opacity: 0;
  animation: qz-step 0.45s cubic-bezier(0.22,1,0.36,1) forwards;
}
.th-quiz .qz-step:nth-child(1) { animation-delay: 0.10s; }
.th-quiz .qz-step:nth-child(2) { animation-delay: 0.20s; }
.th-quiz .qz-step:nth-child(3) { animation-delay: 0.30s; }
.th-quiz .qz-step:nth-child(4) { animation-delay: 0.40s; }
@keyframes qz-step {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.th-quiz .qz-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  font-family: 'Courier New', monospace;
}
.th-quiz .qz-step.done .qz-num {
  background: #1F8F4A;
  color: #FFFFFF;
}
.th-quiz .qz-step.active .qz-num {
  background: #7F614B;
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(127,97,75,0.18);
}
.th-quiz .qz-step.todo .qz-num {
  background: rgba(127,97,75,0.16);
  color: #7F614B;
}
.th-quiz .qz-label {
  font-size: 13.5px; font-weight: 700; color: #2D1A0C;
}
.th-quiz .qz-label small {
  display: block; font-size: 11px; color: #5A6B75; font-weight: 600;
  margin-top: 2px;
}
.th-quiz .qz-foot {
  margin-top: 14px;
  padding-top: 12px; border-top: 1px solid rgba(127,97,75,0.14);
  text-align: center;
  font-size: 11px; color: #5A6B75; letter-spacing: 0.08em;
}

/* ============================================================================
   6 · MARGIN HERO · tier ladder visual
   ============================================================================ */
.th-margin {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(160deg, #FFFFFF 0%, #F4F8FD 100%);
  border: 1.5px solid rgba(31,95,168,0.18);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 26px 60px rgba(0,37,49,0.10);
}
.th-margin .mg-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid rgba(31,95,168,0.10);
  margin-bottom: 14px;
}
.th-margin .mg-title { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; color: #002531; }
.th-margin .mg-tag { font-size: 10.5px; font-weight: 800; color: #1F5FA8; }
.th-margin .mg-tiers { display: grid; gap: 6px; }
.th-margin .mg-row {
  display: grid;
  grid-template-columns: 64px 1fr 56px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(31,95,168,0.04);
  border-radius: 8px;
  font-size: 12px;
}
.th-margin .mg-tier {
  font-family: 'Courier New', monospace;
  font-weight: 800; color: #1F5FA8;
  font-size: 11px;
}
.th-margin .mg-bar {
  height: 12px;
  background: rgba(31,95,168,0.08);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.th-margin .mg-bar::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #1F5FA8, #6DA6F2);
  border-radius: 6px;
  animation: mg-grow 1.6s cubic-bezier(0.22,1,0.36,1) forwards;
  transform-origin: left;
}
.th-margin .mg-row:nth-child(1) .mg-bar::after { width: 8%;  animation-delay: 0.05s; }
.th-margin .mg-row:nth-child(2) .mg-bar::after { width: 16%; animation-delay: 0.12s; }
.th-margin .mg-row:nth-child(3) .mg-bar::after { width: 28%; animation-delay: 0.19s; }
.th-margin .mg-row:nth-child(4) .mg-bar::after { width: 42%; animation-delay: 0.26s; }
.th-margin .mg-row:nth-child(5) .mg-bar::after { width: 60%; animation-delay: 0.33s; }
.th-margin .mg-row:nth-child(6) .mg-bar::after { width: 82%; animation-delay: 0.40s; }
.th-margin .mg-row:nth-child(7) .mg-bar::after { width: 100%; animation-delay: 0.47s; }
@keyframes mg-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.th-margin .mg-pct {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-weight: 900; color: #002531;
}

/* ============================================================================
   7 · TOOLS INDEX HERO · animated 6-tool wheel
   ============================================================================ */
.th-wheel {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.th-wheel .tw-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 96px; height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, #1F5FA8, #002531);
  box-shadow: 0 14px 32px rgba(31,95,168,0.30);
  display: grid; place-items: center;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: center;
  z-index: 3;
  animation: tw-pulse 2.4s ease-in-out infinite;
}
@keyframes tw-pulse {
  0%,100% { box-shadow: 0 14px 32px rgba(31,95,168,0.30), 0 0 0 0 rgba(31,95,168,0.40); }
  50%     { box-shadow: 0 14px 32px rgba(31,95,168,0.30), 0 0 0 16px rgba(31,95,168,0); }
}
.th-wheel .tw-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(31,95,168,0.24);
  border-radius: 50%;
  animation: tw-spin 30s linear infinite;
}
.th-wheel .tw-ring-2 {
  width: 310px; height: 310px;
  border: 1px dashed rgba(127,97,75,0.20);
  animation: tw-spin 50s linear infinite reverse;
}
@keyframes tw-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.th-wheel .tw-node {
  position: absolute;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid rgba(31,95,168,0.20);
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(31,95,168,0.16);
  font-size: 11px;
  font-weight: 800;
  color: #002531;
  text-align: center;
  line-height: 1.1;
  padding: 4px;
  opacity: 0;
  animation: tw-fade 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}
.th-wheel .tw-node:nth-child(3) { top: 0%;   left: 50%; transform: translate(-50%, 0);    animation-delay: 0.10s; }
.th-wheel .tw-node:nth-child(4) { top: 22%;  right: 4%; transform: translate(0, 0);       animation-delay: 0.16s; }
.th-wheel .tw-node:nth-child(5) { bottom: 22%; right: 4%; transform: translate(0, 0);     animation-delay: 0.22s; }
.th-wheel .tw-node:nth-child(6) { bottom: 0%; left: 50%; transform: translate(-50%, 0);   animation-delay: 0.28s; }
.th-wheel .tw-node:nth-child(7) { bottom: 22%; left: 4%; transform: translate(0, 0);      animation-delay: 0.34s; }
.th-wheel .tw-node:nth-child(8) { top: 22%;  left: 4%; transform: translate(0, 0);        animation-delay: 0.40s; }
@keyframes tw-fade { to { opacity: 1; } }

/* ============================================================================
   MOBILE OPTIMISE · all tool heroes
   ============================================================================ */
@media (max-width: 900px) {
  .tool-hero .container { grid-template-columns: 1fr; }
  .tool-hero .th-stage { margin-top: 10px; min-height: 320px; }
}
@media (max-width: 768px) {
  .tool-hero { padding: 32px 0 28px !important; overflow: hidden; }
  .tool-hero h1 { font-size: clamp(26px, 8vw, 36px) !important; }
  .tool-hero .th-lead { font-size: 14px !important; }
  .tool-hero .th-chip { font-size: 11px !important; padding: 5px 9px !important; }
  .tool-hero .th-cta-row { flex-direction: column !important; width: 100%; gap: 10px; }
  .tool-hero .th-cta-row > * { width: 100% !important; justify-content: center !important; }

  .th-calc, .th-cal, .th-spec, .th-fees, .th-quiz, .th-margin {
    max-width: 100% !important;
    padding: 18px 14px !important;
    border-radius: 14px !important;
  }
  .th-calc .tc-bars { height: 24px !important; }
  .th-calc .tc-result .tc-big { font-size: 22px !important; }
  .th-cal .cal-evt { grid-template-columns: 56px 1fr auto !important; font-size: 11.5px !important; padding: 8px 10px !important; }
  .th-spec .sp-row { grid-template-columns: 60px 1fr 56px !important; font-size: 11.5px !important; padding: 8px 10px !important; }
  .th-fees .fe-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .th-fees .fe-cell .fe-num { font-size: 19px !important; }
  .th-quiz .qz-step { padding: 8px 10px !important; gap: 10px !important; }
  .th-quiz .qz-num { width: 28px !important; height: 28px !important; font-size: 12px !important; }
  .th-quiz .qz-label { font-size: 12.5px !important; }
  .th-margin .mg-row { grid-template-columns: 56px 1fr 50px !important; font-size: 11px !important; padding: 7px 9px !important; }
  .th-margin .mg-bar { height: 10px !important; }
  .th-wheel { max-width: 320px !important; }
  .th-wheel .tw-core { width: 80px !important; height: 80px !important; font-size: 10px !important; }
  .th-wheel .tw-ring { width: 170px !important; height: 170px !important; }
  .th-wheel .tw-ring-2 { width: 260px !important; height: 260px !important; }
  .th-wheel .tw-node { width: 56px !important; height: 56px !important; font-size: 10px !important; }
}
@media (max-width: 540px) {
  .th-wheel { max-width: 280px !important; }
  .th-wheel .tw-ring-2 { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .th-calc .tc-bars span,
  .th-cal .cal-evt, .th-spec .sp-row, .th-quiz .qz-step,
  .th-margin .mg-row .mg-bar::after, .th-fees .fe-bar span,
  .th-wheel .tw-core, .th-wheel .tw-ring, .th-wheel .tw-node,
  .tool-hero .th-eyebrow .pulse-dot::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================================
   DYNAMIC MARGIN TABLE · MOBILE FIX
   The 7-tier table needs horizontal scroll on mobile + visible header.
   ============================================================================ */
@media (max-width: 768px) {
  .dm-section { padding: 40px 0 !important; }
  .dm-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    margin-left: -8px;
    margin-right: -8px;
  }
  .dm-table {
    min-width: 720px !important;
    font-size: 12px !important;
  }
  .dm-table th, .dm-table td {
    padding: 10px 8px !important;
  }
  .tier-head .tier-tag { font-size: 9.5px !important; }
  .tier-head .tier-band { font-size: 10px !important; }
}

/* Generic page-hero shrink — non-tools fallback */
@media (max-width: 768px) {
  .page-hero {
    padding: 30px 0 24px !important;
  }
  .page-hero h1 {
    font-size: clamp(26px, 8vw, 36px) !important;
    line-height: 1.1 !important;
  }
  .page-hero .lead {
    font-size: 14.5px !important;
    line-height: 1.55 !important;
  }
}
