* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #222;
}

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.75rem;
}

header h1 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  text-align: center;
}

#filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

#filters select {
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

#map-container {
  margin-bottom: 0.75rem;
}

#map {
  width: 100%;
  height: 500px; /* as requested */
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
}

/* Table */

#table-container {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 0.5rem;
}

#table-controls {
  margin-bottom: 0.5rem;
}

#tableSearch {
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
}

#table-headers {
  display: none; /* hidden on mobile; we use card-style rows */
}

/* Collapsed card-style rows for mobile */

.table-row {
  border-top: 1px solid #eee;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.table-row:first-child {
  border-top: none;
}

.row-main-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.row-main-left {
  display: flex;
  flex-direction: column;
}

.row-company {
  font-weight: 600;
}

.row-style-day {
  font-size: 0.8rem;
  color: #555;
}

.row-city {
  font-size: 0.8rem;
  color: #777;
}

.row-main-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fb-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-decoration: none;
}

.cert-badge {
  font-size: 0.8rem;
}

.cert-yes {
  color: #1a7f37;
}

.cert-no {
  color: #888;
}

.row-more {
  margin-top: 0.25rem;
}

.row-more button {
  border: none;
  background: none;
  color: #0077cc;
  font-size: 0.8rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
}

.row-extra {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #555;
}

/* Highlight when linked to marker */

.table-row.active {
  background: #eef6ff;
}

/* Desktop enhancements */

@media (min-width: 768px) {
  #table-headers {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1.2fr 0.7fr 0.9fr;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
  }

  #table-body {
    display: block;
  }

  .table-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1fr 1.2fr 0.7fr 0.9fr;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0;
    border-top: 1px solid #eee;
  }

  .row-main-line,
  .row-more,
  .row-extra {
    display: contents;
  }

  .row-company,
  .row-style-day,
  .row-city,
  .fb-icon,
  .cert-badge {
    font-size: 0.85rem;
  }

  .row-more button {
    display: none;
  }
}
