* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  color: #1f2937;
  background: #f3f4f6;
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  height: 100vh;
}

.sidebar {
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid #d1d5db;
  background: #ffffff;
}

.map-container {
  height: 100vh;
}

#map {
  height: 100%;
  width: 100%;
}

h1 {
  font-size: 1.35rem;
  margin: 0;
}

.subtitle {
  margin: 8px 0 16px;
  color: #4b5563;
  font-size: 0.9rem;
}

.card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

h2 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  line-height: 1.25rem;
}

label {
  display: block;
  margin: 8px 0 4px;
  font-size: 0.85rem;
}

label.inline-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.85rem;
}

label.inline-option input[type="checkbox"] {
  width: auto;
  margin: 0;
}

input,
select,
button {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

select[multiple] {
  min-height: 140px;
}

button {
  margin-top: 10px;
  border: none;
  cursor: pointer;
  background: #334155;
  color: #ffffff;
  font-weight: 600;
}

button.primary {
  background: #2563eb;
}

button:hover {
  opacity: 0.92;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.2rem;
}

.workflow-card {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.workflow-list {
  margin: 8px 0 0 18px;
  padding: 0;
}

.workflow-list li {
  margin: 6px 0;
  font-size: 0.85rem;
  line-height: 1.2rem;
}

.legend-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 0.83rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-closed {
  background: #dc2626;
}

.legend-narrowed {
  background: #facc15;
}

.legend-lights {
  background: #f97316;
}

.simple-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.simple-list li {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
  font-size: 0.85rem;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.delete-btn {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  background: #dc2626;
}

.secondary-btn {
  width: auto;
  margin: 0;
  padding: 4px 8px;
  background: #475569;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #ffffff;
}

.badge-current {
  background: #d97706;
}

.badge-future {
  background: #2563eb;
}

.alert-closed {
  color: #b91c1c;
  font-weight: 700;
}

.alert-narrowed {
  color: #a16207;
  font-weight: 700;
}

.alert-lights {
  color: #c2410c;
  font-weight: 700;
}

.alert-unknown {
  color: #475569;
  font-weight: 700;
}

.conflict-closed {
  border-left: 4px solid #dc2626 !important;
}

.conflict-narrowed {
  border-left: 4px solid #facc15 !important;
}

.conflict-traffic_lights {
  border-left: 4px solid #f97316 !important;
}

.conflict-unknown {
  border-left: 4px solid #94a3b8 !important;
}

.conflict-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.conflict-clickable:hover,
.conflict-clickable:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
  outline: none;
}

@keyframes roadworkBlink {
  0%,
  100% {
    stroke-opacity: 0.95;
    fill-opacity: 0.6;
  }
  50% {
    stroke-opacity: 0.2;
    fill-opacity: 0.1;
  }
}

.leaflet-overlay-pane .roadwork-blink {
  animation: roadworkBlink 1.3s ease-in-out infinite;
}

.leaflet-overlay-pane .roadwork-closed {
  animation-duration: 0.9s;
}

.leaflet-overlay-pane .roadwork-narrowed {
  animation-duration: 1.5s;
}

.leaflet-overlay-pane .roadwork-traffic_lights {
  animation-duration: 1.1s;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh 1fr;
  }

  .sidebar {
    order: 2;
    border-right: none;
    border-top: 1px solid #d1d5db;
  }

  .map-container {
    order: 1;
    height: 60vh;
  }
}
