:root {
  --bg: #14171c;
  --panel: #1d222b;
  --panel2: #262d39;
  --line: #333b48;
  --text: #d8dee9;
  --muted: #8a93a3;
  --accent: #f0b429;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  flex: 0 0 auto;
}
header h1 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: .5px;
  color: var(--accent);
}
.controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.controls label { color: var(--muted); font-size: 12px; }
.controls select, .controls input[type=text] {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  margin-left: 4px;
  font-size: 13px;
}
.controls .search input { width: 180px; }
.controls .check { display: flex; align-items: center; gap: 4px; }
.approx { color: #e0a23f; font-size: 12px; }
.approx.hidden { display: none; }
.meta { margin-left: auto; color: var(--muted); font-size: 12px; }
.alt { color: var(--accent); text-decoration: none; font-size: 12px; }
.alt:hover { text-decoration: underline; }
#cy { flex: 1 1 auto; width: 100%; }
footer {
  flex: 0 0 auto;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 5px 14px;
  font-size: 11px;
  color: var(--muted);
}
.legend {
  position: absolute;
  left: 14px;
  bottom: 38px;
  background: rgba(29,34,43,.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  pointer-events: none;
}
.legend .row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.legend .swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid #0006; }
.info {
  position: absolute;
  top: 78px;
  right: 14px;
  width: 280px;
  max-height: calc(100% - 130px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 6px 24px #0008;
}
.info.hidden { display: none; }
.info h2 { margin: 0 6px 8px 0; font-size: 16px; color: var(--accent); }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.info .taglist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.info .tag {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  cursor: pointer;
}
#infoClose {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; line-height: 1;
}
