:root {
  --bg: #f5f7f3;
  --ink: #15201d;
  --muted: #60706b;
  --line: #d9e1dc;
  --surface: #ffffff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --amber: #e8a12a;
  --rose: #d94d4d;
  --blue: #3176b8;
  --shadow: 0 18px 48px rgba(21, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(245, 247, 243, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 160px;
  height: 40px;
}

.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(52px, 8vw, 96px) clamp(18px, 4vw, 56px) 28px;
}

.hero-copy,
.section-heading,
.content-grid,
.faq,
footer {
  max-width: 1120px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.lead {
  max-width: 690px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.6;
}

.section-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.tool-hero {
  max-width: 1040px;
  padding: clamp(46px, 7vw, 86px) clamp(18px, 4vw, 56px) 24px;
}

.tool-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary {
  background: var(--teal);
  color: white;
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
}

.hero-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.hero-panel strong {
  display: block;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

.hero-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.audit-visual {
  gap: 18px;
}

.roas-equation {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.roas-equation div:not(.equation-symbol) {
  min-width: 0;
}

.roas-equation span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.roas-equation strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(30px, 4vw, 48px);
}

.equation-symbol {
  color: #8b9a95;
  font-size: 26px;
  font-weight: 900;
}

.gmv-split {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f1;
}

.split-total {
  display: grid;
  align-content: center;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(21, 32, 29, 0.06);
}

.split-total span,
.split-total small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.split-total strong {
  margin: 4px 0;
  font-size: 34px;
}

.split-bars {
  display: grid;
  gap: 12px;
  align-content: center;
}

.split-row {
  display: grid;
  grid-template-columns: minmax(104px, 0.74fr) minmax(120px, 1.3fr) minmax(72px, auto);
  gap: 10px;
  align-items: center;
}

.split-label {
  color: #40514c;
  font-size: 12px;
  font-weight: 850;
}

.split-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(21, 32, 29, 0.08);
}

.split-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.split-fill.organic,
.split-fill.creator {
  background: var(--amber);
}

.split-fill.incremental {
  background: var(--teal);
}

.split-row strong {
  font-size: 13px;
  text-align: right;
}

.visual-formula {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7faf8;
  color: #40514c;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.visual-formula strong {
  display: inline;
  font-size: inherit;
}

.ad-slot {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin: 28px clamp(18px, 4vw, 56px);
  border: 1px dashed #aebbb6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: #7b8984;
  font-size: 13px;
  text-transform: uppercase;
}

.ad-top {
  margin-top: 0;
}

.workspace,
.compare-band,
.content-grid,
.faq {
  padding: 58px clamp(18px, 4vw, 56px);
}

.section-heading {
  margin: 0 auto 24px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.tool-surface,
.results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 32, 29, 0.08);
}

.tool-surface {
  padding: 22px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #34423e;
  font-size: 14px;
  font-weight: 750;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
}

.label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.help-tip {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #b8c6c1;
  border-radius: 999px;
  background: #f8faf8;
  color: var(--muted);
  cursor: help;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.help-tip::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 10;
  width: min(260px, 70vw);
  padding: 10px 12px;
  border: 1px solid #cbd6d1;
  border-radius: 8px;
  background: #15201d;
  color: white;
  content: attr(data-tip);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.help-tip::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  z-index: 11;
  width: 9px;
  height: 9px;
  background: #15201d;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) rotate(45deg);
  transition: opacity 160ms ease;
}

.help-tip:hover::after,
.help-tip:focus-visible::after,
.help-tip:hover::before,
.help-tip:focus-visible::before {
  opacity: 1;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd6d1;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  outline: none;
  padding: 0 12px;
}

input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.money-field,
.percent-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 44px;
  border: 1px solid #cbd6d1;
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.percent-field {
  grid-template-columns: 1fr auto;
}

.money-field span,
.percent-field span {
  padding: 0 12px;
  color: var(--muted);
  font-weight: 850;
}

.money-field input,
.percent-field input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.results {
  padding: 24px;
}

.result-main {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-main p {
  margin: 0;
  color: var(--muted);
}

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

.badge {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f5f2;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 850;
}

.badge.warning {
  background: #fff2d8;
  color: #925d05;
}

.badge.danger {
  background: #ffe7e7;
  color: #a42828;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row span {
  color: var(--muted);
}

.breakdown {
  padding-top: 18px;
}

.bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.bar span {
  min-width: 2px;
}

#barCosts,
.dot.costs {
  background: var(--blue);
}

#barFees,
.dot.fees {
  background: var(--amber);
}

#barAds,
.dot.ads {
  background: var(--rose);
}

#barProfit,
.dot.profit {
  background: var(--teal);
}

.breakdown ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.compare-band {
  background: #e9efec;
}

.table-wrap {
  max-width: 1120px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

td {
  font-weight: 760;
}

tr:last-child td {
  border-bottom: 0;
}

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.tool-card {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(21, 32, 29, 0.06);
}

.tool-card:hover {
  border-color: #9eb5ae;
  transform: translateY(-1px);
}

.tool-card span {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.tool-card strong {
  font-size: 18px;
  line-height: 1.25;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 48px;
  margin: 0 auto;
}

.content-grid p,
.content-grid li,
.faq p {
  color: var(--muted);
  line-height: 1.75;
}

.content-grid ol {
  margin: 0;
  padding-left: 22px;
}

.faq {
  margin: 0 auto;
}

details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 850;
}

footer {
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 56px) 46px;
  color: var(--muted);
}

footer a {
  color: var(--teal-dark);
  font-weight: 800;
}

.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(46px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.legal-page h1 {
  font-size: clamp(40px, 6vw, 64px);
}

.legal-page h2 {
  margin-top: 34px;
  font-size: clamp(24px, 3vw, 34px);
}

.legal-page p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero,
  .calculator-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .tool-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding-top: 42px;
  }

  .hero-panel strong {
    font-size: 40px;
  }
}

@media (max-width: 560px) {
  .input-grid {
    grid-template-columns: 1fr;
  }

  .workspace,
  .compare-band,
  .content-grid,
  .faq {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .hero-actions .button {
    width: 100%;
  }

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

  .roas-equation,
  .gmv-split {
    grid-template-columns: 1fr;
  }

  .split-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .split-row strong {
    text-align: left;
  }
}
