    /* Кнопки «Оживить»/«Ред.» — только ПК hover, на мобильных скрыты */
    .hist-card-actions { display: none; }

    .gen-history {
      flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 0 4px; margin-bottom: 0;
      display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 8px; row-gap: 27px; align-content: start;
      grid-auto-rows: minmax(96px, auto);
    }
    .gen-history:has(.gen-history-empty) {
      display: flex; flex: 1; align-items: center; justify-content: center;
    }
    .gen-history-empty {
      grid-column: 1 / -1;
      display: flex; flex-direction: column; align-items: center;
      justify-content: center; text-align: center;
      padding: 20px 24px; position: relative;
    }
    .gen-history-empty .gen-empty-glow {
      position: absolute;
      width: 220px; height: 220px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(168,85,247,0.10) 0%, transparent 68%);
      pointer-events: none;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
    }
    .gen-history-empty .gen-empty-icon-wrap {
      width: 62px; height: 62px; border-radius: 18px; margin-bottom: 16px;
      animation: gen-empty-float 4s ease-in-out infinite;
    }
    .gen-history-empty .gen-empty-icon-wrap svg {
      width: 30px; height: 30px;
    }
    .gen-history-empty .gen-empty-title {
      font-size: 0.95rem; font-weight: 800; color: var(--text);
      margin: 0 0 7px; letter-spacing: -0.02em;
    }
    .gen-history-empty .gen-empty-sub {
      font-size: 0.78rem; color: var(--tg-theme-hint);
      line-height: 1.6; max-width: 220px; margin: 0;
    }
    @keyframes gen-empty-float {
      0%, 100% { transform: translateY(0); }
      50%       { transform: translateY(-9px); }
    }
    .gen-history .hist-card {
      aspect-ratio: 1; min-height: 90px; border-radius: var(--radius-sm); overflow: hidden;
      background: rgba(168,85,247,0.04); border: 1px solid rgba(168,85,247,0.1);
      display: flex; align-items: center; justify-content: center;
    }
    .gen-history .hist-card img { width: 100%; height: 100%; object-fit: cover; }
    .gen-history .hist-card.error { color: var(--tg-theme-hint); font-size: 0.7rem; text-align: center; padding: 8px; }
    .gen-history .hist-card.pending {
      flex-direction: column; gap: 6px; color: var(--tg-theme-hint); font-size: 0.75rem;
    }
    .gen-history .hist-card.pending .gen-progress-bar {
      width: 70%; height: 4px; background: rgba(168,85,247,0.08); border-radius: 2px; overflow: hidden;
    }
    .gen-history .hist-card.pending .gen-progress-fill {
      height: 100%; background: linear-gradient(90deg, rgba(168,85,247,0.55), rgba(168,85,247,0.38)); border-radius: 2px; transition: width 0.2s;
    }
    .gen-history .hist-card.hist-card-waiting {
      display: flex; align-items: center; justify-content: center; padding: 12px;
      color: var(--tg-theme-hint); font-size: 0.8rem; text-align: center;
    }
    .gen-history .hist-card .gen-waiting-msg { line-height: 1.3; }
    .gen-history .hist-card.hist-card-img { cursor: pointer; }
    /* Видео: те же квадратные ячейки, что и у изображений (aspect-ratio задаётся на .hist-card) */
    .gen-history .hist-card.hist-card-video {
      position: relative; padding: 0; overflow: hidden;
    }
    /* Фон-плейсхолдер, когда первый кадр ещё не загружен (важно для мобильных) */
    .gen-history .hist-card.hist-card-video::before {
      content: ''; position: absolute; inset: 0; z-index: 0;
      background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(168,85,247,0.35)'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/40% no-repeat;
      pointer-events: none;
    }
    .gen-history .hist-card.hist-card-video .hist-card-video-preview {
      position: absolute; inset: 0; width: 100%; height: 100%;
      object-fit: cover; object-position: center;
      pointer-events: none; z-index: 1;
    }
    /* Превью первого кадра (сервер или canvas) */
    .gen-history .hist-card.hist-card-video .hist-card-video-poster {
      position: absolute; inset: 0; width: 100%; height: 100%;
      object-fit: cover; object-position: center;
      pointer-events: none; z-index: 3;
    }
    .gen-history .hist-card.hist-card-video .hist-card-video-poster:not([src]),
    .gen-history .hist-card.hist-card-video .hist-card-video-poster[src=""] { display: none; }
    .gen-history .hist-card.hist-card-video .hist-card-video-poster-placeholder {
      position: absolute; inset: 0; background: var(--bg-card); z-index: 2;
      display: flex; align-items: center; justify-content: center; pointer-events: none;
    }
    .gen-history .hist-card.hist-card-video .hist-card-video-poster-placeholder.hidden { display: none; }
    .gen-history .hist-card.hist-card-video .hist-card-video-play {
      position: absolute; inset: 0; z-index: 5;
      display: flex; align-items: center; justify-content: center;
      pointer-events: none;
      font-size: 0; line-height: 0;
    }
    .gen-history .hist-card.hist-card-video .hist-card-video-play::before {
      content: '';
      width: clamp(36px, 38%, 58px);
      height: clamp(36px, 38%, 58px);
      max-width: 64px; max-height: 64px;
      border-radius: 14px;
      background: rgba(7,4,16,0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(168,85,247,0.92)'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/52% no-repeat;
      box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    }
    .video-sora-pro-block { margin: 4px 0; }
    .video-sora-pro-block .popup-subtitle {
      display: block; font-size: 0.75rem; color: var(--tg-theme-hint); padding: 4px 0 2px;
    }
    .video-sora-pro-block .popup-opt { margin-top: 2px; }
    .gen-lightbox {
      position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 200;
      display: flex; align-items: center; justify-content: center; padding: 16px;
    }
    .gen-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
    .gen-lightbox.gen-lightbox--portrait img { max-height: 85%; max-width: 85%; }
    .gen-lightbox .gen-lightbox-top {
      position: absolute; top: 0; left: 0; right: 0; padding: 12px 16px;
      display: flex; align-items: center; justify-content: space-between;
      background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
      z-index: 1;
    }
    .gen-lightbox .gen-lightbox-top .lb-left,
    .gen-lightbox .gen-lightbox-top .lb-right { display: flex; align-items: center; gap: 8px; }
    .gen-lightbox .gen-lightbox-top .lb-btn.lb-copy-prompt { font-size: 0.8rem; padding: 8px 12px; }
    .gen-lightbox .gen-lightbox-top .lb-btn.lb-copy-image svg { width: 20px; height: 20px; }
    .gen-lightbox .gen-lightbox-copy-toast {
      position: absolute; top: 56px; left: 50%; transform: translateX(-50%);
      padding: 10px 20px; border-radius: 10px; background: rgba(168,85,247,0.95); color: var(--tg-theme-button-text);
      font-size: 0.9rem; font-weight: 600; z-index: 10; white-space: nowrap;
      animation: gen-copy-toast-in 0.2s ease;
    }
    @keyframes gen-copy-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
    .gen-error-toast {
      position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
      padding: 12px 24px; border-radius: 12px; background: rgba(200, 80, 60, 0.95); color: #fff;
      font-size: 0.95rem; font-weight: 600; z-index: 300; white-space: nowrap; max-width: 90%;
      box-shadow: 0 4px 20px rgba(0,0,0,0.3);
      animation: gen-copy-toast-in 0.2s ease;
    }
    .gen-lightbox .gen-lightbox-top .lb-center {
      position: absolute; left: 50%; transform: translateX(-50%);
    }
    /* ── Оживить / Редактировать — кнопки внизу лайтбокса ── */
    .gen-lightbox .lb-image-actions {
      position: absolute; bottom: 0; left: 0; right: 0;
      display: flex; gap: 10px; padding: 32px 16px 20px;
      background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
      z-index: 2;
    }
    .lb-action-btn {
      flex: 1; padding: 11px 8px; border-radius: 12px; border: none;
      font-family: inherit; font-size: 0.9rem; font-weight: 700;
      cursor: pointer; transition: background 0.15s, transform 0.1s;
    }
    .lb-action-btn:active { transform: scale(0.96); }
    .lb-animate-btn { background: #6366f1; color: #fff; }
    .lb-animate-btn:hover { background: #818cf8; }
    .lb-edit-btn {
      background: rgba(255,255,255,0.14);
      color: #fff;
      backdrop-filter: blur(4px);
      border: 1px solid rgba(255,255,255,0.15);
    }
    .lb-edit-btn:hover { background: rgba(255,255,255,0.22); }
    .gen-lightbox .gen-lightbox-top .lb-btn {
      padding: 8px; border-radius: 8px; border: none; font-family: inherit;
      background: rgba(168,85,247,0.14); color: var(--text); cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .gen-lightbox .gen-lightbox-top .lb-btn:hover { background: rgba(168,85,247,0.16); }
    .gen-lightbox .gen-lightbox-top .lb-btn svg { width: 20px; height: 20px; }
    .gen-lightbox .gen-lightbox-top .lb-trash svg { width: 18px; height: 18px; }
    .gen-lightbox .gen-lightbox-download {
      padding: 8px 16px; border-radius: 8px; font-weight: 600; font-family: inherit; font-size: 0.9rem;
      background: linear-gradient(135deg, rgba(168,85,247,0.58), rgba(168,85,247,0.4)); color: var(--tg-theme-button-text); text-decoration: none;
      border: none; cursor: pointer;
    }
    .gen-lightbox .gen-lightbox-close {
      width: 36px; height: 36px; border-radius: 50%;
      background: rgba(168,85,247,0.14); border: none; color: var(--text); font-size: 1.4rem;
      cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
    }
    .gen-lightbox .gen-lightbox-close:hover { background: rgba(168,85,247,0.16); }
    /* Светлая тема: в лайтбоксе верхняя панель на тёмном фоне — текст и кнопки белые */
    [data-theme="light"] .gen-lightbox .gen-lightbox-top .lb-btn,
    [data-theme="light"] .gen-lightbox .gen-lightbox-top .gen-lightbox-close,
    [data-theme="light"] .gen-lightbox .gen-lightbox-top .gen-lightbox-download {
      color: #fff;
    }
    [data-theme="light"] .gen-lightbox .gen-lightbox-top .lb-btn svg,
    [data-theme="light"] .gen-lightbox .gen-lightbox-top .gen-lightbox-close svg {
      fill: currentColor;
    }
    .gen-chat {
      padding: 6px 12px; padding-bottom: calc(6px + env(safe-area-inset-bottom));
      background: var(--bg-card); border-top: 1px solid var(--border); border-radius: 16px 16px 0 0;
    }
    .gen-chat .chat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
    .gen-chat .chat-trigger {
      padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(168,85,247,0.12);
      background: rgba(168,85,247,0.04); color: var(--tg-theme-text); font-size: 0.82rem;
      font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 38px;
    }
    .gen-chat .chat-trigger .arr { font-size: 0.65rem; opacity: 0.8; }
    .gen-chat .chat-add-photo {
      width: 44px; height: 44px; border-radius: 8px; border: 1px dashed rgba(168,85,247,0.18);
      background: rgba(168,85,247,0.05); color: var(--tg-theme-text); font-size: 1.25rem;
      cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .gen-chat .chat-add-photo.has { color: var(--green); border-color: var(--green); }
    .prompt-wrap { position: relative; margin-bottom: 0; }
    .gen-chat .chat-prompt {
      width: 100%; min-height: 90px; max-height: 200px; padding: 10px 36px 10px 12px; margin-bottom: 0;
      border-radius: 12px; border: 1px solid rgba(168,85,247,0.12);
      background: rgba(168,85,247,0.04); color: var(--tg-theme-text); font-family: inherit;
      font-size: 0.9rem; resize: vertical; box-sizing: border-box;
    }
    .prompt-improve-btn {
      position: absolute; right: 6px; top: 6px; width: 26px; height: 26px;
      border: none; background: transparent; color: var(--tg-theme-hint); cursor: pointer;
      padding: 0; display: none; align-items: center; justify-content: center;
      border-radius: 6px;
    }
    .prompt-wrap.has-text .prompt-improve-btn { display: flex; }
    .prompt-improve-btn:hover { color: var(--accent); background: rgba(255,255,255,0.06); }
    .prompt-improve-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .prompt-improve-btn svg { width: 14px; height: 14px; pointer-events: none; }
    .prompt-clear-btn {
      position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px;
      border: none; background: transparent; color: var(--tg-theme-hint); cursor: pointer;
      padding: 0; display: none; align-items: center; justify-content: center;
      border-radius: 6px;
    }
    .prompt-wrap.has-text .prompt-clear-btn { display: flex; }
    .prompt-clear-btn:hover { color: var(--tg-theme-text); background: rgba(255,255,255,0.06); }
    .prompt-clear-btn svg { width: 14px; height: 14px; pointer-events: none; }
    .gen-chat .chat-submit {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 12px 16px; border-radius: 12px; border: none;
      background: var(--accent);
      color: var(--tg-theme-button-text); font-weight: 800; font-family: inherit; font-size: 0.95rem;
      cursor: pointer; width: 100%;
      box-shadow: 0 6px 18px rgba(168,85,247,0.3);
      opacity: 0.65;
    }
    .gen-chat .chat-submit:not(:disabled) {
      opacity: 1;
      box-shadow: 0 8px 22px rgba(168,85,247,0.35);
    }
    .gen-chat .chat-submit .price { opacity: 0.95; font-size: 0.82rem; }
    .gen-chat .chat-submit:disabled { opacity: 0.6; cursor: not-allowed; }
    .gen-overlay {
      position: fixed; inset: 0; background: rgba(5,7,6,0.72); z-index: 100;
      display: flex; align-items: center; justify-content: center; padding: 20px;
      backdrop-filter: blur(6px);
    }
    .gen-popup {
      background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
      padding: 16px; max-width: 320px; width: 100%; max-height: 80vh; overflow-y: auto;
      box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
    }
    .gen-popup .popup-title { font-size: 0.75rem; color: var(--tg-theme-hint); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
    .gen-popup .popup-opt {
      display: block; width: 100%; padding: 12px 14px; margin-bottom: 8px; text-align: left;
      border-radius: var(--radius-sm); border: 1px solid rgba(168,85,247,0.12);
      background: rgba(168,85,247,0.05); color: var(--tg-theme-text); font-family: inherit; cursor: pointer;
    }
    .gen-popup .popup-opt.model-card {
      display: flex !important;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      gap: 12px;
    }
    .gen-popup .popup-opt.active { border-color: rgba(168,85,247,0.28); background: rgba(168,85,247,0.1); }
    .gen-popup .popup-opt:last-child { margin-bottom: 0; }
    #video-model-overlay.gen-overlay { background: var(--bg); }
    /* Выбор модели — на весь экран, сетка 2 в ряд */
    #gen-model-overlay.gen-overlay { padding: 0; align-items: stretch; justify-content: stretch; background: var(--bg); }
    .gen-popup-models {
      max-width: none; width: 100%; height: 100%; min-height: 100vh;
      padding: 0; border-radius: 0; border: none;
      display: flex; flex-direction: column; overflow: hidden;
      background: var(--bg);
    }
    .gen-popup-models .popup-header {
      flex-shrink: 0;
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
      background: var(--bg-card);
      border-bottom: 1px solid var(--border);
    }
    .gen-popup-models .popup-title { font-size: 1rem; font-weight: 700; color: var(--tg-theme-text); margin: 0; }
    .gen-popup-models .gen-models-close {
      width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
      background: var(--bg-card); color: var(--tg-theme-hint);
      font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .gen-popup-models .gen-models-close:hover { background: var(--accent-soft); color: var(--tg-theme-text); }
    .gen-popup-models .popup-subtitle, .gen-popup-models .popup-hint { display: none; }
    .gen-popup-models .model-list {
      flex: 1; min-height: 0; overflow: hidden;
      display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 8px;
      padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
      align-content: stretch;
    }
    .gen-popup-models .model-card {
      display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr;
      width: 100%; height: 100%; min-height: 0; padding: 10px; gap: 6px 0;
      border-radius: 12px; position: relative; overflow: hidden;
      align-items: start;
      border: 1px solid rgba(168,85,247,0.16);
      background: rgba(168,85,247,0.05);
      color: var(--tg-theme-text);
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      transition: border-color 0.2s, background 0.2s, transform 0.08s;
      box-sizing: border-box;
    }
    .gen-popup-models .model-card:active { transform: scale(0.98); }
    .gen-popup-models .model-card:hover { background: rgba(168,85,247,0.06); }
    .gen-popup-models .model-card.active { border-color: rgba(168,85,247,0.26); background: rgba(168,85,247,0.08); box-shadow: 0 0 0 1px rgba(168,85,247,0.12) inset; }
    .gen-popup-models .model-card .model-icon {
      width: 48px; height: 48px; min-width: 48px; min-height: 48px; border-radius: 10px; flex-shrink: 0;
      grid-column: 2; grid-row: 1; justify-self: center; align-self: start;
      display: flex; align-items: center; justify-content: center;
      background: rgba(168,85,247,0.12); margin: 0;
    }
    .gen-popup-models .model-card .model-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; display: block; }
    .gen-popup-models .model-card.active .model-icon { background: rgba(168,85,247,0.16); }
    .gen-popup-models .model-card .model-price {
      grid-column: 3; grid-row: 1; justify-self: end; align-self: start;
      font-size: 0.75rem; font-weight: 700; color: var(--green);
      padding: 3px 6px; border-radius: 6px; background: var(--green-soft); flex-shrink: 0;
    }
    .gen-popup-models .model-card.active .model-price { color: var(--accent); background: var(--accent-soft); }
    .gen-popup-models .model-card .model-body {
      position: absolute;
      left: 10px; right: 10px;
      top: 64px; bottom: 10px;
      display: flex; flex-direction: column; gap: 4px; overflow: hidden;
      justify-content: center; min-width: 0;
    }
    .gen-popup-models .model-card .model-header { display: block; }
    .gen-popup-models .model-card .model-name {
      font-weight: 700; font-size: 0.95rem; line-height: 1.25; color: #FFFFFF;
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
      text-align: center; width: 100%; margin: 0; padding: 0; box-sizing: border-box;
    }
    .gen-popup-models .model-card .model-desc {
      font-size: 0.7rem; line-height: 1.35; color: var(--tg-theme-hint);
      display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
      overflow: hidden; flex: 1; min-height: 0;
      text-align: center; width: 100%; margin: 0; padding: 0;
      box-sizing: border-box;
    }
    .gen-popup-models .model-card .model-tags { display: none; }
    .gen-popup-models .model-card .model-check { display: none !important; }

    /* ── Редактор маски (inpainting) ─────────────────────────── */

    .gen-mask-overlay {
      position: fixed;
      inset: 0;
      z-index: 250;
      background: #070410;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .gen-mask-toolbar {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
      background: rgba(7,4,16,0.97);
      border-bottom: 1px solid rgba(168,85,247,0.15);
      flex-shrink: 0;
    }
    .gen-mask-tool {
      width: 38px; height: 38px;
      border-radius: 10px;
      border: 1px solid rgba(168,85,247,0.15);
      background: rgba(168,85,247,0.05);
      color: var(--text-muted);
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .gen-mask-tool:active { background: rgba(168,85,247,0.15); }
    .gen-mask-tool.active {
      background: rgba(168,85,247,0.18);
      border-color: rgba(168,85,247,0.42);
      color: var(--accent);
    }
    .gen-mask-size-wrap {
      flex: 1;
      display: flex;
      align-items: center;
      padding: 0 4px;
    }
    .gen-mask-size-slider {
      flex: 1;
      height: 4px;
      -webkit-appearance: none;
      appearance: none;
      background: rgba(168,85,247,0.25);
      border-radius: 2px;
      outline: none;
    }
    .gen-mask-size-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 20px; height: 20px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
    }
    .gen-mask-canvas-wrap {
      flex: 1;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
      touch-action: none;
      background: #000;
    }
    #gen-mask-canvas {
      display: block;
      touch-action: none;
      cursor: crosshair;
      max-width: 100%;
      max-height: 100%;
    }
    .gen-mask-cursor {
      position: fixed;
      border-radius: 50%;
      border: 2px solid rgba(168,85,247,0.85);
      pointer-events: none;
      transform: translate(-50%, -50%);
      display: none;
      z-index: 260;
    }
    .gen-mask-actions {
      display: flex;
      gap: 10px;
      padding: 10px 12px;
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
      background: rgba(7,4,16,0.97);
      border-top: 1px solid rgba(168,85,247,0.15);
      flex-shrink: 0;
    }
    .gen-mask-cancel {
      flex: 1; justify-content: center; text-align: center;
      background: rgba(255,255,255,0.1) !important;
      border-color: rgba(255,255,255,0.25) !important;
      color: rgba(255,255,255,0.85) !important;
    }
    .gen-mask-confirm {
      flex: 2; justify-content: center; text-align: center;
      background: var(--accent) !important;
      color: #fff !important;
      border: none !important;
      opacity: 1 !important;
      box-shadow: 0 6px 18px rgba(168,85,247,0.4);
    }

    /* ── Чип «@Стиль» в поле ввода ─────────────────────── */
    .prompt-wrap.has-idea-chip {
      min-height: 72px;
      border-radius: 12px;
      border: 1px solid rgba(168,85,247,0.2);
      background: rgba(168,85,247,0.04);
      display: flex; align-items: center;
      padding: 12px 14px;
    }
    .prompt-wrap.has-idea-chip .prompt-improve-btn,
    .prompt-wrap.has-idea-chip .prompt-clear-btn { display: none; }
    .gen-idea-chip {
      display: flex; align-items: center; gap: 10px;
      width: 100%;
      padding: 10px 16px; border-radius: 10px;
      background: linear-gradient(135deg, rgba(168,85,247,0.14) 0%, rgba(129,140,248,0.08) 100%);
      border: 1px solid rgba(168,85,247,0.25);
      font-family: inherit;
      animation: ideaChipIn 0.25s ease-out;
    }
    @keyframes ideaChipIn {
      from { opacity: 0; transform: scale(0.96) translateY(4px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    .gen-idea-chip-icon {
      width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
      background: rgba(168,85,247,0.15);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.9rem; color: #a855f7;
    }
    .gen-idea-chip-text {
      flex: 1; min-width: 0;
      font-size: 0.92rem; font-weight: 600;
      color: var(--text-highlight, #c084fc);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .gen-idea-chip-remove {
      width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
      border: none; background: rgba(255,255,255,0.08);
      color: var(--text-muted); font-size: 1rem; line-height: 1;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background 0.15s, color 0.15s;
      padding: 0;
    }
    .gen-idea-chip-remove:hover { background: rgba(255,255,255,0.16); color: var(--text); }
    [data-theme="light"] .prompt-wrap.has-idea-chip {
      border-color: rgba(147,51,234,0.15);
      background: rgba(147,51,234,0.03);
    }
    [data-theme="light"] .gen-idea-chip {
      background: linear-gradient(135deg, rgba(147,51,234,0.08), rgba(99,102,241,0.05));
      border-color: rgba(147,51,234,0.18);
    }
    [data-theme="light"] .gen-idea-chip-icon { background: rgba(147,51,234,0.1); color: #7c3aed; }
    [data-theme="light"] .gen-idea-chip-text { color: #7c3aed; }
    [data-theme="light"] .gen-idea-chip-remove { background: rgba(0,0,0,0.05); color: #888; }
    [data-theme="light"] .gen-idea-chip-remove:hover { background: rgba(0,0,0,0.1); color: #333; }
