/* MCP Builder — shared shell primitives across import, analysis, curation, runtime and playground. */

.topbar {
  background: var(--srf);
  border-bottom: 1px solid var(--brd);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
  gap: 10px;
  z-index: 10;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size:var(--fz-ui-xl);
  letter-spacing: -.3px;
}

.logo__ic {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--acc), var(--acc-strong));
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-inverse);
  font-size:var(--fz-ui-xs);
  font-weight: 800;
}

.sep {
  width: 1px;
  height: 16px;
  background: var(--brdb);
  flex-shrink: 0;
}

.spacer {
  flex: 1;
}

.topbar__proj {
  font-family: var(--mono);
  font-size:var(--fz-ui-sm);
  color: var(--tx2);
}

.topbar__file {
  font-family: var(--mono);
  font-size:var(--fz-ui-xs);
  color: var(--tx3);
  background: var(--srf2);
  padding: 2px 7px;
  border-radius: 4px;
}

.topbar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(230, 126, 34, .35);
  background: rgba(230, 126, 34, .12);
  color: var(--acc);
  font-size:var(--fz-ui-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar__version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid var(--brdb);
  background: var(--srf2);
  color: var(--tx3);
  font-family: var(--mono);
  font-size: var(--fz-ui-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar__version-badge[hidden] {
  display: none;
}

.topbar__workspace-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--brdb);
  border-radius: 6px;
  background: var(--srf2);
  color: var(--tx2);
  font-size: var(--fz-ui-xs);
  font-weight: 700;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}

.topbar__workspace-link[hidden] {
  display: none;
}

.topbar__workspace-link:hover {
  border-color: var(--acc);
  color: var(--tx);
}

.topbar__workspace-link--copied {
  border-color: var(--grnstr);
  background: var(--grnbg);
  color: var(--grn);
}

.topbar__workspace-link-manual {
  min-width: min(420px, 32vw);
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--brdb);
  border-radius: 5px;
  background: var(--srf);
  color: var(--tx);
  font-family: var(--mono);
  font-size: var(--fz-ui-xs);
}

.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size:var(--fz-ui-lg);
  transition: background .12s;
}

.theme-btn:hover {
  background: var(--srf2);
}

.topbar__stats {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--tx3);
  white-space: nowrap;
}

.topbar__stats--compact {
  padding: 0;
  height: auto;
  border: none;
  border-radius: 0;
  background: none;
  gap: 6px;
  flex-shrink: 0;
}

.topbar__stats--compact .ts,
.topbar__stats--compact .ts__l {
  font-size:var(--fz-ui-xs);
}

.topbar__stats-sep {
  font-size:var(--fz-ui-2xs);
  color: var(--tx3);
  opacity: .42;
}

.ts {
  font-family: var(--mono);
  font-size:var(--fz-ui-xs);
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--tx3);
  line-height: 1;
}

.ts__l {
  font-size:var(--fz-ui-xs);
  font-weight: 500;
  color: var(--tx3);
  opacity: .82;
}

.ts__arrow {
  color: var(--tx3);
  font-size:var(--fz-ui-xs);
}

.ts--tools {
  gap: 4px;
}

.ts--wht > :first-child {
  color: var(--tx);
}

.ts__tools-breakdown {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.ts__tools-endpoint {
  color: var(--grn);
}

.ts__tools-custom {
  color: var(--custom);
}

.ts__tools-plus {
  color: var(--tx3);
  opacity: .58;
}

.ts__tools-plus[hidden],
.ts__tools-custom[hidden] {
  display: none;
}

.ts--grn > :first-child {
  color: var(--grn);
}

.ts--org > :first-child {
  color: var(--org);
}

.ts--red > :first-child {
  color: var(--red);
}

.btn,
.btn-primary,
.btn-ghost-sm {
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  font-size:var(--fz-ui-md);
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s;
}

.btn-primary,
.btn--primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size:var(--fz-ui-sm);
  font-weight: 600;
  background: var(--acc);
  color: var(--tx-inverse);
  transition: filter .15s;
}

.btn-primary:hover:not(:disabled),
.btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-primary:disabled,
.btn--primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-ghost-sm,
.btn--ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 6px;
  font-size:var(--fz-ui-sm);
  font-weight: 500;
  color: var(--tx2);
  border: 1px solid var(--brdb);
  transition: all .12s;
}

.btn-ghost-sm:hover:not(:disabled),
.btn--ghost:hover:not(:disabled) {
  background: var(--srf2);
  color: var(--tx);
  border-color: var(--acc);
}

.btn-ghost-sm:disabled,
.btn--ghost:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.dl-menu {
  position: relative;
}

.dl-menu__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--srf);
  border: 1px solid var(--brdb);
  border-radius: 8px;
  padding: 4px;
  min-width: 180px;
  box-shadow: var(--shl);
  z-index: 20;
}

.dl-menu--open .dl-menu__dropdown {
  display: block;
}

.dl-menu__item {
  display: block;
  padding: 6px 10px;
  font-size:var(--fz-ui-sm);
  color: var(--tx2);
  text-decoration: none;
  border-radius: 5px;
  transition: background .1s;
}

.dl-menu__item:hover {
  background: var(--srf2);
  color: var(--tx);
}

.btn--small {
  padding: 6px 11px;
  font-size:var(--fz-ui-sm);
}

.workspace-nav {
  grid-column: 1 / -1;
  min-height: 48px;
  background: var(--srf);
  border-bottom: 1px solid var(--brd);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px 14px;
  padding: 7px 16px;
  flex-shrink: 0;
}

.workspace-nav__context,
.workspace-nav__page,
.workspace-nav__actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.workspace-nav__context {
  gap: 8px;
  justify-content: flex-start;
}

.workspace-nav__page {
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  text-align: center;
  line-height: 1.15;
}

.workspace-nav__actions {
  justify-content: flex-end;
  gap: 6px;
}

.workspace-nav__menu {
  position: relative;
  min-width: 0;
}

.workspace-nav__menu-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--tx2);
  font-size: var(--fz-ui-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
}

.workspace-nav__menu-trigger::-webkit-details-marker {
  display: none;
}

.workspace-nav__menu-trigger:hover,
.workspace-nav__menu[open] .workspace-nav__menu-trigger {
  color: var(--tx);
  background: var(--srf2);
  border-color: var(--brdb);
}

.workspace-nav__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--grn);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, .10);
  flex-shrink: 0;
}

.workspace-nav__status-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fz-ui-md);
  letter-spacing: 0;
}

.workspace-nav__menu-caret {
  color: var(--tx3);
  font-size: var(--fz-ui-lg);
  font-weight: 700;
  line-height: 1;
  transform: translateY(-.5px);
}

.workspace-nav__menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 240px;
  padding: 6px;
  border: 1px solid var(--brdb);
  border-radius: 6px;
  background: var(--srf);
  box-shadow: var(--shl);
  z-index: 40;
}

.workspace-nav__step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--tx2);
  text-decoration: none;
}

.workspace-nav__step:hover {
  background: var(--srf2);
  color: var(--tx);
}

.workspace-nav__step--active {
  background: var(--accbg);
  color: var(--tx);
}

.workspace-nav__step-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tx3);
  border-radius: 999px;
  color: var(--tx3);
  font-family: var(--mono);
  font-size: var(--fz-ui-3xs-plus);
  font-weight: 800;
}

.workspace-nav__step--done .workspace-nav__step-icon,
.workspace-nav__step.ps--done .workspace-nav__step-icon {
  border-color: var(--grnstr);
  background: rgba(52, 211, 153, .08);
  color: var(--grn);
}

.workspace-nav__step--active .workspace-nav__step-icon {
  border-color: var(--acc);
  background: var(--acc);
  color: var(--tx-inverse);
}

.workspace-nav__step.ps--skip .workspace-nav__step-icon {
  border-color: rgba(234, 179, 8, .68);
  background: rgba(234, 179, 8, .12);
  color: var(--org-strong);
}

.workspace-nav__step-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.workspace-nav__step-label {
  font-size: var(--fz-ui-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-nav__step-meta {
  font-family: var(--mono);
  font-size: var(--fz-ui-2xs);
  color: var(--tx3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-nav__page-title {
  font-size: var(--fz-ui-md);
  font-weight: 800;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.workspace-nav__page-meta {
  font-family: var(--mono);
  font-size: var(--fz-ui-xs);
  color: var(--tx3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.workspace-nav__page--switcher {
  gap: 0;
}

.workspace-nav__view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(94px, 1fr));
  gap: 2px;
  min-width: 238px;
  padding: 2px;
  border: 1px solid var(--brd);
  border-radius: 6px;
  background: var(--srf2);
}

.workspace-nav__view {
  position: relative;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 4px;
  color: var(--tx3);
  font-size: var(--fz-ui-sm);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}

.workspace-nav__view:hover {
  color: var(--tx2);
  background: rgba(255, 255, 255, .035);
}

.workspace-nav__view--active {
  color: var(--tx);
  background: var(--srf);
  box-shadow: var(--sh);
}

.workspace-nav__view--active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--acc);
}

.workspace-nav .btn-ghost-sm,
.workspace-nav .btn-primary {
  min-height: 30px;
  border-radius: 5px;
}

.workspace-nav .dl-menu__dropdown {
  z-index: 45;
}

.workspace-nav .theme-btn {
  flex-shrink: 0;
}

.workspace-nav__actions .btn-primary:disabled {
  opacity: .45;
}

.workspace-share {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--brd);
  background: rgba(245, 158, 11, .08);
  color: var(--tx2);
  font-size: var(--fz-ui-xs);
  flex-shrink: 0;
}

.workspace-share[hidden] {
  display: none;
}

.workspace-share__copy {
  font-weight: 600;
  color: var(--tx);
}

.workspace-share__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--grn);
}

.workspace-share__manual-link {
  width: min(620px, 42vw);
  min-width: 240px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--brdb);
  border-radius: 5px;
  background: var(--srf);
  color: var(--tx);
  font-family: var(--mono);
  font-size: var(--fz-ui-xs);
}

.workspace-share__trace {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--tx3);
}

.workspace-share__btn,
.workspace-share__close {
  border: 1px solid var(--brdb);
  border-radius: 6px;
  background: var(--srf);
  color: var(--tx);
  font-size: var(--fz-ui-xs);
}

.workspace-share__btn {
  padding: 4px 8px;
}

.workspace-share__close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tx3);
}

.workspace-share__btn:hover,
.workspace-share__close:hover {
  border-color: var(--acc);
  color: var(--acc);
}

@media (max-width: 940px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .topbar,
  .workspace-nav,
  .main,
  .bbar {
    min-width: 0;
    max-width: 100%;
  }

  .workspace-nav {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 8px 12px;
  }

  .workspace-nav__context {
    justify-content: flex-start;
    overflow: visible;
  }

  .workspace-nav__actions {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
  }

  .workspace-nav__actions::-webkit-scrollbar {
    display: none;
  }

  .workspace-nav__page {
    align-items: flex-start;
    text-align: left;
  }

  .workspace-nav__page--switcher {
    align-items: stretch;
  }

  .workspace-nav__view-switch {
    width: 100%;
    min-width: 0;
  }

  .workspace-nav__page-title,
  .workspace-nav__page-meta {
    max-width: 100%;
  }

  .workspace-nav__menu-popover {
    width: min(240px, calc(100vw - 24px));
  }

  .topbar {
    min-width: 0;
  }

  .topbar__proj,
  .topbar__file {
    min-width: 0;
    max-width: min(38vw, 180px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar__stats {
    min-width: 0;
    overflow: hidden;
  }

  .topbar__workspace-link {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar__workspace-link-manual,
  .workspace-share__manual-link {
    width: 100%;
    min-width: 0;
  }

  .workspace-share {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .workspace-share__trace {
    flex: 1 1 100%;
    margin-left: 0;
  }
}
.card {
  background: var(--srf);
  border: 1px solid var(--brd);
  border-radius: 12px;
  box-shadow: var(--sh);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card__title {
  font-size:var(--fz-ui-md);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tx3);
}

.card__hint {
  font-size:var(--fz-ui-sm);
  color: var(--tx3);
  margin-top: 2px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--accbg);
  border: 1px solid var(--acch);
}

.tip.hidden {
  display: none !important;
}

.tip svg,
.tip__icon {
  width: 16px;
  height: 16px;
  stroke: var(--acc);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  color: var(--acc);
  font-size:var(--fz-ui-xl);
  line-height: 1;
}

.tip__text,
.tip__copy {
  flex: 1;
  min-width: 0;
  color: var(--tx2);
  font-size:var(--fz-ui-sm);
  line-height: 1.55;
}

.tip__text strong,
.tip__copy strong {
  color: var(--tx);
  font-weight: 600;
}

.tip__close {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx3);
  flex-shrink: 0;
}

.tip__close:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--tx);
}

.tip--warning {
  background: var(--orgbg);
  border-color: var(--orgstr);
}

.tip--warning svg,
.tip--warning .tip__icon {
  stroke: var(--org);
  color: var(--org);
}

.tip--warning .tip__text strong,
.tip--warning .tip__copy strong {
  color: var(--org);
}

.tip--error {
  background: var(--redbg);
  border-color: var(--redstr);
}

.tip--error svg,
.tip--error .tip__icon {
  stroke: var(--red);
  color: var(--red);
}

.tip--error .tip__text strong,
.tip--error .tip__copy strong {
  color: var(--red);
}

.helptext {
  font-size:var(--fz-ui-xs);
  color: var(--tx3);
  line-height: 1.5;
}

@media (max-width: 980px) {
  .topbar {
    padding: 8px 12px;
    height: auto;
    flex-wrap: wrap;
  }

  .topbar__stats--compact {
    order: 10;
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}
