:root {
  --bg: #000000;
  --card: #121418;
  --ink: #eceef2;
  --soft: rgba(236, 238, 242, 0.5);
  --line: rgba(236, 238, 242, 0.1);
  --accent: #5ad4e6;
  --string: #a8e07a;
  --number: #ffb454;
  --boolean: #b79cff;
  --null: rgba(236, 238, 242, 0.45);
  --indent: 18px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 12px;
}

.jv { width: min(348px, 100%); display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 50px -30px rgba(0, 0, 0, 0.9); overflow: hidden; }
.jv__roll { display: block; overflow: hidden; }
.jv__roll > span { display: block; white-space: nowrap; }

.jv__head { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.jv__file { font-size: 13px; font-weight: 700; font-stretch: 104%; }
.jv__meta { font-size: 11.500px; font-weight: 620; color: var(--soft); }

.jv__tree { height: min(264px, calc(100vh - 130px)); padding: 8px 8px; overflow-y: auto; scrollbar-width: none; font-family: var(--mono); font-size: 12.500px; }
.jv__tree::-webkit-scrollbar { display: none; }
.jv__row { position: relative; display: flex; align-items: center; width: 100%; height: 22px; padding: 0 8px 0 calc(6px + var(--d) * var(--indent)); border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; text-align: left; white-space: nowrap; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; transition: background-color 0.15s; }
.jv__row.is-read, .jv__row:focus-visible { background: rgba(236, 238, 242, 0.07); }
.jv__row:focus-visible { box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 70%, transparent); }
.jv__chev { flex: none; width: 14px; height: 14px; margin-right: 3px; }
.jv__chev svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.jv__row.is-read .jv__chev svg { stroke: var(--ink); }
.jv__key { color: var(--ink); transition: color 0.2s; }
.jv__key.is-index { color: var(--soft); }
.jv__row.is-up .jv__key { color: var(--accent); }
.jv__p { color: var(--soft); white-space: pre; }
.jv__val.t-string { color: var(--string); }
.jv__val.t-number { color: var(--number); }
.jv__val.t-boolean { color: var(--boolean); }
.jv__val.t-null { color: var(--null); }
.jv__badge { margin-left: 2px; padding: 0 6px; height: 17px; line-height: 17px; border-radius: 6px; background: rgba(236, 238, 242, 0.07); color: var(--soft); font-size: 11px; }

/* a branch's children: the script tweens the height; the thin guide lights up when a row inside is read */
.jv__kids { position: relative; overflow: hidden; }
.jv__kids::before { content: ""; position: absolute; left: calc(12.500px + (var(--d) - 1) * var(--indent)); top: 2px; bottom: 2px; width: 1px; background: var(--line); transition: background-color 0.2s; }
.jv__kids.is-up::before { background: color-mix(in srgb, var(--accent) 70%, transparent); }

.jv__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 42px; padding: 0 16px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.jv__path { display: flex; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--soft); white-space: nowrap; overflow: hidden; }
.jv__path b { font-weight: 500; color: var(--ink); }
.jv__path span { display: inline-block; }
.jv__copy { flex: none; height: 18px; line-height: 18px; font-size: 11.500px; font-weight: 660; color: var(--soft); text-align: right; }
.jv.is-copied .jv__copy { color: var(--accent); }

.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #000000; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); z-index: 5; }

@media (max-width: 350px) {
  .jv__tree { font-size: 12px; }
  .jv__bar, .jv__head { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .jv__row, .jv__key, .jv__chev svg, .jv__kids::before { transition: none; }
}
