/* ============================================================
   nonz's kingdom — "Darkroom" editorial aesthetic
   Warm black · ivory · soft pink · serif display · mono labels
   ============================================================ */

:root {
  --bg: #f3eee4;          /* warm paper */
  --bg-2: #e9e3d5;
  --surface: #fbf8f1;     /* warm card */
  --surface-2: #efeadc;
  --line: rgba(34, 28, 20, 0.12);
  --line-2: rgba(34, 28, 20, 0.20);
  --ink: #221c14;         /* warm near-black ink */
  --ink-dim: #4a4234;
  --muted: #756a57;
  --muted-2: #9b9079;
  --accent: #e74b8b;      /* confident rose */
  --accent-2: #f6a8c8;
  --accent-ink: #ffffff;  /* text on accent */
  --error: #cf3a1d;

  --serif: "Caveat", "Bradley Hand", "Comic Sans MS", cursive;  /* warm handwriting display */
  --sans: "Nunito", -apple-system, BlinkMacSystemFont, sans-serif; /* soft warm body */
  --mono: "Nunito", ui-monospace, Menlo, monospace;

  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --shadow: 0 20px 50px rgba(60, 45, 30, 0.16);
  --shadow-sm: 0 4px 16px rgba(60, 45, 30, 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* Warm paper wash + subtle grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(231, 75, 139, 0.06), transparent 55%),
    radial-gradient(110% 110% at 50% 120%, rgba(120, 90, 55, 0.10), transparent 62%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* Soluk kaomoji arka planı — satır satır suratlar */
#bg-faces {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-user-select: none; user-select: none;
  font-family: var(--mono); font-weight: 700;
  color: rgba(34, 28, 20, 0.14);
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.face-row {
  display: flex; gap: 13px; white-space: nowrap; flex: none;
  font-size: clamp(17px, 2.4vw, 22px); letter-spacing: 0.02em;
}
.face-row:nth-child(even) { margin-left: 30px; }
.face-row:nth-child(3n) { margin-left: 14px; }

/* ---------- Buttons ---------- */
button, .btn {
  font-family: var(--sans);
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  min-height: var(--tap);
  padding: 0 20px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.16s, color 0.16s, box-shadow 0.16s;
  -webkit-user-select: none; user-select: none;
}
@media (hover: hover) {
  button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(231, 75, 139, 0.28); }
}
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { background: var(--surface); border-color: var(--ink-dim); box-shadow: none; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-ico { font-family: var(--mono); font-weight: 700; font-size: 15px; }

.iconbtn {
  background: transparent; border: 1px solid var(--line-2); color: var(--ink);
  width: var(--tap); height: var(--tap); border-radius: var(--r-sm);
  font-size: 18px; padding: 0;
}
.iconbtn:hover { background: var(--surface); }

/* ---------- Inputs ---------- */
input {
  font-family: var(--sans);
  width: 100%; min-height: var(--tap);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 15px;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(231, 75, 139, 0.16); }
input::placeholder { color: var(--muted-2); }

.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--error); font-size: 13px; font-family: var(--mono); }

/* mono label helper feel */
.tag, .count-pill, .chip, .meta-text p, .link-host, .who, .empty-face, .drop-box, .upload-status {
  font-family: var(--mono);
}

/* ============================================================
   Landing — editorial hero
   ============================================================ */
.landing {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(40px + var(--safe-t)) 24px calc(40px + var(--safe-b));
  overflow: hidden;
}
/* huge faded backdrop word */
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: grid; place-items: center;
}
/* dev soluk arka plan kelimesi — nowrap + landing overflow:hidden ile kenardan taşar */
.grid-bg::after {
  content: "welcome"; font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: min(46vw, 64vh); line-height: 1; letter-spacing: -0.01em;
  white-space: nowrap; color: rgba(231, 75, 139, 0.11);
  text-shadow: 0.02em 0.02em 0 rgba(231, 75, 139, 0.05);
  /* Caveat sağa eğimli + 'y' kuyruğu yazıyı optik olarak sağa kaydırıyor; sola dengele */
  transform: translateX(-0.05em);
  -webkit-user-select: none; user-select: none;
}
.landing-inner {
  position: relative; z-index: 1; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  max-width: 640px;
}
.landing-inner > * { animation: rise 0.7s var(--ease) both; }
.landing-inner > :nth-child(2) { animation-delay: 0.06s; }
.landing-inner > :nth-child(3) { animation-delay: 0.12s; }
.landing-inner > :nth-child(4) { animation-delay: 0.18s; }
.landing-inner > :nth-child(5) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-eyebrow {
  font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: clamp(34px, 9vw, 56px); line-height: 1.1; letter-spacing: 0;
  color: var(--ink); padding: 0 0.1em;
  text-shadow: 0.02em 0.025em 0 rgba(231, 75, 139, 0.85);
}
.hero-sub {
  font-family: var(--mono); font-size: clamp(13px, 3.4vw, 15px);
  color: var(--muted); line-height: 1.7; letter-spacing: 0.02em;
}
.hero-sub .dim { color: var(--accent); }
.nowrap { white-space: nowrap; }
.neon-btn { /* (eski sınıf adı) editorial filled button */
  margin-top: 4px; min-height: 52px; padding: 0 30px; font-size: 15px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.neon-btn .arr { font-family: var(--serif); font-size: 20px; transition: transform 0.18s var(--ease); }
.neon-btn:hover .arr { transform: translateX(4px); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.chip {
  font-size: 11.5px; font-weight: 400; color: var(--muted); letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  text-transform: uppercase;
}

/* ============================================================
   Auth (login)
   ============================================================ */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) calc(20px + var(--safe-r)) calc(24px + var(--safe-b)) calc(20px + var(--safe-l));
}
.glass, .auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
}
.auth-card {
  border-radius: var(--r-lg);
  padding: clamp(30px, 6vw, 44px) clamp(24px, 5vw, 38px) clamp(28px, 5vw, 38px);
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.6s var(--ease) both;
}
.logo-orb {
  width: 64px; height: 64px; margin: 0 auto 4px;
  border-radius: 16px; display: grid; place-items: center;
  font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: 30px; color: var(--accent-ink);
  background: var(--accent);
}
.logo-orb.big { width: 84px; height: 84px; border-radius: 20px; font-size: 34px; box-shadow: var(--shadow-sm); }
.auth-card h1 { font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 42px; letter-spacing: 0; line-height: 1; }
.auth-card .muted { margin-bottom: 6px; font-family: var(--mono); font-size: 13px; }
.auth-card input { text-align: left; }
.auth-card button { margin-top: 6px; }
.remember-me {
  display: flex; align-items: center; gap: 9px;
  text-align: left; cursor: pointer; user-select: none;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  line-height: 1.3; margin-top: -2px;
}
.remember-me input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; margin: 0; }
.remember-me span { padding-top: 1px; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(20px, var(--safe-r)) 14px max(20px, var(--safe-l));
  padding-top: calc(14px + var(--safe-t));
  background: rgba(243, 238, 228, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.brand, .brand-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-name { font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 24px; }
.logo.sm {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 18px;
  color: var(--accent-ink); background: var(--accent);
  display: grid; place-items: center;
}
.who { color: var(--muted); font-size: 12.5px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Profil fotoğrafı (topbar) ---------- */
.pfp {
  position: relative; flex: none;
  width: 38px; height: 38px; min-height: 0; padding: 0;
  border-radius: 50%; overflow: hidden;
  background: var(--accent-2); border: 1px solid var(--line-2);
  display: grid; place-items: center; cursor: pointer;
}
.pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfp-ph {
  font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: 19px; color: #5e1733; text-transform: uppercase; line-height: 1;
}
.pfp::after {
  content: "✎"; position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(34, 28, 20, 0.45); color: #fff; font-size: 14px;
  opacity: 0; transition: opacity 0.15s var(--ease);
}
@media (hover: hover) {
  .pfp:hover { box-shadow: 0 4px 14px rgba(231, 75, 139, 0.30); transform: translateY(-1px); }
  .pfp:hover::after { opacity: 1; }
}
.pfp.loading { opacity: 0.55; pointer-events: none; }
.pfp.loading::after { opacity: 1; content: "…"; }

.container { max-width: 1180px; margin: 0 auto; padding: 30px max(20px, var(--safe-l)) calc(80px + var(--safe-b)) max(20px, var(--safe-r)); }
.section-title {
  font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: clamp(34px, 7vw, 50px); letter-spacing: 0; color: var(--ink);
  margin-bottom: 22px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  animation: rise 0.5s var(--ease) both;
}

/* ---------- Tags / avatar ---------- */
.tag {
  font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 4px;
  letter-spacing: 0.08em; line-height: 1; text-transform: uppercase; flex: none;
}
.tag.own { background: var(--accent); color: var(--accent-ink); }
.tag.ro { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.avatar {
  position: relative; overflow: hidden;
  width: 38px; height: 38px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 20px;
  color: #5e1733; background: var(--accent-2); text-transform: uppercase;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Gallery selection
   ============================================================ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.gallery-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  animation: rise 0.5s var(--ease) both;
}
@media (hover: hover) {
  .gallery-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow); }
  .gallery-card:hover .cover img { transform: scale(1.05); }
}
.gallery-card .cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.gallery-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); filter: saturate(1.05); }
.gallery-card .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(21,18,14,0.55)); }
.cover-empty { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--mono); font-size: 34px; color: var(--muted-2); }
.cover-tag { position: absolute; top: 12px; left: 12px; z-index: 1; }
.gallery-card .meta { padding: 15px 16px; display: flex; align-items: center; gap: 12px; }
.meta-text { flex: 1; min-width: 0; }
.meta-text h3 { font-family: var(--serif); font-weight: 700; font-size: 25px; letter-spacing: 0; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-text p { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }

/* ============================================================
   Detail
   ============================================================ */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.detail-head .section-title { margin-bottom: 0; }
.actions { display: flex; gap: 10px; }
.count-pill { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 4px; align-self: center; }
.upload-status {
  padding: 12px 15px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); font-size: 13px; color: var(--ink-dim);
  display: flex; align-items: center; gap: 11px;
}
.upload-status::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Masonry (editorial / magazine) grid ---------- */
.grid { columns: 4; column-gap: 14px; counter-reset: frame; }
.tile {
  position: relative; counter-increment: frame;
  break-inside: avoid; -webkit-column-break-inside: avoid;
  margin: 0 0 14px; display: block;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.4s var(--ease) both;
}
@media (hover: hover) { .tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); z-index: 1; } }
.tile img { width: 100%; height: auto; object-fit: cover; display: block; cursor: zoom-in; }
.tile-broken {
  width: 100%; min-height: 170px; cursor: zoom-in;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted-2);
  font-family: var(--serif); font-style: normal; font-weight: 700; font-size: 60px; line-height: 1;
}
@media (hover: hover) { .tile-broken:hover { color: var(--accent); } }
/* frame number (contact sheet) */
.tile::after {
  content: counter(frame, decimal-leading-zero);
  position: absolute; bottom: 8px; left: 9px; z-index: 2;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(243, 236, 222, 0.75); text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}
.tile-badge {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 700;
  pointer-events: none; max-width: calc(100% - 56px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile .del, .tile .edit {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: rgba(251,248,241,0.92); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 8px; width: 38px; height: 38px; min-height: 0; padding: 0; font-size: 13px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: var(--shadow-sm);
  /* Varsayılan: GÖRÜNÜR (tüm dokunmatik cihazlar için güvenli). */
  opacity: 1; transform: none; transition: opacity 0.18s, transform 0.18s, background 0.18s, color 0.18s;
}
.tile .edit { right: 54px; } /* silme butonunun soluna */
.tile .del:active, .tile .edit:active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Yalnızca gerçek hover cihazlarında (masaüstü): hover'a kadar gizle. */
@media (hover: hover) {
  .tile .del, .tile .edit { opacity: 0; transform: translateY(-3px); }
  .tile:hover .del, .tile:hover .edit { opacity: 1; transform: translateY(0); }
  .tile .del:hover, .tile .edit:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(0); }
}

/* ---------- Link tiles ---------- */
.link-content { display: block; width: 100%; height: 100%; position: relative; text-decoration: none; color: var(--ink); }
.link-content img { width: 100%; height: 100%; object-fit: cover; }
.link-card { width: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px 16px; text-align: center; background: var(--surface-2); }
.link-ico { font-family: var(--mono); font-size: 22px; color: var(--accent); }
.link-title { font-family: var(--serif); font-size: 19px; font-weight: 700; word-break: break-word; line-height: 1.15; }
.link-host { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }
.audio-card { cursor: pointer; }
/* Galeri içi arama kutusu */
.gallery-search { margin: 0 0 18px; }
/* Öğe ismi başlığı (ızgara kutusunun altında) */
.tile-cap {
  padding: 8px 10px; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: 13px; line-height: 1.25;
  color: var(--ink); word-break: break-word; background: var(--surface);
}

/* ---------- Empty / skeleton ---------- */
.empty-state { padding: 70px 20px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 14px; letter-spacing: 0.03em; }
.empty-face { font-size: 26px; font-weight: 700; color: var(--muted-2); }
.skeleton { border-radius: var(--r); background: linear-gradient(100deg, rgba(34,28,20,0.05) 30%, rgba(34,28,20,0.10) 50%, rgba(34,28,20,0.05) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.card { aspect-ratio: 4/3; border-radius: var(--r-lg); }
.skeleton.tile { aspect-ratio: 1; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Drag & drop ---------- */
.drop-hint {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(243, 238, 228, 0.8);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  animation: fade 0.18s var(--ease);
}
.drop-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: clamp(28px, 8vw, 56px) clamp(36px, 12vw, 90px);
  border: 1.5px dashed var(--accent); border-radius: var(--r-lg);
  background: rgba(231, 75, 139, 0.07);
  font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0.04em; text-transform: uppercase;
}
.drop-face { font-size: 36px; font-weight: 700; color: var(--accent); animation: bob 1.1s var(--ease) infinite alternate; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-7px); } }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 8, 6, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: max(4vmin, var(--safe-t)) 4vmin max(4vmin, var(--safe-b));
  cursor: zoom-out; animation: fade 0.22s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox img, .lightbox video {
  max-width: 92vw; max-height: 88vh; border-radius: 4px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7); border: 1px solid var(--line-2);
  animation: pop 0.3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.lb-audio { width: min(90vw, 520px); animation: pop 0.3s var(--ease); }
.lb-close {
  position: fixed; top: calc(16px + var(--safe-t)); right: calc(16px + var(--safe-r)); z-index: 101;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.35); color: #fff;
  font-size: 18px; display: grid; place-items: center; cursor: pointer; min-height: 0;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.lb-close:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) { .grid { columns: 3; } }
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gallery-card .meta { padding: 12px; gap: 10px; }
  .avatar { width: 34px; height: 34px; font-size: 15px; }
  .meta-text h3 { font-size: 16px; }
  .grid { columns: 2; column-gap: 10px; }
  .tile { margin-bottom: 10px; }
}
@media (max-width: 560px) {
  .who, .brand-name { display: none; }
  .detail-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .detail-head .actions { width: 100%; }
  .detail-head .actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Ziyaretçiler (admin log) ---------- */
.logs-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.log-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.log-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log-time { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.log-meta { font-family: var(--mono); font-size: 13px; margin-top: 6px; word-break: break-word; }
#logs-summary { margin: 10px 0 4px; gap: 8px; flex-wrap: wrap; }
#logs-summary .chip b { color: var(--ink); }

/* ---------- Log filtre çubuğu ---------- */
.logs-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.filter-chip {
  cursor: pointer;
  font-family: var(--mono);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  transition: all 0.15s var(--ease);
}
.filter-chip:hover { color: var(--ink); border-color: var(--ink-dim); }
.filter-chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------- Kilitli galeri kartı ---------- */
.gallery-card.locked { cursor: default; }
.gallery-card.locked .meta-text p { font-family: var(--mono); letter-spacing: 0.04em; }
@media (hover: hover) {
  .gallery-card.locked:hover { transform: none; border-color: var(--line); box-shadow: none; }
}
.cover-lock { font-size: 30px; opacity: 0.7; }
.gallery-card.locked .cover { background: var(--surface-2); }
.gallery-card.locked .cover::after { display: none; }

/* ============================================================
   Management
   ============================================================ */
.danger { color: var(--error) !important; border-color: rgba(207, 58, 29, 0.4) !important; background: transparent !important; }
.danger:hover { background: var(--error) !important; color: #fff !important; border-color: var(--error) !important; box-shadow: none !important; }

/* ---------- Overview stats ---------- */
.mng-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 30px; animation: rise 0.5s var(--ease) both;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 16px; text-align: center;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-family: var(--serif); font-weight: 700; font-size: 38px; line-height: 1; color: var(--ink); }
.stat-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.mng-section { margin-bottom: 36px; animation: rise 0.5s var(--ease) both; }
.mng-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.mng-head h3 {
  font-family: var(--serif); font-style: normal; font-weight: 700;
  font-size: 28px; letter-spacing: 0; color: var(--ink);
}
.mng-count {
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 10px; min-width: 22px; text-align: center;
}
.mng-hint { font-family: var(--mono); font-size: 12.5px; margin: -8px 0 18px; line-height: 1.7; }
.mng-empty { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 18px; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.mng-empty .empty-face { font-size: 20px; }

.mng-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.mng-form input { flex: 1 1 160px; width: auto; }
.mng-form .btn { flex: 0 0 auto; }

.mng-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- User card ---------- */
.user-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 13px;
  animation: rise 0.4s var(--ease) both;
}
.uc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uc-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1;
}
.uc-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.uc-name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sub { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-actions .btn { flex: 1 1 auto; }

/* ---------- Gallery card (management) ---------- */
.gal-card {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), border-color 0.16s, box-shadow 0.16s;
  animation: rise 0.4s var(--ease) both;
}
@media (hover: hover) { .gal-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); } }
.gal-card:active { transform: translateY(0); }
.gal-ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--accent-2); color: #5e1733;
}
.gal-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.gal-name { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-slug { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-cta { flex: none; display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.mng-chev { font-family: var(--serif); font-size: 24px; color: var(--muted-2); line-height: 1; }

/* ---------- Segmented permission control ---------- */
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 4px;
}
.seg-btn {
  min-height: 38px; padding: 0 6px; border: none; background: transparent;
  color: var(--muted); font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.02em; border-radius: 5px; box-shadow: none;
  transition: background 0.14s, color 0.14s;
}
.seg-btn:hover { box-shadow: none; transform: none; background: var(--surface); color: var(--ink); }
.seg-btn.active { color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.seg-btn.active.seg-none { background: var(--muted); }
.seg-btn.active.seg-read { background: #5b8a72; }
.seg-btn.active.seg-delete { background: var(--accent); }

/* ---------- Cloudinary hesap seçici (galeri başına) ---------- */
.seg-acct { grid-template-columns: repeat(2, 1fr); }
.seg-acct .seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.seg-acct .seg-btn.active[data-acct="extrastash"] { background: #5b7a9a; }
.mng-form .seg-acct { flex: 1 1 220px; }

.mng-acct-box {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); padding: 14px 16px; margin: 4px 0 22px;
}
.mng-acct-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.mng-acct-title { font-family: var(--mono); font-size: 13px; font-weight: 700; flex: 1 1 auto; }
.mng-acct-head .seg-acct { flex: 0 0 220px; max-width: 100%; }
.mng-acct-box .mng-hint { margin: 6px 0 0; }

.tag.acct { background: var(--accent); color: var(--accent-ink); }
.tag.acct.acct-extrastash { background: #5b7a9a; color: #fff; }

@media (max-width: 560px) {
  .mng-acct-head .seg-acct { flex: 1 1 100%; }
  .gal-card .tag.acct { display: none; }
}

/* ---------- Modal dialog ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: max(20px, var(--safe-t)) 20px max(20px, var(--safe-b));
  background: rgba(20, 15, 10, 0.5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.16s var(--ease);
}
.modal-overlay.show { opacity: 1; }
.modal-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transform: translateY(12px) scale(0.98); transition: transform 0.18s var(--ease);
}
.modal-overlay.show .modal-card { transform: none; }
.modal-title { font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.05; }
.modal-body { font-size: 14px; color: var(--ink-dim); line-height: 1.55; margin-top: -4px; }
.modal-body b { color: var(--ink); }
.modal-fields { display: flex; flex-direction: column; gap: 12px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-flabel { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
#toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(20px + var(--safe-b)); z-index: 130;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 92vw;
  background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(14px); }
.toast.err { background: var(--error); color: #fff; }

/* ---------- Management responsive ---------- */
@media (max-width: 560px) {
  .mng-stats { gap: 8px; }
  .stat { padding: 14px 8px; border-radius: var(--r); }
  .stat-num { font-size: 30px; }
  .mng-form input { flex: 1 1 100%; }
  .mng-form .btn { flex: 1 1 100%; }
  .gal-name { font-size: 19px; }
  .gal-cta { font-size: 0; gap: 0; } /* metni gizle, oku bırak — dar ekranda yer aç */
  .gal-cta .mng-chev { font-size: 24px; }
  .modal-title { font-size: 26px; }
}
