:root {
  --ink: #171714;
  --muted: #6e7067;
  --paper: #f3efe5;
  --card: #faf8f1;
  --line: #cfc9bc;
  --yellow: #e9b923;
  --red: #b94735;
  --green: #176b47;
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
}

.hero {
  color: var(--ink);
  background: #ebe5d8;
  padding: 24px max(24px, calc((100vw - 1240px) / 2)) 68px;
  border-top: 8px solid var(--green);
  border-bottom: 1px solid var(--ink);
}

nav, .hero-grid, main, footer { max-width: 1240px; margin-inline: auto; }
nav { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; color: inherit; text-decoration: none; font-size: 25px; font-weight: 800; letter-spacing: -.06em; }
.brand-mac { padding: 7px 10px 8px; color: var(--yellow); background: var(--green); border-radius: 8px; }
.brand-scope { padding-left: 7px; color: var(--ink); }
.status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 12px "DM Mono", monospace; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #51d581; box-shadow: 0 0 0 6px rgba(81, 213, 129, .12); }
.hero-grid { display: grid; grid-template-columns: 1.45fr .7fr; gap: 70px; align-items: end; padding-top: 76px; }
.eyebrow {
  margin: 0 0 12px; color: #b9a339; text-transform: uppercase;
  letter-spacing: .16em; font: 500 11px "DM Mono", monospace;
}
.eyebrow.green { color: var(--green); }
.eyebrow.red { color: var(--red); }
h1 { margin: 0; max-width: 850px; font-family: "Source Serif 4", serif; font-size: clamp(52px, 7vw, 94px); letter-spacing: -.055em; line-height: .93; }
h1 em { color: var(--green); font-style: normal; }
.intro { max-width: 650px; margin: 28px 0 0; color: #55574f; line-height: 1.75; }
.hero-control { padding: 20px 0 0; border: 0; border-top: 2px solid var(--ink); border-radius: 0; background: transparent; backdrop-filter: none; }
.hero-control label { display: block; margin-bottom: 9px; color: var(--muted); font: 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
select, input {
  width: 100%; border: 1px solid var(--line); border-radius: 2px; background: var(--card);
  color: var(--ink); padding: 13px 14px; font: 600 14px "Manrope", sans-serif; outline: none;
}
select:focus, input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 204, 24, .2); }
.product-helper { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.popular-products-wrap { margin-top: 16px; }
.popular-products-wrap > span { display: block; margin-bottom: 7px; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.popular-products { display: flex; flex-wrap: wrap; gap: 7px; }
.product-chip {
  border: 1px solid #bdb6a9; border-radius: 2px; padding: 7px 10px;
  color: var(--ink); background: transparent; font-size: 10px; font-weight: 700;
  cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.product-chip:hover, .product-chip.active { color: var(--ink); border-color: var(--yellow); background: var(--yellow); }
button { font-family: inherit; }
.updated { display: flex; justify-content: space-between; gap: 15px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); font: 11px "DM Mono", monospace; }
.updated span { color: var(--muted); } .updated strong { color: var(--green); text-align: right; }

main { padding: 30px 20px 78px; }
.report-index { display: grid; grid-template-columns: auto 1fr auto auto; gap: 24px; align-items: center; margin-bottom: 48px; padding: 12px 0; border-bottom: 1px solid var(--ink); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.report-index strong { font-size: 12px; }
.kpi-section { margin-bottom: 20px; }
.kpi-explainer { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin: 0 4px 16px; }
.kpi-explainer p:last-child { max-width: 440px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.kpi-grid { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); gap: 16px; }
.kpi, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 2px; box-shadow: none; }
.kpi { min-height: 150px; padding: 20px; display: flex; flex-direction: column; border-top: 3px solid var(--ink); }
.kpi.featured { color: #fff; background: var(--ink); border-color: var(--ink); }
.kpi span { color: var(--muted); font: 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.kpi.featured span { color: #aead9f; }
.kpi strong { margin-top: auto; font-size: 40px; letter-spacing: -.05em; }
.kpi small { margin-top: 5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.featured small { color: #aaa99e; }

.locator-panel { padding: 30px; }
.locator-intro { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.locator-intro p:not(.eyebrow) { max-width: 700px; margin: 10px 0 0; color: var(--muted); line-height: 1.65; font-size: 13px; }
.locator-intro .locator-current { display: inline-block; margin-top: 12px; border-left: 2px solid var(--green); padding: 6px 10px; color: var(--ink); background: #ece8dc; font: 10px "DM Mono", monospace; }
.locator-current strong { color: var(--green); }
.privacy-note { display: block; margin-top: 7px; color: #99988e; font-size: 10px; }
.primary-button {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; border: 1px solid var(--ink); border-radius: 2px; padding: 0 20px;
  color: var(--ink); background: var(--yellow); box-shadow: none;
  font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .2s, opacity .2s;
}
.primary-button:hover { transform: translateY(-2px); }
.primary-button:disabled { opacity: .65; cursor: wait; transform: none; }
.location-icon {
  display: block; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px currentColor;
}
.primary-button.working .location-icon { animation: locate-pulse 1s ease-in-out infinite; }
@keyframes locate-pulse { 50% { transform: scale(.65); opacity: .45; } }
.locator-message { min-height: 18px; margin-top: 16px; color: var(--muted); font: 11px "DM Mono", monospace; }
.locator-message.success { color: var(--green); }
.locator-message.error { color: var(--red); }
.locator-results { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; margin-top: 20px; }
.locator-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 2px; background: #f2efe6; }
.locator-card.recommended { color: #fffdf7; background: var(--ink); border-color: var(--ink); }
.locator-card-label { display: block; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.locator-card.recommended .locator-card-label { color: #aaa99e; }
.locator-badge { position: absolute; top: 16px; right: 16px; color: var(--green); font: 9px "DM Mono", monospace; }
.locator-card.recommended .locator-badge { color: var(--yellow); }
.locator-card h3 { margin: 22px 0 5px; font-size: 15px; }
.locator-card p { min-height: 38px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.locator-card.recommended p, .locator-card.recommended small { color: #aaa99e; }
.locator-metrics { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.locator-metrics strong { font-size: 28px; letter-spacing: -.05em; }
.locator-metrics span { font: 11px "DM Mono", monospace; }
.locator-card small { display: block; margin: 4px 0 17px; color: var(--muted); }
.locator-card a, .nearby-list a { color: inherit; font-size: 11px; font-weight: 800; text-decoration-color: var(--yellow); text-underline-offset: 4px; }
.nearby-list-wrap { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.nearby-list-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; font-size: 12px; }
.nearby-list-heading span { color: var(--muted); font: 10px "DM Mono", monospace; }
.nearby-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nearby-list article { display: flex; min-width: 0; flex-direction: column; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 2px; }
.nearby-list strong, .nearby-list small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-list strong { font-size: 11px; }
.nearby-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.nearby-list article > span { margin-top: auto; font-weight: 800; }

.panel { margin-top: 28px; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: end; padding: 28px 30px 22px; gap: 20px; }
.section-heading.compact { padding-bottom: 6px; }
h2 { margin: 0; font-family: "Source Serif 4", serif; font-size: 30px; letter-spacing: -.035em; }
.legend { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 10px "DM Mono", monospace; }
.legend i { display: block; width: 130px; height: 7px; border-radius: 10px; background: linear-gradient(90deg, #218a52, #f0bd2a, #d64032); }
#map { height: 620px; background: #e8e4d9; }
.map-note { margin: 0; padding: 12px 30px 16px; color: var(--muted); font-size: 11px; }
.leaflet-popup-content-wrapper { border-radius: 12px; font-family: "Manrope", sans-serif; }
.popup-price { font-size: 22px; font-weight: 800; }
.leaflet-tooltip {
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: #fffdf7;
  box-shadow: none;
  font: 600 11px "Manrope", sans-serif;
}

.analysis-section { margin-top: 64px; padding-top: 20px; border-top: 4px solid var(--ink); }
.analysis-title { display: grid; grid-template-columns: 1.3fr .7fr; gap: 35px; align-items: end; padding: 10px 0 28px; }
.analysis-title h2 { font-size: clamp(38px, 5vw, 66px); line-height: .98; }
.analysis-title > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.section-number { margin: 0 0 10px; color: var(--green); font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .12em; }
.analysis-lede { display: grid; grid-template-columns: 1.15fr 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.analysis-main { padding: 30px 32px 32px 0; border-right: 1px solid var(--ink); }
.analysis-main span, .analysis-facts span { color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
.analysis-main h3 { max-width: 650px; margin: 55px 0 10px; font-family: "Source Serif 4", serif; font-size: clamp(30px, 4vw, 52px); line-height: 1.04; letter-spacing: -.045em; }
.analysis-main p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.7; }
.analysis-facts { display: grid; grid-template-columns: 1fr 1fr; }
.analysis-facts article { min-height: 175px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analysis-facts article:nth-child(2n) { border-right: 0; }
.analysis-facts article:nth-child(n+3) { border-bottom: 0; }
.analysis-facts strong { display: block; margin: 36px 0 5px; font-family: "Source Serif 4", serif; font-size: 32px; letter-spacing: -.04em; }
.analysis-facts small { color: var(--muted); line-height: 1.45; }
.analysis-chart-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.analysis-chart { min-width: 0; padding: 28px 28px 20px 0; border-right: 1px solid var(--ink); }
.analysis-chart:nth-child(2) { padding-left: 28px; padding-right: 0; border-right: 0; }
.analysis-chart h3, .analysis-notes h3 { margin: 0; font-family: "Source Serif 4", serif; font-size: 25px; letter-spacing: -.03em; }
.chart-explainer { max-width: 620px; margin: 12px 0 0; padding-left: 10px; border-left: 2px solid var(--yellow); color: var(--muted); font-size: 10px; line-height: 1.55; }
.chart-explainer strong { color: var(--ink); }
.analysis-canvas { height: 340px; padding: 18px 0 10px; }
.analysis-canvas.small { height: 360px; }
.analysis-caption { min-height: 35px; margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.analysis-bottom-grid { display: grid; grid-template-columns: 1.3fr .85fr .85fr; border-bottom: 1px solid var(--ink); }
.analysis-bottom-grid .analysis-chart { padding: 28px 28px 20px 0; }
.analysis-notes { padding: 28px; border-right: 1px solid var(--ink); }
.analysis-notes:last-child { border-right: 0; }
.analysis-notes ol { margin: 25px 0 0; padding: 0; list-style: none; }
.analysis-notes li { display: grid; grid-template-columns: 25px 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.analysis-notes li > span { color: var(--green); font: 10px "DM Mono", monospace; }
.analysis-notes li p { margin: 0; font-size: 11px; line-height: 1.5; }
.analysis-notes li strong, .analysis-notes li small { display: block; }
.analysis-notes li small { margin-top: 3px; color: var(--muted); }
.methodology-note { max-width: 920px; margin: 16px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.methodology-note a { color: var(--ink); text-underline-offset: 3px; }

.charts-grid, .rankings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-panel { min-width: 0; }
.chart-wrap { height: 330px; padding: 20px 24px 24px; }
.ranking { padding-bottom: 12px; }
.ranking ol { margin: 10px 22px 15px; padding: 0; list-style: none; }
.ranking li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.ranking li:last-child { border-bottom: 0; }
.rank-number { color: #a3a297; font: 11px "DM Mono", monospace; }
.rank-place strong { display: block; font-size: 13px; }
.rank-place small { color: var(--muted); }
.rank-price { font-weight: 800; }

.table-heading { align-items: center; }
.table-heading input { width: min(390px, 100%); }
.table-scroll { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 28px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { position: sticky; top: 0; background: #eeebe2; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; }
td:nth-child(3), th:nth-child(3), td:nth-child(4), th:nth-child(4) { text-align: right; }
.price-cell { font-weight: 800; }
.delta.positive { color: var(--red); } .delta.negative { color: var(--green); }
.table-count { margin: 0; padding: 13px 28px; color: var(--muted); font: 11px "DM Mono", monospace; }

footer { display: flex; justify-content: space-between; gap: 25px; padding: 26px 20px 45px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
footer a { color: var(--ink); font-weight: 800; text-decoration-color: var(--yellow); text-underline-offset: 4px; white-space: nowrap; }
.loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; color: #fff; background: var(--ink); transition: opacity .3s, visibility .3s; }
.loading.hidden { opacity: 0; visibility: hidden; }
.loading span { width: 34px; height: 34px; border: 4px solid #4a493f; border-top-color: var(--yellow); border-radius: 50%; animation: spin .8s linear infinite; }
.loading p { color: #aead9f; font: 11px "DM Mono", monospace; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero-grid, .charts-grid, .rankings-grid, .analysis-title, .analysis-lede, .analysis-chart-grid, .analysis-bottom-grid { grid-template-columns: 1fr; }
  .hero-grid { padding-top: 65px; gap: 38px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .analysis-main, .analysis-chart, .analysis-chart:nth-child(2), .analysis-bottom-grid .analysis-chart, .analysis-notes { padding: 26px 0; border-right: 0; border-bottom: 1px solid var(--ink); }
  .analysis-facts { border-top: 1px solid var(--ink); }
  .locator-results { grid-template-columns: 1fr; }
  .nearby-list { grid-template-columns: repeat(2, 1fr); }
  #map { height: 520px; }
}
@media (max-width: 620px) {
  .hero { padding-inline: 18px; padding-bottom: 48px; }
  h1 { font-size: 49px; }
  .status { display: none; }
  main { padding-inline: 12px; }
  .report-index { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .analysis-facts { grid-template-columns: 1fr; }
  .analysis-facts article, .analysis-facts article:nth-child(2n), .analysis-facts article:nth-child(n+3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-explainer { align-items: start; flex-direction: column; gap: 8px; }
  .kpi-explainer p:last-child { text-align: left; }
  .locator-panel { padding: 22px; }
  .locator-intro { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .nearby-list { grid-template-columns: 1fr; }
  .nearby-list-heading { flex-direction: column; }
  .kpi { min-height: 135px; }
  .section-heading, .table-heading { align-items: start; flex-direction: column; padding-inline: 20px; }
  .legend { width: 100%; } .legend i { flex: 1; }
  #map { height: 500px; }
  th, td { padding-inline: 16px; }
  footer { flex-direction: column; }
}
