/* KKTerm dialog design language — Apple/Finder-flavoured.
   Ported from the design reference; class names are kk- prefixed and the
   design's private tokens are aliased onto the app token system so every
   surface themes with the active color scheme. */

/* token bridge: design token name -> app token */
.kk-dlg,
.kk-surface {
  --bg: var(--surface);
  /* Footer shares the body surface — one consistent dialog background;
     a hairline divider provides the separation, not a second fill. */
  --bg-2: var(--surface);
  --chrome-2: var(--surface-muted);
  --sidebar: var(--surface-muted);
  --muted: var(--surface-muted);
  --field: var(--surface-muted);
  --text-2: var(--text-muted);
  --text-3: var(--text-faint);
  --red-press: color-mix(in srgb, var(--red) 82%, #000);
  --radius-sheet: 14px;
  --radius-field: 8px;
  --field-h: 32px;
}

.kk-dlg,
.kk-dlg * {
  box-sizing: border-box;
}

/* ============================ backdrop ================================= */
.kk-dlg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    rgba(15, 23, 42, 0.32);
}

[data-color-scheme="dark"] .kk-dlg-backdrop,
[data-color-scheme="purple"] .kk-dlg-backdrop,
[data-color-scheme="blue-see"] .kk-dlg-backdrop {
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    rgba(0, 0, 0, 0.5);
}

/* ============================== sheet shell ============================ */
.kk-dlg {
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
}

.kk-dlg-head {
  position: relative;
  padding: 20px 22px 0;
  flex: 0 0 auto;
}
.kk-dlg-eyebrow {
  margin: 0 0 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.kk-dlg-title {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.018em;
}
.kk-dlg-sub {
  margin: 5px 0 0;
  max-width: 46ch;
  color: var(--text-2);
  font-size: 12.5px;
}
.kk-dlg-head.with-rule {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.kk-dlg-warn {
  margin: 4px 0 0;
  padding: 9px 11px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
  border-radius: 8px;
}

.kk-dlg-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--muted);
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.kk-dlg-close:hover {
  background: var(--press);
  color: var(--text);
}

.kk-dlg-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 18px 22px;
  overflow-y: auto;
}
.kk-dlg-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-2);
}
.kk-spacer {
  flex: 1 1 auto;
}
.kk-dlg-foot.center {
  justify-content: center;
}

/* ============================== buttons ================================ */
.kk-btn {
  --button-shadow-color: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 15px;
  border-radius: var(--radius-field);
  border: 0.5px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background 0.12s, border-color 0.12s, transform 0.04s, box-shadow 0.12s;
}
.kk-btn:hover {
  background: var(--hover);
}
.kk-btn:active {
  transform: translateY(0.5px);
}
.kk-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.kk-btn.primary {
  --button-shadow-color: var(--accent);
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--button-shadow);
}
.kk-btn.primary:hover {
  background: var(--accent-press);
}
.kk-btn.danger {
  --button-shadow-color: var(--red);
  background: var(--red);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--button-shadow);
}
.kk-btn.danger:hover {
  background: var(--red-press);
}
.kk-btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.kk-btn.ghost:hover {
  background: var(--hover);
}
.kk-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.kk-btn.sm {
  height: 26px;
  padding: 0 11px;
  font-size: 12px;
}
.kk-btn.wide {
  padding: 0 22px;
}

/* ============================== fields ================================= */
.kk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.kk-field > .kk-lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 590;
}
.kk-field > .kk-lbl .kk-req {
  color: var(--accent);
}
.kk-field > .kk-hint {
  margin-top: -1px;
  color: var(--text-3);
  font-size: 11.5px;
}

.kk-inp {
  --control-shadow-color: var(--border-strong);
  width: 100%;
  height: var(--field-h);
  padding: 0 11px;
  border-radius: var(--radius-field);
  border: 0.5px solid var(--border-strong);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: var(--control-shadow);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.kk-inp::placeholder {
  color: var(--text-3);
}
.kk-inp:focus {
  border-color: var(--accent);
  box-shadow: var(--ring), var(--control-shadow);
}
textarea.kk-inp {
  height: auto;
  min-height: 80px;
  padding: 9px 11px;
  resize: vertical;
  line-height: 1.5;
  font-family: var(--font-mono, "SF Mono", ui-monospace, Menlo, monospace);
  font-size: 12.5px;
}
.kk-inp.mono {
  font-family: var(--font-mono, "SF Mono", ui-monospace, Menlo, monospace);
}

.kk-inp-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.kk-inp-row .kk-inp {
  flex: 1 1 auto;
}
.kk-inp-row .kk-btn {
  flex: 0 0 auto;
  height: var(--field-h);
}

.kk-field-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 12px;
  align-items: end;
}
.kk-col-span-2 {
  grid-column: span 2;
}

/* ============================ popup select ============================= */
.kk-sel {
  position: relative;
  display: block;
}
.kk-sel select {
  --control-shadow-color: var(--border-strong);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: var(--field-h);
  padding: 0 34px 0 11px;
  border-radius: var(--radius-field);
  border: 0.5px solid var(--border-strong);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  box-shadow: var(--control-shadow);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.kk-sel select:focus {
  border-color: var(--accent);
  box-shadow: var(--ring), var(--control-shadow);
}
.kk-sel .kk-chev {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  pointer-events: none;
}

/* ============================ toggle switch ============================ */
.kk-switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--toggle-off-bg, var(--border-strong));
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.kk-switch.on {
  background: var(--accent);
}
.kk-switch[disabled] {
  opacity: 0.5;
  cursor: default;
}
.kk-switch .kk-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.kk-switch.on .kk-knob {
  transform: translateX(20px);
}

/* ============================ segmented =============================== */
.kk-seg {
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  padding: 2px;
  border-radius: 9px;
  background: var(--chrome-2);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.kk-seg button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 530;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}
.kk-seg button:hover {
  color: var(--text);
}
.kk-seg button.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 590;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

/* ============================ grouped list ============================= */
.kk-group {
  border-radius: 10px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  overflow: hidden;
}
.kk-group-title {
  margin: 4px 0 7px 3px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kk-grow {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 44px;
  padding: 7px 14px;
}
.kk-grow + .kk-grow {
  border-top: 0.5px solid var(--hairline);
}
.kk-grow .kk-gl-ico {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-2);
}
.kk-grow .kk-gl-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kk-grow .kk-gl-label {
  font-size: 13px;
  font-weight: 510;
}
.kk-grow .kk-gl-desc {
  color: var(--text-3);
  font-size: 11.5px;
}
.kk-grow .kk-gl-ctl {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kk-grow .kk-gl-val {
  color: var(--text-2);
  font-size: 12.5px;
}

.kk-ni-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #fff;
  flex: 0 0 auto;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.18);
}

/* ====================== connection identity tile ====================== */
.kk-conn-id {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.kk-conn-tile {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
}
.kk-conn-tile.editable {
  cursor: pointer;
}
.kk-conn-tile .kk-edit-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 0.5px solid var(--border);
  color: var(--text-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.kk-conn-id .kk-conn-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.kk-conn-id .kk-conn-meta .kk-nm {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.kk-conn-id .kk-conn-meta .kk-sub {
  margin-top: 1px;
  color: var(--text-2);
  font-size: 12.5px;
}
.kk-conn-swatches {
  display: flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
}

.kk-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 0.5px var(--border-strong);
  transition: transform 0.1s;
}
.kk-swatch:hover {
  transform: scale(1.12);
}
.kk-swatch.sel {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.kk-swatch.none {
  position: relative;
  background: var(--field);
}
.kk-swatch.none::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1.5px dashed var(--text-3);
}

/* ============================== stepper =============================== */
.kk-stepper {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-field);
  box-shadow: inset 0 0 0 0.5px var(--border-strong);
  overflow: hidden;
  background: var(--field);
}
.kk-stepper input {
  width: 46px;
  height: calc(var(--field-h) - 2px);
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font: inherit;
  font-size: 13px;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.kk-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: calc(var(--field-h) - 2px);
  border: 0;
  background: var(--chrome-2);
  color: var(--text-2);
  cursor: pointer;
}
.kk-stepper button:hover {
  background: var(--hover);
  color: var(--text);
}
.kk-stepper button:first-child {
  border-right: 0.5px solid var(--border);
}
.kk-stepper button:last-child {
  border-left: 0.5px solid var(--border);
}

/* ============================ confirm body ============================= */
.kk-confirm-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}
.kk-confirm-ico.info {
  background: var(--accent-soft);
  color: var(--accent);
}
.kk-confirm-ico.danger {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--red);
}
.kk-confirm-ico.warn {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--amber);
}
.kk-confirm-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.kk-confirm-body .kk-ct {
  flex: 1 1 auto;
}
.kk-confirm-body .kk-ct h2 {
  margin: 1px 0 6px;
  font-size: 16px;
  font-weight: 660;
  letter-spacing: -0.015em;
}
.kk-confirm-body .kk-ct p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.kk-confirm-body .kk-ct p b {
  color: var(--text);
  font-weight: 600;
}

/* ======================= quick command manager ======================== */
.kk-qc-muted {
  margin: 4px 0;
  color: var(--text-2);
  font-size: 12.5px;
}
.kk-qc-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.kk-qc-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
  user-select: none;
}
.kk-qc-row.dragging {
  opacity: 0.5;
}
.kk-qc-row.drag-over {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.kk-qc-grip {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-3);
  cursor: grab;
  touch-action: none;
}
.kk-qc-row.dragging .kk-qc-grip {
  cursor: grabbing;
}
.kk-qc-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.18);
}
.kk-qc-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
.kk-qc-main .kk-ql {
  display: block;
  font-size: 13px;
  font-weight: 590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kk-qc-main code {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono, "SF Mono", ui-monospace, Menlo, monospace);
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kk-qc-acts {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}

.kk-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.kk-iconbtn:hover {
  background: var(--hover);
  color: var(--text);
}
.kk-iconbtn.danger:hover {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}
.kk-iconbtn[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* ====================== quick command icon/color ====================== */
.kk-picker-row {
  display: flex;
  gap: 14px;
}
.kk-picker-row .kk-pk {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kk-picker-row .kk-pk.kk-pk-preview {
  flex: 1 1 auto;
  min-width: 0;
}
.kk-picker-row .kk-pk > span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 590;
}
.kk-pk-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0.5px solid var(--border-strong);
  background: var(--field);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.kk-pk-trigger.color {
  color: #fff;
}
.kk-pk-trigger:hover,
.kk-pk-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.kk-icon-grid,
.kk-color-grid {
  position: absolute;
  top: 70px;
  left: 0;
  z-index: 5;
  display: grid;
  padding: 9px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow);
}
.kk-icon-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.kk-color-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.kk-icon-grid button,
.kk-color-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: var(--muted);
  color: var(--text);
  cursor: pointer;
}
.kk-icon-grid button:hover {
  background: var(--hover);
}
.kk-icon-grid button.active {
  background: var(--accent);
  color: #fff;
}
.kk-color-grid button.active {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.kk-qc-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--field);
  box-shadow: inset 0 0 0 0.5px var(--border-strong);
  font-size: 13px;
  font-weight: 560;
}
.kk-qc-preview-ico {
  display: inline-flex;
  flex: 0 0 auto;
}
.kk-qc-preview-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====================== quick command command field =================== */
.kk-qc-cmd-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kk-qc-cmd-head .kk-lbl {
  display: flex;
  align-items: center;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 590;
}
.kk-qc-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.12s;
}
.kk-qc-ai-btn:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.kk-qc-cmd-wrap {
  position: relative;
}
.kk-qc-ai-popover {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 15;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100% - 16px));
  padding: 11px;
  background: var(--bg);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.kk-qc-ai-popover .kk-lbl {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 590;
}
.kk-qc-ai-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.kk-qc-ai-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

/* ====================== quick command library ========================= */
.kk-qc-library-sheet .kk-dlg-body {
  gap: 12px;
}
.kk-qc-lib-tabs,
.kk-qc-lib-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  border-radius: 9px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.kk-qc-lib-tab {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.kk-qc-lib-tab:hover {
  color: var(--text);
}
.kk-qc-lib-tab[data-state="active"] {
  background: var(--bg);
  color: var(--text);
  font-weight: 590;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}
.kk-qc-lib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kk-qc-lib-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border);
}
.kk-qc-lib-entry > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.kk-qc-lib-entry-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.kk-qc-lib-entry-title strong {
  font-size: 13px;
  font-weight: 590;
}
.kk-qc-lib-entry p {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 12px;
}
.kk-qc-lib-entry code {
  display: block;
  margin-top: 5px;
  font-family: var(--font-mono, "SF Mono", ui-monospace, Menlo, monospace);
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kk-qc-lib-entry.danger strong,
.kk-qc-lib-entry.danger code {
  color: var(--red);
}
.kk-qc-lib-entry-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}
.kk-qc-danger-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
}

/* Nested subdialogs (edit / library) stack above the manager. The manager
   backdrop already dims the app, so this layer stays transparent — it only
   raises the z-index, never adds a second visual dim over the manager. */
.kk-dlg-backdrop.kk-qc-subdialog {
  z-index: 136;
  background: transparent;
}
