.ad-strip {
  height: 112px;
  max-width: 1160px;
  margin: 14px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9da39f;
}

/* Reference-inspired tool layout */
body {
  background: #f5f7fb;
  color: #172033;
}

.promo-bar {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-bottom: 1px solid #dce2ed;
  background: #eaf4fb;
  color: #4d5b70;
  font-size: 12px;
}

.promo-bar a {
  border-radius: 5px;
  background: #7657e8;
  padding: 5px 11px;
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.topbar {
  position: relative;
  top: auto;
  height: 58px;
  padding: 0 max(3vw, 24px);
  border-bottom: 1px solid #e2e6ee;
  background: white;
  backdrop-filter: none;
}

.brand { color: #172033; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  transform: none;
  background: #7657e8;
  color: white;
}

nav { gap: 0; align-self: stretch; }
nav a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-left: 1px solid #edf0f5;
  color: #313a4c;
  font-size: 13px;
}
nav a:last-child { border-right: 1px solid #edf0f5; }

.header-cta {
  border: 1px solid #ddd8fa;
  background: white;
  color: #6547d7;
  padding: 8px 13px;
}
.header-cta span { color: #7657e8; }

.tool-hero {
  padding: 28px 20px 20px;
  text-align: center;
}

.tool-badge {
  margin: 0 0 9px;
  color: #7657e8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.tool-hero h1 {
  margin: 0;
  color: #0d1321;
  font: 800 clamp(30px, 3vw, 42px)/1.1 Manrope;
  letter-spacing: -1.5px;
}

.tool-hero > p:not(.tool-badge) {
  margin: 9px auto 13px;
  color: #596477;
  font-size: 14px;
}

.helper-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e6e9ef;
  border-radius: 999px;
  background: white;
  padding: 6px 11px;
  color: #31394a;
  font-size: 10px;
  text-decoration: none;
  box-shadow: 0 2px 8px #24324a0a;
}

.helper-pill b {
  border-radius: 999px;
  background: #ff8a35;
  padding: 2px 5px;
  color: white;
  font-size: 7px;
}

.calculator-wrap {
  max-width: 1200px;
  margin: 0 auto 16px;
  border: 0;
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 30px #2837550b;
}

.calc-intro { padding: 22px 28px; }
.calc-intro h2 { color: #172033; font-size: 21px; }
.section-no { color: #d4cff5; }
.kicker { color: #7657e8; }
.unit-switch { background: #f0eefb; }
.unit-switch button.active { color: #6547d7; }

.calculator-grid {
  margin: 0 16px 16px;
  overflow: hidden;
  border: 1px dashed #cfc6ff;
  border-radius: 12px;
}

.input-panel { padding: 28px; }
.shape-options button.active {
  border-color: #7657e8;
  background: #f6f3ff;
  color: #5e42ca;
  box-shadow: 0 0 0 1px #7657e8;
}
.dimension-grid label>span:focus-within,.money:focus-within { border-color: #7657e8; box-shadow: 0 0 0 2px #7657e820; }
.price-box { background: #f7f8fb; }
.add-area { border-color: #cfc6ff; color: #6547d7; }

.results-panel {
  margin: 16px;
  border-radius: 11px;
  background: #292043;
  padding: 30px;
}
.primary-result strong { color: #dcd4ff; }
.cost-card { border-color: #564a72; background: #372d51; }
.copy-btn { background: #7657e8; color: white; }

.ad-strip {
  height: 124px;
  margin: 0 auto 26px;
}
.ad-placeholder {
  height: 92px;
  border: 0;
  background: white;
}

.tool-explainer {
  margin: 0 auto 80px;
  padding: 50px 36px;
  border-radius: 16px;
  background: white;
}
.explainer-head h2,
.explainer-card h3,
.comparison-block h3,
.troubleshooting-block h3 { color: #172033; }
.explainer-card,
.comparison-block,
.troubleshooting-block { border-color: #e3e6ed; }
.explainer-card.caution { border-color: #e6ddc6; background: #fffaf0; }
.table-row.active { background: #f5f2ff; }
.table-row b { color: #7657e8; }

footer { background: #1d1830; }

@media (max-width: 900px) {
  .calculator-grid { grid-template-columns: 1fr; }
  .results-panel { margin-top: 0; }
}

@media (max-width: 600px) {
  .promo-bar { height: auto; min-height: 34px; padding: 6px 10px; font-size: 9px; }
  .topbar { height: 54px; }
  .tool-hero { padding-top: 23px; }
  .tool-hero > p:not(.tool-badge) { font-size: 12px; line-height: 1.5; }
  .calculator-wrap { margin: 0 10px 12px; }
  .calculator-grid { margin: 0 9px 9px; }
  .calc-intro { padding: 18px 15px; }
  .calc-intro .section-no { display: none; }
  .input-panel { padding: 20px 14px; }
  .results-panel { margin: 0 9px 9px; }
  .ad-strip { height: 88px; margin-bottom: 15px; }
  .ad-placeholder { height: 60px; }
  .tool-explainer { margin: 0 10px 50px; padding: 32px 18px; }
}

.ad-strip > span {
  margin-bottom: 5px;
  font-size: 7px;
  letter-spacing: 1.6px;
}

.ad-placeholder {
  width: min(728px, calc(100% - 30px));
  height: 76px;
  border: 1px dashed #c9cdc6;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #eeece5;
  color: #a8aca7;
  font-size: 9px;
  letter-spacing: 1px;
}

.tool-explainer {
  max-width: 1160px;
  margin: -36px auto 100px;
  padding-top: 36px;
}

.explainer-head {
  max-width: 720px;
  margin-bottom: 38px;
}

.explainer-head h2 {
  margin: 10px 0 14px;
  color: var(--forest);
  font: 800 clamp(34px, 4vw, 52px)/1.02 Manrope;
  letter-spacing: -2.4px;
}

.explainer-head > p:last-child,
.explainer-card p,
.comparison-copy p,
.troubleshooting-list p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.explainer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.explainer-card,
.comparison-block,
.troubleshooting-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.explainer-card {
  padding: 27px;
}

.explainer-card.wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 18px;
}

.explainer-number {
  color: #b7c1b2;
  font: 800 24px Manrope;
}

.explainer-card h3,
.comparison-block h3,
.troubleshooting-block h3 {
  margin: 8px 0 11px;
  color: var(--forest);
  font: 800 19px Manrope;
  letter-spacing: -.5px;
}

.explainer-card ul,
.explainer-card ol {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.explainer-card.caution {
  background: #f4f0e5;
  border-color: #d9d2bf;
}

.comparison-block {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 42px;
  margin-top: 14px;
  padding: 32px;
}

.comparison-table {
  overflow: hidden;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.table-row {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr .8fr;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.table-row:last-child { border-bottom: 0; }
.table-row strong { color: var(--ink); }
.table-row b { color: #6f8b50; }
.table-row.active { background: #f0f5e7; }
.table-head { background: #f0f1ec; color: #89928d; font-size: 8px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }

.troubleshooting-block {
  display: grid;
  grid-template-columns: .65fr 1.35fr;
  gap: 45px;
  margin-top: 14px;
  padding: 32px;
}

.troubleshooting-list details {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.troubleshooting-list details:first-child { padding-top: 0; }
.troubleshooting-list details:last-child { border-bottom: 0; }
.troubleshooting-list summary { list-style: none; cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 800; }
.troubleshooting-list summary i { float: right; font-style: normal; font-size: 17px; }
.troubleshooting-list p { margin-bottom: 0; }

@media (max-width: 600px) {
  .ad-strip {
    height: 82px;
    margin: 8px auto;
  }

  .ad-placeholder {
    height: 54px;
  }

  .calculator-wrap {
    margin-top: 0;
  }

  .tool-explainer {
    margin: -28px 15px 70px;
    padding-top: 28px;
  }

  .explainer-grid,
  .comparison-block,
  .troubleshooting-block {
    grid-template-columns: 1fr;
  }

  .explainer-card.wide {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .comparison-block,
  .troubleshooting-block {
    gap: 22px;
    padding: 24px 20px;
  }

  .table-row {
    grid-template-columns: 1fr 1.15fr .7fr;
    padding: 12px 9px;
  }
}
