.tools-workspace {
  min-width: 0;
  --th-gap: clamp(16px, 1.45vw, 24px);
}
.th-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr);
  grid-template-areas: 'catalog runtime' 'catalog recent' 'links links';
  grid-template-rows: auto auto auto;
  gap: var(--th-gap);
}
.th-card,
.th-draft {
  min-width: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.th-card {
  padding: clamp(22px, 2vw, 32px);
}
.th-catalog {
  grid-area: catalog;
  display: flex;
  flex-direction: column;
}
.th-runtime {
  grid-area: runtime;
  display: flex;
  flex-direction: column;
}
.th-recent {
  grid-area: recent;
}
.th-links {
  grid-area: links;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 24px 9px;
}
.th-heading,
.th-tile,
.th-heading h2,
.th-group,
.th-label,
.th-right,
.th-link,
.th-last,
.th-last > div,
.th-shortcut,
.th-runtime dl div,
.th-runtime dt,
.th-draft,
.th-draft > span {
  display: flex;
  align-items: center;
}
.th-heading {
  gap: clamp(12px, 1.45vw, 22px);
}
.th-heading > div {
  min-width: 0;
}
.th-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--type-card);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.35;
}
.th-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-support);
}
.th-heading .primary {
  margin-left: auto;
  white-space: nowrap;
}
.th-tile {
  flex: none;
  justify-content: center;
  width: clamp(44px, 4vw, 62px);
  height: clamp(44px, 4vw, 62px);
  border-radius: 16px;
  background: #e7efff;
  color: var(--blue);
}
.th-tile .icon {
  width: 48%;
  height: 48%;
}
.th-violet,
.th-purple {
  background: #eee8ff;
  color: #6b42bb;
}
.th-green,
.th-mint {
  background: var(--green-soft);
  color: var(--green);
}
.th-orange,
.th-coral,
.th-amber {
  background: #ffecdf;
  color: #b84919;
}
.th-groups {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  margin-top: clamp(16px, 1.8vw, 28px);
  flex: 1;
}
.th-group,
.th-shortcut,
#mcp .th-link {
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
  color: var(--ink);
}
.th-group {
  width: 100%;
  padding: 12px 0;
  gap: clamp(10px, 1.4vw, 20px);
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}
.th-group:last-child {
  border: 0;
}
.th-group:hover:not(:disabled),
.th-shortcut:hover:not(:disabled) {
  background: var(--bg);
}
.th-group:hover .th-label strong,
.th-shortcut:hover strong {
  color: var(--blue);
}
.th-group > .icon,
.th-shortcut > .icon,
.th-link > .icon {
  width: 17px;
  height: 17px;
  flex: none;
}
.th-group > .icon,
.th-shortcut > .icon {
  color: var(--muted);
}
.th-label,
.th-shortcut > span:not(.icon, .th-tile) {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.th-label strong,
.th-shortcut strong {
  font-size: var(--type-item);
  line-height: 1.4;
  font-weight: 650;
}
.th-label small,
.th-shortcut small {
  font-size: var(--type-support);
  color: var(--muted);
  line-height: 1.6;
  margin-top: 3px;
  font-weight: 400;
}
.th-count {
  margin-left: auto;
  white-space: nowrap;
  font-size: var(--type-item);
  font-variant-numeric: tabular-nums;
}
.th-runtime dl {
  margin: 14px 0 0;
}
.th-runtime dl div {
  justify-content: space-between;
  gap: 10px;
  min-height: clamp(48px, 4.2vw, 62px);
  border-bottom: 1px solid var(--line);
}
.th-runtime dt,
.th-runtime dd,
.th-last > div {
  font-size: var(--type-body);
  font-weight: 650;
}
.th-runtime dd {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.th-runtime dt {
  font-weight: 500;
  gap: clamp(10px, 1.4vw, 22px);
}
.th-runtime dt .icon,
.th-last > div .icon {
  width: 19px;
  height: 19px;
  flex: none;
}
.th-right {
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 14px;
}
#mcp .th-link {
  gap: 5px;
  min-height: 44px;
  padding: 5px 8px;
  color: var(--blue);
  font-size: var(--type-control);
  white-space: nowrap;
}
#mcp .th-link:hover,
#mcp .th-link:focus-visible {
  background: var(--blue-soft);
}
.th-last {
  gap: 6px;
  justify-content: space-between;
  margin-top: clamp(18px, 2vw, 32px);
  flex-wrap: wrap;
}
.th-last > div {
  gap: 8px;
}
.th-done {
  color: var(--green);
}
.th-shortcut {
  min-width: 0;
  gap: clamp(10px, 1.4vw, 22px);
  padding: 0 clamp(13px, 1.6vw, 26px);
  border-radius: 0;
}
.th-shortcut + .th-shortcut {
  border-left: 1px solid var(--line);
}
.th-shortcut > .icon {
  margin-left: auto;
}
.th-draft {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #c9dafb;
  padding: 14px 20px;
  margin-top: 15px;
  box-shadow: 0 5px 20px #15366917;
}
.th-draft > span {
  gap: 8px;
}
.th-draft .form-error {
  flex-basis: 100%;
  margin: 0;
}
.th-detail {
  display: grid;
  gap: 15px;
}
.th-panel {
  min-width: 0;
}
.th-detail .mcp-external {
  margin-top: 0;
}
.th-detail-nav {
  margin-bottom: 0;
}
.th-gate {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.th-muted {
  color: var(--muted);
}
.th-failure {
  padding: 12px 0;
}
@media (min-width: 1151px) {
  .th-heading .primary {
    min-width: 126px;
    font-size: var(--type-control);
  }
  .th-links {
    min-height: 122px;
  }
}
@media (min-width: 761px) and (max-width: 1110px) {
  .th-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'catalog catalog' 'runtime recent' 'links links';
  }
  .th-links {
    padding-inline: 0;
  }
  .th-shortcut {
    gap: 8px;
  }
  .th-shortcut .th-tile {
    width: 36px;
    height: 40px;
  }
}
@media (max-width: 760px) {
  .th-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'catalog' 'runtime' 'recent' 'links';
    gap: 14px;
  }
  .th-card {
    padding: 20px;
    border-radius: 22px;
  }
  .th-heading {
    gap: 11px;
    flex-wrap: wrap;
  }
  .th-heading .primary {
    min-width: 0;
    padding: 9px 12px;
  }
  .th-group {
    min-height: 76px;
    gap: 10px;
  }
  .th-group .th-tile {
    width: 39px;
    height: 40px;
    border-radius: 11px;
  }
  .th-links {
    grid-template-columns: 1fr;
    padding: 3px 20px;
  }
  .th-shortcut {
    padding: 13px 0;
    flex-wrap: nowrap;
  }
  .th-shortcut + .th-shortcut {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .th-right {
    padding-top: 6px;
  }
  .th-draft {
    padding: 12px 16px;
    bottom: 8px;
  }
  .th-draft > span {
    margin-left: auto;
  }
}
@media (max-width: 375px) {
  .th-heading {
    gap: 8px;
  }
  .th-catalog .th-heading .th-tile {
    display: none;
  }
  .th-group {
    column-gap: 6px;
  }
  .th-group .th-tile {
    width: 32px;
    height: 35px;
  }
  .th-label small {
    font-size: var(--type-support);
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-th-entry] {
    transform: none !important;
    opacity: 1 !important;
  }
}

.bp-panel {
  display: grid;
  gap: 20px;
}
.bp-panel .th-heading {
  flex-wrap: wrap;
}
.bp-panel p {
  margin: 0;
  color: var(--muted);
}
.bp-row {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.bp-row h3 {
  font-size: var(--type-item);
  margin: 0;
  overflow-wrap: anywhere;
}
.bp-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
}
.bp-line,
.bp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.bp-heading [data-bp='unbind'] {
  background: var(--red);
  color: #fff;
}
.bp-heading [data-bp='unbind']:hover:not(:disabled) {
  background: color-mix(in srgb, var(--red) 85%, black);
}
.bp-row .bp-state {
  color: var(--blue);
  font-weight: 650;
}
.bp-row .bp-origin,
.bp-key {
  overflow-wrap: anywhere;
}
.bp-row details summary {
  cursor: pointer;
  color: var(--link);
}
.bp-row details p {
  margin: 8px 0;
}
.bp-row .bp-key {
  font-size: 14px;
  user-select: all;
}
@media (min-width: 761px) and (max-width: 1250px) {
  .th-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
  }
  .th-shortcut:nth-child(3) {
    border-left: 0;
  }
}
@media (max-width: 760px) {
  .bp-panel .th-heading .primary {
    margin-left: 0;
  }
}
