.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + var(--dock-pad));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.55rem 1rem;
  background: var(--glass);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.04em;
}

.brand img {
  width: 30px;
  height: 30px;
}

.top-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.18s var(--ease);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 1.5rem;
}

.page-wrap {
  width: 100%;
  max-width: var(--site-max, 1180px);
  margin: 0 auto;
  padding: 0 var(--site-gutter, 1.25rem) 2rem;
}

@media (min-width: 900px) {
  .card-grid.cols-2 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.content.padded {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 1rem;
}

.bottom-nav {
  position: fixed;
  left: var(--dock-pad);
  right: var(--dock-pad);
  bottom: calc(var(--dock-pad) + var(--safe-b));
  z-index: var(--z-dock);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.5) blur(22px);
  -webkit-backdrop-filter: saturate(1.5) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(18, 18, 20, 0.12);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  font-size: 0.62rem;
  font-weight: 750;
  color: var(--muted);
  min-height: 52px;
  border-radius: 18px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.page-enter {
  animation: enter 0.4s var(--ease-out);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hero {
  position: relative;
  margin: 0.75rem 1rem 1rem;
  padding: 1.35rem 1.2rem 1.4rem;
  border-radius: 28px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(148, 120, 255, 0.45), transparent 55%),
    linear-gradient(155deg, #1a1528 0%, #121214 55%, #2a1f45 100%);
  box-shadow: var(--shadow-lg);
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.45rem;
}

.hero h1 {
  font-size: clamp(1.7rem, 7vw, 2.15rem);
  max-width: 12ch;
  color: #fff;
  margin-bottom: 0.45rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  max-width: 28ch;
}

.search-dock {
  margin: -0.35rem 1rem 1rem;
  position: relative;
  z-index: 2;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 54px;
  padding: 0.35rem 0.4rem 0.35rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
  outline: none;
}

.search-bar .search-go,
.search-bar .filter-go {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.search-bar .search-go {
  background: var(--ink);
  color: #fff;
}

.search-bar .filter-go {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.section {
  padding: 0 1rem;
  margin-bottom: 1.35rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-head h2 {
  font-size: 1.15rem;
}

.section-head a {
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--accent-ink);
}

.cat-scroll {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding: 0 1rem 0.25rem;
  margin-bottom: 1.1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem 0.45rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 750;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.cat-chip .dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 0.85rem;
}

.cat-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

.cat-chip.active .dot {
  background: rgba(255, 255, 255, 0.12);
}

.bottom-nav.hidden-nav {
  display: none !important;
}

.app-shell.detail-mode {
  padding-bottom: calc(1rem + var(--safe-b));
}

@media (min-width: 768px) {
  .content {
    max-width: 980px;
  }

  .bottom-nav {
    max-width: 420px;
    margin: 0 auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .bottom-nav.hidden-nav {
    display: none !important;
  }
}
