/* Картини-Ум: корги у строки промта, подсказка о первой генерации, скачивание из ленты, диктовка */

/* «Выбрать» в ленте убрана (массовое удаление на мобиле — долгим нажатием) */
#select-mode-btn { display: none !important; }

/* ---------- корги сидит на правом краю строки и показывает на неё ---------- */
.k-pdog { position: absolute; right: 4px; bottom: calc(100% - 10px); z-index: 3; width: 58px; pointer-events: none; }
.k-pdog k-mascot { width: 100%; margin: 0; }
.k-pdog-bubble { position: absolute; right: calc(100% - 4px); bottom: 58%; box-sizing: border-box; width: max-content; max-width: min(300px, calc(100vw - 96px)); padding: 6px 11px;
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; border-radius: 14px; box-shadow: 0 3px 10px rgba(43, 27, 18, .12);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; }
.k-pdog-bubble::after { content: ""; position: absolute; right: -7px; bottom: 7px; width: 10px; height: 10px; background: #fff;
  border-right: 2px solid #2B1B12; border-top: 2px solid #2B1B12; transform: rotate(45deg); }
.k-pdog-bubble.k-swap { animation: kSwap .3s ease-out; }
@keyframes kSwap { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* корги отвечает за микрофон: виден, даже если строка уже заполнена */
.k-pdog.k-talk { display: block !important; }

/* мобильная главная: место под корги над строкой */
.home-prompt-wrap:has(.k-pdog) { margin-top: 52px; }
.k-pdog--home { width: 52px; }
/* десктоп: корги на правом краю композера; прячется, когда человек начал писать */
.k-pdog--desk { width: 62px; right: 20px; bottom: calc(100% - 6px); }
.home-screen.panel-open .k-pdog--desk,
.desktop-prompt-inner:has(.desktop-prompt-grow[data-value]:not([data-value=""])) .k-pdog,
.desktop-prompt-inner.enhancing .k-pdog { display: none; }
.home-screen.desktop-layout .desktop-main-area:has(.k-pdog) { padding-bottom: 200px; }
/* экран создания на мобиле */
.mobile-prompt-bar { position: relative; }
.mobile-prompt-bar:has(.k-pdog) { margin-top: 50px; }
.mobile-prompt-bar:has(.has-user-text) .k-pdog, .mobile-prompt-bar:has(.enhancing) .k-pdog { display: none; }
.mobile-prompt-bar:has(.has-user-text) { margin-top: 16px; }

/* ---------- подсказка при первой генерации ---------- */
.k-tip { position: fixed; left: 50%; bottom: 20px; z-index: 1100; display: flex; align-items: center; gap: 10px;
  width: min(440px, calc(100vw - 24px)); padding: 10px 40px 10px 10px; box-sizing: border-box; transform: translateX(-50%);
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; border-radius: 18px; box-shadow: 0 10px 30px rgba(43, 27, 18, .18);
  animation: kTipIn .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.k-tip k-mascot { flex: none; width: 96px; margin: 0; }
.k-tip-text { font-size: 14px; font-weight: 600; line-height: 1.35; }
.k-tip-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; background: none; color: #6b6478; font-size: 20px; cursor: pointer; }
.k-tip.k-out { opacity: 0; transition: opacity .25s; }
@keyframes kTipIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 1024px) { .k-tip { bottom: 140px; } }

/* ---------- тарифы после нехватки вдохновений ---------- */
.k-paynote { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 6px 12px 6px 4px; border-radius: 16px;
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; font-size: 14px; font-weight: 600; line-height: 1.35; }
.k-paynote k-mascot { flex: none; width: 58px; margin: 0; }

/* ---------- скачивание прямо из ленты ---------- */
.k-dl { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(20, 16, 30, .55); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .15s, transform .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.k-dl svg { width: 18px; height: 18px; display: block; }
.k-dl:hover { background: rgba(99, 102, 241, .9); }
.k-dl:active { transform: scale(.92); }
.k-dl.busy { opacity: .6; pointer-events: none; }
@media (hover: hover) { .k-dl { opacity: 0; } .gallery-item:hover .k-dl, .canvas-feed-item:hover .k-dl, .k-dl:focus-visible { opacity: 1; } }
.home-screen:has(#selection-bar:not(.hidden)) .k-dl { display: none; }
.gallery-item .removebg-badge { left: auto; right: 48px; }

/* ---------- «Из галереи» без готовых картинок ---------- */
.k-nogal, .k-nogal:hover { opacity: .45; cursor: not-allowed; pointer-events: auto; }

/* ---------- диктовка ---------- */
.k-mic { position: relative; flex: none; width: 36px; height: 36px; margin: 0 2px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: transparent; color: var(--tg-theme-hint-color, #8b8599); transition: background .15s, color .15s; }
.k-mic:hover { background: color-mix(in srgb, var(--tg-theme-button-color, #6366f1) 12%, transparent); color: var(--tg-theme-button-color, #6366f1); }
.k-mic.k-rec { background: #ef4444; color: #fff; animation: kRec 1.2s ease-in-out infinite; }
.k-mic.k-busy { opacity: .55; pointer-events: none; }
.k-mic-time { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #ef4444; white-space: nowrap; }
@keyframes kRec { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); } 50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } }
.k-mic-msg { position: absolute; right: 12px; bottom: calc(100% + 8px); z-index: 5; max-width: 280px; padding: 6px 10px;
  background: #2B1B12; color: #fff; border-radius: 10px; font-size: 12px; line-height: 1.35; pointer-events: none; }
.prompt-sheet-header { position: relative; }
.k-mic-hint { position: absolute; right: 30px; top: calc(100% + 8px); box-sizing: border-box; z-index: 2;
  display: flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border-radius: 999px; pointer-events: none;
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; font-size: 12px; font-weight: 700; white-space: nowrap;
  animation: kHint 5.5s ease-out forwards; }
.k-mic-hint k-mascot { width: 26px; margin: 0; }
.k-mic-hint::before { content: ""; position: absolute; top: -7px; right: 24px; width: 10px; height: 10px; background: #fff;
  border-left: 2px solid #2B1B12; border-top: 2px solid #2B1B12; transform: rotate(45deg); }
.prompt-sheet-overlay:not(.open) .k-mic-hint { display: none; }
@keyframes kHint { 0% { opacity: 0; transform: translateX(6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.prompt-sheet-header .k-mic-msg { top: calc(100% + 6px); bottom: auto; }

@media (prefers-reduced-motion: reduce) {
  .k-pdog-bubble.k-swap, .k-tip, .k-mic.k-rec { animation: none; }
  .k-mic-hint { animation-duration: 5.5s; animation-name: kHintFlat; }
  @keyframes kHintFlat { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }
}

/* ---------- Mini App: согласие на первом экране онбординга ---------- */
.ob-consent { margin: 14px 8px 0; font-size: 11px; line-height: 1.45; text-align: center; color: var(--tg-theme-hint-color, #8b8599); }
.ob-consent a { color: inherit; text-decoration: underline; }

/* ======================== UX-2809 ======================== */
/* ---------- окно с Корхи ---------- */
.k-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(24, 16, 12, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: kFade .2s ease-out; }
.k-modal.k-out { opacity: 0; transition: opacity .2s; }
.k-modal-card { position: relative; box-sizing: border-box; width: min(380px, 100%); padding: 74px 22px 20px; text-align: center;
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; border-radius: 24px; box-shadow: 0 18px 50px rgba(43, 27, 18, .28);
  animation: kPop .38s cubic-bezier(.2, .9, .3, 1.25) both; }
.k-modal-dog { position: absolute; left: 50%; top: -58px; width: 128px; transform: translateX(-50%); }
.k-modal-dog k-mascot { width: 100%; margin: 0; }
.k-party .k-modal-dog { animation: kHop 1.1s ease-in-out .3s 2; }
.k-modal-plus { display: inline-block; margin: 0 0 8px; padding: 4px 14px; border-radius: 999px; background: #FFF3C4; border: 2px solid #2B1B12;
  font-size: 22px; font-weight: 800; line-height: 1.1; animation: kPop .45s cubic-bezier(.2, .9, .3, 1.4) .15s both; }
.k-modal-title { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 0 0 8px; }
.k-modal-text { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: #4a3a30; }
.k-modal-gift { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; padding: 10px 12px; text-align: left;
  background: #F2F0FF; border: 2px dashed #6366f1; border-radius: 16px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.k-modal-gift-n { flex: none; font-size: 20px; font-weight: 800; color: #4f46e5; }
.k-modal-btns { display: flex; gap: 10px; margin-top: 14px; }
.k-modal-btn { flex: 1; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 2px solid #2B1B12; background: #fff; color: #2B1B12;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .12s, background .15s; }
.k-modal-btn:active { transform: scale(.97); }
.k-modal-btn.k-primary { background: #6366f1; border-color: #6366f1; color: #fff; box-shadow: 0 4px 0 #3f3aa6; }
.k-modal-btn.k-primary:hover { background: #5458ee; }
.k-confetti { position: absolute; left: 50%; top: 40%; width: 9px; height: 9px; border-radius: 2px; opacity: 0; pointer-events: none;
  animation: kBurst 1.1s ease-out forwards; }
@keyframes kFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kPop { from { opacity: 0; transform: scale(.86) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes kHop { 0%, 100% { transform: translateX(-50%) translateY(0); } 30% { transform: translateX(-50%) translateY(-14px) rotate(-4deg); } 60% { transform: translateX(-50%) translateY(0) rotate(3deg); } }
@keyframes kBurst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

/* ---------- карточка «рисуем»: корги и таймер ---------- */
.k-waitcard { position: fixed; left: 50%; bottom: 22px; z-index: 1100; display: flex; align-items: center; gap: 10px; box-sizing: border-box;
  width: min(420px, calc(100vw - 24px)); padding: 8px 14px 8px 8px; transform: translateX(-50%);
  background: #fff; color: #2B1B12; border: 2px solid #2B1B12; border-radius: 18px; box-shadow: 0 10px 30px rgba(43, 27, 18, .18);
  animation: kTipIn .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.k-waitcard k-mascot { flex: none; width: 64px; margin: 0; }
.k-waitcard b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.k-waitcard span { display: block; font-size: 13px; line-height: 1.35; color: #6b5a4e; }
.k-waitcard.k-out { opacity: 0; transition: opacity .25s; }
.gallery-item.processing, .canvas-feed-item.processing { cursor: pointer; }

/* ---------- ПК: «Сотворить» в строке ввода, «Улучшить текст запроса» внизу панели ---------- */
.k-desk-swap #desktop-enhance-btn { display: none !important; }
.k-desk-swap .rp-gen #desktop-generate-btn { display: none !important; }
.k-gen { flex: none; order: 10; align-self: center; margin: 0 2px 0 6px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: #6366f1; color: #fff; font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 #3f3aa6;
  transition: background .15s, transform .12s, opacity .15s; }
.k-gen:hover { background: #5458ee; }
.k-gen:active { transform: translateY(1px); box-shadow: 0 2px 0 #3f3aa6; }
.k-gen:disabled { opacity: .6; cursor: default; }
.k-gen.k-busy { background: #10b981; box-shadow: 0 3px 0 #0b7a57; }
.k-enh { display: block; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  border: 2px solid color-mix(in srgb, #6366f1 45%, transparent); background: color-mix(in srgb, #6366f1 8%, transparent);
  color: #4f46e5; font: inherit; font-size: 15px; font-weight: 700; transition: background .15s; }
.k-enh:hover { background: color-mix(in srgb, #6366f1 14%, transparent); }
.k-enh:disabled { opacity: .55; cursor: default; }
.k-enh.k-busy { animation: kPulse 1.2s ease-in-out infinite; }
@keyframes kPulse { 50% { opacity: .6; } }

/* ---------- вариантов больше, чем хватает на балансе ---------- */
.variant-opt.k-over, .quality-opt.k-over { opacity: .35; pointer-events: none; }

/* ---------- тарифы ---------- */
.pricing-option.k-reco { position: relative; border: 2px solid #6366f1 !important; box-shadow: 0 6px 20px rgba(99, 102, 241, .22); }
.k-reco-badge { display: flex; align-items: center; gap: 6px; margin: -4px 0 6px; font-size: 12px; line-height: 1.25; text-align: left; color: #4f46e5; }
.k-reco-badge k-mascot { flex: none; width: 38px; margin: 0; transform-origin: 50% 90%; animation: kWiggle 2.6s ease-in-out infinite; }
.k-reco-badge b { display: block; font-size: 13px; }
@media (max-width: 480px) {
  .k-reco-badge { gap: 4px; font-size: 11px; }
  .k-reco-badge k-mascot { width: 28px; }
  .k-reco-badge b { font-size: 12px; }
}
@keyframes kWiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-9deg); } 84% { transform: rotate(8deg); } 92% { transform: rotate(-4deg); } }
.k-paynote2 { margin: 10px 2px 0; font-size: 13px; line-height: 1.4; text-align: center; color: var(--tg-theme-hint-color, #8b8599); }
.promo-card.k-promo-closed { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; text-align: center; }
.promo-card.k-promo-closed > :not(.k-promo-toggle) { display: none !important; }
.k-promo-toggle { padding: 8px 12px; border: 0; background: none; color: var(--tg-theme-link-color, #6366f1); font: inherit; font-size: 14px;
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .k-modal, .k-modal-card, .k-modal-plus, .k-party .k-modal-dog, .k-waitcard, .k-reco-badge k-mascot, .k-enh.k-busy { animation: none; }
  .k-confetti { display: none; }
}

/* 10.10: подарок +10 к первой покупке на экране тарифов */
.k-gift-line { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #f3eeff; color: #4c1d95; font-size: 14px; line-height: 1.35; font-weight: 700; text-align: center; }
.k-gift-add { margin: 2px 0 8px; padding: 3px 8px; border-radius: 8px; background: #f3eeff; color: #5b21b6; font-size: 12px; line-height: 1.3; font-weight: 700; display: inline-block; }
/* 10.10: карточка пакета нажимается целиком; строка «оплата открылась рядом» со ссылкой */
#pricing-card-options .pricing-option { cursor: pointer; }
.k-payopen { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #eef2ff; color: #312e81; font-size: 14px; line-height: 1.4; text-align: center; }
.k-payopen-link { display: inline-block; margin-top: 4px; padding: 6px 4px; color: #4338ca; font-weight: 700; text-decoration: underline; }
