/* OrigAI mobile bugfix send/settings */
.oa-input-wrap {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: end !important;
  gap: 8px !important;
  min-height: 64px !important;
  max-height: 112px !important;
  overflow: visible !important;
}

.oa-input-wrap > * {
  min-width: 0 !important;
}

.oa-input-wrap .oa-round-btn,
.oa-input-wrap #upload-btn {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  align-self: end !important;
  flex: 0 0 44px !important;
  display: grid !important;
  place-items: center !important;
}

#message-input {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  height: 44px;
  max-height: 82px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  resize: none !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  line-height: 22px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#send-btn,
.oa-send-btn {
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  align-self: end !important;
  flex: 0 0 44px !important;
  display: grid !important;
  place-items: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  border-radius: 50% !important;
  background: #111827 !important;
  color: #ffffff !important;
  border: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}

#pause-btn {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#send-btn .oa-send-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  position: relative;
}

#send-btn .oa-send-icon svg {
  position: absolute;
  inset: 0;
  width: 22px !important;
  height: 22px !important;
  transition:
    opacity .18s ease,
    transform .28s cubic-bezier(.16, 1, .3, 1);
}

#send-btn .oa-send-arrow {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#send-btn .oa-send-stop {
  opacity: 0;
  transform: rotate(-180deg) scale(.45);
}

#send-btn.is-generating .oa-send-arrow {
  opacity: 0;
  transform: rotate(360deg) scale(.45);
}

#send-btn.is-generating .oa-send-stop {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

#send-btn.oa-spin-once .oa-send-icon {
  animation: oaSendSpinOnce .42s cubic-bezier(.16, 1, .3, 1);
}

@keyframes oaSendSpinOnce {
  from { transform: rotate(0deg) scale(.96); }
  to { transform: rotate(360deg) scale(1); }
}

.oa-mobile-stack-mask {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: rgba(17, 24, 39, .20);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition:
    opacity .26s cubic-bezier(.16, 1, .3, 1),
    backdrop-filter .26s cubic-bezier(.16, 1, .3, 1);
}

.oa-mobile-stack-mask.show {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.oa-mobile-stack-panel {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .98);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  transform: translateX(-26px);
  opacity: 0;
  transition:
    transform .30s cubic-bezier(.16, 1, .3, 1),
    opacity .24s ease;
}

.oa-mobile-stack-mask.show .oa-mobile-stack-panel {
  transform: translateX(0);
  opacity: 1;
}

.oa-mobile-stack-panel.animating {
  animation: oaMobileStackEnter .30s cubic-bezier(.16, 1, .3, 1);
}

@keyframes oaMobileStackEnter {
  from {
    opacity: .35;
    transform: translateX(-24px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

.oa-mobile-stack-head {
  height: calc(60px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.oa-mobile-stack-back,
.oa-mobile-stack-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #111827;
  display: grid;
  place-items: center;
}

.oa-mobile-stack-back svg,
.oa-mobile-stack-close svg {
  width: 22px;
  height: 22px;
}

.oa-mobile-stack-title {
  min-width: 0;
  text-align: center;
}

.oa-mobile-stack-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.03em;
  color: #111827;
}

.oa-mobile-stack-title p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oa-mobile-stack-body {
  overflow: auto;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.oa-mobile-stack-card {
  border: 1px solid #eef0f4;
  border-radius: 22px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.oa-mobile-stack-row {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid #f3f4f6;
  background: #ffffff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 0 14px;
  font-size: 15px;
}

.oa-mobile-stack-row:last-child {
  border-bottom: 0;
}

.oa-mobile-stack-row small {
  color: #6b7280;
  font-size: 12px;
}

.oa-mobile-stack-row:active {
  background: #f9fafb;
}

.oa-mobile-stack-text {
  color: #374151;
  font-size: 14px;
  line-height: 1.75;
  margin: 0;
}

.oa-mobile-stack-textarea {
  width: 100%;
  min-height: 132px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 12px;
  resize: vertical;
  outline: 0;
  font: inherit;
  line-height: 1.6;
}

.oa-mobile-stack-primary {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 18px;
  background: #111827;
  color: #ffffff;
  font: inherit;
}

.oa-mobile-stack-danger {
  color: #ef4444 !important;
}

.oa-mask,
.oa-page-mask,
.oa-modal-mask {
  transition:
    opacity .26s cubic-bezier(.16, 1, .3, 1),
    backdrop-filter .26s cubic-bezier(.16, 1, .3, 1) !important;
}

.oa-mask.show,
.oa-page-mask.show,
.oa-modal-mask.show {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.oa-sidebar,
.oa-bottom-drawer,
.oa-upload-panel,
.oa-side-modal {
  transition:
    transform .30s cubic-bezier(.16, 1, .3, 1),
    opacity .24s ease !important;
}
