/* Üst nav — canlı mesaj kutusu (liste + sohbet + yanıt) */

#msgPanel.gm-msg-panel,
.dropdown-panel#msgPanel.gm-msg-panel {
  width: min(380px, calc(100vw - 1rem));
  max-height: min(520px, calc(100vh - 80px));
  display: none;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

#msgPanel.gm-msg-panel.open,
.dropdown-panel#msgPanel.gm-msg-panel.open {
  display: flex;
}

/* Mobil: panel, mesaj ikonunun küçük sarmalayıcısına değil ekrana göre
   konumlanır — böylece hangi sayfada olursa olsun ekran dışına taşmaz
   ve topnav'ın "overflow:hidden" kırpmasından etkilenmez. */
@media (max-width: 900px) {
  #msgPanel {
    position: fixed !important;
    top: calc(58px + env(safe-area-inset-top, 0px) + 8px) !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    width: min(94vw, 400px) !important;
    max-width: min(94vw, 400px) !important;
    max-height: min(70vh, 540px) !important;
    margin: 0 !important;
    z-index: 20000 !important;
  }

  #msgPanel.gm-msg-panel,
  .dropdown-panel#msgPanel.gm-msg-panel {
    max-height: min(70vh, 540px) !important;
  }

  .gm-msg-nav {
    max-height: min(70vh, 540px) !important;
  }
}

.dropdown-panel#msgPanel.gm-msg-panel {
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16);
}

html.dark .dropdown-panel#msgPanel.gm-msg-panel {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.gm-msg-nav {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: min(520px, calc(100vh - 80px));
}

.gm-msg-nav-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.gm-msg-nav-back {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--gray-100, #f1f5f9);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

html.dark .gm-msg-nav-back {
  background: #1a2236;
  color: #e2e8f0;
}

.gm-msg-nav-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-msg-nav-title.is-clickable {
  cursor: pointer;
}

.gm-msg-nav-title.is-clickable:hover {
  text-decoration: underline;
}

.gm-msg-nav-link-all {
  font-size: 0.72rem;
  color: var(--blue-600, #2563eb);
  text-decoration: none;
  white-space: nowrap;
}

.gm-msg-nav-link-all:hover {
  text-decoration: underline;
}

.gm-msg-nav-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.gm-msg-nav-list .dp-item {
  margin: 0;
}

.gm-msg-nav-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.gm-msg-nav-thread {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.gm-msg-nav.is-thread .gm-msg-nav-list {
  display: none;
}

.gm-msg-nav.is-thread .gm-msg-nav-thread {
  display: flex;
}

.gm-msg-nav.is-thread .gm-msg-nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gm-msg-nav-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.gm-msg-nav-bubble-row {
  display: flex;
  width: 100%;
}

.gm-msg-nav-bubble-row.is-mine {
  justify-content: flex-end;
}

.gm-msg-nav-bubble {
  max-width: 88%;
  padding: 0.45rem 0.65rem;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.gm-msg-nav-bubble-row.is-mine .gm-msg-nav-bubble {
  background: var(--blue-600, #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.gm-msg-nav-bubble-row:not(.is-mine) .gm-msg-nav-bubble {
  background: var(--gray-100, #f1f5f9);
  color: var(--text, #0f172a);
  border-bottom-left-radius: 4px;
}

html.dark .gm-msg-nav-bubble-row:not(.is-mine) .gm-msg-nav-bubble {
  background: #1a2236;
  color: #e2e8f0;
}

/* Site içi paylaşım kartı (dm.js shareCardHtml; dm.css bu sayfalarda yüklenmez) */
.gm-msg-nav-bubble .dm-share-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  color: inherit;
  text-decoration: none;
}

.gm-msg-nav-bubble .dm-share-card-kind {
  font-size: 0.66rem;
  font-weight: 500;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gm-msg-nav-bubble .dm-share-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.gm-msg-nav-bubble .dm-share-card-cta {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 5px;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--blue-600, #2563eb);
  color: #fff;
}

.gm-msg-nav-bubble-row.is-mine .dm-share-card-cta {
  background: rgba(255, 255, 255, 0.22);
}

.gm-msg-nav-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-top: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: var(--card, #fff);
}

html.dark .gm-msg-nav-compose {
  background: #131828;
  border-color: #1e2d4a;
}

.gm-msg-nav-input {
  flex: 1;
  min-height: 38px;
  max-height: 88px;
  resize: none;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  background: var(--gray-50, #f8faff);
  color: var(--text, #0f172a);
}

html.dark .gm-msg-nav-input {
  background: #0c0f1a;
  border-color: #1e2d4a;
  color: #f1f5ff;
}

.gm-msg-nav-send {
  min-height: 38px;
  min-width: 38px;
  padding: 0 0.75rem;
  border: none;
  border-radius: 999px;
  background: var(--blue-600, #2563eb);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.gm-msg-nav-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gm-msg-nav-emoji {
  min-height: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.gm-msg-nav-emoji:hover {
  background: var(--gray-100, #f1f5f9);
  border-color: var(--blue-200, #bfdbfe);
}

html.dark .gm-msg-nav-emoji {
  border-color: #1e2d4a;
}

html.dark .gm-msg-nav-emoji:hover {
  background: #1a2236;
}

.gm-msg-nav-spam {
  display: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  color: #b91c1c;
  background: #fef2f2;
  border-top: 1px solid #fecaca;
}

.gm-msg-nav-spam.is-visible {
  display: block;
}

html.dark .gm-msg-nav-spam {
  background: #3f1515;
  color: #fecaca;
}

.gm-msg-nav-status {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  padding: 0 0.75rem 0.35rem;
  min-height: 1rem;
}
