.page-json .main {
    max-width: none;
    padding: 0;
    margin: 0;
    width: 100%;
    align-self: stretch;
}

.json-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.json-grid .panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.page-json .json-grid .panel {
    padding: 0;
    border: none;
}

.page-json .json-card {
    padding-left: 0;
    padding-right: 0;
    margin: 0;
    border-radius: 0;
}

.json-actions {
    justify-content: flex-end;
}

.json-card .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.json-card .card-head h2 {
    margin: 0;
}

.page-json .field textarea,
.page-json .code {
    height: var(--jsonPaneHeight, 60vh);
}

.code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 16px;
    line-height: 1.5;
    background: #0b0f15;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
    width: 100%;
    max-width: 100%;
}

html[data-theme="light"] .code {
    background: #f8fafc;
}

.editor {
    position: relative;
    height: var(--jsonPaneHeight, 60vh);
}

.page-json .field {
    grid-template-rows: auto 1fr;
}

.page-json .code {
    height: var(--jsonPaneHeight, 60vh);
    margin: 0;
}

.page-json .editor {
    height: var(--jsonPaneHeight, 60vh);
}

.code-preview {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 48px 1fr;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    pointer-events: none;
}

.code-gutter {
    padding: 12px 8px;
    background: #0b0f15;
    border-right: 1px solid var(--border);
    color: var(--muted);
    text-align: right;
    user-select: none;
}

html[data-theme="light"] .code-gutter {
    background: #f8fafc;
}

.code-inner {
    margin: 0;
    padding: 12px;
    white-space: pre;
}

.editor-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 12px 12px 12px calc(12px + 48px);
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    resize: none;
}

.tok-key {
    color: #82aaff;
}

.tok-str {
    color: #ffcb6b;
}

.tok-num {
    color: #bae67e;
}

.tok-bool {
    color: #c792ea;
}

.tok-null {
    color: #89ddff;
}

.tok-punc {
    color: var(--muted);
}

.coll-toggle {
    display: inline-block;
    width: 1em;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    margin-right: 6px;
}

.coll-toggle.disabled {
    cursor: default;
    color: transparent;
}

.prop .coll-summary {
    display: none;
}

.prop.collapsed .coll-content {
    display: none;
}

.prop.collapsed .coll-summary {
    display: inline;
}