/* Actions, their memory and an isolated trial share one working surface. */
#tools-view .tools-layout { grid-template-columns: minmax(270px, 360px) minmax(0, 1fr); max-width: 1300px; gap: 38px; }
.tools-main, .tools-inspector { min-width: 0; }
#tools-view .tools-list-heading { display: block; margin-bottom: 18px; }
#tools-view .tools-list-heading h2 { margin-bottom: 14px; }
#tools-view .tools-list-heading label { width: 100%; }
#tools-view .card-list { gap: 3px; }
#tools-view .tool-card { padding: 0; border: 1px solid transparent; border-radius: 6px; position: relative; }
#tools-view .tool-card.is-selected { background: var(--muted); border-color: var(--border); }
#tools-view .tool-card:has(.tool-select:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tool-select { display: grid; gap: 7px; width: 100%; padding: 16px 16px 36px; border: 0; background: transparent; text-align: left; color: var(--foreground); border-radius: 6px; cursor: pointer; }
.tool-select:hover { background: var(--muted); }
.tool-select strong { font-size: 14px; font-weight: 600; }
.tool-select code { font-size: 11px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.tool-select .tool-assignments { margin: 0; font-size: 11px; line-height: 1.6; }
.tool-memory-link { position: absolute; bottom: 12px; left: 16px; max-width: calc(100% - 32px); background: transparent; border: 0; padding: 0; color: var(--muted-foreground); font-size: 11px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.tool-memory-link:hover { text-decoration: underline; color: var(--foreground); }
#tool-detail { padding-bottom: 28px; scroll-margin-top: 20px; }
.tool-detail-heading { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.tool-detail-heading > div { min-width: 0; }
.tool-detail-heading h2 { font-size: 21px; line-height: 1.4; margin-bottom: 6px; overflow-wrap: anywhere; }
.tool-detail-heading code { font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.tool-detail-heading .button-row { flex-shrink: 0; }
.tool-purpose { margin: 20px 0; font-size: 13px; line-height: 1.7; max-width: 75ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.tool-context { display: grid; gap: 14px; margin: 22px 0; }
.tool-context > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; font-size: 12px; }
.tool-context dt { color: var(--muted-foreground); }
.tool-context dd { margin: 0; overflow-wrap: anywhere; }
.tool-context dd span { display: block; margin-top: 5px; color: var(--muted-foreground); }
.tool-context button { text-align: left; font-size: 12px; }
.tool-dependencies { margin-bottom: 22px; font-size: 12px; }
.tool-dependencies summary { cursor: pointer; }
.dependency-list { margin: 12px 0; padding: 0; list-style: none; font-size: 12px; }
.dependency-list li { padding: 6px 0; overflow-wrap: anywhere; }
.dependency-list span { color: var(--muted-foreground); margin-right: 8px; }
.tool-trial { margin-top: 20px; }
.tool-trial > summary { width: fit-content; font-size: 12px; cursor: pointer; color: var(--muted-foreground); }
.tool-trial > summary:hover { color: var(--foreground); }
.tool-trial[open] > summary { margin-bottom: 16px; color: var(--foreground); }
.tool-trial-body { max-width: 640px; padding-left: 14px; border-left: 1px solid var(--border); }
.tool-trial-body > .help-text { margin-bottom: 16px; }
#tool-trial-input { margin-bottom: 14px; }
#tool-trial-result:empty { display: none; }
#tool-trial-result { margin-top: 20px; }
.trial-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.trial-comparison h4, .trial-read-value h4 { font-size: 12px; font-weight: 500; margin-bottom: 8px; color: var(--muted-foreground); }
.trial-value { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.trial-value p { margin: 0; white-space: pre-wrap; }
.trial-value ul { margin: 0; padding-left: 18px; }
.trial-value li + li { margin-top: 6px; }
.trial-value dl { margin: 0; }
.trial-value dl > div { margin-bottom: 8px; }
.trial-value dt { font-weight: 500; }
.trial-value dd { margin-left: 12px; }
.trial-returned { margin-top: 16px; font-size: 11px; color: var(--muted-foreground); }
.trial-returned summary { cursor: pointer; margin-bottom: 10px; }
.trial-returned pre { color: var(--foreground); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; padding: 12px; background: var(--muted); border-radius: 4px; margin: 0; }
.state-value-tree { min-width: 0; }
.state-value-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.state-value-heading label { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.state-value-heading select { width: auto; max-width: 150px; font-size: 11px; padding: 5px 8px; }
.state-value-field { min-width: 0; }
.state-value-field textarea, .state-value-field input:not([type=checkbox]) { width: 100%; }
.state-value-field input[type=checkbox] { width: 32px; height: 20px; cursor: pointer; accent-color: var(--primary); }
.state-value-children { padding-left: 14px; border-left: 1px solid var(--border); }
.state-value-item { display: flex; align-items: start; gap: 12px; margin-bottom: 16px; }
.state-value-item > .state-value-field { flex: 1; }
.state-value-item > button { margin-top: 8px; flex-shrink: 0; font-size: 11px; }
.state-value-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 16px; }
.state-value-add input { flex: 1; min-width: 100px; }
.state-value-add .button { flex-shrink: 0; }
.value-empty { color: var(--muted-foreground); font-size: 12px; margin: 10px 0; }
.state-json-editor { margin: 12px 0 18px; font-size: 11px; color: var(--muted-foreground); }
.state-json-editor summary { cursor: pointer; margin-bottom: 10px; }
.state-json-editor textarea { font-family: var(--font-mono, monospace); font-size: 12px; }
.field-error { color: var(--destructive, #b91c1c); font-size: 12px; line-height: 1.6; margin: 10px 0; overflow-wrap: anywhere; }
.field-error:empty { display: none; }
#state-dependencies { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 14px; }
#state-dependencies:empty { display: none; }
#state-dependencies h3 { font-size: 13px; }
.tool-technical { margin: 20px 0 0; }
.tool-technical[open] > summary { margin-bottom: 12px; }
@media (max-width: 1100px) {
  #tools-view .tools-layout { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 24px; }
  .tool-detail-heading { flex-direction: column; }
}
@media (max-width: 850px) {
  #tools-view .tools-layout { grid-template-columns: minmax(0, 1fr); }
  #tools-view .tools-list-heading { display: flex; flex-direction: row; align-items: baseline; }
  #tools-view .tools-list-heading label { max-width: 220px; }
  #tools-view .tools-list-heading h2 { flex-shrink: 0; }
  .tool-detail-heading { flex-direction: row; flex-wrap: wrap; }
  .tool-context > div { grid-template-columns: 90px minmax(0, 1fr); }
  .state-value-item { gap: 8px; }
  .state-value-children { padding-left: 8px; }
}
@media (max-width: 450px) {
  .trial-comparison { grid-template-columns: minmax(0, 1fr); }
  .state-value-heading { flex-wrap: wrap; }
  .state-value-heading select { max-width: 115px; }
}

.tool-field-grid > label { min-width: 0; }
.tool-field-grid select { min-width: 0; max-width: 100%; }
@media (max-width: 650px) {
  .tool-field-grid { grid-template-columns: minmax(0, 1fr); }
}
