/* ============================================
   ReadmeForge – Professional Stylesheet v4.0
   Clean developer-tool aesthetic
   ============================================ */

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

:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --bg-surface: #161616;
  --bg-hover: #1a1a1a;
  --border: #252525;
  --border-focus: #3b82f6;
  --border-subtle: #1c1c1c;
  --text-primary: #f2f2f2;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --accent-dim-hover: rgba(59, 130, 246, 0.2);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.08);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.08);
  --purple: #a855f7;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;
  --transition: 0.15s ease;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.6);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Subtle dot grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, #222 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

/* ── Top gradient fade ── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59,130,246,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  cursor: default;
  user-select: none;
}

.logo-mark {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 14px;
  height: 14px;
  color: white;
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-version {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  transition: color var(--transition);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  font-weight: 400;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
}
.icon-btn:hover { background: var(--bg-hover); border-color: #333; color: var(--text-primary); }
.icon-btn.active { background: var(--accent-dim); border-color: rgba(59,130,246,0.4); color: var(--accent); }

/* ── API Key Settings Panel ── */
.settings-panel {
  position: fixed;
  top: 60px;
  right: 1.5rem;
  z-index: 300;
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  animation: fadeSlideDown 0.15s ease;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.settings-panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
  transition: all var(--transition);
}
.settings-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.settings-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.settings-desc a {
  color: var(--accent);
  text-decoration: none;
}
.settings-desc a:hover { text-decoration: underline; }

.settings-field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.api-key-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  padding: 0.5rem 0.75rem;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.api-key-input:focus { border-color: var(--border-focus); }
.api-key-input::placeholder { color: var(--text-muted); font-family: var(--font-mono); }

.save-key-btn {
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.save-key-btn:hover { background: var(--accent-hover); }

.settings-status {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}
.settings-status.set { color: var(--green); }
.settings-status.set::before {
  content: '●';
  font-size: 0.5rem;
}

/* ── Main Layout ── */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 3.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.eyebrow-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.75;
  font-weight: 400;
}

/* ── URL Input Block ── */
.input-block {
  margin-bottom: 1rem;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-label svg { color: var(--text-muted); }

.input-row {
  display: flex;
  gap: 0.6rem;
}

.repo-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}

.repo-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.repo-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.generate-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

.generate-btn:active { transform: translateY(1px); }
.generate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.generate-btn.loading .btn-spinner { display: block; }
.generate-btn.loading .btn-label { display: none; }

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

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.input-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1em 0.45em;
  border: 1px solid #333;
  border-radius: 3px;
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 0.15em 0.55em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-ai 2s ease infinite;
}

@keyframes pulse-ai {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Examples ── */
.examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.examples-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.example-tag {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition);
}
.example-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Info Strip ── */
.info-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.info-item svg { color: var(--text-muted); flex-shrink: 0; }
.info-sep { width: 1px; height: 14px; background: var(--border); }

/* ── Loading State ── */
.loading-state {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 2rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.loading-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  animation: fadeIn 0.25s ease;
}

.loading-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}

.loading-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.loading-step {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.loading-progress {
  background: var(--bg-surface);
  border-radius: 100px;
  height: 2px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  width: 0%;
  transition: width 0.6s ease;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.step-item.done { color: var(--green); }
.step-item.active { color: var(--text-primary); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
}

.step-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 6px rgba(59,130,246,0.5);
  animation: pulse-step 1.2s ease infinite;
}

.step-dot.done { border-color: var(--green); background: var(--green); }

@keyframes pulse-step {
  0%, 100% { box-shadow: 0 0 4px rgba(59,130,246,0.4); }
  50% { box-shadow: 0 0 12px rgba(59,130,246,0.7); }
}

/* ── Error State ── */
.error-state {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 2rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
}

.error-card {
  width: 100%;
  max-width: 480px;
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  padding: 1.75rem;
  animation: fadeIn 0.25s ease;
}

.error-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.error-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(239,68,68,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}

.error-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.error-message {
  color: var(--text-secondary);
  font-size: 0.83rem;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-xs);
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
  font-size: 0.83rem;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.retry-btn:hover { background: rgba(239,68,68,0.15); }

/* ── Result Section ── */
.result-section {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  animation: fadeIn 0.3s ease;
}

/* ── Repo Stats Bar ── */
.repo-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.stat-repo-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.stat-repo-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: color var(--transition);
}
.stat-repo-name:hover { color: var(--accent); }

.stat-repo-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.stat-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Tabs ── */
.tabs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom: none;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tabs {
  display: flex;
  gap: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover:not(.active) { color: var(--text-secondary); }

.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.77rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--bg-hover);
  border-color: #333;
  color: var(--text-primary);
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.action-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.action-btn.copied {
  background: var(--green-dim);
  border-color: rgba(34,197,94,0.3);
  color: var(--green);
}

.action-btn.active {
  background: var(--accent-dim);
  border-color: rgba(59,130,246,0.35);
  color: var(--accent);
}

/* ── Content Area ── */
.content-area {
  display: flex;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 500px;
  overflow: hidden;
  background: var(--bg-secondary);
}

/* Outline panel */
.outline-panel {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 1rem 0;
  display: none;
  overflow-y: auto;
}

.outline-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.outline-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0.4rem;
}

.outline-link {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.26rem 0.55rem;
  border-radius: 4px;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.outline-link.level-2 { font-weight: 500; color: var(--text-secondary); }
.outline-link.level-3 { padding-left: 1.2rem; font-size: 0.72rem; }

.outline-link:hover { background: var(--bg-hover); color: var(--text-primary); }

.content-pane {
  flex: 1;
  min-width: 0;
}

/* Split view */
.result-section.split-active .content-area { flex-direction: row; }
.result-section.split-active .content-pane { width: 50%; flex: 1; }
.result-section.split-active #rawPane { border-left: 1px solid var(--border); }

/* ── Markdown Preview ── */
.markdown-body {
  padding: 2rem 2.5rem;
  color: var(--text-primary);
  line-height: 1.78;
  font-size: 0.92rem;
}

.markdown-body h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.markdown-body h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.markdown-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text-primary);
}

.markdown-body h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.markdown-body p { margin-bottom: 1rem; color: #c0c0c0; }

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
}
.markdown-body a:hover { text-decoration: underline; }

.markdown-body ul, .markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.markdown-body li { margin-bottom: 0.3rem; color: #c0c0c0; }

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 3px;
  color: #e5e5e5;
}

.markdown-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  position: relative;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #d4d4d4;
  font-size: 0.84rem;
}

.code-lang {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.markdown-body blockquote {
  border-left: 2px solid var(--border);
  padding: 0.1rem 0 0.1rem 1rem;
  color: var(--text-secondary);
  margin: 1rem 0;
}

/* GitHub Alerts */
.gh-alert {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-xs);
  margin: 1.1rem 0;
  font-size: 0.85rem;
  border: 1px solid;
  border-left-width: 3px;
}

.gh-alert > span:first-child { font-size: 0.9rem; }

.gh-alert > span:nth-child(2) {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gh-alert p { margin: 0; color: inherit; }

.alert-note    { background: rgba(59,130,246,0.05); border-color: rgba(59,130,246,0.25); color: var(--accent); }
.alert-tip     { background: rgba(34,197,94,0.05); border-color: rgba(34,197,94,0.25); color: var(--green); }
.alert-important { background: rgba(168,85,247,0.05); border-color: rgba(168,85,247,0.25); color: var(--purple); }
.alert-warning { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.25); color: var(--amber); }
.alert-caution { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.25); color: var(--red); }

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.markdown-body th, .markdown-body td {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.markdown-body tr:nth-child(even) { background: rgba(255,255,255,0.01); }
.markdown-body img { max-width: 100%; border-radius: 5px; }

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Task list */
.task-list { list-style: none; padding-left: 0; }
.task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: #c0c0c0;
}
.task-item.done { color: var(--text-muted); text-decoration: line-through; }
.task-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  font-size: 0.6rem;
  flex-shrink: 0;
  color: transparent;
}
.task-check.checked {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* Badge row */
.badge-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.badge-img { height: 20px; }

/* ── Raw Markdown Pane ── */
.raw-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #aaa;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1.75rem;
  line-height: 1.7;
  tab-size: 2;
}

/* ── How It Works Section ── */
.how-section {
  position: relative; z-index: 1;
  padding: 4rem 1.5rem 5rem;
  max-width: 760px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.step-row:last-child { border-bottom: none; }
.step-row:hover { background: var(--bg-hover); }

.step-number-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step-content {}
.step-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.step-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ── Footer ── */
.footer {
  position: relative; z-index: 1;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-text {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-logo-sep { color: var(--border); }

.footer-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--text-primary); }

/* ── Utilities ── */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.4s ease both;
}

/* ── Shake animation ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake 0.35s ease; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .outline-panel { display: none !important; }
  .result-section.split-active .content-pane { width: 100%; }
  .result-section.split-active #rawPane { border-left: none; border-top: 1px solid var(--border); }
  .result-section.split-active .content-area { flex-direction: column; }
}

@media (max-width: 640px) {
  .header { padding: 0 1rem; }
  .nav-links .nav-link { display: none; }
  .main-wrapper { padding: 3.5rem 1rem 2rem; }
  .hero-title { font-size: 2.2rem; }
  .input-row { flex-direction: column; }
  .generate-btn { width: 100%; justify-content: center; }
  .tab-actions { flex-wrap: wrap; }
  .markdown-body { padding: 1.25rem; }
  .tabs-container { padding: 0; }
  .stat-repo-desc { max-width: 180px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .logo-version { display: none; }
  .info-sep { display: none; }
}
