/* ── Right column ── */
.right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Right-column tab bar ── */
.right-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.right-tabs::-webkit-scrollbar { display: none; }
.right-tab {
  font-size: 13px; font-weight: 500;
  padding: 10px 14px;
  color: var(--text-muted);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.right-tab:hover { color: var(--text); }
.right-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Live Preview section (top) ── */
.preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* ── Component Explorer section ── */
.explorer-section {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.explorer-section.active { display: flex; }

.explorer-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.explorer-search {
  flex: 1; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: 12px; font-family: inherit;
  transition: border-color .15s;
}
.explorer-search:focus { border-color: var(--accent); }
.explorer-search::placeholder { color: var(--text-dim); }
.explorer-refresh-btn {
  font-size: 11px; padding: 4px 10px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: color .15s;
  white-space: nowrap;
}
.explorer-refresh-btn:hover { color: var(--text); }

.explorer-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px;
}
.explorer-body::-webkit-scrollbar { width: 6px; }
.explorer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.explorer-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  gap: 10px; color: var(--text-dim); text-align: center;
}
.explorer-empty-icon { font-size: 36px; opacity: .3; }
.explorer-empty-text { font-size: 13px; }

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.comp-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.comp-card:hover { border-color: var(--accent); background: rgba(47,129,247,.04); }
.comp-card.selected { border-color: var(--accent); background: rgba(47,129,247,.08); }

.comp-card-name {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px;
}
.comp-card-desc {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.comp-card-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.comp-card-chip {
  font-size: 10px; padding: 1px 7px;
  border-radius: 20px; font-weight: 500;
}
.comp-card-chip.variant {
  background: rgba(47,129,247,.12); color: var(--accent);
  border: 1px solid rgba(47,129,247,.2);
}
.comp-card-chip.size {
  background: rgba(63,185,80,.1); color: var(--green);
  border: 1px solid rgba(63,185,80,.2);
}

/* Component detail drawer */
.comp-detail {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  max-height: 50%;
}
.comp-detail.open { display: flex; }

.comp-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.comp-detail-title { font-size: 13px; font-weight: 600; }
.comp-detail-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 2px 6px; line-height: 1;
}
.comp-detail-close:hover { color: var(--text); }

.comp-detail-tabs {
  display: flex; gap: 0; padding: 0 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.comp-detail-tabs::-webkit-scrollbar { display: none; }
.comp-detail-tab {
  font-size: 11px; font-weight: 500;
  padding: 7px 12px; color: var(--text-muted);
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s;
}
.comp-detail-tab:hover { color: var(--text); }
.comp-detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.comp-detail-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px;
  font-size: 12px; color: var(--text-muted);
}
.comp-detail-body::-webkit-scrollbar { width: 6px; }
.comp-detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.comp-detail-pane { display: none; }
.comp-detail-pane.active { display: block; }

.detail-section { margin-bottom: 14px; }
.detail-section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-dim); margin-bottom: 6px;
}
.detail-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border-soft);
}
.detail-chip.variant { background: rgba(47,129,247,.1); color: var(--accent); border-color: rgba(47,129,247,.2); }
.detail-chip.size { background: rgba(63,185,80,.08); color: var(--green); border-color: rgba(63,185,80,.2); }
.detail-chip.state { background: rgba(210,153,34,.08); color: var(--orange); border-color: rgba(210,153,34,.2); }

.props-table { width: 100%; border-collapse: collapse; }
.props-table th, .props-table td {
  text-align: left; padding: 5px 8px; font-size: 11px;
  border-bottom: 1px solid var(--border-soft);
}
.props-table th { color: var(--text-dim); font-weight: 600; }
.props-table td { color: var(--text-muted); }
.props-table td:first-child { color: var(--purple); font-family: "SFMono-Regular", Consolas, monospace; }
.props-table td.prop-required { color: var(--red); font-size: 10px; }

.anatomy-slot { margin-bottom: 6px; }
.anatomy-slot-name {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--accent); font-size: 11px;
}
.anatomy-slot-desc { color: var(--text-muted); font-size: 11px; }

.token-ref-row { display: flex; flex-direction: column; gap: 4px; }
.token-ref {
  display: flex; align-items: flex-start; gap: 8px; font-size: 11px;
}
.token-ref-key {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--purple); min-width: 120px; flex-shrink: 0;
}
.token-ref-val { color: var(--text-muted); word-break: break-all; }

.preview-model-badge {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 2px 8px;
}

/* Code/Preview toggle button */
.code-toggle-btn {
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.code-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
.code-toggle-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(47,129,247,.08); }

/* Preview history navigation */
.preview-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.preview-nav-btn {
  font-size: 13px; line-height: 1;
  width: 24px; height: 24px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: color .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.preview-nav-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.preview-nav-btn:disabled { opacity: 0.35; cursor: default; }
.preview-nav-counter {
  font-size: 10px; color: var(--text-dim);
  padding: 0 4px;
  white-space: nowrap;
}

.preview-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}
.preview-empty-icon { font-size: 40px; opacity: .35; }
.preview-empty-text { font-size: 13px; line-height: 1.6; }

/* Iframe fills the preview body */
.preview-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
  display: block;
}

/* Code view */
.code-view-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.code-view-toolbar {
  display: flex; justify-content: flex-end;
  padding: 8px 12px 4px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.copy-code-btn {
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  background: var(--bg-panel); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: color .15s;
}
.copy-code-btn:hover { color: var(--text); }
.code-view {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 16px 20px;
  background: var(--bg-input);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}
.code-view::-webkit-scrollbar { width: 6px; height: 6px; }
.code-view::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Design System Used / Preview Details section (bottom) ── */
.tools-section {
  flex: 0 0 auto;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Bottom panel sub-tabs */
.tools-sub-tabs {
  display: flex;
  gap: 0;
  flex: 1;
}
.tools-sub-tab {
  font-size: 12px; font-weight: 500;
  padding: 0 14px;
  color: var(--text-muted);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  height: 100%;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tools-sub-tab:hover { color: var(--text); }
.tools-sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tools-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px 12px;
}
.tools-body::-webkit-scrollbar { width: 6px; }
.tools-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.tools-empty {
  font-size: 12px; color: var(--text-dim);
  font-style: italic; padding: 6px 0;
}

.tools-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.tool-item {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-tool);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px; color: var(--purple);
}
.tool-item::before { content: "⚙"; font-size: 10px; opacity: .7; }

/* ── Usage panel ── */
.usage-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.usage-row:last-child { border-bottom: none; }
.usage-label { color: var(--text-dim); }
.usage-value { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.usage-row-total .usage-label,
.usage-row-total .usage-value { font-weight: 600; color: var(--text); }
.usage-cost { color: var(--accent); }
.usage-row-sub { padding: 2px 0 2px 10px; border-bottom: none; }
.usage-row-sub .usage-label { font-size: 11px; }
.usage-value-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; }

/* Token chips (in markdown/preview) */
.token-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(188,140,255,.1);
  border: 1px solid rgba(188,140,255,.25);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 12px; color: var(--purple);
  font-family: "SFMono-Regular", Consolas, monospace;
  vertical-align: middle;
}
.token-chip-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}

/* ── Component Gallery section ── */
.gallery-section {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.gallery-section.active { display: flex; }

.gallery-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px;
}
.gallery-body::-webkit-scrollbar { width: 6px; }
.gallery-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.gallery-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.gallery-card:hover { border-color: var(--accent); }

.gallery-card-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.gallery-card-name { font-size: 13px; font-weight: 600; flex-shrink: 0; }

.gallery-variant-bar {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-left: auto;
}
.gallery-variant-btn {
  font-size: 10px; padding: 1px 8px; border-radius: 20px;
  background: var(--bg-input); color: var(--text-muted);
  border: 1px solid var(--border); cursor: pointer;
  transition: color .1s, border-color .1s, background .1s;
  white-space: nowrap;
}
.gallery-variant-btn:hover { color: var(--accent); border-color: var(--accent); }
.gallery-variant-btn.active {
  background: rgba(47,129,247,.12); color: var(--accent);
  border-color: rgba(47,129,247,.3);
}

.gallery-preview {
  padding: 28px 20px;
  background: #f9fafb;
  min-height: 110px;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px; color: #111827;
  overflow: hidden;
}

.gallery-card-footer {
  padding: 8px 14px;
  font-size: 11px; color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
  line-height: 1.4;
}

/* ── Preview Notes content ── */
.preview-notes-content {
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
}
.preview-notes-content p { margin: 0 0 8px; }
.preview-notes-content p:last-child { margin-bottom: 0; }
.preview-notes-content ul, .preview-notes-content ol { padding-left: 1.4em; margin: 0 0 8px; }
.preview-notes-content li { margin: 3px 0; }
.preview-notes-content strong { color: var(--text); font-weight: 600; }
.preview-notes-content code {
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px;
  color: var(--orange);
}

/* ── About / What & Why section ── */
.about-section {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.about-section.active { display: flex; }

.about-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
}
.about-body::-webkit-scrollbar { width: 6px; }
.about-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.about-intro {
  font-size: 14px; line-height: 1.7;
  color: var(--text);
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.about-intro a { color: var(--accent); text-decoration: none; }
.about-intro a:hover { text-decoration: underline; }

.about-intro-cta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.about-capabilities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.about-capability {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.about-capability-title {
  font-size: 12px; font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.about-capability-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}

.about-cta-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.about-cta-block h3 { border-bottom: none; padding-bottom: 0; }

.about-section-block {
  margin-bottom: 24px;
}
.about-section-block h3 {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.about-section-block p { margin: 0 0 8px; }
.about-section-block p:last-child { margin-bottom: 0; }
.about-section-block strong { color: var(--text); font-weight: 600; }
.about-section-block a { color: var(--accent); text-decoration: none; }
.about-section-block a:hover { text-decoration: underline; }
.about-section-block code {
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px;
  color: var(--orange);
}

.about-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; margin-top: 4px;
}
.about-table th {
  text-align: left; padding: 6px 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.about-table td {
  padding: 7px 10px; color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.about-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.about-table-highlight td { background: rgba(47,129,247,.04); }
.about-table-highlight td:first-child { color: var(--accent); }

.about-diagram {
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px;
  color: var(--text-muted); white-space: pre; overflow-x: auto;
  margin: 0 0 10px;
}

.about-steps {
  padding-left: 1.4em; margin: 0;
}
.about-steps li { margin: 5px 0; color: var(--text-muted); }
.about-steps em { color: var(--text); font-style: italic; }
.about-steps code {
  background: var(--bg-input); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px;
  color: var(--orange);
}

.about-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.about-tools-group {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.about-tools-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-dim); margin-bottom: 4px;
}
.about-tools-group code {
  background: none; border: none; padding: 0;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px;
  color: var(--purple);
}

/* Mobile responsive */
@media (max-width: 900px) {
  .chat-panel { width: 42%; min-width: 260px; }
  /* Fade right edge of tab strip to hint overflow */
  .right-tabs {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }
}

@media (max-width: 700px) {
  .main { flex-direction: column; height: auto; overflow: visible; }
  .chat-panel { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid var(--border); height: 55vh; }
  .right-column { height: auto; min-height: 45vh; overflow: visible; }
  .preview-section { flex: none; height: 40vh; }
  .explorer-section { flex: none; height: 40vh; }
  .gallery-section { flex: none; height: 40vh; }
  .about-section { flex: none; height: 60vh; }
  .about-body { padding: 14px 16px; }
  .tools-section { max-height: 140px; }
  .comp-detail { max-height: 55%; min-height: 200px; }
  .right-tab { font-size: 12px; padding: 9px 10px; }
  .about-table td:first-child { white-space: normal; }
}

/* ── Product navigation ──────────────────────────────────────────────────── */
.product-nav {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.product-nav::-webkit-scrollbar { display: none; }
.product-nav-btn {
  font-size: 13px; font-weight: 500;
  padding: 11px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.product-nav-btn:hover { color: var(--text); }
.product-nav-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── App sections (top-level pages) ─────────────────────────────────────── */
.app-section {
  display: none;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.app-section.active {
  display: flex;
  flex-direction: column;
}

/* Workspace section contains the existing split-panel layout */
#section-workspace.active { flex-direction: column; }
#section-workspace .main {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Design System Ops section ──────────────────────────────────────────── */
.ds-ops-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.ds-ops-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-ops-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.ds-ops-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.ds-ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.ds-ops-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .15s;
}
.ds-ops-card:hover { border-color: var(--text-dim); }
.ds-ops-card-icon {
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}
.ds-ops-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-ops-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.ds-ops-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.ds-ops-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ds-ops-btn {
  font-size: 12px; font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.ds-ops-btn-primary {
  background: rgba(47,129,247,.12);
  color: var(--accent);
  border-color: rgba(47,129,247,.35);
}
.ds-ops-btn-primary:hover { background: rgba(47,129,247,.22); }
.ds-ops-btn-secondary {
  background: var(--bg-input);
  color: var(--text-muted);
  border-color: var(--border);
}
.ds-ops-btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }
.ds-ops-btn-danger {
  background: rgba(248,81,73,.10);
  color: var(--red);
  border-color: rgba(248,81,73,.30);
}
.ds-ops-btn-danger:hover { background: rgba(248,81,73,.20); }
.ds-ops-card-danger {
  border-color: rgba(248,81,73,.25);
}
.ds-ops-card-danger:hover { border-color: rgba(248,81,73,.50); }
.ds-ops-card-danger .ds-ops-card-icon { color: var(--red); }

/* ── Agent Sandbox section ──────────────────────────────────────────────── */
.sandbox-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.agents-panel-body {
  flex: 1;
}
.agents-loading { padding: 16px; font-size: 12px; color: var(--text-dim); }
.sandbox-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
}
.sandbox-coming-soon {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sandbox-coming-soon-icon {
  font-size: 24px;
  color: var(--purple);
  line-height: 1;
}
.sandbox-coming-soon h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.sandbox-coming-soon p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.sandbox-feature-list {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 20px;
  margin: 4px 0;
}
.sandbox-feature-list strong { color: var(--text); }
.sandbox-use-workspace {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}
.sandbox-link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}
.sandbox-link-btn:hover { color: #5b9cf0; }

/* ── About section (top-level) ──────────────────────────────────────────── */
#section-about .about-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 40px;
  overflow-y: auto;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ds-ops-body,
  .sandbox-body { padding: 24px 24px; }
  #section-about .about-body { padding: 24px 24px; }
  .ds-ops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .product-nav { padding: 0 12px; }
  .product-nav-btn { font-size: 12px; padding: 10px 10px; }
  .ds-ops-body,
  .sandbox-body { padding: 16px; }
  #section-about .about-body { padding: 16px; }
}

/* ── DS Ops readiness panel (Phase 4) ───────────────────────────────────── */
.ds-ops-readiness {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ds-ops-readiness-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ds-ops-readiness-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.ds-ops-readiness-score {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ds-ops-readiness-dismiss {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.ds-ops-readiness-dismiss:hover { color: var(--text-muted); }
.ds-ops-readiness-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}
.ds-ops-readiness-badge.ready {
  color: var(--green);
  border-color: rgba(63,185,80,.4);
  background: rgba(63,185,80,.08);
}
.ds-ops-readiness-badge.usable-with-warnings {
  color: var(--orange);
  border-color: rgba(210,153,34,.4);
  background: rgba(210,153,34,.08);
}
.ds-ops-readiness-badge.insufficient {
  color: var(--red);
  border-color: rgba(248,81,73,.4);
  background: rgba(248,81,73,.08);
}
.ds-ops-readiness-findings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-ops-readiness-finding {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.ds-ops-readiness-finding-icon { flex-shrink: 0; }
.ds-ops-readiness-finding.critical .ds-ops-readiness-finding-icon { color: var(--red); }
.ds-ops-readiness-finding.warning .ds-ops-readiness-finding-icon { color: var(--orange); }
.ds-ops-readiness-finding.info    .ds-ops-readiness-finding-icon { color: var(--accent); }
.ds-ops-readiness-next-steps {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
}
.ds-ops-readiness-next-steps strong { color: var(--text-muted); }

/* ── DS Ops warnings panel (Phase 4) ─────────────────────────────────────── */
.ds-ops-warnings-panel {
  border: 1px solid rgba(210,153,34,.3);
  border-radius: var(--radius);
  background: rgba(210,153,34,.05);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ds-ops-warnings-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ds-ops-warnings-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  flex: 1;
}
.ds-ops-warnings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-ops-warnings-list li {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}
.ds-ops-warnings-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--orange);
}
.ds-ops-warnings-list li.info::before { color: var(--accent); }

/* ── Agent Sandbox — Meet the Agents cards (Workstream C) ───────────────── */
.sandbox-agents-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sandbox-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sandbox-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  flex: 1;
}
.sandbox-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.sandbox-agent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.sandbox-agent-cards-loading {
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 0;
}
.sandbox-agent-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .15s;
}
.sandbox-agent-card:hover { border-color: var(--text-dim); }
.sandbox-agent-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sandbox-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sandbox-agent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sandbox-agent-tool-count {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
}
.sandbox-agent-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.sandbox-agent-tools {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
@media (max-width: 700px) {
  .sandbox-agent-cards { grid-template-columns: 1fr; }
}

/* ── Scenario Runner ──────────────────────────────────────────────────────── */
.sr-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.sr-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.sr-section-header .sandbox-coming-soon-icon {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1.2;
  margin-top: 2px;
}
.sr-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.sr-section-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}
.sr-scenario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.sr-scenario-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.sr-scenario-chip:hover { border-color: var(--accent); color: var(--text); }
.sr-scenario-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(88,166,255,.08); }
.sr-scenario-desc-line {
  font-size: 11.5px;
  color: var(--text-dim);
  font-style: italic;
  margin: 0 0 12px;
}
.sr-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.sr-step-trace {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.sr-trace-pre {
  margin: 0;
  font-size: 10.5px;
  overflow: auto;
  max-height: 160px;
  white-space: pre-wrap;
  word-break: break-all;
}
.sr-eval-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sr-eval-entry-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sr-eval-entry-text strong {
  font-size: 13px;
  color: var(--text);
}
.sr-eval-entry-text span {
  font-size: 12px;
  color: var(--text-dim);
}
.sr-eval-link {
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
