/* publish.reprex.org — Branded public publication page */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f8f9fa;
  color: #333;
}

/* ---- Header ---- */

.publish-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  height: 48px;
}

.publish-header .logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.publish-header .title {
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.publish-header .title a {
  color: inherit;
  text-decoration: none;
}

.publish-header .title a:hover {
  text-decoration: underline;
}

.publish-header .badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}

.publish-header .badge-snapshot {
  background: #e0f2fe;
  color: #0369a1;
}

.publish-header .badge-live {
  background: #dcfce7;
  color: #15803d;
}

/* ---- Main content ---- */

.publish-body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 48px);
}

.publish-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ---- Loading / Error ---- */

.publish-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100% - 48px);
  color: #999;
  font-size: 14px;
  gap: 12px;
}

.publish-status .error {
  color: #dc2626;
}

/* ---- Header right (status + run button) ---- */

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.status-text {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.run-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: #1a73e8;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.run-btn:hover:not(:disabled) {
  background: #1557b0;
}

.run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Live mode loading overlay ---- */

.publish-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  font-size: 14px;
  gap: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
