:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #647067;
  --line: #d9dfd8;
  --green: #1f7a4d;
  --green-soft: #e4f4ea;
  --gold: #a16510;
  --gold-soft: #fff0d1;
  --blue: #27638f;
  --blue-soft: #e2f0fa;
  --danger: #a64236;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button,
select,
input {
  font: inherit;
}

button,
select,
input[type="search"] {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

button {
  cursor: pointer;
  padding: 0 12px;
}

button.active,
button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

select,
input[type="search"] {
  width: 100%;
  padding: 0 11px;
  color: var(--ink);
  font-weight: 500;
}

main {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px) 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stats div,
.run,
.listing,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats div {
  padding: 14px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.runs {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.run {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr 100px 90px 180px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
}

.run strong {
  color: var(--ink);
}

.listings {
  display: grid;
  gap: 12px;
}

.listing {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 190px;
  overflow: hidden;
}

.thumb {
  background: #d8ded7;
  display: grid;
  place-items: center;
  color: var(--muted);
  min-height: 190px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-body {
  padding: 16px 18px;
  min-width: 0;
}

.listing-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

h2 {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 a:hover {
  color: var(--green);
}

.listing p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.price {
  text-align: right;
  flex: 0 0 150px;
}

.price strong,
.price span {
  display: block;
}

.price strong {
  font-size: 18px;
}

.price span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green);
}

.badge.program {
  background: var(--gold-soft);
  color: var(--gold);
}

.badge.view {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.land {
  background: #f0eadf;
  color: #75552a;
}

.badge.area {
  background: #e7edf6;
  color: #365b8c;
}

dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
  margin: 0;
}

dl div {
  min-width: 0;
  padding: 9px 10px;
  background: #f7f8f6;
  border-radius: 8px;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.notes {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #405248;
}

.gallery {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding: 8px;
  overflow-x: auto;
  background: #f7f8f6;
  border-radius: 8px;
}

.gallery a {
  flex: 0 0 72px;
  height: 54px;
  overflow: hidden;
  border-radius: 6px;
  background: #d8ded7;
}

.gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.notes li + li {
  margin-top: 3px;
}

.empty {
  padding: 28px;
  color: var(--muted);
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .run {
    grid-template-columns: 1fr 80px;
  }

  .run span:last-of-type,
  .run time {
    display: none;
  }

  .listing {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main {
    padding-inline: 14px;
  }

  .topbar,
  .listing-top {
    display: grid;
  }

  .topbar button {
    width: 100%;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing {
    grid-template-columns: 1fr;
  }

  .thumb {
    aspect-ratio: 16 / 10;
    min-height: auto;
  }

  .price {
    text-align: left;
    flex-basis: auto;
  }
}
