/* Glutensa Topluluk — mobil öncelikli, Instagram benzeri akış tasarımı */
:root {
    --bg: #ffffff;
    --page: #fafafa;
    --line: #efefef;
    --line2: #dbdbdb;
    --text: #262626;
    --muted: #737373;
    --brand: #10b981;
    --brand-d: #059669;
    --like: #ff3040;
    --top-h: 52px;
    --tab-h: 54px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--page); color: var(--text); font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea { font-family: inherit; color: inherit; }
svg { display: block; }

.shell { max-width: 470px; margin: 0 auto; background: var(--bg); min-height: 100vh; min-height: 100dvh; border-left: 1px solid var(--line); border-right: 1px solid var(--line); position: relative; }
@media (max-width: 470px) { .shell { border-left: none; border-right: none; } }

/* Üst çubuk */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 4px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: none; color: var(--text); cursor: pointer; border-radius: 50%; text-decoration: none; flex: none; }
.icon-btn:active { background: #f2f2f2; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #34d399, #059669); color: #fff; display: grid; place-items: center; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.4px; }
.brand-sep { width: 1px; height: 16px; background: var(--line2); }
.brand-sub { font-size: 15px; color: var(--muted); font-weight: 500; }

.view { min-height: calc(100vh - var(--top-h)); padding-bottom: calc(var(--tab-h) + 28px + var(--safe-b)); }

/* Alt sekme çubuğu */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 470px; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 20; }
.tab { flex: 1; display: grid; place-items: center; background: none; border: none; color: var(--text); cursor: pointer; }
.tab svg { width: 26px; height: 26px; }
.tab.active[data-view="home"] svg, .tab.active[data-view="saved"] svg { fill: currentColor; }
.tab-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 2px solid transparent; }
.tab.active .tab-avatar { border-color: var(--text); padding: 1px; }
.tab-avatar .avatar { width: 100%; height: 100%; font-size: 10px; }

/* Avatar */
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; text-transform: uppercase; line-height: 1; letter-spacing: 0; }
.av0 { background: linear-gradient(135deg, #34d399, #0d9488); }
.av1 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.av2 { background: linear-gradient(135deg, #60a5fa, #6366f1); }
.av3 { background: linear-gradient(135deg, #f472b6, #e11d48); }
.av4 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.av5 { background: linear-gradient(135deg, #2dd4bf, #0284c7); }
.av6 { background: linear-gradient(135deg, #a3e635, #16a34a); }
.av7 { background: linear-gradient(135deg, #fb7185, #f59e0b); }

/* Bilgilendirme kartı */
.notice { display: flex; gap: 12px; align-items: flex-start; margin: 12px; padding: 12px 14px; border-radius: 14px; background: #f0fdf7; border: 1px solid #c9f1de; }
.notice-ico { color: var(--brand-d); flex: none; margin-top: 1px; }
.notice p { font-size: 12.5px; line-height: 1.5; color: #14532d; }
.notice button { margin-top: 6px; background: none; border: none; font-size: 12.5px; font-weight: 700; color: var(--brand-d); cursor: pointer; padding: 2px 0; }

/* Gönderi */
.post { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 4px; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 12px; }
.post-head .avatar { width: 34px; height: 34px; font-size: 14px; }
.post-id { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.post-user { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.visual { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 34px 30px; text-align: center; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; cursor: pointer; }
.visual p { font-weight: 800; line-height: 1.22; letter-spacing: -.4px; word-break: break-word; text-shadow: 0 1px 14px rgba(0,0,0,.18); }
.visual::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.22), transparent 55%), radial-gradient(90% 70% at 0% 100%, rgba(0,0,0,.16), transparent 60%); pointer-events: none; }
.visual p { position: relative; }
.g0 { background: linear-gradient(145deg, #10b981, #0f766e); }
.g1 { background: linear-gradient(145deg, #f59e0b, #ea580c); }
.g2 { background: linear-gradient(145deg, #6366f1, #3b82f6); }
.g3 { background: linear-gradient(145deg, #ec4899, #be123c); }
.g4 { background: linear-gradient(145deg, #8b5cf6, #5b21b6); }
.g5 { background: linear-gradient(145deg, #06b6d4, #0369a1); }
.g6 { background: linear-gradient(145deg, #84cc16, #15803d); }
.g7 { background: linear-gradient(145deg, #f43f5e, #f59e0b); }
.burst { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; color: #fff; opacity: 0; pointer-events: none; filter: drop-shadow(0 4px 18px rgba(0,0,0,.35)); }
.burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
.visual.pop .burst, .photo.pop .burst { animation: burst .8s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 18% { opacity: 1; transform: scale(1.12); } 40% { transform: scale(.96); } 70% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }

.textblock { padding: 2px 14px 4px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.textblock.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.more-link { background: none; border: none; color: var(--muted); font-size: 14px; padding: 0 14px 2px; cursor: pointer; }

.actions { display: flex; align-items: center; padding: 4px 6px 0; }
.act { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: none; color: var(--text); cursor: pointer; border-radius: 50%; }
.act:active { transform: scale(.88); }
.act svg { width: 26px; height: 26px; }
.act.like.on { color: var(--like); }
.act.like.on svg, .act.save.on svg { fill: currentColor; }
.act.like.bump svg { animation: bump .35s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.spacer { flex: 1; }
.likes { padding: 0 14px; font-size: 14px; font-weight: 700; }
.likes.zero { font-weight: 500; color: var(--muted); }
.caption { padding: 4px 14px 0; font-size: 14px; line-height: 1.5; }
.caption b { margin-right: 6px; }
.view-comments { display: block; background: none; border: none; padding: 4px 14px 0; font-size: 14px; color: var(--muted); cursor: pointer; text-align: left; }
.post-time { padding: 6px 14px 0; font-size: 10.5px; letter-spacing: .4px; color: var(--muted); font-weight: 500; }

/* Izgara (kaydedilenler / profil) */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 10px; color: #fff; text-align: center; overflow: hidden; border: none; cursor: pointer; }
.tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.2), transparent 55%); }
.tile span { position: relative; font-size: 11.5px; line-height: 1.3; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

/* Profil */
.profile-head { padding: 20px 16px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.profile-head .avatar { width: 88px; height: 88px; font-size: 36px; margin-bottom: 8px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--line2); }
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.profile-sub { font-size: 13px; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; width: 100%; }
.btn { flex: 1; border: none; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; cursor: pointer; background: #efefef; color: var(--text); }
.btn:active { background: #e4e4e4; }
.btn.primary { background: var(--brand-d); color: #fff; }
.btn.primary:active { background: #047857; }
.btn:disabled { opacity: .5; cursor: default; }
.section-title { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.page-title { padding: 16px 14px 10px; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }

/* Boş durum */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 32px; gap: 8px; }
.empty-ico { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--text); display: grid; place-items: center; margin-bottom: 8px; }
.empty-ico svg { width: 32px; height: 32px; }
.empty h3 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.empty p { font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 300px; }
.empty .btn { flex: none; margin-top: 12px; padding: 10px 22px; }
.linkbtn { background: none; border: none; color: var(--brand-d); font-weight: 700; font-size: 14px; cursor: pointer; padding: 8px; }

/* İskelet yükleme */
.skel { padding: 10px 12px 18px; }
.skel-row { display: flex; gap: 10px; align-items: center; }
.sk { background: linear-gradient(90deg, #f1f1f1 25%, #f8f8f8 50%, #f1f1f1 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; }
.sk.round { border-radius: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Alt sayfalar (sheet) */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet { width: 100%; max-width: 470px; background: var(--bg); border-radius: 18px 18px 0 0; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; animation: up .26s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.sheet.tall { height: 88vh; height: 88dvh; }
.sheet.full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line2); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 6px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-title { font-size: 16px; font-weight: 700; text-align: center; flex: 1; }
.head-act { background: none; border: none; padding: 0 12px; font-size: 15px; font-weight: 700; color: var(--brand-d); cursor: pointer; min-width: 64px; text-align: right; height: 44px; }
.head-act:disabled { opacity: .4; cursor: default; }
.sheet-body { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { flex: none; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--safe-b)); }

/* Yorumlar */
.cm { display: flex; gap: 10px; padding: 10px 14px; align-items: flex-start; }
.cm .avatar { width: 32px; height: 32px; font-size: 13px; }
.cm-main { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.cm-main b { margin-right: 6px; }
.cm-main span.t { word-break: break-word; white-space: pre-wrap; }
.cm-meta { display: flex; gap: 14px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cm-meta button { background: none; border: none; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 0; }
.cm-empty { text-align: center; padding: 48px 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cm-empty h4 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cm-input { display: flex; align-items: center; gap: 10px; }
.cm-input .avatar { width: 34px; height: 34px; font-size: 13px; }
.cm-input input { flex: 1; min-width: 0; border: 1px solid var(--line2); border-radius: 22px; padding: 10px 16px; font-size: 14px; outline: none; background: #fff; }
.cm-input input:focus { border-color: var(--brand); }

/* Yeni gönderi */
.compose-user { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px; }
.compose-user .avatar { width: 38px; height: 38px; font-size: 15px; }
.compose-user b { font-size: 14px; }
.compose-text { width: 100%; border: none; outline: none; resize: none; font-size: 17px; line-height: 1.5; padding: 10px 14px; min-height: 160px; background: transparent; }
.compose-text::placeholder { color: #a8a8a8; }
.compose-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.compose-row svg { color: var(--muted); flex: none; }
.compose-row input { flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; background: transparent; }
.compose-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); gap: 12px; }
.compose-foot .count { font-variant-numeric: tabular-nums; flex: none; }

/* Liste satırları (menü / hesap) */
.rows { display: flex; flex-direction: column; }
.row-btn { display: flex; align-items: center; justify-content: center; padding: 16px; background: none; border: none; border-bottom: 1px solid var(--line); font-size: 15px; cursor: pointer; width: 100%; }
.row-btn.danger { color: #ed4956; font-weight: 700; }
.row-btn:last-child { border-bottom: none; }
.row-btn:active { background: #f7f7f7; }

.form { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 10px; letter-spacing: .2px; }
.field { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; border: 1px solid var(--line2); border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none; background: #fafafa; }
.field input:focus { border-color: var(--brand); background: #fff; }
.field .btn { flex: none; padding: 0 16px; }
.hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.msg { min-height: 18px; font-size: 13px; color: #ed4956; padding: 0 16px; }
.danger-zone { display: flex; justify-content: space-between; padding: 8px 12px 16px; }
.danger-zone button { background: none; border: none; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 8px 6px; }
.danger-zone button.red { color: #ed4956; }

.keycard { margin: 16px; border-radius: 16px; padding: 18px 16px; background: linear-gradient(145deg, #ecfdf5, #d1fae5); border: 1px solid #a7f3d0; text-align: center; }
.keycard .kc-name { font-size: 13px; color: #065f46; margin-bottom: 8px; }
.keycard code { display: block; font-size: 18px; font-weight: 800; letter-spacing: 1.2px; color: #064e3b; background: #fff; border-radius: 12px; padding: 14px 8px; user-select: all; -webkit-user-select: all; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.keycard .btn { margin-top: 12px; width: 100%; }
.ack { display: flex; gap: 12px; align-items: flex-start; padding: 4px 16px 12px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.ack input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand-d); flex: none; }

.rule { display: flex; gap: 14px; padding: 12px 18px; }
.rule .ri { width: 36px; height: 36px; border-radius: 50%; background: #ecfdf5; color: var(--brand-d); display: grid; place-items: center; flex: none; }
.rule b { display: block; font-size: 14px; margin-bottom: 2px; }
.rule span { font-size: 13px; line-height: 1.5; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translateX(-50%); background: #262626; color: #fff; font-size: 13.5px; font-weight: 500; padding: 11px 18px; border-radius: 12px; z-index: 200; max-width: 88%; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: fade .2s ease; }
.toast[hidden], .more-link[hidden], .sentinel[hidden] { display: none; }
.sentinel { height: 1px; }

.av-guest { background: #e9e9e9; color: #8e8e8e; }
.keycard code { white-space: pre-line; line-height: 1.5; }

/* Fotoğraflı gönderi */
.photo { position: relative; background: #efefef; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.caption.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.tile.img { padding: 0; background: #efefef; }
.tile.img::before { display: none; }
.tile.img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Yeni gönderide fotoğraf */
.compose-photo { position: relative; margin: 6px 14px 4px; border-radius: 14px; overflow: hidden; background: #efefef; }
.compose-photo[hidden], .compose-add[hidden] { display: none; }
.compose-photo img { display: block; width: 100%; max-height: 52vh; object-fit: cover; }
.compose-photo .rm { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; }
.compose-add { width: 100%; background: none; border: none; border-top: 1px solid var(--line); font-size: 15px; cursor: pointer; text-align: left; color: var(--text); }
.compose-add svg { color: var(--brand-d); }

/* Yönetim paneli */
.icon-btn[hidden] { display: none; }
.top-right { display: flex; align-items: center; }
.seg { display: flex; margin: 12px 14px; background: #efefef; border-radius: 10px; padding: 3px; }
.seg-btn { flex: 1; border: none; background: none; padding: 9px 6px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ad-list { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.ad-card { border: 1px solid var(--line2); border-radius: 14px; padding: 12px; background: #fff; }
.ad-row { display: flex; align-items: center; gap: 10px; }
.ad-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ad-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ad-who b { font-size: 14px; }
.ad-who span { font-size: 12px; color: var(--muted); }
.ad-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #efefef; color: var(--muted); white-space: nowrap; }
.badge.warn { background: #fff4e0; color: #b45309; }
.badge.red { background: #ffe4e6; color: #be123c; }
.badge.dim { background: #e5e7eb; color: #374151; }
.ad-body { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.ad-body img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: #efefef; }
.ad-text { font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ad-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-btn { flex: 1; min-width: 72px; border: 1.5px solid var(--line2); background: #fff; border-radius: 10px; padding: 9px 8px; font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; }
.ad-btn.ok { border-color: var(--brand); color: var(--brand-d); }
.ad-btn.danger { border-color: #fecdd3; color: #be123c; }
.ad-btn:active { background: #f5f5f5; }

/* Alt sayfa açıkken bildirim yazısı üstte çıksın (butonları örtmesin) */
#layer:has(.backdrop) ~ .toast { bottom: auto; top: calc(var(--top-h) + 10px); }
