:root {
  --bg: #0d1012;
  --bar: #070a0c;
  --rail: #11171a;
  --panel: #171d21;
  --panel-2: #20282d;
  --panel-3: #0f1417;
  --line: #34424b;
  --line-strong: #52636d;
  --text: #eef3f5;
  --muted: #9aa8b0;
  --good: #67d391;
  --bad: #ff6f73;
  --warn: #e7c765;
  --accent: #73c7ff;
  --accent-2: #9be28f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: grid;
  gap: 4px;
}

.brand strong {
  font-size: 15px;
}

.brand span,
p,
.muted {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tab,
button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

button {
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.tab.active,
.segment.active {
  border-color: var(--accent);
  color: var(--accent);
}

.primary,
.import-tab {
  border-color: var(--accent-2);
  background: #16251d;
  color: var(--accent-2);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 8px;
}

textarea {
  resize: vertical;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: 21px;
}

h2 {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.status-rail {
  position: fixed;
  top: 58px;
  bottom: 0;
  left: 0;
  width: 260px;
  overflow: auto;
  padding: 12px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}

.status-rail dl {
  display: grid;
  gap: 7px;
}

.status-rail .rail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.status-rail dt {
  color: var(--muted);
}

.status-rail dd {
  max-width: 120px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  margin-top: 58px;
  margin-left: 260px;
  padding: 12px;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 10px;
}

.page-head,
.section-head,
.button-row,
.preset-row,
.segmented {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.page-head {
  min-height: 54px;
}

.button-row,
.preset-row,
.segmented {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.panel {
  min-width: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  min-height: 70px;
  padding: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-item {
  min-height: 54px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-item strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric .label {
  color: var(--muted);
  font-size: 11px;
}

.metric .value {
  margin-top: 8px;
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.two-col,
.wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.form-grid,
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.actions-panel,
.timeline-panel {
  grid-column: span 1;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-grid button.busy,
button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.82;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(115, 199, 255, 0.22);
}

.action-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #13212b;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-left-color: var(--accent);
  border-radius: 5px;
}

.action-banner strong,
.action-banner span,
.action-banner small {
  display: block;
  min-width: 0;
}

.action-banner span {
  color: var(--text);
}

.action-banner small {
  color: var(--muted);
  text-align: right;
}

.action-banner.running {
  border-left-color: var(--accent);
}

.action-banner.pass {
  border-left-color: var(--good);
}

.action-banner.fail {
  border-left-color: var(--bad);
}

.action-feed {
  display: grid;
  gap: 6px;
}

.action-feed-empty {
  padding: 8px 10px;
  color: var(--muted);
  background: var(--panel-3);
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.action-feed-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 4px;
}

.action-feed-item.running {
  border-left-color: var(--accent);
}

.action-feed-item.pass {
  border-left-color: var(--good);
}

.action-feed-item.fail {
  border-left-color: var(--bad);
}

.action-feed-meta {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.action-feed-title {
  color: var(--text);
  font-weight: 700;
}

.action-feed-summary,
.action-feed-time {
  color: var(--muted);
  min-width: 0;
}

.notice {
  margin-top: 10px;
  padding: 8px;
  color: var(--warn);
  background: #221f13;
  border: 1px solid #655628;
  border-radius: 4px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stage {
  min-height: 78px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.stage.running {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(115, 199, 255, 0.35), 0 0 18px rgba(115, 199, 255, 0.18);
  animation: pulseStage 1.2s ease-in-out infinite;
}

.stage.pass {
  border-color: rgba(103, 211, 145, 0.65);
}

.stage.fail {
  border-color: rgba(255, 111, 115, 0.75);
}

.stage.warn,
.stage.pass_with_warning {
  border-color: rgba(231, 199, 101, 0.75);
}

@keyframes pulseStage {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.stage strong,
.stage span,
.stage small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage small {
  margin-top: 4px;
  color: var(--muted);
}

.pending { color: var(--muted); }
.running { color: var(--warn); }
.warn,
.pass_with_warning { color: var(--warn); }
.pass { color: var(--good); }
.fail { color: var(--bad); }

.progress-hero {
  display: grid;
  gap: 10px;
}

.progress-bar-shell {
  position: relative;
  height: 30px;
  overflow: hidden;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: var(--accent);
}

.progress-bar-fill.running {
  background: repeating-linear-gradient(45deg, #2d9fe8 0, #2d9fe8 12px, #73c7ff 12px, #73c7ff 24px);
  animation: progressMove 1s linear infinite;
}

.progress-bar-fill.completed {
  background: var(--good);
}

.progress-bar-fill.failed {
  background: var(--bad);
}

@keyframes progressMove {
  from { background-position: 0 0; }
  to { background-position: 34px 0; }
}

#wizardProgressLabel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.activity-banner {
  padding: 9px;
  background: #111f27;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
}

.status-strip,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.status-pill,
.chip {
  padding: 6px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.console-panel pre,
#wizardConsole {
  min-height: 260px;
  max-height: 340px;
  color: #d9ffe3;
  background: #050806;
  border-color: #24442d;
}

.console-debug {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.console-line {
  display: block;
  white-space: pre-wrap;
}

.console-line.info {
  color: #d9ffe3;
}

.console-line.success {
  color: #66e899;
}

.console-line.warn {
  color: #f1c75b;
}

.console-line.error {
  color: #ff7c7c;
}

.table-wrap {
  overflow: auto;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.table-wrap.tall {
  max-height: calc(100vh - 190px);
}

.table-wrap.medium {
  max-height: 310px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

td.wrap {
  max-width: 420px;
  white-space: normal;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #11171b;
  color: var(--accent);
}

pre {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.invoke-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.invoke-panel.open {
  display: grid;
}

.invoke-card {
  display: grid;
  width: min(760px, 96vw);
  max-height: 92vh;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.wizard-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  padding: 18px;
  background: rgba(0, 0, 0, 0.7);
}

.wizard-modal.open {
  display: block;
}

.wizard-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1480px, 98vw);
  height: min(940px, 96vh);
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.wizard-steps {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background: var(--rail);
  border-bottom: 1px solid var(--line);
}

.wizard-step.active {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.wizard-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.wizard-page {
  display: none;
  gap: 10px;
}

.wizard-page.active {
  display: grid;
}

#wizardManifestPreview,
#wizardRunOutput,
#wizardInvokeOutput {
  min-height: 180px;
}

#wizardToolSelect {
  margin-bottom: 8px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    position: static;
  }

  .status-rail {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    margin: 0;
  }

  .metric-grid,
  .metric-grid.compact,
  .two-col,
  .three-col,
  .wizard-grid,
  .form-grid,
  .filter-grid,
  .action-grid,
  .timeline {
    grid-template-columns: 1fr;
  }
}

/* Phase 27B — capability-centric polish */
.primary-tab {
  border-color: rgba(115, 199, 255, 0.55);
  background: linear-gradient(180deg, rgba(115, 199, 255, 0.18), rgba(115, 199, 255, 0.06));
}

.raw-tab {
  opacity: 0.86;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 199, 255, 0.22), transparent 32%),
    radial-gradient(circle at 92% 20%, rgba(155, 226, 143, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(23, 29, 33, 0.98), rgba(13, 16, 18, 0.98));
  border: 1px solid rgba(115, 199, 255, 0.38);
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.hero-copy h1 {
  margin: 6px 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-badges,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hero-actions {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.large-cta {
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 10px;
}

.catalog-panel-main,
.catalog-side-panel,
.catalog-selected-panel {
  border-color: rgba(115, 199, 255, 0.22);
}

.catalog-side-panel {
  align-self: start;
  position: sticky;
  top: 70px;
}

.latest-job-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.latest-job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-progress {
  height: 8px;
  overflow: hidden;
  background: #070a0c;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mini-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.job-kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 5px 8px;
}

.job-kv dt {
  color: var(--muted);
}

.job-kv dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.cap-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cap-detail-head h3 {
  margin: 4px 0 6px;
  color: var(--text);
  font-size: 20px;
}

.capability-guidance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.capability-guidance-grid section {
  min-width: 0;
  padding: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.capability-guidance-grid h4 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.capability-guidance-grid pre {
  min-height: 0;
  margin: 0;
  white-space: pre-wrap;
}

.floating-import {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 25;
  min-height: 46px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #061014;
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(115, 199, 255, 0.28);
}

.floating-import:hover {
  color: #061014;
  transform: translateY(-1px);
}

.import-latest-panel {
  border-color: rgba(155, 226, 143, 0.28);
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

@media (max-width: 1180px) {
  .hero-panel,
  .catalog-layout,
  .capability-guidance-grid {
    grid-template-columns: 1fr;
  }

  .catalog-side-panel {
    position: static;
  }
}

/* Phase 27C — Capability-centric premium polish and autopilot import UX */
:root {
  --bg: #07111f;
  --bar: rgba(5, 12, 22, 0.92);
  --rail: rgba(8, 18, 32, 0.96);
  --panel: rgba(17, 31, 48, 0.88);
  --panel-2: rgba(24, 42, 62, 0.92);
  --panel-3: rgba(7, 18, 30, 0.9);
  --line: rgba(126, 163, 190, 0.22);
  --line-strong: rgba(151, 202, 234, 0.42);
  --text: #f5fbff;
  --muted: #a8bac8;
  --good: #7cf2a5;
  --bad: #ff7d86;
  --warn: #ffd36f;
  --accent: #7ed7ff;
  --accent-2: #9cf5c6;
  --gold: #f1d18a;
  --glow: rgba(126, 215, 255, 0.22);
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(71, 146, 200, 0.20), transparent 34%),
    radial-gradient(circle at 76% 10%, rgba(156, 245, 198, 0.13), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #0b1320 50%, #070d17 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

pre,
code,
table,
input,
select,
textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
  min-height: 68px;
  padding: 10px 16px;
  background: var(--bar);
  border-bottom: 1px solid rgba(126, 215, 255, 0.18);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand span {
  color: var(--accent-2);
  font-size: 11px;
}

.tab,
button {
  border-radius: 999px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.tab.primary-tab,
.tab.import-tab,
.primary {
  box-shadow: 0 0 0 1px rgba(156,245,198,.08), 0 10px 26px rgba(0,0,0,.18);
}

button:hover,
.tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.status-rail {
  top: 68px;
  background: linear-gradient(180deg, rgba(8, 18, 32, 0.98), rgba(6, 14, 25, 0.96));
  border-right: 1px solid rgba(126, 215, 255, 0.18);
}

.workspace {
  margin-top: 68px;
  padding: 16px;
}

.panel,
.metric,
.detail-item,
.latest-job-card {
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
  background: linear-gradient(180deg, rgba(21, 38, 57, 0.92), rgba(12, 25, 40, 0.88));
  border: 1px solid rgba(126, 215, 255, 0.18);
}

.metric {
  background: linear-gradient(180deg, rgba(30, 53, 76, .88), rgba(15, 31, 48, .88));
  border-color: rgba(126, 215, 255, 0.16);
}

.metric .label,
.detail-item span,
.job-kv dt {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.metric .value,
.detail-item strong {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 750;
}

.super-server-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(156, 245, 198, .22);
  background:
    linear-gradient(135deg, rgba(15, 42, 64, .94), rgba(9, 23, 37, .94)),
    radial-gradient(circle at right top, rgba(156, 245, 198, .18), transparent 42%);
}

.super-server-hero::after {
  content: "";
  position: absolute;
  inset: -35% -10% auto auto;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(126, 215, 255, .18), transparent 58%);
  pointer-events: none;
}

.hero-copy h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 760px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.autopilot-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(241, 209, 138, 0.25);
  background:
    linear-gradient(135deg, rgba(31, 49, 68, 0.96), rgba(10, 23, 37, 0.94)),
    radial-gradient(circle at 10% 0%, rgba(241, 209, 138, 0.12), transparent 38%);
}

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

.autopilot-head h2 {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
}

.autopilot-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px auto;
  gap: 10px;
  align-items: end;
}

.autopilot-input input {
  min-height: 42px;
  border-color: rgba(241, 209, 138, 0.32);
  background: rgba(5, 12, 22, 0.58);
  font-size: 13px;
}

.autopilot-actions .primary,
.autopilot-actions button {
  min-height: 42px;
}

.autopilot-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(241, 209, 138, 0.42);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(241, 209, 138, 0.08);
  white-space: nowrap;
}

.autopilot-status {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 215, 255, 0.16);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(5, 12, 22, 0.42);
}

.autopilot-status strong { color: var(--text); }
.autopilot-status code { color: var(--accent-2); white-space: pre-wrap; }
.autopilot-status.pass { border-color: rgba(124, 242, 165, 0.32); }
.autopilot-status.warn { border-color: rgba(255, 211, 111, 0.38); color: #ffe4a3; }
.autopilot-status.fail { border-color: rgba(255, 125, 134, 0.42); color: #ffb4ba; }
.autopilot-status.running { border-color: rgba(126, 215, 255, 0.42); }

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow-strip.compact-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.workflow-strip > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(126, 215, 255, 0.16);
  border-radius: 14px;
  background: rgba(5, 12, 22, 0.38);
}

.workflow-strip strong {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: #061014;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.workflow-strip span {
  color: var(--text);
  font-weight: 760;
}

.workflow-strip small {
  color: var(--muted);
  line-height: 1.35;
}

.registration-contract {
  margin-bottom: 12px;
  border-color: rgba(156, 245, 198, .18);
}

.wizard-autopilot-panel {
  margin-bottom: 12px;
}

.floating-import {
  right: 24px;
  bottom: 24px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7ed7ff 0%, #9cf5c6 55%, #f1d18a 100%);
  box-shadow: 0 18px 52px rgba(126, 215, 255, 0.32);
}

.floating-import::before {
  content: "Autopilot Ready";
  position: absolute;
  right: 12px;
  bottom: 58px;
  padding: 6px 10px;
  color: var(--gold);
  background: rgba(5, 12, 22, .86);
  border: 1px solid rgba(241, 209, 138, .25);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.console-panel pre,
#wizardConsole {
  min-height: 220px;
  border-color: rgba(156, 245, 198, 0.18);
  background: #02070d;
  box-shadow: inset 0 0 0 1px rgba(156,245,198,.05);
}

.stage.running {
  border-color: rgba(126, 215, 255, 0.58);
  box-shadow: 0 0 0 1px rgba(126, 215, 255, 0.14), 0 0 26px rgba(126, 215, 255, .16);
}

.stage.pass {
  border-color: rgba(124, 242, 165, 0.36);
}

.stage.fail {
  border-color: rgba(255, 125, 134, 0.45);
}

@media (max-width: 1260px) {
  .autopilot-grid,
  .workflow-strip,
  .workflow-strip.compact-flow {
    grid-template-columns: 1fr;
  }

  .autopilot-head {
    display: grid;
  }
}

/* Phase 27D — Capability-centric luxury polish */
:root {
  --phase27d-bg-deep: #050814;
  --phase27d-bg-mid: #081527;
  --phase27d-glass: rgba(12, 26, 45, 0.78);
  --phase27d-glass-strong: rgba(15, 35, 60, 0.92);
  --phase27d-line: rgba(136, 192, 255, 0.18);
  --phase27d-cyan: #7dd3fc;
  --phase27d-blue: #60a5fa;
  --phase27d-gold: #f6c96b;
  --phase27d-green: #52f3a8;
  --phase27d-text: #eef7ff;
  --phase27d-muted: #9fb7ce;
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(96, 165, 250, 0.18), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(125, 211, 252, 0.14), transparent 36rem),
    linear-gradient(135deg, var(--phase27d-bg-deep), var(--phase27d-bg-mid) 48%, #06111f);
  color: var(--phase27d-text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 78%);
  z-index: 0;
}

.topbar,
.status-rail,
.workspace,
.floating-import {
  position: relative;
  z-index: 1;
}

.topbar {
  background: rgba(5, 10, 20, 0.86);
  border-bottom: 1px solid var(--phase27d-line);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 48px rgba(0,0,0,0.28);
}

.brand strong {
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

#modeBadge {
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(96, 165, 250, 0.08);
  color: var(--phase27d-cyan);
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
}

.tab {
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
  transition: transform 160ms ease, border 160ms ease, background 160ms ease;
}
.tab:hover { transform: translateY(-1px); border-color: rgba(125, 211, 252, 0.32); }
.tab.active,
.tab.primary-tab.active {
  background: linear-gradient(135deg, rgba(96,165,250,0.25), rgba(125,211,252,0.14));
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 1px rgba(125,211,252,0.08), 0 12px 34px rgba(0,0,0,0.24);
}
.import-tab {
  background: linear-gradient(135deg, rgba(246, 201, 107, 0.16), rgba(96,165,250,0.08));
  border-color: rgba(246, 201, 107, 0.28);
}
.raw-tab:not(.active) { opacity: 0.72; }

.panel,
.hero-panel,
.status-rail,
.modal-card {
  background: var(--phase27d-glass);
  border: 1px solid var(--phase27d-line);
  box-shadow: 0 22px 60px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
}

.super-server-hero {
  background:
    linear-gradient(135deg, rgba(10, 27, 48, 0.94), rgba(8, 17, 31, 0.86)),
    radial-gradient(circle at top right, rgba(246,201,107,0.2), transparent 22rem),
    radial-gradient(circle at bottom left, rgba(125,211,252,0.2), transparent 22rem);
  border-color: rgba(125, 211, 252, 0.32);
}
.super-server-hero h1 {
  font-size: clamp(2.25rem, 4vw, 4.5rem);
  letter-spacing: -0.06em;
}
.super-server-hero p { max-width: 760px; color: #c5d8eb; }

.large-cta,
.primary,
button.primary,
.floating-import {
  background: linear-gradient(135deg, #63d7ff, #6aa7ff 55%, #f6c96b);
  color: #06111f;
  border: 0;
  box-shadow: 0 16px 38px rgba(96, 165, 250, 0.22);
  font-weight: 800;
}
button.primary:hover,
.large-cta:hover,
.floating-import:hover { filter: brightness(1.07); transform: translateY(-1px); }

.capability-command-deck,
.model-routing-matrix,
.meta-contract-panel,
.autopilot-panel {
  border-color: rgba(125, 211, 252, 0.26);
}

.command-deck-grid,
.routing-matrix-grid,
.meta-contract-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.command-card,
.routing-matrix-grid > div,
.meta-contract-grid > div {
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.022));
  padding: 1rem;
  min-height: 118px;
}
.command-card span,
.routing-matrix-grid b {
  color: var(--phase27d-cyan);
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
}
.command-card strong,
.meta-contract-grid strong { display: block; font-size: 1rem; margin-bottom: 0.45rem; }
.command-card p,
.meta-contract-grid span,
.routing-matrix-grid span { color: var(--phase27d-muted); line-height: 1.45; }
.command-card code,
.routing-matrix-grid code {
  margin-top: 0.75rem;
  display: inline-block;
  color: var(--phase27d-gold);
}
.gold-card {
  border-color: rgba(246,201,107,0.35);
  background: linear-gradient(180deg, rgba(246,201,107,0.12), rgba(255,255,255,0.025));
}
.active-card { box-shadow: 0 0 0 1px rgba(125,211,252,0.12), inset 0 0 28px rgba(125,211,252,0.06); }

.registration-contract,
.autopilot-runbook {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  border: 1px solid rgba(246, 201, 107, 0.24);
  background: rgba(246, 201, 107, 0.07);
  border-radius: 16px;
  padding: 1rem;
}
.registration-contract strong,
.autopilot-runbook strong { color: var(--phase27d-gold); }
.registration-contract span,
.autopilot-runbook span { color: #cfdbeb; }

.capability-detail-pro {
  background: linear-gradient(180deg, rgba(6, 16, 31, 0.72), rgba(7, 18, 33, 0.5));
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.14);
  padding: 1rem;
}
.cap-detail-head h3 { color: var(--phase27d-cyan); }
.capability-guidance-grid section {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 1rem;
}

.latest-job-card,
.autopilot-status {
  border: 1px solid rgba(125,211,252,0.16);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}

.table-wrap table th {
  background: rgba(125, 211, 252, 0.08);
  color: #dff4ff;
}
.table-wrap table tr:hover td { background: rgba(125, 211, 252, 0.045); }

.floating-import {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  padding: 0.95rem 1.15rem;
  border-radius: 999px;
}

.wizard-progress-header,
.terminal,
#jobConsole,
#consoleOutput {
  background: #030712;
  color: #d7f7ff;
  border: 1px solid rgba(125,211,252,0.18);
}

@media (max-width: 1100px) {
  .command-deck-grid,
  .routing-matrix-grid,
  .meta-contract-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .command-deck-grid,
  .routing-matrix-grid,
  .meta-contract-grid { grid-template-columns: 1fr; }
  .floating-import { left: 1rem; right: 1rem; text-align: center; }
}

/* Phase 27E local-source/tool-readiness clarity */
.progress-bar-fill.warning {
  background: linear-gradient(90deg, rgba(255,211,111,0.95), rgba(255,164,71,0.95));
}
.repo-role-note {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(255,211,111,0.28);
  border-radius: 14px;
  background: rgba(255,211,111,0.08);
  color: #ffe7a6;
}
.capability-contract-banner {
  border: 1px solid rgba(124, 242, 165, 0.28);
  background: linear-gradient(135deg, rgba(124, 242, 165, 0.10), rgba(124, 199, 255, 0.06));
}


/* ===== Phase 27F Responsive shell polish ===== */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
.topbar {
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-center { min-width: 0; }
.topbar-controls { display: flex; align-items: center; gap: 8px; }
.chrome-toggle {
  display: none;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}
.brand { min-width: 0; }
.brand strong { display: block; }
#modeBadge {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabs {
  min-width: 0;
  padding-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.tab { flex: 0 0 auto; }
.status-rail { width: 240px; }
.workspace {
  margin-left: 240px;
  padding: 16px;
  min-width: 0;
}
.page.active {
  align-content: start;
  align-items: start;
}
.hero-panel {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: stretch;
}
.hero-copy { display: grid; gap: 0.65rem; }
.hero-actions { align-content: start; }
.catalog-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); }
.catalog-side-panel { top: 88px; }
.metric-grid, .metric-grid.compact, .detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.table-wrap { max-width: 100%; overflow: auto; }
.table-wrap table { min-width: 640px; }
.button-row.tight { flex-wrap: wrap; }
.floating-import { display: none; }
.shell-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(4, 8, 15, 0.48);
  backdrop-filter: blur(2px);
}
body[data-active-tab="catalog"] .workspace { scroll-margin-top: 90px; }

@media (max-width: 1360px) {
  .status-rail { width: 228px; }
  .workspace { margin-left: 228px; padding: 14px; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 1180px) {
  .chrome-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 
      "brand controls"
      "tabs tabs";
    align-items: center;
    padding: 10px 12px;
  }
  .topbar-brand { grid-area: brand; }
  .topbar-controls { grid-area: controls; justify-content: flex-end; }
  .topbar-center {
    grid-area: tabs;
    display: none;
    width: 100%;
    padding-top: 4px;
  }
  body.nav-open .topbar-center { display: block; }
  .tabs {
    padding-bottom: 0;
    overflow: auto;
    background: rgba(6, 12, 21, 0.88);
    border: 1px solid rgba(125,211,252,0.16);
    border-radius: 18px;
    padding: 8px;
  }
  .status-rail {
    position: fixed;
    top: 86px;
    left: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 160ms ease, opacity 160ms ease;
    z-index: 22;
  }
  body.rail-open .status-rail {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .workspace {
    margin-left: 0;
    margin-top: 86px;
    padding: 12px;
  }
  .hero-panel,
  .catalog-layout,
  .autopilot-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .hero-actions, .autopilot-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .action-banner {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .action-banner small {
    text-align: left;
  }
  .action-feed-item {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: start;
  }
  .action-feed-summary,
  .action-feed-time {
    grid-column: 2 / -1;
  }
  .catalog-side-panel { position: static; }
  .section-head, .autopilot-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .floating-import {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    left: auto;
    right: 1rem;
    bottom: 1rem;
    min-width: auto;
  }
}

@media (max-width: 760px) {
  #modeBadge { display: none; }
  .topbar { padding: 10px; gap: 10px; }
  .workspace { margin-top: 84px; padding: 10px; }
  .panel, .hero-panel, .status-rail { padding: 12px; }
  .super-server-hero h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .button-row, .button-row.tight { width: 100%; }
  .button-row > button, .hero-actions button, .autopilot-actions button { width: 100%; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-feed-item { grid-template-columns: 1fr; }
  .action-feed-summary,
  .action-feed-time {
    grid-column: 1;
  }
  .latest-job-top { flex-direction: column; align-items: flex-start; }
  .table-wrap table { min-width: 560px; }
  .floating-import { left: 1rem; right: 1rem; }
}


/* ===== Phase 27G: layout, responsive, and autopilot-result fixes ===== */
:root {
  --shell-topbar-height: 84px;
  --shell-rail-width: 240px;
}

html, body { overflow-x: hidden; }
body { overflow-x: hidden; }
.topbar {
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto !important;
  align-items: start;
  min-height: auto;
}
.topbar-center { min-width: 0; overflow: hidden; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible !important;
  scrollbar-width: none;
}
.topbar-center::-webkit-scrollbar,
.tabs::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
.tab { max-width: 100%; }
.status-rail {
  top: var(--shell-topbar-height) !important;
  width: var(--shell-rail-width) !important;
  max-height: calc(100vh - var(--shell-topbar-height) - 10px);
  overflow: auto;
}
.workspace {
  margin-top: var(--shell-topbar-height) !important;
  margin-left: var(--shell-rail-width) !important;
  padding: 14px !important;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.page.active,
#catalog.page.active,
.capability-catalog-page {
  align-content: start !important;
  align-items: start !important;
  justify-content: stretch;
  grid-auto-rows: max-content;
  gap: 14px;
}
.capability-catalog-page > * { margin-top: 0 !important; }
.super-server-hero,
.hero-panel {
  min-height: 0 !important;
  padding: 20px !important;
  align-items: center !important;
}
.hero-copy,
.hero-actions {
  align-content: start;
}
.catalog-layout { align-items: start; }
.catalog-side-panel {
  position: sticky;
  top: calc(var(--shell-topbar-height) + 8px);
  max-height: calc(100vh - var(--shell-topbar-height) - 24px);
  overflow: auto;
}
.latest-job-card { min-height: 0; }
.wizard-modal { padding: 12px !important; }
.wizard-shell {
  width: min(1640px, calc(100vw - 24px)) !important;
  height: min(980px, calc(100vh - 24px)) !important;
  border-radius: 16px;
}
.wizard-body {
  overflow: auto;
  padding: 14px;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.console-panel,
#wizardConsole { min-width: 0; }
#wizardConsole {
  max-height: 340px;
  overflow: auto;
}
.notice {
  white-space: pre-wrap;
  line-height: 1.55;
}
@media (max-width: 1360px) {
  :root { --shell-rail-width: 228px; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); }
}
@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
  .topbar-center {
    overflow: visible;
  }
  body.nav-open .topbar-center { display: block; }
  .tabs {
    flex-wrap: wrap;
    overflow: visible !important;
  }
  .status-rail {
    width: min(320px, calc(100vw - 24px)) !important;
    top: calc(var(--shell-topbar-height) + 8px) !important;
    max-height: calc(100vh - var(--shell-topbar-height) - 20px);
  }
  .workspace {
    margin-left: 0 !important;
  }
  .hero-panel,
  .catalog-layout,
  .autopilot-grid,
  .two-col {
    grid-template-columns: 1fr !important;
  }
  .catalog-side-panel {
    position: static;
    max-height: none;
  }
}
@media (max-width: 760px) {
  .workspace { padding: 10px !important; }
  .topbar { padding: 10px !important; }
  .hero-panel,
  .panel { padding: 12px !important; }
  .wizard-shell {
    width: calc(100vw - 12px) !important;
    height: calc(100vh - 12px) !important;
  }
  .timeline,
  .detail-grid { grid-template-columns: 1fr; }
}


/* ===== Phase 27G2: fixed-shell layout hotfix =====
   Fixes the large blank area caused by earlier position overrides.
   The command center chrome must be fixed; workspace must start directly below it. */
:root {
  --shell-topbar-height: 92px;
  --shell-rail-width: 240px;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden !important;
}

body[data-shell="meta-mcp"] {
  min-height: 100vh;
}

/* Restore fixed command chrome after previous theme overrides made it relative. */
body[data-shell="meta-mcp"] .topbar {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  z-index: 100 !important;
  width: 100% !important;
}

/* Keep the system rail fixed and aligned under the measured header. */
body[data-shell="meta-mcp"] .status-rail {
  position: fixed !important;
  top: var(--shell-topbar-height, 92px) !important;
  left: 0 !important;
  bottom: 0 !important;
  z-index: 40 !important;
  width: var(--shell-rail-width, 240px) !important;
  max-height: calc(100vh - var(--shell-topbar-height, 92px)) !important;
  overflow: auto !important;
}

/* Workspace should not inherit accidental relative flow offsets. */
body[data-shell="meta-mcp"] .workspace {
  position: relative !important;
  z-index: 1 !important;
  margin-top: var(--shell-topbar-height, 92px) !important;
  margin-left: var(--shell-rail-width, 240px) !important;
  padding: 16px !important;
  min-height: calc(100vh - var(--shell-topbar-height, 92px)) !important;
  max-width: calc(100vw - var(--shell-rail-width, 240px)) !important;
  overflow-x: hidden !important;
}

/* First active page should begin immediately, without phantom vertical gaps. */
body[data-shell="meta-mcp"] .page.active {
  align-content: start !important;
  align-items: start !important;
  justify-content: stretch !important;
  grid-auto-rows: max-content !important;
  gap: 14px !important;
}

body[data-shell="meta-mcp"] .capability-catalog-page > :first-child {
  margin-top: 0 !important;
}

/* Header nav: wrap cleanly without showing the ugly horizontal scrollbar. */
body[data-shell="meta-mcp"] .topbar-center {
  min-width: 0 !important;
  overflow: hidden !important;
}

body[data-shell="meta-mcp"] .tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  overflow: hidden !important;
  max-height: 88px;
}

body[data-shell="meta-mcp"] .tabs::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body[data-shell="meta-mcp"] .tab {
  flex: 0 0 auto !important;
}

/* Prevent oversized hero/panels from being pushed down. */
body[data-shell="meta-mcp"] .hero-panel,
body[data-shell="meta-mcp"] .super-server-hero {
  min-height: 0 !important;
  align-items: center !important;
}

body[data-shell="meta-mcp"] .catalog-layout,
body[data-shell="meta-mcp"] .two-col,
body[data-shell="meta-mcp"] .autopilot-grid {
  min-width: 0 !important;
}

body[data-shell="meta-mcp"] .table-wrap,
body[data-shell="meta-mcp"] pre,
body[data-shell="meta-mcp"] textarea {
  max-width: 100% !important;
}

/* Wizard remains fixed and above the fixed shell. */
body[data-shell="meta-mcp"] .wizard-modal {
  position: fixed !important;
  z-index: 220 !important;
  inset: 0 !important;
}

body[data-shell="meta-mcp"] .wizard-shell {
  width: min(1640px, calc(100vw - 24px)) !important;
  height: min(980px, calc(100vh - 24px)) !important;
}

/* On medium screens use off-canvas rail and remove workspace side margin. */
@media (max-width: 1180px) {
  body[data-shell="meta-mcp"] .status-rail {
    top: calc(var(--shell-topbar-height, 92px) + 8px) !important;
    left: 12px !important;
    bottom: 12px !important;
    width: min(320px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - var(--shell-topbar-height, 92px) - 20px) !important;
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
  }

  body.rail-open[data-shell="meta-mcp"] .status-rail {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body[data-shell="meta-mcp"] .workspace {
    margin-left: 0 !important;
    max-width: 100vw !important;
    padding: 12px !important;
  }

  body[data-shell="meta-mcp"] .topbar-center {
    display: none;
    overflow: visible !important;
  }

  body.nav-open[data-shell="meta-mcp"] .topbar-center {
    display: block;
  }

  body[data-shell="meta-mcp"] .tabs {
    overflow: auto !important;
    max-height: 50vh;
  }
}

@media (max-width: 760px) {
  body[data-shell="meta-mcp"] .workspace {
    padding: 10px !important;
  }

  body[data-shell="meta-mcp"] .wizard-shell {
    width: calc(100vw - 12px) !important;
    height: calc(100vh - 12px) !important;
  }
}
