* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: #1a1a1a;
  background: #0a0a0a;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 16px;
  background: #0a0a0a;
  color: #f0f0f0;
  border-bottom: 1px solid #1f1f1f;
}

header h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.meta {
  font-size: 12px;
  color: #888;
  flex: 1;
}

.layout-controls { display: flex; gap: 8px; }

.layout-controls button {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  cursor: pointer;
}
.layout-controls button:hover { background: #252525; }

#main {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  height: calc(100vh - 48px);
}

#sidebar, #details {
  background: #141414;
  color: #ccc;
  overflow-y: auto;
  border-right: 1px solid #1f1f1f;
  padding: 12px;
}

#details {
  border-right: none;
  border-left: 1px solid #1f1f1f;
}

.filter-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1f1f1f;
}
.filter-section:last-child { border-bottom: none; }

.filter-section h3 {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-section h3 .subtitle {
  font-size: 10px;
  font-weight: 400;
  color: #666;
  text-transform: none;
  letter-spacing: 0;
}

.all-none {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

button.mini {
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  background: #1f1f1f;
  color: #aaa;
  border: 1px solid #2f2f2f;
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
button.mini:hover { background: #2a2a2a; color: #ddd; }

.hint {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

input[type="search"], input[type="number"] {
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #2a2a2a;
  background: #0a0a0a;
  color: #ddd;
  border-radius: 3px;
  width: 100%;
}

.year-controls { display: flex; align-items: center; gap: 6px; color: #888; }
.year-controls input { width: 80px; }

.col-header {
  display: flex;
  font-size: 9px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 4px 4px 4px;
  border-bottom: 1px dashed #1f1f1f;
  margin-bottom: 4px;
}
.col-header .col-vis { width: 16px; text-align: center; }
.col-header .col-label { margin-left: auto; width: 32px; text-align: center; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  color: #ccc;
}
.checkbox-row:hover { background: #1c1c1c; }
.checkbox-row input { margin: 0; }

.checkbox-row.node-type-row {
  /* Two columns: visibility + label */
  display: grid;
  grid-template-columns: 16px 12px 1fr auto 32px;
  gap: 6px;
}
.checkbox-row.node-type-row .lbl-cb {
  justify-self: end;
}

.color-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.1);
}

.count {
  font-size: 10px;
  color: #666;
}

.scroll-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

#graph {
  background: #0a0a0a;
  height: 100%;
  min-height: 400px;
  position: relative;
}

#graph canvas { display: block; }

#details-empty {
  color: #666;
  padding: 24px 12px;
  text-align: center;
  font-style: italic;
}

#details h2 {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.35;
  color: #f0f0f0;
  font-weight: 600;
}

.detail-type-pill {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

#details dl {
  margin: 0 0 12px 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4px 8px;
  font-size: 11px;
}

#details dt {
  color: #666;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.03em;
}

#details dd { margin: 0; color: #ccc; }

#details .section-label {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: #1f1f1f;
  border-radius: 3px;
  margin: 2px 2px 2px 0;
  color: #aaa;
}

.stance-row {
  font-size: 11px;
  padding: 4px 6px;
  background: #1c1c1c;
  border-radius: 3px;
  margin-bottom: 4px;
  color: #ccc;
}

.stance-position { font-weight: 600; color: #f0f0f0; }

.edge-list-item {
  font-size: 11px;
  padding: 4px 6px;
  border-left: 2px solid #2a2a2a;
  margin-bottom: 2px;
  cursor: pointer;
  color: #ccc;
}

.edge-list-item:hover {
  background: #1c1c1c;
  border-left-color: #555;
}

.edge-list-item .edge-type {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  margin-right: 4px;
  letter-spacing: 0.03em;
}

#details a {
  color: #6db5ff;
  text-decoration: none;
  word-break: break-word;
}
#details a:hover { text-decoration: underline; color: #93caff; }

.link-list a {
  display: block;
  font-size: 11px;
  padding: 4px 6px;
  margin-bottom: 2px;
  background: #1c1c1c;
  border-radius: 3px;
}

.link-list a:hover { background: #252525; }

.link-list .link-icon {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  margin-right: 6px;
}

.path-line {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  color: #555;
  word-break: break-all;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #1f1f1f;
}
