/* Code Book — ümumi üslub */
:root {
  --bg: #faf5ea;
  --surface: #fffbf3;
  --surface-2: #f3e9d4;
  --line: #e7d9bd;
  --ink: #2b2118;
  --ink-soft: #6b5a48;
  --ink-faint: #9a8770;
  --accent: #e0a63a;
  --accent-strong: #a8700f;
  --accent-ink: #2b1d08;
  --wood: #8a5a33;
  --wood-dark: #5b391d;
  --wood-light: #b07a48;
  --success: #3f7a4a;
  --danger: #a33a2a;
  --shadow-sm: 0 1px 2px rgba(60, 40, 15, .08), 0 2px 6px rgba(60, 40, 15, .06);
  --shadow-md: 0 4px 10px rgba(60, 40, 15, .10), 0 12px 28px rgba(60, 40, 15, .10);
  --radius: 12px;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --maxw: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip; /* ehtiyat: heç bir element səhifəni yana genişləndirməsin (telefonda kiçilmə olmasın) */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); }
a:hover { color: var(--wood-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; color: var(--ink); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
main { flex: 1; }

/* ---------------------------------------------------------------- Başlıq */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 245, 234, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-family: var(--serif); font-weight: 700; font-size: 1.45rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.logo span { color: var(--accent-strong); }
.logo:hover { color: var(--ink); }
.header-nav { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.header-link {
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-weight: 500;
}
.header-link:hover { background: var(--surface-2); color: var(--ink); }
.header-link.primary { background: var(--ink); color: #fff8ea; }
.header-link.primary:hover { background: var(--wood-dark); color: #fff8ea; }

.profile { position: relative; }
.profile-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer;
}
.profile-btn:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: .8rem;
}
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; display: none;
}
.profile-menu.open { display: block; }
.profile-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.profile-menu .who strong { display: block; }
.profile-menu .who small { color: var(--ink-soft); word-break: break-all; }
.profile-menu a, .profile-menu button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px;
  background: none; border: 0; cursor: pointer; text-decoration: none; color: var(--ink);
}
.profile-menu a:hover, .profile-menu button:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- Düymələr */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d29424; color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: #fff8ea; }
.btn-dark:hover { background: var(--wood-dark); color: #fff8ea; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: none; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #336540; color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .86rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------- Ana səhifə: hero */
.hero-wrap { padding-top: 24px; padding-bottom: 8px; }
.hero-card {
  --hero-bg: #2c4741;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  min-height: 460px; border-radius: 24px; overflow: hidden;
  background: var(--hero-bg); color: #f6efe0;
  box-shadow: 0 20px 50px -24px rgba(30, 50, 45, .55);
}
.hero-copy { padding: 52px 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hero-eyebrow {
  align-self: flex-start; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #f2c14e; padding: 5px 12px; border: 1px solid rgba(242, 193, 78, .45); border-radius: 999px;
}
.hero-copy h1 { color: #fbf5e8; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.hero-copy p { margin: 0; color: #cfdcd5; font-size: 1.05rem; max-width: 520px; }
.search.hero-search { flex: none; max-width: 460px; width: 100%; min-width: 0; }
.search.hero-search input { background: #fbf6ea; border-color: transparent; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .4); padding-top: 14px; padding-bottom: 14px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-light-outline { border-color: rgba(246, 239, 224, .4); color: #f6efe0; background: transparent; }
.btn-light-outline:hover { background: rgba(246, 239, 224, .1); color: #fff; }
.hero-stats { font-size: .88rem !important; color: #a9bcb3 !important; }
.hero-stats strong { color: #f6efe0; }
.hero-media { position: relative; min-height: 300px; background: #24403a; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  opacity: 0; transition: opacity .9s ease;
}
.hero-slide.active { opacity: 1; }
.hero-media::after { /* mətn tərəfə yumşaq keçid */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 60px; pointer-events: none;
  background: linear-gradient(90deg, var(--hero-bg), transparent);
}
.hero-dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2;
  padding: 6px 8px; border-radius: 999px; background: rgba(20, 35, 31, .55); }
.hero-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; cursor: pointer; background: rgba(255, 255, 255, .45); }
.hero-dots button[aria-current="true"] { background: #f2c14e; width: 22px; border-radius: 999px; }
.books-area { padding-top: 22px; scroll-margin-top: 72px; }
@media (max-width: 860px) {
  .hero-card { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 32px 24px 28px; gap: 14px; }
  .hero-media { min-height: 0; height: 260px; order: -1; }
  .hero-media::after { inset: auto 0 0 0; width: auto; height: 50px; background: linear-gradient(0deg, var(--hero-bg), transparent); }
}
@media (max-width: 640px) {
  .hero-wrap { padding-top: 12px; }
  .hero-card { border-radius: 18px; }
  .hero-media { height: 150px; }
  .hero-copy { padding: 20px 18px 22px; gap: 12px; }
  .hero-eyebrow { font-size: .74rem; padding: 4px 10px; }
  .hero-copy h1 { font-size: 1.7rem; }
  #hero-text { font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-actions { flex-wrap: nowrap; gap: 8px; }
  .hero-actions .btn { flex: 1; padding: 10px 12px; font-size: .88rem; }
  .hero-copy .hero-stats { display: none; }
  .books-area { padding-top: 16px; }
}

/* ---------------------------------------------------------------- Ana səhifə */
.hero { padding: 36px 0 22px; }
.hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 600; }
.hero p { margin: 8px 0 0; color: var(--ink-soft); max-width: 560px; }
.search {
  position: relative; flex: 0 1 380px; min-width: 260px;
}
.search input {
  width: 100%; padding: 12px 16px 12px 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: .98rem;
  box-shadow: var(--shadow-sm);
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 166, 58, .25); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-current="page"] { background: var(--ink); color: #fff8ea; border-color: var(--ink); }

.section { padding: 18px 0 34px; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 1.45rem; font-weight: 600; }
.section-head .count { color: var(--ink-faint); font-size: .9rem; font-family: var(--sans); font-weight: 400; margin-left: 6px; }
.see-all { font-weight: 600; text-decoration: none; font-size: .92rem; white-space: nowrap; display: inline-flex; align-items: center; min-height: 40px; padding: 0 2px; }
.see-all:hover { text-decoration: underline; }

.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; }
@media (max-width: 960px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }

.book-card { position: relative; display: flex; flex-direction: column; gap: 10px; }
.book-card .open-book {
  all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 10px; border-radius: 10px;
}
.book-card .open-book:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.book-card .cover { transition: transform .2s ease, box-shadow .2s ease; }
.book-card .open-book:hover .cover { transform: translateY(-4px); box-shadow: var(--shadow-md), 6px 10px 22px rgba(60, 40, 15, .18); }
.book-meta h3 { font-size: 1.05rem; font-weight: 600; }
.book-meta .author { color: var(--ink-soft); font-size: .9rem; margin-top: 2px; }
.book-meta .genre {
  display: inline-block; margin-top: 6px; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--wood-dark);
}
.wish-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255, 251, 243, .92); color: var(--wood-dark); box-shadow: var(--shadow-sm);
}
.wish-btn:hover { background: #fff; }
.wish-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.wish-btn[aria-pressed="true"] svg path { fill: currentColor; }
.status-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 251, 243, .94); color: var(--ink); box-shadow: var(--shadow-sm);
}
.status-badge.done { background: var(--success); color: #fff; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--ink-soft); }
.empty-state h3 { margin-bottom: 6px; }

/* ---------------------------------------------------------------- Üz qabığı */
.cover {
  --bg: #333; --fg: #fff; --ac: #e0a63a;
  position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px;
  background: var(--bg); color: var(--fg); overflow: hidden;
  box-shadow: var(--shadow-sm), 3px 6px 14px rgba(60, 40, 15, .16);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14% 11% 11% 15%;
  isolation: isolate;
}
.cover::before { /* kitab cildi */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7%;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 55%, rgba(0,0,0,.08));
  z-index: 2;
}
.cover::after { /* işıq */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.14), transparent 40%, rgba(0,0,0,.12));
}
.cover svg.pattern { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.cover .c-title {
  position: relative; z-index: 3; font-family: var(--serif); font-weight: 700;
  font-size: clamp(.95rem, 1.6vw, 1.35rem); line-height: 1.15; text-wrap: balance;
}
.cover .c-author { position: relative; z-index: 3; font-size: clamp(.68rem, 1vw, .82rem); letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.cover .c-rule { width: 34%; height: 2px; background: var(--ac); margin: 10px 0 0; position: relative; z-index: 3; }
.cover.has-img { padding: 0; background: var(--bg); }
.cover.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.cover.sm .c-title { font-size: .82rem; }
.cover.sm .c-author { font-size: .6rem; }
.cover.sm { padding: 12% 9% 9% 14%; }

/* ---------------------------------------------------------------- Formlar */
.auth-wrap { display: grid; place-items: start center; padding: 48px 16px 64px; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-md); padding: 30px;
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--ink-soft); margin: 0 0 20px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.tabs a { flex: 1; text-align: center; padding: 8px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-weight: 600; font-size: .9rem; }
.field input {
  width: 100%; min-width: 0;
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224, 166, 58, .25); }
.field .hint { color: var(--ink-faint); font-size: .8rem; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 420px) { .row-2 { grid-template-columns: 1fr; } }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent-strong); font-weight: 600; font-size: .82rem; cursor: pointer; padding: 6px 8px; }
.form-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.form-actions .btn { width: 100%; padding: 12px; }
.form-foot { text-align: center; font-size: .9rem; color: var(--ink-soft); margin-top: 16px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: .92rem; margin-bottom: 16px; }
.alert-error { background: #fbe9e4; color: #7c2a1c; border: 1px solid #f0c9bf; }
.alert-ok { background: #e8f3e6; color: #2e5b35; border: 1px solid #c7e1c3; }
.alert-info { background: #fdf3dc; color: #6b4a10; border: 1px solid #f1dcaa; }
.alert a { font-weight: 600; word-break: break-all; }

/* ---------------------------------------------------------------- Kabinet */
.cabinet { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; padding: 32px 0 56px; align-items: start; }
@media (max-width: 980px) { .cabinet { grid-template-columns: minmax(0, 1fr); } }
/* Sütunlar məzmuna görə genişlənməsin — lentlər öz içində sürüşsün */
.cab-left, .shelf-panel, #cab-main, .cab-section { min-width: 0; }
.cab-hello h1 { font-size: 1.8rem; }
.cab-hello p { color: var(--ink-soft); margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 8px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--ink-soft); font-size: .84rem; margin-top: 6px; }
.stat.highlight { background: linear-gradient(135deg, #fbe7bd, #f6d891); border-color: #eccb7f; }
.cab-section { margin-top: 30px; }
.cab-section h2 { font-size: 1.25rem; margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; }
.cab-section h2 small { font-family: var(--sans); font-size: .85rem; color: var(--ink-faint); font-weight: 400; }

.reading-list { display: flex; flex-direction: column; gap: 14px; }
.reading-item {
  display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.reading-item .ri-body h3 { font-size: 1.08rem; }
.reading-item .ri-body .author { color: var(--ink-soft); font-size: .9rem; }
.progress { margin: 10px 0 12px; }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #c98a1f); border-radius: 999px; }
.progress-text { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-soft); margin-top: 5px; }
.ri-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; }
.mini-card { display: flex; flex-direction: column; gap: 8px; }
.mini-card .open-book { all: unset; cursor: pointer; border-radius: 6px; }
.mini-card .open-book:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.mini-card h3 { font-size: .92rem; }
.mini-card .author { font-size: .8rem; color: var(--ink-soft); }
.mini-card .btn { align-self: flex-start; }

.done-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.done-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; }
.done-item + .done-item { border-top: 1px solid var(--line); }
.done-item h3 { font-size: .98rem; }
.done-item .cover .c-title { font-size: .5rem; }
.done-item .cover .c-author, .done-item .cover .c-rule { display: none; }
.done-item .meta { font-size: .82rem; color: var(--ink-soft); }
.done-item .actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.muted-box { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink-soft); font-size: .95rem; }

/* ---------------------------------------------------------------- Sevdiyim cümlələr */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.q-head h2 { margin-bottom: 0 !important; }
.q-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.q-arrow {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-size: 1.3rem; line-height: 1; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding-bottom: 2px;
}
.q-arrow:hover:not(:disabled) { background: var(--surface-2); }
.q-arrow:disabled { opacity: .35; cursor: default; }
.q-count { font-size: .84rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }
.q-count b { color: var(--ink); }

/* Lent: bir kart görünür, növbətinin kənarı azca görünür (sürüşdürməyə işarə) */
.slider-track {
  display: grid; grid-auto-flow: column; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: auto;
  scrollbar-width: none; padding: 2px 2px 4px; cursor: grab;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.slider-track.dragging a { pointer-events: none; }
.slider-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--radius); }
.slider-track > * { scroll-snap-align: start; min-width: 0; }
.quote-track { grid-auto-columns: calc(100% - 44px); }
.quote-track.single { grid-auto-columns: 100%; cursor: default; }

/* Oxuduğum kitablar: kiçik kartlar lenti */
.done-track { grid-auto-columns: 118px; }
.done-card {
  display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.done-cover { display: block; border-radius: 6px; margin-bottom: 6px; }
.done-cover:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.done-cover .cover { transition: transform .15s; }
.done-cover:hover .cover { transform: translateY(-3px); }
.done-card h3 { font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.done-card .meta { font-size: .76rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-date { font-size: .74rem; font-weight: 600; color: var(--success); }
.done-actions { display: flex; flex-wrap: wrap; gap: 0; margin: 4px -8px -4px; }
.done-actions .btn { padding: 5px 8px; font-size: .78rem; }
.q-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.q-dots span { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width .2s, background .2s; }
.q-dots span.on { width: 20px; background: var(--accent); }

.quote-card {
  margin: 0; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  padding: 16px 18px 8px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--ac, var(--accent));
}
.quote-card::before {
  content: "“"; position: absolute; right: 14px; top: -6px; font-family: var(--serif); font-size: 4rem; line-height: 1;
  color: var(--accent); opacity: .35; pointer-events: none;
}
.quote-card blockquote {
  margin: 0; padding-right: 24px; font-family: var(--serif); font-style: italic; font-size: 1.02rem; line-height: 1.55; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.quote-card figcaption { display: flex; flex-direction: column; gap: 2px; }
.q-src { font-size: .82rem; color: var(--ink-soft); }
.q-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -10px; }
#quotes { scroll-margin-top: 80px; }

/* ---------------------------------------------------------------- Kitab rəfi */
.shelf-panel { position: sticky; top: 88px; }
@media (max-width: 980px) { .shelf-panel { position: static; } }
.shelf-panel h2 { font-size: 1.25rem; margin-bottom: 4px; }
.shelf-panel .sub { color: var(--ink-soft); font-size: .88rem; margin: 0 0 14px; }
/* Ağ künc rəfi: isti LED işıqları, gün işığı və bitkilər */
.shelf-scene { position: relative; padding-top: 96px; }
.scene-top { position: absolute; inset: 0 0 auto 0; height: 96px; pointer-events: none; z-index: 6; }
.scene-top .deco-big { position: absolute; left: 4px; bottom: 6px; width: 122px; height: 96px; }
.scene-top .deco-small { position: absolute; right: 26px; bottom: 7px; width: 50px; height: 55px; }
.vine-wrap { position: absolute; transform-origin: top center; animation: sway 7s ease-in-out infinite alternate; }
.vine-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vine-wrap.left { left: -14px; top: 78px; width: 30px; height: 250px; }
.vine-wrap.left2 { left: -4px; top: 82px; width: 22px; height: 100px; animation-duration: 9s; animation-delay: -3s; }
.vine-wrap.right { right: -14px; top: 84px; width: 30px; height: 190px; animation-duration: 8s; animation-delay: -2s; }
.deco-vine.flip { transform: scaleX(-1); }
@keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }

.bookcase {
  position: relative;
  padding: 10px 12px 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e9e2d6, #f8f4ee 6%, #f8f4ee 94%, #e6ded1);
  box-shadow: 0 1px 0 #fff inset, 0 18px 30px -12px rgba(90, 65, 30, .35), 0 2px 6px rgba(90, 65, 30, .12);
}
.bookcase::before { /* üst taxta */
  content: ""; position: absolute; left: -6px; right: -6px; top: -9px; height: 12px; border-radius: 3px;
  background: linear-gradient(180deg, #fffdf9, #ece5d9); box-shadow: 0 2px 4px rgba(90, 65, 30, .18);
}
.bookcase::after { /* döşəmə xalçası / kölgə */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -14px; height: 14px;
  background: radial-gradient(ellipse at 50% 0, rgba(90, 65, 30, .28), transparent 70%);
}
.shelf-row {
  position: relative; height: 152px; padding: 0 12px 0 20px;
  display: flex; align-items: flex-end; gap: 3px;
  /* arxa panel + yuxarıdakı LED zolağından düşən isti işıq */
  background:
    radial-gradient(ellipse 75% 70% at 50% 0%, rgba(255, 205, 120, .55), rgba(255, 214, 150, .18) 55%, transparent 80%),
    linear-gradient(180deg, #efe4d2, #e8dcc8);
  box-shadow: inset 6px 0 10px -6px rgba(90, 65, 30, .25), inset -6px 0 10px -6px rgba(90, 65, 30, .25);
}
.shelf-row::before { /* LED zolağı */
  content: ""; position: absolute; left: 7%; right: 7%; top: 0; height: 3px; border-radius: 3px;
  background: #fff1cf; box-shadow: 0 0 6px 2px rgba(255, 200, 110, .75), 0 0 18px 6px rgba(255, 200, 110, .35);
}
.plank {
  height: 12px; margin: 0 -6px; position: relative; z-index: 2; border-radius: 2px;
  background: linear-gradient(180deg, #ffffff 0, #f6f1e9 55%, #e5ddcf 100%);
  box-shadow: 0 4px 6px -2px rgba(90, 65, 30, .22);
}
.sun-rays {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(118deg, rgba(255, 240, 205, 0) 0 60px, rgba(255, 240, 205, .12) 60px 110px, rgba(255, 240, 205, 0) 110px 200px);
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
  mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
  mix-blend-mode: screen;
}
/* Book nook: kitabların arasında işıqlı kiçik səhnə */
.shelf-row { isolation: isolate; }
.shelf-nook { position: relative; flex: none; width: 64px; height: 132px; margin: 0 6px; }
.shelf-nook.alone { margin-left: 26%; }
.shelf-nook .nook-svg { position: relative; z-index: 1; display: block; width: 64px; height: 132px; overflow: visible;
  filter: drop-shadow(2px 0 3px rgba(40, 25, 10, .35)); }
.shelf-nook::before { /* divara və qonşu kitablara düşən isti işıq */
  content: ""; position: absolute; z-index: -1; left: -46px; right: -46px; top: 10px; bottom: -6px; pointer-events: none;
  background: radial-gradient(ellipse 55% 52% at 45% 52%, color-mix(in srgb, var(--glow) 75%, transparent), color-mix(in srgb, var(--glow) 25%, transparent) 45%, transparent 72%);
  animation: nook-light 2.8s ease-in-out infinite alternate;
}
.shelf-nook::after { /* rəfin üstündə işıq ləkəsi */
  content: ""; position: absolute; z-index: 2; left: -10px; right: -10px; bottom: -4px; height: 8px; pointer-events: none;
  background: radial-gradient(ellipse at 45% 50%, color-mix(in srgb, var(--glow) 55%, transparent), transparent 70%);
}
@keyframes nook-light { from { opacity: .75; } to { opacity: 1; } }
.nook-svg .nk-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: nk-flame 1.1s ease-in-out infinite alternate; }
.nook-svg .nk-glow { animation: nk-glow 1.5s ease-in-out infinite alternate; }
.nook-svg .nk-bulb { animation: nk-bulb 2.4s ease-in-out infinite alternate; }
@keyframes nk-flame { 0% { transform: scale(1, 1) skewX(0); } 45% { transform: scale(.88, 1.14) skewX(4deg); } 100% { transform: scale(1.06, .9) skewX(-3deg); } }
@keyframes nk-glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes nk-bulb { 0% { opacity: 1; } 60% { opacity: .65; } 100% { opacity: .95; } }

.shelf-plant { flex: none; width: 46px; align-self: flex-end; margin-bottom: -1px; }
.shelf-plant.right { margin-left: auto; }
.shelf-plant.left { margin-right: 6px; }
.shelf-plant svg { display: block; width: 46px; height: 60px; overflow: visible; }
.spine {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  width: var(--w, 34px); height: var(--h, 128px); flex: none;
  background: var(--bg);
  color: var(--fg);
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset 3px 0 4px rgba(255,255,255,.14), inset -3px 0 5px rgba(0,0,0,.28), 1px 0 2px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease;
  transform-origin: bottom center;
}
.spine::before, .spine::after { content: ""; position: absolute; left: 3px; right: 3px; height: 3px; background: var(--ac); opacity: .85; }
.spine::before { top: 10px; }
.spine::after { bottom: 10px; }
.spine .s-title {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--serif); font-weight: 600; font-size: 12px; line-height: 1.1;
  max-height: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spine:hover, .spine:focus-visible { transform: translateY(-6px); }
.spine:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.spine.is-new { opacity: 0; }
.spine.settle { animation: settle .5s ease-out; }
@keyframes settle {
  0% { transform: translateY(-10px); }
  60% { transform: translateY(2px); }
  100% { transform: translateY(0); }
}
.shelf-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78%;
  padding: 14px 16px; text-align: center; border-radius: 12px;
  background: rgba(255, 251, 243, .9); box-shadow: var(--shadow-sm);
  color: var(--wood-dark); font-family: var(--serif); font-size: 1.02rem; font-style: italic; z-index: 7; pointer-events: none;
}
.shelf-note { font-size: .8rem; color: var(--ink-faint); margin-top: 12px; text-align: center; }

.flyer {
  position: fixed; z-index: 100; pointer-events: none; margin: 0;
  transform-origin: top left; will-change: transform, opacity;
}

/* ---------------------------------------------------------------- Tooltip */
.tip {
  position: fixed; z-index: 120; pointer-events: none;
  background: var(--ink); color: #fff8ea; font-size: .8rem; padding: 7px 10px; border-radius: 8px;
  max-width: 240px; box-shadow: var(--shadow-md); opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }

/* ---------------------------------------------------------------- Dialoq və bildiriş */
dialog.modal {
  border: 0; border-radius: 16px; padding: 0; max-width: 420px; width: calc(100% - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(40, 25, 10, .35);
}
dialog.modal::backdrop { background: rgba(43, 33, 24, .45); }
.modal-body { padding: 24px 24px 8px; }
.modal-body h2 { font-size: 1.3rem; margin-bottom: 8px; }
.modal-body p { margin: 0; color: var(--ink-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 24px 22px; flex-wrap: wrap; }

.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff8ea;
  padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-md); font-size: .92rem;
  animation: toast-in .25s ease-out;
}
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 4px 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Altlıq */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--ink-faint); font-size: .85rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.loading { padding: 60px 0; text-align: center; color: var(--ink-faint); }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-link { padding: 6px 9px; }
  .profile-btn .pname { display: none; }
  .hero { padding: 24px 0 14px; }
  .search { flex-basis: 100%; }
  .reading-item { grid-template-columns: 70px 1fr; gap: 12px; }
  .done-item { grid-template-columns: 38px 1fr; }
  .done-item .actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Telefonda kiçik düymələr də rahat toxunulsun */
@media (max-width: 640px) {
  .btn-sm { min-height: 36px; }
}

.q-head h2 small { white-space: nowrap; }
@media (max-width: 420px) { .q-head h2 small { display: none; } .q-head h2 { font-size: 1.15rem; } }

/* Alçaq noutbuk ekranları: hero bir az qısalsın ki, kitablar ilk ekranda görünsün */
@media (min-width: 861px) and (max-height: 820px) {
  .hero-wrap { padding-top: 16px; }
  .hero-card { min-height: 360px; }
  .hero-copy { padding: 30px 40px; gap: 14px; }
  .hero-copy h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
}

/* Giriş səhifəsindəki mətn linkləri telefonda rahat toxunulsun */
.auth-card form a, .form-foot a { display: inline-block; padding: 9px 2px; }
.form-foot { margin-top: 8px; }

/* ---------------------------------------------------------------- Bildiriş zəngi */
.header-link[aria-current="page"] { background: var(--surface-2); }
.bell { position: relative; }
.bell-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.bell-btn:hover { background: var(--surface-2); }
.bell-btn[aria-expanded="true"] { background: var(--surface-2); }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #c8452f; color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg); animation: bell-pop .4s cubic-bezier(.3, 1.6, .6, 1);
}
.bell-badge[hidden] { display: none; }
@keyframes bell-pop { from { transform: scale(0); } }
.bell-panel {
  position: absolute; right: -50px; top: calc(100% + 10px); width: min(360px, calc(100vw - 24px)); display: none; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden;
}
.bell-panel.open { display: block; animation: toast-in .18s ease-out; }
.bell-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.bell-list { max-height: min(420px, 70vh); overflow-y: auto; overscroll-behavior: contain; }
.bell-empty { padding: 22px 16px; color: var(--ink-faint); font-size: .88rem; text-align: center; }
.bell-item { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); align-items: flex-start; position: relative; }
.bell-item + .bell-item { border-top: 1px solid var(--line); }
.bell-item:hover { background: var(--surface-2); color: var(--ink); }
.bell-item.unread { background: #fdf3dc; }
.bell-item.unread::after { content: ""; position: absolute; right: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: #c8452f; }
.bn-img { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--wood-dark); overflow: hidden; }
.bn-img.round { border-radius: 50%; object-fit: cover; }
.bn-img.post { background: #e3ece8; color: #2c4741; border-radius: 50%; }
.bn-img.meeting { background: #f6e6c4; color: #a8700f; border-radius: 10px; }
.bn-img.cover-mini { width: 30px; height: 44px; border-radius: 4px; background: none; }
.bn-img.cover-mini .cover { width: 100%; height: 100%; padding: 0; border-radius: 3px; }
.bn-img.cover-mini .cover .c-title, .bn-img.cover-mini .cover .c-author, .bn-img.cover-mini .cover .c-rule { display: none; }
.bn-text { min-width: 0; flex: 1; padding-right: 12px; }
.bn-text strong { display: block; font-size: .88rem; line-height: 1.35; }
.bn-text span { display: block; font-size: .86rem; color: var(--ink-soft); line-height: 1.35; margin-top: 2px; }
.bn-text time { display: block; font-size: .76rem; color: var(--ink-faint); margin-top: 4px; }

/* Yazar avatarı (foto və ya baş hərflər) */
.au-avatar {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--ac, #2c4741); color: #fbf5e8; font-family: var(--serif); font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 2px 6px rgba(40, 25, 10, .2);
}
.au-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 860px) { .hl-cab { display: none; } }
@media (max-width: 640px) {
  .bell-btn { width: 38px; height: 38px; }
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
}
@media (max-width: 420px) { .hl-reg { display: none; } }
@media (max-width: 640px) { .hl-long { display: none; } }
.btn[hidden] { display: none; }

/* ---------------------------------------------------------------- Fırlanan rəf */
.bookcase { touch-action: pan-y; }
/* Rəfin içi: kitablar və dekorlar bir sırada; fırlananda yalnız bu hissə dönür */
.row-items { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; transform-origin: 50% 100%; }
.bookcase.turning .shelf-row { overflow: clip; }
.shelf-turn { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.turn-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .2s, background .15s;
}
.turn-btn:hover:not(:disabled) { background: var(--surface-2); }
.turn-btn[data-turn="1"]:hover:not(:disabled) { transform: rotate(25deg); }
.turn-btn[data-turn="-1"]:hover:not(:disabled) { transform: rotate(-25deg); }
.turn-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.turn-info { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 120px; text-align: center; }
.turn-info span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.shelf-turn.single .turn-info span { font-weight: 500; color: var(--ink-faint); font-size: .76rem; }
.turn-dots { display: flex; gap: 5px; }
.turn-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: width .25s, background .25s; }
.turn-dots i.on { width: 20px; border-radius: 999px; background: var(--accent-strong); }
.shelf-turn.single .turn-dots { display: none; }

/* ---------------------------------------------------------------- Tövsiyə et (kabinet) */
.pick-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink-soft); font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.pick-btn:hover { background: var(--surface-2); color: var(--ink); }
.pick-btn.on { background: #fbe3dc; border-color: #f0c3b6; color: #a3402a; }
.pick-btn.nudge { border-color: var(--accent); color: var(--accent-strong); animation: pick-nudge 1.2s ease-in-out 4; }
@keyframes pick-nudge { 50% { box-shadow: 0 0 0 5px rgba(224, 166, 58, .28); } }
.pick-modal { max-width: 460px; }
.pk-book { display: flex; gap: 14px; align-items: flex-start; }
.pk-book .cover { flex: none; width: 58px; height: 86px; padding: 0; border-radius: 3px 5px 5px 3px; box-shadow: var(--shadow-md); }
.pk-book .cover .c-title, .pk-book .cover .c-author, .pk-book .cover .c-rule { display: none; }
.pk-book p { font-size: .9rem; }
.pk-label { display: block; margin: 18px 0 6px; font-weight: 600; font-size: .9rem; }
.pk-label small { font-weight: 500; color: var(--ink-faint); }
.pk-note {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); font: inherit; font-size: .95rem; color: var(--ink); resize: vertical;
}
.pk-note:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pk-count { text-align: right; font-size: .72rem; color: var(--ink-faint); margin-top: 3px; }
.pk-remove { margin-right: auto; color: var(--danger); }
@media (max-width: 480px) { .pick-modal .modal-actions { flex-wrap: wrap; } .pk-remove { width: 100%; order: 3; } }
@media (prefers-reduced-motion: reduce) { .pick-btn.nudge { animation: none; } }

/* ---------------------------------------------------------------- Google ilə giriş */
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #1f1f1f;
  font-weight: 600; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.btn-google:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-google:disabled { opacity: .6; cursor: wait; transform: none; }
