/* =========================================================
   Codik - Instagram tarzi mesajlasma arayuzu
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Instagram tasarim tokenlari (ornek: İnstaCodeCtrlShiftI.html) */
:root {
  --bg: #ffffff;                 /* --ig-primary-background */
  --panel: #ffffff;              /* --ig-elevated-background */
  --fg: #0c1014;                 /* --ig-primary-text */
  --muted: #6a717a;              /* --ig-secondary-text */
  --line: #dbdfe4;               /* --ig-separator */
  --hover: #f3f5f7;              /* --ig-secondary-background */
  --bubble-in: #f3f5f7;          /* --ig-incoming-message-bubble */
  --bubble-in-fg: #0c1014;
  --brand: #4a5df9;              /* --ig-primary-button */
  --brand-hover: #4150f7;        /* --ig-primary-button-hover */
  --sent: #4a5df9;               /* --ig-outgoing-message-bubble */
  --icon: #8e8e8e;               /* --ig-secondary-icon */
  --badge: #ff3040;              /* --ig-badge */
  --online: #1cd14f;             /* --ig-close-friends-refreshed */
  --danger: #ed4956;             /* --ig-error-or-destructive */
  --input-radius: 12px;          /* --ig-input-border-radius */
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  --rail-w: 74px;
  --side-w: 360px;
}

[data-theme='dark'] {
  --bg: #0c1014;                 /* koyu: --ig-primary-background */
  --panel: #0c1014;
  --fg: #f8f9f9;                 /* koyu: --ig-primary-text */
  --muted: #a2aab4;              /* koyu: --ig-secondary-text */
  --line: #2b3036;               /* koyu: --ig-separator */
  --hover: #25292e;              /* koyu: --ig-secondary-background */
  --bubble-in: #25292e;          /* koyu: incoming bubble */
  --bubble-in-fg: #f8f9f9;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(0, 149, 246, 0.25);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- Ortak parcalar ---------------- */

mark {
  background: rgba(74, 93, 249, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover {
  background: var(--brand-hover);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--panel);
}
.btn-ghost:hover {
  background: var(--hover);
}

.btn-danger {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
  width: 100%;
}
.btn-danger:hover {
  background: var(--hover);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: var(--fg);
  transition: background 0.15s, transform 0.1s;
  flex: 0 0 auto;
}
.icon-btn:hover {
  background: var(--hover);
}
.icon-btn:active {
  transform: scale(0.94);
}

.avatar {
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  user-select: none;
  flex: 0 0 auto;
  line-height: 1;
  overflow: hidden;
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--badge);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--panel);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #262626;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
[data-theme='dark'] .toast {
  background: #f5f5f5;
  color: #000;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

.spin {
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   Giris / Kayit ekrani
   ========================================================= */

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(0, 149, 246, 0.09), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(225, 48, 108, 0.08), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 26px;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.auth-word {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-tag {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--hover);
  border-radius: 10px;
  padding: 4px;
  margin-top: 22px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus {
  border-color: var(--brand);
}
.field input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.auth-submit {
  margin-top: 4px;
  padding: 12px;
}

.auth-error {
  margin-top: 14px;
  background: rgba(237, 73, 86, 0.1);
  border: 1px solid rgba(237, 73, 86, 0.35);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
}

.auth-demo {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.auth-demo b {
  color: var(--fg);
  font-weight: 600;
}

/* =========================================================
   Uygulama duzeni
   ========================================================= */

.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------- Sol ray ---------------- */

.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 0 18px;
  z-index: 30;
}

.rail-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
  margin-bottom: 12px;
}

.rail-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--fg);
  transition: background 0.15s, transform 0.1s;
}
.rail-btn:hover {
  background: var(--hover);
}
.rail-btn:active {
  transform: scale(0.94);
}
.rail-btn.active {
  background: var(--hover);
}
.rail-btn.active svg {
  stroke-width: 2.2;
}

.rail-spacer {
  flex: 1;
}

.rail-avatar {
  margin-top: 10px;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 20;
}

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

.sidebar-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.search-box {
  margin: 4px 12px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--hover);
  border-radius: 12px;
  padding: 10px 13px;
  color: var(--muted);
  transition: box-shadow 0.15s;
}
.search-box:focus-within {
  box-shadow: 0 0 0 2px rgba(0, 149, 246, 0.35);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
  color: var(--fg);
}
.search-box input::placeholder {
  color: var(--muted);
}

.search-clear {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--muted);
  color: var(--panel);
}
.search-clear:hover {
  opacity: 0.8;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 12px;
}

.list-section {
  padding-top: 4px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 16px 6px;
  text-transform: none;
}

/* ---------------- Konusma satiri ---------------- */

.conv {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin: 1px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.conv:hover,
.conv.active {
  background: var(--hover);
}

.conv-avatar {
  position: relative;
  flex: 0 0 auto;
}

.online-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--online);
  border: 2.5px solid var(--panel);
}

.conv-main {
  flex: 1;
  min-width: 0;
}

.conv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

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

.conv-time {
  font-size: 12px;
  color: var(--muted);
  flex: 0 0 auto;
}
.conv.unread .conv-time {
  color: var(--brand);
}

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

.conv-preview {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv.unread .conv-preview {
  color: var(--fg);
  font-weight: 600;
}
.conv-preview.typing {
  color: var(--brand);
  font-weight: 600;
}

.conv-unread {
  flex: 0 0 auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Arama sonuclari (kisiler / mesajlar) */

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin: 1px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.person:hover {
  background: var(--hover);
}

.person-main {
  flex: 1;
  min-width: 0;
}
.person-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.person-action {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

.msg-hit {
  align-items: flex-start;
}
.msg-hit .person-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.list-empty {
  text-align: center;
  color: var(--muted);
  padding: 34px 20px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.list-empty-ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--fg);
  display: grid;
  place-items: center;
  color: var(--fg);
}

/* =========================================================
   Sohbet alani
   ========================================================= */

.chat {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Bos durum */

.chat-empty {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
}

.chat-empty-circle {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  border: 2px solid var(--fg);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}

.chat-empty h2 {
  font-size: 20px;
  font-weight: 700;
}

.chat-empty p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 10px;
}

/* Aktif sohbet */

.chat-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  z-index: 5;
}

.chat-back {
  display: none;
}

.chat-head-user {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.chat-head-text {
  min-width: 0;
}

.chat-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}
.chat-status.online {
  color: var(--brand);
}
.chat-status.typing {
  color: var(--brand);
  font-weight: 600;
}

.chat-head-actions {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

/* Mesaj govdesi */

.chat-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px 18px 10px;
  display: flex;
  flex-direction: column;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
}

.day-divider {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--hover);
  border: 1px solid var(--line);
  padding: 4px 13px;
  border-radius: 14px;
  margin: 14px 0 8px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: 72%;
}
.msg-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-row.same {
  margin-top: -1px;
}

.msg-avatar {
  width: 28px;
  flex: 0 0 28px;
  display: flex;
  align-items: flex-end;
}

/* Kendi mesajlarinda avatar yok (Instagram ile ayni) */
.msg-row.mine .msg-avatar {
  display: none;
}

.msg-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.msg-row.mine .msg-col {
  align-items: flex-end;
}

.bubble {
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 14.5px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bubble-in);
  color: var(--bubble-in-fg);
}

/* Yeni mesaj giris animasyonu (Instagram easing) */
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
}
.msg-enter {
  animation: msg-in 0.24s cubic-bezier(0.17, 0.17, 0, 1) both;
}
.msg-enter .msg-meta {
  animation: msg-in 0.34s cubic-bezier(0.17, 0.17, 0, 1) 0.06s both;
}

/* Ek icerik (foto / dosya) */
.bubble.has-media {
  padding: 4px;
  overflow: hidden;
  background: transparent !important;
  border-radius: 22px;
}
.bubble.has-media .msg-image {
  display: block;
  max-width: 260px;
  width: 100%;
  border-radius: 20px;
  background: var(--bubble-in);
  cursor: pointer;
}
.bubble.has-media + .msg-meta {
  padding-left: 6px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
  max-width: 280px;
  padding: 12px 14px;
  background: var(--bubble-in);
  color: var(--bubble-in-fg);
  border-radius: 20px;
  text-decoration: none;
}
.msg-row.mine .file-card {
  background: var(--sent);
  color: #fff;
}
.file-card-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(74, 93, 249, 0.14);
  color: var(--brand);
}
.msg-row.mine .file-card-ico {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.file-card-main {
  min-width: 0;
  flex: 1;
}
.file-card-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-size {
  font-size: 11.5px;
  opacity: 0.75;
  margin-top: 2px;
}
.file-card-dl {
  flex: 0 0 auto;
  opacity: 0.85;
}

.msg-row.mine .bubble {
  background: var(--sent);       /* --ig-outgoing-message-bubble */
  color: #fff;
  border-bottom-right-radius: 7px;
}
.msg-row:not(.mine) .bubble {
  border-bottom-left-radius: 7px;
}
.msg-row.same:not(.mine) .bubble {
  border-bottom-left-radius: 20px;
}
.msg-row.same.mine .bubble {
  border-bottom-right-radius: 20px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  padding: 0 4px;
}

.tick {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}
.msg-row.mine .tick {
  color: rgba(255, 255, 255, 0.75);
}
.tick.pending {
  opacity: 0.5;
}

.msg-failed {
  color: var(--danger);
  font-weight: 600;
  cursor: pointer;
}

.msg-highlight .bubble {
  box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.55);
}

/* Yukleniyor balonu */

.loading-row {
  align-self: center;
  margin: auto;
  color: var(--muted);
}

/* Yazi yaziyor... */

.typing-bubble {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 13px 16px;
}
.typing-bubble i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-dot 1.2s infinite ease-in-out;
}
.typing-bubble i:nth-child(2) {
  animation-delay: 0.18s;
}
.typing-bubble i:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes typing-dot {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Yazi alani */

.composer-area {
  position: relative;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.attach-menu {
  position: absolute;
  left: 14px;
  bottom: calc(100% + 10px);
  width: 250px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 20;
  animation: menu-in 0.16s cubic-bezier(0.17, 0.17, 0, 1);
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}
.attach-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.12s;
}
.attach-menu button:hover {
  background: var(--hover);
}
.attach-menu button span {
  color: var(--brand);
}
.attach-hint {
  font-size: 11.5px;
  color: var(--muted);
  padding: 8px 12px 4px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.attach-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  animation: menu-in 0.18s cubic-bezier(0.17, 0.17, 0, 1);
}
.attach-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--brand);
}
.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.attach-info {
  flex: 1;
  min-width: 0;
}
.attach-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-size {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.attach-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--fg);
  flex: 0 0 auto;
}
.attach-remove:hover {
  opacity: 0.75;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  background: transparent;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: none;
  background: var(--hover);
  border-radius: 22px;
  padding: 11px 16px;
  font-size: 14.5px;
  line-height: 1.4;
  max-height: 132px;
  overflow-y: auto;
}
.composer textarea::placeholder {
  color: var(--muted);
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  transition: transform 0.12s, background 0.15s;
  flex: 0 0 auto;
}
.send-btn:hover {
  background: var(--brand-hover);
}
.send-btn:active {
  transform: scale(0.92);
}

/* Bilgi paneli */

.info-panel {
  /* fixed: konusma kapaliyken (mobil liste ekraninda) da gorunur kalisir */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 330px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 40;
  display: flex;
  flex-direction: column;
  animation: slide-left 0.18s ease;
}
@keyframes slide-left {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
}

.info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.info-head h3 {
  font-size: 15px;
  font-weight: 700;
}

.info-body {
  padding: 26px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.info-name {
  font-size: 19px;
  font-weight: 800;
  margin-top: 12px;
}
.info-username {
  font-size: 14px;
  color: var(--muted);
}
.info-bio {
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
  color: var(--fg);
}
.info-since {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.info-actions {
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================================================
   Toast + yukleniyor
   ========================================================= */

.initial-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--brand);
  z-index: 300;
}

/* =========================================================
   Duyarli (mobil)
   ========================================================= */

@media (max-width: 1080px) {
  :root {
    --side-w: 320px;
  }
}

@media (max-width: 820px) {
  .rail {
    width: 64px;
    flex-basis: 64px;
  }

  .chat-back {
    display: inline-grid;
  }

  /* Mobilde liste tam ekran, sohbet uzerden kayar */
  .sidebar {
    flex: 1;
    width: auto;
    border-right: 0;
  }

  .chat {
    position: absolute;
    inset: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    background: var(--bg);
  }
  .app.chat-open .chat {
    transform: translateX(0);
  }

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

  .info-panel {
    width: 100%;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .rail {
    display: none;
  }
  .sidebar {
    flex: 1;
  }
  .sidebar-title {
    font-size: 21px;
  }
  .chat-body {
    padding: 14px 12px 8px;
  }
  .composer {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  }
}

/* =========================================================
   Yanit / tepki / mesaj menu / resim goruntuleyici / profil
   ========================================================= */

/* Yanit cubugu */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  animation: menu-in 0.16s cubic-bezier(0.17, 0.17, 0, 1);
}
.reply-bar-ico {
  color: var(--brand);
  flex: 0 0 auto;
}
.reply-bar-main {
  flex: 1;
  min-width: 0;
  border-left: 3px solid var(--brand);
  padding-left: 10px;
}
.reply-bar-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
}
.reply-bar-text {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Mesaj islem menusu */
.msg-menu {
  position: fixed;
  z-index: 150;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 7px;
  box-shadow: var(--shadow);
  animation: menu-in 0.14s cubic-bezier(0.17, 0.17, 0, 1);
}
.msg-menu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.msg-menu button:hover {
  background: var(--hover);
}
.msg-menu button.danger {
  color: var(--danger);
}
.msg-menu-reactions {
  display: flex;
  gap: 4px;
  padding: 6px 7px 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}
.react-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 0.12s, color 0.12s, background 0.12s;
}
.react-btn:hover {
  background: var(--hover);
  transform: scale(1.14);
}
.react-btn[data-key='heart']:hover { color: #ff3040; }
.react-btn[data-key='thumbsup']:hover { color: #4a5df9; }
.react-btn[data-key='star']:hover { color: #f5a623; }
.react-btn[data-key='fire']:hover { color: #ff6b35; }

/* Mesaj satirinda ac butonu */
.msg-row {
  position: relative;
}
.msg-actions {
  position: absolute;
  top: 1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 2;
}
.msg-row:not(.mine) .msg-actions {
  left: 33px;
}
.msg-row.mine .msg-actions {
  right: 1px;
}
.msg-row:hover .msg-actions,
.msg-actions:focus-visible {
  opacity: 1;
}
.msg-actions:hover {
  color: var(--fg);
  background: var(--hover);
}

/* Alinti (mesaj yaniti) */
.reply-quote {
  display: block;
  background: rgba(255, 255, 255, 0.16);
  border-left: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 7px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  max-width: 300px;
}
.msg-row:not(.mine) .reply-quote {
  background: rgba(74, 93, 249, 0.1);
  border-left-color: var(--brand);
}
.reply-quote-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.msg-row:not(.mine) .reply-quote-name {
  color: var(--brand);
}
.reply-quote-text {
  font-size: 12.5px;
  opacity: 0.85;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bubble.has-reply {
  padding-top: 8px;
}

/* Tepki rozeti */
.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: -6px;
  margin-left: 10px;
  padding: 3px 8px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  position: relative;
  z-index: 1;
  cursor: pointer;
  animation: msg-in 0.2s cubic-bezier(0.17, 0.17, 0, 1);
}
.msg-row.mine .reaction-badge {
  align-self: flex-end;
  margin-right: 10px;
}
.reaction-badge[data-key='heart'] { color: #ff3040; }
.reaction-badge[data-key='thumbsup'] { color: #4a5df9; }
.reaction-badge[data-key='star'] { color: #f5a623; }
.reaction-badge[data-key='fire'] { color: #ff6b35; }

/* Kalp animasyonu (cift tiklama) */
@keyframes heart-pop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.heart-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  color: #ff3040;
  pointer-events: none;
  z-index: 3;
  animation: heart-pop 0.5s cubic-bezier(0.17, 0.17, 0, 1) both;
}

/* Resim goruntuleyici */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
}
.lightbox-top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  color: #fff;
}
.lightbox-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 8px;
}
.lightbox-top .icon-btn {
  color: #fff;
}
.lightbox-top .icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px 20px 34px;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  animation: msg-in 0.22s cubic-bezier(0.17, 0.17, 0, 1);
  user-select: none;
}

/* Profil duzenleme formu */
.profile-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.profile-photo-btn {
  cursor: pointer;
  display: inline-block;
}
.profile-form textarea {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--input-radius);
  padding: 10px 13px;
  font-size: 14.5px;
  outline: none;
  resize: none;
  font-family: inherit;
}
.profile-form textarea:focus {
  border-color: var(--brand);
}
.profile-error {
  background: rgba(237, 73, 86, 0.1);
  border: 1px solid rgba(237, 73, 86, 0.35);
  color: var(--danger);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
}
.profile-actions {
  display: flex;
  gap: 10px;
}
.profile-actions .btn-primary {
  flex: 1;
}
.profile-actions .btn-ghost {
  flex: 0 0 auto;
  padding: 10px 16px;
}

/* Avatar gorsel */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dokunmatik ekranda mesaj islem butonu hep gorunur */
@media (hover: none) {
  .msg-actions {
    opacity: 0.6;
  }
}

.msg-image {
  cursor: zoom-in;
}

/* =========================================================
   Dogrulanmis rozet / hesap tipi / kurumsal e-posta
   ========================================================= */

.vbadge {
  display: inline-flex;
  align-items: center;
  vertical-align: -2px;
  flex: 0 0 auto;
  color: #0095f6;
}
.vbadge svg {
  display: block;
}

.acc-type {
  display: flex;
  gap: 8px;
  width: 100%;
}
.acc-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--input-radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.acc-opt:hover {
  background: var(--hover);
  color: var(--fg);
}
.acc-opt.active {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(74, 93, 249, 0.1);
}
.acc-opt-ico {
  display: inline-flex;
}
.auth-form .acc-type {
  margin-bottom: 3px;
}

.profile-wrap {
  display: flex;
  flex-direction: column;
}

.account-box {
  display: flex;
  flex-direction: column;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--bg);
}
.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.account-label {
  font-size: 13px;
  font-weight: 700;
}
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  color: #0095f6;
  background: rgba(0, 149, 246, 0.12);
  border: 1px solid rgba(0, 149, 246, 0.32);
  padding: 3px 9px;
  border-radius: 20px;
}
.account-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.email-panel {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.email-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.email-title {
  font-size: 13.5px;
  font-weight: 700;
}
.email-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--hover);
  padding: 3px 9px;
  border-radius: 20px;
}
.email-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.email-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 600;
}
.email-addr {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--danger);
  flex: 0 0 auto;
}
.email-del:hover {
  background: rgba(237, 73, 86, 0.14);
}
.email-empty {
  font-size: 13px;
  color: var(--muted);
}
.email-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.email-add input {
  flex: 1 1 68px;
  min-width: 60px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--input-radius);
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
}
.email-add input:focus {
  border-color: var(--brand);
}
.email-at,
.email-suffix {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
}
.email-add .btn-primary {
  flex: 0 0 auto;
  padding: 9px 15px;
}
.email-preview {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  word-break: break-all;
  min-height: 18px;
}
.email-error {
  background: rgba(237, 73, 86, 0.1);
  border: 1px solid rgba(237, 73, 86, 0.35);
  color: var(--danger);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
}
.email-hint {
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================
   Hikayeler (stories)
   ========================================================= */

.story-section {
  padding-top: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.story-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 4px;
  scrollbar-width: none;
}
.story-bar::-webkit-scrollbar {
  display: none;
}
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 66px;
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0;
}
.story-ring {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(from 200deg, #f9ce34, #ee2a7b 45%, #6228d7 90%, #f9ce34);
  display: grid;
  place-items: center;
}
.story-ring.seen {
  background: var(--line);
}
.story-in {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.5px solid var(--panel);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel);
}
.story-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-item.add .story-ring {
  background: var(--line);
}
.story-item.add .story-in {
  background: var(--bg);
  color: var(--brand);
  border-style: dashed;
}
.story-add-plus {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--panel);
  display: grid;
  place-items: center;
}
.story-label {
  font-size: 11px;
  color: var(--muted);
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-priority {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 800;
  color: #ffd166;
  background: #241a05;
  border: 1px solid rgba(255, 209, 102, 0.5);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 2;
}

/* Hikaye goruntuleyici */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #07090c;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fade-in 0.16s ease;
}
.story-bars {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  width: min(430px, 86vw);
  z-index: 3;
}
.story-bars .seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.26);
  overflow: hidden;
}
.story-bars .seg i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}
.story-bars .seg.done i {
  width: 100%;
}
.story-bars .seg.active i {
  animation: story-fill 5s linear forwards;
}
@keyframes story-fill {
  from { width: 0; }
  to { width: 100%; }
}
.story-head {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(430px, 92vw);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
  color: #fff;
}
.story-user {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.story-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #2a2f36;
  flex: 0 0 auto;
}
.story-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.story-time {
  font-size: 12px;
  opacity: 0.7;
}
.story-head .icon-btn {
  color: #fff;
}
.story-head .icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.story-stage {
  flex: 1;
  min-height: 0;
  width: min(430px, 100vw);
  display: grid;
  place-items: center;
  padding: 76px 14px 34px;
}
.story-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  animation: msg-in 0.22s cubic-bezier(0.17, 0.17, 0, 1);
}
.story-text {
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  text-align: center;
  padding: 26px;
  line-height: 1.42;
  word-break: break-word;
}
.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 4;
}
.story-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}
.story-prev { left: 14px; }
.story-next { right: 14px; }

/* Hikaye paylas */
.story-create {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fade-in 0.16s ease;
}
.story-create-box,
.reels-create-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 13px;
  box-shadow: var(--shadow);
}
.story-create-box h4,
.reels-create-box h4 {
  font-size: 15.5px;
  font-weight: 800;
}
.story-create-box textarea {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--input-radius);
  padding: 10px 13px;
  font-size: 14.5px;
  font-family: inherit;
  resize: none;
  outline: none;
}
.story-create-box textarea:focus {
  border-color: var(--brand);
}
.story-create-actions,
.reels-create-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.story-create-actions .btn-primary,
.reels-create-actions .btn-primary {
  flex: 1;
}
.story-create-actions .btn-ghost,
.reels-create-actions .btn-ghost {
  padding: 10px 14px;
}

/* Reels video onizleme */
.reel-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  max-height: 240px;
  display: flex;
  justify-content: center;
}
.reel-preview video {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  background: #000;
}
.reel-preview-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.reel-preview-x:hover {
  background: rgba(0, 0, 0, 0.85);
}
.reel-preview-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.66);
  padding: 3px 9px;
  border-radius: 20px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reel-hint {
  font-size: 12px;
  opacity: 0.6;
  text-align: center;
  margin: 0;
}

/* =========================================================
   Reels
   ========================================================= */

.reels-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: fade-in 0.16s ease;
}
.reels-top {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  box-sizing: border-box;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: 0 0 auto;
}
.reels-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}
.reels-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: #000;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.reels-feed::-webkit-scrollbar {
  display: none;
}
/* YouTube Shorts tarzi: dikey, tam ekran kart */
.reel {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  height: calc(100dvh - 56px);
  width: calc((100dvh - 56px) * 0.5625);
  max-width: 100vw;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
  animation: msg-in 0.24s cubic-bezier(0.17, 0.17, 0, 1);
}
.reel-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #171b20;
}
.reel-video {
  background: #000;
  cursor: pointer;
}
.reel-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 56px 74px 20px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.reel-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.reel-author .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.reel-priority {
  font-size: 10.5px;
  font-weight: 800;
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.55);
  background: rgba(36, 26, 5, 0.7);
  padding: 2px 8px;
  border-radius: 20px;
}
.reel-caption {
  font-size: 13.5px;
  opacity: 0.92;
  line-height: 1.4;
  word-break: break-word;
}
.reel-date {
  font-size: 11.5px;
  opacity: 0.65;
}
.reel-actions {
  position: absolute;
  right: 8px;
  bottom: 104px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  z-index: 2;
}
.reel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.reel-btn.on {
  color: #ff3040;
}
.reel-btn:hover {
  opacity: 0.85;
}
.reels-empty {
  position: absolute;
  inset: 0;
  top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.reels-create {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 6;
}

/* =========================================================
   Profil foto duzenleyici (kirp / dondur / yakinlastir)
   ========================================================= */

.avatar-editor {
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.74);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fade-in 0.16s ease;
}
.avatar-editor-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}
.avatar-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.avatar-editor-head h4 {
  font-size: 15.5px;
  font-weight: 800;
}
.av-stage {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  cursor: grab;
  touch-action: none;
}
.av-stage.dragging {
  cursor: grabbing;
}
.av-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.av-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  background-position: -1px -1px;
  opacity: 0.55;
}
.av-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.av-controls input[type='range'] {
  flex: 1;
  accent-color: var(--brand);
}
.av-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* Rozet ve hikaye detaylari */
.vbadge {
  margin-left: 3px;
}
.info-name .vbadge,
.chat-name .vbadge {
  margin-left: 4px;
}
.story-in .avatar {
  width: 100% !important;
  height: 100% !important;
  font-size: 17px !important;
}
.story-ring.seen .story-in .avatar {
  opacity: 0.85;
}
.conv-name .vbadge {
  flex: 0 0 auto;
}

/* =========================================================
   Hikaye duzenleyici (filtre + yazi + muzik)
   ========================================================= */

.story-editor {
  position: fixed;
  inset: 0;
  z-index: 330;
  background: #07090c;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.16s ease;
}
.se-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.se-top .se-close {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.se-tools {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.se-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.se-tool:hover {
  background: rgba(255, 255, 255, 0.16);
}
.se-tool.active {
  background: rgba(74, 93, 249, 0.24);
  border-color: var(--brand);
  color: #fff;
}
.se-share {
  padding: 9px 16px;
}
.se-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
}
.se-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  touch-action: none;
  cursor: grab;
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.55);
  background: #101317;
}
.se-stage canvas.dragging {
  cursor: grabbing;
}
.se-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 13px;
  border-radius: 20px;
  pointer-events: none;
}

/* paneller */
.se-panel {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 13px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 47vh;
  overflow-y: auto;
}
.se-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.se-row-end {
  justify-content: flex-end;
}
.se-row-last .se-align {
  margin-right: auto;
}
.se-input,
.se-select {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--input-radius);
  padding: 9px 12px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.se-input:focus,
.se-select:focus {
  border-color: var(--brand);
}
.se-input {
  flex: 1;
}
.se-ctl {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.se-ctl-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.se-ctl-label b {
  color: var(--brand);
}
.se-ctl input[type='range'] {
  width: 100%;
  accent-color: var(--brand);
}
.se-color {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.se-color input[type='color'] {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
}
.se-align {
  display: flex;
  gap: 5px;
}
.se-align-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}
.se-align-btn.active {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(74, 93, 249, 0.12);
}
.se-danger {
  color: var(--danger);
}
.se-danger:hover {
  background: rgba(237, 73, 86, 0.12);
}
.se-panel .btn-primary,
.se-panel .btn-ghost {
  padding: 9px 16px;
}

/* filtre secici */
.se-filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.se-filters::-webkit-scrollbar {
  display: none;
}
.se-fchip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  width: 76px;
}
.se-fchip img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--hover);
}
.se-fchip span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.se-fchip.active img {
  border-color: var(--brand);
}
.se-fchip.active span {
  color: var(--brand);
}

/* muzik arama */
.se-music-search {
  display: flex;
  gap: 8px;
}
.se-music-now {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--brand);
  background: rgba(74, 93, 249, 0.1);
  border-radius: 12px;
}
.se-music-now img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--hover);
}
.se-music-now .sn-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.se-music-now .sn-meta b {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.se-music-now .sn-meta span {
  font-size: 12px;
  color: var(--muted);
}
.se-music-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 30vh;
}
.sm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  text-align: left;
}
.sm-item:hover {
  background: var(--hover);
}
.sm-item.active {
  border-color: var(--brand);
  background: rgba(74, 93, 249, 0.1);
}
.sm-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--hover);
  flex: 0 0 auto;
}
.sm-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sm-meta b {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-meta span {
  font-size: 12px;
  color: var(--muted);
}
.sm-play {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hover);
  color: var(--fg);
}
.sm-item.active .sm-play,
.sm-play.on {
  background: var(--brand);
  color: #fff;
}
.sm-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}
.se-music-error {
  background: rgba(237, 73, 86, 0.1);
  border: 1px solid rgba(237, 73, 86, 0.35);
  color: var(--danger);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
}
.se-music-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 14px;
}

/* goruntuleyicide muzik etiketi */
.story-music {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 26px;
  width: min(430px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 3;
  color: #fff;
}
.story-music img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  background: #2a2f36;
  flex: 0 0 auto;
}
.story-music .smm-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.story-music .smm-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
}
.story-music .smm-track {
  display: inline-block;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 700;
  padding-left: 100%;
  animation: smm-marquee 11s linear infinite;
}
@keyframes smm-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.story-music .smm-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.story-music .smm-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.se-music-loading svg {
  animation: spin 0.85s linear infinite;
  color: var(--brand);
}
.se-music-loading {
  gap: 9px;
}
