:root {
  --navy: #123c52;
  --navy-dark: #0a2a3b;
  --blue: #177a9c;
  --cyan: #3ab4c4;
  --orange: #e59a5d;
  --ink: #17313f;
  --muted: #637784;
  --line: #dce6ea;
  --surface: #ffffff;
  --canvas: #f3f7f8;
  --shadow: 0 16px 40px rgba(15, 48, 65, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; }

.site-header {
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(220, 230, 234, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 760; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); }
.brand-mark svg { width: 22px; fill: none; stroke: white; stroke-width: 2; stroke-linejoin: round; }
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: white;
  background: var(--navy);
  border-radius: 10px;
  padding: 11px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease;
}
.download-button:hover { background: var(--navy-dark); transform: translateY(-1px); }
.download-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero {
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 18%, rgba(58, 180, 196, 0.26), transparent 28%),
    linear-gradient(130deg, var(--navy-dark), var(--navy) 62%, #155a70);
}
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 64px 24px 88px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 { max-width: 780px; margin: 0; font-size: clamp(36px, 5.5vw, 64px); line-height: 1.04; letter-spacing: -0.04em; }
.hero-copy { max-width: 680px; margin: 20px 0 0; color: #d7e7ed; font-size: 18px; line-height: 1.6; }
.hero-meta { margin-top: 28px; display: flex; gap: 24px; color: #bbd2dc; font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { width: 8px; height: 8px; border-radius: 50%; background: #61d2a6; box-shadow: 0 0 0 4px rgba(97, 210, 166, 0.15); }

.content-shell { max-width: 1180px; margin: -40px auto 0; padding: 0 24px 70px; position: relative; }
.loading-card, .error-card { padding: 32px; background: white; border-radius: 16px; box-shadow: var(--shadow); }
.error-card { color: #8e2e2e; background: #fff5f3; border: 1px solid #f0c9c2; }
.metrics { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 14px; }
.metric {
  min-height: 148px;
  padding: 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 9px 28px rgba(15, 48, 65, 0.055);
}
.metric-primary { color: white; background: linear-gradient(145deg, #187a9c, #14627e); border-color: transparent; }
.metric p { margin: 0 0 15px; color: var(--muted); font-size: 13px; font-weight: 680; }
.metric-primary p, .metric-primary span { color: #d7eff5; }
.metric strong { display: block; font-size: clamp(23px, 2.5vw, 31px); letter-spacing: -0.035em; white-space: nowrap; }
.metric span { display: block; margin-top: 9px; color: #82939d; font-size: 12px; }

.tabs { display: flex; gap: 5px; margin: 44px 0 30px; padding: 5px; overflow-x: auto; background: #e6eef1; border-radius: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; min-width: max-content; padding: 11px 18px; color: #58707c; background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--navy); background: white; box-shadow: 0 2px 10px rgba(15, 48, 65, 0.08); }
.tab-panel { animation: panel-in 220ms ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; color: var(--navy-dark); font-size: 27px; letter-spacing: -0.025em; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; font-weight: 650; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend-material { background: var(--blue); }
.legend-labor { background: var(--orange); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr); gap: 20px; }
.category-chart, .project-card, .assumptions-grid, .sources-list { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 9px 28px rgba(15, 48, 65, 0.045); }
.category-chart { padding: 25px; }
.chart-row { display: grid; grid-template-columns: 165px minmax(100px, 1fr) 105px; align-items: center; gap: 14px; min-height: 42px; }
.chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.bar-track { height: 12px; display: flex; overflow: hidden; background: #edf2f4; border-radius: 999px; }
.bar-material { background: var(--blue); }
.bar-labor { background: var(--orange); }
.chart-total { color: #526974; font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; font-weight: 700; }
.project-card { padding: 27px; }
.project-card h3 { margin: 0 0 22px; color: var(--navy-dark); font-size: 23px; }
.project-card dl { margin: 0; }
.project-card dl div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid #edf2f4; }
.project-card dt { color: var(--muted); font-size: 13px; }
.project-card dd { margin: 0; text-align: right; font-size: 13px; font-weight: 700; }
.project-note { margin: 22px 0 0; padding: 16px; color: #526974; background: #f1f7f8; border-radius: 10px; font-size: 12px; line-height: 1.55; }

.budget-heading { align-items: center; }
.table-summary { margin: 0; color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; }
.search-field { flex: 1; position: relative; }
.search-field svg { width: 18px; position: absolute; top: 50%; left: 14px; transform: translateY(-50%); fill: none; stroke: #82939d; stroke-width: 2; stroke-linecap: round; }
input, select { width: 100%; height: 44px; color: var(--ink); background: white; border: 1px solid #cfdbdf; border-radius: 10px; outline: none; }
input { padding: 0 14px 0 42px; }
select { min-width: 225px; padding: 0 38px 0 13px; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23, 122, 156, 0.12); }
.table-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 9px 28px rgba(15, 48, 65, 0.04); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { color: white; background: var(--navy); }
th { padding: 14px 12px; text-align: left; white-space: nowrap; }
th:nth-last-child(-n+3) { text-align: right; }
td { padding: 12px; border-bottom: 1px solid #e6edef; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f6fafb; }
td:nth-last-child(-n+3) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-name { min-width: 280px; font-weight: 650; }
.category-pill { display: inline-block; padding: 5px 8px; color: #315567; background: #eaf2f5; border-radius: 6px; white-space: nowrap; font-size: 10px; font-weight: 750; }
.quantity { color: var(--muted); white-space: nowrap; }
.empty-state { padding: 28px; text-align: center; color: var(--muted); }

.assumptions-grid { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; }
.assumption { padding: 22px; border-bottom: 1px solid var(--line); }
.assumption:nth-child(odd) { border-right: 1px solid var(--line); }
.assumption:last-child, .assumption:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.assumption h3 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.assumption strong { font-size: 17px; }
.assumption p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sources-list { overflow: hidden; }
.source { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.source:last-child { border-bottom: 0; }
.source h3 { margin: 0; font-size: 14px; }
.source p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.source a { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; word-break: break-all; }
.source a:hover { text-decoration: underline; }

.notice { display: flex; gap: 14px; margin-top: 34px; padding: 18px 20px; color: #566e79; background: #eaf1f3; border-radius: 12px; font-size: 12px; line-height: 1.6; }
.notice svg { flex: 0 0 auto; width: 20px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.notice p { margin: 0; }
footer { min-height: 90px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #8aa0aa; background: var(--navy-dark); font-size: 12px; }
footer a { color: #d3e5eb; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .project-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
}
@media (max-width: 640px) {
  .site-header { height: 64px; padding-inline: 16px; }
  .download-button { padding: 10px 12px; }
  .download-button svg { display: none; }
  .hero-inner { padding: 48px 18px 72px; }
  .hero h1 { font-size: 37px; }
  .hero-copy { font-size: 16px; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .content-shell { margin-top: -30px; padding: 0 14px 50px; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .metric { min-height: 128px; }
  .tabs { margin-top: 30px; }
  .tab { flex: 0 0 auto; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .chart-row { grid-template-columns: 110px minmax(75px, 1fr) 80px; gap: 9px; }
  .category-chart { padding: 18px 14px; }
  .chart-label { font-size: 11px; }
  .chart-total { font-size: 10px; }
  .project-card dl, .assumptions-grid { display: block; }
  .assumption, .assumption:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--line); }
  .assumption:last-child { border-bottom: 0; }
  .filters { flex-direction: column; }
  select { min-width: 100%; }
  .source { grid-template-columns: 1fr; gap: 8px; }
  footer { padding: 24px 18px; flex-direction: column; justify-content: center; text-align: center; }
}
