.knowledge-operations-shell {
  display: grid;
  grid-template-rows: auto 34px 82px 42px 42px minmax(0, 1fr);
  gap: 10px;
  height: calc(100vh - 116px);
  min-height: 660px;
  font-size: 12px;
}

.knowledge-operations-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 150px 110px 96px 34px;
  gap: 8px;
  align-items: end;
}

.knowledge-operations-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted, #9bb3cd);
  font-size: 10px;
}

.knowledge-operations-toolbar input,
.knowledge-operations-toolbar select {
  width: 100%;
  height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--border, #2c3a4d);
  border-radius: 6px;
  background: var(--panel-alt, #111923);
  color: var(--text, #edf4ff);
  padding: 0 10px;
  font-size: 12px;
}

.knowledge-info { width: 34px; height: 34px; padding: 0; }

.knowledge-operations-message {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  border-left: 3px solid #5b9be5;
  background: rgba(91, 155, 229, 0.08);
  color: #b9cee6;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.knowledge-operations-message.success { border-color: #45c99a; color: #86e5c2; }
.knowledge-operations-message.error { border-color: #ef6c75; color: #ffabb0; }
.knowledge-operations-message.loading { border-color: #efb94f; color: #f4d58b; }

.knowledge-operations-summary {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
}

.knowledge-operations-metric {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #2c3a4d);
  background: var(--panel, #182230);
}

.knowledge-operations-metric span { color: #9bb3cd; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-operations-metric strong { font-size: 16px; color: #f4f8ff; }

.knowledge-operations-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border, #2c3a4d); }
.knowledge-operations-tabs button { height: 36px; border-radius: 5px 5px 0 0; background: transparent; color: #9bb3cd; }
.knowledge-operations-tabs button.active { color: #fff; border-color: #5b9be5; background: rgba(91, 155, 229, 0.16); }

.knowledge-operations-package-basket { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #2c3a4d; background: #101923; }
.knowledge-operations-package-basket span { margin-right: auto; color: #a9bfd8; }
.knowledge-operations-package-basket button { height: 28px; padding: 0 9px; font-size: 10px; }
.knowledge-operations-package-members { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.knowledge-operations-package-members li { padding: 6px 8px; border: 1px solid #33445a; color: #dcecff; overflow-wrap: anywhere; }

.knowledge-operations-grid {
  display: grid;
  grid-template-columns: minmax(720px, 1.65fr) minmax(360px, 0.85fr);
  gap: 10px;
  min-height: 0;
}

.knowledge-operations-list-panel,
.knowledge-operations-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border, #2c3a4d);
  background: var(--panel, #182230);
  overflow: hidden;
}

.knowledge-operations-list-panel { display: grid; grid-template-rows: 42px minmax(0, 1fr) 42px; }
.knowledge-operations-detail-panel { display: grid; grid-template-rows: 42px auto minmax(0, 1fr); }
.knowledge-operations-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--border, #2c3a4d); }
.knowledge-operations-list-head strong { font-size: 14px; }
.knowledge-operations-list-head span { color: #9bb3cd; font-size: 10px; }
.knowledge-operations-table-wrap,
.knowledge-operations-detail { min-height: 0; overflow: auto; }
.knowledge-operations-table { width: 100%; table-layout: fixed; font-size: 12px; }
.knowledge-operations-table th { position: sticky; top: 0; z-index: 1; background: #182230; font-size: 10px; }
.knowledge-operations-table th,
.knowledge-operations-table td { padding: 9px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-operations-table tbody tr { cursor: pointer; }
.knowledge-operations-table tbody tr:hover,
.knowledge-operations-table tbody tr.selected { background: rgba(91, 155, 229, 0.14); }
.knowledge-operations-table small { display: block; color: #829ab5; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.knowledge-operations-table th:last-child,
.knowledge-operations-table td:last-child { width: 142px; }
.knowledge-operations-row-actions { display: flex; gap: 5px; min-height: 30px; align-items: center; }
.knowledge-operations-row-actions button { min-width: 40px; height: 28px; padding: 0 7px; font-size: 10px; }

.knowledge-operations-command-bar {
  min-height: 42px;
  box-sizing: border-box;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border, #2c3a4d);
}
.knowledge-operations-command-bar:not([hidden]) { display: flex; gap: 6px; align-items: center; }
.knowledge-operations-command-bar button { height: 28px; padding: 0 9px; font-size: 10px; }

.knowledge-operations-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--border, #2c3a4d); }
.knowledge-operations-pagination span { min-width: 64px; text-align: center; font-size: 10px; }
.knowledge-operations-detail { padding: 12px; }
.knowledge-operations-detail h4 { margin: 0; font-size: 16px; }
.knowledge-operations-detail h5 { margin: 14px 0 7px; font-size: 12px; }
.knowledge-operations-detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.knowledge-operations-detail-meta span { padding: 3px 6px; border: 1px solid #33445a; color: #a9bfd8; font-size: 9px; }
.knowledge-operations-lineage { display: grid; grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr); border-top: 1px solid #2b394b; }
.knowledge-operations-lineage dt,
.knowledge-operations-lineage dd { margin: 0; padding: 7px 6px; border-bottom: 1px solid #2b394b; overflow-wrap: anywhere; }
.knowledge-operations-lineage dt { color: #8fa9c5; font-size: 10px; }
.knowledge-operations-lineage dd { color: #eef5ff; }
.knowledge-operations-json { display: grid; gap: 4px; }
.knowledge-operations-json-row { display: grid; grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr); gap: 8px; padding: 5px 6px; background: rgba(8, 14, 22, .38); }
.knowledge-operations-json-row span:first-child { color: #8fa9c5; font-size: 10px; }
.knowledge-operations-json-row span:last-child { overflow-wrap: anywhere; }
.knowledge-operations-empty { display: grid; place-items: center; min-height: 140px; color: #8fa9c5; text-align: center; }
.knowledge-operations-table .knowledge-operations-empty-cell { white-space: normal; text-align: center; color: #8fa9c5; height: 140px; }

.knowledge-operations-command-dialog {
  width: min(620px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid #40536c;
  border-radius: 6px;
  background: #141d29;
  color: #eef5ff;
}
.knowledge-operations-command-dialog::backdrop { background: rgba(3, 8, 14, .72); }
.knowledge-operations-command-dialog form { display: grid; gap: 12px; padding: 16px; max-height: calc(100vh - 96px); overflow: auto; }
.knowledge-operations-command-dialog header,
.knowledge-operations-command-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.knowledge-operations-command-dialog h3 { margin: 0; font-size: 16px; }
.knowledge-operations-command-dialog footer { justify-content: flex-end; }
.knowledge-operations-command-target { display: grid; grid-template-columns: 130px minmax(0, 1fr); margin: 0; border-top: 1px solid #2b394b; }
.knowledge-operations-command-target dt,
.knowledge-operations-command-target dd { margin: 0; padding: 6px; border-bottom: 1px solid #2b394b; overflow-wrap: anywhere; }
.knowledge-operations-command-target dt { color: #8fa9c5; font-size: 10px; }
.knowledge-operations-command-fields { display: grid; gap: 6px; }
.knowledge-operations-command-fields[hidden] { display: none; }
.knowledge-operations-command-fields label { color: #a9bfd8; font-size: 10px; }
.knowledge-operations-command-fields input,
.knowledge-operations-command-fields textarea,
.knowledge-operations-command-fields output {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #34465d;
  border-radius: 5px;
  background: #0f1721;
  color: #eef5ff;
  padding: 8px;
  font: inherit;
}
.knowledge-operations-command-fields textarea { resize: vertical; }
.knowledge-operations-command-fields p { margin: 0; color: #a9bfd8; }
.knowledge-operations-command-error { min-height: 18px; color: #ffabb0; }

@media (max-width: 1250px) {
  .knowledge-operations-toolbar { grid-template-columns: 1fr 1fr 140px 100px; }
  .knowledge-operations-toolbar button { align-self: end; }
  .knowledge-operations-summary { grid-template-columns: repeat(5, 1fr); }
  .knowledge-operations-grid { grid-template-columns: minmax(600px, 1.5fr) minmax(320px, .8fr); }
}
