/*
 * Focused local-first developer utilities introduced after the initial
 * KivTools catalogue.  The styles intentionally use the existing cards,
 * Bootstrap controls, and green accent rather than creating a second visual
 * language for the site.
 */
.kiv-next-tool .next-command-bar {
    display: flex;
    gap: 9px;
    align-items: stretch;
    margin: 15px 0 11px;
}

.kiv-next-tool .next-command-bar .form-control {
    min-width: 0;
    height: 42px;
}

.kiv-next-tool .next-method {
    flex: 0 0 105px;
    color: #0a8f62;
    font-weight: 700;
}

.kiv-next-tool .next-url {
    flex: 1 1 auto;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
}

.kiv-next-tool .next-command-bar .btn {
    min-width: 118px;
}

.kiv-next-tool .next-label-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
}

.kiv-next-tool .next-label-row label,
.kiv-next-tool .next-field-label {
    margin: 0;
    color: #3f505c;
    font-size: 12px;
    font-weight: 700;
}

.kiv-next-tool .next-help,
.kiv-next-tool .next-local-note {
    margin: 0;
    color: #75848f;
    font-size: 12px;
    line-height: 1.5;
}

.kiv-next-tool .next-local-note {
    margin: 9px 0 0;
}

.kiv-next-tool .next-parameter-list {
    margin-bottom: 8px;
}

.kiv-next-tool .next-parameter-row {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(160px, 1fr) 34px;
    gap: 7px;
    align-items: center;
    margin: 7px 0;
}

.kiv-next-tool .next-parameter-row .form-control {
    height: 34px;
    font-size: 13px;
}

.kiv-next-tool .next-parameter-row .btn {
    width: 34px;
    height: 34px;
    padding: 5px 0;
}

.kiv-next-tool .next-code-input {
    min-height: 126px;
    resize: vertical;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.48;
}

.kiv-next-tool .next-code-input.next-code-short {
    min-height: 96px;
}

.kiv-next-tool .next-toggle-row {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.kiv-next-tool .next-toggle-row .form-control {
    width: auto;
    min-width: 156px;
}

.kiv-next-tool .next-response-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 32px;
    color: #61717c;
    font-size: 12px;
}

.kiv-next-tool .next-status-pill,
.kiv-next-tool .next-mini-pill {
    display: inline-block;
    padding: 3px 7px;
    border: 1px solid #d4e2e8;
    border-radius: 12px;
    background: #f7fafb;
    color: #48606c;
    font-size: 11px;
    font-weight: 700;
}

.kiv-next-tool .next-status-pill.ok {
    border-color: #b7e2cd;
    background: #effaf4;
    color: #08784f;
}

.kiv-next-tool .next-status-pill.warn {
    border-color: #f0d7a6;
    background: #fff8ea;
    color: #9a6500;
}

.kiv-next-tool .next-response-output {
    min-height: 210px;
    max-height: 460px;
    overflow: auto;
    margin: 0;
    padding: 13px;
    border: 1px solid #e0e7eb;
    border-radius: 3px;
    background: #fbfcfd;
    color: #263842;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.52;
    white-space: pre-wrap;
    word-break: break-word;
}

.kiv-next-tool .next-tab-links {
    margin-bottom: 14px;
}

.kiv-next-tool .next-openapi-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.kiv-next-tool .next-openapi-grid .form-control {
    min-width: 0;
}

.kiv-next-tool .next-openapi-ops {
    max-height: 235px;
    overflow: auto;
    margin: 10px 0 0;
    border: 1px solid #e1e7eb;
    border-radius: 3px;
    background: #fcfdfd;
}

.kiv-next-tool .next-openapi-operation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-bottom: 1px solid #edf1f3;
    color: #40515c;
    font-size: 12px;
}

.kiv-next-tool .next-openapi-operation:last-child {
    border-bottom: 0;
}

.kiv-next-tool .next-openapi-operation code {
    color: #0d8b62;
    font-size: 11px;
}

.kiv-next-tool .next-operation-select {
    margin-top: 9px;
}

.kiv-next-tool .next-palette-dropzone {
    min-height: 158px;
}

.kiv-next-tool .next-image-preview-wrap {
    position: relative;
    min-height: 90px;
    margin-top: 12px;
    border: 1px solid #e1e7eb;
    border-radius: 3px;
    background: #fbfcfd;
}

.kiv-next-tool .next-image-preview-wrap[hidden] {
    display: none;
}

.kiv-next-tool .next-image-preview {
    display: block;
    width: 100%;
    max-height: 390px;
    object-fit: contain;
    background: repeating-conic-gradient(#f2f5f6 0 25%, #fff 0 50%) 50% / 16px 16px;
}

.kiv-next-tool .next-image-meta {
    position: absolute;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 7px;
    border-radius: 2px;
    background: rgba(28, 44, 53, .82);
    color: #fff;
    font-size: 11px;
}

.kiv-next-tool .next-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px;
    margin: 5px 0 0;
}

.kiv-next-tool .next-swatch {
    position: relative;
    display: flex;
    min-height: 91px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(34, 50, 58, .15);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform .14s ease, box-shadow .14s ease;
}

.kiv-next-tool .next-swatch:hover,
.kiv-next-tool .next-swatch:focus {
    box-shadow: 0 7px 16px rgba(28, 52, 64, .18);
    outline: 0;
    transform: translateY(-2px);
}

.kiv-next-tool .next-swatch:focus-visible {
    outline: 3px solid #5bc0de;
    outline-offset: 2px;
}

.kiv-next-tool .next-swatch::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(180deg, transparent 25%, rgba(0, 0, 0, .43));
    content: "";
}

.kiv-next-tool .next-swatch strong,
.kiv-next-tool .next-swatch span {
    position: relative;
    z-index: 1;
}

.kiv-next-tool .next-swatch strong {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 15px;
    letter-spacing: .02em;
}

.kiv-next-tool .next-swatch span {
    margin-top: 2px;
    font-size: 11px;
    opacity: .92;
}

.kiv-next-tool .next-icu-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 4px 0 14px;
}

.kiv-next-tool .next-summary-cell {
    padding: 12px 10px;
    border: 1px solid #e1e8eb;
    border-radius: 3px;
    background: #fbfcfd;
    text-align: center;
}

.kiv-next-tool .next-summary-cell strong {
    display: block;
    color: #0c9264;
    font-size: 22px;
    line-height: 1.1;
}

.kiv-next-tool .next-summary-cell span {
    display: block;
    margin-top: 5px;
    color: #6d7c86;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.kiv-next-tool .next-check-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.kiv-next-tool .next-check-list li {
    position: relative;
    min-height: 36px;
    margin: 7px 0;
    padding: 8px 10px 8px 83px;
    border: 1px solid #e5eaed;
    border-radius: 3px;
    background: #fff;
    color: #42535d;
    font-size: 13px;
    line-height: 1.45;
}

.kiv-next-tool .next-check-list .next-level {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 62px;
    color: #63808d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}

.kiv-next-tool .next-check-list li.good {
    border-color: #c5e7d5;
    background: #f4fcf7;
}

.kiv-next-tool .next-check-list li.good .next-level {
    color: #078759;
}

.kiv-next-tool .next-check-list li.warning {
    border-color: #f0d9ad;
    background: #fffaf1;
}

.kiv-next-tool .next-check-list li.warning .next-level {
    color: #a96900;
}

.kiv-next-tool .next-check-list li.danger {
    border-color: #f0c4c3;
    background: #fff7f7;
}

.kiv-next-tool .next-check-list li.danger .next-level {
    color: #bd3b38;
}

.kiv-next-tool .next-icu-token {
    display: inline-block;
    margin: 1px 2px;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(38, 62, 73, .08);
    color: #1f5668;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 11px;
}

html.kiv-shell-dark .kiv-next-tool .next-response-output,
html.kiv-shell-dark .kiv-next-tool .next-openapi-ops,
html.kiv-shell-dark .kiv-next-tool .next-image-preview-wrap,
html.kiv-shell-dark .kiv-next-tool .next-summary-cell,
html.kiv-shell-dark .kiv-next-tool .next-check-list li {
    border-color: #40525d;
    background: #22313b;
    color: #dfe8ed;
}

html.kiv-shell-dark .kiv-next-tool .next-openapi-operation {
    border-color: #344650;
    color: #d7e2e7;
}

html.kiv-shell-dark .kiv-next-tool .next-label-row label,
html.kiv-shell-dark .kiv-next-tool .next-field-label {
    color: #d9e4e9;
}

html.kiv-shell-dark .kiv-next-tool .next-help,
html.kiv-shell-dark .kiv-next-tool .next-local-note,
html.kiv-shell-dark .kiv-next-tool .next-summary-cell span {
    color: #aabcc5;
}

html.kiv-shell-dark .kiv-next-tool .next-status-pill,
html.kiv-shell-dark .kiv-next-tool .next-mini-pill {
    border-color: #47616e;
    background: #2d414c;
    color: #d7e4e8;
}

html.kiv-shell-dark .kiv-next-tool .next-check-list li.good {
    border-color: #317252;
    background: #244435;
}

html.kiv-shell-dark .kiv-next-tool .next-check-list li.warning {
    border-color: #795c27;
    background: #4a3b22;
}

html.kiv-shell-dark .kiv-next-tool .next-check-list li.danger {
    border-color: #804b49;
    background: #4b3032;
}

@media (max-width: 767px) {
    .kiv-next-tool .next-command-bar {
        display: grid;
        grid-template-columns: 102px minmax(0, 1fr);
    }

    .kiv-next-tool .next-command-bar .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .kiv-next-tool .next-parameter-row {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .kiv-next-tool .next-parameter-row input:first-child {
        grid-column: 1 / 2;
    }

    .kiv-next-tool .next-parameter-row input:nth-child(2) {
        grid-column: 1 / 2;
    }

    .kiv-next-tool .next-parameter-row .btn {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
    }

    .kiv-next-tool .next-openapi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .kiv-next-tool .next-openapi-grid .btn {
        width: 100%;
    }

    .kiv-next-tool .next-icu-summary {
        grid-template-columns: 1fr;
    }

    .kiv-next-tool .next-palette-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
