:root {
  --bg-root: #09090b;
  --bg-sidebar: #0e0e12;
  --bg-surface: #16161d;
  --bg-elevated: #1e1e28;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f4f6;
  --text-secondary: #8e8ea0;
  --text-tertiary: #636374;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-deep: #2563eb;
  --bubble-out: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  --bubble-in: #181820;
  --online: #22c55e;
  --danger: #ef4444;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-root);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

/* Özel İnce Kaydırma Çubuğu */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

/* --- GİRİŞ EKRANI --- */
.auth-screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.28;
}
.orb-1 {
  width: 340px;
  height: 340px;
  background: #2563eb;
  top: -80px;
  left: -60px;
}
.orb-2 {
  width: 300px;
  height: 300px;
  background: #0ea5e9;
  bottom: -80px;
  right: -60px;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 390px;
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: fadeScaleIn 0.35s var(--ease-spring);
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.auth-header h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.segmented-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 11px;
  margin-bottom: 18px;
}

.seg-tab {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.seg-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10.5px 13px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.btn-solid {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.18s, transform 0.14s var(--ease-spring);
}

.btn-solid:hover {
  background: var(--accent-deep);
}
.btn-solid:active {
  transform: scale(0.97);
}
.btn-solid.sm {
  padding: 8px 15px;
  font-size: 13.5px;
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-subtle.sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-subtle.full {
  width: 100%;
}

.btn-ghost-install {
  margin-top: 15px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.btn-ghost-install:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* --- ANA UYGULAMA İSKELETİ --- */
.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 340px 1fr;
  width: 100%;
  height: 100dvh;
  background: var(--bg-root);
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding-top: var(--safe-top);
  overflow: hidden;
  z-index: 2;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  gap: 8px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar-box {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  user-select: none;
}

.conn-dot, .online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.conn-dot.connected, .online-dot {
  background: var(--online);
}
.conn-dot.connecting, .conn-dot.reconnecting {
  background: #f59e0b;
}
.conn-dot.disconnected {
  background: var(--text-tertiary);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-handle {
  font-size: 12px;
  color: var(--text-secondary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s, color 0.16s, transform 0.14s;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn.sm {
  width: 28px;
  height: 28px;
}
.icon-btn.highlight {
  color: var(--accent-bright);
  background: rgba(59, 130, 246, 0.11);
}
.icon-btn.light {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.icon-btn.muted-danger:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.11);
}

/* Arama */
.search-bar {
  position: relative;
  margin: 0 14px 10px;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px 8px 34px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus {
  border-color: var(--accent);
}

/* İstek Paneli */
.requests-panel {
  margin: 0 12px 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: fadeScaleIn 0.25s var(--ease-spring);
}
.req-head {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.2px;
}
.req-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.req-user {
  font-size: 13px;
  font-weight: 550;
}
.req-actions {
  display: flex;
  gap: 5px;
}

/* Kişi Listesi */
.contact-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 8px calc(14px + var(--safe-bottom));
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.contact-item:hover {
  background: var(--bg-hover);
}
.contact-item.active {
  background: rgba(59, 130, 246, 0.13);
}

.contact-body {
  flex: 1;
  min-width: 0;
}

.contact-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.contact-title {
  font-weight: 580;
  font-size: 14.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-ts {
  font-size: 11.5px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.contact-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-snippet {
  font-size: 12.8px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.contact-snippet.typing {
  color: var(--accent-bright);
}

.unread-pill {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.empty-list-note {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
}

/* --- SAĞ SOHBET PANELİ --- */
.chat-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-root);
  overflow: hidden;
}

.empty-pane {
  margin: auto;
  max-width: 360px;
  text-align: center;
  padding: 24px;
}

.empty-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.empty-pane h2 {
  font-size: 18px;
  font-weight: 620;
  margin-bottom: 6px;
}
.empty-pane p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.chat-active {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(14, 14, 18, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}

.peer-head {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.peer-details {
  min-width: 0;
}

.peer-title {
  font-weight: 620;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peer-sub {
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.peer-sub.online {
  color: var(--online);
}
.peer-sub.typing {
  color: var(--accent-bright);
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sürükle Bırak */
.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.drop-card {
  border: 1.5px dashed var(--accent);
  border-radius: 18px;
  padding: 32px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--accent-bright);
  background: rgba(59, 130, 246, 0.07);
}

/* Mesaj Akışı */
.messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-pill {
  align-self: center;
  margin: 10px 0;
  padding: 3px 11px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 550;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: min(72%, 500px);
  animation: msgEnter 0.24s var(--ease-spring);
}

@keyframes msgEnter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg-row.out {
  align-self: flex-end;
  align-items: flex-end;
}
.msg-row.in {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  position: relative;
  padding: 8px 12px 7px;
  border-radius: 18px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  transition: transform 0.15s var(--ease-spring);
}

.msg-row.out .msg-bubble {
  background: var(--bubble-out);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg-row.in .msg-bubble {
  background: var(--bubble-in);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.msg-quote {
  border-left: 2.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 9px;
  border-radius: 7px;
  margin-bottom: 6px;
  font-size: 12.2px;
  cursor: pointer;
}
.msg-row.in .msg-quote {
  border-left-color: var(--accent);
}
.msg-quote strong {
  display: block;
  font-size: 11.5px;
  opacity: 0.9;
}

/* Medya Kartları */
.msg-media-frame {
  position: relative;
  margin: -3px -6px 6px;
  border-radius: 13px;
  overflow: hidden;
  background: #050507;
  min-width: 190px;
}
.msg-media-frame:last-child {
  margin-bottom: 2px;
}

.msg-photo {
  display: block;
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  cursor: zoom-in;
  transition: filter 0.28s ease, transform 0.28s ease;
}
.msg-photo.blurred {
  filter: blur(12px);
  transform: scale(1.05);
}

.msg-video {
  display: block;
  width: 100%;
  max-height: 350px;
  background: #000;
  border-radius: 12px;
}

.media-loader {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 550;
}

.loader-bar {
  width: 68%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.16s linear;
}

/* Özel Modern Sesli Mesaj Oynatıcısı (Dalga Formlu) */
.voice-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 235px;
  padding: 3px 2px;
}

.vp-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.14s, background 0.16s;
}
.msg-row.in .vp-play-btn {
  background: var(--accent);
}
.vp-play-btn:active {
  transform: scale(0.92);
}

.vp-wave {
  flex: 1;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 2.5px;
  cursor: pointer;
}
.vp-bar {
  flex: 1;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.32);
  transition: background 0.12s;
}
.vp-bar.played {
  background: #fff;
}
.msg-row.in .vp-bar.played {
  background: var(--accent-bright);
}

.vp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.vp-time {
  font-size: 11px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.vp-speed {
  border: none;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font-size: 10px;
  font-weight: 650;
  padding: 1px 5px;
  border-radius: 5px;
  cursor: pointer;
}

.msg-text {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.42;
}

.msg-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: 10.8px;
  opacity: 0.72;
  user-select: none;
}

.status-icon {
  display: inline-flex;
  align-items: center;
}
.status-icon.seen {
  color: #93c5fd;
  opacity: 1;
}
.msg-row.out .status-icon.seen {
  color: #bae6fd;
  filter: drop-shadow(0 0 4px rgba(186, 230, 253, 0.45));
}

/* Son gönderilen mesajın altındaki açık "Görüldü / İletildi" satırı */
.seen-caption {
  font-size: 11.2px;
  color: var(--text-secondary);
  margin-top: 3px;
  padding-right: 4px;
  animation: fadeIn 0.22s ease;
}
.seen-caption.is-seen {
  color: var(--accent-bright);
  font-weight: 550;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.msg-hover-bar {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.msg-row:hover .msg-hover-bar,
.msg-row.active-opts .msg-hover-bar {
  opacity: 1;
  pointer-events: auto;
}
.msg-opt {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.msg-opt:hover {
  color: var(--text);
}

/* Yazıyor Balonu Animasyonu */
.typing-row {
  padding: 4px 20px 8px;
  animation: msgEnter 0.2s var(--ease-spring);
}
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  background: var(--bubble-in);
  border: 1px solid var(--border);
}
.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.16s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.32s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Yanıt ve Staging Çubukları */
.context-bar, .staging-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  animation: slideUpBar 0.18s var(--ease-spring);
}

@keyframes slideUpBar {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.context-accent {
  width: 3px;
  height: 30px;
  border-radius: 99px;
  background: var(--accent);
}
.context-body {
  flex: 1;
  min-width: 0;
}
.context-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-bright);
}
.context-text {
  display: block;
  font-size: 12.8px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staging-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
}
.stage-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #000;
  flex-shrink: 0;
}
.stage-thumb img, .stage-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.btn-link-danger {
  border: none;
  background: transparent;
  color: #f87171;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Canlı Ses Kayıt Çubuğu */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  animation: slideUpBar 0.2s var(--ease-spring);
}
.voice-live-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 99px;
  padding: 7px 14px;
}
.rec-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: recBlink 1s infinite;
  flex-shrink: 0;
}
@keyframes recBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.2); }
}
.rec-time {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.live-wave {
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.live-wave span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--accent-bright);
  transition: height 0.08s ease;
}

.btn-circle-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Mesaj Yazma Çubuğu (Composer) */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
}

.input-pill {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  transition: border-color 0.2s;
}
.input-pill:focus-within {
  border-color: rgba(59, 130, 246, 0.55);
}

.input-pill textarea {
  width: 100%;
  max-height: 120px;
  min-height: 22px;
  resize: none;
  border: none;
  background: transparent;
  font-size: 14.5px;
  line-height: 1.4;
  outline: none;
}

/* Akıllı Dönüşen Mikrofon <-> Gönder Butonu */
.btn-morph {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s var(--ease-spring), transform 0.14s var(--ease-spring);
}
.btn-morph.mode-mic {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-morph.mode-mic:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.btn-morph.mode-send {
  background: var(--accent);
  color: #fff;
}
.btn-morph:active {
  transform: scale(0.9);
}
.btn-morph svg {
  position: absolute;
  transition: opacity 0.18s ease, transform 0.22s var(--ease-spring);
}
.btn-morph.mode-mic .icon-mic {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.btn-morph.mode-mic .icon-send {
  opacity: 0;
  transform: scale(0.5) rotate(-35deg);
}
.btn-morph.mode-send .icon-mic {
  opacity: 0;
  transform: scale(0.5) rotate(35deg);
}
.btn-morph.mode-send .icon-send {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* --- CANLI KAMERA & VİDEO ÇEKİM MODALI --- */
.camera-dialog {
  width: 100%;
  max-width: 520px;
  height: min(84dvh, 660px);
  background: #050507;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: fadeScaleIn 0.26s var(--ease-spring);
}

.camera-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.68), transparent);
}

.cam-mode-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 99px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.12);
}
.cam-mode-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.cam-mode-btn.active {
  background: #fff;
  color: #000;
}

.cam-rec-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.65);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
}
.cam-top-btns {
  display: flex;
  gap: 8px;
}

.camera-stage {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.camera-stage video, .camera-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
}

.shutter-outer {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: transparent;
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.shutter-outer:active {
  transform: scale(0.92);
}
.shutter-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: all 0.2s var(--ease-spring);
}
.shutter-outer.video-mode .shutter-inner {
  background: var(--danger);
}
.shutter-outer.recording .shutter-inner {
  width: 52%;
  height: 52%;
  border-radius: 6px;
  background: var(--danger);
}

.camera-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
}
.cam-caption {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
}

/* --- MODALLAR --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 410px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  animation: fadeScaleIn 0.22s var(--ease-spring);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 {
  font-size: 16.5px;
  font-weight: 630;
}

.info-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.tile-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tile-row code {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-bright);
}

.outgoing-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.metric-value {
  font-size: 15px;
  font-weight: 650;
}
.metric-value.ok {
  color: var(--online);
}
.metric-card small {
  font-size: 10.8px;
  color: var(--text-tertiary);
}

.guide-body ol {
  padding-left: 18px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 5, 7, 0.96);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  border-bottom: 1px solid var(--border);
}
.lightbox-name {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.lightbox-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}
.lightbox-stage img, .lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

/* Toast */
.toast-stack {
  position: fixed;
  top: calc(16px + var(--safe-top));
  right: 16px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  animation: fadeScaleIn 0.2s var(--ease-spring);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.mobile-only {
  display: none;
}

/* --- MOBİL ANİMASYONLU GEÇİŞ --- */
@media (max-width: 859px) {
  .app-shell {
    display: block;
    position: relative;
    overflow: hidden;
  }

  .mobile-only {
    display: inline-flex;
  }

  .sidebar {
    position: absolute;
    inset: 0;
    width: 100%;
    transition: transform 0.32s var(--ease-spring), opacity 0.32s ease;
    transform: translateX(0);
  }

  .chat-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    z-index: 10;
    transition: transform 0.32s var(--ease-spring);
    transform: translateX(100%);
  }

  .app-shell.mobile-chat-open .sidebar {
    transform: translateX(-24%);
    opacity: 0.45;
  }

  .app-shell.mobile-chat-open .chat-pane {
    transform: translateX(0);
  }

  .msg-row {
    max-width: 84%;
  }

  .camera-dialog {
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    border: none;
  }
}
