:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%; width: 100%;
  background: #050308;
  color: #c8d0ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#gr-root {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
}

/* Toolbar ─────────────────────────────────────────────── */
.gr-toolbar {
  display: flex; align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(12, 8, 24, 0.96);
  border-bottom: 1px solid rgba(100, 140, 255, 0.2);
  z-index: 20;
  flex: 0 0 auto;
}
.gr-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffcc66;
  margin-right: 8px;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gr-search-input {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(100, 140, 255, 0.3);
  background: rgba(20, 14, 40, 0.9);
  color: #e0e4ff;
  font-size: 13px;
  outline: none;
}
.gr-search-input:focus {
  border-color: rgba(140, 180, 255, 0.6);
}
.gr-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(100, 140, 255, 0.3);
  background: rgba(20, 14, 40, 0.9);
  color: #c8d0ff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.gr-btn:hover {
  background: rgba(40, 30, 80, 0.95);
  border-color: rgba(140, 180, 255, 0.55);
}
.gr-btn-active {
  background: rgba(100, 80, 200, 0.3);
  border-color: rgba(180, 160, 255, 0.7);
  color: #fff;
}
.gr-status {
  font-size: 11px;
  color: #8a92b8;
  margin-left: 6px;
  white-space: nowrap;
}

/* Canvas ────────────────────────────────────────────── */
.gr-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}
#gr-canvas {
  display: block;
  width: 100%; height: 100%;
}

/* Tooltip ───────────────────────────────────────────── */
.gr-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 6, 20, 0.92);
  border: 1px solid rgba(140, 180, 255, 0.4);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #ffeecc;
  white-space: nowrap;
  z-index: 40;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis;
}

/* Tag panel ─────────────────────────────────────────── */
.gr-tags-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 240px;
  background: rgba(12, 8, 24, 0.97);
  border-left: 1px solid rgba(100, 140, 255, 0.25);
  padding: 12px;
  overflow-y: auto;
  z-index: 30;
  font-size: 12px;
}
.gr-tags-empty { color: #8a92b8; font-style: italic; }
.gr-tag-clear {
  width: 100%;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid rgba(100, 140, 255, 0.3);
  background: transparent;
  color: #c8d0ff;
  cursor: pointer;
  margin-bottom: 10px;
  font-size: 11px;
}
.gr-tag-clear:hover {
  background: rgba(40, 30, 80, 0.9);
}
.gr-tags-list {
  display: flex; flex-direction: column; gap: 2px;
}
.gr-tag-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.gr-tag-row:hover {
  background: rgba(40, 30, 80, 0.5);
}
.gr-tag-row input[type=checkbox] {
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}
.gr-tag-label {
  flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #d4dcff;
}
.gr-tag-count {
  flex: 0 0 auto;
  color: #6a729a;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
