/* IRANNIAN AI R387 — Desktop chat geometry fix only
   Scope: Brain + Advanced desktop chat layout.
   No visual redesign. Mobile behavior remains untouched. */

@media (min-width: 901px) {
  .r370-chat-frame {
    min-height: 0 !important;
    grid-template-rows: 48px minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .r370-chat-log {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 28px 6% 24px !important;
    overscroll-behavior: contain;
    scroll-padding-bottom: 24px;
    scrollbar-gutter: stable;
  }

  .r370-chat-bottom {
    position: static !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 86% !important;
    max-width: 900px;
    margin: 0 auto 12px !important;
    padding: 0 !important;
    z-index: auto !important;
    flex: 0 0 auto;
    background: linear-gradient(to top, var(--ia-bg) 68%, transparent) !important;
  }

  .r370-prompt-chips {
    flex: 0 0 auto;
  }

  .r370-composer {
    width: 100%;
    box-sizing: border-box;
  }

  .r370-chat-bottom .notice {
    max-width: 820px;
    margin-inline: auto;
  }
}

/* Short-height desktop/laptop: remove the old forced 580px floor.
   The grid now shrinks the message area instead of covering it. */
@media (min-width: 901px) and (max-height: 760px) {
  .r370-chat-frame {
    min-height: 0 !important;
  }

  .r370-chat-log {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }

  .r370-welcome {
    padding-top: 3vh !important;
    padding-bottom: 20px !important;
  }

  .r370-chat-bottom {
    margin-bottom: 6px !important;
  }
}
