:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f97316;
  --purple: #7c3aed;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

html,
body,
#map {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#map {
  position: absolute;
  inset: 0;
}

#panel {
  position: absolute;
  z-index: 10;
  top: 12px;
  left: 12px;
  width: 460px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.app-header {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: white;
}

.app-header h1 {
  font-size: 20px;
  margin: 0;
}

.app-header p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.section {
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  margin-top: 12px;
}

.section h2 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--gray-800);
}

label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

input,
select,
button {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
}

input,
select {
  background: white;
}

button {
  cursor: pointer;
  background: var(--gray-100);
  color: var(--gray-800);
  font-weight: 600;
}

button:hover {
  background: var(--gray-200);
}

button.active {
  background: #dbeafe;
  border-color: var(--blue);
  color: var(--blue-dark);
}

.primary-btn {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 750;
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

.start-row input {
  border-left: 5px solid var(--green);
}

.end-row input {
  border-left: 5px solid var(--red);
}

.button-row,
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.info-box,
.status {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--gray-50);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  border: 1px solid var(--gray-200);
}

.status {
  color: var(--gray-800);
}

.point-title {
  font-weight: 800;
}

.point-start {
  color: var(--green);
}

.point-end {
  color: var(--red);
}

.point-empty {
  color: var(--gray-400);
}

#results {
  margin-top: 10px;
  max-height: 230px;
  overflow: auto;
  font-size: 14px;
}

.result {
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-top: 8px;
  background: white;
}

.result-name {
  line-height: 1.3;
  color: var(--gray-800);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.result-actions button {
  margin-top: 0;
  padding: 8px;
  font-size: 13px;
}

.route-option {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--gray-50);
  cursor: pointer;
}

.route-option:hover {
  border-color: var(--gray-400);
}

.route-option.active {
  border-color: var(--blue);
  background: #eff6ff;
}

.route-option-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.route-duration {
  font-size: 20px;
  font-weight: 850;
  color: var(--gray-800);
}

.route-arrival {
  font-size: 13px;
  color: var(--gray-600);
  text-align: right;
}

.route-summary {
  margin-top: 8px;
  font-size: 13px;
  color: var(--gray-700);
}

.route-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-600);
}

#itineraryBox {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.leg {
  padding: 10px;
  margin-top: 8px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--gray-200);
}

.leg strong {
  display: block;
  margin-bottom: 3px;
}

.small {
  color: var(--gray-600);
  font-size: 12px;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gray-200);
  font-size: 12px;
  margin-right: 5px;
  font-weight: 800;
}

.badge-walk {
  background: #e5e7eb;
  color: var(--gray-800);
}

.badge-transit {
  background: #ede9fe;
  color: var(--purple);
}

.badge-road {
  background: #dbeafe;
  color: var(--blue-dark);
}