/* ============================================================
   style.css — Mobil-öncelikli, temizlenmiş versiyon
   ============================================================ */

* {
  box-sizing: border-box;
}

:root {
  --primary:       #16a34a;
  --primary-light: #dcfce7;
  --bg:            #f4fbf7;
  --surface:       rgba(255, 255, 255, 0.94);
  --user-bubble:   #16a34a;
  --text:          #111827;
  --muted:         #6b7280;
  --border:        rgba(17, 24, 39, 0.08);
  --radius:        20px;
  --shadow:        0 18px 40px rgba(17, 24, 39, 0.08);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --gx-header-h: 62px;
  --gx-composer-h: clamp(148px, 22vh, 198px);
}

/* ── Base ──────────────────────────────────────────────────── */

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; /* iOS zoom önleme — 16px altında zoom başlar */
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  background: #e8e8e8;
}

body.theme-dark {
  --bg:      #0f172a;
  --surface: rgba(15, 23, 42, 0.92);
  --text:    #f8fafc;
  --muted:   #94a3b8;
  --border:  rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

body.button-soft .quick-chip,
body.button-soft .utility-button,
body.button-soft .submenu-chip {
  border-radius: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
  font-size: 16px; /* iOS zoom önleme */
}

button { cursor: pointer; }

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── App Shell ──────────────────────────────────────────────── */

.app-shell {
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ── Chat Card (mobil varsayılan: tam ekran) ─────────────────── */

.chat-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 252, 249, 0.98));
}

/* ── Globex Screen Layout ───────────────────────────────────── */

.gx-screen {
  position: relative;
  background: #f0f2f8;
}

.gx-dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 100;
}

.gx-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: #0d1b3e;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 8px;
  z-index: 50;
}

.gx-status-time {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}

.gx-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gx-signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.gx-signal-bars span {
  background: #fff;
  border-radius: 1px;
  width: 3px;
}

.gx-signal-bars span:nth-child(1) { height: 4px; }
.gx-signal-bars span:nth-child(2) { height: 6px; }
.gx-signal-bars span:nth-child(3) { height: 9px; }
.gx-signal-bars span:nth-child(4) { height: 12px; }

.gx-battery {
  width: 25px;
  height: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 1.5px;
}

.gx-battery::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 1px 1px 0;
}

.gx-battery-fill {
  width: 80%;
  height: 100%;
  background: #fff;
  border-radius: 1.5px;
}

.gx-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--gx-header-h) + env(safe-area-inset-top));
  background: #0d1b3e;
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top) 18px 0;
  gap: 12px;
  z-index: 40;
}

.gx-header-menu {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
  padding: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.gx-header-menu span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.gx-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.gx-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gx-header-avatar span {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gx-header-info { flex: 1; min-width: 0; }

.gx-header-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gx-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.gx-header-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

.gx-header-online {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.gx-clear-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1;
  white-space: nowrap;
}

.gx-clear-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.18);
}

.gx-content {
  position: absolute;
  top: calc(var(--gx-header-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: calc(var(--gx-composer-h) + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #f0f2f8;
  scrollbar-width: none;
}

.gx-content::-webkit-scrollbar { display: none; }

.gx-hero-banner {
  margin: clamp(12px, 3.5vw, 16px) clamp(12px, 3.5vw, 16px) 0;
  border-radius: 20px;
  padding: 16px 110px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: clamp(84px, 18vw, 92px);
  overflow: hidden;
  position: relative;
}

.gx-hero-banner.gx-intro {
  background:
    radial-gradient(circle at 88% 45%, rgba(76, 130, 255, 0.18), transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #edf5ff 100%);
  box-shadow: 0 18px 44px rgba(23, 64, 135, 0.12), inset 0 1px 0 rgba(255,255,255,0.85);
}

.gx-hero-banner.gx-intro.gx-intro--dismiss {
  animation: gx-intro-floatUpFade 2.2s ease-in-out forwards;
  pointer-events: none;
}

.gx-intro-message {
  color: #122043;
  font-size: clamp(14px, 3.6vw, 16px);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 70%;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.gx-intro-typed {
  display: inline;
  border-right: 2px solid #2468ff;
  animation: gx-intro-caret 0.7s step-end infinite;
}

.gx-intro-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.72) 45%, transparent 70%);
  transform: translateX(-130%);
  animation: gx-intro-shine 3s ease-in-out 0.7s infinite;
  pointer-events: none;
}

.gx-intro-robot-wrap {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 78px;
  height: 78px;
  transform: translateY(-50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 22%, #ffffff 0 18%, #eaf3ff 35%, #d4e6ff 66%, #b9d4ff 100%);
  box-shadow: 0 14px 28px rgba(38, 102, 255, 0.22), inset 0 2px 4px rgba(255,255,255,0.9), inset 0 -10px 20px rgba(48, 101, 210, 0.14);
  animation: gx-intro-robotEnter 1s cubic-bezier(.2,.9,.2,1.15) both, gx-intro-robotBob 2.3s ease-in-out 1s infinite;
}

.gx-intro-robot-wrap::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgba(32, 76, 160, 0.13);
  filter: blur(5px);
  animation: gx-intro-shadowPulse 2.3s ease-in-out 1s infinite;
}

.gx-intro-robot {
  position: relative;
  width: 52px;
  height: 60px;
  z-index: 1;
  animation: gx-intro-waveBody 1.25s ease-in-out 1s 4;
}

.gx-intro-antenna {
  position: absolute;
  left: 26px;
  top: -1px;
  width: 3px;
  height: 10px;
  border-radius: 8px;
  background: linear-gradient(#5d8cff, #194fd6);
}

.gx-intro-antenna::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #5bdcff 45%, #2867ff);
  box-shadow: 0 0 14px rgba(66, 201, 255, 0.8);
}

.gx-intro-head {
  position: absolute;
  left: 6px;
  top: 8px;
  width: 40px;
  height: 30px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #dbeaff);
  border: 3px solid #2e69ff;
  box-shadow: inset 0 -7px 12px rgba(38, 102, 255, 0.12), 0 7px 14px rgba(24, 65, 150, 0.18);
}

.gx-intro-face {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 28px;
  height: 17px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 120%, rgba(82, 203, 255, 0.28), transparent 45%), linear-gradient(180deg, #102f68, #071835);
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.13);
}

.gx-intro-eye {
  position: absolute;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6deaff;
  box-shadow: 0 0 10px #6deaff;
  animation: gx-intro-blink 2.4s infinite;
}

.gx-intro-eye--left { left: 8px; }
.gx-intro-eye--right { right: 8px; }

.gx-intro-smile {
  position: absolute;
  left: 12px;
  bottom: 2px;
  width: 9px;
  height: 4px;
  border-radius: 0 0 10px 10px;
  border-bottom: 2px solid #6deaff;
}

.gx-intro-ear {
  position: absolute;
  top: 18px;
  width: 8px;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6897ff, #194fd6);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.45);
}

.gx-intro-ear--left { left: 0px; }
.gx-intro-ear--right { right: 0px; }

.gx-intro-neck {
  position: absolute;
  left: 22px;
  top: 36px;
  width: 10px;
  height: 7px;
  border-radius: 5px;
  background: linear-gradient(90deg, #b9d6ff, #ffffff, #b9d6ff);
}

.gx-intro-body {
  position: absolute;
  left: 14px;
  top: 42px;
  width: 26px;
  height: 20px;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(145deg, #ffffff, #dcecff);
  border: 3px solid #2e69ff;
  box-shadow: 0 7px 12px rgba(24, 65, 150, 0.14), inset 0 -6px 10px rgba(38,102,255,0.12);
}

.gx-intro-core {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #84f0ff, #2e69ff 70%);
  box-shadow: 0 0 14px #2e69ff;
}

.gx-intro-arm {
  position: absolute;
  right: 3px;
  top: 40px;
  width: 8px;
  height: 22px;
  border-radius: 9px;
  background: linear-gradient(180deg, #4d82ff, #1547c8);
  transform-origin: top center;
  animation: gx-intro-waveHand 0.65s ease-in-out 1s 7;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

.gx-intro-hand {
  position: absolute;
  bottom: -5px;
  left: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(145deg, #123c8d, #061d4e);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

@keyframes gx-intro-robotEnter {
  from { opacity: 0; transform: translate(75px, -50%) scale(.62) rotate(12deg); }
  to { opacity: 1; transform: translateY(-50%) scale(1) rotate(0); }
}

@keyframes gx-intro-robotBob { 0%, 100% { margin-top: 0; } 50% { margin-top: -8px; } }
@keyframes gx-intro-shadowPulse { 0%, 100% { transform: scaleX(1); opacity: .7; } 50% { transform: scaleX(.82); opacity: .45; } }
@keyframes gx-intro-waveHand { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-42deg); } }
@keyframes gx-intro-waveBody { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@keyframes gx-intro-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.15); } }
@keyframes gx-intro-caret { 50% { border-color: transparent; } }
@keyframes gx-intro-shine { 0%, 45% { transform: translateX(-130%); } 70%, 100% { transform: translateX(130%); } }

@keyframes gx-intro-floatUpFade {
  to {
    opacity: 0;
    transform: translateY(-78px) scale(.98);
    filter: blur(7px);
  }
}

.gx-chat-area {
  padding: 18px 16px 10px;
}

.gx-screen .chat-body {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  padding: 0;
  gap: 14px;
}

/* Message sizing closer to reference */

.message-row {
  align-items: flex-end;
}

.message-row__avatar {
  align-self: flex-start;
  margin-top: 2px;
}

.message-bubble {
  max-width: min(88%, 340px);
  padding: 14px 16px 12px;
}

.message-text {
  margin: 0;
  line-height: 1.35;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.2px;
}

.message-text.gx-typewriter {
  border-right: 2px solid #2468ff;
  padding-right: 2px;
  animation: gx-chat-caret 0.7s step-end infinite;
}

@keyframes gx-chat-caret {
  50% { border-color: transparent; }
}

.message-meta {
  font-size: 12px;
  letter-spacing: -0.2px;
}

.message-bubble--bot {
  border-radius: 18px 18px 18px 4px;
}

.message-bubble--user {
  border-radius: 18px 18px 4px 18px;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #1e40af 100%);
}


.quick-actions {
  padding: 6px 0 10px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: transparent;
}


.qa-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 12px;
}

/* quick-chip already provides glass + padding for arrow via ::after,
   but qa-btn has its own arrow element; avoid duplicate chevron */
.qa-btn::after { content: none; }

.qa-btn:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.6);
}

.qa-btn:active {
  transform: scale(0.99);
  background: rgba(241, 245, 249, 0.98);
}

.qa-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.qa-label {
  font-size: clamp(13px, 3.4vw, 14px);
  font-weight: 500;
  color: #0f172a;
  flex: 1;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-arrow {
  font-size: 18px;
  color: #94a3b8;
  font-weight: 500;
}

@media (max-width: 360px) {
  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .qa-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 15px;
  }

  .qa-btn {
    gap: 8px;
    padding: 9px 10px;
  }
}

@media (max-width: 320px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  :root {
    --gx-composer-h: clamp(160px, 26vh, 210px);
  }
}

.gx-note {
  padding: 0 16px 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.gx-content-spacer { height: 6px; }

@media (max-width: 420px) {
  .message-bubble {
    max-width: 86%;
  }
}

.gx-input-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: #f0f2f8;
  z-index: 30;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.gx-input-inner {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 28px;
  padding: 10px 10px 10px 18px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
  gap: 10px;
  min-height: 56px;
}

.gx-input-field {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 16px;
  color: #0f172a;
  background: transparent;
}

.gx-input-field::placeholder { color: #94a3b8; }

.gx-send-btn {
  width: 40px;
  height: 40px;
  background: #1e3a8a;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.35);
}

/* Bottom navigation removed to match reference */

/* Map existing message UI to Globex look */

.message-row {
  gap: 8px;
}

.message-bubble {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.message-bubble--bot {
  background: #fff;
  border: 0;
  border-radius: 18px 18px 18px 4px;
}

.message-bubble--user {
  background: #1e3a8a;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.message-meta { color: #94a3b8; }

.message-bubble--user .message-meta { color: rgba(255, 255, 255, 0.6); }

/* Desktop: iPhone frame */

@media (min-width: 768px) {
  .app-shell {
    padding: 24px;
    align-items: center;
  }

  .chat-card.gx-screen {
    width: 393px;
    height: 852px;
    border-radius: 54px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.25);
    background: #f0f2f8;
  }

  .chat-card.gx-screen {
    overflow: hidden;
  }
}

body.theme-dark .chat-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98));
}

/* ── Header ─────────────────────────────────────────────────── */

.chat-header,
.chat-composer {
  flex: 0 0 auto;
  z-index: 5;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.chat-header__identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1 1 auto;
}

.chat-header__copy {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.chat-header__copy h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header__subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header__copy p {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  color: var(--muted);
}

.chat-header__copy span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: rgba(107, 114, 128, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

/* ── Avatar ─────────────────────────────────────────────────── */

.brand-avatar {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfeff 0%, var(--primary-light) 100%);
  border: 1px solid rgba(22, 163, 74, 0.12);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.brand-avatar--header  { width: 44px; height: 44px; }
.brand-avatar--message { width: 28px; height: 28px; }

.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-avatar img[hidden],
.brand-avatar span[hidden] {
  display: none !important;
}

.brand-avatar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* ── Buttons (shared transitions) ───────────────────────────── */

.menu-button,
.quick-chip,
.utility-button,
.lead-submit,
.submenu-chip,
.chat-form button {
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  -webkit-user-select: none;
          user-select: none;
  touch-action: manipulation; /* iOS dokunma gecikmesini kaldırır */
}

.menu-button {
  min-height: 40px;
  min-width: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.menu-button--text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.menu-button:hover { background: #fff; border-color: rgba(22, 163, 74, 0.2); }

.menu-button:active,
.quick-chip:active,
.utility-button:active,
.lead-submit:active,
.submenu-chip:active,
.chat-form button:active {
  transform: scale(0.96);
}

.menu-button svg,
.chat-form svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Chat Body ──────────────────────────────────────────────── */

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overscroll-behavior: contain;
}

/* ── Messages ───────────────────────────────────────────────── */

.message-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: 100%;
  animation: message-in 0.2s ease;
}

.message-row--user { justify-content: flex-end; }

.message-row__avatar {
  flex: 0 0 auto;
  align-self: flex-start;
}

.message-bubble {
  max-width: min(82%, 300px);
  padding: 10px 12px 8px;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.04);
}

.message-bubble--bot {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 24, 39, 0.05);
  border-top-left-radius: 8px;
}

.message-bubble--user {
  background: linear-gradient(180deg, var(--user-bubble) 0%, var(--primary) 100%);
  color: #fff;
  border-top-right-radius: 8px;
}

.message-bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-bubble--bot a {
  color: var(--primary);
}

.message-bubble--bot .phone-link {
  color: #16a34a; /* WhatsApp Green */
  font-weight: 600;
  white-space: nowrap;
}

.message-bubble--bot .phone-link:hover {
  color: #15803d;
}

body.theme-dark .message-bubble--bot,
body.theme-dark .lead-card,
body.theme-dark .submenu-chip,
body.theme-dark .quick-chip,
body.theme-dark .utility-button,
body.theme-dark .chat-form,
body.theme-dark .menu-button {
  background: rgba(30, 41, 59, 0.96);
  color: var(--text);
}

body.theme-dark .chat-header,
body.theme-dark .chat-composer {
  background: rgba(15, 23, 42, 0.88);
}

.message-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: break-word;
}

.message-text a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-text.gx-typewriter {
  border-right: 2px solid #2468ff;
  padding-right: 2px;
  animation: gx-chat-caret 0.7s step-end infinite;
}

.message-bubble--bot .message-text a { color: var(--primary); }

.message-meta {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.68rem;
  text-align: right;
  color: rgba(107, 114, 128, 0.9);
}

.message-bubble--user .message-meta { color: rgba(255, 255, 255, 0.76); }

/* ── Typing Indicator ───────────────────────────────────────── */

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(107, 114, 128, 0.65);
  animation: pulse 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

/* ── Submenu / Lead Card ────────────────────────────────────── */

.submenu-row,
.lead-card {
  margin-left: 36px;
  max-width: calc(100% - 36px);
}

.submenu-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.submenu-row::-webkit-scrollbar { display: none; }

.submenu-chip {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 34px 10px 12px;
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 10px 22px rgba(15, 23, 42, 0.06);
  position: relative;
}

.submenu-chip:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.6);
}

/* Mini map preview (Ünvan) */
.gx-map-card {
  display: block;
  width: min(360px, calc(100% - 36px));
  margin-left: 36px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  color: inherit;
}

.gx-map-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.gx-map-pin {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.92);
  flex: 0 0 auto;
}

.gx-map-pin svg { width: 18px; height: 18px; }

.gx-map-meta { min-width: 0; flex: 1; }

.gx-map-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.92);
}

.gx-map-addr {
  font-size: 0.82rem;
  color: rgba(71, 85, 105, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gx-map-chev {
  font-size: 18px;
  color: rgba(100, 116, 139, 0.75);
  flex: 0 0 auto;
}

.gx-map-preview {
  height: 86px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 72% 28%, rgba(56, 118, 255, 0.22), transparent 34%),
              linear-gradient(145deg, #ffffff 0%, #edf5ff 100%);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Animated mini-map (ported from azerbaijan_mini_map_button.html) */
.gx-mini-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  z-index: -2;
  background-image:
    linear-gradient(rgba(52, 99, 180, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 99, 180, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}

.gx-mini-glow {
  position: absolute;
  width: 70px;
  height: 70px;
  right: -18px;
  top: -16px;
  border-radius: 50%;
  background: rgba(38, 102, 255, 0.16);
  filter: blur(3px);
  z-index: -1;
}

.gx-mini-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.78) 48%, transparent 72%);
  transform: translateX(-130%);
  animation: gx-mini-shine 3.4s ease-in-out infinite;
  pointer-events: none;
}

.gx-mini-az {
  width: 76px;
  height: 50px;
  filter: drop-shadow(0 8px 10px rgba(22, 72, 145, 0.18));
  animation: gx-mini-float 2.8s ease-in-out infinite;
  will-change: transform;
}

.gx-mini-map {
  stroke: rgba(15, 63, 150, 0.78);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.gx-mini-highlight { fill: rgba(255, 255, 255, 0.22); }

.gx-mini-pin {
  transform-origin: 49px 23px;
  transform-box: fill-box;
  animation: gx-mini-pin 1.65s ease-in-out infinite;
  will-change: transform;
}
.gx-mini-pin-body { fill: #ff4e55; stroke: #ffffff; stroke-width: 1.5; }
.gx-mini-pin-dot { fill: #ffffff; }

.gx-mini-ring {
  fill: none;
  stroke: #2f6dff;
  stroke-width: 2;
  opacity: 0;
  transform-origin: 49px 25px;
  transform-box: fill-box;
  animation: gx-mini-ring 1.65s ease-out infinite;
  will-change: transform, opacity;
}

.gx-mini-label {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  color: #24406f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 10px rgba(26, 67, 145, 0.10);
  opacity: 0.92;
}

/* Card interactivity */
.gx-map-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.gx-map-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.10);
}

.gx-map-card:active {
  transform: translateY(0px) scale(0.99);
}

@keyframes gx-mini-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes gx-mini-pin { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-4px) scale(1.05); } 52% { transform: translateY(1px) scale(.94); } 70% { transform: translateY(0) scale(1); } }
@keyframes gx-mini-ring { 0% { opacity: 0; transform: scale(.3); } 42% { opacity: .55; } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes gx-mini-shine { 0%, 50% { transform: translateX(-130%); } 78%, 100% { transform: translateX(130%); } }



@media (max-width: 360px) {
  .gx-map-card {
    width: calc(100% - 36px);
  }
  .gx-map-preview { height: 78px; }
}

.lead-card {
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  margin: 2px 0;
}

body.theme-dark .lead-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

.lead-card__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.lead-field {
  grid-column: span 2;
}

/* Name ve Phone yan yana olsun (yer tasarrufu) */
.lead-field--name,
.lead-field--phone {
  grid-column: span 1;
}

.lead-grid input,
.lead-grid textarea {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  background: rgba(17, 24, 39, 0.02);
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color 0.2s;
}

body.theme-dark .lead-grid input,
body.theme-dark .lead-grid textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.lead-grid textarea {
  min-height: 50px;
  padding-top: 8px;
  resize: none;
}

.lead-grid input:focus,
.lead-grid textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

body.theme-dark .lead-grid input:focus,
body.theme-dark .lead-grid textarea:focus {
  background: rgba(255, 255, 255, 0.08);
}

.lead-submit {
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  padding: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  width: 100%;
  cursor: pointer;
}

.lead-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Composer ───────────────────────────────────────────────── */

.chat-composer {
  padding: var(--space-2) var(--space-3);
  padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

/* Quick chips strip */

.quick-strip,
.utility-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-strip { padding-bottom: var(--space-2); }
.utility-strip { padding-bottom: var(--space-2); }

.utility-strip:empty { display: none; padding: 0; }

.quick-strip::-webkit-scrollbar,
.utility-strip::-webkit-scrollbar { display: none; }

.quick-chip,
.utility-button {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 34px 10px 12px;
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 44px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 10px 22px rgba(15, 23, 42, 0.06);
  position: relative;
}

.quick-chip:hover,
.utility-button:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.6);
}

.quick-chip::after,
.utility-button::after,
.submenu-chip::after {
  content: '›';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.05rem;
  color: rgba(100, 116, 139, 0.75);
  line-height: 1;
}

.quick-chip:active::after,
.utility-button:active::after,
.submenu-chip:active::after {
  color: rgba(100, 116, 139, 0.9);
}

.quick-chip .quick-icon,
.utility-button .quick-icon,
.submenu-chip .quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  color: rgba(30, 41, 59, 0.86);
  flex: 0 0 auto;
}

.quick-chip .quick-icon svg,
.utility-button .quick-icon svg,
.submenu-chip .quick-icon svg {
  width: 18px;
  height: 18px;
}

/* Chat form */

.chat-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-form:focus-within {
  border-color: rgba(22, 163, 74, 0.32);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  font-size: 16px; /* iOS zoom önleme — ZORUNLU */
  appearance: none;
  -webkit-appearance: none;
}

.chat-form input::placeholder { color: #9ca3af; }

.chat-form button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #14532d 100%);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.18);
}

.chat-form button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(22, 163, 74, 0.22);
}

.chat-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.composer-note {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

/* ── Animations ─────────────────────────────────────────────── */

@keyframes message-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1;    transform: translateY(-2px); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ─ Mobil öncelikli (320px → 767px): varsayılan yukarısı
   ─ Küçük mobil (≤ 360px): daha sıkı padding
   ─ Orta ekran (440px+): tablet-benzeri iyileştirmeler
   ─ Desktop (768px+): kart modu
   ============================================================ */

/* ── ≤ 360px: En küçük ekranlar (iPhone SE, Galaxy A) ───────── */
@media (max-width: 360px) {
  .chat-header {
    padding: var(--space-2) var(--space-3);
    padding-top: max(var(--space-2), env(safe-area-inset-top));
  }

  .brand-avatar--header { width: 38px; height: 38px; }

  .chat-header__copy h1 { font-size: 0.92rem; }

  .chat-body { padding: 8px; gap: 6px; }

  .message-bubble {
    max-width: min(88%, 270px);
    padding: 9px 10px 7px;
  }

  .message-text { font-size: 0.88rem; }

  .quick-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    gap: 6px;
  }

  .quick-chip,
  .utility-button {
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
    padding: 8px 8px;
  }

  .submenu-row,
  .lead-card { margin-left: 0; max-width: 100%; }

  .chat-form input { padding: 10px 10px; }
}

/* ── 361px – 440px: Standart mobil (iPhone 14, Galaxy S24) ───── */
@media (min-width: 361px) and (max-width: 440px) {
  .quick-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .quick-chip,
  .utility-button {
    justify-content: center;
    text-align: center;
  }

  .submenu-row,
  .lead-card { margin-left: 0; max-width: 100%; }

  .message-bubble { max-width: min(86%, 290px); }
}

/* ── 441px – 767px: Büyük telefon / küçük tablet ─────────────── */
@media (min-width: 441px) and (max-width: 767px) {
  .chat-body { padding: var(--space-4); }

  .quick-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .quick-chip {
    justify-content: center;
    text-align: center;
  }

  .message-bubble { max-width: min(80%, 320px); }
}

/* ── 768px+: Desktop / tablet (kart modu) ─────────────────────── */
@media (min-width: 768px) {
  .app-shell {
    padding: var(--space-5);
    align-items: center;
  }

  .chat-card {
    max-width: 430px;
    min-height: 88dvh;
    max-height: 88dvh;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
  }

  body.mode-fullscreen .chat-card {
    max-width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .quick-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .quick-chip { text-align: center; }

  .message-bubble { max-width: min(84%, 320px); }
}

/* ── iOS Safari: Klavye açıkken viewport küçülmesi ────────────── */
@supports (height: 100svh) {
  .chat-card {
    min-height: 100svh;
  }

  @media (min-width: 768px) {
    .chat-card {
      min-height: 88svh;
      max-height: 88svh;
    }
  }
}

/* ── Yüksek Kontrast Modu (erişilebilirlik) ──────────────────── */
@media (forced-colors: active) {
  .quick-chip,
  .submenu-chip,
  .utility-button {
    border: 2px solid ButtonText;
  }

  .chat-form { border: 2px solid ButtonText; }
}

/* ── Hareketi Azalt (erişilebilirlik) ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .message-row { animation: none; }
  .typing-indicator span { animation: none; opacity: 0.6; }
  * { transition-duration: 0.01ms !important; }
}
