/* JSON Studio (tools/json-studio.html). Only this page links this file (own ?v=, bump it in the page).
   The studio has its own scoped palette (like a game palette): dark first, a tuned light theme, or "match site".
   Every colour is a --sx-* custom property defined in the two theme blocks below. Notes: scripts/notes/json-studio.md */

.jst-app {
  --sx-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sx-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sx-radius: 18px;
  --sx-r: 10px;
  --sx-ease: cubic-bezier(.2, .8, .2, 1);
  --fs: 14px;
  --lh: 23px;
  --tab: 2;
  font-family: var(--sx-font);
  color: var(--sx-text);
  margin-top: 18px;
}
.jst-app[data-jst-theme="dark"] {
  --sx-page: #070a12;
  --sx-bg: #0b0f1a;
  --sx-panel: #0e1320;
  --sx-panel-2: #121828;
  --sx-raised: #182033;
  --sx-hover: #1b2438;
  --sx-editor: #0b101b;
  --sx-border: #222b40;
  --sx-border-soft: #1a2133;
  --sx-border-strong: #313c58;
  --sx-text: #e7eaf3;
  --sx-text-2: #c3cad9;
  --sx-muted: #97a2b9;
  --sx-gutter: #6f7b95;
  --sx-gutter-active: #c3cad9;
  --sx-accent: #8f8cff;
  --sx-accent-2: #c084fc;
  --sx-accent-3: #38bdf8;
  --sx-accent-soft: rgba(143, 140, 255, .14);
  --sx-on-accent: #0b0c1d;
  --sx-ok: #4ade80;
  --sx-ok-soft: rgba(74, 222, 128, .12);
  --sx-err: #ff7b85;
  --sx-err-soft: rgba(255, 123, 133, .13);
  --sx-warn: #f5b84a;
  --sx-warn-soft: rgba(245, 184, 74, .13);
  --sx-add: #4ade80;
  --sx-add-bg: rgba(74, 222, 128, .10);
  --sx-del: #ff7b85;
  --sx-del-bg: rgba(255, 123, 133, .10);
  --sx-mod: #f5b84a;
  --sx-mod-bg: rgba(245, 184, 74, .10);
  --sx-caret: #b9b7ff;
  --sx-selection: rgba(143, 140, 255, .32);
  --sx-curline: rgba(255, 255, 255, .035);
  --sx-find: rgba(245, 184, 74, .30);
  --sx-find-cur: rgba(245, 184, 74, .62);
  --sx-k: #8ab4ff;
  --sx-s: #7ee2a8;
  --sx-n: #ffb86b;
  --sx-b: #d6a2ff;
  --sx-z: #ff8fa3;
  --sx-p: #8d98b0;
  --sx-x: #ff7b85;
  --sx-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  --sx-pop-shadow: 0 18px 50px -12px rgba(0, 0, 0, .65), 0 2px 8px rgba(0, 0, 0, .3);
  --sx-glow-1: rgba(143, 140, 255, .28);
  --sx-glow-2: rgba(192, 132, 252, .18);
  --sx-glow-3: rgba(56, 189, 248, .16);
  --sx-grid: rgba(255, 255, 255, .045);
  color-scheme: dark;
}
.jst-app[data-jst-theme="light"] {
  --sx-page: #eef1f8;
  --sx-bg: #f7f8fc;
  --sx-panel: #ffffff;
  --sx-panel-2: #f4f6fb;
  --sx-raised: #ffffff;
  --sx-hover: #eceff7;
  --sx-editor: #ffffff;
  --sx-border: #dfe3ee;
  --sx-border-soft: #eaedf5;
  --sx-border-strong: #c9cfde;
  --sx-text: #10162a;
  --sx-text-2: #2c3550;
  --sx-muted: #556079;
  --sx-gutter: #6f7a92;
  --sx-gutter-active: #10162a;
  --sx-accent: #4b45e0;
  --sx-accent-2: #8a3ffc;
  --sx-accent-3: #0e8fb3;
  --sx-accent-soft: #eceeff;
  --sx-on-accent: #ffffff;
  --sx-ok: #11743f;
  --sx-ok-soft: #e3f5ea;
  --sx-err: #c22f3a;
  --sx-err-soft: #fdebec;
  --sx-warn: #8a5600;
  --sx-warn-soft: #fdf3dc;
  --sx-add: #11743f;
  --sx-add-bg: #e6f6ec;
  --sx-del: #c22f3a;
  --sx-del-bg: #fdecee;
  --sx-mod: #8a5600;
  --sx-mod-bg: #fdf4e0;
  --sx-caret: #4b45e0;
  --sx-selection: rgba(75, 69, 224, .2);
  --sx-curline: rgba(16, 22, 42, .035);
  --sx-find: #ffe58a;
  --sx-find-cur: #ffc53d;
  --sx-k: #1f57c4;
  --sx-s: #0f7a3f;
  --sx-n: #a84a00;
  --sx-b: #7c3aed;
  --sx-z: #c2306f;
  --sx-p: #5d6781;
  --sx-x: #c22f3a;
  --sx-shadow: 0 30px 70px -32px rgba(15, 20, 36, .32), 0 2px 6px -2px rgba(15, 20, 36, .06);
  --sx-pop-shadow: 0 18px 44px -12px rgba(15, 20, 36, .28), 0 2px 6px rgba(15, 20, 36, .08);
  --sx-glow-1: rgba(99, 91, 255, .16);
  --sx-glow-2: rgba(168, 85, 247, .1);
  --sx-glow-3: rgba(14, 165, 233, .1);
  --sx-grid: rgba(16, 22, 42, .05);
  color-scheme: light;
}
.jst-app :focus-visible { outline: 2px solid var(--sx-accent); outline-offset: 2px; box-shadow: none; }
.jst-app button { font-family: inherit; }
.jst-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.jst-app .tool-head {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 6px; padding: 26px 32px 24px;
  border-radius: 24px; border: 1px solid var(--sx-border);
  background:
    radial-gradient(700px 300px at 85% -10%, var(--sx-glow-1), transparent 60%),
    radial-gradient(520px 260px at 10% 120%, var(--sx-glow-3), transparent 60%),
    radial-gradient(400px 220px at 55% 50%, var(--sx-glow-2), transparent 70%),
    var(--sx-bg);
  color: var(--sx-text);
  box-shadow: var(--sx-shadow);
}
.jst-app .tool-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--sx-grid) 1px, transparent 1px), linear-gradient(90deg, var(--sx-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
}
.jst-app .breadcrumb, .jst-app .breadcrumb a { color: var(--sx-muted); }
.jst-app .breadcrumb a:hover { color: var(--sx-accent); }
.jst-app ol.breadcrumb [aria-current] { color: var(--sx-text-2); }
.jst-app .tool-head .fs-btn { background: var(--sx-panel-2); border-color: var(--sx-border); color: var(--sx-text-2); box-shadow: none; }
.jst-app .tool-head .fs-btn:hover { background: var(--sx-hover); color: var(--sx-text); }
.jst-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.jst-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 12px 5px 8px; border-radius: 99px; border: 1px solid var(--sx-border); background: var(--sx-panel-2); color: var(--sx-text-2) !important; font-size: .78rem !important; font-weight: 600; letter-spacing: .02em; }
.jst-eyebrow b { display: inline-grid; place-items: center; height: 20px; padding: 0 7px; border-radius: 99px; background: linear-gradient(120deg, var(--sx-accent), var(--sx-accent-2)); color: var(--sx-on-accent); font-size: .7rem; font-weight: 750; letter-spacing: .04em; }
.jst-app .tool-head h1 { margin: 0 0 12px; font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; color: var(--sx-text); }
.jst-brand { background: linear-gradient(100deg, var(--sx-text) 10%, var(--sx-accent) 55%, var(--sx-accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jst-h1-sub { display: block; margin-top: 10px; font-size: clamp(1rem, 1.6vw, 1.18rem); font-weight: 600; letter-spacing: -.01em; color: var(--sx-text-2); line-height: 1.35; }
.jst-app .tool-head p.jst-lede { color: var(--sx-muted); font-size: 1rem; line-height: 1.65; max-width: 600px; margin: 0 0 18px; }
.jst-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.jst-app .tool-facts li { border-color: var(--sx-border); background: var(--sx-panel-2); color: var(--sx-text-2); font-weight: 600; }
.jst-app .tool-facts .i { color: var(--sx-ok); }
.jst-art { position: relative; min-width: 0; }
.jst-art-win { border-radius: 16px; border: 1px solid var(--sx-border-strong); background: var(--sx-editor); box-shadow: var(--sx-pop-shadow); overflow: hidden; transform: perspective(1200px) rotateY(-6deg) rotateX(3deg); transition: transform .6s var(--sx-ease); }
.jst-art:hover .jst-art-win { transform: perspective(1200px) rotateY(-2deg) rotateX(1deg); }
.jst-art-bar { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--sx-border-soft); background: var(--sx-panel-2); font: 600 12px var(--sx-mono); color: var(--sx-muted); }
.jst-art-bar .jst-pill { margin-left: auto; }
.jst-art pre { margin: 0; padding: 14px 16px; font: 12.5px/1.75 var(--sx-mono); color: var(--sx-text); background: none; border: 0; overflow: hidden; white-space: pre; }
.jst-art-chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 12px; border: 1px solid var(--sx-border-strong); background: var(--sx-raised); color: var(--sx-text); font-size: 12px; font-weight: 650; box-shadow: var(--sx-pop-shadow); animation: jst-float 6s ease-in-out infinite; }
.jst-art-chip.c1 { left: -22px; bottom: -18px; }
.jst-art-chip.c2 { right: 18px; top: -16px; animation-delay: -3s; }
.jst-art-chip .add { color: var(--sx-add); } .jst-art-chip .del { color: var(--sx-del); } .jst-art-chip .mod { color: var(--sx-mod); }
@keyframes jst-float { 50% { transform: translateY(-6px); } }

/* ---------- Pills, studio buttons ---------- */
.jst-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font: 650 11.5px var(--sx-font); letter-spacing: .01em; white-space: nowrap; background: var(--sx-accent-soft); color: var(--sx-accent); }
.jst-pill.ok { background: var(--sx-ok-soft); color: var(--sx-ok); }
.jst-pill.err { background: var(--sx-err-soft); color: var(--sx-err); }
.jst-pill.warn { background: var(--sx-warn-soft); color: var(--sx-warn); }
.jst-pill.muted { background: var(--sx-panel-2); color: var(--sx-muted); border: 1px solid var(--sx-border); }
.jst-pill .jst-ico { width: 12px; height: 12px; }
.jb {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 11px; min-width: 0;
  border-radius: var(--sx-r); border: 1px solid transparent; background: transparent; color: var(--sx-text-2);
  font: 600 13px/1 var(--sx-font); white-space: nowrap; cursor: pointer; user-select: none;
  transition: background .15s, color .15s, border-color .15s, transform .08s, box-shadow .2s;
}
.jb:hover { background: var(--sx-hover); color: var(--sx-text); }
.jb:active { transform: translateY(1px); }
.jb[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.jb[disabled]:hover { background: transparent; color: var(--sx-text-2); }
.jb.icon { width: 32px; padding: 0; }
.jb.outline { border-color: var(--sx-border); background: var(--sx-panel); }
.jb.outline:hover { border-color: var(--sx-border-strong); }
.jb.primary { background: linear-gradient(135deg, var(--sx-accent), color-mix(in srgb, var(--sx-accent) 70%, var(--sx-accent-2))); color: var(--sx-on-accent); box-shadow: 0 6px 18px -8px var(--sx-accent); }
.jb.primary:hover { filter: brightness(1.07); color: var(--sx-on-accent); box-shadow: 0 8px 24px -8px var(--sx-accent); }
.jb.danger { color: var(--sx-err); }
.jb.danger:hover { background: var(--sx-err-soft); color: var(--sx-err); }
.jb.lg { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.jb.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; }
.jb.sm.icon { width: 28px; padding: 0; }
.jb[aria-pressed="true"] { background: var(--sx-accent-soft); color: var(--sx-accent); }
.jb kbd { font: 600 10.5px var(--sx-mono); padding: 2px 5px; border-radius: 5px; background: color-mix(in srgb, currentColor 14%, transparent); border: 0; color: inherit; }

/* ---------- Studio window ---------- */
.jst-studio { position: relative; margin-top: 16px; border-radius: var(--sx-radius); border: 1px solid var(--sx-border); background: var(--sx-bg); box-shadow: var(--sx-shadow); overflow: hidden; }
.jst-studio.max { position: fixed; inset: 0; z-index: 900; margin: 0; border-radius: 0; border: 0; display: flex; flex-direction: column; }
html.jst-max-open { overflow: hidden; }
.jst-topbar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--sx-border); background: linear-gradient(180deg, var(--sx-panel-2), var(--sx-panel)); }
.jst-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.jst-tabs::-webkit-scrollbar { display: none; }
.jst-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--sx-muted); font: 650 13.5px var(--sx-font); cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.jst-tab:hover { color: var(--sx-text); background: var(--sx-hover); }
.jst-tab[aria-selected="true"] { color: var(--sx-text); background: var(--sx-raised); border-color: var(--sx-border); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 4px 14px -8px rgba(0, 0, 0, .5); }
.jst-tab[aria-selected="true"] .jst-ico { color: var(--sx-accent); }
.jst-tab-n { font: 650 10.5px var(--sx-mono); color: var(--sx-gutter); }
.jst-topbar-r { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.jst-local { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin-right: 4px; border-radius: 99px; background: var(--sx-ok-soft); color: var(--sx-ok); font-size: 12px; font-weight: 650; }
.jst-local .jst-ico { width: 14px; height: 14px; }

.jst-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel); }
.jst-tb-main { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.jst-tsep { width: 1px; height: 20px; margin: 0 5px; background: var(--sx-border); flex: none; }
.jst-toolbar-r { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jst-app .jst-select { height: 32px; padding: 0 30px 0 10px; border-radius: var(--sx-r); border: 1px solid var(--sx-border); background-color: var(--sx-panel-2); color: var(--sx-text); font: 600 13px var(--sx-font); width: auto; cursor: pointer;
  appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sx-muted) 50%), linear-gradient(135deg, var(--sx-muted) 50%, transparent 50%); background-position: right 14px top 14px, right 9px top 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.jst-app .jst-select:hover { border-color: var(--sx-border-strong); }
.jst-app .jst-input { height: 32px; margin: 0; box-shadow: none; -webkit-appearance: none; appearance: none; padding: 0 10px; border-radius: var(--sx-r); border: 1px solid var(--sx-border); background: var(--sx-editor); color: var(--sx-text); font: 500 13px var(--sx-mono); min-width: 0; width: 100%; }
.jst-app .jst-input:focus { outline: none; border-color: var(--sx-accent); box-shadow: 0 0 0 3px var(--sx-accent-soft); }
.jst-app .jst-input::placeholder { color: var(--sx-gutter); }
.jst-switch { display: inline-flex; align-items: center; gap: 8px; color: var(--sx-text-2); font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.jst-switch input { appearance: none; -webkit-appearance: none; position: relative; width: 32px; height: 18px; margin: 0; border-radius: 99px; background: var(--sx-border-strong); cursor: pointer; transition: background .2s; flex: none; }
.jst-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s var(--sx-ease); }
.jst-switch input:checked { background: var(--sx-accent); }
.jst-switch input:checked::after { transform: translateX(14px); }
.jst-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--sx-panel-2); border: 1px solid var(--sx-border); min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.jst-seg::-webkit-scrollbar { display: none; }
.jst-seg button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--sx-muted); font: 650 12.5px var(--sx-font); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.jst-seg button:hover { color: var(--sx-text); }
.jst-seg button[aria-pressed="true"], .jst-seg button[aria-selected="true"] { background: var(--sx-raised); color: var(--sx-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.jst-seg .jst-ico { width: 14px; height: 14px; }

/* ---------- Split panes ---------- */
.jst-split { display: flex; height: var(--jst-h, 600px); min-height: 280px; }
.jst-studio.max .jst-mode[data-mode="editor"] { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.jst-studio.max .jst-mode[data-mode="editor"] .jst-split { flex: 1; height: auto; }
.jst-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--sx-editor); }
.jst-pane.left { flex: 0 0 calc(var(--split, 50) * 1% - 4px); }
.jst-pane.right { flex: 1 1 0; }
.jst-resizer { flex: 0 0 8px; position: relative; cursor: col-resize; background: var(--sx-panel); border-left: 1px solid var(--sx-border); border-right: 1px solid var(--sx-border); touch-action: none; }
.jst-resizer::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 28px; transform: translate(-50%, -50%); border-radius: 2px; background: var(--sx-border-strong); transition: background .15s, height .2s; }
.jst-resizer:hover::after, .jst-resizer.drag::after, .jst-resizer:focus-visible::after { background: var(--sx-accent); height: 56px; }
.jst-resizer:focus-visible { outline: none; }
.jst-phead { display: flex; align-items: center; gap: 8px; height: 46px; flex: none; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--sx-border-soft); background: var(--sx-panel); }
.jst-phead h2, .jst-phead h3 { margin: 0; font: 700 12px var(--sx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); white-space: nowrap; }
.jst-phead .jst-file { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.jst-phead-r { margin-left: auto; display: flex; align-items: center; gap: 2px; min-width: 0; }
.jst-pbody { position: relative; flex: 1; min-height: 0; }
.jst-height-grip { height: 12px; cursor: row-resize; background: var(--sx-panel); border-top: 1px solid var(--sx-border); position: relative; touch-action: none; }
.jst-height-grip::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 3px; transform: translate(-50%, -50%); border-radius: 3px; background: var(--sx-border-strong); }
.jst-height-grip:hover::after, .jst-height-grip:focus-visible::after { background: var(--sx-accent); }
.jst-height-grip:focus-visible { outline: none; }
.jst-studio.max .jst-height-grip { display: none; }

/* ---------- Code editor (textarea over a highlighted <pre>) ---------- */
.jst-ed { position: absolute; inset: 0; display: flex; font: 400 var(--fs)/var(--lh) var(--sx-mono); font-variant-ligatures: none; background: var(--sx-editor); }
.jst-gutter { position: relative; flex: none; min-width: 48px; overflow: hidden; border-right: 1px solid var(--sx-border-soft); color: var(--sx-gutter); text-align: right; user-select: none; background: var(--sx-editor); }
.jst-gutter-in { padding: 12px 12px 12px 10px; white-space: pre; will-change: transform; font-size: calc(var(--fs) - 1.5px); line-height: var(--lh); }
.jst-gmark { position: absolute; left: 0; right: 0; height: var(--lh); pointer-events: none; }
.jst-gmark.err { background: var(--sx-err-soft); box-shadow: inset 3px 0 0 var(--sx-err); }
.jst-gmark.cur { background: var(--sx-curline); }
.jst-ed-body { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.jst-ed-body textarea {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 12px 18px 12px 14px; border: 0; border-radius: 0; resize: none; outline: none; box-shadow: none;
  background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--sx-caret);
  font: inherit; line-height: inherit; letter-spacing: 0; white-space: pre; overflow: auto; overflow-wrap: normal; tab-size: var(--tab); -moz-tab-size: var(--tab); z-index: 2;
}
.jst-ed-body textarea:focus { outline: none; box-shadow: none; border: 0; }
.jst-ed-body textarea::selection { background: var(--sx-selection); }
.jst-ed-body textarea::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
.jst-ed.plain textarea { color: var(--sx-text); -webkit-text-fill-color: var(--sx-text); }
.jst-ed.plain .jst-hl { display: none; }
.jst-hl { position: absolute; top: 0; left: 0; margin: 0; padding: 12px 18px 12px 14px; min-width: 100%; border: 0; border-radius: 0; background: none; color: var(--sx-text); font: inherit; line-height: inherit; white-space: pre; tab-size: var(--tab); -moz-tab-size: var(--tab); pointer-events: none; will-change: transform; z-index: 1; overflow: visible; }
.jst-line { position: absolute; left: 0; right: 0; height: var(--lh); pointer-events: none; z-index: 0; }
.jst-line.cur { background: var(--sx-curline); }
.jst-line.err { background: var(--sx-err-soft); }
.jst-ed:not(.focused) .jst-line.cur, .jst-ed:not(.focused) .jst-gmark.cur { display: none; }
.jst-ed.readonly textarea { caret-color: transparent; }
.jst-hl .k, .jst-code .k { color: var(--sx-k); }
.jst-hl .s, .jst-code .s { color: var(--sx-s); }
.jst-hl .n, .jst-code .n { color: var(--sx-n); }
.jst-hl .b, .jst-code .b { color: var(--sx-b); }
.jst-hl .z, .jst-code .z { color: var(--sx-z); font-style: italic; }
.jst-hl .p, .jst-code .p { color: var(--sx-p); }
.jst-hl .x, .jst-code .x { color: var(--sx-x); }
.jst-hl mark { color: inherit; border-radius: 3px; padding: 0; }
.jst-hl mark.f { background: var(--sx-find); }
.jst-hl mark.fc { background: var(--sx-find-cur); box-shadow: 0 0 0 1px var(--sx-warn); }
.jst-hl mark.err { background: var(--sx-err-soft); text-decoration: underline wavy var(--sx-err); text-decoration-skip-ink: none; text-underline-offset: 3px; }
.jst-hl mark.err-eof { background: none; }
.jst-hl mark.err-eof::after { content: "⏎"; color: var(--sx-err); padding-left: 2px; }

/* Empty / welcome states */
.jst-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; pointer-events: none; text-align: center; }
.jst-empty-card { max-width: 420px; pointer-events: auto; animation: jst-in .4s var(--sx-ease) both; }
.jst-empty-ico { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--sx-accent-soft), transparent); border: 1px solid var(--sx-border); color: var(--sx-accent); font: 700 20px var(--sx-mono); }
.jst-empty h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 700; color: var(--sx-text); letter-spacing: -.01em; }
.jst-empty p { margin: 0 auto 16px; color: var(--sx-muted); font-size: .9rem; line-height: 1.55; max-width: 340px; }
.jst-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.jst-empty-samples { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.jst-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--sx-border); background: var(--sx-panel); color: var(--sx-text-2); font: 600 12.5px var(--sx-font); cursor: pointer; transition: border-color .15s, color .15s, background .15s, transform .15s; }
.jst-chip:hover { border-color: var(--sx-accent); color: var(--sx-text); transform: translateY(-1px); }
.jst-chip[aria-pressed="true"] { border-color: var(--sx-accent); background: var(--sx-accent-soft); color: var(--sx-accent); }
.jst-chip code { font: 600 12px var(--sx-mono); background: none; padding: 0; color: inherit; }
.jst-empty-hint { color: var(--sx-gutter); font-size: 12px; }
.jst-empty-hint kbd, .jst-kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--sx-border-strong); border-bottom-width: 2px; background: var(--sx-panel-2); color: var(--sx-text-2); font: 600 11px/1.5 var(--sx-mono); text-align: center; }
@keyframes jst-in { from { opacity: 0; transform: translateY(6px); } }

/* Problem banner under the input */
.jst-problem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px 10px 14px; border-top: 1px solid var(--sx-border); background: var(--sx-err-soft); color: var(--sx-text); font-size: 13px; line-height: 1.5; animation: jst-in .25s var(--sx-ease); }
.jst-problem > .jst-ico { color: var(--sx-err); margin-top: 2px; }
.jst-problem.warn { background: var(--sx-warn-soft); }
.jst-problem.warn > .jst-ico { color: var(--sx-warn); }
.jst-problem b { font-weight: 700; }
.jst-problem .jst-where { font: 650 12px var(--sx-mono); color: var(--sx-err); margin-right: 6px; white-space: nowrap; }
.jst-problem.warn .jst-where { color: var(--sx-warn); }
.jst-problem .jst-hint { display: block; color: var(--sx-muted); margin-top: 2px; }
.jst-problem .jb { margin-left: auto; flex: none; }
.jst-problem-txt { min-width: 0; overflow-wrap: anywhere; }
.jst-stale { position: absolute; top: 10px; right: 14px; z-index: 4; }
.jst-pbody.is-stale .jst-ed { opacity: .55; }

/* Find & replace */
.jst-find { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 8px 10px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel-2); animation: jst-in .2s var(--sx-ease); }
.jst-find-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.jst-find-row .jst-input { flex: 1; }
.jst-find-count { font: 600 12px var(--sx-mono); color: var(--sx-muted); min-width: 64px; text-align: center; white-space: nowrap; }
.jst-find-count.none { color: var(--sx-err); }
.jst-find .jb.sm { font-family: var(--sx-mono); }

/* Status bar */
.jst-status { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; min-height: 32px; padding: 5px 14px; border-top: 1px solid var(--sx-border); background: var(--sx-panel); color: var(--sx-muted); font: 500 12px var(--sx-font); }
.jst-status > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.jst-status .jst-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sx-gutter); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.jst-status .ok .jst-dot { background: var(--sx-ok); box-shadow: 0 0 0 3px var(--sx-ok-soft); }
.jst-status .err .jst-dot { background: var(--sx-err); box-shadow: 0 0 0 3px var(--sx-err-soft); }
.jst-status .busy .jst-dot { background: var(--sx-accent); animation: jst-pulse 1s ease-in-out infinite; }
.jst-status .ok { color: var(--sx-ok); font-weight: 650; }
.jst-status .err { color: var(--sx-err); font-weight: 650; }
.jst-status button.jst-warnbtn { border: 0; background: var(--sx-warn-soft); color: var(--sx-warn); font: 650 12px var(--sx-font); height: 22px; padding: 0 9px; border-radius: 99px; cursor: pointer; }
.jst-status-r { margin-left: auto; }
@keyframes jst-pulse { 50% { opacity: .35; } }

/* ---------- Tree view ---------- */
.jst-tree-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--sx-editor); }
.jst-tree-tools { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--sx-border-soft); }
.jst-app .jst-tree-tools .jst-input { flex: 1; font-family: var(--sx-font); }
.jst-tree { flex: 1; overflow: auto; padding: 8px 6px 16px; font: 400 var(--fs)/1.75 var(--sx-mono); }
.jst-tree [role="group"] { margin-left: 18px; border-left: 1px dashed var(--sx-border); padding-left: 2px; }
.jst-tr-row { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 6px 0 2px; border-radius: 7px; cursor: default; white-space: nowrap; position: relative; }
.jst-tr-row:hover { background: var(--sx-hover); }
[role="treeitem"]:focus { outline: none; }
[role="treeitem"]:focus > .jst-tr-row { background: var(--sx-accent-soft); box-shadow: inset 0 0 0 1px var(--sx-accent); }
.jst-tr-tog { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border: 0; border-radius: 5px; background: none; color: var(--sx-muted); cursor: pointer; padding: 0; }
.jst-tr-tog:hover { background: var(--sx-raised); color: var(--sx-text); }
.jst-tr-tog .jst-ico { width: 13px; height: 13px; transition: transform .18s var(--sx-ease); }
[aria-expanded="true"] > .jst-tr-row .jst-tr-tog .jst-ico { transform: rotate(90deg); }
.jst-tr-sp { width: 18px; flex: none; }
.jst-tr-key { color: var(--sx-k); }
.jst-tr-key.idx { color: var(--sx-gutter); }
.jst-tr-colon { color: var(--sx-p); margin-left: -4px; }
.jst-tr-val { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jst-tr-val.s { color: var(--sx-s); } .jst-tr-val.n { color: var(--sx-n); } .jst-tr-val.b { color: var(--sx-b); } .jst-tr-val.z { color: var(--sx-z); font-style: italic; }
.jst-tr-val.o { color: var(--sx-p); }
.jst-tr-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 99px; background: var(--sx-panel-2); border: 1px solid var(--sx-border); color: var(--sx-muted); font: 600 11px var(--sx-font); }
.jst-tr-acts { display: inline-flex; gap: 2px; margin-left: auto; padding-left: 10px; opacity: 0; transition: opacity .12s; }
.jst-tr-row:hover .jst-tr-acts, [role="treeitem"]:focus > .jst-tr-row .jst-tr-acts { opacity: 1; }
@media (hover: none) and (pointer: coarse) { .jst-tr-acts { opacity: 1; } }
.jst-tr-acts button { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border: 1px solid var(--sx-border); border-radius: 6px; background: var(--sx-panel); color: var(--sx-text-2); font: 600 11px var(--sx-font); cursor: pointer; }
.jst-tr-acts button:hover { border-color: var(--sx-accent); color: var(--sx-accent); }
.jst-tr-acts .jst-ico { width: 12px; height: 12px; }
.jst-tree mark { background: var(--sx-find); color: inherit; border-radius: 3px; }
.jst-tr-row.hit-cur { box-shadow: inset 0 0 0 1px var(--sx-warn); background: var(--sx-warn-soft); }
.jst-tr-more { margin: 4px 0 4px 24px; }
.jst-pathbar { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px 4px 14px; border-top: 1px solid var(--sx-border-soft); background: var(--sx-panel); font: 500 12px var(--sx-mono); color: var(--sx-text-2); }
.jst-pathbar .jb { font-family: var(--sx-font); }
.jst-pathbar code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; padding: 0; color: inherit; font: inherit; }

/* ---------- Compare ---------- */
.jst-mode[data-mode="compare"] .jst-split { height: var(--jst-ch, 360px); }
.jst-vstat { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 12px; border-top: 1px solid var(--sx-border-soft); background: var(--sx-panel); font-size: 12px; color: var(--sx-muted); }
.jst-vstat.ok { color: var(--sx-ok); } .jst-vstat.err { color: var(--sx-err); }
.jst-vstat button { margin-left: auto; }
.jst-result { border-top: 1px solid var(--sx-border); background: var(--sx-panel); }
.jst-result-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--sx-border-soft); }
.jst-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jst-summary .jst-chip b { font-family: var(--sx-mono); }
.jst-chip.add { color: var(--sx-add); } .jst-chip.del { color: var(--sx-del); } .jst-chip.mod { color: var(--sx-mod); }
.jst-chip.add[aria-pressed="true"] { background: var(--sx-add-bg); border-color: var(--sx-add); color: var(--sx-add); }
.jst-chip.del[aria-pressed="true"] { background: var(--sx-del-bg); border-color: var(--sx-del); color: var(--sx-del); }
.jst-chip.mod[aria-pressed="true"] { background: var(--sx-mod-bg); border-color: var(--sx-mod); color: var(--sx-mod); }
.jst-result-body { max-height: 520px; overflow: auto; background: var(--sx-editor); }
.jst-studio.max .jst-result-body { max-height: none; }
.jst-changes { list-style: none; margin: 0; padding: 6px; font: 400 13px/1.55 var(--sx-mono); }
.jst-change { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 8px; border-radius: 8px; border-left: 3px solid transparent; animation: jst-in .25s var(--sx-ease) both; }
.jst-change + .jst-change { margin-top: 2px; }
.jst-change:hover { background: var(--sx-hover); }
.jst-change.add { border-left-color: var(--sx-add); } .jst-change.del { border-left-color: var(--sx-del); } .jst-change.mod { border-left-color: var(--sx-mod); }
.jst-change-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 800 13px var(--sx-mono); }
.jst-change.add .jst-change-ico { background: var(--sx-add-bg); color: var(--sx-add); }
.jst-change.del .jst-change-ico { background: var(--sx-del-bg); color: var(--sx-del); }
.jst-change.mod .jst-change-ico { background: var(--sx-mod-bg); color: var(--sx-mod); }
.jst-change-path { color: var(--sx-text); font-weight: 600; overflow-wrap: anywhere; }
.jst-change-vals { margin-top: 2px; color: var(--sx-muted); overflow-wrap: anywhere; font-size: 12.5px; }
.jst-change-vals .from { color: var(--sx-del); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--sx-del) 50%, transparent); }
.jst-change-vals .to { color: var(--sx-add); }
.jst-change-vals .arrow { color: var(--sx-gutter); padding: 0 6px; }
.jst-change-vals .type { color: var(--sx-gutter); font-family: var(--sx-font); font-size: 11.5px; margin-left: 6px; }
.jst-unified { margin: 0; padding: 8px 0; font: 400 13px/1.65 var(--sx-mono); white-space: pre; overflow: visible; background: none; border: 0; color: var(--sx-text); min-width: max-content; }
.jst-unified div { padding: 0 14px 0 8px; }
.jst-unified div::before { content: attr(data-k); display: inline-block; width: 18px; color: var(--sx-gutter); }
.jst-unified .add { background: var(--sx-add-bg); color: var(--sx-add); }
.jst-unified .del { background: var(--sx-del-bg); color: var(--sx-del); }
.jst-unified .add::before, .jst-unified .del::before { color: inherit; font-weight: 800; }
.jst-unified button.fold { display: block; width: 100%; text-align: left; border: 0; padding: 2px 14px 2px 26px; background: var(--sx-panel-2); color: var(--sx-muted); font: 600 12px var(--sx-font); cursor: pointer; }
.jst-unified button.fold:hover { color: var(--sx-accent); }
.jst-identical { display: flex; align-items: center; gap: 12px; padding: 22px 18px; color: var(--sx-ok); font-weight: 650; }
.jst-identical .jst-ico { width: 22px; height: 22px; }

/* ---------- Convert / Query / Stats ---------- */
.jst-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel-2); min-height: 52px; }
.jst-opts label.jst-lab { display: inline-flex; align-items: center; gap: 8px; color: var(--sx-text-2); font-size: 13px; font-weight: 600; }
.jst-app .jst-opts .jst-input { width: 140px; font-family: var(--sx-font); }
.jst-opts-note { color: var(--sx-muted); font-size: 12.5px; }
.jst-mode[data-mode="convert"] .jst-split, .jst-mode[data-mode="query"] .jst-split { height: var(--jst-h, 600px); }
.jst-qbar { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel); }
.jst-qbar .jst-qfield { position: relative; flex: 1; min-width: 0; }
.jst-app .jst-qbar .jst-input { height: 40px; font-size: 14px; padding-left: 12px; border-radius: 12px; }
.jst-app .jst-qbar .jst-input.bad { border-color: var(--sx-err); box-shadow: 0 0 0 3px var(--sx-err-soft); }
.jst-qex { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--sx-border-soft); background: var(--sx-panel-2); align-items: center; }
.jst-qex > span { color: var(--sx-muted); font-size: 12px; font-weight: 600; margin-right: 2px; }
.jst-qmsg { padding: 10px 14px; font-size: 13px; color: var(--sx-muted); border-bottom: 1px solid var(--sx-border-soft); }
.jst-qmsg.err { color: var(--sx-err); background: var(--sx-err-soft); }
.jst-qres { list-style: none; margin: 0; padding: 8px; overflow: auto; height: 100%; box-sizing: border-box; }
.jst-qitem { border: 1px solid var(--sx-border); border-radius: 12px; background: var(--sx-panel); margin-bottom: 8px; overflow: hidden; animation: jst-in .25s var(--sx-ease) both; }
.jst-qitem-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--sx-border-soft); }
.jst-qitem-head code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12.5px var(--sx-mono); color: var(--sx-text); background: none; padding: 0; }
.jst-code { margin: 0; padding: 10px 12px; font: 400 13px/1.6 var(--sx-mono); white-space: pre; overflow: auto; max-height: 220px; background: var(--sx-editor); border: 0; border-radius: 0; color: var(--sx-text); }
.jst-stats { padding: 16px; display: grid; gap: 16px; }
.jst-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.jst-card { position: relative; padding: 16px; border-radius: 14px; border: 1px solid var(--sx-border); background: linear-gradient(160deg, var(--sx-panel), var(--sx-panel-2)); overflow: hidden; animation: jst-in .35s var(--sx-ease) both; }
.jst-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(var(--sx-glow-1), transparent 70%); }
.jst-card-l { display: flex; align-items: center; gap: 7px; color: var(--sx-muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.jst-card-l .jst-ico { color: var(--sx-accent); width: 14px; height: 14px; }
.jst-card-v { margin-top: 8px; font: 750 1.75rem/1.1 var(--sx-font); letter-spacing: -.02em; color: var(--sx-text); font-variant-numeric: tabular-nums; }
.jst-card-s { margin-top: 4px; color: var(--sx-muted); font-size: 12.5px; }
.jst-box { border: 1px solid var(--sx-border); border-radius: 14px; background: var(--sx-panel); padding: 16px; min-width: 0; }
.jst-box h3 { margin: 0 0 12px; font-size: .92rem; font-weight: 700; color: var(--sx-text); }
.jst-bars { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--sx-panel-2); }
.jst-bars span { height: 100%; transition: width .6s var(--sx-ease); }
.jst-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 12.5px; color: var(--sx-text-2); }
.jst-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.jst-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.jst-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13px; }
.jst-dl dt { color: var(--sx-muted); }
.jst-dl dd { margin: 0; color: var(--sx-text); font-family: var(--sx-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.jst-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jst-keys li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font: 500 12.5px var(--sx-mono); }
.jst-keys li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sx-k); }
.jst-keys .jst-kbar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--sx-panel-2); overflow: hidden; }
.jst-keys .jst-kbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sx-accent), var(--sx-accent-3)); border-radius: 4px; }
.jst-blank { display: grid; place-items: center; min-height: 340px; padding: 30px; text-align: center; color: var(--sx-muted); }
.jst-blank h3 { color: var(--sx-text); margin: 0 0 6px; font-size: 1rem; }
.jst-blank p { margin: 0 0 14px; font-size: .9rem; }

/* ---------- Popovers, menus, dialog, toasts, tooltip, drop zone ---------- */
.jst-pop { position: fixed; z-index: 1000; min-width: 220px; max-width: min(340px, calc(100vw - 24px)); padding: 6px; border-radius: 14px; border: 1px solid var(--sx-border-strong); background: var(--sx-raised); box-shadow: var(--sx-pop-shadow); color: var(--sx-text); font-family: var(--sx-font); animation: jst-pop .16s var(--sx-ease); }
@keyframes jst-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.jst-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--sx-text-2); font: 600 13px var(--sx-font); text-align: left; cursor: pointer; }
.jst-menu-item:hover, .jst-menu-item:focus-visible { background: var(--sx-hover); color: var(--sx-text); outline: none; }
.jst-menu-item small { display: block; color: var(--sx-muted); font-weight: 500; font-size: 11.5px; margin-top: 1px; }
.jst-menu-item .jst-ico { color: var(--sx-accent); }
.jst-menu-sep { height: 1px; margin: 5px 4px; background: var(--sx-border); }
.jst-pop-sec { padding: 8px 8px 10px; }
.jst-pop-sec + .jst-pop-sec { border-top: 1px solid var(--sx-border); }
.jst-pop-sec h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); font-weight: 700; }
.jst-pop-sec .jst-switch { display: flex; justify-content: space-between; padding: 5px 0; }
.jst-pop-sec p { margin: 4px 0 0; font-size: 11.5px; color: var(--sx-muted); line-height: 1.45; }
.jst-dlg { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 18px; border: 1px solid var(--sx-border-strong); background: var(--sx-raised); color: var(--sx-text); box-shadow: var(--sx-pop-shadow); font-family: var(--sx-font); }
.jst-dlg::backdrop { background: rgba(5, 8, 15, .55); backdrop-filter: blur(3px); }
.jst-dlg[open] { animation: jst-pop .2s var(--sx-ease); }
.jst-dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--sx-border); }
.jst-dlg-head h2 { margin: 0; font-size: 1.05rem; font-weight: 750; color: var(--sx-text); }
.jst-dlg-head .jb { margin-left: auto; }
.jst-dlg-body { padding: 14px 20px 20px; overflow: auto; max-height: calc(100vh - 140px); }
.jst-keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; }
.jst-keys-grid h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); }
.jst-keys-grid dl { margin: 0; display: grid; gap: 7px; }
.jst-keys-grid dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--sx-text-2); }
.jst-keys-grid dd { margin: 0; white-space: nowrap; }
.jst-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 36px); }
.jst-toast { display: flex; align-items: flex-start; gap: 10px; min-width: 240px; max-width: 400px; padding: 11px 10px 11px 13px; border-radius: 13px; border: 1px solid var(--sx-border-strong); background: var(--sx-raised); color: var(--sx-text); box-shadow: var(--sx-pop-shadow); font: 500 13px/1.45 var(--sx-font); pointer-events: auto; animation: jst-toast .28s var(--sx-ease); }
.jst-toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.jst-toast > .jst-ico { margin-top: 1px; }
.jst-toast.ok > .jst-ico { color: var(--sx-ok); } .jst-toast.err > .jst-ico { color: var(--sx-err); } .jst-toast.info > .jst-ico { color: var(--sx-accent); } .jst-toast.warn > .jst-ico { color: var(--sx-warn); }
.jst-toast.err { border-color: color-mix(in srgb, var(--sx-err) 45%, var(--sx-border-strong)); }
.jst-toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.jst-toast button { border: 0; background: none; color: var(--sx-muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-grid; }
.jst-toast button:hover { color: var(--sx-text); background: var(--sx-hover); }
.jst-toast .jst-toast-act { color: var(--sx-accent); font: 650 12.5px var(--sx-font); padding: 2px 6px; }
@keyframes jst-toast { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.jst-tip { position: fixed; z-index: 1200; max-width: 260px; padding: 6px 9px; border-radius: 8px; background: #0f1322; color: #eef0f7; font: 600 12px/1.4 var(--sx-font, sans-serif); box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .45); pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.jst-tip.show { opacity: 1; transform: none; }
.jst-tip kbd { margin-left: 6px; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, .14); font: 600 11px var(--sx-mono, monospace); border: 0; color: inherit; }
.jst-drop { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--sx-bg) 82%, transparent); backdrop-filter: blur(2px); border: 2px dashed var(--sx-accent); border-radius: inherit; pointer-events: none; animation: jst-in .15s; }
.jst-drop-card { text-align: center; color: var(--sx-text); font-weight: 700; }
.jst-drop-card .jst-ico { width: 34px; height: 34px; color: var(--sx-accent); margin-bottom: 8px; }
.jst-drop-card small { display: block; color: var(--sx-muted); font-weight: 500; margin-top: 4px; }
.jst-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.jst-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sx-border-strong); border-top-color: var(--sx-accent); animation: jst-rot .7s linear infinite; }
@keyframes jst-rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .jst-tb-label { display: none; }
  .jb.has-label { width: 32px; padding: 0; }
  .jb.primary.has-label .jst-tb-label { display: inline; }
  .jb.primary.has-label { width: auto; padding: 0 12px; }
}
@media (max-width: 900px) {
  .jst-hero { grid-template-columns: minmax(0, 1fr); }
  .jst-art { display: none; }
  .jst-split { flex-direction: column; height: auto; min-height: 0; }
  .jst-pane.left, .jst-pane.right { flex: none; height: var(--jst-ph, 54vh); min-height: 320px; }
  .jst-mode[data-mode="compare"] .jst-split, .jst-mode[data-mode="convert"] .jst-split, .jst-mode[data-mode="query"] .jst-split { height: auto; }
  .jst-mode[data-mode="compare"] .jst-pane { height: 300px; min-height: 240px; }
  .jst-resizer { display: none; }
  .jst-pane.right { border-top: 1px solid var(--sx-border); }
  .jst-height-grip { display: none; }
  .jst-two { grid-template-columns: minmax(0, 1fr); }
  .jst-local span { display: none; }
  .jst-local { padding: 0 8px; }
  .jst-studio.max .jst-mode[data-mode="editor"] .jst-split { overflow: auto; }
}
@media (max-width: 640px) {
  .jst-app .tool-head { padding: 18px 16px 18px; border-radius: 18px; }
  .jst-cta .jb.lg { height: 38px; padding: 0 13px; font-size: 13.5px; }
  .jst-tab span.jst-tab-t { display: none; }
  .jst-topbar { gap: 6px; padding: 8px 8px 8px 8px; }
  .jst-tabs { flex: 1; }
  .jst-local, .jst-topbar-r [data-act="shortcuts"] { display: none; }
  .jst-tb-main { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .jst-tb-main::-webkit-scrollbar { display: none; }
  .jst-tb-main .jb { flex: none; }
  #jst-out-kind, .jst-phead .jst-file { display: none !important; }
  .jst-phead { padding-left: 12px; }
  .jst-phead-r { gap: 0; }
  .jst-seg button { padding: 0 8px; }
  .jst-tab { padding: 0 9px; gap: 6px; font-size: 13px; }
  .jst-tabs { gap: 2px; }
  .jst-tr-acts button { font-size: 0; gap: 0; padding: 0 6px; }
  .jst-qbar { flex-wrap: wrap; }
  .jst-qbar .jst-qfield { flex: 1 1 100%; }
  .jst-qex { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .jst-qex::-webkit-scrollbar { display: none; }
  .jst-qex > * { flex: none; }
  .jst-tr-acts .jst-ico { width: 13px; height: 13px; }
  .jst-tab[aria-selected="true"] span.jst-tab-t { display: inline; }
  .jst-tab-n { display: none; }
  .jst-toolbar-r { margin-left: 0; width: 100%; justify-content: space-between; }
  .jst-tsep.hide-sm { display: none; }
  .jst-keys-grid { grid-template-columns: minmax(0, 1fr); }
  .jst-find { grid-template-columns: minmax(0, 1fr); }
  .jst-toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; max-width: none; }
  .jst-toast { max-width: none; min-width: 0; }
  .jst-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jst-card-v { font-size: 1.4rem; }
  .jst-phead .jst-file { max-width: 90px; }
  .jst-app .jst-opts .jst-input { width: 110px; }
}
/* ==========================================================================================================
   Workspaces (2026-11-25): Editor | Convert | Generate | Environment. Shared by json-studio-workspaces.js.
   ========================================================================================================== */
.jst-hl .c, .jst-code .c { color: var(--sx-muted); font-style: italic; }
.jst-hl .t, .jst-code .t { color: var(--sx-accent-3); }
.jst-hl .a, .jst-code .a { color: var(--sx-accent-2); }
.jst-ws { display: flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--sx-bg); border: 1px solid var(--sx-border); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.jst-ws::-webkit-scrollbar { display: none; }
.jst-ws-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--sx-muted); font: 680 13.5px var(--sx-font); cursor: pointer; white-space: nowrap; transition: color .15s, background .2s, box-shadow .2s; }
.jst-ws-tab:hover { color: var(--sx-text); background: var(--sx-hover); }
.jst-ws-tab:focus-visible, .jst-doctab:focus-visible { outline: 2px solid var(--sx-accent); outline-offset: 1px; }
.jst-ws-tab[aria-selected="true"] { color: var(--sx-on-accent); background: linear-gradient(135deg, var(--sx-accent), color-mix(in srgb, var(--sx-accent) 68%, var(--sx-accent-2))); box-shadow: 0 6px 18px -8px var(--sx-accent); }
.jst-ws-tab[aria-selected="true"] .jst-ico { color: inherit; }
.jst-subbar { display: flex; align-items: center; min-height: 46px; padding: 4px 10px; border-bottom: 1px solid var(--sx-border); background: var(--sx-panel); }
.jst-subbar .jst-tab { height: 32px; font-size: 13px; }
.jst-studio.ws-enter .jst-mode:not([hidden]) { animation: jst-ws-in .28s var(--sx-ease); }
@keyframes jst-ws-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.jst-fmtpick { display: inline-flex; align-items: center; gap: 6px; color: var(--sx-muted); }
.jst-fmtpick .jst-ico { width: 16px; height: 16px; }
.jst-app .jst-fmt { min-width: 96px; font-weight: 700; }
.jst-rootname { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--sx-text-2); font: 600 13px var(--sx-font); }
.jst-app .jst-rootname .jst-input { width: 130px; }
.jst-opts-wrap { border-bottom: 1px solid var(--sx-border); background: var(--sx-panel-2); animation: jst-in .2s var(--sx-ease); }
.jst-optpanel { display: grid; gap: 12px; padding: 12px; border: 0; background: none; min-height: 0; max-height: 46vh; overflow: auto; }
.jst-optgroup { margin: 0; padding: 0; border: 0; min-width: 0; }
.jst-optgroup legend { padding: 0 0 8px; font: 700 11px var(--sx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); }
.jst-optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; align-items: center; }
.jst-opt.jst-lab { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.jst-opt.jst-lab > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jst-app .jst-opt .jst-select { max-width: 60%; }
.jst-app .jst-opt .jst-input { width: 55%; flex: none; }
.jst-opt.wide { grid-column: 1 / -1; align-items: flex-start; }
.jst-app .jst-opt .jst-ta { width: 70%; height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.jst-wsp .jst-split { height: var(--jst-h, 600px); }
.jst-studio.max .jst-wsp:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.jst-studio.max .jst-wsp .jst-split { flex: 1; height: auto; min-height: 0; }
.jst-mswitch { display: none; }
.jst-doctabs { display: flex; gap: 2px; padding: 4px 6px 0; border-bottom: 1px solid var(--sx-border-soft); background: var(--sx-panel); overflow-x: auto; scrollbar-width: none; flex: none; }
.jst-doctabs::-webkit-scrollbar { display: none; }
.jst-doctab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--sx-muted); font: 600 12.5px var(--sx-mono); cursor: pointer; white-space: nowrap; }
.jst-doctab:hover { color: var(--sx-text); background: var(--sx-hover); }
.jst-doctab[aria-selected="true"] { color: var(--sx-text); background: var(--sx-editor); border-color: var(--sx-border-soft); box-shadow: 0 -2px 0 var(--sx-accent) inset; }
.jst-doctab.add { color: var(--sx-accent); }
.jst-doctab .jst-ico { width: 14px; height: 14px; }
.jst-doctab-x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: var(--sx-muted); }
.jst-doctab-x:hover { background: var(--sx-err-soft); color: var(--sx-err); }
.jst-vstat.warn { color: var(--sx-warn); }
.jst-vstat .jst-ico { width: 14px; height: 14px; flex: none; }
.jst-vstat > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jst-diag { border-top: 1px solid var(--sx-border); background: var(--sx-panel); max-height: 260px; overflow: auto; }
.jst-diag:empty { display: none; }
.jst-diag-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: var(--sx-panel); border-bottom: 1px solid var(--sx-border-soft); }
.jst-diag-title { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font: 700 11px var(--sx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); }
.jst-diag-title .jst-ico { width: 14px; height: 14px; }
.jst-diag-list { list-style: none; margin: 0; padding: 4px 0; }
.jst-diag-list li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 12px; font-size: 13px; color: var(--sx-text-2); line-height: 1.45; }
.jst-diag-list li + li { border-top: 1px solid var(--sx-border-soft); }
.jst-diag-list li > .jst-ico { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.jst-diag-list li.error > .jst-ico { color: var(--sx-err); }
.jst-diag-list li.warning > .jst-ico { color: var(--sx-warn); }
.jst-diag-list li.info > .jst-ico { color: var(--sx-accent-3); }
.jst-diag-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.jst-diag-msg small { display: block; color: var(--sx-muted); font-size: 12px; }
.jst-diag-list .jb { flex: none; }
.jst-loss { display: flex; gap: 10px; margin: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--sx-accent-soft); color: var(--sx-text-2); font-size: 12.5px; line-height: 1.5; }
.jst-loss > .jst-ico { width: 16px; height: 16px; flex: none; color: var(--sx-accent); margin-top: 1px; }
.jst-loss ul { margin: 4px 0 0; padding-left: 18px; }
.jst-banner { flex: none; padding: 6px 12px; border-bottom: 1px solid var(--sx-border-soft); background: var(--sx-warn-soft); color: var(--sx-text-2); font-size: 12.5px; line-height: 1.45; }
.jst-banner p { display: flex; gap: 8px; margin: 3px 0; }
.jst-banner .jst-ico { width: 15px; height: 15px; flex: none; color: var(--sx-warn); margin-top: 1px; }
.jst-spring { margin: 8px 12px 12px; border: 1px solid var(--sx-border); border-radius: 10px; background: var(--sx-panel-2); }
.jst-spring summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font: 650 13px var(--sx-font); color: var(--sx-text-2); }
.jst-spring summary .jst-ico { width: 15px; height: 15px; }
.jst-spring > p { margin: 0 12px 8px; }
.jst-spring-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.jst-spring-t th { text-align: left; padding: 6px 12px; color: var(--sx-muted); font: 700 11px var(--sx-font); letter-spacing: .06em; text-transform: uppercase; border-top: 1px solid var(--sx-border); }
.jst-spring-t td { padding: 5px 12px; border-top: 1px solid var(--sx-border-soft); vertical-align: middle; }
.jst-spring-t td:last-child { display: flex; align-items: center; gap: 8px; }
.jst-spring-t code { font: 600 12px var(--sx-mono); color: var(--sx-k); overflow-wrap: anywhere; }
.jst-app .jst-spring-t .jst-input { height: 28px; font-size: 12px; }
.jst-spring-t tr.amb .jst-input { border-color: color-mix(in srgb, var(--sx-warn) 55%, var(--sx-border)); }
.jst-help { position: absolute; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100%); display: flex; flex-direction: column; border-left: 1px solid var(--sx-border-strong); background: var(--sx-panel); box-shadow: var(--sx-pop-shadow); animation: jst-help-in .25s var(--sx-ease); }
.jst-help:focus { outline: none; }
@keyframes jst-help-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.jst-help-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--sx-border); font: 700 13px var(--sx-font); color: var(--sx-text); }
.jst-help-head > span { display: inline-flex; align-items: center; gap: 8px; }
.jst-help-head .jst-ico { color: var(--sx-accent); }
.jst-help-body { flex: 1; overflow: auto; padding: 4px 18px 20px; font-size: 13.5px; line-height: 1.6; color: var(--sx-text-2); }
.jst-help-body h3 { margin: 14px 0 6px; font-size: 16px; color: var(--sx-text); }
.jst-help-body h4 { margin: 16px 0 4px; font: 700 11.5px var(--sx-font); letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); }
.jst-help-body p { margin: 4px 0; }
.jst-help-body ul { margin: 4px 0; padding-left: 18px; }
.jst-help-body li { margin: 3px 0; }
.jst-help-body code { font: 500 12.5px var(--sx-mono); padding: 1px 5px; border-radius: 5px; background: var(--sx-panel-2); color: var(--sx-text); }
.jst-help-small { font-size: 12px; color: var(--sx-muted); }
.jst-matrix { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12.5px; text-align: center; }
.jst-matrix th, .jst-matrix td { padding: 5px 4px; border: 1px solid var(--sx-border); }
.jst-matrix thead th, .jst-matrix tbody th { background: var(--sx-panel-2); color: var(--sx-text); font-weight: 700; }
.jst-matrix td { color: var(--sx-ok); font-weight: 700; }
.jst-recent-row { display: flex; align-items: center; gap: 2px; }
.jst-recent-row .jst-menu-item { flex: 1; min-width: 0; }
.jst-recent-row .jst-menu-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.jst-pop-empty { margin: 4px 10px 10px; font-size: 12.5px; color: var(--sx-muted); }
@media (max-width: 1100px) {
  .jst-ws-tab { padding: 0 11px; }
  .jst-app .jst-rootname .jst-input { width: 100px; }
}
@media (max-width: 900px) {
  .jst-mswitch { display: flex; margin: 8px 10px 0; width: calc(100% - 20px); }
  .jst-mswitch button { flex: 1; justify-content: center; height: 32px; }
  .jst-wsp .jst-split { flex-direction: column; height: auto; }
  .jst-wsp .jst-split > .jst-pane { height: var(--jst-ph, 62vh); min-height: 340px; flex: none; border-top: 0; margin-top: 8px; border-top: 1px solid var(--sx-border); }
  .jst-wsp .jst-split[data-show="left"] > .jst-pane.right, .jst-wsp .jst-split[data-show="right"] > .jst-pane.left { display: none; }
  .jst-optgrid { grid-template-columns: minmax(0, 1fr); }
  .jst-help { width: 100%; }
}
@media (max-width: 640px) {
  .jst-ws { flex: 1 1 100%; order: 2; }
  .jst-ws-tab { flex: 1 1 auto; justify-content: center; padding: 0 8px; gap: 6px; font-size: 12.5px; }
  .jst-ws-tab[aria-selected="true"] { flex: 2 1 auto; }
  .jst-ws-tab .jst-ws-t { display: none; }
  .jst-ws-tab[aria-selected="true"] .jst-ws-t { display: inline; }
  .jst-topbar { flex-wrap: wrap; }
  .jst-topbar-r { margin-left: auto; order: 1; }
  .jst-subbar { padding: 4px 6px; }
  .jst-wtb .jst-tb-main { flex-wrap: wrap; overflow: visible; }
  .jst-wtb .jst-tsep { display: none; }
  .jst-fmtpick { flex: 1 1 100%; }
  .jst-app .jst-fmt { flex: 1; min-width: 0; }
  .jst-rootname { margin-left: 0; }
  .jst-app .jst-opt .jst-select, .jst-app .jst-opt .jst-input { max-width: 58%; }
  .jst-app .jst-opt .jst-ta { width: 100%; }
  .jst-opt.wide { flex-direction: column; }
  .jst-diag { max-height: 320px; }
  .jst-app input.jst-input, .jst-app select.jst-select, .jst-app textarea.jst-ta { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .jst-app *, .jst-app *::before, .jst-app *::after, .jst-pop, .jst-toast, .jst-dlg, .jst-help { animation: none !important; transition: none !important; }
  .jst-art-win { transform: none; }
}
