:root{
  --bg:#f5f5f7;          /* Apple açık gümüş arka plan */
  --card:#e5e5ea;        /* kartlar: arka plandan koyu */
  --text:#1d1d1f;        /* Apple koyu yazı */
  --muted:#6e6e73;       /* Apple ikincil yazı */
  --line:#c7c7cc;        /* border */
  --brand:#8e8e93;       /* “accent” ama yine gümüş */
  --radius:16px;

  --topbar-h:64px;
  --bottombar-h:140px;
}

*{box-sizing:border-box}
html{
  overflow-y: scroll;   /* scrollbar boşluğu her zaman sabit kalsın */
  overflow-x: hidden;   /* yatay taşmayı kapat */
}

/* ekstra güvenlik: nadiren 1-2px taşma olabiliyor */

html,body{min-height:100%} 

html{
  overflow-y: scroll;          /* scrollbar boşluğu sabit kalsın */
  scrollbar-gutter: stable;    /* destekleyen tarayıcılarda daha temiz */
  overflow-x: hidden;          /* minik yatay taşmaları kapat */
}


body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
  overflow-x: hidden;

  /* fixed topbar + fixed bottombar alanı */
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
}

a{color:inherit; text-decoration:none}
.container{max-width:980px; margin:0 auto; padding:0 16px}

/* ============== TOP BAR ============== */
.topbar{
  position:fixed; top:0; left:0; right:0; z-index:20;
  height:64px;
  background:rgba(245,245,247,.88);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.top-inner{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:14px;
  flex-wrap:nowrap;
}
.brand{display:flex; align-items:center; flex:0 0 auto}
.logo{height:44px; width:auto; display:block}

/* Ara butonu: logo ile menü arasında, menüyü sağa iter */
.searchbtn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  font-weight:700;
  font-size:13px;
  margin-right:auto;
}
.searchbtn:hover{background:rgba(142,142,147,.14); border-color:rgba(142,142,147,.32)}
.sicon{opacity:.9}
@media (max-width: 520px){
  .stext{display:none}
}

.topnav{
  display:none;
  gap:14px;
  font-size:14px;
  white-space:nowrap;
}
.topnav a{
  padding:8px 10px;
  border-radius:12px;
}
.topnav a:hover{background:rgba(142,142,147,.14);
  border-color:rgba(142,142,147,.32);}

.spacer{flex:1}
.inline{display:inline}

/* desktop: üst menü açık */
@media (min-width: 860px){
  .topnav{display:flex}
}

/* mobil: üst menü kaybolmasın, yatay kaydırılabilsin */
@media (max-width: 859px){
  .topnav{
    display:flex !important;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap:10px;
  }
  .topnav .spacer{ display:none; }
  .topnav a, .topnav .btnlink{
    flex: 0 0 auto;
    padding:8px 8px;
    font-size:13px;
  }
  .topnav{ scrollbar-width: none; }
  .topnav::-webkit-scrollbar{ display:none; }
}

/* ============== PAGE / CARD ============== */
.page{
  padding:18px 16px;
  /* kritik: alt bar altında kalmayı %100 bitirir */
  padding-bottom: calc(18px + var(--bottombar-h) + env(safe-area-inset-bottom));
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
}
h1,h2{margin:0 0 8px}
.muted{color:var(--muted);}

.cardhead{display:flex; align-items:flex-end; justify-content:space-between; gap:12px}
.cardhead p{margin:0}

/* ============== GRID ============== */
.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
@media (min-width: 860px){
  .grid{grid-template-columns:1fr 1fr}
}

/* ============== BOTTOM BAR ============== */
.bottombar{
  position:fixed; left:0; right:0; bottom:0; z-index:20;
  background:rgba(229,229,234,.92);
  border-top:1px solid var(--line);
  padding:10px 0 calc(10px + env(safe-area-inset-bottom));
}
.bottom-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.bottom-left{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  font-size:13px;
  color:var(--muted);
}
.bottom-left a{
  padding:6px 8px;
  border-radius:12px;
}
.bottom-left a:hover{
background:rgba(142,142,147,.14);
border-color:rgba(142,142,147,.32);  
color:var(--text)}

.bottom-right{
  display:flex;
  gap:10px;
  align-items:center;
  margin-left:auto;
}
.iconbtn{
  width:38px;
  height:38px;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.iconbtn:hover{background:rgba(124,58,237,.12); border-color:rgba(124,58,237,.35)}
.iconbtn svg{
  width:18px;
  height:18px;
  fill:var(--text);
  opacity:.9;
}

/* ============== FORMS / BUTTONS ============== */
.form{margin-top:12px}
.field{display:flex; flex-direction:column; gap:6px; margin-top:10px}
.field input{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}
.field input:focus{border-color:rgba(124,58,237,.55)}

.btn{
  margin-top:12px;
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(110,110,115,.45);
  background:linear-gradient(180deg, rgba(255,255,255,.55), rgba(209,209,214,.55));
  color:var(--text);
  font-weight:700;
  cursor:pointer;
}
.btn:hover{background:linear-gradient(180deg, rgba(255,255,255,.70), rgba(199,199,204,.70))}

.btnlink{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.btnlink:hover{
  background:rgba(142,142,147,.14);
  border-color:rgba(142,142,147,.32);}

.link{color:var(--text); text-decoration:underline}

/* ============== POSTS ============== */
.postlist{margin-top:12px; display:flex; flex-direction:column; gap:12px}

.postcard{
  padding:14px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.35);
}
.posttop{display:flex; gap:12px; align-items:center}

.avatar{
  width:42px; height:42px;
  border-radius:16px;
  border:1px solid var(--line);
  background:linear-gradient(135deg, rgba(142,142,147,.18), rgba(255,255,255,.60));
  flex:0 0 auto;
  overflow:hidden; display:inline-flex; align-items:center; justify-content:center;
}

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

.avatar .avatarph{ width:100%; height:100%; display:block; }

.meta{min-width:0}
.line1{display:flex; gap:8px; flex-wrap:wrap; color:var(--muted); font-size:12px}
.line2{margin-top:2px; color:var(--muted); font-size:12px}
.who{color:var(--text); font-weight:800}
.dot{opacity:.6}

.posttext{
  display:block;
  margin-top:10px;
  color:var(--text);
  line-height:1.6;
}
.posttext:hover{text-decoration:underline}

.loadmore{padding:14px; text-align:center}

/* ============== TRENDS ============== */
.trends{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:14px;
}
.trenditem{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  overflow:hidden;
}
.trendnum{
  width:26px; height:26px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:12px;
  color:var(--text);
  background:rgba(142,142,147,.18);
  border:1px solid rgba(142,142,147,.40);
  flex:0 0 auto;
}
.trendword{
  font-weight:800;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media (max-width: 900px){
  .trends{grid-template-columns: repeat(3, minmax(0, 1fr));}
}
@media (max-width: 520px){
  .trends{grid-template-columns: repeat(2, minmax(0, 1fr));}
}

/* ============== PROFILE ============== */
.profilehead{display:flex; gap:14px; align-items:center}
.avatarbig{
  width:72px; height:72px;
  border-radius:22px;
  border-color:var(--line);
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  overflow:hidden;
  flex:0 0 auto;
}
.avatarbig img{width:100%; height:100%; object-fit:cover; display:block}
.avatarph{
  width:100%; height:100%;
  background:linear-gradient(135deg, rgba(142,142,147,.22), rgba(255,255,255,.65));
  border-color:var(--line);
}

.avatar img.avatarlogo{
  width:70% !important;
  height:70% !important;
  object-fit:contain !important;
  opacity:.95;
}
.avatarbig img.avatarlogo{
  width:70% !important;
  height:70% !important;
  object-fit:contain !important;
  opacity:.95;
}
.pname{margin:0 0 4px}
.profmeta{min-width:0}
.bio{margin:8px 0 0; line-height:1.5}

/* ============== DM ============== */
.dmstart{margin-top:12px; display:flex; gap:10px; flex-wrap:wrap}
.dmstart input{
  flex:1 1 240px;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
}
.dmstartbtn{width:auto}

.threadlist{margin-top:12px; display:flex; flex-direction:column; gap:10px}
.threadcard{
  display:flex; gap:12px; align-items:center;
  padding:12px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.threadcard:hover{
  background:rgba(142,142,147,.14);
  border-color:rgba(142,142,147,.32);}
.threadmeta{min-width:0}
.threadmeta .line2{
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.msglist{margin-top:12px; display:flex; flex-direction:column; gap:10px}
.msg{display:flex; flex-direction:column; gap:4px; max-width:88%}
.msg.me{align-self:flex-end; text-align:right}
.msg.other{align-self:flex-start}
.bubble{
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  line-height:1.5;
  word-break:break-word;
}
.msg.me .bubble{
  background:rgba(142,142,147,.16);
  border-color:rgba(110,110,115,.35);
}
.ts{font-size:11px; color:var(--muted)}

.msgform{margin-top:12px}
.msgform textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
  resize:vertical;
}

/* ============== NOTIFS ============== */
.notiflist{display:flex; flex-direction:column; gap:10px}
.notifcard{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.notifcard:hover{background:rgba(142,142,147,.14);
  border-color:rgba(142,142,147,.32);}
.notifcard.unread{
  border-color:rgba(110,110,115,.55);
  background:rgba(142,142,147,.12);
}
.notifleft{display:flex; gap:12px; align-items:center; min-width:0}
.notifmeta{min-width:0}
.notifmeta .line2{
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.notifts{color:var(--muted); font-size:12px; white-space:nowrap}

/* ============== FLASH MESSAGES ============== */
.flashwrap{display:flex; flex-direction:column; gap:10px; margin-bottom:12px}
.flash{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.flash.success,
.flash.error{
  border-color:rgba(110,110,115,.55);
  background:rgba(142,142,147,.12);
  color:var(--text);
}


.pfrow{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.pfcounters{
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:13px;
}

.actrow{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}

.citem{
  padding:12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  margin-top:10px;
}
.cmeta{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.cbody{margin-top:6px; line-height:1.55}

a.trenditem{color:inherit}


.postactions{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.postimg{
  width:100%;
  height:auto;
  display:block;
  margin-top:12px;
  border-radius:18px;
  border:1px solid var(--line);
}

.threadrow{
  display:flex;
  align-items:center;
  gap:10px;
}
.threadrow .threadcard{
  flex:1 1 auto;
}

/* Paylaş kutusu: sabit, çekince büyümesin */
.composer-text{
  width:100%;
  height:110px;        /* sabit yükseklik */
  max-height:110px;
  resize:none;         /* sürükleyerek büyütmeyi kapat */
  overflow:auto;       /* yazı uzarsa içeride scroll */
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255, 255, 255, 0.907);
  color:var(--text);
  outline:none;
  line-height:1.5;
}
.composer-text:focus{border-color:rgba(110,110,115,.55)}


.composer-youtube{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  outline:none;
}

.ytwrap{
  position:relative;
  margin-top:12px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.ytwrap::before{
  content:"";
  display:block;
  padding-top:56.25%; /* 16:9 */
}
.ytwrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

.ytmeta{
  margin-top:10px;
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.ytnote{
  font-size:12px;
}

.nline1{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.ntag{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.25);
  font-size:12px;
  font-weight:800;
  color:var(--text);
}
.nline2{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

.topnav a{ position:relative; display:inline-flex; align-items:center; gap:8px; }

.badge{
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--line);
  background:rgba(29,29,31,.12);
  color:var(--text);
  animation: badgeIn .18s ease-out;
}
@keyframes badgeIn{
  from{ transform:scale(.6); opacity:.4; }
  to{ transform:scale(1); opacity:1; }
}

/* “patlama” efekti: okunmamış -> 0 olunca kısa burst */
.badge-burst{
  position:absolute;
  right:6px;
  top:6px;
  width:18px;
  height:18px;
  border-radius:999px;
  border:1px solid rgba(29,29,31,.25);
  animation: burst .35s ease-out forwards;
  pointer-events:none;
}
@keyframes burst{
  from{ transform:scale(.9); opacity:1; }
  to{ transform:scale(2.2); opacity:0; }
}

/* Dosya seç inputunu şık göster */
.composer-images{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.25);
  color:var(--text);
}

/* Çoklu görsel grid */
.imggrid{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
  position:relative;
}
.imggrid a{ display:block; }
.imggrid img{
  width:100%;
  height:180px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid var(--line);
  display:block;
}
.imggrid.detail{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 520px){
  .imggrid.detail{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.imgmore{
  position:absolute;
  right:10px;
  bottom:10px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(245,245,247,.85);
  font-weight:900;
}

.cookiebar{
  position:fixed;
  left:0;
  right:0;
  bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 10px);
  z-index:40;
}
.cookieinner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-radius:16px;
  border:1px solid var(--line);
  background:var(--card);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}
.cookietext{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.cookieactions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
@media (max-width: 520px){
  .cookieinner{flex-direction:column; align-items:stretch;}
  .cookieactions{justify-content:flex-end;}
}


.composer-select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.25);
  color:var(--text);
  outline:none;
  appearance:none;
}