:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #20242a;
  --muted: #64748b;
  --line: #d8dee8;
  --brand: #0f766e;
  --brand-soft: #e6f5f3;
  --error: #b42318;
  --route: #1565c0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #f8fbff 0%, var(--bg) 42%, #edf1f5 100%);
}

.app {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.search-panel {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input {
  height: 42px;
  border: 1px solid #c9d4e3;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.96rem;
}

.field input:focus {
  outline: 2px solid #b2e8e3;
  border-color: var(--brand);
}

.mapping-badge {
  display: inline-block;
  background: var(--brand-soft);
  color: #0e5a54;
  border: 1px solid #b6e8e2;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 10px;
  height: 40px;
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #c9d4e3;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  margin: 0;
  font-size: 0.9rem;
  color: var(--error);
}

.result-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.route-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}

.route-summary span {
  color: var(--muted);
  font-size: 0.92rem;
}

.step-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.step-tab {
  white-space: nowrap;
  height: 34px;
  border: 1px solid #c9d4e3;
  background: #f8fafc;
  color: #1e293b;
  border-radius: 999px;
  padding: 0 12px;
  cursor: pointer;
}

.step-tab.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: #0e5a54;
}

.map-wrap {
  position: relative;
  width: 100%;
  border: 1px solid #d4dde8;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
}

.map-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.map-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.step-controls {
  display: flex;
  gap: 8px;
}

.instructions h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.instructions ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

@media (max-width: 720px) {
  .app {
    padding: 14px 10px 24px;
  }

  .panel {
    border-radius: 12px;
    padding: 12px;
  }
}
