/* =====================================================
   RYNXDigital Tool Pages Extension
   Add this after assets/css/style.css on tool pages.
   It keeps the tools aligned with the RYNX brand system.
===================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #7c3cff;
  --accent-cyan: #18c8ff;
  --bg-dark: #050816;
  --bg-card-solid: #0f172a;
  --white-soft: #f8fafc;
  --muted-ryn: #94a3b8;
  --soft-blue: rgba(37, 99, 235, 0.12);
  --soft-green: rgba(34, 197, 94, 0.14);
  --soft-red: rgba(239, 68, 68, 0.14);
  --soft-warning: rgba(245, 158, 11, 0.14);

  /* Keep your existing CSS variables working */
  --brand: var(--primary);
  --brand-2: var(--primary-dark);
  --brand-3: var(--accent);
}

.tool-page .page-hero p {
  max-width: 780px;
}

.tool-hero-actions,
.tool-utility-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.tool-back-link,
.tool-lang-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tool-back-link:hover,
.tool-lang-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(37, 99, 235, 0.12);
}

.tool-lang-toggle {
  cursor: pointer;
}

.tool-lang-toggle .flag {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.tool-calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.tool-page .form-card,
.tool-page .result-card,
.tool-page .learn-section,
.tool-page .note-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 24px);
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.13), transparent 36%),
    rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow, 0 24px 70px rgba(0, 0, 0, 0.32));
  backdrop-filter: blur(18px);
}

.tool-page .form-card,
.tool-page .result-card {
  padding: clamp(22px, 3vw, 30px);
}

.tool-page .form-card h2,
.tool-page .learn-section h2,
.tool-page .note-card h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.tool-page .subtext,
.tool-page .field-help,
.tool-page .learn-section p,
.tool-page .note-card p {
  color: var(--muted);
  line-height: 1.75;
}

.tool-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tool-field {
  display: grid;
  gap: 8px;
}

.tool-field > span:first-child {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.tool-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.tool-field input:focus {
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.date-input-wrapper {
  position: relative;
}

.date-input-wrapper input {
  padding-left: 48px;
}

.date-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  opacity: 0.78;
  pointer-events: none;
}

input[type="date"] {
  color-scheme: dark;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 900;
  line-height: 1;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.28);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

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

.result-card {
  position: sticky;
  top: 98px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  font-size: 13px;
  font-weight: 900;
}

.big-result {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(24, 200, 255, 0.15), transparent 38%),
    linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(124, 60, 255, 0.08));
  transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.big-result span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 6px;
}

.big-result strong {
  display: block;
  color: var(--text);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  word-break: break-word;
}

.age-big-result strong {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.045em;
}

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

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.metric-grid span {
  display: block;
  color: var(--muted-2, var(--muted));
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.metric-grid strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.insight-box {
  margin-top: 16px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 18px;
  padding: 16px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.12);
  font-weight: 750;
  line-height: 1.65;
}

.insight-box.good {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.16);
  background: rgba(34, 197, 94, 0.13);
}

.insight-box.bad {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(239, 68, 68, 0.13);
}

.result-card.result-good {
  border-color: rgba(34, 197, 94, 0.22);
}

.big-result.result-good {
  border-color: rgba(34, 197, 94, 0.24);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(15, 23, 42, 0.4));
}

.result-card.result-warning {
  border-color: rgba(245, 158, 11, 0.22);
}

.big-result.result-warning {
  border-color: rgba(245, 158, 11, 0.24);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(15, 23, 42, 0.4));
}

.result-card.result-bad {
  border-color: rgba(239, 68, 68, 0.22);
}

.big-result.result-bad {
  border-color: rgba(239, 68, 68, 0.24);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(15, 23, 42, 0.4));
}

.tool-note-section,
.tool-learn-section {
  margin-top: 28px;
}

.tool-page .note-card,
.tool-page .learn-section {
  padding: clamp(22px, 3vw, 34px);
}

.formula-box {
  width: fit-content;
  margin-top: 18px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.1);
}

.formula-box span {
  color: var(--warning);
  font-size: 13px;
  font-weight: 900;
}

.formula-box strong {
  color: var(--text);
}

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

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

.learn-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.learn-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  top: -50px;
  right: -50px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
}

.learn-number {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.learn-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.related-tools-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.related-tools-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 800;
  font-size: 14px;
}

.related-tools-strip a:hover {
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.12);
}

/* Tools listing polish for tools.html */
.tool-card .tag.live-tool,
.live-tool {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.24);
}

.tool-card .tool-type {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.12);
  font-size: 12px;
  font-weight: 850;
}

/* Light mode */
[data-theme="light"] .tool-field input,
[data-theme="light"] .metric-grid div,
[data-theme="light"] .learn-card,
[data-theme="light"] .secondary-button,
[data-theme="light"] .tool-back-link,
[data-theme="light"] .tool-lang-toggle {
  background: rgba(255, 255, 255, 0.78);
}

[data-theme="light"] .tool-page .form-card,
[data-theme="light"] .tool-page .result-card,
[data-theme="light"] .tool-page .learn-section,
[data-theme="light"] .tool-page .note-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.1), transparent 36%),
    rgba(255, 255, 255, 0.78);
}

[data-theme="light"] .big-result {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.86), rgba(255, 255, 255, 0.92));
}

[data-theme="light"] .insight-box {
  color: var(--primary-dark);
}

[data-theme="light"] input[type="date"] {
  color-scheme: light;
}

[data-theme="light"] .tool-card .tool-type,
[data-theme="light"] .live-tool {
  color: var(--primary-dark);
}

@media (max-width: 980px) {
  .tool-calculator-layout,
  .learn-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .tool-form-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  .tool-hero-actions,
  .tool-utility-bar {
    align-items: stretch;
  }

  .tool-back-link,
  .tool-lang-toggle {
    width: 100%;
  }
}

/* ================================
   Tool Pages Light Mode Fix
   Better contrast for result cards
================================ */

[data-theme="light"] .tool-page .form-card,
[data-theme="light"] .tool-page .result-card,
[data-theme="light"] .tool-page .learn-section,
[data-theme="light"] .tool-page .note-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.94);
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 24px 70px rgba(37, 54, 94, 0.12);
}

/* The small result pill */
[data-theme="light"] .status-pill {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.16);
}

/* Main result box */
[data-theme="light"] .big-result {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.10), transparent 36%),
    linear-gradient(135deg, #eef6ff, #ffffff);
  border-color: rgba(37, 99, 235, 0.18);
}

/* Result label */
[data-theme="light"] .big-result span {
  color: #475569;
}

/* Result number/value */
[data-theme="light"] .big-result strong {
  color: #050816;
}

/* Small result metric boxes */
[data-theme="light"] .metric-grid div {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .metric-grid span {
  color: #64748b;
}

[data-theme="light"] .metric-grid strong {
  color: #050816;
}

/* Insight message */
[data-theme="light"] .insight-box {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Good / warning / bad result states in light mode */
[data-theme="light"] .insight-box.good {
  color: #166534;
  background: #ecfdf5;
  border-color: #bbf7d0;
}

[data-theme="light"] .insight-box.bad {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

[data-theme="light"] .result-card.result-good .big-result,
[data-theme="light"] .big-result.result-good {
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  border-color: rgba(34, 197, 94, 0.24);
}

[data-theme="light"] .result-card.result-warning .big-result,
[data-theme="light"] .big-result.result-warning {
  background: linear-gradient(135deg, #fffbeb, #ffffff);
  border-color: rgba(245, 158, 11, 0.26);
}

[data-theme="light"] .result-card.result-bad .big-result,
[data-theme="light"] .big-result.result-bad {
  background: linear-gradient(135deg, #fef2f2, #ffffff);
  border-color: rgba(239, 68, 68, 0.24);
}

/* Khmer text readability */
.tool-page [lang="km"],
.tool-page .kh,
.tool-page [data-lang="km"] {
  line-height: 1.85;
}

/* ================================
   FINAL Light Mode Fix for Tool Result Cards
   Strong override because calculator JS adds inline colors
================================ */

html[data-theme="light"] body.tool-page {
  color: #050816;
}

/* Main result card */
html[data-theme="light"] body.tool-page .result-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fbff) !important;
  border-color: rgba(37, 99, 235, 0.16) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10) !important;
}

/* Status pill */
html[data-theme="light"] body.tool-page .status-pill {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, 0.11) !important;
  border: 1px solid rgba(37, 99, 235, 0.18) !important;
}

/* Big result box */
html[data-theme="light"] body.tool-page .big-result {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.10), transparent 36%),
    linear-gradient(135deg, #eff6ff, #ffffff) !important;
  border-color: rgba(37, 99, 235, 0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

/* Big result label */
html[data-theme="light"] body.tool-page .big-result span {
  color: #475569 !important;
}

/* Big result number */
html[data-theme="light"] body.tool-page .big-result strong {
  color: #050816 !important;
}

/* Metric boxes */
html[data-theme="light"] body.tool-page .metric-grid div {
  background: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.14) !important;
}

html[data-theme="light"] body.tool-page .metric-grid span {
  color: #64748b !important;
}

html[data-theme="light"] body.tool-page .metric-grid strong {
  color: #050816 !important;
}

/* Insight message */
html[data-theme="light"] body.tool-page .insight-box {
  color: #1e40af !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}

/* Good result */
html[data-theme="light"] body.tool-page .result-card.result-good .big-result,
html[data-theme="light"] body.tool-page .big-result.result-good {
  background: linear-gradient(135deg, #ecfdf5, #ffffff) !important;
  border-color: rgba(34, 197, 94, 0.28) !important;
}

/* Warning result */
html[data-theme="light"] body.tool-page .result-card.result-warning .big-result,
html[data-theme="light"] body.tool-page .big-result.result-warning {
  background: linear-gradient(135deg, #fffbeb, #ffffff) !important;
  border-color: rgba(245, 158, 11, 0.30) !important;
}

/* Bad result */
html[data-theme="light"] body.tool-page .result-card.result-bad .big-result,
html[data-theme="light"] body.tool-page .big-result.result-bad {
  background: linear-gradient(135deg, #fef2f2, #ffffff) !important;
  border-color: rgba(239, 68, 68, 0.28) !important;
}

/* Khmer readability inside tool pages */
body.tool-page [lang="km"],
body.tool-page .kh,
body.tool-page [data-lang="km"],
body.tool-page [data-km] {
  line-height: 1.85;
}

/* Khmer font for tool pages */
.tool-page :lang(km),
.tool-page [lang="km"],
.tool-page .kh,
.tool-page [data-lang="km"],
.tool-page [data-km] {
  font-family: "Khmer OS Battambang", "Battambang", "Noto Sans Khmer", sans-serif;
  line-height: 1.85;
  letter-spacing: 0;
}

/* ================================
   Tool Card Badge Fix
   Make Live Tool / Coming Soon pill fit content
================================ */

.tool-card .tag.live-tool,
.tool-card .live-tool,
.tool-card .badge-coming {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: flex-start !important;
  width: auto !important;
  max-width: fit-content !important;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Live badge style */
.tool-card .tag.live-tool,
.tool-card .live-tool {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.32);
}

/* Coming soon badge style */
.tool-card .badge-coming {
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.26);
}

/* Light mode */
[data-theme="light"] .tool-card .tag.live-tool,
[data-theme="light"] .tool-card .live-tool {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .tool-card .badge-coming {
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
}

/* ================================
   Elite Tools Hub Page
================================ */

.tools-hub-section {
  position: relative;
}

.tools-hub-header {
  max-width: 760px;
  margin-bottom: 34px;
}

.tools-hub-header h2 {
  margin: 12px 0 0;
  max-width: 760px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.tools-hub-header p {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

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

.tool-card {
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.14), transparent 34%),
    rgba(255, 255, 255, 0.045);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 100%, rgba(124, 60, 255, 0.16), transparent 36%);
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(24, 200, 255, 0.32);
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.06);
}

.tool-card > * {
  position: relative;
  z-index: 1;
}

.tool-card-featured {
  border-color: rgba(24, 200, 255, 0.34);
  box-shadow: 0 24px 80px rgba(37, 99, 235, 0.16);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.tool-badge {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.tool-badge.live {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.34);
}

.tool-badge.soon {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.26);
}

.tool-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #18c8ff;
  background:
    radial-gradient(circle at 30% 20%, rgba(24, 200, 255, 0.18), transparent 34%),
    rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(24, 200, 255, 0.14);
  font-size: 26px;
  font-weight: 900;
}

.tool-card h3 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.tool-card p {
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.tool-card .btn {
  margin-top: auto;
}

.tool-card .btn.wide {
  width: 100%;
  justify-content: center;
}

.tool-card.coming {
  opacity: 0.82;
}

.tool-card.coming .btn {
  cursor: not-allowed;
}

/* Light mode */
[data-theme="light"] .tool-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .tool-badge.live {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.18);
}

[data-theme="light"] .tool-badge.soon {
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
}

/* Responsive */
@media (max-width: 1080px) {
  .tools-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .tools-hub-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
    padding: 24px;
  }

  .tools-hub-header h2 {
    letter-spacing: -0.04em;
  }
}

/* ================================
   Profit Margin Hero Tool Polish
================================ */

.profit-hero {
  padding: 92px 0 54px;
}

.tool-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
}

.tool-hero-content h1 {
  margin: 16px 0 0;
  max-width: 780px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.tool-hero-content p {
  max-width: 700px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.tool-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.tool-hero-panel {
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.22), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(124, 60, 255, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 80px rgba(37, 99, 235, 0.14);
}

.mini-dashboard {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 26px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(5, 8, 22, 0.92), rgba(15, 23, 42, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-dashboard span {
  color: #18c8ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mini-dashboard strong {
  max-width: 360px;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.mini-bars {
  height: 110px;
  display: flex;
  align-items: end;
  gap: 12px;
}

.mini-bars i {
  flex: 1;
  display: block;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #18c8ff, #2563eb 55%, #7c3cff);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.26);
}

/* Light mode */
[data-theme="light"] .tool-hero-panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.12), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(124, 60, 255, 0.10), transparent 38%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.1);
}

/* Mobile */
@media (max-width: 900px) {
  .profit-hero {
    padding: 64px 0 36px;
  }

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

  .tool-hero-content h1 {
    letter-spacing: -0.045em;
  }

  .mini-dashboard {
    min-height: 280px;
  }
}

@media (max-width: 600px) {
  .tool-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ================================
   Tools Mobile UX Polish
================================ */

@media (max-width: 768px) {
  .tools-hub-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tool-card {
    min-height: auto;
    padding: 24px;
    border-radius: 26px;
  }

  .tool-card-top {
    margin-bottom: 22px;
  }

  .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    font-size: 22px;
  }

  .tool-card h3 {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.04;
  }

  .tool-card p {
    margin: 18px 0 24px;
    font-size: 16px;
    line-height: 1.7;
  }

  .tool-card .btn {
    width: 100%;
    justify-content: center;
  }

  .profit-hero {
    padding: 58px 0 34px;
  }

  .tool-hero-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .tool-hero-content h1 {
    font-size: clamp(42px, 13vw, 62px);
    line-height: 1;
    letter-spacing: -0.045em;
  }

  .tool-hero-content p {
    font-size: 16px;
    line-height: 1.75;
  }

  .tool-hero-actions {
    display: grid;
    gap: 12px;
  }

  .tool-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .tool-hero-panel {
    border-radius: 26px;
    padding: 18px;
  }

  .mini-dashboard {
    min-height: 240px;
    border-radius: 22px;
    padding: 22px;
  }

  .mini-dashboard strong {
    font-size: clamp(28px, 9vw, 40px);
  }

  .calculator {
    gap: 18px;
  }

  .result-panel,
  .contact-form {
    border-radius: 26px;
  }

  .result-number {
    font-size: clamp(42px, 12vw, 64px);
    line-height: 1;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tool-card {
    padding: 22px;
  }

  .tool-badge {
    font-size: 12px;
    padding: 7px 12px;
  }

  .tool-card-top {
    align-items: flex-start;
  }

  .mini-bars {
    height: 86px;
  }
}