*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
#ssgraph-root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #12141d; color: #f8f9fa; height: var(--ssgraph-height, 100vh);
  display: flex; flex-direction: column; overflow: hidden; }
#ssgraph-root #top { --brand-w: 160px; padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
#ssgraph-root #top-row1 { display: flex; align-items: center; gap: 10px; }
#ssgraph-root #top-row2 { display: flex; align-items: center; gap: 8px; padding-left: calc(var(--brand-w) + 10px); }
#ssgraph-root #logo { display: flex; align-items: center; flex-shrink: 0; width: var(--brand-w); text-decoration: none; }
#ssgraph-root .logo-wordmark { height: 40px !important; width: auto !important; display: block; }
#ssgraph-root .logo-mark     { height: 40px !important; width: auto !important; display: none; }
#ssgraph-root #search { display: flex; gap: 8px; flex: 1; }
#ssgraph-root #filter-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 5px 9px; font-size: 16px; line-height: 1; color: #b0b0b0; cursor: pointer; white-space: nowrap; }
#ssgraph-root #handle-input { flex: 1; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  padding: 8px 14px; font-size: 14px; color: #f8f9fa; outline: none; }
#ssgraph-root #handle-input:focus { border-color: #ff8c42; }
#ssgraph-root #search-btn { background: #ff8c42; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; color: #12141d; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.15s; }
#ssgraph-root #search-btn:hover { background: #e67e3b; }
#ssgraph-root #mode-toggle { display: flex; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
#ssgraph-root .mode-btn { background: #1a1a2e; border: none; padding: 8px 14px; font-size: 13px;
  color: #b0b0b0; cursor: pointer; transition: background 0.15s, color 0.15s; }
#ssgraph-root .mode-btn:hover { background: #222238; color: #f8f9fa; }
#ssgraph-root .mode-btn.active { background: #222238; color: #ff8c42; }
#ssgraph-root #share-btn { background: none; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; color: #b0b0b0; cursor: pointer; transition: border-color 0.15s, color 0.15s; white-space: nowrap; }
#ssgraph-root #share-btn:hover { border-color: rgba(255,255,255,0.3); color: #f8f9fa; }
#ssgraph-root #status { font-size: 12px; color: #b0b0b0; margin-left: 4px; }
#ssgraph-root #node-count { font-size: 12px; color: #b0b0b0; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px; padding: 4px 6px; width: 52px; text-align: center; -moz-appearance: textfield; color-scheme: dark; }
#ssgraph-root #node-count::-webkit-inner-spin-button, #ssgraph-root #node-count::-webkit-outer-spin-button { opacity: 0.3; }
#ssgraph-root #graph-wrap { flex: 1; position: relative; overflow: hidden; }
#ssgraph-root #graph { width: 100%; height: 100%; }
#ssgraph-root #cat-filters { display: flex; gap: 6px; flex-shrink: 0; }
#ssgraph-root .cat-btn { display: flex; align-items: center; gap: 5px; background: #1a1a2e; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; color: #b0b0b0; cursor: pointer;
  transition: border-color 0.15s, color 0.15s; white-space: nowrap; }
#ssgraph-root .cat-btn .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; opacity: 0.35; transition: opacity 0.15s; }
#ssgraph-root .cat-btn.active { color: #f8f9fa; border-color: rgba(255,255,255,0.35); }
#ssgraph-root .cat-btn.active .dot { opacity: 1; }
#ssgraph-root #legend { position: absolute; bottom: 16px; left: 16px; display: flex; flex-wrap: wrap;
  gap: 6px 12px; max-width: 420px; pointer-events: none; }
#ssgraph-root .legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #b0b0b0; }
#ssgraph-root .legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
#ssgraph-root #tooltip { position: absolute; background: rgba(26,26,46,0.97); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.6;
  pointer-events: none; display: none; max-width: 220px; }
#ssgraph-root #tooltip b { color: #f8f9fa; }
#ssgraph-root #tooltip .cat { color: #b0b0b0; font-size: 11px; }
#ssgraph-root #api-flash { position: absolute; bottom: 20px; right: 20px; font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px; color: #ff8c42; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
#ssgraph-root #site-mark { position: absolute; bottom: 20px; right: 20px; font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px; color: #5E377B; opacity: 1; pointer-events: none; transition: opacity 0.4s ease; }
#ssgraph-root #zoom-controls { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
#ssgraph-root .zoom-btn { background: rgba(26,26,46,0.85); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; color: #b0b0b0; font-size: 18px; line-height: 1;
  width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: color 0.15s, border-color 0.15s; }
#ssgraph-root .zoom-btn:hover { color: #f8f9fa; border-color: rgba(255,255,255,0.35); }
@media (max-width: 640px) {
  #ssgraph-root #top { --brand-w: 32px; padding: 10px 12px 6px; gap: 6px; }
  #ssgraph-root #top-row2 { padding-left: 0; }
  #ssgraph-root .logo-wordmark { display: none; }
  #ssgraph-root .logo-mark     { display: block; margin-left: 8px; padding-top: 2px; }
  #ssgraph-root #top-row1 { flex-wrap: wrap; gap: 6px; }
  #ssgraph-root #search { order: 10; flex-basis: 100%; }
  #ssgraph-root #handle-input { font-size: 16px; }
  #ssgraph-root .mode-btn { padding: 7px 10px; font-size: 12px; }
  #ssgraph-root .cat-btn { padding: 4px 7px; font-size: 11px; }
  #ssgraph-root .cat-btn .dot { width: 7px; height: 7px; }
  #ssgraph-root #node-count { width: 44px; }
  #ssgraph-root #share-btn { padding: 5px 10px; }
  #ssgraph-root #status { display: none; }
  #ssgraph-root #legend { display: none; }
  #ssgraph-root #api-flash { font-size: 11px; bottom: 12px; right: 12px; }
  #ssgraph-root #site-mark { font-size: 11px; bottom: 12px; right: 12px; }
  #ssgraph-root #top-row2 { display: none; flex-wrap: wrap; }
  #ssgraph-root #top-row2.open { display: flex; }
  #ssgraph-root #filter-toggle { display: flex; }
}
