@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #12263a;
  --muted: #627487;
  --paper: #f7fafc;
  --card: #ffffff;
  --line: #dce6ed;
  --teal: #0b7285;
  --teal-deep: #095c6b;
  --mint: #d9f2ec;
  --green: #3caa7d;
  --amber: #f4a261;
  --red: #dc4c4c;
  --red-soft: #fff0ef;
  --shadow: 0 20px 50px rgba(18, 38, 58, 0.10);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 84% 3%, #e6f4f4 0, transparent 28rem), var(--paper); font-family: Manrope, system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 48px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 44px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--teal); box-shadow: 0 8px 18px rgba(11,114,133,.22); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; letter-spacing: .08em; }
.badge { border: 1px solid #bfe0dc; background: rgba(255,255,255,.72); color: var(--teal-deep); border-radius: 999px; padding: 8px 13px; font-size: 12px; font-weight: 700; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 28px; align-items: end; margin-bottom: 28px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 14px; }
h1 { max-width: 760px; margin: 0; font-size: clamp(38px, 5vw, 70px); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 610px; margin: 20px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero-note { justify-self: end; max-width: 355px; padding: 18px 20px; border: 1px solid #cbe4e2; border-radius: 18px; background: rgba(255,255,255,.68); color: var(--teal-deep); font-size: 13px; line-height: 1.6; }
.hero-note strong { display: block; margin-bottom: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }

.app-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: stretch; }
.card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.map-card { min-height: 580px; padding: 22px; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; margin-bottom: 12px; }
.card-kicker { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.card-title { margin: 4px 0 0; font-size: 22px; letter-spacing: -.03em; }
.map-hint { padding: 8px 10px; border-radius: 10px; color: var(--teal-deep); background: var(--mint); font-size: 11px; font-weight: 700; white-space: nowrap; }
.map-wrap { position: relative; height: 465px; margin-top: 18px; border: 1px solid #dbe9ec; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #f5fbfb, #edf5f7); }
.map-wrap::before { content: ''; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(#d6e8ea 1px, transparent 1px), linear-gradient(90deg, #d6e8ea 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent); }
#map { position: relative; width: 100%; height: 100%; z-index: 1; }
.graph-edge { stroke: #b6c7cf; stroke-width: 4; stroke-linecap: round; transition: stroke .25s ease, stroke-width .25s ease; }
.graph-edge.active { stroke: var(--red); stroke-width: 8; }
.edge-label { fill: #6c7c88; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; }
.node { cursor: pointer; }
.node circle { fill: var(--green); stroke: white; stroke-width: 4; filter: drop-shadow(0 4px 4px rgba(18,38,58,.14)); transition: transform .22s ease, fill .22s ease, stroke .22s ease; transform-box: fill-box; transform-origin: center; }
.node:hover circle { transform: scale(1.12); }
.node.start circle { fill: #2e86ab; stroke: #d9f2ec; }
.node.end circle { fill: var(--amber); stroke: #fff0d8; }
.node text { fill: var(--ink); font-size: 12px; font-weight: 800; pointer-events: none; }
.node .node-sub { fill: var(--muted); font-size: 9px; font-weight: 600; }

.side-stack { display: flex; flex-direction: column; gap: 18px; }
.controls { padding: 22px; }
.controls h2, .result-card h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.controls p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 8px 0 18px; }
.field-label { display: block; margin: 14px 0 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
select, .request-input { width: 100%; border: 1px solid #cad8e0; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fbfdfe; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
select:focus, .request-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(11,114,133,.10); }
.actions { display: flex; gap: 9px; margin-top: 17px; }
.primary, .secondary { border: 0; border-radius: 12px; padding: 12px 15px; font-size: 13px; font-weight: 800; transition: transform .2s ease, background .2s ease; }
.primary { flex: 1; color: white; background: var(--teal); }
.primary:hover { background: var(--teal-deep); transform: translateY(-1px); }
.secondary { color: var(--ink); background: #eef3f5; }
.secondary:hover { background: #e2eaee; transform: translateY(-1px); }
.or { display: flex; align-items: center; gap: 10px; margin: 20px 0 6px; color: #8da0aa; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.request-row { display: flex; gap: 8px; }
.request-row .request-input { min-width: 0; }
.request-button { flex: 0 0 auto; border: 1px solid #bfe0dc; border-radius: 12px; padding: 0 13px; color: var(--teal-deep); background: var(--mint); font-size: 12px; font-weight: 800; }
.request-button:hover { background: #c8e9e0; }

.result-card { padding: 22px; min-height: 210px; }
.status { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 13px; border-radius: 13px; background: #f4f8fa; color: var(--muted); font-size: 13px; line-height: 1.55; }
.status::before { content: ''; flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #9cafb8; }
.status.success { background: var(--mint); color: var(--teal-deep); }
.status.success::before { background: var(--green); }
.status.error { background: var(--red-soft); color: #9a3232; }
.status.error::before { background: var(--red); }
.route-line { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.route-place { padding: 7px 9px; border: 1px solid #bfe0dc; border-radius: 9px; color: var(--teal-deep); background: #f1fbf8; font-size: 12px; font-weight: 800; }
.route-arrow { color: #8da0aa; font-weight: 800; }
.distance { margin-top: 15px; color: var(--muted); font-size: 12px; }
.distance strong { color: var(--ink); font-family: 'DM Mono', monospace; font-size: 22px; }

.footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.footer strong { color: var(--ink); }
.mono { font-family: 'DM Mono', monospace; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-note { justify-self: start; max-width: 100%; }
  .app-grid { grid-template-columns: 1fr; }
  .map-card { min-height: auto; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 1240px); padding-top: 17px; }
  .topbar { margin-bottom: 32px; }
  .brand-sub, .badge { display: none; }
  h1 { font-size: 42px; }
  .hero-copy { font-size: 15px; }
  .map-card, .controls, .result-card { padding: 16px; border-radius: 18px; }
  .card-head { display: block; }
  .map-hint { display: inline-block; margin-top: 10px; }
  .map-wrap { height: 370px; margin-top: 12px; }
  .node text { font-size: 10px; }
  .footer { display: block; line-height: 1.7; }
}
