:root {
  color-scheme: light dark;
  --font-family-mono: "Inconsolata", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --radius-1: 6px;
  --radius-2: 8px;
  --border-color: #ccc;
  --border-color-strong: #505050;
  --text-muted: #777;
  --success: #22863a;
  --danger: #b31d28;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family-mono);
  line-height: 1.4;
}

/* Layout */
header,
.filters,
footer {
  padding: var(--space-3) var(--space-4);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--space-2)) var(--space-4);
}

.site-header__title {
  margin: 0;
  text-transform: uppercase;
  font-size: 1.4rem;
  letter-spacing: 4px;
}

.site-header__meta {
  color: var(--text-muted);
  font-size: 0.9em;
}

.site-header a {
  font-size: 14px;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.filters > * {
  position: relative;
  white-space: nowrap;
}

.filters > *:not(:first-child):not(.filters__save)::before {
  content: "•";
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  margin: 0 6px;
  color: #aaa;
}

.filters__group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.filters__group-label {
  font-weight: 600;
  margin-right: 4px;
}

.filters__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filters__range {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.filters__search {
  padding: 6px 8px;
}

.filters__number {
  width: 6rem;
}

/* Advanced filters (modifier uses base .filters styles via extra class) */

.filters__details {
  width: 100%;
}

.filters__summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  margin-top: 4px;
}

.filters__details[open] > .filters__summary {
  margin-bottom: 8px;
}

.filters__groups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.filters__groups > * {
  position: relative;
  white-space: nowrap;
}

.filters__groups > *:not(:first-child)::before {
  content: "•";
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  margin: 0 6px;
  color: #aaa;
}

/* Controls */
label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

input,
select,
button {
  padding: 6px 8px;
}

.btn-icon {
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  background: canvas;
  border-radius: var(--radius-1);
  cursor: pointer;
}

.sort-dir-toggle {
  line-height: 1;
  font-size: 12px;
  width: 34px;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  position: sticky;
  top: 0;
  background: canvas;
  z-index: 1;
}

.data-table th,
.data-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-color-strong);
  text-align: left;
}

.data-table th + th,
.data-table td + td {
  border-left: 1px solid var(--border-color-strong);
}

.data-table tbody tr:hover {
  background-color: color-mix(in oklab, canvas 70%, highlight 30%);
  box-shadow: 0 1px 0 rgba(0,0,0,.08) inset;
}

.data-table th:nth-child(3),
.data-table th:nth-child(4),
.data-table th:nth-child(5),
.data-table th:nth-child(6) {
  text-align: right;
}

.data-table td:nth-child(3),
.data-table td:nth-child(4),
.data-table td:nth-child(5),
.data-table td:nth-child(6) {
  text-align: right;
}

/* Sortable header styles */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.data-table th.sorted-asc::after {
  content: "\25B4";
  opacity: 1;
  font-size: 10px;
  margin-left: 6px;
}

.data-table th.sorted-desc::after {
  content: "\25BE";
  opacity: 1;
  font-size: 10px;
  margin-left: 6px;
}

/* Utilities */
.u-muted,
.muted {
  color: var(--text-muted);
  font-weight: normal;
}

/* List meta (visible counter) */
.list-meta {
  padding: 8px var(--space-4);
  font-size: 0.9em;
}

.ok {
  color: var(--success);
  font-weight: 700;
}

.fail {
  color: var(--danger);
  font-weight: 700;
}

/* Mobile-friendly layout */
@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    justify-content: initial;
    text-align: center;
    gap: 0
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    align-items: start;
    justify-content: initial;
  }

  /* Hide separators on mobile grid */
  .filters > *:not(:first-child)::before,
  .filters > *:not(:first-child):not(.filters__save)::before,
  .filters__groups > *:not(:first-child)::before {
    content: none;
    display: none;
  }

  .filters #houseTypes,
  .filters #roomClasses {
    grid-column: 1 / -1;
  }

  .filters__group {
    align-items: start;
    flex-direction: column;
    width: 100%;
  }

  .filters input,
  .filters select, {
    width: 100%;
  }

  .filters__range {
    width: 100%;
    gap: var(--space-5);
  }

  .data-table thead {
    display: none;
  }

  .data-table {
    border: 0;
  }

  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    margin: var(--space-3) 0;
    padding: var(--space-3);
    border: 1px solid #ddd;
    border-radius: var(--radius-2);
    background: canvas;
    box-shadow: var(--shadow-1);
  }

  .data-table td {
    padding: 6px 8px;
    border: 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
  }

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

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
  }

  /* In card layout, numeric cells align left next to label */
  .data-table td:nth-child(3),
  .data-table td:nth-child(4),
  .data-table td:nth-child(5),
  .data-table td:nth-child(6) {
    text-align: left;
  }

  /* Emphasize first fields */
  .data-table td:first-child {
    font-weight: 700;
  }
}

