:root {
  color-scheme: light;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f6f8;
  color: #1b1f24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

.page-header {
  padding: 2rem 5vw 1rem;
  background: #1f3b57;
  color: #fff;
}

.page-header h1 {
  margin: 0 0 0.5rem;
}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 5vw;
  background: #fff;
  border-bottom: 1px solid #d9dee3;
  align-items: flex-start;
}

.status-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6773;
}

#status-message {
  margin: 0;
  font-size: 1rem;
}


.status-info {
  flex: 1 1 320px;
}

.status-filters-panel {
  flex: 0 1 280px;
}

.status-filters {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #d9dee3;
  border-radius: 10px;
  display: grid;
  gap: 0.5rem;
  background: #f8fafc;
}

.status-filters legend {
  padding: 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6773;
}

.status-filters label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.status-filters input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.open {
  background: #d64545;
}

.legend-dot.acknowledged {
  background: #f4a640;
}

.legend-dot.closed {
  background: #3e9b5f;
}

.legend-dot.other {
  background: #4e79a7;
}

.legend-dot.archived {
  background: #7a828c;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 5vw 3rem;
}

#map {
  width: 100%;
  min-height: 60vh;
  border-radius: 12px;
  border: 1px solid #d9dee3;
  overflow: hidden;
}

.results {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid #d9dee3;
  max-height: 70vh;
  overflow-y: auto;
}

.results h2 {
  margin-top: 0;
}

#issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.issue-item {
  border-left: 4px solid #4e79a7;
  padding-left: 0.75rem;
}

.issue-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.issue-title-link {
  color: #1f3b57;
  text-decoration: none;
}

.issue-title-link:hover,
.issue-title-link:focus {
  text-decoration: underline;
}

.issue-item p {
  margin: 0.15rem 0;
  color: #4c5560;
  font-size: 0.9rem;
}

.issue-item .meta {
  font-size: 0.85rem;
  color: #6c7885;
}

.issue-item.open {
  border-left-color: #d64545;
}

.issue-item.acknowledged {
  border-left-color: #f4a640;
}

.issue-item.closed {
  border-left-color: #3e9b5f;
}

.issue-item.archived {
  border-left-color: #7a828c;
}

.issue-link {
  color: #1f3b57;
  font-weight: 600;
  text-decoration: none;
}

.issue-link:hover,
.issue-link:focus {
  text-decoration: underline;
}

.issue-page {
  background: #f4f6f8;
  min-height: 100vh;
}

.issue-panel {
  padding: 1.5rem 5vw 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #d9e5f1;
  font-size: 0.95rem;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus {
  text-decoration: underline;
}

.issue-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.issue-detail {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border: 1px solid #d9dee3;
  display: grid;
  gap: 1rem;
}

.issue-detail h2 {
  margin: 0;
  font-size: 1.25rem;
}

.issue-detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
  gap: 0.5rem 1rem;
}

.issue-detail dt {
  font-weight: 600;
  color: #1f3b57;
}

.issue-detail dd {
  margin: 0;
  color: #4c5560;
}

.issue-detail .external-link {
  color: #1f3b57;
  font-weight: 600;
  text-decoration: none;
}

.issue-detail .external-link:hover,
.issue-detail .external-link:focus {
  text-decoration: underline;
}

.issue-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.issue-media-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d9dee3;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.comments-panel {
  margin-top: 0;
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  border: 1px solid #d9dee3;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
  min-height: 0;
  overflow: hidden;
}

.comments-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.25rem;
}

.comment-item {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid #e1e6eb;
  background: #f8fafc;
  display: grid;
  gap: 0.6rem;
}

.comment-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #4c5560;
}

.comment-header span:first-child {
  font-weight: 600;
  color: #1f3b57;
}

.comment-role {
  background: #d9e5f1;
  color: #1f3b57;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comment-date {
  margin-left: auto;
  font-size: 0.82rem;
}

.comment-body {
  margin: 0;
  color: #37414d;
  line-height: 1.5;
}

.comment-image {
  width: 100%;
  max-width: 440px;
  border-radius: 10px;
  border: 1px solid #d9dee3;
}

.comment-media-link {
  color: #1f3b57;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

.comment-media-link:hover,
.comment-media-link:focus {
  text-decoration: underline;
}

.nearby-panel {
  margin-top: 1.5rem;
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem 1.5rem;
  border: 1px solid #d9dee3;
}

.nearby-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nearby-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.nearby-sort {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #4c5560;
}

.nearby-sort select {
  border: 1px solid #d9dee3;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: #f8fafc;
}

.nearby-filter {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #4c5560;
}

.nearby-filter span {
  font-size: 0.85rem;
  color: #6c7885;
}


.nearby-date-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.nearby-date-fields input[type="date"] {
  border: 1px solid #d9dee3;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: #f8fafc;
}

.nearby-date-separator {
  font-size: 0.85rem;
  color: #6c7885;
}

.nearby-layout {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.nearby-list-panel {
  display: grid;
  gap: 0.75rem;
}

.nearby-map-panel {
  min-height: 300px;
  border: 1px solid #d9dee3;
  border-radius: 12px;
  overflow: hidden;
  background: #f4f6f8;
}

#nearby-map {
  width: 100%;
  min-height: 300px;
}

.nearby-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.nearby-item {
  border-left: 4px solid #4e79a7;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e1e6eb;
  display: grid;
  gap: 0.35rem;
}

.nearby-item h3 {
  margin: 0;
  font-size: 1rem;
}

.nearby-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #4c5560;
}

.nearby-item .meta {
  font-size: 0.82rem;
  color: #6c7885;
}

.nearby-item.open {
  border-left-color: #d64545;
}

.nearby-item.acknowledged {
  border-left-color: #f4a640;
}

.nearby-item.closed {
  border-left-color: #3e9b5f;
}

.nearby-item.archived {
  border-left-color: #7a828c;
}

.nearby-pagination {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nearby-pagination button {
  border: 1px solid #d9dee3;
  background: #f4f6f8;
  color: #1f3b57;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.nearby-pagination button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nearby-pagination span {
  font-size: 0.9rem;
  color: #4c5560;
}

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

  #map {
    min-height: 50vh;
  }

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

  .comment-date {
    margin-left: 0;
  }

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

  .comments-panel {
    max-height: none;
  }

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

  .nearby-map-panel,
  #nearby-map {
    min-height: 240px;
  }
}
