/* 仅首页 index.html：编辑器铺满视口，左右两个独立面板 */

body.page-json-home {
    overflow-x: hidden;
}

body.page-json-home .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.page-json-home #page-sidebar,
body.page-json-home .page-sidebar {
    display: none !important;
}

/* 首页不走通用 tool-header-split，最大化在右侧输出区工具栏 */
body.page-json-home .tool-form-json > .tool-header-split {
    display: none;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar .json-toolbar-fullscreen {
    margin-left: auto;
}

body.page-json-home .json-home-convert-btn {
    width: auto;
    min-width: 40px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #555;
    opacity: 0.8;
}

body.page-json-home .json-home-convert-btn:hover {
    color: #555;
    opacity: 1;
}

body.page-json-home .json-home-convert-btn span {
    line-height: 1;
}

/* 收藏星标与最大化垂直居中对齐 */
body.page-json-home .json-editor-fullbleed .json-output-toolbar {
    align-items: center;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar .page-collect-wrap-toolbar,
body.page-json-home .json-editor-fullbleed .json-output-toolbar .json-toolbar-fullscreen {
    align-self: center;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar .page-collect-wrap-toolbar .page-collect-box {
    width: 32px;
    height: 32px;
    background: transparent !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar .page-collect-wrap-toolbar .w-collection-img,
body.page-json-home .json-editor-fullbleed .json-output-toolbar .json-toolbar-fullscreen .fullscreen-img {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0;
}

body.page-json-home .my-class {
    padding-bottom: 1.5rem;
}

body.page-json-home .my-class > .content {
    margin-bottom: 0;
    position: relative;
}

body.page-json-home .my-class > .tool-info {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px 1rem;
    box-sizing: border-box;
}

/* 最大化时隐藏下方介绍，避免占屏 */
body.page-json-home .my-class:has(.tool-form-json.fullscreen) > .tool-info {
    display: none;
}

body.page-json-home .tool-form-json {
    margin-bottom: 0;
}

/* 首页编辑区全宽：隐藏左右栏 */
body.page-json-home .main-three-part-grid-container {
    grid-template-columns: minmax(0, 1fr);
}

body.page-json-home .main-three-part-grid-container > div:first-child,
body.page-json-home .main-three-part-grid-container > div:last-child {
    display: none;
}

body.page-json-home .json-editor-fullbleed {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

body.page-json-home .json-editor-fullbleed .form-field {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.page-json-home .json-editor-fullbleed #container.json-editor-workspace {
    --json-home-editor-gap-top: 18px;
    --json-home-editor-gap-bottom: 0px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(
        100dvh - var(--json-home-editor-top, 48px) -
        var(--json-home-editor-gap-top) - var(--json-home-editor-gap-bottom)
    );
    min-height: 320px;
    padding: var(--json-home-editor-gap-top) 12px var(--json-home-editor-gap-bottom);
    box-sizing: border-box;
    position: relative;
}

body.page-json-home .json-editor-main-row {
    --json-home-rail-toolbar-offset: 42px;
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    align-items: stretch;
}

body.page-json-home .json-editor-split {
    height: auto !important;
}

/*
 * 双栏用 grid + subgrid：左右工具栏同行等高，
 * 中间分隔条可拖动；右侧换行时左侧空工具栏同步撑高。
 */
body.page-json-home .json-editor-fullbleed .json-editor-main-row > .json-editor-split {
    --json-home-divider-width: 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--json-home-divider-width) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    height: auto !important;
    column-gap: 0;
    row-gap: 0;
    padding: 0;
    align-items: stretch;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input {
    grid-column: 1;
}

body.page-json-home .json-editor-fullbleed .json-home-divider {
    grid-column: 2;
    grid-row: 2;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
    grid-column: 3;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input,
body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / -1;
    min-height: 0;
    min-width: 0;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    align-self: stretch;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
    min-height: 0;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input > .json-input-toolbar,
body.page-json-home .json-editor-fullbleed .json-editor-panel-output > .json-output-toolbar {
    grid-row: 1;
    min-height: 40px;
    margin-bottom: 2px;
    box-sizing: border-box;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output > .json-output-toolbar {
    padding-right: 4px;
}

body.page-json-home .json-toolbar-icon-btn svg .json-home-icon-text {
    fill: #555;
    stroke: none;
    opacity: 0.9;
}

body.page-json-home #json-example-btn svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.85;
    opacity: 0.88;
}

body.page-json-home #json-example-btn:hover svg {
    opacity: 1;
}

body.page-json-home #json-unescape-btn svg,
body.page-json-home #json-unicode-cn-btn svg {
    width: 22px;
    height: 22px;
}

body.page-json-home .json-toolbar-icon-btn:hover svg .json-home-icon-text {
    opacity: 1;
}

/* 示例：主按钮加载默认，箭头打开下拉 */
body.page-json-home .json-example-split {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 4px;
}

body.page-json-home .json-example-split .json-toolbar-icon-btn {
    border-radius: 4px 0 0 4px;
}

body.page-json-home .json-example-split .json-example-chevron {
    width: 20px;
    border-radius: 0 4px 4px 0;
    margin-left: -2px;
}

body.page-json-home .json-example-split .json-example-chevron svg {
    width: 14px;
    height: 14px;
}

body.page-json-home .json-example-split.is-open .json-example-chevron,
body.page-json-home .json-example-split.is-open #json-example-btn {
    background: #ececec;
}

/* 示例右侧能力提示：居中落在工具栏剩余空白，可点加载大示例 */
body.page-json-home .json-input-toolbar .json-toolbar-left {
    flex-wrap: nowrap;
}

body.page-json-home .json-example-capability {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    margin: 0;
    padding: 0 8px;
    border: none;
    background: transparent;
    min-width: 0;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

body.page-json-home .json-example-capability-main {
    font-size: 11px;
    color: #0958d9;
    white-space: nowrap;
    transition: color 0.15s ease;
}

body.page-json-home .json-example-capability-main em {
    font-style: normal;
    font-weight: 700;
    color: inherit;
}

body.page-json-home .json-example-capability:hover .json-example-capability-main,
body.page-json-home .json-example-capability:focus-visible .json-example-capability-main {
    color: #002c8c;
}

body.page-json-home .json-example-capability:focus-visible {
    outline: none;
}

body.page-json-home .json-example-capability:focus-visible .json-example-capability-main {
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 720px) {
    body.page-json-home .json-example-capability {
        display: none;
    }
}

body.page-json-home .json-example-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    min-width: 280px;
    max-width: min(360px, 80vw);
    max-height: min(420px, 60vh);
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

body.page-json-home .json-example-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #222;
    box-sizing: border-box;
}

body.page-json-home .json-example-item:hover,
body.page-json-home .json-example-item:focus-visible {
    background: #f5f7fa;
    outline: none;
}

body.page-json-home .json-example-item-mark {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f0f2f5;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1;
}

body.page-json-home .json-example-item-mark[data-tone="blue"] {
    background: #e8f3ff;
    color: #1677ff;
}

body.page-json-home .json-example-item-mark[data-tone="violet"] {
    background: #f3e8ff;
    color: #7c3aed;
}

body.page-json-home .json-example-item-mark[data-tone="teal"] {
    background: #e6fffb;
    color: #0f766e;
}

body.page-json-home .json-example-item-mark[data-tone="green"] {
    background: #edfce8;
    color: #389e0d;
}

body.page-json-home .json-example-item-mark[data-tone="cyan"] {
    background: #e6f7ff;
    color: #0891b2;
}

body.page-json-home .json-example-item-mark[data-tone="amber"] {
    background: #fff7e6;
    color: #d48806;
}

body.page-json-home .json-example-item-mark[data-tone="rose"] {
    background: #fff1f0;
    color: #cf1322;
    font-size: 9px;
    letter-spacing: -0.3px;
}

body.page-json-home .json-example-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding-top: 1px;
}

body.page-json-home .json-example-item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
}

body.page-json-home .json-example-item-desc {
    font-size: 12px;
    line-height: 1.4;
    color: #888;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-input {
    overflow: visible;
}

body.page-json-home .json-editor-fullbleed .json-input-toolbar {
    overflow: visible;
    position: relative;
    z-index: 3;
}

/* 展开到指定层 */
body.page-json-home .json-fold-level-split {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

body.page-json-home .json-fold-level-split.is-open #json-fold-level-btn {
    background: #ececec;
}

body.page-json-home .json-fold-level-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 45;
    min-width: 148px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

body.page-json-home .json-fold-level-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #222;
    font-size: 13px;
    line-height: 1.3;
    box-sizing: border-box;
}

body.page-json-home .json-fold-level-item:hover,
body.page-json-home .json-fold-level-item:focus-visible {
    background: #f5f7fa;
    outline: none;
}

body.page-json-home .json-editor-fullbleed .json-output-toolbar {
    overflow: visible;
    position: relative;
    z-index: 2;
}

body.page-json-home .json-editor-fullbleed #input-editor-host {
    grid-row: 2;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

body.page-json-home .json-editor-fullbleed #input-editor-host .ln-textarea,
body.page-json-home .json-editor-fullbleed #input-editor-host .cm-editor {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

body.page-json-home .json-editor-fullbleed .json-editor-panel-output .wd-editor,
body.page-json-home .json-editor-fullbleed .json-editor-panel-output .output-panel {
    grid-row: 2;
    min-height: 0;
    height: auto;
}

body.page-json-home .json-home-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    background: #e8e8e8;
    border: none;
    border-radius: 2px;
    box-sizing: border-box;
    user-select: none;
    touch-action: none;
}

body.page-json-home .json-home-divider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -5px;
    right: -5px;
    cursor: col-resize;
    z-index: 2;
}

body.page-json-home .json-home-divider:hover,
body.page-json-home.is-json-home-resizing .json-home-divider {
    background: #d6e8ff;
}

body.page-json-home .json-home-split-ratio {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    transform: translate(-50%, -50%);
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(22, 119, 255, 0.95);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.28);
}

body.page-json-home .json-home-split-ratio small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.92;
}

body.page-json-home.is-json-home-resizing {
    cursor: col-resize;
    user-select: none;
}

/* 左侧竖条：历史 / 保存（收起态偏窄、次要视觉） */
body.page-json-home .json-history-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 30px;
    width: 30px;
    min-height: 0;
    align-self: stretch;
    margin-top: var(--json-home-rail-toolbar-offset);
    margin-right: 0;
    padding: 2px 0 6px;
    box-sizing: border-box;
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-right: none;
    border-radius: 4px 0 0 4px;
    gap: 1px;
}

body.page-json-home .json-history-rail-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    width: 26px;
    min-height: 0;
    padding: 5px 0 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #8a8a8a;
    cursor: pointer;
    box-sizing: border-box;
}

body.page-json-home .json-history-rail-btn:hover {
    background: #ececec;
    color: #555;
}

body.page-json-home .json-history-rail-btn.is-active {
    background: #e8f3ff;
    color: #1677ff;
}

body.page-json-home .json-history-rail-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
}

body.page-json-home .json-history-rail-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.06em;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.1;
    user-select: none;
}

body.page-json-home .json-history-rail-badge {
    position: static;
    margin-top: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #52c41a;
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
}

/* 历史记录展开面板 */
body.page-json-home .json-history-panel {
    display: none;
    flex-direction: column;
    width: 300px;
    flex: 0 0 300px;
    min-height: 0;
    align-self: stretch;
    margin-top: var(--json-home-rail-toolbar-offset, 42px);
    margin-right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-right: none;
    border-radius: 4px 0 0 4px;
    box-sizing: border-box;
    overflow: hidden;
}

body.page-json-home .json-editor-workspace.is-history-open .json-history-panel {
    display: flex;
    border-left: none;
    border-radius: 0;
}

/* 收起时竖条贴左编辑器左边 */
body.page-json-home .json-editor-workspace:not(.is-history-open) .json-editor-panel-input #input-editor-host {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

body.page-json-home .json-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

body.page-json-home .json-history-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

body.page-json-home .json-history-title span {
    font-weight: 500;
    color: #888;
}

body.page-json-home .json-history-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

body.page-json-home .json-history-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-json-home .json-history-icon-btn:hover {
    background: #f0f0f0;
}

body.page-json-home .json-history-icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: #666;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.page-json-home .json-history-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f0faf4;
    color: #2f6b45;
    font-size: 12px;
    line-height: 1.45;
    flex-shrink: 0;
}

body.page-json-home .json-history-privacy-icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    border-radius: 50%;
    background: #3cb371;
    box-shadow: inset 0 0 0 2px #f0faf4;
    position: relative;
}

body.page-json-home .json-history-privacy-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

body.page-json-home .json-history-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 0 4px;
}

body.page-json-home .json-history-empty {
    padding: 24px 16px;
    color: #999;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

body.page-json-home .json-history-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 28px 10px 10px;
    border: none;
    border-bottom: 1px solid #f2f2f2;
    background: transparent;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

body.page-json-home .json-history-item:hover,
body.page-json-home .json-history-item.is-active {
    background: #f7f9fc;
}

body.page-json-home .json-history-item-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border-radius: 6px;
    background: #eef3f9;
    color: #4a6fa5;
    font-size: 10px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-json-home .json-history-item-num {
    font-size: 12px;
    font-weight: 700;
    color: #5b7c99;
    letter-spacing: -0.02em;
}

body.page-json-home .json-history-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

body.page-json-home .json-history-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.page-json-home .json-history-item-meta {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
}

body.page-json-home .json-history-item-del {
    position: absolute;
    top: 8px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    color: #aaa;
    font-size: 16px;
    line-height: 18px;
    text-align: center;
    opacity: 0;
}

body.page-json-home .json-history-item:hover .json-history-item-del {
    opacity: 1;
}

body.page-json-home .json-history-item-del:hover {
    background: #eee;
    color: #666;
}

body.page-json-home .json-history-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

body.page-json-home .json-history-pager-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

body.page-json-home .json-history-pager-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

body.page-json-home .json-history-pager-select-wrap select {
    height: 28px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    color: #555;
    font-size: 12px;
    padding: 0 4px;
    max-width: 88px;
}


/* 拖放上传高亮 */
body.page-json-home .json-editor-workspace.is-dragover #input-editor-host,
body.page-json-home .json-editor-workspace.is-dragover .json-editor-panel-output .wd-editor {
    border-color: #4a90d9;
    box-shadow: inset 0 0 0 1px #4a90d9;
}

body.page-json-home .json-editor-workspace.is-dragover::after {
    content: "松开以载入 JSON 文件";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    padding: 10px 16px;
    border-radius: 6px;
    background: rgba(22, 119, 255, 0.92);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

/* 全屏：fullbleed 必须参与 tool-form 的 flex 撑高 */
body.page-json-home .tool-form-json.fullscreen .json-editor-fullbleed {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

body.page-json-home .tool-form-json.fullscreen .json-editor-fullbleed .form-field {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.page-json-home .tool-form-json.fullscreen #container.json-editor-workspace {
    flex: 1 1 0;
    height: auto !important;
    min-height: 0;
    --json-home-editor-gap-top: 8px;
    --json-home-editor-gap-bottom: 0px;
    padding: var(--json-home-editor-gap-top) 0 var(--json-home-editor-gap-bottom);
}

body.page-json-home .tool-form-json.fullscreen #container.json-editor-workspace > .json-editor-main-row {
    flex: 1 1 0;
    min-height: 0;
}

body.page-json-home .tool-form-json.fullscreen #container.json-editor-workspace .json-editor-split {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
}

@media screen and (max-width: 640px) {
    body.page-json-home .json-editor-fullbleed #container.json-editor-workspace {
        --json-home-editor-gap-top: 8px;
        --json-home-editor-gap-bottom: 0px;
        min-height: 280px;
        padding-left: 8px;
        padding-right: 8px;
    }

    body.page-json-home .json-history-rail {
        flex-basis: 28px;
        width: 28px;
        margin-right: 0;
    }

    body.page-json-home .json-history-panel {
        position: absolute;
        left: 28px;
        top: 42px;
        bottom: 32px;
        z-index: 20;
        width: min(300px, calc(86vw - 28px));
        margin-top: 0;
        margin-right: 0;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    }

    body.page-json-home .json-home-divider {
        display: none;
    }

    body.page-json-home .json-editor-fullbleed .json-editor-main-row > .json-editor-split {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(180px, 1fr) auto minmax(180px, 1fr);
    }

    body.page-json-home .json-editor-fullbleed .json-editor-panel-input,
    body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
        grid-column: 1;
        grid-row: auto;
        display: flex;
        flex-direction: column;
        grid-template-rows: none;
    }

    body.page-json-home .json-editor-fullbleed .json-editor-panel-input {
        grid-row: 1 / 3;
    }

    body.page-json-home .json-editor-fullbleed .json-editor-panel-output {
        grid-row: 3 / 5;
    }

    body.page-json-home .json-editor-fullbleed #input-editor-host,
    body.page-json-home .json-editor-fullbleed .json-editor-panel-output .wd-editor,
    body.page-json-home .json-editor-fullbleed .json-editor-panel-output .output-panel {
        grid-row: auto;
        flex: 1 1 auto;
    }
}
