/* ── Artifacts Split-View Studio & Code Explorer ── */

.artifacts-header {
  padding: max(12px, env(safe-area-inset-top, 12px)) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-hairline);
  background: #0d101a;
  flex-shrink: 0;
}

.artifacts-tabs {
  display: flex;
  background: #090c14;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}

.art-tab {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.art-tab.active {
  background: #1b2236;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.artifacts-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.artifacts-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  background: var(--bg-card);
}

.art-panel {
  display: none;
  height: 100%;
}

.art-panel.active {
  display: block;
}

/* Tab 1: Artifact Body */
.artifact-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--ink-muted);
}

.artifact-empty-state p {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-top: 12px;
}

.artifact-empty-state span {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.artifact-body {
  padding: 24px 24px 80px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-primary);
  max-width: 820px;
  margin: 0 auto;
}

.artifact-body h1, .artifact-body h2, .artifact-body h3, .artifact-body h4 {
  color: #fff;
  margin: 20px 0 10px;
  letter-spacing: -0.015em;
}

.artifact-body h1 { font-size: 22px; font-weight: 800; }
.artifact-body h2 { font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--border-hairline); padding-bottom: 8px; }
.artifact-body h3 { font-size: 15.5px; font-weight: 600; }

.artifact-body p {
  margin-bottom: 14px;
}

.artifact-body ul, .artifact-body ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.artifact-body li {
  margin-bottom: 6px;
}

.artifact-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.artifact-body th, .artifact-body td {
  border: 1px solid var(--border-hairline);
  padding: 8px 12px;
  text-align: left;
}

.artifact-body th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 600;
}

.artifact-body pre {
  background: #080a12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 14px 0;
}

.artifact-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 5px;
  border-radius: 4px;
  color: #c7d2fe;
}

/* Tab 2: Live Preview Frame */
#tabPreview {
  width: 100%;
  height: 100%;
  position: relative;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: #05070e;
}

/* Tab 3: Repo Files Tree & Code Inspector */
.repo-browser-split {
  display: flex;
  height: 100%;
}

.repo-tree-col {
  width: 200px;
  border-right: 1px solid var(--border-hairline);
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #0a0d18;
  flex-shrink: 0;
}

.repo-code-col {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #060810;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre;
  color: #e2e8f0;
}

.tree-node {
  padding: 6px 8px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
  transition: all 0.14s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.tree-node.active {
  background: #1e263d;
  color: #fff;
  font-weight: 600;
}

.tree-icon {
  font-size: 13px;
  flex-shrink: 0;
}
