/* ==========================================================================
   JOB: MOLEKULAS-WA-INPAGE-CONVERSATION-PHASE-A-UI-01
   Masttech Çözüm Ekibi — In-Page Customer Support Drawer & Bottom Sheet
   ========================================================================== */

.msa-chat-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: clamp(390px, 30vw, 440px);
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  background-color: #15181C;
  color: #F3F4F6;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: -10px 0 36px rgba(0, 0, 0, 0.52);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: right 220ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  overflow: hidden;
}

.msa-chat-drawer.is-open {
  right: 0;
  pointer-events: auto;
}

.msa-chat-drawer.is-minimized {
  pointer-events: none;
}

.msa-chat-header {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  padding: 0 16px;
  background-color: #1A1E24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  flex: 0 0 52px;
}

.msa-chat-header-brand,
.chat-header-brand,
.chat-brand-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  height: 36px;
}

.chat-logo-box {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-sizing: border-box;
}

.msa-chat-header-logo,
.chat-header-logo,
.chat-logo-box img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  object-position: center center;
  flex: 0 0 36px;
  border-radius: 0;
  display: block;
  background: none;
}

.msa-chat-header-info,
.chat-header-copy,
.chat-copy-stack {
  height: 36px;
  display: grid;
  grid-template-rows: 18px 18px;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

.chat-copy-box,
.msa-chat-header-title,
.msa-chat-header-status {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 18px;
  margin: 0;
  padding: 0;
  line-height: 1;
  border: 0;
  background: none;
}

.msa-chat-header-title {
  font-size: 15px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msa-chat-header-status {
  font-size: 12.5px;
  color: #9CA3AF;
  gap: 6px;
}

.msa-chat-status--online .msa-chat-status-text {
  color: #25D366;
}

.msa-chat-status--waiting .msa-chat-status-text {
  color: #F59E0B;
}

.msa-chat-status--claimed .msa-chat-status-text {
  color: #25D366;
  font-weight: 500;
}

.msa-chat-status--error .msa-chat-status-text {
  color: #EF4444;
}

.msa-chat-header-actions {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  height: 36px;
  flex: 0 0 auto;
}

.msa-chat-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #9CA3AF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
  padding: 0;
}

.msa-chat-header-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.16);
}

.msa-chat-header-btn:focus-visible {
  outline: 2px solid #25D366;
  outline-offset: 1px;
}

.msa-chat-context-card {
  margin: 8px 16px 0;
  padding: 6px 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  box-sizing: border-box;
  max-height: none;
  overflow: hidden;
  flex: 0 0 auto;
}

.msa-chat-context-card[hidden],
.msa-chat-context-row[hidden],
.msa-chat-recommended[hidden],
.msa-chat-error-card[hidden],
.msa-chat-identity-gate[hidden],
.msa-chat-hours-offline[hidden],
.msa-chat-messages[hidden] {
  display: none !important;
}

.msa-chat-context-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.msa-chat-context-label {
  color: #9CA3AF;
  min-width: 50px;
}

.msa-chat-context-val {
  color: #F3F4F6;
  font-family: var(--mt-font-body);
}

.msa-chat-val-demand,
.msa-chat-val-product {
  color: #60A5FA;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.msa-chat-error-card {
  margin: 8px 16px 0;
  padding: 12px;
  background-color: rgba(227, 1, 15, 0.08);
  border: 1px solid rgba(227, 1, 15, 0.3);
  border-radius: 8px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.msa-chat-error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.msa-chat-error-icon {
  width: 28px;
  height: 28px;
  color: #EF4444;
}

.msa-chat-error-text {
  margin: 0;
  font-size: 13px;
  color: #FECACA;
  line-height: 1.4;
}

.msa-chat-error-action {
  background-color: #E3010F;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms;
}

.msa-chat-error-action:hover {
  background-color: #BD000C;
}

/* Business hours offline (MSA-CHAT-BUSINESS-HOURS-01) */
.msa-chat-hours-offline {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.msa-chat-hours-offline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  max-width: 320px;
  margin: 0 auto;
}

.msa-chat-hours-offline-icon {
  width: 36px;
  height: 36px;
  color: #94A3B8;
}

.msa-chat-hours-offline-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #E5E7EB;
}

.msa-chat-hours-leave-btn {
  background-color: #E3010F;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms;
}

.msa-chat-hours-leave-btn:hover {
  background-color: #BD000C;
}

.msa-chat-status--hours-offline .msa-chat-status-text {
  color: #94A3B8;
}

.msa-chat-composer[hidden] {
  display: none !important;
}

/* Identity Gate (MSA-CHAT-VISITOR-IDENTITY-GATE-01) */
.msa-chat-identity-gate {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.msa-chat-identity-header {
  margin-bottom: 20px;
  text-align: left;
}

.msa-chat-identity-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.3;
}

.msa-chat-identity-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #9CA3AF;
}

.msa-chat-identity-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msa-chat-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.msa-chat-field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: #D1D5DB;
  display: flex;
  align-items: center;
  gap: 4px;
}

.msa-chat-field-required {
  color: #EF4444;
}

.msa-chat-identity-input {
  width: 100%;
  background-color: #1E232A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #FFFFFF;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 150ms, box-shadow 150ms;
}

.msa-chat-identity-input::placeholder {
  color: #6B7280;
}

.msa-chat-identity-input:focus {
  border-color: #E3010F;
  box-shadow: 0 0 0 2px rgba(227, 1, 15, 0.25);
}

.msa-chat-identity-input.is-invalid {
  border-color: #EF4444;
}

.msa-chat-field-error {
  font-size: 12px;
  color: #EF4444;
  line-height: 1.3;
  margin-top: 2px;
}

.msa-chat-identity-general-error {
  font-size: 12.5px;
  color: #FECACA;
  background-color: rgba(227, 1, 15, 0.1);
  border: 1px solid rgba(227, 1, 15, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.4;
  text-align: center;
}

.msa-chat-identity-btn {
  background-color: #E3010F;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 160ms, opacity 160ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.msa-chat-identity-btn:hover:not(:disabled) {
  background-color: #BD000C;
}

.msa-chat-identity-btn:disabled {
  background-color: #374151;
  color: #9CA3AF;
  cursor: not-allowed;
  opacity: 0.7;
}

.msa-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.msa-chat-messages.is-empty {
  justify-content: center;
  align-items: center;
}

.msa-chat-empty-hint {
  display: none;
  margin: 0;
  max-width: 280px;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: #9CA3AF;
}

.msa-chat-messages.is-empty .msa-chat-empty-hint {
  display: block;
}

.msa-chat-messages.is-empty .msa-chat-date-separator {
  display: none;
}

.msa-chat-date-separator {
  text-align: center;
  margin: 4px 0 10px;
}

.msa-chat-date-label {
  display: inline-block;
  font-size: 11.5px;
  color: #6B7280;
  padding: 2px 10px;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.msa-chat-msg {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.msa-chat-msg--system {
  align-items: center;
  margin: 6px 0;
}

.msa-chat-system-pill {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 6px 14px;
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
  max-width: 90%;
}

.msa-chat-system-pill--welcome {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #E5E7EB;
  text-align: center;
  max-width: 92%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.msa-chat-msg--visitor {
  align-items: flex-end;
}

.msa-chat-msg--team {
  align-items: flex-start;
}

.msa-chat-bubble-wrap {
  max-width: 84%;
  display: flex;
  flex-direction: column;
}

.msa-chat-msg--visitor .msa-chat-bubble-meta {
  text-align: right;
  font-size: 11.5px;
  color: #6B7280;
  margin-bottom: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.msa-chat-msg--team .msa-chat-bubble-meta {
  text-align: left;
  font-size: 11.5px;
  color: #9CA3AF;
  margin-bottom: 4px;
  font-weight: 500;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.msa-chat-time {
  color: #6B7280;
  font-size: 11px;
}

.msa-chat-bubble {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.msa-chat-bubble p {
  margin: 0;
}

.msa-chat-msg--visitor .msa-chat-bubble {
  background-color: #2A333E;
  color: #FFFFFF;
  border-radius: 10px 10px 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.msa-chat-msg--team .msa-chat-bubble {
  background-color: #1D222A;
  color: #F3F4F6;
  border-radius: 10px 10px 10px 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.msa-chat-translation-bar {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.msa-chat-translation-bar[data-translation-ready="true"] {
  display: flex;
}

.msa-chat-trans-badge {
  background-color: rgba(255, 255, 255, 0.06);
  color: #9CA3AF;
  padding: 1px 6px;
  border-radius: 4px;
}

.msa-chat-trans-status {
  color: #6B7280;
}

.msa-chat-trans-btn {
  background: transparent;
  border: none;
  color: #60A5FA;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  text-decoration: underline;
}

.msa-chat-recommended {
  margin: 8px 16px 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.msa-chat-recommended-label {
  font-size: 11px;
  color: #9CA3AF;
  letter-spacing: 0.02em;
}

.msa-chat-recommended-val {
  font-size: 13px;
  color: #F3F4F6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.msa-chat-composer {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  background-color: #1A1E24;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
  flex: 0 0 auto;
  align-self: stretch;
}

.msa-chat-composer.is-locked {
  opacity: 0.4;
  pointer-events: none;
}

.msa-chat-composer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  background-color: #13161A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  transition: border-color 160ms, box-shadow 160ms;
}

.msa-chat-composer-wrap:focus-within {
  border-color: rgba(37, 211, 102, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.15);
}

.msa-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  padding: 8px 0;
  max-height: 120px;
  box-sizing: border-box;
}

.msa-chat-input::placeholder {
  color: #6B7280;
}

.msa-chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #25D366;
  color: #FFFFFF;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms, transform 100ms;
  flex-shrink: 0;
  padding: 0;
}

.msa-chat-send-btn:hover:not(:disabled) {
  background-color: #20BA5A;
}

.msa-chat-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.msa-chat-send-btn:disabled {
  background-color: rgba(255, 255, 255, 0.08);
  color: #4B5563;
  cursor: not-allowed;
}

.msa-chat-minimized-pill {
  position: fixed;
  bottom: calc(var(--mt-footer-height) + 10px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  z-index: 1040;
  background-color: #1A1E24;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  user-select: none;
}

.msa-chat-minimized-pill:hover {
  background-color: #222730;
  border-color: rgba(37, 211, 102, 0.6);
  transform: translateY(-2px);
}

.msa-chat-pill-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #FFFFFF;
}

.msa-chat-pill-icon {
  width: 18px;
  height: 18px;
  color: #25D366;
}

.msa-chat-status-dot {
  color: #25D366;
  font-size: 11px;
}

.msa-chat-minimized-pill.is-closed .msa-chat-status-dot {
  color: #9CA3AF;
}

.msa-chat-unread-badge {
  background-color: #E3010F;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .msa-chat-drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    top: auto;
    left: 0;
    right: 0;
    bottom: -100%;
    border-left: none;
    transition: bottom 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .msa-chat-drawer.is-open {
    right: 0;
    bottom: 0;
  }

  .msa-chat-btn-minimize {
    display: none;
  }

  .msa-chat-header {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding: 0 var(--mobile-page-padding, 10px) !important;
    flex: 0 0 52px !important;
  }

  .msa-chat-header .chat-brand-row,
  .msa-chat-header .msa-chat-header-brand {
    height: 36px !important;
  }

  .msa-chat-header .chat-logo-box {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
  }

  .msa-chat-header .msa-chat-header-logo,
  .msa-chat-header .chat-header-logo,
  .msa-chat-header img.msa-chat-header-logo,
  .msa-chat-header .chat-logo-box img {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    flex: 0 0 36px !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  .msa-chat-header .chat-copy-stack,
  .msa-chat-header .msa-chat-header-info {
    height: 36px !important;
    grid-template-rows: 18px 18px !important;
  }

  .msa-chat-identity-gate {
    padding: var(--mobile-gap-double, 20px) var(--mobile-page-padding, 10px);
    justify-content: flex-start;
  }

  /* MSA-MOBILE-10PX-RULE-FULLSET-FINAL-AUDIT-01: mesaj alani + composer 10px sistemi */
  .msa-chat-drawer .msa-chat-messages {
    padding: var(--mobile-gap, 10px) var(--mobile-page-padding, 10px);
    gap: var(--mobile-gap, 10px);
  }

  .msa-chat-drawer .msa-chat-composer {
    padding: var(--mobile-gap, 10px) var(--mobile-page-padding, 10px);
  }

  .msa-chat-drawer .msa-chat-context-card {
    margin: var(--mobile-gap, 10px) var(--mobile-page-padding, 10px) 0;
  }

  .msa-chat-drawer .msa-chat-identity-title {
    margin-bottom: var(--mobile-gap-half, 5px);
  }

  .msa-chat-drawer .msa-chat-identity-form {
    gap: var(--mobile-gap, 10px);
  }

  .msa-chat-drawer .msa-chat-field-group {
    gap: var(--mobile-gap-half, 5px);
  }

  .msa-chat-drawer .msa-chat-identity-input {
    padding-left: var(--mobile-gap, 10px);
    padding-right: var(--mobile-gap, 10px);
  }

  .msa-chat-drawer .msa-chat-identity-btn {
    margin-top: 0;
  }

  .msa-chat-minimized-pill {
    bottom: calc(var(--mt-footer-height) + 11px + env(safe-area-inset-bottom, 0px));
    right: var(--mobile-page-padding, 10px);
    padding: 8px 14px;
    font-size: 12.5px;
  }
}

[dir="rtl"] .msa-chat-drawer,
.msa-chat-drawer[dir="rtl"] {
  right: auto;
  left: -100%;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  transition: left 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .msa-chat-drawer.is-open,
.msa-chat-drawer[dir="rtl"].is-open {
  left: 0;
}

@media (max-width: 767px) {
  [dir="rtl"] .msa-chat-drawer,
  .msa-chat-drawer[dir="rtl"] {
    left: 0;
    right: 0;
    bottom: -100%;
    transition: bottom 220ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  [dir="rtl"] .msa-chat-drawer.is-open,
  .msa-chat-drawer[dir="rtl"].is-open {
    bottom: 0;
    left: 0;
  }
}

[dir="rtl"] .msa-chat-msg--visitor {
  align-items: flex-start;
}

[dir="rtl"] .msa-chat-msg--visitor .msa-chat-bubble-meta {
  justify-content: flex-start;
}

[dir="rtl"] .msa-chat-msg--visitor .msa-chat-bubble {
  border-radius: 10px 10px 10px 2px;
}

[dir="rtl"] .msa-chat-msg--team {
  align-items: flex-end;
}

[dir="rtl"] .msa-chat-msg--team .msa-chat-bubble-meta {
  justify-content: flex-end;
}

[dir="rtl"] .msa-chat-msg--team .msa-chat-bubble {
  border-radius: 10px 10px 2px 10px;
}

[dir="rtl"] .msa-chat-minimized-pill {
  right: auto;
  left: 24px;
}

[dir="rtl"] .msa-chat-system-pill,
.msa-chat-drawer[dir="rtl"] .msa-chat-system-pill {
  direction: rtl;
  text-align: center;
  unicode-bidi: plaintext;
}

[dir="rtl"] .msa-chat-system-pill--welcome,
.msa-chat-drawer[dir="rtl"] .msa-chat-system-pill--welcome {
  direction: rtl;
  text-align: center;
  line-height: 1.55;
}

[dir="rtl"] .msa-chat-identity-gate,
.msa-chat-drawer[dir="rtl"] .msa-chat-identity-gate,
[dir="rtl"] .msa-chat-identity-header,
.msa-chat-drawer[dir="rtl"] .msa-chat-identity-header,
[dir="rtl"] .msa-chat-field-group,
.msa-chat-drawer[dir="rtl"] .msa-chat-field-group {
  text-align: right;
}

[dir="rtl"] .msa-chat-identity-input,
.msa-chat-drawer[dir="rtl"] .msa-chat-identity-input {
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .msa-chat-drawer {
    transition: none !important;
  }
}

/* ==========================================================================
   MSA-MOBILE-CHAT-LAUNCHER-MINI-01 (2026-09-22) — SADECE MOBİL (<=767px)
   Aktif chat launcher'ı ("Masttech Destek ● 0" pill) mobilde MİNİ yuvarlak
   ikon butona dönüşür: 44px daire, koyu zemin, yeşil sohbet ikonu.
   Başlık + durum noktası görünmez (aria-label korunur). Okunmamış mesaj
   varsa rozet dairenin sağ üst köşesinde; 0 iken gizli ([hidden] artık
   display:inline-flex tarafından ezilmez). Masaüstü DEĞİŞMEZ.
   ========================================================================== */
@media (max-width: 767px) {
  .msa-chat-minimized-pill {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  .msa-chat-minimized-pill[hidden] {
    display: none;
  }
  .msa-chat-minimized-pill .msa-chat-pill-content {
    gap: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
  }
  .msa-chat-minimized-pill .msa-chat-pill-icon {
    width: 20px;
    height: 20px;
  }
  .msa-chat-minimized-pill .msa-chat-pill-title,
  .msa-chat-minimized-pill .msa-chat-status-dot {
    display: none;
  }
  .msa-chat-minimized-pill .msa-chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 10.5px;
    border: 2px solid #1A1E24;
  }
  .msa-chat-minimized-pill .msa-chat-unread-badge[hidden] {
    display: none;
  }
  [dir="rtl"] .msa-chat-minimized-pill {
    left: var(--mobile-page-padding, 10px);
    right: auto;
  }
}

/* ==========================================================================
   MSA-CHAT-VISITOR-MOBILE-COMPOSER-OVERFLOW-FIX-02 (2026-09-24) — SADECE MOBİL
   Kök neden: iOS Safari, font-size < 16px olan input/textarea odaklandığında
   sayfayı otomatik YAKINLAŞTIRIR (chat input 13.5px, kimlik inputları 14px).
   Yakınlaşan görsel viewport'ta composer satırının sağındaki Gönder butonu
   ekran dışına düşer ve yatay kaydırma gerekir. Çözüm: mobilde form alanları
   16px (zoom tetiklenmez). Ek koruma: çekmece 100vw yerine 100% genişlik,
   composer satırı viewport içinde kilitli, alt safe-area payı.
   Masaüstü DEĞİŞMEZ (yalnız max-width: 767px).
   ========================================================================== */
@media (max-width: 767px) {
  .msa-chat-drawer {
    width: 100%;
    max-width: 100%;
  }
  .msa-chat-drawer .msa-chat-composer {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: calc(var(--mobile-gap, 10px) + env(safe-area-inset-bottom, 0px));
  }
  .msa-chat-drawer .msa-chat-composer-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .msa-chat-drawer .msa-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    font-size: 16px;
  }
  .msa-chat-drawer .msa-chat-send-btn {
    flex: 0 0 44px;
  }
  .msa-chat-drawer .msa-chat-identity-input {
    font-size: 16px;
  }
}
