/* Component-scoped styles — Blazor CSS isolation */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f1117;
    --bg2: #171b24;
    --bg3: #1e2330;
    --bg4: #252a38;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.13);
    --text: #e2e6f0;
    --text2: #8b92a8;
    --text3: #55607a;
    --mono: 'JetBrains Mono','Fira Code','Cascadia Code',ui-monospace,monospace;
    --sans: 'Inter',system-ui,sans-serif;
    --accent: #1D9E75;
    --accent2: #0F6E56;
    --cmd: #D4537E;
    --kw: #A78BFA;
    --str: #7EC87A;
    --num: #F4875A;
    --qry: #5BA3F5;
    --err: #F47070;
    --success: #1D9E75;
    --radius: 6px;
}

html, body {
    height: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}


.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading...");
    }

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 46px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    user-select: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.02em;
    color: var(--text);
}

.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
}
.pill {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pill-green {
    background: rgba(29,158,117,0.18);
    color: #3ecfa0;
    border: 1px solid rgba(29,158,117,0.25);
}

.pill-blue {
    background: rgba(91,163,245,0.12);
    color: #7bbcf9;
    border: 1px solid rgba(91,163,245,0.2);
}

.topbar-spacer {
    flex: 1;
}

.topbar-endpoint {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text3);
}

.main {
    display: grid;
    grid-template-columns: 220px 1fr 1fr;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.schema-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.op-toggle {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.op-btn {
    flex: 1;
    padding: 6px 0;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: none;
    background: var(--bg2);
    color: var(--text3);
    cursor: pointer;
    transition: background .15s,color .15s;
    border-right: 1px solid var(--border);
}

    .op-btn:last-child {
        border-right: none;
    }

    .op-btn:hover {
        background: var(--bg3);
        color: var(--text2);
    }

    .op-btn[data-op="query"].active {
        background: var(--bg3);
        color: var(--qry);
    }

    .op-btn[data-op="command"].active {
        background: var(--bg3);
        color: var(--cmd);
    }

.schema-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    min-height: 0;
}

.schema-section {
    padding: 6px 12px 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text3);
    margin-top: 6px;
}

    .schema-section:first-child {
        margin-top: 0;
    }

.schema-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 12px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    border-left: 2px solid transparent;
    transition: border-color .1s,color .1s;
    cursor: pointer;
    user-select: none;
}

    .schema-item:hover {
        border-left-color: var(--accent);
        color: var(--text);
    }

.schema-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schema-field {
    display: flex;
    align-items: center;
    padding: 0;
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
}

.schema-field-label {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    padding: 2px 10px 2px 22px;
    cursor: pointer;
    user-select: none;
}

    .schema-field-label:hover {
        background: var(--bg3);
    }

.schema-field-cb {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.schema-field-name {
    color: var(--text2);
}

.schema-field-type {
    color: var(--num);
    margin-left: 4px;
    font-size: 10px;
    opacity: .7;
}

.schema-field-opt {
    color: var(--text3);
    opacity: .5;
}

.schema-field-label.unchecked .schema-field-name,
.schema-field-label.unchecked .schema-field-type {
    opacity: .3;
}

.schema-msg {
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text3);
}

.schema-msg-err {
    color: var(--err);
}

.editor-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    min-height: 0;
    height: 100%;
}

.editor-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    font-family: var(--mono, monospace);
    display: flex;
    flex-direction: column;
    position: relative;
}

.cqs-editor {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono, monospace);
    font-size: 14px;
    line-height: 1.7;
    padding: 16px;
    border: none;
    outline: none;
    resize: none;
    tab-size: 2;
    caret-color: var(--accent);
    box-sizing: border-box;
}

.validate-bar {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid var(--border);
    display: none;
    flex-shrink: 0;
}

.pane-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 12px;
    min-height: 38px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text3);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    user-select: none;
}

.pane-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pane-meta {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text3);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.response-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.response-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px;
    background: var(--bg);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    min-height: 0;
}

    .response-body pre {
        white-space: pre-wrap;
        word-break: break-word;
    }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: var(--text3);
    font-size: 13px;
    text-align: center;
    padding: 32px;
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 4px;
    opacity: .25;
    color: var(--accent);
}

.json-key {
    color: var(--qry)
}

.json-str {
    color: var(--str)
}

.json-num {
    color: var(--num)
}

.json-bool {
    color: var(--kw)
}

.json-null {
    color: var(--text3)
}

.statusbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 34px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.spinner {
    display: none;
    width: 13px;
    height: 13px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.status-text {
    font-size: 12px;
    color: var(--text3)
}

.status-ok {
    color: var(--success)
}

.status-err {
    color: var(--err)
}

.actionbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.actionbar-spacer {
    flex: 1
}

.btn {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border2);
    cursor: pointer;
    background: var(--bg3);
    color: var(--text2);
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

    .btn:hover {
        background: var(--bg4);
        color: var(--text)
    }

    .btn:active {
        transform: scale(.98)
    }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent)
}

    .btn-primary:hover {
        background: var(--accent2);
        border-color: var(--accent2);
        color: #fff
    }

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text3)
    }

@media(max-width:900px) {
    .main {
        grid-template-columns: 1fr 1fr
    }

    .schema-pane {
        display: none
    }
}

@media(max-width:600px) {
    .main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr
    }

    .editor-pane {
        border-right: none;
        border-bottom: 1px solid var(--border)
    }
}

*
/*.visual-editor-content:focus*/ {
    outline: none;
}
