/* Gallery premium redesign (P4.8). Apple-minimal, edge-to-edge, no visual noise. */

.gallery-root {
  margin: -1rem -0.75rem -6rem;
  background: #FFFFFF;
  min-height: calc(100vh - 3.5rem);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 640px) { .gallery-root { margin-left: -1.5rem; margin-right: -1.5rem; } }
@media (min-width: 768px) { .gallery-root { margin: -2rem -2rem -2rem; } }

.gallery-toolbar {
  position: sticky;
  top: 3.5rem;
  z-index: 30;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: 48px;
  display: flex;
  align-items: center;
}
@media (min-width: 768px) {
  .gallery-toolbar { top: 4rem; height: 52px; }
}

.gallery-toolbar-inner {
  max-width: 88rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
@media (min-width: 768px) { .gallery-toolbar-inner { padding: 0 1.5rem; gap: 1.5rem; } }

.gt-search {
  position: relative;
  flex-shrink: 0;
  width: 160px;
}
@media (min-width: 640px) { .gt-search { width: 200px; } }
@media (min-width: 1024px) { .gt-search { width: 240px; } }
.gt-search input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.04);
  border: 0;
  border-radius: 8px;
  color: #111827;
  outline: none;
  transition: background 0.15s ease;
}
.gt-search input:focus { background: rgba(0, 0, 0, 0.06); }
.gt-search input::placeholder { color: #9CA3AF; }
.gt-search .fa-search {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: #9CA3AF; font-size: 11px; pointer-events: none;
}

.gt-cats {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 24px), transparent);
}
.gt-cats::-webkit-scrollbar { display: none; }
.gt-cat {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 400;
  color: #6B7280;
  background: transparent;
  border: 0;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  position: relative;
}
.gt-cat:hover { color: #111827; }
.gt-cat.active { color: #007AFF; font-weight: 500; }
.gt-cat.active::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  bottom: 0;
  height: 2px;
  background: #007AFF;
  border-radius: 1px;
}
.gt-cat .emoji { margin-right: 4px; opacity: 0.8; }

.gt-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gt-icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: #6B7280;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s ease;
}
.gt-icon-btn:hover { color: #111827; background: rgba(0, 0, 0, 0.04); }
.gt-icon-btn.active { color: #007AFF; background: rgba(0, 122, 255, 0.08); }

.gt-density {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
}
.gt-density-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: #9CA3AF;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.12s ease;
}
.gt-density-btn:hover:not(:disabled) { color: #6B7280; }
.gt-density-btn.active { color: #007AFF; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.gt-density-btn:disabled { opacity: 0.3; cursor: default; }

.g-container {
  max-width: 88rem;
  margin: 0 auto;
  padding: 20px 12px 60px;
}
@media (min-width: 640px) { .g-container { padding: 24px 20px 60px; } }
@media (min-width: 1024px) { .g-container { padding: 28px 32px 80px; } }

.g-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 12px;
}
.g-section-title {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.01em;
}
.g-section-title .emoji { margin-left: 6px; opacity: 0.7; font-size: 13px; }
.g-section-count { font-size: 12px; color: #9CA3AF; font-weight: 400; margin-left: 6px; }
.g-section-more {
  font-size: 12px;
  color: #6B7280;
  font-weight: 400;
  background: transparent; border: 0; padding: 4px 6px; cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s ease;
}
.g-section-more:hover { color: #007AFF; }
.g-section-more .fa { margin-left: 3px; font-size: 10px; }

.g-page-title {
  font-size: 20px;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0 4px 4px;
}
.g-page-sub {
  font-size: 12px;
  color: #9CA3AF;
  margin: 0 4px 20px;
}

.shelf { margin-bottom: 24px; }
@media (min-width: 768px) { .shelf { margin-bottom: 32px; } }

.shelf-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 4px 8px;
  scroll-snap-type: x proximity;
  height: var(--shelf-h, 200px);
}
.shelf-scroll::-webkit-scrollbar { display: none; }
.shelf-scroll .g-card {
  flex-shrink: 0;
  height: 100%;
  width: auto;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
}
.shelf-scroll .g-card img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Density affects both shelves and masonry */
.gallery-root.density-1 { --shelf-h: 280px; }
.gallery-root.density-2 { --shelf-h: 200px; }
.gallery-root.density-3 { --shelf-h: 140px; }
@media (max-width: 640px) {
  .gallery-root.density-1 { --shelf-h: 240px; }
  .gallery-root.density-2 { --shelf-h: 170px; }
  .gallery-root.density-3 { --shelf-h: 120px; }
}

/* Divider between shelves (very subtle) */
.shelf { position: relative; padding-top: 16px; }
.shelf + .shelf { border-top: 1px solid rgba(0, 0, 0, 0.04); padding-top: 20px; }
.shelf.highlighted { background: linear-gradient(180deg, rgba(0, 122, 255, 0.02) 0%, transparent 100%); border-radius: 12px; padding-left: 12px; padding-right: 12px; }


.masonry {
  column-gap: 6px;
  padding: 0 4px;
}
.masonry.density-1 { column-count: 1; }
.masonry.density-2 { column-count: 2; }
.masonry.density-3 { column-count: 3; }
.masonry.density-4 { column-count: 4; }
.masonry.density-5 { column-count: 5; }
.masonry.density-6 { column-count: 6; }
.masonry .g-card { break-inside: avoid; margin-bottom: 6px; }

.g-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: transparent;
  animation: gFadeIn 0.35s ease-out both;
}
.g-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (hover: hover) {
  .g-card:hover {
    transform: translateY(-1px) scale(1.008);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.18),
                0 2px 6px -2px rgba(0, 0, 0, 0.08);
  }
  .g-card:hover img { transform: scale(1.015); }
}
.g-card:active { transform: scale(0.99); }

.g-badges {
  position: absolute;
  right: 8px; bottom: 8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .g-card:hover .g-badges { opacity: 1; transform: none; }
}
@media (hover: none) {
  .g-badges { opacity: 1; transform: none; }
}
.g-badge {
  display: inline-flex; align-items: center;
  padding: 3px 6px;
  font-size: 10px; font-weight: 500;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 5px;
  line-height: 1;
}

.g-fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  font-size: 11px;
}
@media (hover: hover) {
  .g-card:hover .g-fav { opacity: 1; transform: none; }
  .g-fav:hover { background: rgba(0, 0, 0, 0.6); }
}
@media (hover: none) { .g-fav { opacity: 0.9; transform: none; } }
.g-fav.active { color: #FF9500; background: rgba(255, 255, 255, 0.95); }

.g-empty {
  text-align: center;
  padding: 80px 20px;
  color: #9CA3AF;
}
.g-empty .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.35; }
.g-empty p { font-size: 13px; margin: 0; }

.g-spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-top-color: #007AFF;
  border-radius: 50%;
  animation: gSpin 0.7s linear infinite;
}

@keyframes gFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes gSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .g-card, .g-card img, .g-fav, .g-badges { transition: none !important; animation: none !important; }
}

/* P4.8b additions */

.g-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 4px 14px;
}
.g-section-title {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.015em;
  margin: 0;
}
.g-section-count {
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.g-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 4px 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: 0.01em;
}
.g-more-btn:hover {
  color: #111827;
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.02);
  transform: translateX(2px);
}
.g-more-btn:hover i { transform: translateX(2px); }
.g-more-btn i { font-size: 10px; transition: transform 0.2s ease; }

.g-feed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 20px;
}
.g-back-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: #6B7280;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.g-back-btn:hover { color: #111827; background: rgba(0, 0, 0, 0.05); }
.g-page-title {
  font-size: 20px;
  font-weight: 500;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0;
}
.g-page-count {
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 400;
  margin-left: 2px;
}

/* Lightbox P4.9b — modal with blurred backdrop */
.gl-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: glFadeIn 0.2s ease-out;
}
@media (max-width: 767px) { .gl-overlay { padding: 0; align-items: stretch; } }

.gl-modal {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  max-height: 92vh;
  background: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
  animation: glModalIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
@media (max-width: 767px) {
  .gl-modal { flex-direction: column; max-height: 100vh; height: 100vh; border-radius: 0; }
}

.gl-stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #F5F5F7;
  touch-action: pan-y;
}
@media (max-width: 767px) { .gl-stage { padding: 16px; flex: 1 1 55%; min-height: 0; } }

.gl-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: glImgIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gl-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
  display: block;
}

.gl-nav-zone {
  position: absolute;
  top: 0; bottom: 0;
  width: 20%;
  cursor: pointer;
  z-index: 2;
}
.gl-nav-zone.left { left: 0; }
.gl-nav-zone.right { right: 0; }
@media (max-width: 767px) { .gl-nav-zone { display: none; } }

.gl-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 3;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.15);
}
.gl-nav-btn:hover:not(:disabled) { background: #FFFFFF; transform: translateY(-50%) scale(1.08); color: #007AFF; }
.gl-nav-btn:disabled { opacity: 0.25; cursor: default; }
.gl-nav-btn.prev { left: 16px; }
.gl-nav-btn.next { right: 16px; }
@media (max-width: 767px) { .gl-nav-btn { display: none; } }

.gl-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.15);
}
.gl-close:hover { background: #FFFFFF; color: #FF3B30; transform: rotate(90deg); }

.gl-panel {
  width: 380px;
  flex-shrink: 0;
  background: #FFFFFF;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid rgba(0, 0, 0, 0.05);
}
@media (max-width: 1024px) { .gl-panel { width: 320px; } }
@media (max-width: 767px) {
  .gl-panel {
    width: 100%;
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px 16px;
    flex: 0 1 45%;
    min-height: 0;
  }
}

.gl-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #6B7280; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.gl-title { font-size: 15px; color: #111827; font-weight: 500; line-height: 1.5; letter-spacing: -0.01em; margin: 0; }

.gl-prompt-block { background: #F9FAFB; border-radius: 10px; padding: 14px; position: relative; }
.gl-prompt-label { font-size: 10px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 6px; }
.gl-prompt-text { font-size: 13px; color: #374151; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.gl-prompt-text.locked { filter: blur(4px); user-select: none; pointer-events: none; }
.gl-copy-btn {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #6B7280;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.gl-copy-btn:hover { color: #007AFF; border-color: rgba(0, 122, 255, 0.3); }
.gl-copy-btn.copied { color: #34C759; border-color: rgba(52, 199, 89, 0.3); }
.gl-copy-btn.locked { opacity: 0.5; }

.gl-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 12px 0; border-top: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
.gl-meta-item .k { font-size: 10px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 2px; }
.gl-meta-item .v { font-size: 12px; color: #374151; font-weight: 500; }

.gl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.gl-tag { font-size: 11px; color: #6B7280; padding: 3px 8px; background: #F3F4F6; border-radius: 999px; }

.gl-stats { display: flex; gap: 16px; font-size: 11px; color: #9CA3AF; }
.gl-stat i { margin-right: 3px; opacity: 0.7; }

.gl-similar { padding-top: 4px; scrollbar-width: none; }
.gl-similar::-webkit-scrollbar { display: none; }
.gl-similar-label { font-size: 10px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 8px; }
.gl-similar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; scrollbar-width: none; }
.gl-similar-grid::-webkit-scrollbar { display: none; }
.gl-similar-item {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #F3F4F6;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gl-similar-item:hover { transform: scale(1.03); box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.15); }
.gl-similar-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gl-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.gl-btn-primary {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: #FFFFFF;
  background: #007AFF;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  letter-spacing: -0.005em;
}
.gl-btn-primary:hover { background: #0066D6; transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(0, 122, 255, 0.5); }
.gl-btn-primary:active { transform: scale(0.98); }
.gl-btn-primary.animating { animation: glBtnPulse 0.4s ease-out; }
.gl-btn-secondary {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6B7280;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}
.gl-btn-secondary:hover { color: #007AFF; border-color: rgba(0, 122, 255, 0.4); background: rgba(0, 122, 255, 0.04); }
.gl-btn-secondary.active { color: #FF9500; border-color: rgba(255, 149, 0, 0.4); background: rgba(255, 149, 0, 0.06); }

.gl-toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  z-index: 200;
  animation: glToastIn 0.2s ease-out;
  backdrop-filter: blur(10px);
}

@keyframes glFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glModalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes glImgIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glBtnPulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes glToastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

body.gl-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .gl-overlay, .gl-modal, .gl-img-wrap, .gl-btn-primary, .gl-toast { animation: none !important; }
}

.gl-nav-btn.top {
  top: 16px;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 4;
}
.gl-nav-btn.top:hover:not(:disabled) { transform: translate(-50%, -2px) scale(1.08); }
@media (max-width: 767px) { .gl-nav-btn.top { display: none; } }

.gl-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(6px);
}
@media (max-width: 767px) { .gl-hint { display: none; } }

/* Mobile compact panel P4.10b — fixed layout, safe-area aware */
@media (max-width: 767px) {
  .gl-hide-mobile { display: none !important; }

  .gl-modal {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
  }

  .gl-stage {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 12px !important;
  }

  .gl-panel {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 8px !important;
    border-radius: 16px 16px 0 0;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    background: #FFFFFF;
  }

  .gl-drag-handle {
    width: 40px; height: 4px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
    margin: 4px auto 4px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .gl-mobile-hint {
    font-size: 10px;
    color: #9CA3AF;
    text-align: center;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
    flex-shrink: 0;
  }

  .gl-prompt-block {
    padding: 8px 12px !important;
    margin: 0 !important;
    flex-shrink: 0;
    max-height: 80px;
    overflow-y: auto;
  }
  .gl-prompt-label { font-size: 9px !important; margin-bottom: 3px !important; }
  .gl-prompt-mobile-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px !important;
    line-height: 1.4 !important;
    max-height: 2.8em;
  }
  .gl-copy-btn { width: 22px !important; height: 22px !important; top: 6px !important; right: 6px !important; }

  .gl-actions {
    border-top: 0 !important;
    padding-top: 4px !important;
    margin-top: 0 !important;
    flex-shrink: 0;
  }
  .gl-btn-primary { padding: 12px 14px !important; font-size: 14px !important; font-weight: 500 !important; }

  .gl-close {
    top: 10px !important; right: 10px !important;
    width: 34px !important; height: 34px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.3) !important;
    z-index: 20 !important;
  }
}

.gl-only-mobile { display: none; }
@media (max-width: 767px) { .gl-only-mobile { display: block; } }

/* Narrow toolbar wrap on very small screens */
@media (max-width: 380px) {
  .gt-search { width: 130px; }
  .gt-actions { gap: 4px; }
  .gt-icon-btn { width: 30px; height: 30px; }
  .gt-density { padding: 2px; }
  .gt-density-btn { width: 24px; height: 24px; }
}

/* P4.11 — Trend highlight on cards */
.g-card.is-trend {
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.6), 0 4px 16px -6px rgba(255, 193, 7, 0.3);
}
.g-card.is-trend:hover {
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.85), 0 20px 40px -18px rgba(255, 193, 7, 0.5);
}
@media (hover: hover) {
  .g-card.is-trend:hover { transform: translateY(-2px) scale(1.01); }
}

.g-trend-badge {
  position: absolute;
  top: 8px; right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #7A5C00;
  background: linear-gradient(135deg, #FFD54F 0%, #FFB300 100%);
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.4);
  letter-spacing: 0.02em;
  z-index: 2;
  pointer-events: none;
}
.g-trend-badge i { font-size: 9px; }

/* Desktop modal: prompt clamp + sticky action bar */
@media (min-width: 768px) {
  .gl-panel {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .gl-panel > * { flex-shrink: 0; }
  .gl-panel > .gl-similar { flex-shrink: 1; overflow-y: auto; min-height: 0; }
  .gl-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0), #FFFFFF 30%);
    padding-top: 16px !important;
    margin-top: 4px !important;
    z-index: 5;
  }
}



.gl-prompt-toggle {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  color: #007AFF;
  background: transparent;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.gl-prompt-toggle:hover { text-decoration: underline; }


/* P4.11b — Fixed-height prompt box + hidden scrollbars */
.gl-prompt-block {
  padding: 12px 14px !important;
  position: relative;
}

.gl-prompt-scroll {
  max-height: 4.7em;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-right: 24px;
}
.gl-prompt-scroll.expanded {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: none;
}
.gl-prompt-scroll.expanded::-webkit-scrollbar { display: none; }

.gl-prompt-text {
  font-size: 13px;
  color: #374151;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.gl-similar-grid {
  scrollbar-width: none;
}
.gl-similar-grid::-webkit-scrollbar { display: none; }
.gl-panel {
  scrollbar-width: none;
}
.gl-panel::-webkit-scrollbar { display: none; }

/* Mobile: чуть меньше clamp высоты */
@media (max-width: 767px) {
  .gl-prompt-scroll {
    max-height: 3.2em;
  }
  .gl-prompt-scroll.expanded {
    max-height: 120px;
  }
  .gl-prompt-mobile-clamp {
    /* legacy class от старого шаблона — сбрасываем */
    display: block !important;
    -webkit-line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ============================================================
   P4.13a — Landing sections
   ============================================================ */

.lp-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  text-align: center;
  position: relative;
}
@media (max-width: 767px) { .lp-hero { padding: 32px 16px 24px; } }

.lp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 59, 48, 0.08));
  border: 1px solid rgba(255, 149, 0, 0.25);
  color: #C2410C;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.lp-hero-badge i { color: #FF9500; }

.lp-hero-title {
  font-size: clamp(28px, 4.8vw, 52px);
  font-weight: 700;
  color: #0F172A;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.lp-grad {
  background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lp-hero-sub {
  font-size: clamp(15px, 2vw, 19px);
  color: #4B5563;
  max-width: 680px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.lp-hero-cta {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}
.lp-btn-primary, .lp-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 0;
  cursor: pointer;
}
.lp-btn-primary {
  background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 24px -8px rgba(0, 122, 255, 0.5);
}
.lp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -8px rgba(0, 122, 255, 0.6);
}
.lp-btn-ghost {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.lp-btn-ghost:hover { background: rgba(0, 0, 0, 0.08); }

.lp-hero-trust {
  display: inline-flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 32px;
}
.lp-hero-trust span { display: inline-flex; align-items: center; gap: 5px; }

.lp-hero-carousel {
  overflow: hidden;
  position: relative;
  margin: 0 -20px;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.lp-hero-track {
  display: flex;
  gap: 10px;
  animation: lpMarquee 40s linear infinite;
  width: max-content;
}
@keyframes lpMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.lp-hero-card {
  flex-shrink: 0;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.15);
}
.lp-hero-card img { height: 100%; width: auto; display: block; object-fit: cover; }
@media (max-width: 767px) { .lp-hero-card { height: 140px; border-radius: 10px; } }

.lp-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
}
@media (max-width: 767px) { .lp-section { padding: 40px 16px; } }
.lp-section-tint {
  background: linear-gradient(180deg, rgba(0, 122, 255, 0.025), rgba(175, 82, 222, 0.02));
  max-width: none;
  padding-left: 20px;
  padding-right: 20px;
}
.lp-section-tint > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

.lp-h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0 0 8px;
}
.lp-h2-sub {
  font-size: 15px;
  color: #6B7280;
  text-align: center;
  margin: 0 0 40px;
}

.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 767px) { .lp-steps { grid-template-columns: 1fr; gap: 14px; } }
.lp-step {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lp-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.12);
}
.lp-step-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  font-size: 22px;
  margin-bottom: 18px;
}
.lp-step-icon-blue { background: linear-gradient(135deg, #007AFF, #5AC8FA); }
.lp-step-icon-purple { background: linear-gradient(135deg, #AF52DE, #FF2D55); }
.lp-step-icon-orange { background: linear-gradient(135deg, #FF9500, #FF2D55); }
.lp-step-num {
  position: absolute;
  top: 22px; right: 24px;
  font-size: 12px; font-weight: 700;
  color: rgba(0, 0, 0, 0.15);
  letter-spacing: 0.05em;
}
.lp-step h3 {
  font-size: 18px; font-weight: 600; color: #0F172A;
  margin: 0 0 8px;
}
.lp-step p {
  font-size: 14px; color: #4B5563; line-height: 1.5;
  margin: 0;
}

.lp-models {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1023px) { .lp-models { grid-template-columns: 1fr; } }
.lp-model {
  display: block;
  background: #FFFFFF;
  border-radius: 18px;
  padding: 22px;
  border-left: 3px solid #007AFF;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.08);
}
.lp-model:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -18px rgba(0, 122, 255, 0.25);
}
.lp-model-blue { border-left-color: #007AFF; }
.lp-model-purple { border-left-color: #AF52DE; }
.lp-model-orange { border-left-color: #FF9500; }
.lp-model-soon { opacity: 0.75; cursor: default; }
.lp-model-soon:hover { transform: none; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.08); }

.lp-model-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.lp-model-icon {
  font-size: 32px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  flex-shrink: 0;
}
.lp-model h3 {
  font-size: 17px; font-weight: 600; color: #0F172A;
  margin: 0 0 4px;
}
.lp-model-sub {
  font-size: 13px; color: #4B5563; line-height: 1.45;
  margin: 0;
}
.lp-model-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.lp-model-tags span {
  font-size: 11px; font-weight: 500;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.05);
  color: #4B5563;
  border-radius: 999px;
}

.lp-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1023px) { .lp-cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .lp-cats { grid-template-columns: repeat(2, 1fr); } }
.lp-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.lp-cat:hover {
  border-color: rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.03);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0, 122, 255, 0.25);
}
.lp-cat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(175, 82, 222, 0.08));
  color: #007AFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.lp-cat-emoji { font-size: 20px; }
.lp-cat h3 {
  flex: 1;
  font-size: 14px; font-weight: 600; color: #0F172A;
  margin: 0;
  min-width: 0;
}
.lp-cat-arrow {
  color: #9CA3AF;
  font-size: 12px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.lp-cat:hover .lp-cat-arrow { color: #007AFF; transform: translateX(3px); }

.lp-gallery-head { padding-bottom: 20px; }

.lp-bonuses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 767px) { .lp-bonuses { grid-template-columns: 1fr; } }
.lp-bonus {
  border-radius: 18px;
  padding: 26px;
  color: #0F172A;
  position: relative;
  transition: transform 0.2s ease;
}
.lp-bonus:hover { transform: translateY(-3px); }
.lp-bonus-green { background: linear-gradient(135deg, rgba(52, 199, 89, 0.12), rgba(52, 199, 89, 0.04)); border: 1px solid rgba(52, 199, 89, 0.25); }
.lp-bonus-blue { background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(0, 122, 255, 0.04)); border: 1px solid rgba(0, 122, 255, 0.25); }
.lp-bonus-orange { background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 149, 0, 0.04)); border: 1px solid rgba(255, 149, 0, 0.25); }

.lp-bonus-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.12);
}
.lp-bonus-green .lp-bonus-icon { color: #34C759; }
.lp-bonus-blue .lp-bonus-icon { color: #007AFF; }
.lp-bonus-orange .lp-bonus-icon { color: #FF9500; }

.lp-bonus h3 {
  font-size: 18px; font-weight: 600;
  margin: 0 0 6px;
}
.lp-bonus p {
  font-size: 14px; color: #4B5563; line-height: 1.5;
  margin: 0 0 12px;
}
.lp-bonus-badge {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: #0F172A;
}

.lp-social { padding-top: 20px; padding-bottom: 20px; }
.lp-social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: linear-gradient(135deg, #0F172A, #1E293B);
  border-radius: 20px;
  padding: 32px 20px;
  color: #FFFFFF;
  text-align: center;
}
@media (max-width: 640px) { .lp-social-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; padding: 24px 16px; } }
.lp-social-num {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #5AC8FA, #AF52DE);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 4px;
}
.lp-social-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.lp-faq { max-width: 780px; margin: 0 auto; }
.lp-faq-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #FFFFFF;
  transition: border-color 0.15s ease;
}
.lp-faq-item.is-open { border-color: rgba(0, 122, 255, 0.4); }
.lp-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: 0;
  font-size: 15px;
  font-weight: 500;
  color: #0F172A;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}
.lp-faq-q i {
  color: #9CA3AF;
  transition: transform 0.2s ease;
  font-size: 12px;
  flex-shrink: 0;
}
.lp-faq-item.is-open .lp-faq-q i { transform: rotate(180deg); color: #007AFF; }
.lp-faq-a {
  padding: 0 20px 18px;
  font-size: 14px;
  color: #4B5563;
  line-height: 1.6;
}

.lp-cta-final {
  padding-top: 60px;
  padding-bottom: 60px;
}
.lp-cta-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 32px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
  color: #FFFFFF;
  box-shadow: 0 30px 60px -30px rgba(0, 122, 255, 0.6);
}
@media (max-width: 767px) { .lp-cta-inner { padding: 36px 20px; } }
.lp-cta-inner h2 {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.lp-cta-inner p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0 0 24px;
}
.lp-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #FFFFFF;
  color: #0F172A;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s ease;
}
.lp-cta-btn:hover { transform: scale(1.04); }
.lp-cta-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 18px;
}
.lp-cta-hint a { color: #FFFFFF; text-decoration: underline; }

.lp-sticky {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 100px);
  z-index: 60;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: calc(100% - 24px);
  width: 640px;
}
.lp-sticky.is-shown { transform: translate(-50%, 0); }
.lp-sticky-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.96);
  color: #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lp-sticky-text { flex: 1; font-size: 13px; line-height: 1.35; }
.lp-sticky-text strong { font-weight: 600; }
.lp-sticky-text b { color: #FFD54F; }
.lp-sticky-btn {
  display: inline-flex;
  padding: 8px 16px;
  background: linear-gradient(135deg, #007AFF, #AF52DE);
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease;
}
.lp-sticky-btn:hover { transform: scale(1.05); }
.lp-sticky-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
}
.lp-sticky-close:hover { background: rgba(255, 255, 255, 0.2); }
@media (max-width: 640px) {
  .lp-sticky-inner { padding: 10px 12px; }
  .lp-sticky-text { font-size: 12px; }
  .lp-sticky-btn { padding: 7px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-hero-track { animation: none !important; }
  .lp-step, .lp-model, .lp-cat, .lp-bonus, .lp-sticky { transition: none !important; }
}

/* P4.13a-fix — hide landing for authenticated users */
html.is-auth .lp-guest-only { display: none !important; }
html.is-auth .lp-sticky { display: none !important; }
html.is-auth .lp-gallery-head { display: none !important; }

/* P4.13a-fix — trust badges вниз на десктопе */
@media (min-width: 768px) {
  .lp-hero { display: flex; flex-direction: column; align-items: center; }
  .lp-hero-badge { order: 1; }
  .lp-hero-title { order: 2; }
  .lp-hero-sub { order: 3; }
  .lp-hero-cta { order: 4; }
  .lp-hero-carousel { order: 5; width: 100%; margin-top: 8px; margin-bottom: 24px; }
  .lp-hero-trust { order: 6; margin-bottom: 0; margin-top: 4px; }
}

/* P4.13a-fix — мобильный overflow */
html, body { overflow-x: hidden; }

.lp-hero, .lp-section {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  .lp-hero { padding: 24px 12px 20px; }
  .lp-section { padding: 32px 12px; }
  .lp-section-tint { padding-left: 12px; padding-right: 12px; }

  .lp-hero-carousel { margin: 0 -12px; }
  .lp-hero-title { font-size: 26px; }
  .lp-hero-sub { font-size: 14px; }
  .lp-hero-badge { font-size: 11px; padding: 5px 10px; }
  .lp-hero-badge span { display: inline-block; max-width: 260px; line-height: 1.35; }

  .lp-hero-cta { gap: 8px; }
  .lp-btn-primary, .lp-btn-ghost { padding: 11px 16px; font-size: 14px; }

  .lp-h2 { font-size: 22px; margin-bottom: 6px; }
  .lp-h2-sub { font-size: 13px; margin-bottom: 24px; }

  .lp-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .lp-cat { padding: 12px 12px; gap: 10px; }
  .lp-cat-icon { width: 34px; height: 34px; font-size: 15px; }
  .lp-cat h3 { font-size: 13px; }
  .lp-cat-arrow { display: none; }

  .lp-models { gap: 12px; }
  .lp-model { padding: 18px; }

  .lp-bonuses { gap: 12px; }
  .lp-bonus { padding: 20px; }

  .lp-cta-final { padding: 40px 12px; }
  .lp-cta-inner { padding: 32px 20px; }

  .lp-social-grid { padding: 24px 12px; gap: 20px 12px; }
}

@media (max-width: 380px) {
  .lp-hero-trust { font-size: 12px; gap: 12px; }
  .lp-hero-cta { flex-direction: column; width: 100%; }
  .lp-btn-primary, .lp-btn-ghost { width: 100%; justify-content: center; }
}

/* ============================================================
   P4.13a-dark — Dark "AI Models" section with carousels
   ============================================================ */

.lp-section-dark {
  background: linear-gradient(180deg, #0B0F1A 0%, #111827 50%, #0F172A 100%);
  padding: 60px 20px;
  margin: 60px -20px;
  position: relative;
  overflow: hidden;
}
@media (max-width: 767px) {
  .lp-section-dark { padding: 40px 12px; margin: 40px -12px; }
}
.lp-section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 122, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255, 193, 7, 0.08) 0%, transparent 40%);
  pointer-events: none;
}

.lp-dark-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.lp-h2-dark { color: #FFFFFF; }
.lp-h2-sub-dark { color: rgba(255, 255, 255, 0.55); margin-bottom: 40px; }

.lp-mcard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.lp-mcard::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.35), rgba(255, 193, 7, 0.05) 50%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.lp-mcard:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 193, 7, 0.35);
  box-shadow: 0 30px 60px -25px rgba(255, 193, 7, 0.25), 0 0 0 1px rgba(255, 193, 7, 0.15);
}
.lp-mcard:hover::before { opacity: 1; }
@media (max-width: 767px) { .lp-mcard { padding: 20px 16px; margin-bottom: 16px; border-radius: 18px; } }

.lp-mcard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.lp-mcard-title-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}
.lp-mcard-icon {
  font-size: 34px;
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 193, 7, 0.05));
  border: 1px solid rgba(255, 193, 7, 0.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lp-mcard-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.lp-mcard-eyebrow-gold { color: #FFD54F; }
.lp-mcard-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFD54F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lp-mcard-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin: 0 0 12px;
  max-width: 480px;
}
.lp-mcard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lp-mcard-tags span {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.lp-mcard-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FFD54F, #FFB300);
  color: #0F172A;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -8px rgba(255, 193, 7, 0.5);
}
.lp-mcard-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(255, 193, 7, 0.65);
}
@media (max-width: 640px) {
  .lp-mcard-cta { width: 100%; justify-content: center; }
}

.lp-mcard-carousel {
  overflow: hidden;
  margin: 0 -28px -28px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
@media (max-width: 767px) {
  .lp-mcard-carousel { margin: 0 -16px -20px; }
}

.lp-mcard-track {
  display: flex;
  gap: 8px;
  animation: lpModelMarquee 45s linear infinite;
  width: max-content;
  padding: 16px;
}
.lp-mcard-track-reverse {
  animation-direction: reverse;
  animation-duration: 55s;
}
@keyframes lpModelMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.lp-mcard:hover .lp-mcard-track { animation-play-state: paused; }

.lp-mcard-thumb {
  flex-shrink: 0;
  height: 160px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.lp-mcard-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 24px -8px rgba(255, 193, 7, 0.4), 0 0 0 1px rgba(255, 193, 7, 0.4);
  z-index: 2;
}
.lp-mcard-thumb img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
  border-radius: 10px;
}
@media (max-width: 767px) {
  .lp-mcard-thumb { height: 120px; }
}

.lp-mcard-soon {
  opacity: 0.8;
}
.lp-mcard-soon .lp-mcard-icon {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.2), rgba(175, 82, 222, 0.15));
  border-color: rgba(0, 122, 255, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .lp-mcard-track { animation: none !important; }
}

/* P4.13c.1-fix — плавное скрытие лендинга при async auth check */
.lp-guest-only, .lp-sticky, .lp-gallery-head {
  transition: opacity 0.15s ease;
}
html.is-auth .lp-guest-only,
html.is-auth .lp-sticky,
html.is-auth .lp-gallery-head {
  display: none !important;
  opacity: 0;
}
