:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #1d252c;
  --muted: #66727d;
  --line: #d8dee4;
  --accent: #176b87;
  --accent-soft: #dff2f7;
  --warning-soft: #fff0bf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.site-header {
  padding: 18px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header a {
  font-weight: 700;
  text-decoration: none;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.home {
  width: min(760px, calc(100% - 32px));
}

.page-title {
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0 0 8px;
  font-size: clamp(2.4rem, 5.6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.listing-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-button span {
  color: var(--muted);
  font-weight: 700;
  margin-left: 2px;
}

.filter-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.filter-button.active span {
  color: white;
}

.select-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.select-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafb;
  padding: 4px 5px 4px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.select-control select {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 4px 26px 4px 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.select-control select:focus {
  outline: 2px solid var(--accent-soft);
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.card-media {
  display: block;
}

.card img,
.placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--accent-soft);
}

.card-body {
  padding: 16px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
}

.card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.24;
}

.card h2 a,
tbody a {
  color: var(--text);
  text-decoration: none;
}

.card h2 a:hover,
tbody a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.card-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: #174442;
  font-size: 0.78rem;
  font-weight: 700;
}

.address {
  min-height: 3em;
  color: var(--muted);
  font-size: 0.92rem;
}

.properties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.property {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 0.76rem;
}

dd {
  margin: 0;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.button {
  border-radius: 5px;
  padding: 5px 7px;
  background: var(--accent);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary {
  background: #48525a;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

thead th {
  position: sticky;
  top: 0;
  background: #eef3f5;
}

.markdown-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.markdown-table {
  min-width: 0;
}

.markdown-table th,
.markdown-table td {
  padding: 8px 10px;
}

.markdown-table thead th {
  position: static;
}

.page-list ul {
  padding: 0;
  list-style: none;
}

.page-list a {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.detail-image {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.detail-panel,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.detail-actions {
  margin-top: 12px;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.description {
  max-width: 880px;
}

.description p {
  margin: 0 0 1rem;
}

.description ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

@media (max-width: 820px) {
  .listing-controls {
    align-items: stretch;
  }

  .filters,
  .select-controls,
  .select-control {
    width: 100%;
  }

  .select-controls {
    justify-content: stretch;
  }

  .select-control {
    justify-content: space-between;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}
