* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #f4f4f1;
  color: #222;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #ddd;
  background: white;
}
header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
#meta { font-size: 0.85rem; color: #666; }
#refresh {
  margin-left: 0.75rem;
  border: 1px solid #999;
  background: white;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}
#refresh:hover { background: #eee; }

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

.dir {
  background: white;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dir h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}
.dir h2 small { font-weight: normal; color: #888; font-size: 0.85rem; }

.big {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}
.num .value {
  font-size: 3.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.num .unit { font-size: 1.2rem; color: #666; margin-left: 0.25rem; }
.cars, .wait { color: #555; }
.cars .value, .wait .value { font-weight: 600; }

table.flows {
  width: 100%;
  font-size: 0.9rem;
  border-collapse: collapse;
}
table.flows th {
  text-align: left;
  font-weight: normal;
  color: #666;
  padding: 0.25rem 0;
  width: 40%;
}
table.flows td { padding: 0.25rem 0; font-variant-numeric: tabular-nums; }
table.flows tr.balance { font-weight: 600; }
table.flows tr.balance td.positive { color: #c0392b; }
table.flows tr.balance td.negative { color: #27ae60; }
table.flows tr.indicator { color: #777; font-size: 0.85em; }
table.flows tr.indicator td { padding-top: 0.5rem; }
table.flows tr.official { color: #555; font-weight: 500; }
table.flows tr.official th { color: #444; }

.meta-row {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
  font-variant-numeric: tabular-nums;
}

canvas.hist {
  display: block;
  width: 100%;
  height: 180px;
  margin: 1rem 0 0;
  background: #fafafa;
  border-radius: 4px;
}

.error {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.error:empty { display: none; }

footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: #666;
}
footer code { background: #efefef; padding: 0.1rem 0.3rem; border-radius: 3px; }
