:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #5f6b7a; --accent: #0b63ce;
  --ok: #1a7f37; --warn: #9a6700; --fail: #cf222e; --border: #d8dee4;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #9198a1; --accent: #4493f8;
          --ok: #3fb950; --warn: #d29922; --fail: #f85149; --border: #30363d; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
nav form { margin-left: auto; }
button { font: inherit; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--accent); color: #fff; cursor: pointer; min-height: 44px; }
button.link { background: none; color: var(--accent); border: none; padding: 0; min-height: auto; }
input, select { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); min-height: 44px; }
.login { max-width: 320px; margin: 15vh auto; display: flex; flex-direction: column; gap: 8px; }
.error { color: var(--fail); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.hit { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.hit.verified { border-left-color: var(--ok); }
.hit header { display: flex; justify-content: space-between; gap: 8px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid currentColor; color: var(--warn); }
.hit.verified .badge { color: var(--ok); }
.price { font-size: 24px; font-weight: 600; }
.price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.meta, .empty { color: var(--muted); font-size: 14px; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.counts div { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.counts dt { color: var(--muted); font-size: 13px; }
.counts dd { margin: 0; font-size: 22px; font-weight: 600; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.fail td:first-child { border-left: 3px solid var(--fail); }
pre { margin: 0; white-space: pre-wrap; font-size: 13px; }
button.secondary { background: var(--card); color: var(--text); }
button.danger { background: var(--card); color: var(--fail); }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ok { color: var(--ok); }
tr.inactive td { opacity: .55; }
.chart { position: relative; height: 60vh; min-height: 280px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.settings { display: grid; gap: 4px; max-width: 480px; }
.settings label { margin-top: 10px; font-weight: 600; }
.settings small { color: var(--muted); }
.settings button { margin-top: 16px; }
nav a { text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; }
nav a.active { border-bottom-color: var(--accent); font-weight: 600; }
nav a.brand { font-weight: 700; color: var(--text); margin-right: 8px; }
.tabs { display: flex; gap: 4px; margin: 4px 0 16px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.tabs a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 7px; text-decoration: none; color: var(--muted); min-height: 44px; }
.tabs a.active { background: var(--accent); color: #fff; font-weight: 600; }
.hit header a { text-decoration: none; color: var(--text); }
.hit header a:hover strong { text-decoration: underline; }
.code { color: var(--muted); font-weight: 400; font-size: 13px; }
.hit.close { border-left-color: var(--accent); }
.hit.community { border-left-color: var(--accent); }
.hit.muted { opacity: .6; border-left-color: var(--border); }
.hit.close .badge { color: var(--accent); }
.hit .price small { display: inline-block; margin-left: 6px; }
progress.budget { display: block; width: 100%; max-width: 320px; height: 8px; margin-top: 6px; accent-color: var(--accent); }
.hit.fare { border-left-color: var(--border); }
.hit.fare .badge { color: var(--muted); }
.hit.fare.close { border-left-color: var(--accent); }
.hit.fare.close .badge { color: var(--accent); }
.hit.fare.verified { border-left-color: var(--ok); }
.hit.fare.verified .badge { color: var(--ok); }
.ref { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.hit header { align-items: flex-start; }
.badge { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 480px) {
  nav { gap: 4px 14px; font-size: 15px; }
  nav a.brand { display: none; }
  .badge { white-space: normal; text-align: center; max-width: 9em; }
}
@media (max-width: 480px) { nav form { display: none; } }
.logout-bottom { margin-top: 32px; }
details.add { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }
details.add summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.add form { margin: 12px 0 0; }
h2.region { margin: 20px 0 8px; font-size: 18px; }
h2.region small { color: var(--muted); font-weight: 400; }
ul.routes { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
ul.routes li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); align-items: center; }
ul.routes li:last-child { border-bottom: none; }
ul.routes li.inactive { opacity: .55; }
ul.routes .route-name { text-decoration: none; color: var(--text); }
ul.routes .meta { grid-column: 1; }
ul.routes .actions { grid-column: 2; grid-row: 1 / span 2; }
button.small { min-height: 36px; padding: 4px 10px; font-size: 14px; }
