:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --text:#1c1e21;
  --muted:#6b7280;
  --border:#e8e8ef;
  --primary:#2563eb;
  --primary-600:#1e40af;
  --chip:#eef2ff;
  --shadow:0 8px 24px rgba(16,24,40,.06);
  --shadow-hover:0 10px 28px rgba(16,24,40,.10);
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;
}
a{color:var(--primary);text-decoration:none}
a:hover{color:var(--primary-600)}
.container{max-width:1100px;margin:0 auto;padding:0 16px}

/* Masthead */
.masthead{
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
  justify-items:center;
  gap:22px;
  padding:22px 24px;
  margin:18px 0 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 45%, #eef2ff 100%);
  border:1px solid color-mix(in srgb, var(--border) 75%, #c7d2fe);
  border-radius:16px;
  box-shadow:var(--shadow);
  min-height:140px;
}
.brand{
  width:100%;
  max-width:480px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  text-align:center;
  gap:6px;
}
.brand-title{
  margin:0;
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight:800;
  letter-spacing:-0.03em;
  color:#0f172a;
}
.brand-sub{
  color:#334155;
  margin-top:6px;
  font-size:16px;
}
.masthead img{
  max-width:100%;
  height:auto;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--border) 70%, #cbd5e1);
  box-shadow:var(--shadow);
  align-self:center;
  justify-self:center;
  object-fit:contain;
  display:block;
}
@media(max-width:640px){
  .masthead{display:flex; flex-direction:column; align-items:flex-start;}
  .masthead img{width:100%; height:auto;}
}

/* Hero */
.hero{
  margin:18px 0 12px;
  padding:18px;
  border-radius:14px;
  background:
    radial-gradient(80% 120% at 100% -10%, #dbeafe 0%, rgba(219,234,254,0) 60%),
    linear-gradient(180deg,#ffffff, #f9fafb);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero h1{margin:0 0 6px;font-size:26px}
.hero p{margin:0;color:var(--muted)}

/* Top bar */
.topbar{display:flex;justify-content:space-between;align-items:center;margin:12px 0}
.inline{display:flex;align-items:center;gap:10px}
.muted{color:var(--muted);font-size:13px}
.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:var(--primary);
  color:#fff;
  padding:9px 12px;
  border-radius:10px;
  text-decoration:none;
  font-weight:600;
  border:1px solid var(--primary-600);
  box-shadow:0 1px 0 rgba(0,0,0,.04), 0 2px 8px rgba(37,99,235,.18);
}
.btn.secondary{background:#6b7280;border-color:#5a6268}
.btn:hover{background:var(--primary-600)}
.btn.secondary:hover{background:#525760}
button.btn{cursor:pointer}

/* Grid + cards */
.grid{display:grid;grid-template-columns:1fr;gap:16px;margin:16px 0 20px}
@media(min-width:760px){ .grid{grid-template-columns:1fr 1fr} }
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  box-shadow:var(--shadow);
  transition:transform .1s ease, box-shadow .2s ease;
}
.card:hover{transform:translateY(-2px);box-shadow:var(--shadow-hover)}
.card h3{margin:0 0 8px;font-size:18px}
.card h3 a{text-decoration:none;color:#0f172a}

.chip{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:#0f172a;
  font-size:12px;
}
.chip.cat{background:var(--chip);border-color:#c7d2fe}
.chip.reg{background:#f1f5f9}
a.chip{color:inherit}
.chip{transition: transform .1s ease, box-shadow .2s ease;}
a.chip.link:hover{box-shadow:0 2px 8px rgba(16,24,40,.10);transform:translateY(-1px)}

/* Route comparator */
.route-card h2{margin:0 0 6px}
.route-card .muted{margin:0}
.route-form{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap:12px;
  margin-top:12px;
}
.route-field label{display:block;font-weight:700;margin:0 0 6px}
.route-field input[type="text"]{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
}
.route-actions{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.route-actions .btn[disabled]{opacity:.55; cursor:not-allowed;}
.route-hint{
  grid-column:1/-1;
  border:1px dashed var(--border);
  background:#f8fafc;
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
}
.route-hint a{word-break:break-all;}

/* Logs table */
.logs-table{width:100%; overflow-x:auto;}
.logs-table table{width:100%; border-collapse:collapse;}
.logs-table th,.logs-table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}
.logs-table th{
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  text-transform:uppercase;
}
.mono{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;}
