/* API Integration Theater — wizard shell (W13–W15) */

.at-page main { padding-bottom: 4rem; }

.at-hero {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.at-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 22ch;
  margin: 0.5rem auto 1rem;
}

.at-hero .eyebrow { color: var(--accent); }

.at-hero-lead {
  color: var(--text2);
  max-width: 62ch;
  margin: 0 auto 1.25rem;
  line-height: 1.6;
}

.at-api-banner {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  margin-top: 0.75rem;
}

.at-api-banner code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
}

.at-live-banner {
  border-color: rgba(255, 77, 77, 0.45);
  background: rgba(255, 77, 77, 0.08);
}

.at-live-badge-pill {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.at-live-mode .at-step-panel {
  border-color: rgba(255, 107, 107, 0.2);
}

.at-demo-url {
  margin-top: 1.25rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.at-demo-url label {
  display: block;
  font-size: 0.75rem;
  color: var(--text2);
  margin-bottom: 0.35rem;
}

.at-demo-url-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.at-demo-url input {
  flex: 1;
  min-width: 200px;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.75rem;
}

.at-wizard {
  margin-top: 2rem;
}

.at-step-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.at-step-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text2);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  appearance: none;
  font-family: inherit;
  line-height: 1.2;
}

.at-step-tab:hover { border-color: rgba(249, 115, 22, 0.4); }

.at-step-tab.active {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.55);
  color: var(--text);
}

.at-step-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.7;
}

.at-step-panel {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.at-step-panel h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

.at-step-lead {
  color: var(--text2);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.at-action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.at-status {
  font-size: 0.82rem;
  color: var(--text2);
  font-family: var(--mono);
}

.at-io-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.at-code-shell pre {
  max-height: 360px;
  overflow: auto;
  font-size: 0.72rem;
}

.at-code-shell header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.at-copy {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}

.at-copy:hover {
  color: var(--text);
  border-color: rgba(249, 115, 22, 0.45);
}

.at-code-full { margin-top: 1rem; }

.at-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.at-tier-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.at-tier-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.at-tier-card h3 {
  margin: 0;
  font-size: 1rem;
}

.at-latency {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text2);
}

.at-card-desc {
  font-size: 0.78rem;
  color: var(--text2);
  margin: 0 0 0.75rem;
}

.at-tier-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.at-tier-badge.tier-critical {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
}

.at-tier-badge.tier-caution {
  background: rgba(255, 176, 46, 0.15);
  color: #ffb02e;
}

.at-tier-badge.tier-nominal {
  background: rgba(57, 217, 138, 0.15);
  color: #39d98a;
}

.at-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
}

.at-card-metrics dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text2);
}

.at-card-metrics dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.at-card-extra {
  font-size: 0.75rem;
  color: #60a5fa;
  margin: 0.5rem 0 0;
}

.at-tier-pulse { border-top: 3px solid #f97316; }
.at-tier-meridian { border-top: 3px solid #60a5fa; }
.at-tier-apex { border-top: 3px solid #a78bfa; }

.at-chart-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.at-chart-panel header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.at-chart-panel header p {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--text2);
}

.at-mahal-chart {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.at-placeholder {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text2);
}

.at-stage-track {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.at-stage {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text2);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.at-stage.is-active {
  color: var(--text);
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.12);
}

.at-stage.is-done .at-stage-dot {
  background: #39d98a;
}

.at-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.at-sse-log-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.at-sse-log-wrap header {
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}

.at-sse-log {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.at-sse-log-row {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.at-result-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.at-result-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.at-mono-line {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.at-sop-preview {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text2);
}

.at-sop-preview .at-sop-kind {
  font-size: 0.68rem;
  text-transform: uppercase;
  opacity: 0.7;
}

.at-hash-dl {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.at-hash-dl dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text2);
}

.at-hash-dl dd {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.at-hash {
  color: #39d98a;
}

.at-hash-muted {
  color: var(--text2);
  opacity: 0.85;
}

.at-hash-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.at-hash-row-full dd {
  margin: 0;
}

.at-hash-match {
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.at-hash-match--ok {
  color: #39d98a;
  border-color: rgba(57, 217, 138, 0.35);
  background: rgba(57, 217, 138, 0.08);
}

.at-hash-match--fail {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
}

.at-hash-match--pending {
  color: var(--text2);
  background: rgba(255, 255, 255, 0.03);
}

.at-btn-ghost.at-btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
}

.at-btn-ghost.at-btn-sm:hover {
  color: var(--text);
  border-color: rgba(249, 115, 22, 0.45);
}

.at-tab-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.at-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text2);
  font-size: 0.82rem;
  cursor: pointer;
}

.at-tab.active {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.45);
  color: var(--text);
}

.at-replay-pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .at-io-pair,
  .at-tier-grid {
    grid-template-columns: 1fr;
  }

  .at-step-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
  }
}
