.ad-tool-shell {
  --bg: #f8f7f3;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #5e6a64;
  --line: #dcd8cf;
  --accent: #0f6b57;
  --accent-dark: #0a4d3f;
  --warning: #a95b18;
  --bad: #9f2d2d;
  --good: #1d7a4d;
  --shadow: 0 18px 40px rgba(23, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

.ad-tool-shell {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.tool-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  letter-spacing: 0;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 680px;
}

.calculator,
.faq {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calculator {
  overflow: hidden;
}

.path-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.path-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: min(100%, 420px);
  height: 48px;
  padding: 4px;
  background: #ece8df;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.path-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.path-button.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(23, 33, 29, 0.1);
}

form {
  padding: 24px;
}

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

.field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 107, 87, 0.14);
}

.input-suffix {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  overflow: hidden;
}

.input-suffix input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.input-suffix span {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.primary-button,
.text-button {
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #ffffff;
  padding: 12px 18px;
  text-decoration: none;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px;
}

.form-error {
  margin-top: 14px;
  color: var(--bad);
  font-weight: 800;
}

.results {
  padding: 24px;
  border-top: 1px solid var(--line);
  background: #fbfaf6;
}

.score-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 10px solid var(--accent);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
}

.score-ring span {
  font-size: 2.35rem;
  font-weight: 950;
  line-height: 1;
}

.score-ring small {
  margin-top: -18px;
  color: var(--muted);
  font-weight: 800;
}

.recommendation {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

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

.result-block {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.result-block ol {
  margin: 0;
  padding-left: 20px;
}

.result-block li + li {
  margin-top: 10px;
}

.result-block p {
  color: var(--muted);
}

.metric-line {
  margin-bottom: 10px;
}

.metric-line strong {
  color: var(--ink);
}

.next-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.next-action .primary-button {
  margin-top: auto;
}

.faq {
  margin-top: 24px;
  padding: 24px;
}

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

details:first-of-type {
  margin-top: 18px;
}

details:last-child {
  padding-bottom: 0;
}

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

details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.is-hidden {
  display: none;
}

@media (max-width: 840px) {
  .tool-shell {
    width: min(100% - 24px, 680px);
    padding: 32px 0;
  }

  .path-card,
  .score-panel {
    grid-template-columns: 1fr;
  }

  .path-card {
    display: grid;
  }

  .path-toggle,
  .form-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }
}

@media (max-width: 520px) {
  .tool-shell {
    width: min(100% - 18px, 480px);
    padding: 22px 0;
  }

  .path-card,
  form,
  .results,
  .faq {
    padding: 18px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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