:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-alt: #f8fafc;
  --border: #dbe3ef;
  --text: #0f172a;
  --muted: #475569;
  --muted-soft: #64748b;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --accent-soft: #eef2ff;
  --success: #0f766e;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius: 24px;
  --radius-sm: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7f9fd 0%, #f4f7fb 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

.app-main { min-height: 70vh; }
.container-xxl { max-width: 1380px; }

.app-navbar {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(219, 227, 239, .8);
  padding: .9rem 0;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 220px;
}
.brand-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-subtitle {
  display: block;
  font-size: .8rem;
  color: var(--muted-soft);
}

.app-search-wrap {
  position: relative;
  max-width: 560px;
  width: 100%;
}
.app-search {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(248,250,252,.96);
  padding: 0 .95rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.app-search i { color: var(--muted-soft); }
.app-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: .96rem;
  color: var(--text);
}
.search-clear {
  border: 0;
  background: transparent;
  color: var(--muted-soft);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { background: #e8edf5; }
.search-results {
  position: absolute;
  top: calc(100% + .6rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: .55rem;
  z-index: 30;
  display: none;
}
.search-results.is-visible { display: block; }
.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .8rem .9rem;
  border-radius: 14px;
}
.search-result-item:hover { background: var(--panel-alt); }
.search-result-item strong { display: block; font-size: .95rem; }
.search-result-item small { display: block; color: var(--muted-soft); margin-top: .15rem; }
.search-result-type {
  font-size: .72rem;
  line-height: 1;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: .45rem .55rem;
  white-space: nowrap;
}

.navbar-nav .nav-link {
  color: var(--muted);
  font-weight: 600;
  padding: .55rem .8rem;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus { color: var(--text); }
.nav-cta { padding-inline: 1rem; }

.btn { border-radius: 999px; font-weight: 700; }
.btn-app-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border: 0;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-app-primary:hover { color: #fff; background: linear-gradient(135deg, var(--accent-strong) 0%, #6d28d9 100%); }
.btn-app-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
.btn-app-secondary:hover { background: var(--panel-alt); }

.hero-section,
.page-hero,
.content-section { position: relative; }
.display-title {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: 1rem;
  font-weight: 800;
}
.page-title { font-size: clamp(1.9rem, 3.4vw, 3rem); }
.hero-copy,
.section-copy,
.footer-copy,
.app-card p,
.helper-text { color: var(--muted); }
.eyebrow,
.section-label,
.card-kicker,
.inset-kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-strong);
  margin-bottom: .9rem;
}
.section-title,
.section-title-sm {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.03em;
}
.section-title-sm { font-size: 1.15rem; }
.section-heading { margin-bottom: 1rem; }
.breadcrumb-line {
  font-size: .9rem;
  color: var(--muted-soft);
  margin-bottom: 1rem;
}
.breadcrumb-line span { margin-inline: .35rem; }
.breadcrumb-line a:hover { color: var(--accent-strong); }

.app-card,
.library-card,
.category-tile,
.category-panel,
.code-panel {
  background: var(--panel);
  border: 1px solid rgba(219, 227, 239, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.app-card,
.code-panel { padding: 1.5rem; }
.hero-card,
.page-hero-card { padding: 1.75rem; }
.inset-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border-radius: 20px;
}
.inset-stat {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: .3rem;
}

.stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem 1.1rem;
}
.stat-label {
  color: var(--muted-soft);
  font-size: .82rem;
  margin-bottom: .35rem;
}
.stat-value {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -.03em;
}

.stack-list { display: grid; gap: 1rem; }
.stack-item {
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-alt);
}
.stack-item.compact { padding: .95rem 1rem; }
.stack-item-title {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.stack-item p { margin: 0; font-size: .92rem; }

.library-nav { display: grid; gap: .75rem; }
.library-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-alt);
  color: var(--text);
  font-weight: 600;
}
.library-nav a:hover { transform: translateY(-1px); }

.seg-toggle {
  display: inline-flex;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem;
  gap: .25rem;
}
.seg-toggle-full { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: .7rem 1rem;
  font-weight: 700;
  color: var(--muted);
}
.seg-btn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
}

.mini-list { display: grid; gap: .8rem; }
.mini-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.mini-list-item strong { display: block; font-size: .96rem; margin-bottom: .25rem; }
.mini-list-item small { color: var(--muted-soft); display: block; line-height: 1.45; }
.mini-list-item:hover { transform: translateY(-1px); }

.library-pill,
.meta-inline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border-radius: 999px;
  padding: .5rem .75rem;
  font-size: .78rem;
  font-weight: 700;
}
.library-pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.meta-inline {
  background: #eef6ff;
  color: #1d4ed8;
}

.code-panel {
  position: relative;
  overflow: hidden;
}
.code-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.code-panel-head small { display: block; font-weight: 600; color: var(--muted-soft); }
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 20px;
  padding: 1.2rem;
  min-height: 320px;
  font-size: .92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.code-block.subtle {
  min-height: auto;
  background: #111827;
}
.copy-toast {
  display: none;
  color: var(--success);
  font-weight: 700;
  font-size: .9rem;
}

.library-card,
.category-panel,
.category-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.35rem;
}
.library-card-top,
.category-panel-top { flex-grow: 1; }
.library-card h3,
.category-tile h3,
.category-panel h2 {
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: .9rem 0 .55rem;
  font-weight: 800;
}
.library-card p,
.category-tile p,
.category-panel p { margin-bottom: 0; color: var(--muted); }
.library-card-bottom,
.category-panel-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.category-panel-bottom,
.category-meta,
.text-link {
  color: var(--accent-strong);
  font-weight: 700;
}
.category-tile-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #f3e8ff 100%);
  border-radius: 14px;
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.chip-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.action-stack { display: grid; gap: .75rem; }
.sticky-panel { position: sticky; top: 6.5rem; }
.app-label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
}
.app-select,
.app-textarea {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
}
.app-select { min-height: 48px; }
.app-textarea {
  min-height: 180px;
  padding: .95rem 1rem;
  resize: vertical;
}
.helper-text { font-size: .88rem; }

.site-footer {
  border-top: 1px solid rgba(219, 227, 239, .8);
  background: rgba(255,255,255,.78);
}
.footer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
.footer-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.footer-subtitle,
.footer-copy,
.footer-links a { color: var(--muted); }
.footer-heading {
  font-weight: 800;
  margin-bottom: .9rem;
  font-size: .9rem;
}
.footer-links li + li { margin-top: .55rem; }
.footer-links a:hover { color: var(--accent-strong); }

@media (max-width: 1199.98px) {
  .app-search-wrap { max-width: none; }
  .sticky-panel { position: static; }
}

@media (max-width: 991.98px) {
  .app-navbar .container-xxl { row-gap: 1rem; }
  .brand-mark { min-width: auto; }
  .stat-grid { grid-template-columns: 1fr; }
  .code-panel-head,
  .library-card-bottom,
  .category-panel-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 767.98px) {
  .app-card,
  .code-panel,
  .library-card,
  .category-panel,
  .category-tile { padding: 1.15rem; }
  .display-title { font-size: 2rem; }
  .app-search { height: 48px; }
}
