* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  color: #1f2937;
}

body {
  background: #f3f4f6;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  height: 100vh;
}

.sidebar,
.detail-panel {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
}

.detail-panel {
  border-right: 0;
  border-left: 1px solid #e5e7eb;
}

.sidebar-section,
.detail-panel {
  padding: 20px;
}

.sidebar-section {
  border-bottom: 1px solid #f1f5f9;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

h2, h3 {
  margin-top: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
button {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

button {
  cursor: pointer;
  background: #ffffff;
}

.secondary-button:hover {
  background: #f8fafc;
}

.muted {
  color: #6b7280;
  font-size: 14px;
}

.map-wrap {
  position: relative;
}

#map {
  height: 100vh;
  width: 100%;
}

.detail-empty {
  color: #6b7280;
  padding: 24px 20px;
}

.hidden {
  display: none;
}

.detail-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-grid > div {
  display: grid;
  gap: 4px;
}

.label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
}

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

.media-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.main-photo-section {
  margin-top: 8px;
}

.main-photo-wrap {
  margin-bottom: 12px;
}

.main-photo-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.main-photo-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.detail-link {
  display: inline-block;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.detail-link:hover {
  text-decoration: underline;
}

.legend {
  display: grid;
  gap: 10px;
}

.auth-box {
  display: grid;
  gap: 8px;
}

.auth-links {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.15);
  flex: 0 0 auto;
}

.marker-pin {
  background: transparent;
  border: 0;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 280px 1fr 320px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 50vh auto;
    height: auto;
  }

  #map {
    height: 50vh;
  }

  .sidebar,
  .detail-panel {
    border: 0;
  }
}
