:root {
  --bg: #f4f3ee;
  --paper: #ffffff;
  --ink: #1c1c1c;
  --muted: #6b6b66;
  --line: #d9d7cf;
  --navy: #1d3f8f;
  --bar: #1d3f8f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
header.top {
  display: flex; align-items: baseline; justify-content: space-between;
  max-width: 760px; margin: 0 auto; padding: 18px 16px 0;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 18px; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 400; }
.tag { color: var(--muted); font-size: 13px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; margin-left: 16px; }
.nav a.here { color: var(--ink); font-weight: 600; }
.nav a:hover { color: var(--navy); }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
main.wide { max-width: 1000px; }

/* bus leaderboard */
.strip { color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.7; }
.strip b { color: var(--ink); font-weight: 600; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.controls #q, .controls select { font: 14px/1.2 inherit; font-family: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); }
.controls #q { width: 190px; font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.controls .chk { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.controls .chk input { margin: 0; }
.controls .count { margin-left: auto; color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
table.lb { border: 0; border-radius: 0; }
table.lb { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 14px; }
table.lb th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
table.lb th.sorted { color: var(--navy); }
table.lb th.sorted::after { content: " ↑"; }
table.lb th.sorted.desc::after { content: " ↓"; }
table.lb td { padding: 7px 10px; border-top: 1px solid #ecebe5; vertical-align: middle; }
table.lb tr:first-child td { border-top: 0; }
table.lb .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lb .muted { color: var(--muted); }
table.lb a.pl { font-family: ui-monospace, Menlo, Consolas, monospace; text-decoration: none; color: var(--navy); font-weight: 600; }
table.lb tr.typo td { color: var(--muted); }
table.lb tr.typo em { font-style: normal; font-size: 11px; color: #a61e1e; border: 1px solid #e3b4b4; background: #fbf0f0; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
table.lb tr.hl td { background: #fff6cc; }
table.lb small { color: var(--muted); }
.lic { font-size: 12px; border-radius: 3px; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); }
.lic.current { color: #3b5b2d; border-color: #bcd3b1; background: #f0f7ec; }
.lic.expired, .lic.suspended { color: #a61e1e; border-color: #e3b4b4; background: #fbf0f0; }
.lic.grace { color: #8a5a00; border-color: #e6cf99; background: #fcf6e8; }
.note { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.note em { font-style: normal; color: #a61e1e; }
@media (max-width: 700px) {
  table.lb .opt, table.lb th.opt { display: none; }
  .controls .count { margin-left: 0; width: 100%; }
}
h1 { font-size: 30px; line-height: 1.15; margin: 44px 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 0 0 4px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 32px 0 10px; font-weight: 600; }
.lede { color: var(--muted); margin: 0 0 22px; max-width: 560px; }

form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.plate-input, .plate {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper); border: 2px solid var(--navy); border-radius: 6px;
  padding: 6px 14px 4px; min-width: 220px; position: relative;
}
.plate-input input {
  border: 0; outline: 0; background: transparent; width: 100%; text-align: center;
  font: 700 34px/1.1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.12em;
  color: var(--navy); text-transform: uppercase; padding: 0;
}
.plate-input input::placeholder { color: #c4cbdd; }
.plate-input:focus-within { box-shadow: 0 0 0 3px rgba(29, 63, 143, 0.15); }
.state { font: 600 9px/1 Helvetica, Arial, sans-serif; letter-spacing: 0.22em; color: var(--navy); margin-top: 2px; }
button {
  font: 600 16px/1 inherit; font-family: inherit; background: var(--navy); color: #fff; border: 0; border-radius: 6px;
  padding: 0 20px; cursor: pointer; min-height: 56px;
}
button:disabled { opacity: 0.6; cursor: wait; }
.msg { margin: 12px 0 0; color: #a61e1e; font-size: 15px; }
.msg.ok { color: var(--muted); }
.examples { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 2; }
.examples a { text-decoration: none; border: 1px solid var(--line); background: var(--paper); border-radius: 4px; padding: 2px 8px; margin-right: 6px; color: var(--ink); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.examples a b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

#result { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 28px; }
.head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.plate.big { min-width: 230px; padding: 8px 16px 6px; }
.plate.big span:first-child { font: 700 36px/1.1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.12em; color: var(--navy); }
.title { flex: 1; min-width: 220px; }
.sub { margin: 0; color: var(--muted); }
.notices { margin: 6px 0 0; font-size: 14px; }
.notices span { display: inline-block; border: 1px solid; border-radius: 4px; padding: 1px 7px; margin: 2px 6px 2px 0; font-size: 13px; }
.notices .bad { color: #a61e1e; border-color: #e3b4b4; background: #fbf0f0; }
.notices .warn { color: #8a5a00; border-color: #e6cf99; background: #fcf6e8; }
.notices .info { color: #3b5b2d; border-color: #bcd3b1; background: #f0f7ec; }

.rarity { display: flex; gap: 16px; align-items: center; margin: 26px 0 0; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.pill { display: inline-block; color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 14px; padding: 8px 14px; border-radius: 4px; }
.rarity p { margin: 0; flex: 1; min-width: 240px; color: var(--ink); }

table.cmp { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.cmp td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
table.cmp tr:first-child td { border-top: 0; }
table.cmp td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 110px; }
table.cmp td.p { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; width: 80px; font-size: 13px; }
table.cmp td.b { width: 30%; }
.bar { height: 6px; background: var(--bar); border-radius: 3px; min-width: 2px; opacity: 0.85; }
table.cmp tr.hi td { font-weight: 600; }

dl.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.share { margin: 22px 0 0; font-size: 14px; color: var(--muted); }

.about { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 24px; color: var(--muted); font-size: 15px; }
.about h2 { color: var(--ink); font-size: 17px; }
ul.tiers { list-style: none; padding: 0; margin: 12px 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
ul.tiers li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--ink); }
ul.tiers li i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
ul.tiers li small { color: var(--muted); }
footer { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 520px) {
  h1 { font-size: 26px; margin-top: 32px; }
  form { flex-direction: column; }
  .plate-input { width: 100%; }
  button { width: 100%; }
  table.cmp td.b { display: none; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dt { margin-top: 8px; }
}
