:root {
  --bg: #07080d;
  --bg-secondary: #0d111a;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(13, 17, 26, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(100, 170, 255, 0.26);
  --white: #fff;
  --muted: #a1a1aa;
  --muted-dark: #71717a;
  --blue: #0f4fa8;
  --electric: #2563eb;
  --gold: #ffc72c;
  --gold-dark: #c99a00;
  --gold-glow: rgba(255, 199, 44, 0.22);
  --success: #25d366;
  --danger: #ff5b6e;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --heading: "Montserrat", Arial, sans-serif;
  --body: "Montserrat", Arial, sans-serif;
  --container: min(1180px, calc(100% - 40px));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--white);
  font-family: var(--body);
  background:
    radial-gradient(circle at 75% 0%, rgba(15, 79, 168, 0.22), transparent 31rem),
    radial-gradient(circle at 2% 20%, rgba(37, 99, 235, 0.11), transparent 24rem),
    var(--bg);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 12%, #000 0%, transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.tool-shell {
  width: var(--container);
  margin-inline: auto;
}

.tool-header {
  position: sticky;
  z-index: 10;
  top: 16px;
  padding-top: 16px;
}

.tool-nav {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px 10px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 8, 13, 0.68);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(22px) saturate(130%);
}

.tool-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.tool-brand img {
  display: block;
  width: 188px;
  max-width: 46vw;
  height: auto;
}

.tool-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-nav-link {
  color: #d4d4d8;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.tool-nav-link:hover {
  color: var(--gold);
}

.tool-main {
  padding: 70px 0 42px;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(280px, 0.94fr);
  align-items: center;
  gap: clamp(28px, 5vw, 70px);
  min-height: 390px;
  padding: 48px 0 28px;
}

.tool-hero--center {
  max-width: 780px;
  min-height: auto;
  margin-inline: auto;
  text-align: center;
}

.tool-kicker {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-hero h1 {
  max-width: 100%;
  margin: 14px 0 18px;
  font-family: var(--heading);
  font-size: clamp(2.45rem, 6vw, 5.4rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.07em;
  overflow-wrap: normal;
}

.tool-hero p {
  max-width: 680px;
  color: #c4c4cc;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  font-weight: 500;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.tool-card,
.tool-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 45%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.tool-panel {
  padding: clamp(18px, 2.4vw, 28px);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  min-width: 0;
}

.span-4 {
  grid-column: span 4;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: 1 / -1;
}

.metric-card {
  min-height: 170px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 14px;
  color: var(--gold);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.tool-field label,
.tool-panel h2,
.tool-panel h3 {
  font-weight: 900;
}

.tool-field label {
  color: #e4e4e7;
  font-size: 0.84rem;
}

.tool-field span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tool-input,
.tool-textarea,
.tool-select {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(7, 8, 13, 0.72);
  color: var(--white);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tool-textarea {
  min-height: 160px;
  resize: vertical;
}

.tool-input:focus,
.tool-textarea:focus,
.tool-select:focus {
  border-color: rgba(255, 199, 44, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 199, 44, 0.12);
}

.tool-actions,
.tool-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-button,
.tool-chip {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
  padding: 12px 18px;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tool-button:hover,
.tool-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 199, 44, 0.4);
}

.tool-button.primary {
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffda61, var(--gold));
  color: #050506;
  box-shadow: 0 16px 38px var(--gold-glow);
}

.tool-button.danger {
  color: var(--danger);
}

.tool-chip.is-active,
.tool-chip.selected {
  border-color: var(--gold);
  background: rgba(255, 199, 44, 0.12);
  color: var(--gold);
}

.tool-chip:disabled,
.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 74px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 199, 44, 0.42);
  background: rgba(255, 255, 255, 0.085);
}

.link-card > span:not(.link-icon) {
  flex: 1;
  min-width: 0;
}

.link-card strong {
  display: block;
  font-size: 1rem;
}

.link-card > span:not(.link-icon) span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: break-word;
}

.link-icon {
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 199, 44, 0.42);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 900;
  margin-top: 0;
}

.tool-footer {
  padding: 34px 0 42px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tool-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.tool-footer a {
  color: var(--gold);
  font-weight: 700;
}

.result-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.result-modal.is-open {
  display: flex;
}

.result-box {
  width: min(860px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #0b0f18;
  padding: 22px;
  box-shadow: var(--shadow);
}

.result-box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.result-box h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.close-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
}

.close-button:hover {
  color: var(--gold);
}

.helper-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .tool-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .span-4,
  .span-6,
  .span-8 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  :root {
    --container: min(1180px, calc(100% - 28px));
  }

  .tool-header {
    top: 8px;
    padding-top: 8px;
  }

  .tool-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .tool-nav-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    justify-content: flex-start;
  }

  .tool-nav-actions .tool-button,
  .tool-nav-actions .tool-nav-link {
    width: 100%;
    text-align: center;
  }

  .tool-main {
    padding-top: 36px;
  }

  .tool-hero {
    padding-top: 30px;
  }

  .tool-hero h1 {
    max-width: 11ch;
    font-size: clamp(1.72rem, 8.6vw, 2.25rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tool-hero p {
    max-width: 31ch;
    font-size: 0.98rem;
  }

  .tool-hero--center h1,
  .tool-hero--center p {
    margin-inline: auto;
  }

  .metric-caption {
    max-width: 31ch;
  }

  .link-card {
    gap: 12px;
    padding: 14px;
  }

  .link-icon {
    width: 38px;
    height: 38px;
  }

  .link-card > span:not(.link-icon) span {
    max-width: 22ch;
  }

  .tool-card,
  .tool-panel {
    border-radius: 20px;
  }

  .tool-footer-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
