.kiv-ops-tool {
    --ops-ink: #1d352d;
    --ops-muted: #6c8079;
    --ops-green: #12a66a;
    --ops-green-dark: #08794c;
    --ops-soft: #f3f8f5;
    --ops-soft-2: #edf5f1;
    --ops-line: #dbe7e1;
    --ops-amber: #b96c18;
    --ops-red: #b33a45;
    color: var(--ops-ink);
    min-width: 0;
}

.kiv-ops-tool .ops-tabs {
    align-items: stretch;
    background: #f5f8f6;
    border-bottom: 1px solid var(--ops-line);
    display: flex;
    margin: 0 0 24px;
    overflow-x: auto;
    padding: 0 8px;
    scrollbar-width: thin;
}

.kiv-ops-tool .ops-tabs > li { flex: 0 0 auto; float: none; margin: 0; }
.kiv-ops-tool .ops-tabs > li > a {
    border: 0;
    border-radius: 0;
    color: #4c625a;
    font-size: 14px;
    font-weight: 650;
    margin: 0;
    min-height: 51px;
    padding: 16px 17px 13px;
    position: relative;
    white-space: nowrap;
}
.kiv-ops-tool .ops-tabs > li > a:hover,
.kiv-ops-tool .ops-tabs > li > a:focus { background: #eaf4ef; color: var(--ops-green-dark); outline: 0; }
.kiv-ops-tool .ops-tabs > li.active > a,
.kiv-ops-tool .ops-tabs > li.active > a:hover,
.kiv-ops-tool .ops-tabs > li.active > a:focus { background: #fff; color: var(--ops-green-dark); }
.kiv-ops-tool .ops-tabs > li.active > a::before {
    background: var(--ops-green);
    border-radius: 0 0 3px 3px;
    content: "";
    height: 3px;
    left: 12px;
    position: absolute;
    right: 12px;
    top: 0;
}

.kiv-ops-tool .ops-intro,
.kiv-ops-tool .tool-intro { margin: 0 0 16px; }
.kiv-ops-tool .ops-intro h1,
.kiv-ops-tool .tool-intro h1 {
    color: #20372f;
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -.025em;
    line-height: 1.25;
    margin: 0 0 8px;
}
.kiv-ops-tool .ops-intro p,
.kiv-ops-tool .tool-intro p { color: var(--ops-muted); font-size: 15px; line-height: 1.65; margin: 0; max-width: 930px; }
.kiv-ops-tool .ops-badge {
    background: #e8f7ef;
    border-radius: 999px;
    color: var(--ops-green-dark);
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    margin-left: 8px;
    padding: 5px 8px 4px;
    vertical-align: middle;
}
.kiv-ops-tool .ops-badge.is-network { background: #e9f2fb; color: #315f89; }

.kiv-ops-tool .ops-rail {
    align-items: center;
    background: linear-gradient(90deg, #edf7f2 0, #f7faf8 72%);
    border-left: 3px solid var(--ops-green);
    color: #47665a;
    display: flex;
    font-size: 13px;
    gap: 14px;
    justify-content: space-between;
    margin: 0 0 18px;
    min-height: 42px;
    padding: 10px 13px;
}
.kiv-ops-tool .ops-rail strong { color: #176b49; }
.kiv-ops-tool .ops-rail small { color: #7a8d85; }
.kiv-ops-tool .ops-rail.is-network { background: linear-gradient(90deg, #eef5fb 0, #f8fafb 72%); border-left-color: #4e86b3; }
.kiv-ops-tool .ops-rail.is-network strong { color: #315f89; }

.kiv-ops-tool .ops-status {
    display: none;
    font-size: 13px;
    margin: 0 0 14px;
    padding: 11px 13px;
}
.kiv-ops-tool .ops-status.is-visible { display: block; }
.kiv-ops-tool .ops-status.is-ok { background: #eaf7f0; color: #176b49; }
.kiv-ops-tool .ops-status.is-warn { background: #fff6e8; color: #8b571d; }
.kiv-ops-tool .ops-status.is-error { background: #fff0f1; color: #982e39; }

.kiv-ops-tool .ops-query {
    align-items: end;
    background: #fff;
    box-shadow: 0 10px 34px rgba(31, 64, 53, .06);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(240px, 1fr) minmax(150px, .28fr) auto;
    margin-bottom: 17px;
    padding: 16px;
}
.kiv-ops-tool .ops-query.ops-query-two { grid-template-columns: minmax(240px, 1fr) auto; }
.kiv-ops-tool .ops-field { min-width: 0; }
.kiv-ops-tool .ops-field label {
    color: #38544a;
    display: block;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .02em;
    margin-bottom: 6px;
}
.kiv-ops-tool .ops-input,
.kiv-ops-tool .ops-select,
.kiv-ops-tool .ops-textarea {
    background: #fafdfe;
    border: 1px solid #d2e0d9;
    border-radius: 3px;
    box-shadow: none;
    color: #213b31;
    font-size: 14px;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}
.kiv-ops-tool .ops-textarea {
    font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    min-height: 340px;
    resize: vertical;
}
.kiv-ops-tool .ops-input:focus,
.kiv-ops-tool .ops-select:focus,
.kiv-ops-tool .ops-textarea:focus {
    border-color: #65c598;
    box-shadow: 0 0 0 3px rgba(18, 166, 106, .1);
    outline: 0;
}
.kiv-ops-tool .ops-button {
    background: var(--ops-green);
    border: 0;
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    min-height: 42px;
    padding: 10px 16px;
    white-space: nowrap;
}
.kiv-ops-tool .ops-button:hover,
.kiv-ops-tool .ops-button:focus { background: #0c8a59; color: #fff; outline: 0; }
.kiv-ops-tool .ops-button[disabled] { cursor: wait; opacity: .58; }
.kiv-ops-tool .ops-button.is-secondary { background: #edf4f0; color: #2d5948; }
.kiv-ops-tool .ops-button.is-secondary:hover { background: #e1eee7; }
.kiv-ops-tool .ops-button.is-quiet { background: transparent; color: #42705d; padding-left: 9px; padding-right: 9px; }

.kiv-ops-tool .ops-layout { display: grid; gap: 17px; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); }
.kiv-ops-tool .ops-stack { display: grid; gap: 17px; }
.kiv-ops-tool .ops-panel {
    background: #fff;
    box-shadow: 0 1px 0 rgba(28, 70, 55, .05), 0 10px 30px rgba(31, 64, 53, .05);
    min-width: 0;
}
.kiv-ops-tool .ops-panel-head {
    align-items: center;
    background: #f7faf8;
    border-bottom: 1px solid var(--ops-line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 48px;
    padding: 11px 15px;
}
.kiv-ops-tool .ops-panel-head strong { color: #29483d; font-size: 14px; }
.kiv-ops-tool .ops-panel-head small { color: #7d9088; font-size: 12px; }
.kiv-ops-tool .ops-panel-body { min-width: 0; padding: 15px; }
.kiv-ops-tool .ops-empty { color: #869790; font-size: 13px; line-height: 1.6; padding: 34px 16px; text-align: center; }

.kiv-ops-tool .ops-metrics { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kiv-ops-tool .ops-metric { background: var(--ops-soft); min-width: 0; padding: 11px 12px; }
.kiv-ops-tool .ops-metric strong { color: #163e2f; display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kiv-ops-tool .ops-metric span { color: #71847c; display: block; font-size: 11px; margin-top: 3px; }

.kiv-ops-tool .ops-records { display: grid; gap: 1px; }
.kiv-ops-tool .ops-record {
    align-items: start;
    background: #f7faf8;
    display: grid;
    gap: 10px;
    grid-template-columns: 58px minmax(125px, .45fr) minmax(180px, 1fr) 66px;
    padding: 11px 12px;
}
.kiv-ops-tool .ops-record-type { color: var(--ops-green-dark); font-size: 11px; font-weight: 850; letter-spacing: .06em; }
.kiv-ops-tool .ops-record-name,
.kiv-ops-tool .ops-record-value { color: #324a41; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.kiv-ops-tool .ops-record-ttl { color: #819189; font-size: 11px; text-align: right; }

.kiv-ops-tool .ops-timeline { padding-left: 30px; position: relative; }
.kiv-ops-tool .ops-hop { background: #f7faf8; margin-bottom: 10px; padding: 12px 13px; position: relative; }
.kiv-ops-tool .ops-hop::before {
    background: var(--ops-green);
    border: 4px solid #e7f5ed;
    border-radius: 50%;
    content: "";
    height: 16px;
    left: -28px;
    position: absolute;
    top: 15px;
    width: 16px;
}
.kiv-ops-tool .ops-hop:not(:last-child)::after { background: #cfe3d8; content: ""; height: calc(100% + 10px); left: -21px; position: absolute; top: 31px; width: 2px; }
.kiv-ops-tool .ops-hop-head { align-items: baseline; display: flex; gap: 9px; margin-bottom: 5px; }
.kiv-ops-tool .ops-code { background: #dff4e9; border-radius: 3px; color: #0b7449; font-size: 12px; font-weight: 850; padding: 3px 7px; }
.kiv-ops-tool .ops-hop-url { color: #27463a; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.kiv-ops-tool .ops-hop-meta { color: #75877f; display: flex; flex-wrap: wrap; font-size: 11px; gap: 11px; }

.kiv-ops-tool .ops-checks { display: grid; gap: 8px; }
.kiv-ops-tool .ops-check { align-items: start; background: #f7faf8; display: grid; gap: 10px; grid-template-columns: 28px 80px 1fr; padding: 11px 12px; }
.kiv-ops-tool .ops-check-dot { align-items: center; background: #dce8e2; border-radius: 50%; color: #60766d; display: flex; font-size: 11px; font-weight: 900; height: 24px; justify-content: center; width: 24px; }
.kiv-ops-tool .ops-check.is-pass .ops-check-dot { background: #dff5e9; color: #08794c; }
.kiv-ops-tool .ops-check.is-fail .ops-check-dot { background: #ffe6e8; color: #a72c39; }
.kiv-ops-tool .ops-check-name { color: #29483d; font-size: 13px; font-weight: 750; padding-top: 3px; }
.kiv-ops-tool .ops-check-message { color: #687c74; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; padding-top: 3px; }

.kiv-ops-tool .ops-kv { display: grid; gap: 1px; grid-template-columns: minmax(120px, .34fr) 1fr; }
.kiv-ops-tool .ops-kv dt,
.kiv-ops-tool .ops-kv dd { background: #f7faf8; font-size: 12px; line-height: 1.55; margin: 0; min-width: 0; padding: 9px 11px; }
.kiv-ops-tool .ops-kv dt { color: #62776e; font-weight: 650; }
.kiv-ops-tool .ops-kv dd { color: #2b473c; overflow-wrap: anywhere; }

.kiv-ops-tool .ops-dropzone {
    align-items: center;
    background: #f5f9f7;
    border: 1px dashed #a7c8b8;
    color: #61776e;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
    min-height: 96px;
    padding: 16px;
    text-align: center;
}
.kiv-ops-tool .ops-dropzone:hover,
.kiv-ops-tool .ops-dropzone.is-dragover { background: #eaf6f0; border-color: var(--ops-green); }
.kiv-ops-tool .ops-dropzone strong { color: #28664e; font-size: 14px; }
.kiv-ops-tool .ops-dropzone small { color: #84958e; }
.kiv-ops-tool .ops-dropzone input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.kiv-ops-tool .ops-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }

.kiv-ops-tool .ops-events { display: grid; gap: 10px; }
.kiv-ops-tool .ops-event { background: #f7faf8; border-left: 3px solid #75c89f; padding: 12px 13px; }
.kiv-ops-tool .ops-event h3 { color: #25473a; font-size: 14px; line-height: 1.4; margin: 0 0 5px; }
.kiv-ops-tool .ops-event-meta { color: #6e8279; display: flex; flex-wrap: wrap; font-size: 11px; gap: 10px; }
.kiv-ops-tool .ops-event p { color: #536b61; font-size: 12px; line-height: 1.6; margin: 8px 0 0; white-space: pre-wrap; }

.kiv-ops-tool .ops-key-output { background: #f8faf9; color: #2c453b; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; margin: 0; max-height: 320px; min-height: 112px; overflow: auto; padding: 12px; white-space: pre-wrap; word-break: break-all; }
.kiv-ops-tool .ops-note { background: #fff7e9; color: #82541b; font-size: 12px; line-height: 1.55; margin-top: 12px; padding: 10px 12px; }

/* The global theme switch places `kiv-shell-dark` on <html>. Keep every
   workbench surface genuinely dark instead of leaving bright white islands. */
html.kiv-shell-dark .kiv-ops-tool {
    --ops-ink: #dbe9e3;
    --ops-muted: #9aada5;
    --ops-soft: #1a2b24;
    --ops-soft-2: #20352b;
    --ops-line: #30463c;
}
html.kiv-shell-dark .kiv-ops-tool .ops-tabs { background: #1b2923; border-bottom-color: #34483f; }
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li > a { color: #aebfb8; }
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li > a:hover,
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li > a:focus { background: #22372e; color: #a8e0be; }
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li.active > a,
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li.active > a:hover,
html.kiv-shell-dark .kiv-ops-tool .ops-tabs > li.active > a:focus { background: #14211c; color: #a8e0be; }
html.kiv-shell-dark .kiv-ops-tool .ops-intro h1,
html.kiv-shell-dark .kiv-ops-tool .tool-intro h1,
html.kiv-shell-dark .kiv-ops-tool .ops-panel-head strong { color: #e2ede8; }
html.kiv-shell-dark .kiv-ops-tool .ops-badge { background: #1c3b2d; color: #9bdeb8; }
html.kiv-shell-dark .kiv-ops-tool .ops-badge.is-network { background: #1a3445; color: #a7cce8; }
html.kiv-shell-dark .kiv-ops-tool .ops-rail { background: linear-gradient(90deg, #182b23 0, #15221d 72%); color: #a9bbb4; }
html.kiv-shell-dark .kiv-ops-tool .ops-rail strong { color: #9bdeb8; }
html.kiv-shell-dark .kiv-ops-tool .ops-rail small { color: #83978f; }
html.kiv-shell-dark .kiv-ops-tool .ops-rail.is-network { background: linear-gradient(90deg, #192c38 0, #15221d 72%); }
html.kiv-shell-dark .kiv-ops-tool .ops-rail.is-network strong { color: #a7cce8; }
html.kiv-shell-dark .kiv-ops-tool .ops-query,
html.kiv-shell-dark .kiv-ops-tool .ops-panel { background: #15231d; box-shadow: 0 12px 34px rgba(0, 0, 0, .16); }
html.kiv-shell-dark .kiv-ops-tool .ops-panel-head { background: #1b2c25; border-bottom-color: var(--ops-line); }
html.kiv-shell-dark .kiv-ops-tool .ops-panel-head small,
html.kiv-shell-dark .kiv-ops-tool .ops-empty { color: #879b93; }
html.kiv-shell-dark .kiv-ops-tool .ops-field label { color: #b7c9c1; }
html.kiv-shell-dark .kiv-ops-tool .ops-input,
html.kiv-shell-dark .kiv-ops-tool .ops-select,
html.kiv-shell-dark .kiv-ops-tool .ops-textarea {
    background: #101c17;
    border-color: #385248;
    color: #dce8e3;
}
html.kiv-shell-dark .kiv-ops-tool .ops-input::placeholder,
html.kiv-shell-dark .kiv-ops-tool .ops-textarea::placeholder { color: #73877f; }
html.kiv-shell-dark .kiv-ops-tool .ops-input:focus,
html.kiv-shell-dark .kiv-ops-tool .ops-select:focus,
html.kiv-shell-dark .kiv-ops-tool .ops-textarea:focus { border-color: #58b985; box-shadow: 0 0 0 3px rgba(88, 185, 133, .13); }
html.kiv-shell-dark .kiv-ops-tool .ops-button.is-secondary { background: #263b32; color: #b8dfca; }
html.kiv-shell-dark .kiv-ops-tool .ops-button.is-secondary:hover { background: #304a3e; }
html.kiv-shell-dark .kiv-ops-tool .ops-button.is-quiet { color: #9fd8b8; }
html.kiv-shell-dark .kiv-ops-tool .ops-metric,
html.kiv-shell-dark .kiv-ops-tool .ops-record,
html.kiv-shell-dark .kiv-ops-tool .ops-hop,
html.kiv-shell-dark .kiv-ops-tool .ops-check,
html.kiv-shell-dark .kiv-ops-tool .ops-kv dt,
html.kiv-shell-dark .kiv-ops-tool .ops-kv dd,
html.kiv-shell-dark .kiv-ops-tool .ops-event,
html.kiv-shell-dark .kiv-ops-tool .ops-key-output { background: #1a2b24; border-color: #385248; }
html.kiv-shell-dark .kiv-ops-tool .ops-metric strong,
html.kiv-shell-dark .kiv-ops-tool .ops-record-name,
html.kiv-shell-dark .kiv-ops-tool .ops-record-value,
html.kiv-shell-dark .kiv-ops-tool .ops-hop-url,
html.kiv-shell-dark .kiv-ops-tool .ops-check-name,
html.kiv-shell-dark .kiv-ops-tool .ops-kv dd,
html.kiv-shell-dark .kiv-ops-tool .ops-event h3,
html.kiv-shell-dark .kiv-ops-tool .ops-key-output { color: #d2e2db; }
html.kiv-shell-dark .kiv-ops-tool .ops-metric span,
html.kiv-shell-dark .kiv-ops-tool .ops-record-ttl,
html.kiv-shell-dark .kiv-ops-tool .ops-hop-meta,
html.kiv-shell-dark .kiv-ops-tool .ops-check-message,
html.kiv-shell-dark .kiv-ops-tool .ops-kv dt,
html.kiv-shell-dark .kiv-ops-tool .ops-event-meta,
html.kiv-shell-dark .kiv-ops-tool .ops-event p { color: #91a69d; }
html.kiv-shell-dark .kiv-ops-tool .ops-dropzone { background: #182a23; border-color: #436b59; color: #9eb2aa; }
html.kiv-shell-dark .kiv-ops-tool .ops-dropzone:hover,
html.kiv-shell-dark .kiv-ops-tool .ops-dropzone.is-dragover { background: #203a2f; border-color: #58b985; }
html.kiv-shell-dark .kiv-ops-tool .ops-dropzone strong { color: #b8dfca; }
html.kiv-shell-dark .kiv-ops-tool .ops-dropzone small { color: #83978f; }
html.kiv-shell-dark .kiv-ops-tool .ops-note { background: #352918; color: #e6bd7d; }
html.kiv-shell-dark .kiv-ops-tool .ops-status.is-ok { background: #173328; color: #9bdeb8; }
html.kiv-shell-dark .kiv-ops-tool .ops-status.is-warn { background: #382b18; color: #e6bd7d; }
html.kiv-shell-dark .kiv-ops-tool .ops-status.is-error { background: #3a2024; color: #ef9ca5; }

@media (max-width: 900px) {
    .kiv-ops-tool .ops-query,
    .kiv-ops-tool .ops-query.ops-query-two { grid-template-columns: 1fr 160px; }
    .kiv-ops-tool .ops-query .ops-field:first-child { grid-column: 1 / -1; }
    .kiv-ops-tool .ops-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .kiv-ops-tool .ops-tabs { margin-left: -8px; margin-right: -8px; padding: 0; }
    .kiv-ops-tool .ops-tabs > li > a { font-size: 13px; min-height: 46px; padding: 14px 13px 11px; }
    .kiv-ops-tool .ops-intro h1,
    .kiv-ops-tool .tool-intro h1 { font-size: 21px; }
    .kiv-ops-tool .ops-intro p,
    .kiv-ops-tool .tool-intro p { font-size: 14px; }
    .kiv-ops-tool .ops-badge { margin: 7px 0 0; }
    .kiv-ops-tool .ops-rail { align-items: flex-start; flex-direction: column; gap: 3px; }
    .kiv-ops-tool .ops-query,
    .kiv-ops-tool .ops-query.ops-query-two { grid-template-columns: 1fr; padding: 13px; }
    .kiv-ops-tool .ops-query .ops-field:first-child { grid-column: auto; }
    .kiv-ops-tool .ops-button { width: 100%; }
    .kiv-ops-tool .ops-toolbar .ops-button { flex: 1 1 130px; width: auto; }
    .kiv-ops-tool .ops-metrics { grid-template-columns: 1fr 1fr; }
    .kiv-ops-tool .ops-record { grid-template-columns: 52px 1fr; }
    .kiv-ops-tool .ops-record-value { grid-column: 1 / -1; }
    .kiv-ops-tool .ops-record-ttl { grid-column: 2; grid-row: 1; }
    .kiv-ops-tool .ops-check { grid-template-columns: 26px 70px 1fr; padding: 10px 9px; }
    .kiv-ops-tool .ops-kv { grid-template-columns: 1fr; }
    .kiv-ops-tool .ops-kv dt { padding-bottom: 3px; }
    .kiv-ops-tool .ops-kv dd { padding-top: 3px; }
}
