:root {
  --bg: #ffffff;
  --text: #20242a;
  --muted: #5f6b7a;
  --line: #d9e0e8;
  --panel: #f7f9fb;
  --panel-strong: #eef3f7;
  --brand: #145c72;
  --brand-dark: #0d3f50;
  --accent: #b8622b;
  --success: #217a45;
  --warning: #9b650f;
  --danger: #a33a32;
  --shadow: 0 12px 28px rgba(31, 43, 56, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--brand);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text small {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #26313d;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a[aria-current="page"] {
  background: var(--panel-strong);
  color: var(--brand-dark);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 56px 0 34px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 36px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  font-size: clamp(2rem, 5vw, 4.1rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

h3 {
  font-size: 1.08rem;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-panel,
.summary-card,
.building-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.hero-panel {
  padding: 20px;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric {
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.section {
  padding: 34px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head p {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.building-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.building-shortcuts a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.button.secondary {
  background: #fff;
  color: var(--brand);
}

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

.summary-card,
.building-card,
.doc-card {
  padding: 18px;
}

.summary-card p,
.building-card p,
.doc-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.building-card {
  display: grid;
  gap: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 760;
  white-space: nowrap;
}

.status.open {
  background: #fae9e7;
  color: var(--danger);
}

.status.progress {
  background: #fff1d7;
  color: var(--warning);
}

.status.closed {
  background: #e3f3e9;
  color: var(--success);
}

.status.review {
  background: #e7eef8;
  color: var(--brand-dark);
}

.status.paid {
  background: #e8f4f2;
  color: #126153;
}

.report-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.report-meta div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-meta strong {
  display: block;
  margin-bottom: 4px;
  color: #2a3541;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.inspection-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.inspection-table th,
.inspection-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.inspection-table th {
  background: var(--panel-strong);
  color: #2a3541;
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inspection-table tr:last-child td {
  border-bottom: 0;
}

.inspection-table td {
  font-size: 0.94rem;
}

.thumb-button {
  width: 86px;
  min-height: 66px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f4f7;
  cursor: pointer;
  overflow: hidden;
}

.thumb-button img {
  width: 100%;
  height: 66px;
  object-fit: cover;
}

.no-photo {
  display: grid;
  place-items: center;
  width: 86px;
  height: 66px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.photo-note {
  display: block;
  max-width: 180px;
  color: var(--muted);
  font-size: 0.84rem;
}

.note-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.village-license-row td {
  background: #e7eef8;
  color: var(--brand-dark);
  font-weight: 800;
}

.village-noted-row td,
.village-section-row td {
  background: var(--panel-strong);
  color: #2a3541;
  font-weight: 780;
}

.village-violation-row td {
  background: #fff;
  color: #2a3541;
  font-weight: 780;
}

.village-violation-row td:first-child {
  color: var(--danger);
}

.notice {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--brand);
  background: var(--panel);
  color: #33404d;
}

.footer {
  margin-top: 38px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 17, 23, 0.82);
}

.lightbox.active {
  display: flex;
}

.lightbox-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 10px;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
}

.lightbox-title {
  margin: 0;
  font-weight: 720;
}

.lightbox-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox img {
  max-height: calc(100vh - 132px);
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 860px) {
  .nav-wrap {
    min-height: 64px;
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .main-nav {
    display: none;
    width: 100%;
    padding: 0 0 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 11px 12px;
  }

  .hero-grid,
  .summary-grid,
  .building-grid,
  .doc-grid,
  .report-meta {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }
}

@media (max-width: 560px) {
  .nav-wrap,
  .container {
    width: min(100% - 22px, 1180px);
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding-top: 36px;
  }

  .metric-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .hero-panel {
    padding: 8px;
    margin-top: 14px;
  }

  .metric {
    min-height: 54px;
    padding: 8px 5px;
    text-align: center;
  }

  .metric strong {
    font-size: 1rem;
  }

  .metric span {
    margin-top: 3px;
    font-size: 0.58rem;
    line-height: 1.15;
  }

  .button {
    width: 100%;
  }

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

  .building-shortcuts a {
    min-width: 0;
    min-height: 34px;
    padding: 7px 10px;
  }

  .inspection-table {
    min-width: 480px;
    table-layout: fixed;
  }

  .inspection-table th,
  .inspection-table td {
    padding: 8px 7px;
  }

  .inspection-table th {
    font-size: 0.66rem;
  }

  .inspection-table td {
    font-size: 0.74rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .inspection-table th:nth-child(1),
  .inspection-table td:nth-child(1) {
    width: 126px;
    max-width: 126px;
  }

  .inspection-table th:nth-child(2),
  .inspection-table td:nth-child(2) {
    width: 72px;
  }

  .inspection-table th:nth-child(3),
  .inspection-table td:nth-child(3),
  .inspection-table th:nth-child(4),
  .inspection-table td:nth-child(4) {
    width: 58px;
  }

  .inspection-table th:nth-child(5),
  .inspection-table td:nth-child(5) {
    width: 106px;
  }

  .thumb-button {
    width: 48px;
    min-height: 42px;
  }

  .thumb-button img {
    height: 42px;
  }

  .photo-note {
    max-width: 96px;
    font-size: 0.68rem;
  }

  .status {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.66rem;
  }
}
