/* вынесен из inline-<style> страницы generate.html (SEC-11: style-src без unsafe-inline) */
    /* Галерея — wide первая карточка занимает 2 колонки */
    .gallery-grid .gallery-item--wide {
      grid-column: span 2;
      height: 320px !important;
    }
    /* Карточка истории — вынесено из инлайн-стилей шаблона generate-2.js («Б2»). */
    .gallery-grid .gallery-item {
      display: block; position: relative; overflow: hidden;
      height: 240px; text-decoration: none;
      border: 1px solid var(--ui-line-hi); border-radius: var(--nv-r-lg);
      transition: transform 0.2s;
      background: var(--ui-bg);
    }
    .gallery-item--empty { background: rgba(255,53,99,0.10) !important; }
    .gallery-item__img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
    .gallery-item__shade {
      position: absolute; inset: 0; z-index: 2; padding: 14px;
      display: flex; flex-direction: column; justify-content: flex-end;
      background: linear-gradient(to top, rgba(13,12,20,0.95) 0%, rgba(13,12,20,0.3) 40%, transparent 70%);
    }
    .gallery-item__title { font-size: 0.82rem; font-weight: 700; color: var(--ui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: normal; word-spacing: normal; }
    .gen-gallery-note { grid-column: 1/-1; text-align: center; padding: 32px; color: var(--ui-text-4); font-size: 0.88rem; }
    .gen-gallery-note--error { color: var(--danger); }
    .gen-gallery-retry { margin-top: 10px; }
    .gallery-grid .gallery-item img {
      opacity: 1;
    }
    .gallery-grid .gallery-item:hover {
      transform: translateY(-3px);
      border-color: var(--ui-accent) !important;
      box-shadow: 0 12px 32px transparent;
    }
    @media (max-width: 600px) {
      .gallery-grid .gallery-item--wide { grid-column: span 1; height: 220px !important; }
      .gallery-grid .gallery-item { height: 180px !important; }
    }
  
