.tools-pane {
  padding: 14px 12px 12px;
  /* flex column so tab panels expand to fill remaining height */
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* ─── CSS-only tab inputs — hidden but track active tab state ─── */
.tab-input {
  display: none;
}

/* ─── Tab bar ─── */
/* Segmented control pill matching the landing-page design language */
.pane-tab-bar {
  display: flex;
  background: rgba(38, 107, 246, 0.06);
  border: 1px solid rgba(38, 107, 246, 0.12);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

/* Each tab label acts as the clickable tab button */
.pane-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Inter', 'Avenir Next', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #585f6a;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.2;
}
.pane-tab:hover {
  color: #266bf6;
}

/* Active tab: blue fill — uses :checked on the sibling radio input */
#tab-runtime:checked     ~ .pane-tab-bar label[for="tab-runtime"],
#tab-tools-panel:checked ~ .pane-tab-bar label[for="tab-tools-panel"] {
  background: #266bf6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(38, 107, 246, 0.25);
}

/* ─── Tab panels ─── */
.tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1;          /* fill remaining pane height */
  min-height: 0;    /* allow shrink below natural size so overflow:hidden works */
  overflow: hidden;
  gap: 4px;
}

/* Tools panel is hidden by default (Runtime is the default tab) */
.tab-panel-tools {
  display: none;
}

/* Switch to tools panel when its radio is :checked */
#tab-tools-panel:checked ~ .tab-panel-runtime { display: none; }
#tab-tools-panel:checked ~ .tab-panel-tools   { display: flex; }

/* Scrollable areas inside each tab panel */
.tab-panel .agent-catalog,
.tab-panel .tool-catalog,
.tab-panel #tools-groups {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

/* tools-actions always pinned to the bottom of the Tools tab */
.tab-panel .tools-actions {
  flex-shrink: 0;
  margin-top: 4px;
}
.tab-panel .tools-counter {
  flex-shrink: 0;
}

/* ─── Pane header: title + collapse button side-by-side ─── */
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  min-height: 28px;
}

.pane-title {
  font-family: 'Manrope', 'Avenir Next', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #00003c;
  letter-spacing: -0.2px;
  margin-bottom: 0;
}

/* ─── Collapse toggle button (label for the hidden checkbox) ─── */
.tools-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  color: #585f6a;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  /* smooth flip animation when collapsed */
  transition: transform 0.28s ease, background 0.15s, color 0.15s;
}

.tools-collapse-btn:hover {
  background: rgba(38, 107, 246, 0.08);
  color: #266bf6;
}

.tools-subtitle {
  font-family: 'Inter', 'Avenir Next', sans-serif;
  color: #585f6a;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 2px;
}

.agent-catalog,
.tool-catalog,
#tools-groups {
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
}

.agent-runtime-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 7px;
  margin-bottom: 5px;
  background: var(--panel);
}

.agent-runtime-row.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.28), 0 0 0 5px rgba(var(--brand-rgb), 0.1);
}

.agent-runtime-row.is-blocked {
  border-color: #b42318;
}

.agent-runtime-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.agent-runtime-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agent-toggle {
  width: 14px;
  height: 14px;
  margin: 0;
}

.agent-runtime-name {
  font-weight: 700;
  font-size: 12px;
}

.agent-runtime-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agent-runtime-badge.is-active {
  color: var(--brand-ink);
  border-color: var(--brand);
}

.agent-runtime-badge.is-blocked {
  color: #7a1711;
  border-color: #b42318;
}

.agent-runtime-badge.is-done,
.agent-runtime-badge.is-idle {
  color: var(--muted);
  border-color: var(--line);
}

.runtime-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98a2b3;
}

.runtime-dot.is-active {
  background: var(--ok);
  animation: runtimePulse 1s ease-in-out infinite;
}

.runtime-dot.is-blocked {
  background: #b42318;
}

.runtime-dot.is-done,
.runtime-dot.is-idle {
  background: #98a2b3;
}

@keyframes runtimePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.agent-runtime-meta {
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
}

.tool-runtime-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 7px;
  margin-bottom: 5px;
  background: var(--panel);
}

.tool-runtime-row.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.28), 0 0 0 5px rgba(var(--brand-rgb), 0.1);
}

.tool-runtime-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tool-runtime-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-toggle-mini {
  width: 14px;
  height: 14px;
  margin: 0;
}

.tool-runtime-name {
  font-weight: 650;
  font-size: 12px;
}

.tool-runtime-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tool-chip {
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 5px;
  color: var(--muted);
}

.tool-chip.is-used {
  color: var(--ok);
  border-color: rgba(14, 159, 110, 0.35);
}

.tool-runtime-meta {
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
}

.tool-group {
  margin-bottom: 18px;
}

#tools-groups {
  display: none;
}

.tool-group h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.tool-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
}

.tool-toggle {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.tool-name {
  font-weight: 600;
}

.tool-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.tools-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tools-actions button {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.tools-counter {
  color: var(--muted);
  margin-top: 4px;
  font-size: 11px;
}

/* CSS tooltip for tool cards */
.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg, #101828);
  color: var(--bg, #fff);
  font-size: 11px;
  line-height: 1.4;
  padding: 5px 8px;
  border-radius: 5px;
  width: 200px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.has-tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--fg, #101828);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before {
  opacity: 1;
}
