.tools-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.tools-hero h1 {
  margin-bottom: 4px;
}

.tools-hero p {
  max-width: 780px;
  margin: 0;
}

.tools-index-grid,
.tools-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tool-link-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-link-card h2,
.tool-link-card h3,
.tool-link-card p {
  margin: 0;
}

.tool-link-card a {
  font-weight: 800;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  gap: 16px;
  align-items: stretch;
}

.tool-form,
.tool-result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.tool-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tool-field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.tool-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.tool-field input:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.tool-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.tool-result span,
.tool-result small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tool-result strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.tool-result b {
  color: var(--accent-strong);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.tool-result .is-positive {
  color: var(--danger);
}

.tool-result .is-negative {
  color: var(--accent-strong);
}

.tool-content {
  margin-top: 18px;
}

.tool-formula {
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 700;
  line-height: 1.65;
}

.tool-example {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 14px;
  background: var(--accent-soft);
}

.tool-example strong,
.tool-example p {
  margin: 0;
}

.tool-faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.tool-faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.tool-faq summary {
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.tool-faq details p {
  margin-bottom: 0;
}

.tool-ad-slot {
  display: none !important;
}

.tool-disclaimer {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
}

body:not(.light) {
  --bg: #0b1220;
  --surface: #111827;
  --surface-strong: #111827;
  --surface-muted: #172033;
  --text: #e5edf7;
  --muted: #a4b2c3;
  --line: rgba(148, 163, 184, .22);
  --accent: #60a5fa;
  --accent-hover: #6f94ff;
  --accent-strong: #bfdbfe;
  --accent-soft: rgba(96, 165, 250, .12);
  --danger: #ff6b78;
  --shadow: 0 12px 30px rgba(0, 0, 0, .22);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(96, 165, 250, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .035) 1px, transparent 1px);
}

@media (max-width: 760px) {
  .tool-layout,
  .tools-index-grid,
  .tools-related-grid {
    grid-template-columns: 1fr;
  }

  .tool-form {
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .tool-form {
    grid-template-columns: 1fr;
  }

  .tool-form,
  .tool-result,
  .tool-link-card {
    padding: 14px;
  }
}
