:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #161b22;
  --line: #2a3340;
  --text: #e7edf5;
  --muted: #9aa6b2;
  --fact: #3d9cf0;
  --dict: #e0a040;
  --aux: #8b93a0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", Tahoma, sans-serif;
}

body {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100%;
}

#panel {
  padding: 16px 16px 28px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}

h1 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 650;
}

.lead, #stats {
  margin: 0 0 12px;
  color: var(--muted);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 8px 10px 10px;
}

legend {
  padding: 0 4px;
  color: var(--muted);
}

label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 0;
}

label.stack {
  display: block;
}

input[type="search"], select {
  width: 100%;
  margin-top: 4px;
}

input[type="search"], select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.dropdown {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

.dropdown summary {
  cursor: pointer;
  padding: 6px 8px;
}

.dropdown summary::-webkit-details-marker {
  display: none;
}

#domains {
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 4px 8px 8px;
  border-top: 1px solid var(--line);
}

.dropdown[open] #domains {
  display: block;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.stepper button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.stepper #weight-label {
  min-width: 2ch;
  text-align: center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.swatch.fact { background: var(--fact); }
.swatch.dict { background: var(--dict); }
.swatch.aux { background: var(--aux); }

#detail {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

#detail h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

#detail p { margin: 0 0 8px; color: var(--muted); }
#detail .about { color: var(--text); }

#detail ul {
  margin: 0;
  padding-left: 18px;
  max-height: 220px;
  overflow: auto;
}

#graph {
  height: 100vh;
  background: #000000;
}

#missing {
  padding: 24px;
}
