:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --code-bg: #111827;
  --code-panel: #182235;
  --text: #152238;
  --muted: #667085;
  --faint: #98a2b3;
  --border: #dbe2ec;
  --border-strong: #c8d3e2;
  --primary: #315efb;
  --primary-hover: #234ce0;
  --primary-text: #ffffff;
  --success: #087a58;
  --success-bg: #e9f8f1;
  --danger: #ba2846;
  --danger-bg: #fff0f2;
  --warning: #9a5a00;
  --shadow: 0 14px 40px rgba(32, 51, 85, .08);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1421;
  --surface: #151f2e;
  --surface-muted: #192536;
  --code-bg: #0a101a;
  --code-panel: #101b2a;
  --text: #e8eef8;
  --muted: #a9b5c7;
  --faint: #7f8ca0;
  --border: #2b3a50;
  --border-strong: #3d4e67;
  --primary: #7ca1ff;
  --primary-hover: #a5beff;
  --primary-text: #0c1830;
  --success: #6ee0b4;
  --success-bg: #123e35;
  --danger: #ff9bad;
  --danger-bg: #482333;
  --warning: #f5c46b;
  --shadow: 0 16px 44px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 48%, transparent); outline-offset: 2px; }
.site-shell { max-width: 1500px; padding: 28px 28px 40px; margin: 0 auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 4px 0 24px; }
.brand-block, .header-actions, .panel-heading, .command-bar, .tree-toolbar, .path-bar, .diff-intro, .search-controls, .tree-actions, .input-stats, .output-actions { display: flex; align-items: center; }
.brand-block { gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; color: var(--primary-text); background: var(--primary); font: 700 14px/1 var(--mono); box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 25%, transparent); }
.eyebrow, .panel-kicker { margin: 0 0 3px; color: var(--primary); font-size: .69rem; font-weight: 760; letter-spacing: .085em; line-height: 1.2; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 2px; font-size: 1.36rem; letter-spacing: -.026em; line-height: 1.18; }
h2 { margin-bottom: 0; font-size: .94rem; letter-spacing: -.012em; }
.subtitle { margin: 0; color: var(--muted); font-size: .91rem; }
.header-actions { gap: 12px; }
.privacy-note { max-width: 430px; margin: 0; color: var(--muted); font-size: .79rem; text-align: right; }
.privacy-note span { color: var(--success); font-weight: 800; }
.icon-button, .small-button, .button { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); border-radius: 8px; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.icon-button:hover, .small-button:hover:not(:disabled), .button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.icon-button:active, .small-button:active:not(:disabled), .button:active:not(:disabled) { transform: translateY(1px); }
.icon-button { width: 36px; height: 36px; font-size: 1.13rem; }
.panel-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.workbench .panel-card { min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.editor-card { border-right: 1px solid var(--border) !important; }
.panel-heading { justify-content: space-between; min-height: 67px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.input-stats { gap: 7px; color: var(--muted); font: 600 .72rem/1 var(--mono); white-space: nowrap; }
.code-editor { display: grid; grid-template-columns: 48px minmax(0, 1fr); height: clamp(330px, 49vh, 570px); overflow: hidden; background: var(--code-bg); }
.line-numbers { overflow: hidden; margin: 0; padding: 18px 9px 18px 0; border-right: 1px solid rgba(255,255,255,.09); color: #60708a; background: var(--code-panel); font: 14px/1.55 var(--mono); text-align: right; user-select: none; }
#json-input, .diff-input { width: 100%; min-width: 0; padding: 18px; resize: none; border: 0; outline: 0; color: #e8eef8; background: var(--code-bg); caret-color: #e8eef8; font: 14px/1.55 var(--mono); tab-size: 2; }
#json-input::placeholder, .diff-input::placeholder { color: #75839a; }
.editor-help { margin: 0; padding: 9px 18px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface-muted); font-size: .72rem; }
kbd { padding: 1px 4px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text); background: var(--surface); font: 600 .67rem/1.4 var(--mono); }
.output-actions { gap: 7px; }
.small-button { min-height: 29px; padding: 5px 9px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.output-wrap { height: clamp(370px, 53vh, 610px); overflow: auto; background: var(--code-bg); }
.json-output { min-width: max-content; min-height: 100%; margin: 0; padding: 18px; color: #dbe8ff; font: 14px/1.55 var(--mono); white-space: pre; tab-size: 2; }
.command-bar { justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.command-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button { min-height: 35px; padding: 7px 12px; font-size: .78rem; font-weight: 700; }
.button-primary { border-color: var(--primary); color: var(--primary-text); background: var(--primary); }
.button-primary:hover:not(:disabled) { border-color: var(--primary-hover); color: var(--primary-text); background: var(--primary-hover); }
.button-quiet { background: transparent; }
.indent-label { display: flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--muted); font-size: .75rem; font-weight: 600; }
#indent-select { min-height: 32px; max-width: 102px; padding: 4px 25px 4px 7px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); background: var(--surface); font-size: .75rem; }
.status-message { min-height: 40px; margin: 12px 0 20px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: var(--surface-muted); font-size: .82rem; }
.status-message.success { border-color: color-mix(in srgb, var(--success) 35%, transparent); color: var(--success); background: var(--success-bg); }
.status-message.error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); background: var(--danger-bg); }
.status-message.warning { color: var(--warning); }
.inspector { overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 0 15px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.tab { position: relative; padding: 14px 14px 12px; border: 0; color: var(--muted); background: transparent; font-size: .82rem; font-weight: 720; }
.tab::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 2px; background: transparent; content: ""; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); }
.tab.is-active::after { background: var(--primary); }
.tab-panel { min-height: 395px; }
.tree-toolbar { justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tree-actions { gap: 7px; }
.search-field { display: flex; align-items: center; gap: 7px; width: min(42%, 400px); min-width: 180px; min-height: 31px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--faint); background: var(--surface-muted); }
.search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .76rem; }
.search-controls { gap: 7px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.icon-text { min-width: 29px; padding-right: 5px; padding-left: 5px; }
.path-bar { gap: 9px; min-height: 48px; padding: 9px 16px; border-bottom: 1px solid var(--border); background: var(--surface-muted); overflow-x: auto; }
.path-label { flex: 0 0 auto; color: var(--muted); font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.path-bar code { flex: 1 1 auto; min-width: 100px; color: var(--primary); font: .77rem var(--mono); white-space: nowrap; }
.tree-view { max-height: 570px; min-height: 295px; overflow: auto; padding: 13px 16px 17px; background: var(--surface); font: 13px/1.5 var(--mono); }
.tree-list { margin: 0; padding: 0; list-style: none; }
.tree-children { margin: 0; padding: 0 0 0 22px; list-style: none; }
.tree-row { display: flex; align-items: baseline; min-height: 26px; border-radius: 5px; white-space: nowrap; }
.tree-row:hover { background: var(--surface-muted); }
.tree-row.is-selected { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.tree-row.is-current-match { outline: 1px solid var(--primary); outline-offset: -1px; }
.tree-toggle { display: inline-grid; width: 21px; height: 26px; place-items: center; flex: 0 0 auto; padding: 0; border: 0; color: var(--faint); background: transparent; font-size: .75rem; }
.tree-toggle:not(:disabled):hover { color: var(--primary); }
.tree-toggle:disabled { opacity: .26; }
.tree-content { display: flex; gap: 7px; min-width: 0; align-items: baseline; width: 100%; padding: 2px 6px 2px 0; border: 0; color: inherit; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.tree-key { color: var(--text); font-weight: 680; }
.tree-separator { color: var(--faint); }
.tree-value { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.tree-value.string { color: #0c8c70; }.tree-value.number { color: #a26700; }.tree-value.boolean { color: #8656d7; }.tree-value.null { color: #d0567c; }.tree-value.container { color: var(--faint); font-style: italic; }
[data-theme="dark"] .tree-value.string { color: #60d7b6; } [data-theme="dark"] .tree-value.number { color: #f2bd61; } [data-theme="dark"] .tree-value.boolean { color: #c0a0ff; } [data-theme="dark"] .tree-value.null { color: #ff91b2; }
.tree-match { background: color-mix(in srgb, #ffd35a 50%, transparent); color: inherit; border-radius: 2px; }
.tree-omitted { padding: 6px 0 5px 21px; color: var(--warning); font: .74rem/1.4 var(--mono); }
.tree-footnote { margin: 0; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface-muted); font-size: .72rem; }
.empty-panel { margin: 0; padding: 36px 18px; color: var(--muted); font-size: .84rem; text-align: center; }
.analysis-view { padding: 20px; }
.analysis-heading { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.analysis-heading h2 { font-size: 1rem; }.analysis-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.analysis-grid { display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: 9px; margin-bottom: 18px; }
.metric { padding: 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-muted); }.metric dt { color: var(--muted); font-size: .7rem; font-weight: 650; }.metric dd { margin: 3px 0 0; font: 700 1.05rem/1.15 var(--mono); }
.structure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }.structure-card { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; }.structure-card h3 { margin: 0 0 9px; font-size: .78rem; }.structure-card ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }.structure-card li { overflow: hidden; color: var(--muted); font: .72rem/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }.structure-card code { color: var(--primary); }.analysis-notice { margin: 0 0 14px; color: var(--warning); font-size: .76rem; }
.diff-intro { justify-content: space-between; gap: 18px; padding: 19px 18px 14px; }.diff-intro h2 { font-size: 1rem; }.diff-intro p:not(.panel-kicker) { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.diff-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 0 18px 16px; }.diff-editors label { display: block; margin-bottom: 6px; color: var(--muted); font-size: .74rem; font-weight: 700; }.diff-input { display: block; height: 190px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: .78rem; }.diff-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.diff-status { margin: 0 18px; padding: 10px 11px; border-radius: 7px; color: var(--muted); background: var(--surface-muted); font-size: .77rem; }.diff-status.error { color: var(--danger); background: var(--danger-bg); }.diff-status.success { color: var(--success); background: var(--success-bg); }
.diff-results { max-height: 350px; overflow: auto; margin-top: 13px; padding: 0 18px 18px; }.diff-empty { padding: 14px; border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); border-radius: 8px; color: var(--success); background: var(--success-bg); font-size: .8rem; }.diff-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 9px; border-bottom: 1px solid var(--border); font: .74rem/1.3 var(--mono); }.diff-kind { font-weight: 900; }.diff-add .diff-kind { color: var(--success); }.diff-remove .diff-kind { color: var(--danger); }.diff-change .diff-kind { color: var(--warning); }.diff-path { overflow: hidden; color: var(--primary); text-overflow: ellipsis; white-space: nowrap; }.diff-detail { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 20; padding: 9px 13px; border-radius: 8px; color: #fff; background: #172235; box-shadow: 0 8px 20px rgba(0,0,0,.22); font-size: .78rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { max-width: 650px; margin: 12px auto; padding: 10px 12px; border: 1px solid #e2b4bd; border-radius: 8px; color: #8f2036; background: #fff1f3; font-size: .84rem; }
.skip-link { position: fixed; top: 7px; left: 7px; z-index: 50; padding: 7px 10px; border-radius: 6px; color: #fff; background: #172235; transform: translateY(-160%); }.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 920px) { .site-shell { padding: 20px 18px 30px; }.topbar { align-items: flex-start; flex-direction: column; }.header-actions { width: 100%; justify-content: space-between; }.privacy-note { text-align: left; }.workbench { grid-template-columns: 1fr; }.editor-card { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }.code-editor { height: 360px; }.output-wrap { height: 340px; }.analysis-grid { grid-template-columns: repeat(3, 1fr); }.structure-grid { grid-template-columns: 1fr 1fr; }.structure-card:last-child { grid-column: span 2; } }
@media (max-width: 640px) { .site-shell { padding: 14px 12px 25px; }.topbar { gap: 13px; margin-bottom: 15px; }.brand-mark { width: 39px; height: 39px; }.subtitle { font-size: .82rem; }.privacy-note { max-width: calc(100% - 46px); font-size: .72rem; }.panel-heading { padding: 12px 13px; }.code-editor { grid-template-columns: 37px minmax(0, 1fr); height: 330px; }.line-numbers { padding-left: 3px; font-size: 12px; } #json-input, .json-output { padding: 13px; font-size: 12px; }.output-wrap { height: 315px; }.command-bar { align-items: stretch; gap: 9px; }.command-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 7px; }.secondary-commands { grid-template-columns: 1fr 1fr; }.button { padding: 7px 8px; font-size: .72rem; }.indent-label { justify-content: space-between; margin: 0; }.tree-toolbar { align-items: stretch; flex-wrap: wrap; padding: 11px 12px; }.tree-actions { order: 2; }.search-field { order: 1; width: 100%; }.search-controls { order: 3; margin-left: auto; }.path-bar { padding: 9px 12px; flex-wrap: wrap; }.path-bar code { flex-basis: 100%; order: 2; }.path-bar .small-button { order: 3; }.tree-view { padding: 11px 10px; font-size: 12px; }.tree-children { padding-left: 15px; }.analysis-view { padding: 14px; }.analysis-grid { grid-template-columns: repeat(2, 1fr); }.structure-grid { grid-template-columns: 1fr; }.structure-card:last-child { grid-column: auto; }.diff-intro { align-items: flex-start; flex-direction: column; padding: 15px 13px 12px; }.diff-editors { grid-template-columns: 1fr; padding: 0 13px 13px; }.diff-input { height: 150px; }.diff-status { margin: 0 13px; }.diff-results { padding: 0 13px 13px; }.diff-row { grid-template-columns: 16px minmax(0, 1fr); }.diff-detail { grid-column: 2; }.toast { bottom: 15px; } }
