.esq-page {
    --esq-ink: #172033;
    --esq-muted: #69758a;
    --esq-line: #dce3ee;
    --esq-soft: #f5f7fb;
    --esq-blue: #2864f0;
    --esq-blue-dark: #1e4fc6;
    --esq-code: #0d1626;
    --esq-code-line: #26344b;
    width: min(1460px, calc(100% - 32px));
    margin: 0 auto;
    color: var(--esq-ink);
}

.esq-page *, .esq-page *::before, .esq-page *::after { box-sizing: border-box; }
.esq-page button, .esq-page input, .esq-page select, .esq-page textarea { font: inherit; }

.esq-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 38px 4px 24px; }
.esq-hero > div:first-child { max-width: 780px; }
.esq-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 10px; color: #56637a; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.esq-eyebrow i { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #f4ae18 0 48%, #27a9be 48%); font-size: .65rem; font-style: normal; letter-spacing: 0; box-shadow: 0 7px 18px rgba(30, 79, 198, .18); }
.esq-hero h1 { margin: 0 0 9px; color: #121a2a; font-size: clamp(1.85rem, 3vw, 2.65rem); font-weight: 800; letter-spacing: -.045em; }
.esq-hero p { margin: 0; color: var(--esq-muted); font-size: 1rem; line-height: 1.6; }
.esq-local-note { display: flex; min-width: 260px; align-items: center; gap: 11px; padding: 12px 15px; border: 1px solid #dce7df; border-radius: 13px; background: #f5fbf7; }
.esq-local-note > span { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #27a35e; box-shadow: 0 0 0 5px rgba(39, 163, 94, .11); }
.esq-local-note strong, .esq-local-note small { display: block; }
.esq-local-note strong { font-size: .8rem; }
.esq-local-note small { margin-top: 2px; color: #68766c; font-size: .7rem; }

.esq-presets { display: flex; align-items: stretch; gap: 18px; margin-bottom: 18px; }
.esq-section-intro { width: 150px; flex: 0 0 150px; padding: 7px 0; }
.esq-section-intro > span, .esq-section-label { color: #8a95a8; font-size: .65rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.esq-section-intro h2 { margin: 4px 0 0; font-size: 1rem; font-weight: 800; }
.esq-preset-list { display: grid; min-width: 0; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.esq-preset-list button { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--esq-line); border-radius: 12px; color: var(--esq-ink); background: #fff; text-align: left; cursor: pointer; transition: border-color .16s, box-shadow .16s, transform .16s; }
.esq-preset-list button:hover { border-color: #9ab5fa; box-shadow: 0 8px 20px rgba(48, 76, 128, .09); transform: translateY(-1px); }
.esq-preset-list button > span { min-width: 0; }
.esq-preset-list i { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--esq-blue); background: #eef3ff; font-size: .76rem; font-style: normal; font-weight: 800; }
.esq-preset-list strong, .esq-preset-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esq-preset-list strong { font-size: .78rem; }
.esq-preset-list small { margin-top: 2px; color: #7d8799; font-size: .65rem; }

.esq-workbench { display: grid; overflow: hidden; min-height: 680px; grid-template-columns: minmax(0, 1.2fr) minmax(440px, .8fr); border: 1px solid #cfd8e6; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(28, 44, 72, .1); }
.esq-builder { min-width: 0; border-right: 1px solid var(--esq-line); }
.esq-preview { min-width: 0; background: var(--esq-code); }
.esq-panel-head { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--esq-line); }
.esq-panel-head > div:first-child > span, .esq-panel-head > div:first-child > strong { display: block; }
.esq-panel-head > div:first-child > span { margin-bottom: 3px; color: #8a95a8; font-size: .62rem; font-weight: 800; letter-spacing: .13em; }
.esq-panel-head > div:first-child > strong { font-size: .9rem; }
.esq-head-actions { display: flex; align-items: center; gap: 7px; }
.esq-head-actions button, .esq-add-actions button, .esq-block-head > button, .esq-dialog footer button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 7px 11px; border: 1px solid #d5ddea; border-radius: 9px; color: #526077; background: #fff; font-size: .72rem; font-weight: 750; cursor: pointer; }
.esq-head-actions button:hover, .esq-add-actions button:hover, .esq-block-head > button:hover { border-color: #9ab5fa; color: var(--esq-blue); }
.esq-head-actions button.is-primary, .esq-add-actions button.is-primary, .esq-dialog button.is-primary { border-color: var(--esq-blue); color: #fff; background: var(--esq-blue); }
.esq-head-actions button.is-primary:hover, .esq-add-actions button.is-primary:hover, .esq-dialog button.is-primary:hover { border-color: var(--esq-blue-dark); color: #fff; background: var(--esq-blue-dark); }

.esq-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--esq-line); background: #fbfcfe; }
.esq-tabs button { display: flex; align-items: center; gap: 6px; padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; color: #718097; background: transparent; font-size: .74rem; font-weight: 800; cursor: pointer; }
.esq-tabs button:hover { color: var(--esq-ink); }
.esq-tabs button.is-active { border-bottom-color: var(--esq-blue); color: var(--esq-blue); }
.esq-tabs button span { min-width: 19px; padding: 2px 5px; border-radius: 10px; color: #718097; background: #edf1f7; font-size: .58rem; text-align: center; }
.esq-tabs button.is-active span { color: var(--esq-blue); background: #e8efff; }
.esq-tab-panel { padding: 17px; }

.esq-request-settings { display: grid; grid-template-columns: minmax(260px, 1fr) 84px 84px; gap: 9px; margin-bottom: 20px; }
.esq-page label > span { display: block; margin-bottom: 5px; color: #7b879a; font-size: .62rem; font-weight: 800; letter-spacing: .05em; }
.esq-page input, .esq-page select, .esq-page textarea { width: 100%; border: 1px solid #d5ddea; border-radius: 9px; color: var(--esq-ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.esq-page input, .esq-page select { height: 38px; padding: 7px 9px; font-size: .77rem; }
.esq-page textarea { padding: 12px; font: .73rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.esq-page input:focus, .esq-page select:focus, .esq-page textarea:focus { border-color: #7fa3fb; box-shadow: 0 0 0 3px rgba(40, 100, 240, .11); }
.esq-index-field > div { display: flex; height: 38px; overflow: hidden; align-items: center; border: 1px solid #d5ddea; border-radius: 9px; background: #fff; }
.esq-index-field > div:focus-within { border-color: #7fa3fb; box-shadow: 0 0 0 3px rgba(40, 100, 240, .11); }
.esq-index-field code { align-self: stretch; padding: 10px 8px; color: #1f8655; background: #edf8f2; font-size: .62rem; font-weight: 850; }
.esq-index-field input { min-width: 80px; height: 36px; padding-right: 3px; border: 0; box-shadow: none !important; }
.esq-index-field b { padding-right: 10px; color: #8290a4; font: .67rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }

.esq-block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.esq-block-head strong, .esq-block-head small { display: block; }
.esq-block-head strong { font-size: .84rem; }
.esq-block-head small { margin-top: 3px; color: #8893a5; font-size: .65rem; }
.esq-guide { position: relative; }
.esq-guide summary { color: var(--esq-blue); font-size: .68rem; font-weight: 800; list-style: none; cursor: pointer; }
.esq-guide summary::-webkit-details-marker { display: none; }
.esq-guide-popover { position: absolute; z-index: 10; top: 27px; right: 0; width: min(720px, 78vw); max-height: 440px; overflow: auto; padding: 14px; border: 1px solid var(--esq-line); border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(22, 36, 60, .18); }
.esq-guide-popover p { margin: 0 0 10px; color: var(--esq-muted); font-size: .7rem; }
.esq-guide-popover table { width: 100%; border-collapse: collapse; font-size: .65rem; }
.esq-guide-popover th, .esq-guide-popover td { padding: 7px; border: 1px solid #e2e7ef; vertical-align: top; }
.esq-guide-popover code { color: #c03b63; }

.esq-clause { position: relative; display: grid; grid-template-columns: 150px 126px minmax(120px, .8fr) minmax(150px, 1.15fr) 32px; gap: 7px; align-items: start; margin-bottom: 8px; padding: 10px; border: 1px solid #dde4ef; border-radius: 11px; background: #fbfcfe; }
.esq-clause:hover { border-color: #c6d3e7; }
.esq-clause .esq-value-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.esq-clause [data-remove], .esq-list-row [data-remove] { display: grid; width: 32px; height: 38px; place-items: center; border: 0; border-radius: 8px; color: #a66273; background: transparent; font-size: 1rem; cursor: pointer; }
.esq-clause [data-remove]:hover, .esq-list-row [data-remove]:hover { color: #d7375b; background: #fff0f3; }
.esq-clause-hint { grid-column: 2 / -1; min-height: 0; color: #8994a6; font-size: .61rem; line-height: 1.35; }
.esq-group { margin-bottom: 9px; padding: 10px; border: 1px solid #b9c9e4; border-left: 3px solid var(--esq-blue); border-radius: 11px; background: #f7f9fd; }
.esq-group > .esq-group-head { display: grid; grid-template-columns: 150px 126px 1fr 32px; gap: 7px; align-items: center; }
.esq-group-title { color: #79869a; font-size: .64rem; line-height: 1.35; }
.esq-group-children { margin: 10px 0 0 14px; padding-left: 10px; border-left: 1px dashed #b8c7df; }
.esq-group-children .esq-clause { grid-template-columns: 130px 115px minmax(105px, .8fr) minmax(130px, 1fr) 32px; }
.esq-group-actions { display: flex; gap: 6px; margin-top: 8px; }
.esq-group-actions button { padding: 6px 9px; border: 1px solid #cfdaeb; border-radius: 8px; color: #52657f; background: #fff; font-size: .65rem; font-weight: 750; cursor: pointer; }
.esq-empty { margin: 0 0 10px; padding: 15px; border: 1px dashed #ccd6e5; border-radius: 10px; color: #7f8a9b; background: #fafbfd; font-size: .72rem; text-align: center; }
.esq-add-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.esq-inline-setting { width: 260px; margin-top: 12px; }
.esq-inline-setting label { display: block; margin-bottom: 5px; color: #768298; font: .65rem ui-monospace, SFMono-Regular, Menlo, monospace; }

.esq-advanced { margin-top: 17px; border-top: 1px solid #edf0f5; }
.esq-advanced summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 1px 4px; color: #627087; font-size: .7rem; font-weight: 800; list-style: none; cursor: pointer; }
.esq-advanced summary::-webkit-details-marker { display: none; }
.esq-advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 9px; }
.esq-check { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #dce3ed; border-radius: 9px; }
.esq-check input { width: 16px; height: 16px; flex: 0 0 auto; }
.esq-check span { margin: 0 !important; letter-spacing: 0 !important; }
.esq-check strong, .esq-check small { display: block; }
.esq-check strong { color: #506078; font: .65rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.esq-check small { margin-top: 2px; color: #8a95a5; font-size: .58rem; font-weight: 500; }

.esq-extra-block + .esq-extra-block { margin-top: 24px; padding-top: 19px; border-top: 1px solid #e3e8f0; }
.esq-list-row { display: grid; grid-template-columns: minmax(130px, 1fr) 130px minmax(130px, 1fr) 110px 32px; gap: 7px; margin-bottom: 8px; padding: 9px; border: 1px solid #dde4ed; border-radius: 10px; background: #fbfcfe; }
.esq-sort-row { grid-template-columns: minmax(150px, 1fr) 120px 32px; }
.esq-schema-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.esq-schema-intro strong { font-size: .84rem; }
.esq-schema-intro p { max-width: 680px; margin: 4px 0 0; color: var(--esq-muted); font-size: .68rem; line-height: 1.5; }
.esq-schema-intro > span { flex: 0 0 auto; font-size: .67rem; }
.esq-mapping-fields { max-height: 160px; overflow: auto; margin-top: 12px; }
.esq-mapping-fields .badge { display: inline-block; margin: 0 4px 4px 0; padding: 5px 7px; border: 1px solid #d8e0eb !important; border-radius: 6px; color: #34445b !important; background: #f7f9fc !important; font: .61rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.esq-mapping-fields .text-muted { color: #8a96a9 !important; }

.esq-preview .esq-panel-head { border-bottom-color: var(--esq-code-line); }
.esq-preview .esq-panel-head > div:first-child > span { color: #60708b; }
.esq-preview .esq-panel-head > div:first-child > strong { color: #edf3fd; }
.esq-preview .esq-head-actions button { border-color: #2b3950; color: #aebad0; background: #162238; }
.esq-preview .esq-head-actions button.is-primary { border-color: #356df1; color: #fff; background: #2864f0; }
.esq-output-tabs { display: flex; gap: 4px; padding: 8px 13px; border-bottom: 1px solid var(--esq-code-line); }
.esq-output-tabs button { padding: 6px 10px; border: 0; border-radius: 7px; color: #7888a3; background: transparent; font: 700 .65rem ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.esq-output-tabs button:hover { color: #d7e2f4; }
.esq-output-tabs button.active { color: #dce8ff; background: #1e3152; }
.esq-editor-wrap { border-bottom: 1px solid var(--esq-code-line); }
.esq-editor-wrap > textarea { min-height: 410px; border: 0; border-radius: 0; color: #dce6f5; background: var(--esq-code); }
.esq-preview .CodeMirror { height: 410px; color: #dce6f5; background: var(--esq-code); font: .72rem/1.62 ui-monospace, SFMono-Regular, Menlo, monospace; }
.esq-preview .CodeMirror-gutters { border-right-color: #223048; background: #09111f; }
.esq-preview .CodeMirror-linenumber { color: #465773; }
.esq-preview .CodeMirror-cursor { border-left-color: #fff; }
.esq-preview .CodeMirror-selected { background: #263b60; }
.esq-preview .cm-property { color: #82b4ff; }
.esq-preview .cm-string { color: #9ed8a7; }
.esq-preview .cm-number, .esq-preview .cm-atom { color: #efbb79; }
.esq-validation-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px 7px; color: #d5deec; font-size: .7rem; }
.esq-validation-head span { padding: 2px 7px; border-radius: 10px; color: #93a1b8; background: #18243a; font-size: .58rem; }
.esq-validation { max-height: 150px; overflow: auto; padding: 0 15px 12px; color: #aebbd0; font-size: .67rem; line-height: 1.45; }
.esq-validation > span { display: flex; align-items: center; gap: 6px; color: #7fcf9d !important; }
.esq-validation ul { margin: 0; padding: 0; list-style: none; }
.esq-validation li { margin-bottom: 6px !important; }
.esq-validation .badge { display: inline-block; margin-right: 6px; padding: 3px 5px; border-radius: 5px; font-size: .55rem; }
.esq-validation .bg-danger { color: #ffc2ce; background: rgba(216, 55, 91, .22) !important; }
.esq-validation .bg-warning { color: #ffd78b !important; background: rgba(221, 153, 35, .19) !important; }
.esq-validation .btn { padding: 2px 5px !important; border: 1px solid #4469b1; border-radius: 5px; color: #9ebcff; background: transparent; font-size: .58rem; }
.esq-preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 15px; border-top: 1px solid var(--esq-code-line); color: #667792; }
.esq-preview-footer span { display: flex; align-items: center; gap: 7px; font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.esq-preview-footer i { width: 7px; height: 7px; border-radius: 50%; background: #3fca7d; box-shadow: 0 0 0 4px rgba(63, 202, 125, .1); }
.esq-preview-footer small { font-size: .58rem; }

.esq-dialog { width: min(720px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 17px; color: var(--esq-ink); box-shadow: 0 30px 90px rgba(12, 24, 44, .33); }
.esq-dialog::backdrop { background: rgba(13, 22, 38, .62); backdrop-filter: blur(3px); }
.esq-dialog form { padding: 20px; }
.esq-dialog header { display: flex; align-items: flex-start; justify-content: space-between; }
.esq-dialog header span { color: #8b96a8; font-size: .6rem; font-weight: 800; letter-spacing: .12em; }
.esq-dialog h2 { margin: 4px 0 0; font-size: 1.2rem; }
.esq-dialog header > button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #68758a; background: #f0f3f8; font-size: 1.25rem; cursor: pointer; }
.esq-dialog p { margin: 10px 0; color: var(--esq-muted); font-size: .74rem; line-height: 1.5; }
.esq-dialog textarea { min-height: 300px; color: #dce6f5; background: var(--esq-code); }
.esq-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.esq-import-status { min-height: 20px; padding-top: 6px; color: #cf3859; font-size: .68rem; }

.esq-about { display: grid; grid-template-columns: minmax(260px, .7fr) 1.3fr; gap: 42px; padding: 48px 4px 22px; }
.esq-about h2 { margin: 6px 0 10px; font-size: 1.45rem; letter-spacing: -.025em; }
.esq-about > div:first-child p { margin: 0; color: var(--esq-muted); font-size: .82rem; line-height: 1.65; }
.esq-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.esq-feature-grid article { padding: 15px; border: 1px solid var(--esq-line); border-radius: 12px; }
.esq-feature-grid i { display: grid; width: 35px; height: 35px; margin-bottom: 12px; place-items: center; border-radius: 9px; color: var(--esq-blue); background: #edf3ff; font: 800 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.esq-feature-grid strong { font-size: .78rem; }
.esq-feature-grid p { margin: 5px 0 0; color: var(--esq-muted); font-size: .68rem; line-height: 1.5; }
.esq-page > .seo-texts { width: min(980px, 100%); margin: 15px auto 35px; }
.esq-page .d-none { display: none !important; }

@media (max-width: 1120px) {
    .esq-workbench { grid-template-columns: 1fr; }
    .esq-builder { border-right: 0; }
    .esq-preview { border-top: 1px solid var(--esq-line); }
    .esq-preview .CodeMirror, .esq-editor-wrap > textarea { height: 360px; min-height: 360px; }
    .esq-preset-list { grid-template-columns: repeat(2, 1fr); }
    .esq-presets { align-items: flex-start; }
}

@media (max-width: 760px) {
    .esq-page { width: min(100% - 20px, 1460px); }
    .esq-hero { align-items: flex-start; padding: 24px 1px 18px; }
    .esq-local-note { display: none; }
    .esq-hero h1 { font-size: 1.8rem; }
    .esq-hero p { font-size: .85rem; }
    .esq-presets { display: block; }
    .esq-section-intro { width: auto; padding: 0 1px 8px; }
    .esq-preset-list { display: flex; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; }
    .esq-preset-list button { min-width: 230px; scroll-snap-align: start; }
    .esq-workbench { min-height: 0; border-radius: 13px; }
    .esq-panel-head { min-height: 62px; padding: 11px 12px; }
    .esq-head-actions button { padding: 6px 8px; }
    .esq-head-actions button span { display: none; }
    .esq-tab-panel { padding: 12px; }
    .esq-tabs { overflow-x: auto; padding-left: 7px; }
    .esq-tabs button { flex: 0 0 auto; padding: 9px; }
    .esq-request-settings { grid-template-columns: 1fr 82px 82px; }
    .esq-index-field { grid-column: 1 / -1; }
    .esq-block-head { align-items: flex-start; }
    .esq-block-head small { max-width: 230px; }
    .esq-guide-popover { position: fixed; top: 100px; right: 10px; left: 10px; width: auto; max-height: 70vh; }
    .esq-clause { grid-template-columns: 1fr 1fr 32px; }
    .esq-clause > select[data-k="occur"] { grid-column: 1; }
    .esq-clause > select[data-k="type"] { grid-column: 2; }
    .esq-clause > [data-remove] { grid-column: 3; grid-row: 1; }
    .esq-clause > input[data-k="field"] { grid-column: 1 / 2; }
    .esq-clause > .esq-value, .esq-clause > .esq-value-range { grid-column: 2 / 4; }
    .esq-clause-hint { grid-column: 1 / -1; }
    .esq-group > .esq-group-head { grid-template-columns: 1fr 1fr 32px; }
    .esq-group-title { display: none; }
    .esq-group-children { margin-left: 3px; padding-left: 7px; }
    .esq-group-children .esq-clause { grid-template-columns: 1fr 1fr 32px; }
    .esq-advanced-grid { grid-template-columns: 1fr; }
    .esq-list-row, .esq-sort-row { grid-template-columns: 1fr 1fr 32px; }
    .esq-list-row > input:first-child { grid-column: 1 / 3; }
    .esq-list-row > [data-remove] { grid-column: 3; grid-row: 1; }
    .esq-schema-intro { display: block; }
    .esq-schema-intro > span { display: block; margin-top: 7px; }
    .esq-about { display: block; padding-top: 32px; }
    .esq-feature-grid { grid-template-columns: 1fr; margin-top: 20px; }
}

@media (max-width: 430px) {
    .esq-panel-head > div:first-child > span { display: none; }
    .esq-head-actions button { font-size: .66rem; }
    .esq-tabs button { font-size: .68rem; }
    .esq-preview .CodeMirror, .esq-editor-wrap > textarea { height: 330px; min-height: 330px; }
    .esq-preview-footer small { display: none; }
}
