:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-success: #10b981;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px;
}

.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-bar a.changelog-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.top-bar a.team-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-btn {
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: inherit;
}

.lang-btn.active {
  color: var(--text-primary);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.1);
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  font-weight: 600;
  transition: all 0.2s;
}

.back-link:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.card h1 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.guide-lede {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
}

.guide-tab-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.guide-tab {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.guide-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.guide-tab:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.guide-tab[aria-selected="true"] {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.guide-tab--primary {
  padding: 16px 20px;
  font-size: 15px;
}

.guide-tab-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.guide-panels {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  min-height: 120px;
}

.guide-panel[hidden] {
  display: none !important;
}

.guide-panel h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 26px 0 12px;
  color: var(--text-primary);
}

.guide-panel h2:first-child {
  margin-top: 0;
}

.guide-panel .guide-lede + h2 {
  margin-top: 0;
}

.guide-panel h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--accent-primary);
}

.card p,
.card .guide-rich {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 14px;
}

.guide-rich ul {
  margin: 10px 0 12px;
  padding-left: 1.35rem;
  list-style: disc;
}

.guide-rich li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.guide-rich li:last-child {
  margin-bottom: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.card a {
  color: var(--accent-primary);
  text-decoration: none;
}

.card a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.cta-wrap {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--accent-primary);
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.footer {
  margin-top: 32px;
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 14px;
}

.footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

#dev-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #059669 50%, #10b981 100%);
  z-index: 99999;
}

@media (max-width: 900px) {
  .guide-tab-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 20px 18px;
  }

  .card h1 {
    font-size: 1.35rem;
  }

  .guide-tab-grid {
    grid-template-columns: 1fr;
  }
}
