:root {
  --ref-blue: #5861df;
  --ref-blue-dark: #4852d8;
  --ref-bg: #f5f7fb;
  --ref-ink: #151927;
  --ref-muted: #626877;
  --ref-line: #d9dde7;
}

body { background: var(--ref-bg); color: var(--ref-ink); }
.topbar { position: relative; height: 48px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--ref-line); backdrop-filter: none; }
.topbar nav { gap: 28px; }
.topbar nav a { color: #404554; font-size: 12px; }
.header-cta { border: 1px solid var(--ref-blue); border-radius: 8px; padding: 9px 14px; background: #fff; color: var(--ref-blue); }
.header-cta span { color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ref-blue); box-shadow: none; }
.brand > span:last-child > span { color: var(--ref-blue); }

.tool-hero { min-height: 148px; padding: 12px 20px 22px; text-align: center; }
.tool-badge { margin: 0 0 5px; color: var(--ref-blue); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; }
.tool-hero h1 { margin: 0; color: var(--ref-ink); font-size: clamp(28px, 3vw, 36px); line-height: 1.08; letter-spacing: -1.5px; }
.tool-hero > p:not(.tool-badge) { max-width: 680px; margin: 6px auto 0; color: #626877; font-size: 13px; }

.calculator-wrap { width: calc(100% - 18px); max-width: 1420px; margin: 0 auto 84px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0; }
.input-panel, .results-panel.gravel-result { min-height: 534px; margin: 0; border: 1px solid var(--ref-line); border-radius: 16px; padding: 26px 28px 22px; background: #fff; box-shadow: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.panel-heading > p { margin: 0; color: var(--ref-blue); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.unit-switch { padding: 3px; background: #f0f1f5; }
.unit-switch button { padding: 7px 14px; }
.unit-switch button.active { color: var(--ref-blue); }
.field-row { margin-bottom: 16px; }
.input-panel label { color: #454b58; font-size: 11px; }
.shape-options { gap: 10px; margin-top: 7px; }
.shape-options button { height: 41px; border-color: #ced3de; border-radius: 9px; color: #3f4551; text-align: center; }
.shape-options button span { font-size: 13px; margin-right: 3px; }
.shape-options button.active { border-color: var(--ref-blue); background: #f1f3ff; color: var(--ref-blue); box-shadow: none; }
.dimension-grid { gap: 12px; margin-bottom: 14px; }
.dimension-grid label > span, .money { margin-top: 6px; border-color: #d2d6df; border-radius: 9px; }
.dimension-grid input, .money input { height: 39px; color: #1e2330; font-size: 14px; }
.dimension-grid b { background: #f3f4f7; }
.dimension-grid small { margin-top: 4px; color: #717784; }
.select-field { margin-bottom: 14px; }
.select-field select { height: 41px; margin-top: 6px; border-color: #d2d6df; border-radius: 9px; color: #1e2330; }
.price-box { gap: 12px; margin-bottom: 18px; padding: 0; background: transparent; }
.custom-density-field { margin: -5px 0 12px; padding: 10px 12px; }
.calc-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; border-top: 1px solid #e1e4eb; }
.calc-actions p { margin: 0; color: #686e7a; font-size: 11px; }
.calculate-button { display: none; }
.clear-button { min-width: 82px; height: 42px; border-radius: 9px; color: #343a49; }

.results-panel.gravel-result { display: flex; flex-direction: column; gap: 0; color: var(--ref-ink); }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid #dfe2e9; }
.result-label { margin: 0 0 5px; color: var(--ref-blue) !important; font-size: 11px; letter-spacing: 1px; }
.primary-result { margin: 0; gap: 6px; }
.gravel-result .primary-result strong { color: var(--ref-ink); font-size: 34px; line-height: 1; letter-spacing: -1px; }
.primary-result span { color: #4d5360; font-size: 14px; }
.gravel-result .round-note { max-width: 155px; margin: 0; color: #4c515e; font-size: 11px; text-align: right; }
.gravel-result .round-note b { display: block; color: var(--ref-ink); font-size: 13px; }
.result-detail { position: relative; padding: 14px 0; border-bottom: 1px solid #dfe2e9; }
.result-detail > span { display: block; margin-bottom: 6px; color: var(--ref-blue); font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.result-detail p { margin: 0; color: #252a37; font-size: 13px; line-height: 1.45; }
.result-detail > strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gravel-result .cost-card { margin: 0; border: 0; border-bottom: 1px solid #dfe2e9; border-radius: 0; padding: 14px 0; background: transparent; }
.gravel-result .cost-card span { color: var(--ref-blue); }
.gravel-result .cost-card strong { display: inline; color: #252a37; font: inherit; }
.gravel-result .cost-card small { color: #252a37; font-size: inherit; }
.gravel-result .fine-print { margin: 14px 0 16px; color: #656b78; font-size: 10px; line-height: 1.45; text-align: left; font-style: italic; }
.gravel-result .copy-btn { height: 46px; margin-top: auto; border-radius: 10px; background: var(--ref-blue); color: #fff; font-size: 13px; }
.gravel-result .copy-btn:hover { background: var(--ref-blue-dark); }
.ad-strip { display: none; }

@media (min-width: 1300px) {
  .calculator-wrap { width: calc(100% - 18px); }
}
@media (max-width: 900px) {
  .topbar { height: auto; }
  .tool-hero { min-height: 136px; }
  .calculator-grid { grid-template-columns: 1fr; }
  .input-panel, .results-panel.gravel-result { min-height: auto; }
}
@media (max-width: 600px) {
  .tool-hero { padding: 18px 16px 24px; }
  .tool-hero h1 { font-size: 27px; }
  .calculator-wrap { width: calc(100% - 20px); }
  .input-panel, .results-panel.gravel-result { padding: 20px 16px; border-radius: 13px; }
  .panel-heading { align-items: flex-start; }
  .dimension-grid, .price-box { grid-template-columns: 1fr 1fr; }
  .calc-actions p { max-width: 210px; }
}
