.tool-detail {
  min-width:0;
  font-size:14px;
  color:var(--ink);
  letter-spacing:0;
}
.tool-detail .icon {width:16px; height:16px}
.tool-detail .btn,.tool-detail .field input,.tool-detail .field select,.tool-detail .field textarea {font-size:var(--font-ui)}
.tool-detail .btn {min-height:var(--control-height); border-radius:4px}
.tool-detail .icon-btn {width:var(--control-height); height:var(--control-height); border-radius:4px}
.tool-detail h1 {font-size:22px; line-height:30px; overflow-wrap:anywhere}
.tool-detail h2 {font-size:16px; line-height:24px}
.tool-detail code,.tool-detail pre,.tool-detail small,.tool-detail .badge {font-size:12px}
.tool-detail code {overflow-wrap:anywhere; word-break:break-word}
.detail-page-head {display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 0 20px}
.detail-actions {display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0}
.detail-page-head>.detail-actions {justify-content:flex-end}
.detail-summary {padding:24px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--surface)}
.detail-identity {display:flex; align-items:center; gap:16px; min-width:0}
.detail-avatar {display:grid; place-items:center; flex:0 0 58px; width:58px; height:58px; border-radius:8px; background:var(--primary); color:#fff; font-size:20px; font-weight:650; overflow:hidden}
.detail-identity-content {min-width:0; display:flex; align-items:flex-start; flex-direction:column; gap:5px}
.detail-badges {display:flex; gap:6px; flex-wrap:wrap}
.detail-tool-name {font-size:22px; line-height:30px; font-weight:650; overflow-wrap:anywhere; max-width:100%}
.detail-server-key {color:var(--primary-ink); max-width:100%}
.detail-metadata {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; min-width:0; gap:0}
.detail-meta-item {min-width:0; padding:15px 18px 15px 0; border-bottom:1px solid var(--line)}
.detail-meta-item dt {color:var(--muted); font-size:12px; margin:0 0 6px; line-height:20px}
.detail-meta-item dd {margin:0; min-width:0; color:var(--ink); line-height:22px; overflow-wrap:anywhere}
.detail-meta-item dd .tag-list {padding-top:0}
.detail-summary-metadata {grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,.6fr) minmax(0,.7fr) minmax(0,.8fr); margin-top:20px}
.detail-summary-metadata .detail-meta-item {border-bottom:0; padding:0 16px; border-right:1px solid var(--line)}
.detail-summary-metadata .detail-meta-item:first-child {padding-left:0}
.detail-summary-metadata .detail-meta-item:last-child {border-right:0}
.detail-completeness {font-weight:600; color:var(--primary-ink)}
.detail-tabs {min-width:0; overflow-x:auto; border-bottom:1px solid var(--line); background:var(--surface); margin-top:16px}
.detail-tabs>[role="tablist"] {display:flex; width:max-content; min-width:100%; gap:2px; padding:0 10px}
.detail-tab {display:flex; align-items:center; gap:7px; min-height:49px; padding:11px 13px; color:var(--muted); white-space:nowrap; border-bottom:2px solid transparent; font-weight:550; flex-shrink:0}
.detail-tab:hover {text-decoration:none; color:var(--primary-ink); background:var(--primary-soft)}
.detail-tab.active {color:var(--primary-ink); border-bottom-color:var(--primary); background:var(--primary-soft)}
.detail-tab-count {font-size:12px; min-width:19px; height:19px; padding:0 5px; display:inline-grid; place-items:center; background:var(--primary-soft); color:var(--primary-ink); border-radius:4px}
.detail-status-dot {width:7px; height:7px; display:inline-block; flex:0 0 7px; border-radius:50%; background:var(--primary)}
.detail-status-dot.amber {background:#d99020}
#tool-detail-panel {min-width:0; background:var(--surface)}
.detail-section {padding:24px; border-bottom:1px solid var(--line); min-width:0}
.detail-section:last-child {border-bottom:0}
.detail-section-head {display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; min-width:0}
.detail-section-head>div {min-width:0}
.detail-section-head p,.detail-caption {font-size:12px; color:var(--muted); line-height:20px}
.detail-section-head p {margin-top:4px}
.detail-section>.detail-metadata .detail-meta-item:nth-last-child(-n+3) {border-bottom:0}
.detail-inline-note {font-size:12px; color:var(--muted); margin-left:8px; font-weight:400}
.detail-placeholder {color:var(--muted); font-size:14px; padding:16px 0}
.detail-prose {line-height:24px; white-space:pre-wrap; overflow-wrap:anywhere}
.detail-markdown {margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:24px; font-family:inherit; max-height:460px; overflow:auto}
.detail-completeness-row {display:flex; align-items:center; gap:28px; padding:5px 0}
.detail-score {width:82px; height:82px; flex:0 0 82px; border:5px solid var(--primary-soft); border-top-color:var(--primary); border-right-color:var(--primary); border-radius:50%; display:flex; align-items:baseline; justify-content:center; padding-top:17px}
.detail-score strong {font-size:26px; line-height:32px}
.detail-score span {font-size:12px; color:var(--muted); margin-left:3px}
.detail-checks {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 26px}
.detail-checks>span {display:flex; align-items:center; gap:6px; color:var(--muted); font-size:14px}
.detail-checks>span.complete>.icon {color:var(--primary)}
.detail-checks small {margin-left:4px; white-space:nowrap}
.detail-form-grid {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; min-width:0}
.detail-fieldset {padding:0; margin:0; border:0; min-width:0}
.detail-form-footer {display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-top:20px}
.detail-form-footer>.btn:only-child {margin-left:auto}
.detail-note {display:flex; align-items:flex-start; gap:9px; padding:11px 12px; color:var(--primary-ink); background:var(--primary-soft); font-size:12px; line-height:20px; margin-top:16px; min-width:0}
.detail-note .icon {margin-top:2px}
.detail-note.amber {color:#8b5b0f; background:#fff8e9}
.detail-note+.detail-metadata {margin-top:10px}
.detail-note span {overflow-wrap:anywhere}
.detail-label {font-size:14px; font-weight:550; color:var(--text)}
.detail-check-label {display:flex; align-items:center; gap:8px; font-size:14px; line-height:22px}
.detail-switch-setting {display:flex; align-items:center; justify-content:space-between; gap:16px}
.detail-switch-setting>span {min-width:0; overflow-wrap:anywhere}
.detail-switch-setting>.ui-switch {flex-shrink:0}
#detail-headers-form .detail-label+.ui-switch {margin:8px 0 20px}
.tool-detail input[type="checkbox"],.tool-detail input[type="radio"] {width:16px; height:16px; min-height:16px; flex:0 0 16px; padding:0; margin:0; accent-color:var(--primary)}
.detail-checkboxes {display:grid; gap:14px; margin-top:20px}
.detail-table-wrap {overflow:auto; max-width:100%; width:100%; min-width:0}
.detail-table {width:100%; min-width:640px; border-collapse:collapse; table-layout:fixed; font-size:14px; text-align:left}
.detail-table th {color:var(--muted); font-weight:550; background:var(--surface-subtle,#f8fafb); font-size:12px}
.detail-table th,.detail-table td {padding:12px 14px; border-bottom:1px solid var(--line); overflow-wrap:anywhere; vertical-align:middle}
.detail-table th:first-child,.detail-table td:first-child {padding-left:0}
.detail-table td .badge {margin-left:5px}
.detail-table th:last-child,.detail-table td:last-child {width:74px; padding-right:0}
.detail-table td>.icon-btn {border:0}
.detail-gateway-address {display:flex; align-items:center; gap:12px; padding:14px 16px; background:#172222; color:#a9e4cf; min-width:0}
.detail-address-label {color:#dbe6e3; font-size:12px; white-space:nowrap}
.detail-gateway-address code {flex:1; min-width:0; line-height:22px}
.detail-gateway-address .icon-btn {background:transparent; color:#b6e2d6; border-color:#536762}
.detail-key-field {max-width:560px; margin-bottom:20px}
.detail-segmented {display:inline-flex; max-width:100%; overflow-x:auto; padding:3px; gap:2px; background:var(--surface-subtle,#f3f6f7); border:1px solid var(--line); border-radius:5px; vertical-align:top}
.detail-segmented button {padding:6px 12px; min-height:32px; border:0; background:transparent; color:var(--muted); font-size:14px; white-space:nowrap; border-radius:3px}
.detail-segmented button.active {background:var(--surface); color:var(--primary-ink); box-shadow:0 1px 3px #17222214; font-weight:550}
.detail-code-toolbar {display:flex; align-items:center; justify-content:space-between; min-height:42px; gap:12px; margin-top:10px; margin-bottom:7px}
.detail-code-toolbar>span {color:var(--muted); overflow-wrap:anywhere}
.tool-detail .detail-code {margin:0; padding:17px 18px; background:#172222; color:#dce6e2; border:1px solid #263735; border-radius:4px; font-family:"SFMono-Regular",Consolas,monospace; line-height:21px; overflow:auto; white-space:pre; overflow-wrap:normal; max-width:100%; tab-size:2}
.detail-code:empty {min-height:160px}
.detail-python {max-height:480px}
.detail-environment-summary {display:flex; align-items:center; gap:12px; padding:0 0 16px; min-width:0}
.detail-environment-summary>div {flex:1; min-width:0}
.detail-environment-summary strong {font-size:14px; font-weight:550}
.detail-environment-summary p {font-size:12px; color:var(--muted); margin-top:4px}
.detail-environment-icon {width:40px; height:40px; display:grid; place-items:center; border-radius:5px; background:var(--primary-soft); color:var(--primary-ink); flex-shrink:0}
.detail-environment-templates {display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:20px 0}
.detail-environment-templates label {font-size:12px; margin-right:4px}
.detail-environment-templates select {min-height:36px; padding:6px 30px 6px 10px}
.detail-environment-table {min-width:610px}
.detail-environment-table th:nth-child(1) {width:34%}
.detail-environment-table th:nth-child(2) {width:auto}
.detail-environment-table th:nth-child(3) {width:95px}
.detail-environment-table th:last-child {width:54px}
.detail-environment-table input {width:100%; font-size:14px; min-height:36px; padding:7px 9px}
.detail-environment-table input[name^="environment_name_"] {font-family:"SFMono-Regular",Consolas,monospace; font-size:12px}
.detail-environment-add {padding:12px 0 0}
.detail-environment-add>.btn {width:100%; border-style:dashed; color:var(--primary-ink)}
.detail-debug-connection {padding-bottom:20px; border-bottom:1px solid var(--line)}
.detail-debug-connection>.detail-label {margin-bottom:10px}
.detail-debug-key {max-width:560px; margin-top:16px}
.detail-debug-headers {margin-top:16px}
.detail-debug-headers summary,.detail-schema summary,.detail-source-history summary {font-size:12px; color:var(--muted); cursor:pointer; padding:6px 0}
.detail-debug-headers .field {max-width:700px; padding-top:10px}
.detail-debug-tool-row {display:flex; align-items:flex-end; gap:12px; margin:20px 0 24px}
.detail-debug-tool-row>.field {flex:1}
.detail-debug-grid {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; min-width:0}
.detail-debug-grid>div {min-width:0}
.detail-debug-grid textarea {font-family:"SFMono-Regular",Consolas,monospace; font-size:12px; min-height:234px}
.detail-tool-description {line-height:24px; white-space:pre-wrap; color:var(--text); overflow-wrap:anywhere}
.detail-schema {margin-top:16px}
.detail-schema .detail-code {max-height:320px}
.tool-detail .detail-debug-result {margin-top:24px; max-height:480px}
.detail-log-controls {display:flex; align-items:center; flex-wrap:wrap; gap:12px 18px; margin-bottom:18px}
.detail-log-controls>.detail-actions {margin-left:auto}
.detail-inline-field {display:flex; align-items:center; gap:8px; font-size:12px; font-weight:400}
.detail-inline-field select {min-height:36px; padding:5px 26px 5px 9px; font-size:14px}
.detail-log-filters {display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) minmax(0,1fr) auto; align-items:end; gap:12px}
.detail-log-filters>.field {min-width:0}
.detail-log-filters input {min-width:0; width:100%; padding:8px}
.detail-log-filters .field label {font-size:12px}
.detail-log-meta {display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:12px; color:var(--muted); margin:16px 0 10px; min-width:0}
.detail-log-meta>span {min-width:0; overflow-wrap:anywhere}
.tool-detail .detail-log-output {min-height:360px; height:480px; max-height:65dvh; color:#b9e7d1}
.detail-source-summary {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; font-size:12px; margin-bottom:16px; min-width:0}
.detail-source-summary>span {min-width:0; overflow-wrap:anywhere}
.detail-source-origin {display:flex; align-items:center; gap:8px; color:var(--muted)}
.detail-source-origin>span:not(.detail-inline-note) {max-width:320px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.detail-source-origin .detail-inline-note {margin-left:4px; white-space:nowrap}
.detail-source-toolbar {margin-bottom:16px; gap:6px}
.tool-detail .detail-source-toolbar .btn {min-height:32px; font-size:12px; padding:5px 9px; gap:6px}
.tool-detail .detail-source-toolbar .icon-btn {width:32px; height:32px}
.detail-toolbar-spacer {flex:1}
.detail-source-workspace {display:grid; grid-template-columns:240px minmax(0,1fr); gap:12px; min-width:0; height:640px}
.detail-source-files {border:1px solid var(--line); border-radius:6px; min-width:0; display:flex; flex-direction:column; overflow:hidden; background:#fff}
.detail-source-search {position:relative; border-bottom:1px solid var(--line); padding:8px}
.detail-source-search>.icon {position:absolute; top:18px; left:18px; color:var(--muted)}
.tool-detail .detail-source-search input {width:100%; padding:6px 8px 6px 31px; min-height:36px; font-size:12px}
.detail-file-list {flex:1; overflow:auto; padding:6px 4px; min-height:0; scrollbar-gutter:stable}
.detail-file {display:flex; align-items:center; gap:7px; border:0; background:transparent; width:100%; height:32px; min-height:32px; padding:5px 8px 5px 24px; text-align:left; border-radius:3px; color:var(--text)}
.detail-file:hover,.detail-file.active {color:var(--primary-ink); background:var(--primary-soft)}
.detail-file.active {box-shadow:inset 2px 0 var(--primary)}
.detail-file .detail-file-name {min-width:0; flex:1; font-size:12px; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.detail-file .detail-file-readonly {color:var(--muted); font-size:11px; white-space:nowrap}
.detail-file>.icon {color:var(--muted)}
.detail-tree-directory {min-width:0}
.detail-tree-directory>summary {display:flex; align-items:center; gap:6px; cursor:pointer; height:32px; padding:5px 7px; color:var(--text); font-size:12px; border-radius:3px; list-style:none; min-width:0}
.detail-tree-directory>summary::-webkit-details-marker {display:none}
.detail-tree-directory>summary:hover {background:#f5f7fa}
.detail-tree-directory>summary>span {overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.detail-tree-directory>summary>.icon:first-child {width:12px; height:12px; flex:0 0 12px; color:var(--muted)}
.detail-tree-directory[open]>summary>.icon:first-child {transform:rotate(90deg)}
.detail-tree-directory>summary>.icon:nth-child(2) {color:#8591a3}
.detail-tree-children {padding-left:12px}
.detail-tree-empty {padding:14px 10px; font-size:12px; color:var(--muted)}
.detail-tree-footer {display:flex; align-items:center; justify-content:space-between; min-height:33px; gap:8px; padding:3px 8px; border-top:1px solid var(--line); color:var(--muted); font-size:11px; background:#f9fafc}
.detail-tree-footer>span {min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tool-detail .detail-tree-footer>.icon-btn {height:26px; width:26px; min-height:26px; border:0; background:transparent}
.detail-tree-footer>[aria-pressed="true"] {color:var(--primary-ink)}
.detail-source-editor {min-width:0; min-height:0; display:flex; flex-direction:column; overflow:hidden; background:#fff; border:1px solid var(--line); border-radius:6px}
.detail-editor-head {min-height:42px; display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--text); background:#f7f8fb; padding:9px 12px; border-bottom:1px solid var(--line); font-size:12px}
.detail-editor-head strong {display:flex; align-items:center; gap:8px; min-width:0; font-family:"SFMono-Regular",Consolas,monospace; font-weight:500}
.detail-editor-head strong>span {overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0}
.detail-editor-head strong>.icon {color:var(--muted)}
.detail-editor-head>span {color:var(--muted); white-space:nowrap}
.detail-code-editor {flex:1; min-height:0; overflow:hidden}
.detail-code-editor:empty {display:none}
.tool-detail .detail-code-editor .cm-editor {height:100%; background:#fff; color:#202733; font-size:13px}
.tool-detail .detail-code-editor .cm-focused {outline:0}
.tool-detail .detail-code-editor .cm-scroller {font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; line-height:22px; overflow:auto; tab-size:4}
.tool-detail .detail-code-editor .cm-content {padding:8px 0}
.tool-detail .detail-code-editor .cm-line {padding:0 12px}
.tool-detail .detail-code-editor .cm-gutters {background:#f8f9fb; color:#929baa; border-right:1px solid #e9edf3}
.tool-detail .detail-code-editor .cm-lineNumbers .cm-gutterElement {min-width:36px; padding-left:8px; padding-right:9px}
.tool-detail .detail-code-editor .cm-activeLine,.tool-detail .detail-code-editor .cm-activeLineGutter {background:#edf5ff}
.tool-detail .detail-code-editor .cm-selectionBackground {background:#cfe1fb}
.tool-detail #detail-source-content {width:100%; flex:1; min-height:0; resize:none; background:#fff; color:#202733; border:0; border-radius:0; padding:12px; font-family:"SFMono-Regular",Consolas,monospace; font-size:13px; line-height:22px; overflow:auto; outline-offset:-3px; tab-size:4}
.detail-source-empty {display:flex; flex:1; align-items:center; justify-content:center; flex-direction:column; gap:12px; color:var(--muted); padding:24px; text-align:center; font-size:14px}
.detail-source-empty>.icon {width:28px; height:28px}
.detail-editor-status {display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:32px; background:#f9fafc; color:var(--muted); border-top:1px solid var(--line); font-size:11px; padding:5px 10px}
.detail-editor-status>span:last-child {display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:12px}
.tool-detail #detail-source-diff {margin-top:16px; max-height:460px}
.detail-source-history {margin-top:18px}
.detail-source-history ol {list-style:none; padding:0; margin:10px 0}
.detail-source-history li {display:flex; flex-wrap:wrap; gap:12px; font-size:12px; color:var(--muted); padding:8px 0; border-bottom:1px solid var(--line)}
@media(max-width:1100px) {
  .detail-page-head {flex-wrap:wrap}
  .detail-page-head>.detail-actions {justify-content:flex-start}
  .detail-checks {grid-template-columns:repeat(2,minmax(0,1fr))}
  .detail-log-filters {grid-template-columns:repeat(2,minmax(0,1fr))}
  .detail-log-filters>.btn {justify-self:start}
}
@media(max-width:760px) {
  .detail-page-head {padding-bottom:16px; gap:12px}
  .detail-page-head>.detail-actions {width:100%; gap:6px}
  .tool-detail .detail-page-head .btn {padding:8px 10px}
  .detail-summary {padding:18px 16px}
  .detail-summary-metadata {grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:16px}
  .detail-summary-metadata .detail-meta-item {padding:12px 12px 12px 0; border-right:0; border-bottom:1px solid var(--line)}
  .detail-summary-metadata .detail-meta-item:last-child {border-bottom:0}
  .detail-metadata {grid-template-columns:repeat(2,minmax(0,1fr))}
  .detail-section>.detail-metadata .detail-meta-item:nth-last-child(-n+3) {border-bottom:1px solid var(--line)}
  .detail-section>.detail-metadata .detail-meta-item:nth-last-child(-n+2) {border-bottom:0}
  .detail-tabs {margin-top:10px}
  .detail-tabs>[role="tablist"] {padding:0 4px}
  .detail-tab {padding:10px 12px; min-height:45px}
  .detail-section {padding:20px 16px}
  .detail-section-head {gap:10px; flex-wrap:wrap}
  .detail-debug-grid,.detail-form-grid {grid-template-columns:minmax(0,1fr)}
  .detail-debug-tool-row {align-items:stretch; flex-direction:column}
  .detail-debug-tool-row>.detail-actions {flex-wrap:wrap}
  .detail-gateway-address {align-items:flex-start; flex-wrap:wrap; padding:12px}
  .detail-address-label {width:calc(100% - 48px)}
  .detail-gateway-address code {flex-basis:calc(100% - 48px); order:2}
  .detail-gateway-address>.icon-btn {margin-top:-4px}
  .detail-completeness-row {align-items:flex-start; gap:18px}
  .detail-checks {grid-template-columns:minmax(0,1fr); gap:8px}
  .detail-checks small {margin-left:auto}
  .detail-log-controls {gap:10px}
  .detail-log-controls>.detail-actions {margin-left:0; width:100%}
  .detail-log-filters {grid-template-columns:minmax(0,1fr)}
  .tool-detail .detail-log-output {height:430px; min-height:280px}
  .detail-source-workspace {grid-template-columns:minmax(0,1fr); height:740px; grid-template-rows:220px minmax(0,1fr)}
  .detail-source-toolbar {gap:6px}
  .detail-toolbar-spacer {display:none}
  .detail-source-origin {flex-wrap:wrap; row-gap:4px}
  .detail-source-origin>span:not(.detail-inline-note) {max-width:200px}
  .detail-source-origin .detail-inline-note {margin-left:0}
  .tool-detail .detail-source-toolbar .btn {min-height:34px}
  .tool-detail .detail-source-toolbar .icon-btn {width:34px; height:34px}
  .detail-editor-status>span:last-child {gap:6px}
  .detail-environment-summary {flex-wrap:wrap}
  .detail-environment-summary>.badge {margin-left:52px}
  .detail-form-footer {align-items:flex-start; gap:12px}
  .detail-form-footer>.detail-actions {width:100%; justify-content:flex-start}
}
@media(max-width:390px) {
  .detail-summary {padding-left:12px; padding-right:12px}
  .detail-section {padding-left:12px; padding-right:12px}
  .detail-metadata {grid-template-columns:minmax(0,1fr)}
  .detail-summary-metadata {grid-template-columns:repeat(2,minmax(0,1fr))}
  .detail-section>.detail-metadata .detail-meta-item:nth-last-child(-n+2) {border-bottom:1px solid var(--line)}
  .detail-section>.detail-metadata .detail-meta-item:last-child {border-bottom:0}
  .detail-identity {gap:12px; align-items:flex-start}
  .detail-avatar {width:46px; height:46px; flex-basis:46px; font-size:18px}
  .detail-tool-name {font-size:20px; line-height:28px}
  .detail-completeness-row {gap:14px}
  .detail-score {width:66px; height:66px; flex-basis:66px; padding-top:11px}
  .detail-score strong {font-size:22px; line-height:28px}
  .detail-checks>span {font-size:12px}
  .detail-checks small {font-size:12px}
}
