/* kitaplik.co - ortak stiller. MOBILE-FIRST. Tüm renkler aşağıdaki marka token'larından gelir (bkz. PROJECT_RULES.md > Marka).
   Tailwind tarafındaki karşılıkları base.html içindeki config'te: brand-bg, brand-surface, brand-raised, brand-line,
   brand-ivory, brand-muted, brand-terracotta(-hover), brand-brass, brand-sage, brand-burgundy, brand-danger. */
:root {
  /* --- Marka paleti --- */
  --bg: #131315;               /* Derin Mürekkep Siyahı - ana zemin */
  --surface: #1B1B1F;          /* Kart / yüzey */
  --raised: #222228;           /* İkincil yüzey / input */
  --line: #2A2A30;             /* Kenarlık */
  --ivory: #EDE6D6;            /* Parşömen Fildişi - ana metin */
  --muted: #9A968E;            /* İkincil metin */
  --terracotta: #C84B31;       /* Ana aksiyon: CTA, aktif sekme, + butonu, yarış çubuğu */
  --terracotta-hover: #B03E26;
  --brass: #C59B5F;            /* Prestij: Pro, kupa, AI hak barı, marka noktası */
  --sage: #4E8C6F;             /* Başarı / Bitti */
  --burgundy: #9E3535;         /* Tehlike / Silme (dolgu) */
  --danger-soft: #D98C86;      /* Bordonun koyu zeminde okunur metin tonu (yalnızca hata metni) */

  /* --- Türetilmiş tonlar --- */
  --terracotta-tint: rgba(200, 75, 49, .16);
  --brass-tint: rgba(197, 155, 95, .14);
  --line-strong: #3A3A42;

  /* --- Tipografi --- */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* iOS güvenli alanlar (çentik / Dynamic Island / ana ekran çubuğu) - viewport-fit=cover ile çalışır */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  --topbar-h: 56px;
  --bottom-nav-h: 64px;
  --touch: 44px; /* minimum dokunma hedefi */
}

* { -webkit-tap-highlight-color: transparent; }
[x-cloak] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  overscroll-behavior-y: none;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;     /* sayfa rakamları hizalı */
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; min-height: 100dvh; }
::selection { background: rgba(200, 75, 49, .45); color: var(--ivory); }

/* Başlıklar ve marka yazısı: Newsreader (serif). Menü, buton, form, filtre ve rakamlar: Inter */
h1, h2, .font-serif {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -.005em;
  font-variant-numeric: normal;
}
button, input, select, textarea { font-family: var(--font-sans); }

/* Çift dokunuşla yakınlaştırmayı engelle, gecikmeyi kaldır */
a, button, [role="button"], input, select, textarea, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------------------------------------------------------------- güvenli alan yardımcıları */
.safe-top    { padding-top: var(--sat); }
.safe-bottom { padding-bottom: var(--sab); }
.safe-x      { padding-left: var(--sal); padding-right: var(--sar); }

/* ---------------------------------------------------------------- uygulama iskeleti */
.app-topbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--sat); padding-left: var(--sal); padding-right: var(--sar);
  background: rgba(19, 19, 21, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1rem; }

/* Mobil: alt çubuğun altında içerik kalmasın */
.app-main {
  padding-left: calc(1rem + var(--sal)); padding-right: calc(1rem + var(--sar));
  padding-top: 1rem;
  padding-bottom: calc(var(--bottom-nav-h) + var(--sab) + 1.5rem);
}

/* ---------------------------------------------------------------- alt gezinme (mobil) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: var(--sab); padding-left: var(--sal); padding-right: var(--sar);
  background: rgba(19, 19, 21, .94);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav-inner { height: var(--bottom-nav-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--touch); height: 100%; font-size: .68rem; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.nav-item svg { width: 1.5rem; height: 1.5rem; }
.nav-item span { white-space: nowrap; letter-spacing: -.01em; }
.nav-item.is-active { color: var(--terracotta); }
.nav-item:active { transform: scale(.94); }
/* Ortadaki "+ Ekle" birincil eylemi: bar yüksekliği İÇİNDE, diğer 4 öğeyle aynı ikon + etiket hizasında (yüzen daire YOK) */
.nav-add-icon {
  display: grid; place-items: center; width: 2.75rem; height: 1.5rem; border-radius: .6rem;
  background: var(--terracotta); color: var(--ivory); transition: background .15s;
}
.nav-item-add { color: var(--ivory); }
.nav-item-add:hover .nav-add-icon { background: var(--terracotta-hover); }
.nav-item-add .nav-add-icon svg { width: 1.2rem; height: 1.2rem; }

/* ---------------------------------------------------------------- profil avatarı (üst bar + masaüstü sağ üst) */
.avatar-btn {
  display: inline-grid; place-items: center; min-width: var(--touch); min-height: var(--touch); border-radius: 999px; text-decoration: none;
}
.avatar-btn-face {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; box-sizing: border-box;
  background: var(--raised); color: var(--ivory); border: 1px solid var(--line-strong);
  font-family: var(--font-sans); font-size: .95rem; font-weight: 600; line-height: 1; transition: border-color .15s;
}
.avatar-btn.is-pro .avatar-btn-face { border-color: var(--brass); color: var(--brass); }   /* Pro: ince altın kenarlık */
.avatar-btn.is-active .avatar-btn-face { border-color: var(--terracotta); }
.avatar-btn.is-pro.is-active .avatar-btn-face { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
@media (hover: hover) { .avatar-btn:hover .avatar-btn-face { border-color: var(--brass); } }
.desktop-avatar { position: fixed; top: .75rem; right: 1.5rem; z-index: 35; }
@media (min-width: 768px) {
  body:has(.desktop-avatar) .app-main { padding-top: 4rem; }   /* sağ üstteki avatarın altında kalmasın */
}

/* ---------------------------------------------------------------- masaüstü yan menü (md+) */
.side-link {
  display: flex; align-items: center; gap: .75rem; min-height: var(--touch); padding: 0 .9rem; border-radius: .8rem;
  color: var(--muted); font-weight: 500; text-decoration: none; transition: all .15s;
}
.side-link:hover { background: var(--raised); color: var(--ivory); }
.side-link.is-active { background: var(--terracotta-tint); color: var(--ivory); }
.side-link.is-active svg { color: var(--terracotta); }
.side-link svg { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }

@media (min-width: 768px) {
  .app-main { padding: 2rem 1.5rem; }
}
/* Giriş / kayıt gibi gezinmesiz sayfalar: alt çubuk payı yok, yalnızca güvenli alan */
.app-main.app-main--bare { padding-bottom: calc(var(--sab) + 1.5rem); }

/* ---------------------------------------------------------------- marka yazısı */
.brand-word { font-family: var(--font-serif); font-weight: 600; letter-spacing: -.01em; line-height: 1; white-space: nowrap; font-variant-numeric: normal; }
.brand-word .w-ivory { color: var(--ivory); }
.brand-word .w-dot { color: var(--brass); }
.brand-word .w-co { color: var(--terracotta); }

/* ---------------------------------------------------------------- düğmeler (min 44px dokunma hedefi) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--touch); padding: .6rem 1.1rem; border-radius: .85rem; white-space: nowrap;
  font-size: 1rem; font-weight: 500; line-height: 1.2; color: var(--ivory); text-decoration: none;
  background: var(--raised); border: 1px solid var(--line-strong); cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, filter .15s;
  user-select: none; -webkit-user-select: none;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--terracotta); border-color: var(--terracotta); color: var(--ivory); font-weight: 600; }
.btn-primary:hover { background: var(--terracotta-hover); border-color: var(--terracotta-hover); }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--bg); font-weight: 600; }
.btn-brass:hover { background: var(--brass); border-color: var(--brass); filter: brightness(1.08); }
.btn-danger { background: rgba(158, 53, 53, .22); border-color: var(--burgundy); color: var(--danger-soft); }
.btn-danger:hover { background: rgba(158, 53, 53, .38); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--raised); color: var(--ivory); }
.btn-block { width: 100%; }
.btn-icon { min-width: var(--touch); padding: .6rem; }

/* ---------------------------------------------------------------- form alanları (iOS zoom önleme: >= 16px) */
.input {
  width: 100%; min-height: var(--touch); padding: .65rem .85rem; border-radius: .85rem;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--ivory);
  font-size: 1rem; /* 16px - iOS Safari odaklanınca yakınlaştırmaz */
  line-height: 1.4; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select.input {
  -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239A968E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center;
}
.input::placeholder { color: rgba(154, 150, 142, .6); }
.input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(200, 75, 49, .22); }
textarea.input { resize: vertical; min-height: 6rem; line-height: 1.5; }
/* Güvence: sayfadaki HER metin alanı en az 16px (üçüncü taraf / unutulmuş alanlar için) */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: max(16px, 1rem); }
.label {
  display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

/* ---------------------------------------------------------------- kart / çip / rozet */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; min-height: var(--touch); padding: .4rem 1rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  white-space: nowrap; cursor: pointer; transition: all .15s; user-select: none; -webkit-user-select: none;
}
.chip:hover { color: var(--ivory); border-color: var(--line-strong); }
.chip.is-active { color: var(--ivory); background: var(--terracotta); border-color: var(--terracotta); font-weight: 600; }
.badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: .5rem;
  font-size: .7rem; font-weight: 600; line-height: 1.2; max-width: 100%;
}
.badge-pro { background: var(--brass); color: var(--bg); }

/* Kaydırılabilir yatay çip satırı (mobil) */
.hscroll { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll { gap: .4rem; }
.hscroll .chip { padding-left: .7rem; padding-right: .7rem; font-size: .85rem; flex-shrink: 0; }

/* ---------------------------------------------------------------- kitap kartı + kapaksız (bez cilt) kapak */
.cover-wrap { position: relative; aspect-ratio: 2 / 3; border-radius: .6rem; overflow: hidden; background: var(--raised); }
.cover-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Bez cilt: kitap adına göre deterministik koyu editoryal ton (--cloth / --cloth-deep, bkz. coverBg()).
   Sol kenarda ince sırt çizgisi, hafif bez dokusu. Başlık, sağ üstteki durum rozetiyle ÇAKIŞMAZ:
   üstte güvenli boşluk (2.5rem = pt-10) bırakılır ve başlık ortalanır. */
.cover-fallback {
  --cloth: #34363C; --cloth-deep: #25262B;
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem .7rem .9rem 1.15rem; text-align: center; overflow: hidden;
  background-color: var(--cloth);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .28));
  box-shadow: inset 0 0 0 1px rgba(237, 230, 214, .06);
}
.cover-fallback::before {          /* cilt / sırt şeridi */
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 9%;
  background: linear-gradient(90deg, var(--cloth-deep), rgba(0, 0, 0, 0) 130%);
  border-right: 1px solid rgba(237, 230, 214, .16);
}
.cover-fallback::after {           /* sırt çizgisinin yanında ince pirinç ayrac */
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(9% + 3px); width: 1px; background: rgba(197, 155, 95, .28);
}
.cover-fallback .t {
  position: relative; font-family: var(--font-serif); font-weight: 600; font-size: .95rem; line-height: 1.2; color: var(--ivory);
  font-variant-numeric: normal; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.cover-fallback .t::after {        /* başlık altı pirinç süs çizgisi */
  content: ""; display: block; width: 1.4rem; height: 1px; margin: .5rem auto 0; background: var(--brass); opacity: .85;
}
.cover-fallback .a { position: relative; margin-top: .45rem; font-size: .68rem; color: rgba(237, 230, 214, .66); max-width: 100%; }
/* Küçük kapak (80px liste küçük resmi): daha küçük yazı, yazar gizli, rozet yok */
.cover-sm .cover-fallback { padding: 1.6rem .4rem .5rem .85rem; }
.cover-sm .cover-fallback .t { font-size: .72rem; -webkit-line-clamp: 6; }
.cover-sm .cover-fallback .a { display: none; }
/* Küçük kapaklarda (başlıksız) yalnızca bez doku görünür */
.cover-fallback:empty { padding: 0; }

.book-card { cursor: pointer; transition: transform .18s ease; min-width: 0; }
.book-card .cover-wrap { box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .85), 0 0 0 1px rgba(237, 230, 214, .06); transition: box-shadow .18s; }
.book-card:active { transform: scale(.98); }
@media (hover: hover) {
  .book-card:hover { transform: translateY(-3px); }
  .book-card:hover .cover-wrap { box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .85), 0 0 0 1px rgba(197, 155, 95, .4); }
}
.progress { height: 4px; background: rgba(237, 230, 214, .18); }
.progress > span { display: block; height: 100%; background: var(--terracotta); }

/* ---------------------------------------------------------------- yardımcılar */
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid rgba(237, 230, 214, .22); border-top-color: var(--brass); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-host { position: fixed; left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none;
  bottom: calc(var(--bottom-nav-h) + var(--sab) + .75rem); padding: 0 1rem; }
@media (min-width: 768px) { .toast-host { bottom: 1.5rem; } }
.toast { pointer-events: auto; max-width: 28rem; padding: .75rem 1rem; border-radius: .9rem; font-size: 1rem; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); }
.toast.err { border-color: var(--burgundy); color: var(--danger-soft); }

/* ---------------------------------------------------------------- okuma yarışı pisti */
.race-track {
  position: relative; height: 12px; border-radius: 999px; background: var(--raised); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
}
.race-bar {
  height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.22, 1, .36, 1);
  background: linear-gradient(90deg, var(--terracotta-hover), var(--terracotta));
}
.race-bar.is-finished { background: var(--sage); }
.live-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 0 rgba(78, 140, 111, .6); animation: pulse-live 2s infinite; }
.live-dot.is-busy { background: var(--brass); }
@keyframes pulse-live { 70% { box-shadow: 0 0 0 7px rgba(78, 140, 111, 0); } 100% { box-shadow: 0 0 0 0 rgba(78, 140, 111, 0); } }
@media (prefers-reduced-motion: reduce) { .race-bar { transition: none; } .live-dot { animation: none; } }

/* ---------------------------------------------------------------- spoiler kilitli yorum kartı */
.lock-card { background: linear-gradient(160deg, var(--brass-tint), var(--surface) 60%); border-color: rgba(197, 155, 95, .28); }
.spoiler-blur { display: flex; flex-direction: column; gap: .45rem; filter: blur(5px); opacity: .55; user-select: none; pointer-events: none; }
.spoiler-blur > span { display: block; height: .7rem; border-radius: .35rem; background: var(--muted); }

/* ---------------------------------------------------------------- bottom sheet / modal */
html.sheet-open { overflow: hidden; }
.sheet-root { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 8, 9, .66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet {
  position: relative; width: 100%; max-width: 32rem; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 1.25rem 1.25rem 0 0;
  padding: 1rem 1rem calc(1rem + var(--sab)); padding-left: calc(1rem + var(--sal)); padding-right: calc(1rem + var(--sar));
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.sheet-enter { transition: transform .22s ease, opacity .22s ease; }
.sheet-enter-start { transform: translateY(24px); opacity: 0; }
.sheet-enter-end { transform: translateY(0); opacity: 1; }
@media (min-width: 768px) {
  .sheet-root { align-items: center; padding: 1.5rem; }
  .sheet { border-radius: 1.25rem; border-bottom: 1px solid var(--line-strong); padding-bottom: 1rem; }
}

/* ---------------------------------------------------------------- sepet özeti çubuğu (istek listesi) */
.cart-bar {
  position: fixed; left: 0; right: 0; z-index: 35;
  bottom: calc(var(--bottom-nav-h) + var(--sab) + .75rem);    /* alt menünün hemen üstünde (taşan + düğmesi yok) */
  padding: 0 calc(.75rem + var(--sar)) 0 calc(.75rem + var(--sal)); pointer-events: none;
}
.cart-bar-inner {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 72rem; margin: 0 auto; padding: .7rem 1rem; border-radius: 1rem;
  background: rgba(27, 27, 31, .97); border: 1px solid rgba(197, 155, 95, .38);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.cart-spacer { height: 7.5rem; }
@media (min-width: 768px) {
  .cart-bar { left: 16rem; bottom: 1rem; }   /* yan menü genişliği kadar içeriden */
}
input[type="checkbox"].cart-check {
  appearance: none; -webkit-appearance: none; width: 1.6rem; height: 1.6rem; border-radius: .5rem;
  border: 2px solid var(--line-strong); background: var(--raised); display: inline-grid; place-content: center; cursor: pointer; transition: all .12s;
}
input[type="checkbox"].cart-check:checked { background: var(--terracotta); border-color: var(--terracotta); }
input[type="checkbox"].cart-check:checked::after {
  content: ""; width: .4rem; height: .8rem; border: solid var(--ivory); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px);
}

/* Barkod okuyucu alanı */
#reader { width: 100%; border-radius: 1rem; overflow: hidden; background: #000; }
#reader video { border-radius: 1rem; }

/* ---------------- Sprint 3: Raf ağacı (yan menü) ---------------- */
.tree-link {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2rem; padding: .2rem .55rem;
  border-radius: .6rem; color: rgba(237, 230, 214, .78); font-size: .9rem; transition: background .15s, color .15s;
}
.tree-link:hover { background: rgba(237, 230, 214, .06); color: var(--ivory); }
.tree-link.is-active { background: rgba(200, 75, 49, .16); color: var(--ivory); }
.tree-count { flex-shrink: 0; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree-link.is-active .tree-count { color: var(--brass); }

/* ---------------- Sprint 3: Raflar sayfası (kitaplık raf şeridi) ---------------- */
.shelf-board {
  position: relative; display: flex; align-items: flex-end; gap: .45rem; overflow-x: auto; padding: .75rem .65rem .35rem;
  min-height: 6.4rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(237, 230, 214, .015), rgba(237, 230, 214, .055));
  border: 1px solid var(--line); border-bottom: 0; border-radius: .7rem .7rem 0 0;
}
.shelf-plank {      /* rafın tahtası: koyu ahşap + ince pirinç üst çizgisi */
  height: 9px; border-radius: 0 0 .55rem .55rem;
  background: linear-gradient(180deg, #3a3126, #231e17);
  box-shadow: inset 0 1px 0 rgba(197, 155, 95, .38), 0 8px 14px -8px rgba(0, 0, 0, .9);
}
.shelf-empty {
  display: flex; align-items: center; justify-content: center; min-height: 5.6rem; padding: .75rem 1rem; text-align: center;
  font-size: .95rem; color: var(--muted); border: 1px dashed var(--line-strong); border-bottom: 0; border-radius: .7rem .7rem 0 0;
}
.shelf-book { position: relative; flex: 0 0 3.25rem; width: 3.25rem; padding: 0; cursor: grab; border-radius: .4rem; transition: transform .15s; }
.shelf-book:hover, .shelf-book:focus-visible { transform: translateY(-4px); }
.shelf-book.is-dragging { opacity: .35; cursor: grabbing; }
.shelf-book .cover-wrap { box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .9), 0 0 0 1px rgba(237, 230, 214, .08); }
.shelf-book:hover .cover-wrap, .shelf-book:focus-visible .cover-wrap { box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .9), 0 0 0 1px rgba(197, 155, 95, .55); }
.shelf-book .cover-fallback { padding: .9rem .22rem .3rem .5rem; }
.shelf-book .cover-fallback .t { font-size: .52rem; line-height: 1.15; -webkit-line-clamp: 6; }
.shelf-book .cover-fallback .t::after { display: none; }
.shelf-book .loan-dot { position: absolute; top: .2rem; right: .2rem; width: .55rem; height: .55rem; border-radius: 999px; background: var(--brass); box-shadow: 0 0 0 2px rgba(19, 19, 21, .85); }
.drop-over { outline: 2px dashed var(--terracotta); outline-offset: 3px; border-radius: .9rem; background: rgba(200, 75, 49, .06); }
.shelf-tip {
  position: fixed; z-index: 70; transform: translate(-50%, calc(-100% - 8px)); max-width: 15rem; width: max-content; pointer-events: none;
  padding: .4rem .6rem; border-radius: .55rem; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ivory);
  font-size: .8rem; line-height: 1.3; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .9);
}
.assign-list { max-height: min(46vh, 22rem); overflow-y: auto; margin: 0 -.25rem; padding: 0 .25rem; list-style: none; }

/* ---------------- Sprint 3: ödünç göstergesi (pirinç tonlu) ---------------- */
.loan-pill {
  display: inline-flex; align-items: center; max-width: 100%; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; line-height: 1.2; font-weight: 600; color: var(--brass);
  background: rgba(197, 155, 95, .12); border: 1px solid rgba(197, 155, 95, .38);
}
.loan-pill-lg { font-size: .95rem; padding: .45rem .8rem; }

.shelf-book .cover-wrap { display: block; width: 100%; }
.shelf-book .cover-fallback { position: absolute; inset: 0; display: flex; }

/* ---------------- Sprint 4: puanlama (eskitme pirinç yıldızlar) + beğeni ---------------- */
.rating { display: inline-flex; gap: .15rem; }
.rating-star { position: relative; display: inline-block; width: 2.5rem; height: 2.75rem; font-size: 2.25rem; line-height: 2.75rem; text-align: center; }
.rating-glyph { position: absolute; inset: 0; color: var(--line-strong); }
.rating-fill { position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; white-space: nowrap; color: var(--brass); text-align: left; padding-left: calc((2.5rem - 1em) / 2); transition: width .12s; }
.rating-hit { position: absolute; top: 0; bottom: 0; width: 50%; min-height: 44px; background: transparent; border: 0; cursor: pointer; }
.rating-hit-l { left: 0; } .rating-hit-r { right: 0; }
.rating-hit:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; border-radius: .4rem; }
.react-like { background: rgba(78, 140, 111, .22); border-color: var(--sage); color: var(--ivory); }
.react-dislike { background: rgba(158, 53, 53, .28); border-color: var(--burgundy); color: var(--ivory); }
.rating-badge {
  display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.2;
  color: var(--brass); background: rgba(19, 19, 21, .72); border: 1px solid rgba(197, 155, 95, .45); backdrop-filter: blur(4px);
}

/* ---------------- Sprint 5: kitap detayında benzer liste / rota şeridi ---------------- */
.related-card {
  display: flex; flex-direction: column; gap: .3rem; flex: 0 0 11rem; min-height: 44px; padding: .65rem .8rem; border-radius: .9rem;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--ivory); transition: border-color .15s;
}
.related-card:hover { border-color: var(--brass); }
.related-card .badge { align-self: flex-start; }

/* ---------------- Okur profili: bez cilt tonları (services/users.py PROFILE_THEMES ile AYNI; app/__init__.py CLOTHS) ---------------- */
.theme-bordo    { --theme: #5B2733; --theme-deep: #3F1A23; }
.theme-lacivert { --theme: #1F2D4A; --theme-deep: #141E36; }
.theme-orman    { --theme: #1E3B31; --theme-deep: #14281F; }
.theme-fume     { --theme: #34363C; --theme-deep: #222328; }
.theme-kahve    { --theme: #4A3425; --theme-deep: #33231A; }

/* /profile: ton seçici */
.theme-chip {
  display: inline-flex; align-items: center; gap: .5rem; min-height: var(--touch); padding: .4rem .9rem; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line); color: var(--ivory); font-weight: 500; transition: border-color .15s;
}
.theme-chip.is-active { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.theme-dot {
  width: 1.15rem; height: 1.15rem; border-radius: 999px; flex: none;
  background: linear-gradient(135deg, var(--theme), var(--theme-deep)); border: 1px solid rgba(237, 230, 214, .28);
}

/* /@kullanıcı: üst kartta cilt bandı + vurgulu avatar (profil teması seçiliyse) */
.profile-hero { position: relative; overflow: hidden; border-radius: 1rem; border: 1px solid var(--line); background: var(--surface); }
.profile-band { height: .6rem; background: linear-gradient(90deg, var(--theme-deep), var(--theme) 60%, var(--brass) 160%); }
.profile-hero.has-theme .profile-avatar { background: linear-gradient(135deg, var(--theme), var(--theme-deep)); border-color: rgba(237, 230, 214, .3); color: var(--ivory); }

/* ---------------------------------------------------------------- Pro (v8): editoryal PRO rozeti ve yükseltme penceresi */
.pro-mark {
  display: inline-flex; align-items: center; padding: .05rem .45rem; border: 1px solid rgba(197, 155, 95, .55); border-radius: .4rem;
  color: var(--brass); font-family: var(--font-sans); font-size: .6875rem; font-weight: 700; letter-spacing: .12em; line-height: 1.5;
  text-transform: uppercase; vertical-align: middle;
}
.upgrade-card { background: linear-gradient(165deg, var(--brass-tint), var(--surface) 60%); border: 1px solid rgba(197, 155, 95, .4); }


/* ---------------------------------------------------------------- Sprint 1 (v9): mobil UX, /home, kompakt Kitaplığım */
/* Editoryal sekme şeridi (alt çizgili): Kitaplar · Raflar · Listeler · İstek */
.ed-tabs { display: flex; margin-bottom: .75rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ed-tabs::-webkit-scrollbar { display: none; }
.ed-tab {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: var(--touch); padding: 0 .75rem; margin-bottom: -1px;
  border-bottom: 2px solid transparent; font-size: 1rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s, border-color .15s;
}
.ed-tab:hover { color: var(--ivory); }
.ed-tab.is-active { color: var(--ivory); border-bottom-color: var(--terracotta); font-weight: 600; }

/* Üst satır: arama + tek Filtrele düğmesi (aktif filtre sayısı rozeti) */
.filter-btn { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--touch); height: var(--touch); border-radius: .85rem;
  background: var(--raised); border: 1px solid var(--line-strong); color: var(--ivory); cursor: pointer; transition: border-color .15s; }
.filter-btn.has-filter { border-color: var(--brass); }
.filter-badge { position: absolute; top: -.4rem; right: -.4rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: 999px; box-sizing: border-box;
  display: grid; place-items: center; background: var(--terracotta); color: var(--ivory); font-size: .7rem; font-weight: 700; line-height: 1; }
/* Aktif filtre etiketi: dokunma alanı 44px, görünen hap küçük */
.fchip { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0; background: transparent; border: 0; color: var(--ivory); cursor: pointer; }
.fchip-body { display: inline-flex; align-items: center; gap: .35rem; height: 1.9rem; padding: 0 .6rem 0 .75rem; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--line-strong); font-size: .85rem; font-weight: 500; white-space: nowrap; }
.fchip-body svg { width: .8rem; height: .8rem; color: var(--muted); }
.fchip:hover .fchip-body { border-color: var(--brass); }
.filter-sheet { max-width: 26rem; }
@media (min-width: 768px) { .filter-sheet { max-width: 24rem; } }

/* Ana sayfa: ince çizgili bloklar, kutu yığını yok */
.home-section { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.home-section:first-child { border-top: 0; padding-top: 0; }
.home-kicker { font-family: var(--font-sans); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.home-strip { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3.25rem; padding: .5rem 0;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); color: var(--ivory); text-decoration: none; }
.home-strip:hover { border-color: var(--brass); }
.route-scroll { display: flex; gap: .85rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: .25rem 1rem; }
.route-scroll::-webkit-scrollbar { display: none; }
.route-card { flex: 0 0 15rem; scroll-snap-align: start; display: flex; flex-direction: column; gap: .35rem; min-height: var(--touch); padding: .1rem 0 .1rem .85rem;
  border-left: 2px solid var(--brass); color: var(--ivory); text-decoration: none; }
.route-card:hover .route-title { text-decoration: underline; text-underline-offset: 3px; }

/* /discover üstü: Rotalar ve Kitap Turnuvası hızlı geçişi */
.dc-quick { display: flex; gap: 1.5rem; margin-bottom: 1rem; }
.dc-quick a { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--touch); color: var(--brass); font-weight: 500; text-decoration: none; }
.dc-quick a:hover { text-decoration: underline; text-underline-offset: 4px; }
.dc-quick svg { width: 1.1rem; height: 1.1rem; }
