.kt-pane {
    --kt-line: var(--line, #dedbd5);
    --kt-muted: var(--muted, #6b6962);
    --kt-accent: var(--accent, #b54b26);
    display: grid;
    gap: 18px;
    min-width: 0;
}
.kt-card {
    padding: 24px;
    border: 1px solid var(--kt-line);
    border-radius: 12px;
    background: var(--surface, #fff);
    min-width: 0;
}
.kt-card h3, .kt-dialog h3 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink, #262521); }
.kt-heading-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.kt-hint, .kt-source, .kt-footnote { color: var(--kt-muted); font-size: 12px; }
.kt-visually-hidden {
    position: absolute; padding: 0; margin: -1px; overflow: hidden;
    width: 1px; height: 1px; white-space: nowrap; clip-path: inset(50%); border: 0;
}
.kt-query { display: flex; gap: 10px; margin-top: 18px; }
.kt-query-box {
    display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1;
    border: 1px solid var(--kt-line); border-radius: 7px; padding: 0 12px; color: var(--kt-muted);
}
.kt-query-box svg { width: 18px; height: 18px; flex: none; }
.kt-query-box:focus-within { outline: 2px solid var(--kt-accent); outline-offset: 1px; }
.kt-query-box input { width: 100%; min-width: 0; padding: 10px 0; font: inherit; color: var(--ink, #262521); background: transparent; outline: none; border: 0; }
.kt-query button { flex-shrink: 0; }
.kt-quiet { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--kt-muted); text-align: center; font-size: 14px; }
.kt-footnote { margin: 10px 0 0; border-top: 1px solid var(--kt-line); padding-top: 14px; }
.kt-hit-count { font-size: 12px; color: var(--kt-muted); margin: 15px 0 8px; }
.kt-result { padding: 15px 0; border-top: 1px solid var(--kt-line); overflow-wrap: anywhere; }
.kt-result-source { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.kt-result > p { margin: 0 0 9px; white-space: pre-wrap; line-height: 1.65; }
.kt-pane mark { padding: 0 2px; background: #f9e7d9; color: #883714; }
.kt-parent { margin-top: 10px; }
.kt-parent summary, .kt-demo summary { width: fit-content; cursor: pointer; font-size: 13px; color: var(--kt-accent); }
.kt-parent p { margin: 9px 0; padding: 12px; border-left: 2px solid var(--kt-line); white-space: pre-wrap; line-height: 1.65; }

.kt-mode-options { border: 0; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.kt-mode-option { display: flex; gap: 9px; align-items: flex-start; padding: 14px 12px; border: 1px solid var(--kt-line); border-radius: 7px; cursor: pointer; }
.kt-mode-option:has(input:checked) { border-color: var(--kt-accent); background: #fdf6f1; }
.kt-mode-option input { accent-color: var(--kt-accent); margin: 4px 0 0; }
.kt-mode-option span { display: grid; gap: 5px; }
.kt-mode-option strong { font-size: 14px; font-weight: 600; }
.kt-mode-option small { font-size: 12px; color: var(--kt-muted); }
.kt-settings section + section { margin-top: 22px; }
.kt-settings h3 + .kt-param { margin-top: 4px; }
.kt-param { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--kt-line); min-height: 56px; }
.kt-param:last-child { border-bottom: 0; padding-bottom: 0; }
.kt-param label, .kt-param-name { font-size: 14px; }
.kt-param label span { color: var(--kt-muted); font-size: 12px; margin-left: 6px; }
.kt-model-info { display: grid; min-width: 0; max-width: 60%; gap: 3px; text-align: end; font-size: 14px; overflow-wrap: anywhere; }
.kt-model-info a, .kt-model-field a { color: var(--kt-accent); text-decoration: underline; text-underline-offset: 3px; }
.kt-model-field { display: grid; width: 290px; max-width: calc(100% - 5.5em); min-width: 0; gap: 5px; text-align: end; }
.kt-param input[type="number"] {
    width: 158px; max-width: 55%; padding: 8px 10px; border: 1px solid var(--kt-line);
    border-radius: 5px; color: var(--ink, #262521); background: white; font: inherit; font-size: 14px;
}
.kt-param select { width: 174px; max-width: 55%; }
.kt-model-field select { width: 100%; max-width: 100%; min-width: 0; white-space: nowrap; text-overflow: ellipsis; }
.kt-model-field selectedcontent { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kt-model-field option { white-space: normal; }
.kt-param input { accent-color: var(--kt-accent); }
.kt-inline-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.kt-inline-check input { margin: 0; }
.kt-weight { display: grid; gap: 4px; max-width: 55%; width: 158px; }
.kt-weight output { color: var(--kt-muted); font-size: 12px; }
.kt-weight input { width: 100%; margin: 0; }
.kt-dialog {
    --kt-line: var(--line, #dedbd5); --kt-muted: var(--muted, #6b6962); --kt-accent: var(--accent, #b54b26);
    width: min(590px, calc(100% - 32px)); max-height: calc(100% - 40px); max-height: calc(100dvh - 40px); padding: 0;
    box-sizing: border-box; border-radius: 12px; border: 1px solid var(--kt-line); color: var(--ink, #262521);
    box-shadow: 0 12px 60px #201a1426; margin: auto; background: var(--surface, white); overflow: hidden;
}
.kt-dialog[open], .kt-dialog-step, .kt-settings { display: flex; flex-direction: column; min-height: 0; }
.kt-dialog::backdrop { background: #24201b6b; }
.kt-settings-head { flex: none; display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 18px 24px 15px; border-bottom: 1px solid var(--kt-line); }
.kt-settings-head h2 { margin: 0; font-size: 22px; }
.kt-settings-head p { margin: 2px 0 0; color: var(--kt-muted); font-size: 13px; overflow-wrap: anywhere; }
.kt-dialog-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px; }
.kt-mode-transition { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 16px 0; }
.kt-mode-transition div { padding: 11px 12px; border: 1px solid var(--kt-line); border-radius: 7px; }
.kt-mode-transition div:last-child { background: #fdf6f1; }
.kt-mode-transition dt, .kt-mode-transition dd span { font-size: 12px; color: var(--kt-muted); }
.kt-mode-transition dd { display: grid; gap: 2px; margin: 5px 0 0; overflow-wrap: anywhere; }
.kt-mode-transition dd strong { font-weight: 600; }
.kt-dialog-text { font-size: 14px; line-height: 1.65; margin: 0; }
.kt-counts { margin: 18px 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-block: 1px solid var(--kt-line); }
.kt-counts div { padding: 12px 5px 12px 0; }
.kt-counts dt { color: var(--kt-muted); font-size: 12px; }
.kt-counts dd { margin: 5px 0 0; font-size: 24px; font-variant-numeric: tabular-nums; }
.kt-counts dd small { font-size: 12px; color: var(--kt-muted); }
.kt-demo label { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 8px 0; cursor: pointer; }
.kt-demo input { accent-color: var(--kt-accent); }
.kt-error { padding: 10px 12px; border-radius: 6px; background: #fbede7; color: #923b20; font-size: 14px; }
.kt-dialog-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--kt-line); }
.kt-back { margin-inline-end: auto; color: var(--kt-accent); padding: 8px 2px; cursor: pointer; }
.kt-back:hover { text-decoration: underline; }
@media (max-width: 650px) {
    .kt-card, .kt-dialog-scroll { padding: 16px; }
    .kt-settings-head, .kt-dialog-actions { padding: 12px 16px; }
    .kt-dialog-actions button { min-height: 42px; }
    .kt-mode-options { grid-template-columns: 1fr; }
    .kt-mode-option span { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; }
    .kt-query { gap: 6px; }
}
@media (max-width: 370px) {
    .kt-param:has(.kt-model-field) { flex-direction: column; align-items: stretch; gap: 7px; }
    .kt-model-field { width: 100%; max-width: none; }
}
