
/* ---------------------------------------------------------
   TABLET / LAYOUT
   --------------------------------------------------------- */

@media (max-width: 1200px) {
  .imggen-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  .imggen-column {
    min-width: 0;
    width: 100%;
  }

  .imggen-preview__media {
    height: 620px;
  }
}

@media (max-width: 900px) {
  .imggen-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    height: auto;
    min-height: 62px;
    padding: 8px 8px;
    background:
      radial-gradient(700px 180px at 50% 0%, rgba(15, 106, 190, .13), transparent 70%),
      #0b0c12;
    flex-wrap: wrap;
    gap: 12px;
  }

  .imggen-layout {
    margin-top: 88px;
  }

  .imggen-topbar__right,
  .imggen-userblock {
    flex-wrap: wrap;
  }

  .imggen-topbar__right {
    gap: 10px;
  }

  .ss-seo {
    padding: 48px 24px;
  }

  .ss-seo__styles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }


  .imggen-mobile-nav__item[aria-current="page"] {
      border-color: rgba(100,190,255,.48);
      background: linear-gradient(110deg, rgba(38,145,225,.34), rgba(54,116,180,.20));
      color: #ffffff;
      box-shadow: inset 3px 0 0 #55baff;
    }

  .imggen-mobile-nav__item:active {
      background: rgba(65,155,230,.30);
      border-color: rgba(100,190,255,.42);
    }


  /* Компоновка аккаунта в меню */
  .imggen-topbar__right .imggen-userblock {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .imggen-topbar__right .imggen-username {
    width: 100%;
  }

  .imggen-userblock {
    gap: 7px;
  }

  .imggen-username {
    font-size: 14px;
  }

  .imggen-userblock .imggen-balance {
    padding: 7px 9px;
    font-size: 12px;
  }

  .imggen-account-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 1100px) {
  .ss-seo__capabilities {
    width: 100%;
    margin-left: 0;
  }

  .ss-seo__capabilities-list {
    gap: 14px;
  }

  .ss-seo-capability__content {
    padding: 12px;
  }
}

@media (max-width: 850px) {
  .ss-seo__capabilities-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "one one"
      "two two"
      "three three"
      "four four"
      "five five";
    gap: 14px;
  }

  .ss-seo-capability {
    height: 185px;
  }
}

@media (min-width: 761px) and (max-width: 1200px) {
  .imggen-works__grid .imggen-work {
    flex-basis: calc((100% - 16px) / 2);
  }
}


/* ---------------------------------------------------------
   GENERAL MOBILE ELEMENTS
   --------------------------------------------------------- */

.imggen-mobile-menu-toggle,
.imggen-mobile-nav {
  display: none;
}


/* ---------------------------------------------------------
   MOBILE: MAX-WIDTH 760PX
   --------------------------------------------------------- */

@media (max-width: 760px) {

  /* PAGE */

  .imggen-page {
    padding-top: 12px;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* MOBILE COLORS */

  .imggen-page {
    background:
      radial-gradient(700px 420px at 50% -100px, rgba(35, 115, 190, .22), transparent 68%),
      linear-gradient(180deg, #0d1729 0%, #0a1221 100%);
  }

  .imggen-page .imggen-card {
    background: linear-gradient(145deg, #192d49 0%, #14243b 55%, #122139 100%);
    border-color: rgba(125, 177, 229, .24);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  }

  .imggen-panel,
  .imggen-models,
  .imggen-styles,
  .imggen-ratios,
  .imggen-segments {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }


  /* TOPBAR */

  .imggen-topbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .imggen-topbar__left {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0;
  }

  .imggen-brand {
    min-width: 0;
    gap: 8px;
  }

  .imggen-brand__logo {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
  }

  .imggen-brand__name {
    font-size: 22px;
    white-space: nowrap;
  }

  .imggen-topbar__sep,
  .imggen-topbar__title {
    display: none;
  }



















  .imggen-topbar__right .imggen-userblock {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .imggen-topbar__right .imggen-username {
    width: 100%;
  }

  .imggen-userblock {
    gap: 7px;
  }

  .imggen-username {
    font-size: 14px;
  }

  .imggen-userblock .imggen-balance {
    padding: 7px 9px;
    font-size: 12px;
  }

  .imggen-account-btn {
    width: 36px;
    height: 36px;
  }


  /* PROMPT BUILDER */

  .imggen-prompt-builder-trigger,
  .imggen-prompt-builder,
  .imggen-builder-editor {
    display: none !important;
  }


  /* COLUMN ORDER */

  .imggen-column--right > .imggen-panel:nth-child(1) {
    order: 1;
  }

  .imggen-column--right > .imggen-panel:nth-child(3) {
    order: 2;
  }

  .imggen-column--right > .imggen-panel:nth-child(2) {
    order: 3;
  }

  .imggen-column--right > .imggen-panel:nth-child(4) {
    order: 4;
  }

  .imggen-column--right > .imggen-panel:nth-child(n+5) {
    order: 5;
  }


  /* MODELS */

  .imggen-models {
    grid-template-columns: minmax(0, 1fr);
  }

  .imggen-model {
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .imggen-model__content {
    min-width: 0;
  }

  .imggen-model__title,
  .imggen-model__desc {
    overflow-wrap: anywhere;
  }

  .imggen-model-select {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    background: linear-gradient(
      180deg,
      rgba(30,134,220,.15),
      rgba(255,255,255,.035)
    );
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
  }

  .imggen-model-select__icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(42,146,230,.16);
    color: #d7efff;
    font-size: 19px;
  }

  .imggen-model-select__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 5px;
  }

  .imggen-model-select__title {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .imggen-model__desc,
  .imggen-model-select__desc {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .imggen-model-select__desc {
    color: #b2b6c8;
    line-height: 1.35;
  }

  .imggen-model-select__arrow {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    margin: -5px 5px 0 12px;
    border-right: 2px solid rgba(160, 195, 230, .85);
    border-bottom: 2px solid rgba(160, 195, 230, .85);
    transform: rotate(45deg);
    transition: transform .2s ease;
  }

  .imggen-model-panel--open .imggen-model-select__arrow {
    margin-top: 5px;
    transform: rotate(225deg);
  }

  .imggen-model-panel #modelList {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    gap: 8px;
    margin-top: 10px;
  }

  .imggen-model-panel.imggen-model-panel--open #modelList {
    display: grid;
  }

  .imggen-model-panel #modelList .imggen-model {
    width: 100%;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 11px;
  }

  .imggen-model-panel #modelList .imggen-model__content {
    min-width: 0;
  }

  .imggen-model-panel #modelList .imggen-model__title,
  .imggen-model-panel #modelList .imggen-model__desc {
    overflow-wrap: anywhere;
  }

  .imggen-section-head.imggen-resolution .imggen-section-head__title {
    display: none;
  }


  /* STYLES SLIDER */

  .imggen-styles {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .imggen-styles::-webkit-scrollbar {
    display: none;
  }

  .imggen-styles .imggen-style {
    flex: 0 0 calc((100% - 20px) / 2.35);
    min-width: 0;
    scroll-snap-align: start;
  }

  .imggen-style {
    min-width: 0;
  }

  .imggen-style span {
    overflow-wrap: anywhere;
    font-size: 13px;
  }


  /* IMAGE RATIOS SLIDER */

  .imggen-ratios {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .imggen-ratios::-webkit-scrollbar {
    display: none;
  }

  .imggen-ratios .imggen-ratio {
    flex: 0 0 calc((100% - 32px) / 4.25);
    min-width: 0;
    scroll-snap-align: start;
  }

  .imggen-ratio {
    min-width: 0;
    padding-left: 2px;
    padding-right: 2px;
    font-size: 12px;
  }


  /* RESOLUTION SEGMENTS */

  .imggen-segments {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .imggen-segment {
    min-width: 0;
    padding: 4px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }


  /* PROMPT */
  
  .imggen-upload-message {
    margin-top: 4px;
    margin-bottom: 4px;
  }
  
  .imggen-prompt {
    padding-bottom: 6px;
    padding-top: 0px;
  }
  
  .imggen-chip
  {
    margin-bottom: 4px;
  }

  .imggen-prompt .imggen-textarea {
    background: linear-gradient(145deg, #142640 0%, #102039 100%);
    border-color: rgba(125, 177, 229, .32);
    color: #f1f6ff;
  }

  .imggen-prompt .imggen-textarea::placeholder {
    color: #b2c4dc;
    opacity: 1;
  }

  .imggen-prompt .imggen-textarea {
    height: auto;
    min-height: calc(3 * 1.45em + 24px);
    max-height: calc(6 * 1.45em + 24px);
    padding: 12px;
    line-height: 1.45;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .imggen-prompt .imggen-textarea::-webkit-scrollbar {
    display: none;
  }

  .imggen-prompt__bottom {
    margin-top: 4px;
  }

  .imggen-actions {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 0;
  }

  .imggen-actions #resetBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0;
  }

  .imggen-actions #resetBtn::before {
    content: "↻";
    font-size: 26px;
    line-height: 1;
  }

  .imggen-actions #generateBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    gap: 10px;
    width: auto;
    min-width: 90px;
    height: 40px;
    padding: 0 8px;
    font-size: 16px;
    white-space: nowrap;
  }

  .imggen-btn__desktop-label {
    display: none;
  }

  .imggen-btn__mobile-price,
  .imggen-btn__mobile-arrow {
    display: inline;
  }

  .imggen-btn__mobile-price {
    font-weight: 600;
  }

  .imggen-btn__mobile-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0;
    line-height: 0;
  }

  .imggen-btn__mobile-arrow::before {
    display: block;
    width: 20px;
    height: 20px;
    background: currentColor;
    clip-path: polygon(0 42%, 100% 0, 68% 100%, 52% 58%, 32% 73%, 39% 51%);
    content: "";
  }


  /* UPLOADS */

  .imggen-upload-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }


  /* ADVANCED SETTINGS */

  .imggen-settings {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }

  .imggen-settings > .imggen-field {
    width: 100%;
    min-width: 0;
  }

  .imggen-settings .imggen-select,
  .imggen-settings .imggen-slider-row,
  .imggen-settings .imggen-slider {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .imggen-settings .imggen-field--moderation {
    display: none !important;
  }

  .imggen-settings > .imggen-field--gif-size {
    order: 6;
  }

  .imggen-settings > .imggen-field--frames {
    order: 7;
  }


  /* PREVIEW */

  .imggen-preview__media {
    height: 420px;
  }

  .imggen-preview__loader {
    width: 180px;
    height: 180px;
  }

  .imggen-preview__loading::before {
    top: calc(50% - 90px);
    left: calc(50% - 90px);
    width: 180px;
    height: 180px;
  }

  .imggen-preview__loading::after {
    top: calc(50% - 110px);
    left: calc(50% - 110px);
    width: 220px;
    height: 220px;
  }

  .imggen-preview__loading-title {
    font-size: 18px;
  }


  /* MY WORKS SLIDER */

  .imggen-works__navigation {
    display: none !important;
  }

  .imggen-works__slider {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .imggen-works__grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .imggen-works__grid::-webkit-scrollbar {
    display: none;
  }

  #worksGrid .imggen-work {
    flex: 0 0 calc((100% - 10px) / 1.35) !important;
    min-width: 0;
    scroll-snap-align: start;
  }

  .imggen-works__grid .imggen-works__empty {
    flex: 0 0 100%;
  }

  #worksGrid .imggen-work__actions {
    position: absolute;
    top: auto;
    right: 10px;
    bottom: 60px;
    left: 10px;
    justify-content: flex-end;
    opacity: 1;
    transform: none;
  }

  .imggen-works__nav {
    width: 35px;
    height: 35px;
  }


  /* SEO */

  .ss-seo {
    margin-top: 16px;
    padding: 36px 16px;
    border-radius: 16px;
  }

  /* SEO COLORS — MATCH IMGGEN CARDS */

  .ss-seo {
    background: linear-gradient(145deg, #192d49 0%, #14243b 55%, #122139 100%);
    border-color: rgba(125, 177, 229, .24);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  }

  .ss-seo-feature,
  .ss-seo-style,
  .ss-seo-faq,
  .ss-seo-capability {
    background: linear-gradient(145deg, #203957 0%, #1b304d 100%);
    border-color: rgba(125, 177, 229, .22);
  }

  .ss-seo-capability__media {
    background: #294363;
  }

  .ss-seo__header > p,
  .ss-seo-feature p,
  .ss-seo__section-heading > p,
  .ss-seo-style p,
  .ss-seo-faq > p {
    color: #c3d2e6;
  }

  .ss-seo__note {
    background: rgba(35, 115, 190, .16);
    color: #d4e2f5;
  }

  .ss-seo__header {
    margin-bottom: 30px;
    text-align: left;
  }

  .ss-seo__header h2 {
    font-size: 27px;
    letter-spacing: -.4px;
  }

  .ss-seo__header > p {
    font-size: 16px;
    line-height: 1.7;
  }

  .ss-seo__features {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 46px;
  }

  .ss-seo-feature {
    height: auto;
    padding: 20px;
  }

  .ss-seo-feature__number {
    margin-bottom: 12px;
  }

  .ss-seo-feature h3 {
    font-size: 18px;
  }

  .ss-seo__styles {
    margin-bottom: 46px;
  }

  .ss-seo__styles-grid {
    gap: 10px;
  }

  .ss-seo-style__content {
    padding: 12px;
  }

  .ss-seo-style h4 {
    font-size: 16px;
  }

  .ss-seo-style p {
    font-size: 15px;
    line-height: 1.55;
  }

  .ss-seo__section-heading h3,
  .ss-seo__capabilities h3 {
    font-size: 25px;
  }

  .ss-seo__capabilities {
    margin-bottom: 46px;
  }

  .ss-seo__capabilities-heading {
    margin-bottom: 20px;
  }

  .ss-seo__capabilities-heading h3 {
    font-size: 25px;
    letter-spacing: -.5px;
  }

  .ss-seo__capabilities-list {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "one"
      "two"
      "three"
      "four"
      "five";
    gap: 12px;
  }

  .ss-seo-capability {
    grid-template-columns: 35% minmax(0, 1fr);
    height: 180px;
    border-radius: 12px;
  }
  


  .ss-seo-capability__content {
    padding: 11px 12px;
  }

  .ss-seo-faq summary {
    padding: 16px 43px 16px 15px;
    font-size: 16px;
  }

  .ss-seo-faq summary::after {
    right: 15px;
  }

  .ss-seo-faq > p {
    padding: 0 15px 17px;
    font-size: 15px;
  }


  /* FOOTER */

  .ssimages-footer {
    padding: 24px 18px;
  }

  .ssimages-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .ssimages-footer__title {
    font-size: 21px;
  }

  .ssimages-footer__contacts {
    gap: 10px;
  }
  
  
 /* SEO TEXT SCROLL — SMALL SCREENS */ 
    .ss-seo-capability {
    height: 250px;
  }

  .ss-seo-capability__content {
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
  }

  .ss-seo-capability__content h4 {
    flex-shrink: 0;
  }

  .ss-seo-capability__content p {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .ss-seo-capability__content p::-webkit-scrollbar {
    display: none;
  }


  /* AUTH MODAL */

  .imggen-auth-modal {
    padding: 30px 20px 22px;
  }

  .imggen-auth-modal__actions {
    flex-direction: column;
  }
}


/* ---------------------------------------------------------
   SMALL SCREENS
   --------------------------------------------------------- */

@media (max-width: 390px) {
  .ss-seo-capability {
    grid-template-columns: 33% minmax(0, 1fr);
  }

  .ss-seo-capability__content {
    padding: 10px;
  }

  .ss-seo-capability__content h4 {
    font-size: 17px;
  }
}




@media (min-width: 761px) {
  .imggen-model-select {
    display: none !important;
  }
}


@media (max-width: 780px) {
  .imggen-card.imggen-prompt {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
     padding: 0px;
  }
}


/* BURGER MENU: до 900px */
@media (max-width: 900px) {

  .imggen-mobile-menu-toggle {
      display: flex;
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      padding: 0;
      border: 1px solid rgba(255,255,255,.12);
      border-radius: 12px;
      background: rgba(255,255,255,.05);
      cursor: pointer;
    }

  .imggen-mobile-menu-toggle span {
      display: block;
      width: 20px;
      height: 2px;
      border-radius: 2px;
      background: #f4f6ff;
    }

  .imggen-topbar__right {
      display: none;
      position: absolute;
      top: calc(100% + 0px);
      right: 0;
      width: min(320px, calc(100vw - 36px));
      flex-direction: column;
      align-items: stretch;
      gap: 18px;
      padding: 16px;
      border: 1px solid rgba(112,185,255,.32);
      border-radius: 18px;
      background: linear-gradient(145deg, #203e60 0%, #192f4c 55%, #142740 100%);
      box-shadow: 0 14px 40px rgba(0,0,0,.38), 0 0 22px rgba(48,145,225,.12);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

  .imggen-topbar.is-menu-open .imggen-topbar__right {
      display: flex;
    }

  .imggen-mobile-nav {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

  .imggen-mobile-nav__heading {
      padding: 0 5px 9px;
      color: #9dcfff;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: .7px;
      text-transform: uppercase;
    }

  .imggen-mobile-nav__item {
      display: block;
      padding: 13px 14px;
      border: 1px solid rgba(150,195,235,.10);
      border-radius: 11px;
      background: rgba(75,145,205,.12);
      color: #f0f7ff;
      font-size: 15px;
      font-weight: 600;
      line-height: 1.35;
      text-decoration: none;
      transition: background .2s ease, border-color .2s ease;
    }

}
