/* IDE.UtilityPane (SR-0) — tabbed container above the asset list.
   Design: Documents/Todo/SEARCH_ARCHITECTURE.md §3. Reuses the
   sidebar-section flex/scroll/resize idiom the Knowledge Pane had. */

.ide-utility-section {
  display: flex;
  flex-direction: column;
  flex: 0 0 40%;
  overflow: hidden;
  min-height: 80px;
}

.ide-utility-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.ide-utility-chev {
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  opacity: 0.7;
  padding: 0 2px;
}
.ide-utility-chev:hover {
  opacity: 1;
}

/* Tab strip ------------------------------------------------------------ */
.ide-utility-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1 1 auto;
  overflow-x: auto;
}

.ide-utility-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-dim, #9a9ab0);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.ide-utility-tab:hover {
  color: var(--text, #e6e6f0);
  background: var(--hover-bg, rgba(255, 255, 255, 0.04));
}
.ide-utility-tab.active {
  color: var(--text, #e6e6f0);
  border-bottom-color: var(--accent, #3a78c4);
  font-weight: 600;
}
.ide-utility-tab-icon {
  font-size: 13px;
}
.ide-utility-tab-badge {
  min-width: 16px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  color: #fff;
  background: var(--accent, #3a78c4);
  border-radius: 8px;
}

/* Body — one host; the active tab's body element is shown ------------- */
.ide-utility-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}
.ide-utility-tab-body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* The Knowledge Pane, now hosted inside a tab body, no longer owns its
   own section chrome — it renders a thin toolbar + its sections. */
.ide-kp-body-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.ide-kp-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 2px 4px;
  flex: 0 0 auto;
}
.ide-kp-body-wrap .ide-kp-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.ide-utility-resize-handle {
  flex: 0 0 auto;
}

/* compose() group tabs — stacked member panels inside one tab body ---- */
.ide-utility-panel {
  border-bottom: 1px solid var(--border, #2a2a40);
}
.ide-utility-panel:last-child {
  border-bottom: none;
}
/* synthesized header for adopted *tabs* (sections bring their own) */
.ide-utility-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim, #9a9ab0);
  user-select: none;
}
.ide-utility-panel-header:hover {
  color: var(--text, #e6e6f0);
}
.ide-utility-panel-chev {
  font-size: 10px;
  opacity: 0.7;
}
/* A relocated .sidebar-section must stack (not stretch) inside the tab
   body, and not try to own the full sidebar height as it did at root. */
.ide-utility-tab-body .sidebar-section {
  flex: 0 0 auto;
}
.ide-utility-tab-body .ide-kp-section,
.ide-utility-tab-body .ide-links-pane {
  flex: 0 0 auto;
}

/* SR-2 — the Search tab body. */
.ide-search-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.ide-srchp-controls {
  display: flex;
  gap: 4px;
  padding: 4px;
  flex: 0 0 auto;
}
.ide-srchp-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}
.ide-srchp-input:focus {
  border-color: var(--accent, #3a78c4);
}
.ide-srchp-toggle {
  background: var(--bg-input, #0f0f1e);
  color: var(--text-dim, #9a9ab0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}
.ide-srchp-toggle.active {
  background: var(--accent, #3a78c4);
  color: #fff;
  border-color: var(--accent, #3a78c4);
}
.ide-srchp-scope {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
.ide-srchp-scope .ide-srchp-scope-act {
  background: none;
  border: none;
  color: var(--accent, #5b9bd5);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  text-decoration: underline;
}
.ide-srchp-status {
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
.ide-srchp-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 2px 4px 8px;
}
.ide-srchp-asset {
  margin-bottom: 4px;
}
.ide-srchp-asset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e6e6f0);
  border-radius: 4px;
}
.ide-srchp-asset-head:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.05));
}
.ide-srchp-asset-count {
  font-size: 10px;
  color: #fff;
  background: var(--accent, #3a78c4);
  border-radius: 8px;
  padding: 0 6px;
  font-weight: 400;
}
.ide-srchp-asset.collapsed .ide-srchp-matches {
  display: none;
}
.ide-srchp-match {
  display: flex;
  gap: 6px;
  padding: 2px 6px 2px 14px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
}
.ide-srchp-match:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.05));
}
.ide-srchp-ln {
  color: var(--text-dim, #777);
  flex: 0 0 auto;
  min-width: 28px;
  text-align: right;
}
.ide-srchp-ctx {
  color: var(--text-dim, #b8b8c8);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-srchp-ctx mark {
  background: var(--mark-bg, #f5d33a);
  color: #1a1a36;
  border-radius: 2px;
}
.ide-srchp-more,
.ide-srchp-skipped {
  padding: 2px 14px;
  font-size: 11px;
  color: var(--text-dim, #888);
}

/* SR-4 — the other versions of the same document. Quiet by default: the point
   of folding a family is that ONE row leads, so the siblings must not compete
   with it visually. But they are buttons, not text, because the whole reason
   they are kept is that one of them is sometimes the row you wanted. */
.ide-srchp-also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 6px;
  font-size: 11px;
  color: var(--text-dim, #888);
}
.ide-srchp-also-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  border: 1px solid var(--border, #3a3a5c);
  background: transparent;
  color: var(--text-dim, #888);
}
.ide-srchp-also-chip:hover,
.ide-srchp-also-chip.open {
  color: var(--text, #e0e0f0);
  border-color: var(--accent, #6c63ff);
}
.ide-srchp-also-n {
  opacity: 0.75;
}
.ide-srchp-sib {
  border-left: 2px solid var(--border, #3a3a5c);
  margin-left: 14px;
}

/* SL-2 — the Links tab body. */
.ide-links-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 8px;
  font-size: 12px;
}
.ide-lp-head {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border, #3a3a5e);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.ide-lp-focus {
  color: var(--text-dim, #9a9ab0);
  margin-bottom: 4px;
  word-break: break-all;
}
.ide-lp-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.ide-lp-analyse {
  background: var(--accent, #3a78c4);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}
.ide-lp-analyse:disabled {
  opacity: 0.6;
  cursor: default;
}
.ide-lp-aligner {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 4px;
}
.ide-lp-coverage {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ide-lp-cov-bar {
  flex: 1 1 auto;
  height: 6px;
  background: var(--bg-input, #0f0f1e);
  border-radius: 3px;
  overflow: hidden;
}
.ide-lp-cov-bar > span {
  display: block;
  height: 100%;
  background: var(--accent, #2bb673);
}
.ide-lp-cov-label {
  flex: 0 0 auto;
  color: var(--text-dim, #9a9ab0);
  font-size: 11px;
}
.ide-lp-sec-title {
  font-weight: 600;
  margin: 6px 0 3px;
  color: var(--text-dim, #9a9ab0);
}
.ide-lp-sib,
.ide-lp-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
}
.ide-lp-sib:hover,
.ide-lp-link:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.05));
}
.ide-lp-sib-name,
.ide-lp-from,
.ide-lp-to {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-lp-sib-name {
  flex: 1 1 auto;
  font-weight: 500;
}
.ide-lp-sib-type,
.ide-lp-sib-count {
  color: var(--text-dim, #888);
  font-size: 11px;
}
.ide-lp-open,
.ide-lp-go {
  background: var(--bg-input, #0f0f1e);
  color: var(--accent, #5b9bd5);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  cursor: pointer;
}
.ide-lp-from {
  flex: 1 1 40%;
}
.ide-lp-to {
  flex: 1 1 40%;
  color: var(--text-dim, #b8b8c8);
}
.ide-lp-arrow {
  color: var(--text-dim, #777);
}
.ide-lp-aligner-badge {
  font-size: 10px;
  border-radius: 8px;
  padding: 0 6px;
  background: var(--bg-input, #0f0f1e);
  color: var(--text-dim, #9a9ab0);
}
.ide-lp-al-ai {
  background: rgba(58, 120, 196, 0.3);
  color: #cfe0f5;
}
.ide-lp-al-manual {
  background: rgba(43, 182, 115, 0.3);
  color: #d6f5e6;
}

/* OCR-3 — object hits (OCR regions + concepts) in the Search pane. */
.ide-srchp-objsec {
  margin-bottom: 8px;
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  background: rgba(91, 155, 213, 0.06);
}
.ide-srchp-objsec-head {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #5b9bd5);
  border-bottom: 1px solid var(--border, #3a3a5e);
}
.ide-srchp-obj {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(58, 58, 94, 0.4);
}
.ide-srchp-obj:last-child {
  border-bottom: none;
}
.ide-srchp-obj-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ide-srchp-obj-badge {
  font-size: 12px;
}
.ide-srchp-obj-name {
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--text, #e0e0ef);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-srchp-obj-locate {
  background: transparent;
  border: none;
  color: var(--accent, #5b9bd5);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
}
.ide-srchp-obj-locate:hover {
  color: #cfe0f5;
}
.ide-srchp-obj-snippet {
  font-size: 11px;
  color: var(--text-dim, #b8b8c8);
  margin: 2px 0 0 18px;
}
.ide-srchp-obj-follow {
  margin: 3px 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ide-srchp-follow {
  background: var(--bg-input, #0f0f1e);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 8px;
  color: var(--text-dim, #9a9ab0);
  cursor: pointer;
  font-size: 10px;
  padding: 0 6px;
}
.ide-srchp-follow:hover {
  color: #cfe0f5;
  border-color: var(--accent, #5b9bd5);
}

/* OCR-7 — "Build object references" affordance in the Links pane. */
.ide-lp-empty {
  padding: 12px;
  text-align: center;
}
.ide-lp-build {
  background: var(--accent, #5b9bd5);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  margin: 6px 0;
}
.ide-lp-build:disabled {
  opacity: 0.6;
  cursor: default;
}
.ide-lp-build-hint {
  font-size: 11px;
  margin-top: 4px;
}
.ide-lp-build-status {
  font-size: 11px;
  color: var(--text-dim, #b8b8c8);
  margin-top: 8px;
}

/* EN-5 — search multi-select → note */

.ide-srchp-pick {
  flex: 0 0 auto;
  margin: 2px 4px 0 0;
  accent-color: #1a6fd4;
  cursor: pointer;
}

.ide-srchp-selbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #eef5ff;
  border-bottom: 1px solid #d4e3f7;
}

.ide-srchp-selbar-count {
  font-weight: 600;
  color: #1a4f8f;
}

.ide-srchp-selbar-add,
.ide-srchp-selbar-clear {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: #fff;
  padding: 1px 8px;
  cursor: pointer;
  font-size: 12px;
}

.ide-srchp-selbar-add:hover {
  background: #e7f0fe;
}

/* ------------------------------------------------------------------ */
/* WA-4 — the Ask tab body. Deliberately sized and coloured like the   */
/* Search pane beside it: they share a scope chip, so reading as two   */
/* halves of one surface is the point, not a coincidence.             */
/* ------------------------------------------------------------------ */
.ide-ask-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}
.ide-askp-intro {
  padding: 6px 8px 2px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
.ide-askp-scope {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
.ide-askp-scope .ide-askp-scope-act {
  background: none;
  border: none;
  color: var(--accent, #5b9bd5);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  text-decoration: underline;
}
.ide-askp-controls {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  flex: 0 0 auto;
  align-items: flex-start;
}
.ide-askp-input {
  flex: 1 1 auto;
  min-width: 0;
  resize: vertical;
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.45;
  outline: none;
}
.ide-askp-input:focus {
  border-color: var(--accent, #3a78c4);
}
.ide-askp-go {
  flex: 0 0 auto;
  background: var(--accent, #3a78c4);
  color: #fff;
  border: 1px solid var(--accent, #3a78c4);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.ide-askp-go[disabled] {
  opacity: 0.6;
  cursor: default;
}
.ide-askp-status {
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
/* The "what your choice left out" sentence. Set apart, because it is the
   one line that explains a thinner-than-expected answer. */
.ide-askp-note {
  margin: 4px 8px;
  padding: 6px 8px;
  border-left: 3px solid var(--accent, #5b9bd5);
  background: var(--bg-input, #0f0f1e);
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim, #9a9ab0);
  flex: 0 0 auto;
}
.ide-askp-answer {
  padding: 4px 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text, #e6e6f0);
  flex: 0 0 auto;
}
.ide-askp-answer p {
  margin: 0 0 8px;
}
.ide-askp-widen {
  background: var(--accent, #3a78c4);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  margin-top: 4px;
}
.ide-askp-sources {
  padding: 0 8px 6px;
  flex: 0 0 auto;
}
.ide-askp-src-head {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim, #9a9ab0);
  margin: 6px 0 3px;
}
.ide-askp-src-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ide-askp-src {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 3px 4px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim, #9a9ab0);
}
.ide-askp-src.is-openable {
  cursor: pointer;
}
.ide-askp-src.is-openable:hover {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
}
.ide-askp-src-icon {
  flex: 0 0 auto;
}
.ide-askp-src-text {
  min-width: 0;
  word-break: break-word;
}
.ide-askp-src-where {
  display: block;
  font-size: 10px;
  opacity: 0.75;
}
.ide-askp-save {
  padding: 2px 8px 10px;
  flex: 0 0 auto;
}
.ide-askp-savebtn {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.ide-askp-savebtn:hover {
  border-color: var(--accent, #3a78c4);
}

/* SR-4 — "some of this isn't shared with you". A search of a workspace you
   hold PART of must not look like a search of one you hold all of; without
   this line the honest conclusion ("it isn't in here") is wrong. The server
   counts what it withheld and never names it. */
.ide-srchp-not-yours {
  margin: 10px 4px 4px;
  padding: 6px 8px;
  border-left: 2px solid var(--border, #444);
  font-size: 11.5px;
  line-height: 1.45;
  opacity: 0.75;
}

/* RC-3 (F-CW20) — the content tab hosts ONE viewer's helper panel, which
   scrolls inside itself (its script, notes and recorder). */
.ide-utility-tab-body.ide-content-pane-body {
  overflow: hidden;
  min-height: 0;
}
