:root {
  --bg: #f8fafc;
  --text: #1e293b;
  --border: #e2e8f0;
  --card: #ffffff;
  --primary: #8b5cf6;
  --secondary: #3b82f6;
  --success: #10b981;
  --warn: #f59e0b;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-mid: 0 14px 30px rgba(15, 23, 42, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 520px at 100% -10%, rgba(139, 92, 246, 0.08), transparent 55%),
    radial-gradient(900px 420px at 0% -10%, rgba(59, 130, 246, 0.08), transparent 50%),
    var(--bg) !important;
  color: var(--text) !important;
}

.page-hero {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sub-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}

.sub-nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
}

.sub-nav-link {
  font-size: 0.875rem;
  color: #64748b;
  padding: 0.8rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sub-nav-link:hover {
  color: #2563eb;
}

.sub-nav-link.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.main-shell {
  max-width: 72rem !important;
  padding-bottom: 1rem;
}

#dashboard,
#quick-nav {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  #dashboard,
  #quick-nav {
    padding: 1.15rem;
  }
}

.hero-summary {
  background: linear-gradient(135deg, #ecfeff 0%, #f0f9ff 45%, #eef2ff 100%);
  border: 1px solid #bfdbfe !important;
  border-radius: 14px !important;
  padding: 1.1rem 1.2rem !important;
  color: #1e3a8a !important;
  box-shadow: var(--shadow-soft);
}

.hero-summary h2 {
  color: #1e40af !important;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px;
  color: #fff;
  box-shadow: var(--shadow-mid);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.18);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
}

.stat-card:hover::after {
  left: 140%;
}

.counter {
  display: inline-block;
}

.mini-stat {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 15px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mini-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.quick-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.05rem 1.1rem;
  transition: all 0.2s ease;
  display: block;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
  border-color: #c7d2fe;
}

.quick-chip {
  display: inline-block;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quick-chip-blue { background: #dbeafe; color: #1e40af; }
.quick-chip-purple { background: #ede9fe; color: #6d28d9; }
.quick-chip-emerald { background: #d1fae5; color: #065f46; }
.quick-chip-amber { background: #fef3c7; color: #92400e; }

.code-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: all 0.22s ease;
}

.code-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-mid);
}

.code-header {
  background: linear-gradient(135deg, #eef2ff 0%, #e0ecff 55%, #e6f0ff 100%);
  color: #1e293b;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-body {
  background: #f8fafc;
}

.download-link {
  color: #1d4ed8;
  font-weight: 600;
  font-size: 12px;
}

.download-link:hover {
  text-decoration: underline;
}

.summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

details[open] .summary {
  background: #eef2ff;
  color: #1e3a8a;
}

pre[class*="language-"] {
  margin: 0 !important;
  border-radius: 0 !important;
  background: #f8fafc !important;
  max-height: 72vh;
  overflow: auto;
}

code[class*="language-"] {
  color: #1e293b !important;
}

.footer-card {
  border-top: 1px solid var(--border);
  color: #64748b;
}
