:root {
  color-scheme: light;
  --bg: #efe6d7;
  --panel: rgba(255, 252, 247, 0.9);
  --panel-strong: #fff9f1;
  --text: #1f2328;
  --muted: #5c6773;
  --line: rgba(31, 35, 40, 0.1);
  --accent: #0d7c66;
  --accent-strong: #0b5e4e;
  --warm: #c87c2a;
  --danger: #b33c2f;
  --shadow: 0 18px 48px rgba(72, 55, 25, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    "SF Pro Display",
    "PingFang SC",
    "Hiragino Sans GB",
    sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 247, 230, 0.95), transparent 36%),
    linear-gradient(180deg, #f3ecdf 0%, #e9dfce 100%);
  color: var(--text);
}

body {
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  padding: 20px 18px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(13, 124, 102, 0.28), rgba(200, 124, 42, 0.18));
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
}

.hero-copy {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 28ch;
}

.user-badge {
  margin: 12px 0 0;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(13, 124, 102, 0.1);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  padding: 16px;
}

.query-form {
  display: grid;
  gap: 12px;
}

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

.field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(13, 124, 102, 0.16);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
}

.field input:focus {
  outline: 2px solid rgba(13, 124, 102, 0.22);
  border-color: rgba(13, 124, 102, 0.42);
}

.actions,
.footer-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.button {
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

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

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #17917a 100%);
  color: #fff;
}

.button-secondary {
  background: rgba(13, 124, 102, 0.08);
  color: var(--accent-strong);
}

.panel-map {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.map-frame {
  width: 100%;
  min-height: 320px;
  background:
    linear-gradient(135deg, rgba(13, 124, 102, 0.09), rgba(200, 124, 42, 0.09)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.25) 0,
      rgba(255, 255, 255, 0.25) 12px,
      rgba(255, 255, 255, 0.08) 12px,
      rgba(255, 255, 255, 0.08) 24px
    );
}

.map-hint {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 249, 241, 0.88);
  color: var(--muted);
  font-size: 13px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(13, 124, 102, 0.08);
}

.summary-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.routes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}

.routes-header h2 {
  margin: 0;
  font-size: 18px;
}

.status-text {
  font-size: 13px;
  color: var(--warm);
}

.routes-list {
  display: grid;
  gap: 10px;
}

.route-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(13, 124, 102, 0.08);
  background: #fff;
}

.route-card.is-active {
  border-color: rgba(13, 124, 102, 0.44);
  box-shadow: 0 0 0 2px rgba(13, 124, 102, 0.14);
}

.route-card-top,
.route-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-card-top {
  margin-bottom: 10px;
}

.route-rank {
  font-size: 13px;
  color: var(--muted);
}

.route-time {
  font-size: 20px;
  font-weight: 800;
}

.route-traffic {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 124, 102, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.route-card-meta {
  font-size: 13px;
  color: var(--muted);
}

.error-text {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}

@media (min-width: 820px) {
  body {
    padding: 24px;
  }

  .app-shell {
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: start;
  }

  .hero {
    grid-column: 1 / -1;
  }

  .panel-map {
    grid-row: span 2;
    min-height: 620px;
  }

  .map-frame {
    min-height: 620px;
  }
}
