.json-compare-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    height: 46.8vh;
    overflow: hidden;
}

.json-compare-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.json-compare-editor {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    overflow: hidden;
    background: #fff;
}

.json-compare-gutter {
    padding: 6px 10px 6px 12px;
    border-right: 1px solid #ddd;
    color: #999;
    font-family: monospace, Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 22px;
    white-space: pre;
    overflow: hidden;
    user-select: none;
    background: #f6f6f6;
}

.json-compare-editable {
    padding: 6px 10px;
    overflow: auto;
    white-space: pre;
    font-family: monospace, Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 22px;
    color: #444;
    background: #fff;
    outline: none;
    min-width: 0;
}

.json-compare-editable:focus {
    outline: none;
}

.json-compare-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.tool-form-json-compare.fullscreen .form-field {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tool-form-json-compare.fullscreen .json-compare-split {
    flex: 1;
    height: 100% !important;
    min-height: 0;
}

.tool-form-json-compare.fullscreen .json-compare-actions {
    margin-top: 10px;
}

.tool-form-json-compare.fullscreen .json-compare-legend {
    order: 3;
    flex-shrink: 0;
    margin-top: 8px;
}

.json-compare-legend {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow-x: auto;
}

.json-compare-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.json-compare-legend-sample {
    display: inline;
    min-width: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.4;
    text-align: left;
    flex-shrink: 0;
}

.json-compare-legend-sample.is-removed,
.json-diff-removed {
    color: red;
    background: transparent;
    font-weight: bold;
}

.json-compare-legend-sample.is-changed,
.json-diff-changed {
    color: orange;
    background: transparent;
    font-weight: bold;
}

.json-compare-legend-sample.is-added,
.json-diff-added {
    color: green;
    background: transparent;
    font-weight: bold;
}

.json-diff-error {
    color: red;
    font-weight: bold;
}

@media screen and (max-width: 768px) {
    .json-compare-split {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 46.8vh;
    }

    .json-compare-panel {
        min-height: 220px;
    }

    .json-compare-legend {
        justify-content: flex-start;
        padding-bottom: 2px;
    }
}
