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

:root {
  --bg: #fff;
  --bg-2: #f8f8f8;
  --text: #111;
  --text-2: #444;
  --text-3: #888;
  --border: #e5e5e5;
  --accent: #2563eb;
  --zone-repo-bg: #1a1a1a;
  --mono: 'Menlo', 'Monaco', monospace;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

nav {
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
}
nav a { color: var(--text-2); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--accent); }

.page-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 32px 40px;
}
.page-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-header .subtitle { font-size: 15px; color: var(--text-2); }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Diagram */
.diagram-section {
  margin-top: 28px;
}
.diagram-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 14px;
}

.diagram-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 260px;
  background: var(--bg-2);
  position: relative;
}

/* Panels */
.panel {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.panel-local { background: var(--bg-2); }
.panel-github {
  background: #dbeafe;
  border-left: 1px solid rgba(37,99,235,.15);
  border-right: 1px solid rgba(37,99,235,.15);
}
.panel-clone {
  background: #f0fdf4;
  border-left: 1px solid rgba(22,163,74,.15);
  display: none;
}
.panel-clone.visible { display: flex; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.panel-icon { font-size: 22px; }
.panel-title { font-size: 13px; font-weight: 700; color: var(--text); }
.panel-subtitle { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.panel-divider {
  height: 1px;
  background: rgba(0,0,0,.07);
  margin: 2px 0 6px;
}

/* Commit timeline in panels */
.commit-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}
.commit-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.commit-row.visible { opacity: 1; transform: translateY(0); }
.commit-row.flying {
  animation: flyRight 0.6s ease forwards;
}
.commit-row.flying-left {
  animation: flyLeft 0.6s ease forwards;
}
@keyframes flyRight {
  0%  { opacity: 1; transform: translateX(0); }
  50% { opacity: .6; transform: translateX(60px); }
  100%{ opacity: 1; transform: translateX(0); }
}
@keyframes flyLeft {
  0%  { opacity: 1; transform: translateX(0); }
  50% { opacity: .6; transform: translateX(-60px); }
  100%{ opacity: 1; transform: translateX(0); }
}

.c-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
}
.c-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.c-line {
  width: 2px;
  height: 18px;
  background: rgba(37,99,235,.2);
}
.c-info {}
.c-msg { font-size: 12px; font-weight: 500; color: var(--text); }
.c-hash { font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-top: 1px; }

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  gap: 8px;
}
.empty-state .e-icon { font-size: 28px; opacity: .4; }
.empty-state .e-text { font-size: 13px; color: var(--text-3); }

/* Center arrows column */
.arrows-col {
  width: 80px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.arrow-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
  width: 68px;
  text-align: center;
}
.arrow-btn:hover:not(:disabled) { background: #eff6ff; box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.arrow-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.arrow-btn .a-arrow { font-size: 16px; }
.arrow-btn.btn-push .a-arrow { color: #2563eb; }
.arrow-btn.btn-pull .a-arrow { color: #7c3aed; }
.arrow-btn.btn-clone .a-arrow { color: #16a34a; }
.arrow-btn.btn-reset-diag {
  color: var(--text-3);
  font-size: 10px;
  font-family: system-ui, sans-serif;
  font-weight: 400;
}

/* Steps section */
.steps-section {
  margin-top: 32px;
  padding-bottom: 60px;
}
.steps-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.steps-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-body { flex: 1; }
.step-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.step-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 10px;
}
.step-desc:last-child { margin-bottom: 0; }

.code-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0d1117;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
}
.code-block code {
  font-family: var(--mono);
  font-size: 13px;
  color: #7dd3fc;
  flex: 1;
}
.copy-btn {
  padding: 5px 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  color: rgba(255,255,255,.6);
  font-size: 11px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.copy-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.copy-btn.copied { color: #86efac; border-color: #86efac; }

/* New pc badge */
.new-pc-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11px;
  padding: 2px 8px;
  font-weight: 600;
  margin-left: 6px;
}

@media (max-width: 640px) {
  nav, .page-header { padding-left: 20px; padding-right: 20px; }
  .container { padding: 0 20px; }
  .diagram-wrapper { flex-direction: column; min-height: auto; }
  .arrows-col {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px;
  }
  .panel-github { border-left: none; border-right: none; border-top: 1px solid rgba(37,99,235,.15); }
}
