:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-2: #111113;
  --ink: #f3f3f1;
  --muted: #a7a39d;
  --line: rgba(255, 174, 105, 0.22);
  --line-soft: rgba(255, 174, 105, 0.14);
  --accent: #ff9e3f;
  --accent-bright: #ffd2a3;
  --warn: #c98d5e;
  --display-font: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono-font: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--display-font);
  background: radial-gradient(1200px 920px at 88% -8%, rgba(255, 122, 30, 0.13) 0%, transparent 64%),
    radial-gradient(900px 700px at 8% 24%, rgba(255, 163, 90, 0.08) 0%, transparent 66%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(900px 540px at 18% 0%, rgba(255, 130, 31, 0.07) 0%, transparent 70%),
    radial-gradient(700px 560px at 82% 84%, rgba(255, 160, 86, 0.04) 0%, transparent 72%);
}

body.inspector-open {
  overflow: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(78px);
  pointer-events: none;
  opacity: 0.13;
  animation: orb-drift 15s ease-in-out infinite alternate;
}

.bg-orb-a {
  width: 360px;
  height: 360px;
  top: -150px;
  left: 6vw;
  background: radial-gradient(circle at 30% 30%, rgba(255, 184, 130, 0.4), rgba(255, 130, 34, 0.08));
}

.bg-orb-b {
  width: 430px;
  height: 430px;
  right: 4vw;
  bottom: -210px;
  background: radial-gradient(circle at 34% 34%, rgba(255, 193, 142, 0.34), rgba(255, 116, 0, 0.08));
  animation-duration: 19s;
}

.workspace {
  position: relative;
  z-index: 2;
  height: 100vh;
  width: 100%;
}

.chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  min-height: 64px;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0.9), rgba(10, 10, 11, 0.5));
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(7px);
}

.brand {
  font-family: var(--mono-font);
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.67rem;
}

.title {
  margin-top: 0.25rem;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip-button,
.chip-link {
  font-family: var(--mono-font);
  text-decoration: none;
  color: #f0eeea;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.64rem;
  background: linear-gradient(120deg, rgba(255, 142, 41, 0.08), rgba(20, 20, 21, 0.56));
  cursor: pointer;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.chip-link {
  display: inline-flex;
  align-items: center;
}

.chip-button:hover,
.chip-link:hover,
.chip-button:focus-visible,
.chip-link:focus-visible {
  border-color: var(--accent-bright);
  box-shadow: 0 0 14px rgba(255, 146, 52, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.chip-subtle {
  border-color: rgba(255, 174, 105, 0.16);
  background: rgba(17, 17, 18, 0.5);
}

.graph-stage {
  position: relative;
  height: 100%;
}

#graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#graph-canvas.dragging {
  cursor: grabbing;
}

.overlay-top {
  position: absolute;
  top: 4.6rem;
  left: 1.2rem;
  right: 1.2rem;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  pointer-events: none;
}

.status-text {
  font-family: var(--mono-font);
  color: #cdb39a;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.9rem;
}

.stat-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: #f0efec;
}

.stat-value {
  font-size: 1rem;
  line-height: 1;
}

.stat-label {
  font-family: var(--mono-font);
  font-size: 0.56rem;
  color: #9e8a75;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.inspector {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  width: min(370px, 88vw);
  padding: 5.2rem 1rem 1rem;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(12, 12, 13, 0.95), rgba(16, 16, 17, 0.88));
  border-left: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

body.inspector-open .inspector {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.35);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.inspector-section {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
}

.panel-title {
  font-family: var(--mono-font);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.source-chip-grid {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.source-chip {
  border: 1px solid rgba(255, 180, 109, 0.2);
  border-radius: 999px;
  padding: 0.38rem 0.56rem;
  font-family: var(--mono-font);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d6c3ad;
  background: rgba(255, 150, 54, 0.05);
}

.node-details {
  margin-top: 0.6rem;
  line-height: 1.45;
  color: #ded8d0;
  display: grid;
  gap: 0.45rem;
}

.node-details.empty {
  color: #9b8571;
}

.node-name {
  font-size: 1rem;
  line-height: 1.2;
}

.node-meta {
  font-family: var(--mono-font);
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #b19172;
}

.data-list {
  display: grid;
  gap: 0.34rem;
  margin-top: 0.15rem;
}

.data-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 0.4rem;
  align-items: baseline;
}

.data-key {
  font-family: var(--mono-font);
  color: #987b61;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.data-value {
  color: #ded8d0;
  font-size: 0.79rem;
  word-break: break-word;
}

.tips {
  list-style: none;
  margin-top: 0.55rem;
  display: grid;
  gap: 0.32rem;
  color: #be9d82;
  font-size: 0.82rem;
}

.tips li {
  position: relative;
  padding-left: 0.86rem;
}

.tips li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.44rem;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 8px rgba(255, 168, 91, 0.5);
}

@keyframes orb-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(0, 30px, 0) scale(1.06);
  }
}

@media (max-width: 980px) {
  .chrome {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 0.8rem;
  }

  .overlay-top {
    top: 6.2rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-row {
    justify-content: flex-start;
    gap: 0.65rem;
  }
}

@media (max-width: 720px) {
  .chrome {
    padding-inline: 0.8rem;
  }

  .title {
    font-size: 1rem;
  }

  .overlay-top {
    left: 0.8rem;
    right: 0.8rem;
  }

  .inspector {
    width: 100%;
    max-width: 100%;
  }

  .data-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}
