/* Zukan's Speak — liquid glass sohbet arayüzü
   Tasarım dili ana sayfa (index.html) ile aynı: acit/mint/ice renkler,
   cam paneller, imleç ışığı, grain. Büyük yüzeylerde opacity+gradient
   kullanılır (animasyonlu canvas üzerinde backdrop-filter pahalıdır);
   küçük yüzen parçalarda gerçek blur vardır. */
:root {
  color-scheme: dark;
  --ink: #f5f6f2;
  --muted: #a7aca6;
  --line: rgba(255, 255, 255, .14);
  --acid: #d4ff62;
  --ice: #bfe9ff;
  --mint: #7fe3cd;
  --gold: #ffd479;
  --ease: cubic-bezier(.2, .9, .25, 1);
  --radius: 26px;
  --topbar-height: 62px;
  --mobilebar-height: 50px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #071012;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .13em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: rgba(212, 255, 98, .3); }

/* ---------- arka plan ---------- */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -4; }
.ambient { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.blob.b1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: radial-gradient(circle, rgba(127, 227, 205, .16), transparent 65%); animation: drift 26s ease-in-out infinite alternate; }
.blob.b2 { width: 40vw; height: 40vw; right: -10vw; top: 22vh; background: radial-gradient(circle, rgba(212, 255, 98, .1), transparent 65%); animation: drift 32s ease-in-out infinite alternate-reverse; }
.blob.b3 { width: 34vw; height: 34vw; left: 30vw; bottom: -18vw; background: radial-gradient(circle, rgba(191, 233, 255, .1), transparent 65%); animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(4vw, -3vh) scale(1.08); } }
.wash { position: fixed; inset: 0; z-index: -2; background: radial-gradient(ellipse at 70% 10%, transparent 0 20%, rgba(7, 16, 18, .25) 65%), linear-gradient(180deg, rgba(3, 10, 12, .1), #071012 92%); pointer-events: none; }
.grain { position: fixed; inset: 0; z-index: -1; opacity: .05; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60; background: linear-gradient(90deg, var(--acid), var(--ice)); box-shadow: 0 0 12px rgba(212, 255, 98, .5); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* ---------- sıvı cam ---------- */
.glass {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .05)),
    linear-gradient(150deg, rgba(23, 30, 32, .86), rgba(11, 17, 19, .78));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px rgba(255, 255, 255, .16), inset 0 -1px rgba(255, 255, 255, .03), 0 30px 80px rgba(0, 0, 0, .32);
  border-radius: var(--radius);
}
/* camın üst kenarındaki ışık çizgisi */
.glass::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35) 30%, rgba(212, 255, 98, .25) 50%, rgba(255, 255, 255, .35) 70%, transparent);
  pointer-events: none;
}
/* İmleç efekti yok: kartlar fareyi takip eden parlama göstermez. */
.card-glow { overflow: hidden; }

/* ---------- üst nav ---------- */
.topnav {
  height: var(--topbar-height); flex: 0 0 var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 12px 16px 0; padding: 0 16px;
  border-radius: 20px; z-index: 20;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
.logo:hover { text-decoration: none; }
.logo i { position: relative; display: block; width: 20px; height: 20px; border: 1px solid var(--acid); border-radius: 7px 11px 7px 11px; transform: rotate(20deg); transition: transform .7s var(--ease), box-shadow .5s var(--ease); }
.logo i::after { content: ""; position: absolute; width: 5px; height: 5px; top: 4px; right: 3px; background: var(--acid); border-radius: 50%; transition: transform .5s var(--ease); }
.logo:hover i { transform: rotate(205deg); box-shadow: 0 0 22px rgba(212, 255, 98, .35); }
.logo:hover i::after { transform: scale(1.5); }
.logo-divider { color: var(--muted); font-weight: 600; }
.logo strong { color: var(--acid); }
.topnav nav { display: flex; align-items: center; gap: 16px; }
.topnav nav a { position: relative; color: var(--muted); font-size: 13px; transition: color .3s var(--ease); }
.topnav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--acid); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.topnav nav a:hover { color: var(--ink); }
.topnav nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 200px; padding: 7px 13px; border: 1px solid rgba(212, 255, 98, .35); border-radius: 100px; background: rgba(212, 255, 98, .06); color: var(--ink); font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease); }
.user-chip:hover { background: rgba(212, 255, 98, .13); border-color: var(--acid); transform: translateY(-1px); }
.user-chip-ava { display: grid; flex: 0 0 20px; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--acid); font-size: 9px; font-weight: 800; overflow: hidden; text-transform: uppercase; }
.user-chip-ava img { width: 100%; height: 100%; object-fit: cover; }
.user-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-bar { display: none; }

/* ---------- üç sütun ---------- */
.speak-app { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(250px, 292px) minmax(0, 1fr) minmax(216px, 258px); gap: 16px; padding: 14px 16px 16px; }
.sidebar, .rightbar { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.sidebar { padding: 18px 14px 12px; }
.sidebar-head { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.brand-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; letter-spacing: -.035em; }
.beta-badge { padding: 2px 7px; border-radius: 20px; background: var(--acid); color: #0b1411; font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.brand-sub { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.brand-sub b { color: var(--mint); }

/* arama */
.search-wrap { padding: 12px 0 9px; }
.search-wrap input { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 13px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.search-wrap input::placeholder { color: #7d8783; }
.search-wrap input:focus { border-color: rgba(212, 255, 98, .5); box-shadow: 0 0 0 3px rgba(212, 255, 98, .08); }

.sidebar-actions { display: flex; gap: 8px; padding-bottom: 10px; }
.sidebar-actions .button { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 9px; }

/* ---------- butonlar ---------- */
.button {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--acid); border-radius: 14px;
  background: var(--acid); color: #111b16;
  padding: 10px 15px; font-weight: 800; font-size: 13px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(212, 255, 98, .12);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease);
}
.button::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .55), transparent 65%);
  transform: translateX(-150%); transition: transform .85s var(--ease);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(212, 255, 98, .22); }
.button:hover::before { transform: translateX(150%); }
.button:active { transform: translateY(0) scale(.98); box-shadow: 0 6px 16px rgba(212, 255, 98, .16); }
.button:disabled { opacity: .55; cursor: wait; }
.button-sm { min-height: 38px; padding: 8px 14px; font-size: 12.5px; }
.button.ghost { background: rgba(255, 255, 255, .06); border-color: var(--line); color: var(--ink); box-shadow: none; }
.button.ghost:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .3); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.button:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .05); color: var(--ink);
  font-size: 12.5px; font-weight: 650; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .1); }
.btn:active { transform: scale(.97); }
.btn:disabled { cursor: wait; opacity: .6; }
.btn-sm { min-height: 31px; padding: 5px 10px; border-radius: 10px; font-size: 11.5px; }
.btn.danger { color: #ff9b9b; border-color: rgba(255, 120, 120, .28); }
.btn.danger:hover { background: rgba(255, 100, 100, .12); }

.icon-btn { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 15px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.icon-btn:hover { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .1); }
.icon-btn:active { transform: scale(.94); }
.icon-btn-xs { flex-basis: 26px; width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }

.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; background: rgba(255, 255, 255, .045); color: var(--muted); font-size: 11.5px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease); }
.chip:hover { color: var(--ink); border-color: rgba(255, 255, 255, .28); }
.chip.active { color: var(--acid); border-color: rgba(212, 255, 98, .38); background: rgba(212, 255, 98, .09); }

/* ---------- oda listesi ---------- */
.room-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 2px 2px 8px; margin: 0 -4px; }
.room-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; margin-bottom: 5px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.room-item:hover { border-color: var(--line); background: rgba(255, 255, 255, .045); transform: translateX(3px); }
.room-item.active { border-color: rgba(212, 255, 98, .34); background: rgba(212, 255, 98, .09); }
.room-ico { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .04); font-size: 16px; overflow: hidden; }
.room-ico.has-photo { padding: 0; background: rgba(255, 255, 255, .08); }
.room-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-item.encrypted .room-ico { border-color: rgba(127, 227, 205, .3); background: rgba(127, 227, 205, .09); }
.room-item.private .room-ico { border-color: rgba(255, 212, 121, .3); background: rgba(255, 212, 121, .09); }
.room-item.hidden .room-ico { border-color: rgba(191, 233, 255, .32); background: rgba(191, 233, 255, .09); }
.room-main { flex: 1; min-width: 0; }
.room-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.room-desc { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.badge { padding: 2px 7px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 10px; }
.badge.lock { color: var(--mint); border-color: rgba(127, 227, 205, .32); }
.badge.unread { color: var(--acid); border-color: rgba(212, 255, 98, .35); }

.sidebar-foot { padding-top: 11px; border-top: 1px solid var(--line); }
.user-card { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .035); }
.user-ava, .member-ava, .msg-avatar { display: grid; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .05); color: var(--acid); font-weight: 800; overflow: hidden; }
.user-ava { width: 34px; height: 34px; font-size: 12px; }
.user-ava img, .member-ava img, .msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-ava.has-photo, .msg-avatar.has-photo { background: rgba(255, 255, 255, .08); border-color: rgba(212, 255, 98, .4); }
.user-info { flex: 1; min-width: 0; }
.user-name { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ana sohbet ---------- */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.room-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  /* Not: tam ekran `filter` pahalı bir yeniden boyama; optimize görünüm için yok. */
  transform: scale(1.03) translateZ(0);
}
.room-bg::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(7, 16, 18, .22) 0%, rgba(7, 16, 18, .38) 48%, rgba(7, 16, 18, .52) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(212, 255, 98, .08), transparent 55%);
}
.main > *:not(.room-bg) { position: relative; z-index: 1; }
.main.has-bg.glass {
  background: rgba(11, 17, 19, .14);
  border-color: rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px rgba(255, 255, 255, .22), 0 30px 80px rgba(0, 0, 0, .38);
}
.main.has-bg .room-header {
  background: rgba(14, 26, 29, .34);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom-color: rgba(255, 255, 255, .16);
}
.main.has-bg .composer {
  background: rgba(14, 26, 29, .32);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-top-color: rgba(255, 255, 255, .16);
}
.main.has-bg .composer textarea {
  background: rgba(255, 255, 255, .08);
}
/* Performans: her mesaj balonunda backdrop-filter, uzun sohbetlerde kare kare
   bulanıklaştırma demek ve kaydırırken kasmaya yol açıyor. Balonlar yarı
   saydam düz renkle aynı cam hissini çok daha ucuza verir; blur yalnızca
   başlık + yazma alanında (tekil öğeler) kalır. */
.main.has-bg .msg-bubble {
  background: rgba(16, 27, 30, .42);
  border-color: rgba(255, 255, 255, .2);
}
.main.has-bg .msg.me .msg-bubble {
  background: rgba(72, 86, 32, .45);
}
.main.has-bg .chat-topfade { background: linear-gradient(180deg, rgba(7, 16, 18, .45), transparent); }
.main.has-bg .attach-card, .main.has-bg .code-block, .main.has-bg .reply-quote {
  background: rgba(8, 14, 16, .42);
}
body.speak-vibrant .sidebar.glass,
body.speak-vibrant .rightbar.glass {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02) 45%, rgba(255, 255, 255, .04)),
    rgba(11, 17, 19, .42);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}
.room-bg-tools { display: flex; flex-direction: column; gap: 8px; }
.room-icon-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.room-icon-tools[hidden] { display: none; }
.room-icon-current { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; }
.room-icon-current .hint { display: block; font-weight: 400; }
.room-icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.room-icon-choice { display: grid; place-items: center; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, .045); font-size: 17px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.room-icon-choice:hover { border-color: rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.room-icon-choice.active { border-color: rgba(212, 255, 98, .55); background: rgba(212, 255, 98, .13); box-shadow: 0 0 0 1px rgba(212, 255, 98, .25); }
.room-icon-choice:disabled { opacity: .5; cursor: wait; transform: none; }
.room-icon-custom { display: flex; gap: 6px; }
.room-icon-custom input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 14px; }
.room-icon-custom input:focus { border-color: rgba(212, 255, 98, .45); }
.room-ico.is-owner { cursor: pointer; }
.room-ico.is-owner:hover { border-color: rgba(212, 255, 98, .5); }
.room-bg-preview {
  width: 100%; height: 72px; border: 1px solid var(--line); border-radius: 12px;
  background-size: cover; background-position: center; background-color: rgba(255, 255, 255, .04);
}
.room-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: rgba(14, 26, 29, .55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.room-header-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.room-ico { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)); font-size: 17px; overflow: hidden; }
.room-heading { min-width: 0; }
.room-header h1 { overflow: hidden; margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.room-header p { overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.e2e-badge { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid rgba(127, 227, 205, .3); border-radius: 20px; background: rgba(127, 227, 205, .1); color: var(--mint); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.e2e-badge.off { border-color: var(--line); background: rgba(255, 255, 255, .045); color: var(--muted); }
.members-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, .045); color: var(--muted); font-size: 11px; white-space: nowrap; }
.members-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 9px var(--acid); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.8); } }

/* ---------- sohbet alanı ---------- */
.chat { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: auto; padding: 18px clamp(12px, 3vw, 30px) 12px; scroll-behavior: smooth; }
#messages { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; }

.day-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0 8px; color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .04em; }
.day-sep::before, .day-sep::after { flex: 1; height: 1px; content: ""; background: linear-gradient(90deg, transparent, var(--line), transparent); }

.msg { position: relative; display: flex; gap: 10px; padding: 5px 8px; border-radius: 14px; animation: msgIn .4s var(--ease) backwards; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.me { justify-content: flex-end; }
.msg-avatar { width: 33px; height: 33px; font-size: 11px; margin-top: 2px; }
.msg-body { max-width: min(72%, 620px); min-width: 0; }
.msg.me .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.msg.me .msg-head { flex-direction: row-reverse; }
.msg-author { font-size: 13px; font-weight: 750; }
.msg-time { color: var(--muted); font-size: 10px; }
.msg-bubble { position: relative; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px 16px 16px 6px; background: linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025)); box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 8px 22px rgba(0, 0, 0, .22); }
.msg.me .msg-bubble { border-radius: 16px 16px 6px 16px; border-color: rgba(212, 255, 98, .3); background: linear-gradient(135deg, rgba(212, 255, 98, .14), rgba(191, 233, 255, .05)); box-shadow: inset 0 1px rgba(255, 255, 255, .16), 0 8px 22px rgba(0, 0, 0, .25); }
.msg-text { color: #e8eeea; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text a { color: var(--ice); text-decoration: underline; text-decoration-color: rgba(191, 233, 255, .35); }
.msg-text code, .code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.msg-text code { padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, .07); font-size: 12px; }
.code-block { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, .3); overflow: auto; font-size: 12px; line-height: 1.55; color: var(--ice); }
.msg-actions { display: flex; gap: 4px; margin-top: 5px; opacity: 0; transition: opacity .2s ease; }
.msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-action { padding: 3px 8px; border-radius: 8px; color: var(--muted); font-size: 10.5px; cursor: pointer; transition: color .2s ease, background .2s ease; }
.msg-action:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
.msg-action.danger:hover { color: #ff9b9b; }

/* yanıt alıntısı */
.reply-quote { display: flex; flex-direction: column; gap: 2px; margin-bottom: 7px; padding: 7px 10px; border-left: 2px solid var(--acid); border-radius: 0 9px 9px 0; background: rgba(212, 255, 98, .06); font-size: 11.5px; }
.reply-quote b { color: var(--acid); font-size: 10.5px; }
.reply-quote span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

/* sistem mesajları */
.system-msg { margin: 9px auto; padding: 7px 13px; border: 1px dashed var(--line); border-radius: 100px; background: rgba(255, 255, 255, .025); color: var(--muted); font-size: 11px; text-align: center; width: fit-content; }

/* ---------- dosya mesajları ---------- */
.attach-card { display: flex; align-items: center; gap: 12px; min-width: 230px; max-width: 340px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .045); }
.attach-ico { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(191, 233, 255, .12), rgba(255, 255, 255, .02)); font-size: 17px; }
.attach-info { flex: 1; min-width: 0; }
.attach-name { overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.attach-meta { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.attach-dl { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(212, 255, 98, .35); border-radius: 10px; background: rgba(212, 255, 98, .1); color: var(--acid); font-size: 14px; cursor: pointer; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.attach-dl:hover { background: rgba(212, 255, 98, .2); transform: translateY(-1px); }
.attach-dl.busy { cursor: wait; opacity: .55; }
.attach-img-wrap { max-width: 100%; }
.attach-img-wrap .attach-img { max-width: min(100%, 340px); aspect-ratio: auto; }
.attach-img-grid { display: grid; gap: 6px; margin-top: 7px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.attach-thumb { width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; }
.attach-img { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .04); aspect-ratio: 4/3; cursor: zoom-in; }
.attach-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.attach-img:hover img { transform: scale(1.04); }
.attach-img.loading { background: linear-gradient(100deg, rgba(255, 255, 255, .05) 20%, rgba(255, 255, 255, .12) 40%, rgba(255, 255, 255, .05) 60%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
.attach-img.loading img { filter: blur(6px); opacity: .4; }
.attach-img.loading img:not([src]), .attach-img.loading img[src=""] { opacity: 0; filter: none; }
.attach-img.broken { cursor: default; }
.attach-img .attach-dl { position: absolute; top: 8px; right: 8px; z-index: 2; width: auto; min-width: 34px; padding: 0 8px; opacity: .92; }
.attach-img-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; max-width: min(100%, 340px); }
.attach-img-cap .attach-name { font-size: 11.5px; }
.attach-img-cap .attach-meta { flex: 0 0 auto; }
.attach-audio { margin-top: 8px; width: 100%; max-width: 300px; height: 34px; border-radius: 10px; }
.attach-note { margin-top: 7px; color: var(--muted); font-size: 10.5px; }

/* ---------- kod mesajları / kod penceresi ---------- */
.code-wrap { display: block; min-width: min(100%, 300px); }
.msg-text .code-wrap { margin: 6px 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px 5px 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: rgba(255, 255, 255, .06); }
.code-head + .code-block { border-radius: 0 0 10px 10px; }
.code-lang { color: var(--mint); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-wrap > .code-lang { display: inline-block; margin-bottom: 4px; }
.code-copy { flex: 0 0 auto; opacity: 1; }
.icon-btn-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; color: var(--mint); }
.code-modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; tab-size: 2; white-space: pre; }
.code-file-btn { align-self: flex-start; cursor: pointer; }
@media (max-width: 560px) { .code-modal-row { grid-template-columns: 1fr; } }

/* ---------- iyimser (optimistic) gönderim durumu ---------- */
.msg.pending .msg-bubble { opacity: .72; }
.msg.failed .msg-bubble { border-color: rgba(255, 110, 110, .55); }
.msg.failed { cursor: pointer; }
.msg-status { margin-top: 4px; color: var(--muted); font-size: 10px; }
.msg.me .msg-status { text-align: right; }
.msg.failed .msg-status { color: #ff9b9b; }

/* ---------- boş durum / hoş geldin ---------- */
.empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.empty h2, .empty h3 { margin: 0 0 9px; color: var(--ink); }
.empty p { margin: 0; font-size: 13px; line-height: 1.65; }
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 560px; min-height: 100%; margin: auto; text-align: center; animation: msgIn .6s var(--ease); }
.welcome .eyebrow { color: var(--acid); margin-bottom: 14px; }
.welcome h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -.05em; }
.welcome p { max-width: 440px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.welcome .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.welcome-orb { position: relative; width: 110px; height: 110px; margin-bottom: 22px; border-radius: 46% 54% 58% 42% / 42% 46% 54% 58%; background: radial-gradient(circle at 35% 25%, #eaffc5 0 4%, transparent 26%), radial-gradient(circle at 58% 42%, #b8dbfa 0 18%, transparent 38%), linear-gradient(145deg, #95c9c8, #213a43 65%, #0d171b); box-shadow: -20px 20px 50px rgba(117, 213, 195, .16), inset -20px -12px 40px #0b161a; animation: float 7s ease-in-out infinite; }
.welcome-specs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }
.spec-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 16px; text-align: left; }
.spec-mini small { color: var(--muted); }
.spec-mini strong { font-size: 14px; }
@keyframes float { 50% { transform: rotate(-8deg) translateY(-10px); } }

/* ---------- en eski mesajlar ---------- */
.chat-topfade { position: sticky; top: 0; z-index: 3; display: flex; justify-content: center; padding: 4px 0 8px; background: linear-gradient(180deg, rgba(7, 16, 18, .9), transparent); }

/* aşağıya kaydır */
.scroll-bottom { position: absolute; right: 22px; bottom: 14px; z-index: 4; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(14, 26, 29, .85); color: var(--ink); font-size: 15px; box-shadow: 0 10px 26px rgba(0, 0, 0, .4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; transition: transform .3s var(--ease), border-color .3s var(--ease); }
.scroll-bottom:hover { transform: translateY(-2px); border-color: rgba(212, 255, 98, .4); }
.scroll-bottom-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 100px; background: var(--acid); color: #111b16; font-size: 10px; font-weight: 800; }

/* ---------- dosya bırakma ---------- */
.drop-overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(7, 16, 18, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 44px; border: 1px dashed rgba(212, 255, 98, .5); border-radius: 22px; text-align: center; }
.drop-ico { font-size: 34px; }
.drop-card strong { font-size: 16px; }
.drop-card span { color: var(--muted); font-size: 12px; }

/* ---------- yazı alanı ---------- */
.composer { flex: 0 0 auto; padding: 11px 14px 9px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: rgba(14, 26, 29, .72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.reply-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding: 7px 8px 7px 12px; border: 1px solid rgba(212, 255, 98, .3); border-radius: 12px; background: rgba(212, 255, 98, .06); animation: msgIn .3s var(--ease); }
.reply-bar-lbl { color: var(--acid); flex: 0 0 auto; }
.reply-quote { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reply-quote b { color: var(--ink); font-size: 11.5px; }
.reply-quote span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.attach-chip { position: relative; display: flex; align-items: center; gap: 8px; max-width: 230px; padding: 7px 9px 7px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .05); animation: msgIn .3s var(--ease); }
.attach-chip.error { border-color: rgba(255, 110, 110, .4); }
.attach-chip-ico { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(191, 233, 255, .1); font-size: 13px; }
.attach-chip-info { min-width: 0; flex: 1; }
.attach-chip-name { overflow: hidden; font-size: 11.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip-meta { color: var(--muted); font-size: 9.5px; }
.attach-chip-x { display: grid; flex: 0 0 20px; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: var(--muted); font-size: 10px; cursor: pointer; }
.attach-chip-x:hover { color: #ff9b9b; background: rgba(255, 100, 100, .12); }
.attach-chip-progress { position: absolute; left: 0; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--acid), var(--ice)); box-shadow: 0 0 8px rgba(212, 255, 98, .6); animation: chipProgress 1.2s ease-in-out infinite; }
@keyframes chipProgress { 0% { width: 8%; } 55% { width: 82%; } 100% { width: 8%; } }

.composer-bar { display: flex; align-items: flex-end; gap: 9px; width: 100%; max-width: 880px; margin: 0 auto; }
.composer textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 140px; resize: none; padding: 10px 13px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 13.5px; line-height: 1.5; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.composer textarea::placeholder { color: #7d8783; }
.composer textarea:focus { border-color: rgba(212, 255, 98, .5); box-shadow: 0 0 0 3px rgba(212, 255, 98, .08); }
.send-btn { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(212, 255, 98, .4); border-radius: 50%; background: linear-gradient(145deg, rgba(212, 255, 98, .95), rgba(127, 227, 205, .85)); color: #111b16; cursor: pointer; box-shadow: 0 6px 18px rgba(212, 255, 98, .18); transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s ease; }
.send-btn:hover { transform: translateY(-2px) rotate(-8deg); box-shadow: 0 10px 26px rgba(212, 255, 98, .3); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { cursor: wait; opacity: .5; }
.composer-foot { display: flex; justify-content: space-between; gap: 12px; max-width: 880px; margin: 7px auto 0; color: var(--muted); font-size: 10px; }

/* ---------- sağ panel ---------- */
.rightbar { padding: 17px 14px; }
.rightbar section { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.rightbar section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.rightbar h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 11px; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.member { display: flex; align-items: center; gap: 9px; padding: 6px 5px; border-radius: 10px; animation: msgIn .4s var(--ease) backwards; }
.member:hover { background: rgba(255, 255, 255, .035); }
.member-ava { width: 28px; height: 28px; font-size: 10px; }
.member-name { font-size: 12px; font-weight: 650; }
.member-role { margin-top: 2px; color: var(--muted); font-size: 10px; }
.room-tools { display: flex; flex-direction: column; gap: 8px; }
.room-tools .btn { width: 100%; }
.room-code-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px dashed rgba(191, 233, 255, .35); border-radius: 12px; background: rgba(191, 233, 255, .06); }
.room-code-box .mono { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; }
.room-code-box code { flex: 1; min-width: 0; overflow: hidden; color: var(--ice); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: .16em; text-overflow: ellipsis; white-space: nowrap; }
.room-code-box .btn { flex: 0 0 auto; width: auto; }
.room-tools .hint, .hint { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

/* ---------- pencereler ---------- */
.overlay { position: fixed; z-index: 50; inset: 0; display: none; place-items: center; overflow: auto; padding: 18px; background: rgba(3, 7, 8, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.overlay.open { display: grid; }
.modal { width: min(560px, 100%); max-height: min(90dvh, 820px); overflow: auto; padding: 19px 20px; border-radius: 22px; animation: modalIn .35s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-narrow { width: min(430px, 100%); }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 13px; }
.modal-head { margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-body { display: flex; flex-direction: column; gap: 13px; }
.modal-foot { justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .room-type-field > legend { padding: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: rgba(255, 255, 255, .05); color: var(--ink); font-size: 13px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.field select option { background: #10201f; color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(212, 255, 98, .5); box-shadow: 0 0 0 3px rgba(212, 255, 98, .08); }
.field textarea { min-height: 66px; resize: vertical; }
.room-type-field { margin: 0; padding: 0; border: 0; }
.room-type-field > legend { margin-bottom: 8px; }
.radio-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 8px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .035); cursor: pointer; transition: border-color .25s var(--ease), background .25s var(--ease); }
.radio input { flex: 0 0 14px; width: 14px; height: 14px; margin: 2px 0 0; accent-color: var(--acid); }
.radio span { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
.radio b { font-size: 12px; line-height: 1.35; }
.radio small { color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 520px) { .radio-group { grid-template-columns: 1fr; } }
.radio.active { border-color: rgba(212, 255, 98, .43); background: rgba(212, 255, 98, .075); }
#typeHint { margin: 8px 0 0; }
#pwReq { color: #ffaaaa; font-size: 11px; }
.remember-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.remember-label input { accent-color: var(--acid); }
.alert { display: none; padding: 10px 12px; border: 1px solid rgba(255, 110, 110, .27); border-radius: 11px; background: rgba(255, 95, 95, .1); color: #ffabab; font-size: 12px; line-height: 1.5; }
.alert.show { display: block; animation: msgIn .3s var(--ease); }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 100; bottom: 20px; left: 50%; max-width: min(92vw, 520px); padding: 11px 17px; transform: translateX(-50%); border: 1px solid rgba(255, 255, 255, .18); border-radius: 100px; background: rgba(16, 28, 32, .9); color: var(--ink); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); font-size: 13px; text-align: center; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: toastIn .35s var(--ease); }
.toast.success { border-color: rgba(212, 255, 98, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }
.load-error { color: #ffabab; }

/* skelet */
.skel { height: 46px; margin-bottom: 6px; border-radius: 14px; background: linear-gradient(100deg, rgba(255, 255, 255, .05) 20%, rgba(255, 255, 255, .12) 40%, rgba(255, 255, 255, .05) 60%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- görüntüayıcı ---------- */
.lightbox { z-index: 90; background: rgba(3, 7, 8, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: zoom-out; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 84dvh; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 40px 120px rgba(0, 0, 0, .6); animation: modalIn .3s var(--ease); }
.lightbox-cap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 100px; background: rgba(14, 26, 29, .85); color: var(--muted); font-size: 11.5px; }
.lightbox-actions { position: fixed; top: 18px; right: 18px; z-index: 91; display: flex; gap: 8px; }
.lightbox-dl { width: auto !important; min-width: 34px; height: 36px; padding: 0 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* ---------- kaydırma çubukları ---------- */
* { scrollbar-color: rgba(255, 255, 255, .2) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 20px; background: rgba(255, 255, 255, .16); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .25); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- animasyonlar ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.ripple { position: absolute; border-radius: 50%; transform: translate(-50%, -50%) scale(0); pointer-events: none; background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%); animation: ripple .65s var(--ease) forwards; }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* ---------- mobil ---------- */
@media (max-width: 1080px) {
  .speak-app { grid-template-columns: minmax(245px, 290px) minmax(0, 1fr); }
  .rightbar { position: fixed; z-index: 22; top: calc(var(--topbar-height) + var(--mobilebar-height) + 12px); right: 12px; bottom: 12px; width: min(88vw, 320px); padding: 17px 14px; transform: translateX(calc(100% + 20px)); transition: transform .26s var(--ease); }
  .speak-app.drawer-right .rightbar { transform: translateX(0); box-shadow: -14px 0 42px rgba(0, 0, 0, .48); }
}
@media (max-width: 760px) {
  :root { --topbar-height: 56px; }
  .topnav { margin: 8px 10px 0; padding: 0 12px; border-radius: 16px; }
  .topnav nav a { display: none; }
  .user-chip { max-width: 150px; }
  .mobile-bar { display: flex; flex: 0 0 var(--mobilebar-height); align-items: center; justify-content: space-between; gap: 10px; height: var(--mobilebar-height); margin: 8px 10px 0; padding: 0 12px; border-radius: 14px; z-index: 15; }
  .mobile-bar strong { color: var(--acid); font-size: 13px; }
  .mobile-bar .btn { min-height: 31px; padding: 5px 9px; }
  .speak-app { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .sidebar { position: fixed; z-index: 21; top: calc(var(--topbar-height) + var(--mobilebar-height) + 18px); bottom: 10px; left: 10px; width: min(88vw, 330px); padding: 18px 14px 12px; transform: translateX(-108%); transition: transform .24s var(--ease); box-shadow: 14px 0 42px rgba(0, 0, 0, .48); }
  .speak-app.drawer-open .sidebar { transform: translateX(0); }
  .room-header { padding: 10px 12px; }
  .room-header p { display: none; }
  .room-header .btn { min-height: 30px; padding: 4px 8px; font-size: 10.5px; }
  .members-pill { display: none; }
  .chat { padding: 12px 9px; }
  .msg-body { max-width: 85%; }
  .composer { padding: 9px 10px 8px; }
  .composer-foot { display: none; }
  .welcome h2 { font-size: 30px; }
  .attach-card { min-width: 0; max-width: 100%; }
}
@media (max-width: 420px) {
  .logo span.logo-word { display: none; }
  .room-header h1 { max-width: 40vw; }
}
/* dokunmatik ekran: mesaj eylemleri her zaman görünür (hover yok) */
@media (hover: none) {
  .msg-actions { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .chat { scroll-behavior: auto; }
}


/* ---------- yazıyor göstergesi ---------- */
.typing-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: 26px; padding: 5px 18px 1px; color: var(--muted); font-size: 12px; font-style: italic; animation: msgIn .25s var(--ease); }
.typing-bar[hidden] { display: none; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); opacity: .35; animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- mesaj gruplama ---------- */
.msg.grouped { padding-top: 0; margin-top: -3px; }
.msg.grouped .msg-head { display: none; }
.msg.grouped .msg-avatar { visibility: hidden; }

/* ---------- Grandmaster ---------- */
.Grandmaster-badge { padding: 1px 7px; border: 1px solid rgba(255, 212, 121, .45); border-radius: 100px; background: rgba(255, 212, 121, .12); color: #ffd479; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.member-main { flex: 1; min-width: 0; }
.member-Grandmaster-btn { margin-top: 5px; padding: 4px 9px; font-size: 10.5px; }
